@drax/crud-back 0.33.1 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/controllers/AbstractFastifyController.js +0 -0
  2. package/dist/exports/AbstractExport.js +0 -0
  3. package/dist/exports/ExportCsv.js +0 -0
  4. package/dist/exports/ExportJson.js +0 -0
  5. package/dist/index.js +0 -0
  6. package/dist/repository/AbstractMongoRepository.js +0 -0
  7. package/dist/repository/AbstractSqliteRepository.js +0 -0
  8. package/dist/schemas/PaginateBodySchema.js +20 -0
  9. package/dist/services/AbstractService.js +0 -0
  10. package/dist/workers/ExportCsvWorker.js +0 -0
  11. package/dist/zod/DeleteBodySchema.js +6 -0
  12. package/dist/zod/IdParamSchema.js +6 -0
  13. package/dist/zod/PaginateBodySchema.js +20 -0
  14. package/package.json +6 -6
  15. package/src/workers/ExportCsvWorker.js +12 -0
  16. package/test/exports/output_base_test.csv/export_50969507-e285-464e-bdd3-3ed1b1854b2e.csv +2 -0
  17. package/test/exports/output_object_test.csv/export_ac96f27e-4fb4-44ed-a025-bf03392d761a.csv +2 -0
  18. package/tsconfig.tsbuildinfo +1 -1
  19. package/types/controllers/AbstractFastifyController.d.ts +0 -0
  20. package/types/controllers/AbstractFastifyController.d.ts.map +0 -0
  21. package/types/exports/AbstractExport.d.ts +0 -0
  22. package/types/exports/AbstractExport.d.ts.map +0 -0
  23. package/types/exports/ExportCsv.d.ts +0 -0
  24. package/types/exports/ExportCsv.d.ts.map +0 -0
  25. package/types/exports/ExportJson.d.ts +0 -0
  26. package/types/exports/ExportJson.d.ts.map +0 -0
  27. package/types/index.d.ts +0 -0
  28. package/types/index.d.ts.map +0 -0
  29. package/types/repository/AbstractMongoRepository.d.ts +0 -0
  30. package/types/repository/AbstractMongoRepository.d.ts.map +0 -0
  31. package/types/repository/AbstractSqliteRepository.d.ts +0 -0
  32. package/types/repository/AbstractSqliteRepository.d.ts.map +0 -0
  33. package/types/schemas/ExportBodyResponseSchema.d.ts +2 -2
  34. package/types/schemas/PaginateBodySchema.d.ts +61 -0
  35. package/types/schemas/PaginateBodySchema.d.ts.map +1 -0
  36. package/types/services/AbstractService.d.ts +0 -0
  37. package/types/services/AbstractService.d.ts.map +0 -0
  38. package/types/workers/ExportCsvWorker.d.ts +0 -0
  39. package/types/workers/ExportCsvWorker.d.ts.map +0 -0
  40. package/types/zod/DeleteBodySchema.d.ts +11 -0
  41. package/types/zod/DeleteBodySchema.d.ts.map +1 -0
  42. package/types/zod/IdParamSchema.d.ts +11 -0
  43. package/types/zod/IdParamSchema.d.ts.map +1 -0
  44. package/types/zod/PaginateBodySchema.d.ts +61 -0
  45. package/types/zod/PaginateBodySchema.d.ts.map +1 -0
File without changes
File without changes
File without changes
File without changes
package/dist/index.js CHANGED
File without changes
File without changes
File without changes
@@ -0,0 +1,20 @@
1
+ import z from "zod";
2
+ const PaginateQuerySchema = z.object({
3
+ page: z.number(),
4
+ limit: z.number(),
5
+ orderBy: z.string().optional(),
6
+ order: z.enum(["asc", "desc"]).optional(),
7
+ search: z.string().optional(),
8
+ filters: z.array(z.object({
9
+ field: z.string(),
10
+ operator: z.string(),
11
+ value: z.any(),
12
+ })).optional()
13
+ });
14
+ const PaginateBodyResponseSchema = z.object({
15
+ page: z.number(),
16
+ limit: z.number(),
17
+ total: z.number(),
18
+ items: z.array(z.any())
19
+ });
20
+ export { PaginateQuerySchema, PaginateBodyResponseSchema };
File without changes
File without changes
@@ -0,0 +1,6 @@
1
+ import z from "zod";
2
+ const DeleteBodySchema = z.object({
3
+ message: z.string(),
4
+ });
5
+ export default DeleteBodySchema;
6
+ export { DeleteBodySchema };
@@ -0,0 +1,6 @@
1
+ import z from "zod";
2
+ const IdParamSchema = z.object({
3
+ id: z.string().min(1, "validation.required")
4
+ });
5
+ export default IdParamSchema;
6
+ export { IdParamSchema };
@@ -0,0 +1,20 @@
1
+ import z from "zod";
2
+ const PaginateBodyRequestSchema = z.object({
3
+ page: z.number(),
4
+ limit: z.number(),
5
+ orderBy: z.string().optional(),
6
+ order: z.enum(["asc", "desc"]).optional(),
7
+ search: z.string().optional(),
8
+ filters: z.array(z.object({
9
+ field: z.string(),
10
+ operator: z.string(),
11
+ value: z.any(),
12
+ }))
13
+ });
14
+ const PaginateBodyResponseSchema = z.object({
15
+ page: z.number(),
16
+ limit: z.number(),
17
+ total: z.number(),
18
+ items: z.array(z.any())
19
+ });
20
+ export { PaginateBodyRequestSchema, PaginateBodyResponseSchema };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.33.1",
6
+ "version": "0.34.0",
7
7
  "description": "Crud utils across modules",
8
8
  "main": "dist/index.js",
9
9
  "types": "types/index.d.ts",
@@ -22,10 +22,10 @@
22
22
  "author": "Cristian Incarnato & Drax Team",
23
23
  "license": "ISC",
24
24
  "dependencies": {
25
- "@drax/common-back": "^0.33.0",
26
- "@drax/common-share": "^0.33.0",
27
- "@drax/identity-share": "^0.33.0",
28
- "@drax/media-back": "^0.33.1",
25
+ "@drax/common-back": "^0.34.0",
26
+ "@drax/common-share": "^0.34.0",
27
+ "@drax/identity-share": "^0.34.0",
28
+ "@drax/media-back": "^0.34.0",
29
29
  "@graphql-tools/load-files": "^7.0.0",
30
30
  "@graphql-tools/merge": "^9.0.4",
31
31
  "mongoose": "^8.6.3",
@@ -45,5 +45,5 @@
45
45
  "tsc-alias": "^1.8.10",
46
46
  "typescript": "^5.6.2"
47
47
  },
48
- "gitHead": "bb0468049ef3388a464c991fa170226739a6f2d2"
48
+ "gitHead": "3a121099fcdd0814fd232d90aeac0b2086e2e625"
49
49
  }
@@ -0,0 +1,12 @@
1
+ import { parentPort } from 'worker_threads';
2
+ import ExportCsv from '../exports/ExportCsv.js'; // Ajusta la ruta según sea necesario
3
+
4
+ parentPort.on('message', async (options) => {
5
+ const exporter = new ExportCsv(options);
6
+ try {
7
+ let result = await exporter.process();
8
+ parentPort.postMessage({result: result});
9
+ } catch (error) {
10
+ parentPort.postMessage({error: error.message});
11
+ }
12
+ });
@@ -0,0 +1,2 @@
1
+ name;lastname;address;phones;hobbies
2
+ Cristian;Incarnato;{"street":"Directorio","number":"3935","floor":"6","depto":"c"};[{"number":"1234567","type":"personal"},{"number":"87456123","type":"laboral"}];soccer,gym
@@ -0,0 +1,2 @@
1
+ name;lastname;address.street;address.number
2
+ Cristian;Incarnato;Directorio;3935