@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.
- package/dist/controllers/AbstractFastifyController.js +0 -0
- package/dist/exports/AbstractExport.js +0 -0
- package/dist/exports/ExportCsv.js +0 -0
- package/dist/exports/ExportJson.js +0 -0
- package/dist/index.js +0 -0
- package/dist/repository/AbstractMongoRepository.js +0 -0
- package/dist/repository/AbstractSqliteRepository.js +0 -0
- package/dist/schemas/PaginateBodySchema.js +20 -0
- package/dist/services/AbstractService.js +0 -0
- package/dist/workers/ExportCsvWorker.js +0 -0
- package/dist/zod/DeleteBodySchema.js +6 -0
- package/dist/zod/IdParamSchema.js +6 -0
- package/dist/zod/PaginateBodySchema.js +20 -0
- package/package.json +6 -6
- package/src/workers/ExportCsvWorker.js +12 -0
- package/test/exports/output_base_test.csv/export_50969507-e285-464e-bdd3-3ed1b1854b2e.csv +2 -0
- package/test/exports/output_object_test.csv/export_ac96f27e-4fb4-44ed-a025-bf03392d761a.csv +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/types/controllers/AbstractFastifyController.d.ts +0 -0
- package/types/controllers/AbstractFastifyController.d.ts.map +0 -0
- package/types/exports/AbstractExport.d.ts +0 -0
- package/types/exports/AbstractExport.d.ts.map +0 -0
- package/types/exports/ExportCsv.d.ts +0 -0
- package/types/exports/ExportCsv.d.ts.map +0 -0
- package/types/exports/ExportJson.d.ts +0 -0
- package/types/exports/ExportJson.d.ts.map +0 -0
- package/types/index.d.ts +0 -0
- package/types/index.d.ts.map +0 -0
- package/types/repository/AbstractMongoRepository.d.ts +0 -0
- package/types/repository/AbstractMongoRepository.d.ts.map +0 -0
- package/types/repository/AbstractSqliteRepository.d.ts +0 -0
- package/types/repository/AbstractSqliteRepository.d.ts.map +0 -0
- package/types/schemas/ExportBodyResponseSchema.d.ts +2 -2
- package/types/schemas/PaginateBodySchema.d.ts +61 -0
- package/types/schemas/PaginateBodySchema.d.ts.map +1 -0
- package/types/services/AbstractService.d.ts +0 -0
- package/types/services/AbstractService.d.ts.map +0 -0
- package/types/workers/ExportCsvWorker.d.ts +0 -0
- package/types/workers/ExportCsvWorker.d.ts.map +0 -0
- package/types/zod/DeleteBodySchema.d.ts +11 -0
- package/types/zod/DeleteBodySchema.d.ts.map +1 -0
- package/types/zod/IdParamSchema.d.ts +11 -0
- package/types/zod/IdParamSchema.d.ts.map +1 -0
- package/types/zod/PaginateBodySchema.d.ts +61 -0
- 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,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.
|
|
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.
|
|
26
|
-
"@drax/common-share": "^0.
|
|
27
|
-
"@drax/identity-share": "^0.
|
|
28
|
-
"@drax/media-back": "^0.
|
|
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": "
|
|
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
|
+
});
|