{"version":3,"file":"get-count.mjs","names":["formatter"],"sources":["../../../src/services/processed-images/get-count.ts"],"sourcesContent":["import formatter from \"../../libs/formatters/index.js\";\nimport { ProcessedImagesRepository } from \"../../libs/repositories/index.js\";\nimport type { ServiceFn } from \"../../utils/services/types.js\";\n\nconst getCount: ServiceFn<[], number> = async (context) => {\n\tconst ProcessedImages = new ProcessedImagesRepository(\n\t\tcontext.db.client,\n\t\tcontext.config.db,\n\t);\n\n\tconst processedImageCountRes = await ProcessedImages.count({\n\t\tvalidation: { enabled: true },\n\t});\n\tif (processedImageCountRes.error) return processedImageCountRes;\n\n\treturn {\n\t\terror: undefined,\n\t\tdata: formatter.parseCount(processedImageCountRes.data?.count),\n\t};\n};\n\nexport default getCount;\n"],"mappings":"2GAIA,MAAM,EAAkC,KAAO,IAAY,CAM1D,IAAM,EAAyB,MAAM,IALT,EAC3B,EAAQ,GAAG,OACX,EAAQ,OAAO,EAGmC,CAAC,CAAC,MAAM,CAC1D,WAAY,CAAE,QAAS,EAAK,CAC7B,CAAC,EAGD,OAFI,EAAuB,MAAc,EAElC,CACN,MAAO,IAAA,GACP,KAAMA,EAAU,WAAW,EAAuB,MAAM,KAAK,CAC9D,CACD"}