@open-dpp/dto 3.1.4 → 3.3.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/bulk-import/bulk-import-config.dto.d.ts +84 -0
- package/dist/bulk-import/bulk-import-config.dto.d.ts.map +1 -0
- package/dist/bulk-import/bulk-import-config.dto.js +41 -0
- package/dist/bulk-import/bulk-import-parse-result.dto.d.ts +15 -0
- package/dist/bulk-import/bulk-import-parse-result.dto.d.ts.map +1 -0
- package/dist/bulk-import/bulk-import-parse-result.dto.js +15 -0
- package/dist/bulk-import/bulk-import-run-item.dto.d.ts +53 -0
- package/dist/bulk-import/bulk-import-run-item.dto.d.ts.map +1 -0
- package/dist/bulk-import/bulk-import-run-item.dto.js +28 -0
- package/dist/bulk-import/bulk-import-run.dto.d.ts +67 -0
- package/dist/bulk-import/bulk-import-run.dto.d.ts.map +1 -0
- package/dist/bulk-import/bulk-import-run.dto.js +36 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/package.json +1 -1
- package/src/bulk-import/bulk-import-config.dto.ts +56 -0
- package/src/bulk-import/bulk-import-parse-result.dto.ts +17 -0
- package/src/bulk-import/bulk-import-run-item.dto.ts +34 -0
- package/src/bulk-import/bulk-import-run.dto.ts +45 -0
- package/src/index.ts +4 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const FieldMappingDtoSchema: z.ZodObject<{
|
|
3
|
+
input: z.ZodString;
|
|
4
|
+
output: z.ZodString;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type FieldMappingDto = z.infer<typeof FieldMappingDtoSchema>;
|
|
7
|
+
export declare const SubmodelFieldMappingDtoSchema: z.ZodObject<{
|
|
8
|
+
submodelIdShort: z.ZodString;
|
|
9
|
+
fieldMappings: z.ZodArray<z.ZodObject<{
|
|
10
|
+
input: z.ZodString;
|
|
11
|
+
output: z.ZodString;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type SubmodelFieldMappingDto = z.infer<typeof SubmodelFieldMappingDtoSchema>;
|
|
15
|
+
export declare const BulkImportConfigDtoSchema: z.ZodObject<{
|
|
16
|
+
id: z.ZodUUID;
|
|
17
|
+
organizationId: z.ZodString;
|
|
18
|
+
templateId: z.ZodUUID;
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
idField: z.ZodString;
|
|
21
|
+
submodelMappings: z.ZodArray<z.ZodObject<{
|
|
22
|
+
submodelIdShort: z.ZodString;
|
|
23
|
+
fieldMappings: z.ZodArray<z.ZodObject<{
|
|
24
|
+
input: z.ZodString;
|
|
25
|
+
output: z.ZodString;
|
|
26
|
+
}, z.core.$strip>>;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
inputSample: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
29
|
+
createdAt: z.ZodUnion<readonly [z.ZodISODateTime, z.ZodDate]>;
|
|
30
|
+
updatedAt: z.ZodUnion<readonly [z.ZodISODateTime, z.ZodDate]>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
export type BulkImportConfigDto = z.infer<typeof BulkImportConfigDtoSchema>;
|
|
33
|
+
export declare const BulkImportConfigPaginationDtoSchema: z.ZodObject<{
|
|
34
|
+
result: z.ZodArray<z.ZodObject<{
|
|
35
|
+
id: z.ZodUUID;
|
|
36
|
+
organizationId: z.ZodString;
|
|
37
|
+
templateId: z.ZodUUID;
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
idField: z.ZodString;
|
|
40
|
+
submodelMappings: z.ZodArray<z.ZodObject<{
|
|
41
|
+
submodelIdShort: z.ZodString;
|
|
42
|
+
fieldMappings: z.ZodArray<z.ZodObject<{
|
|
43
|
+
input: z.ZodString;
|
|
44
|
+
output: z.ZodString;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
inputSample: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
48
|
+
createdAt: z.ZodUnion<readonly [z.ZodISODateTime, z.ZodDate]>;
|
|
49
|
+
updatedAt: z.ZodUnion<readonly [z.ZodISODateTime, z.ZodDate]>;
|
|
50
|
+
}, z.core.$strip>>;
|
|
51
|
+
paging_metadata: z.ZodObject<{
|
|
52
|
+
cursor: z.ZodNullable<z.ZodString>;
|
|
53
|
+
total_count: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
export type BulkImportConfigPaginationDto = z.infer<typeof BulkImportConfigPaginationDtoSchema>;
|
|
57
|
+
export declare const BulkImportConfigCreateDtoSchema: z.ZodObject<{
|
|
58
|
+
templateId: z.ZodUUID;
|
|
59
|
+
name: z.ZodString;
|
|
60
|
+
idField: z.ZodString;
|
|
61
|
+
submodelMappings: z.ZodArray<z.ZodObject<{
|
|
62
|
+
submodelIdShort: z.ZodString;
|
|
63
|
+
fieldMappings: z.ZodArray<z.ZodObject<{
|
|
64
|
+
input: z.ZodString;
|
|
65
|
+
output: z.ZodString;
|
|
66
|
+
}, z.core.$strip>>;
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
inputSample: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
export type BulkImportConfigCreateDto = z.input<typeof BulkImportConfigCreateDtoSchema>;
|
|
71
|
+
export declare const BulkImportConfigUpdateDtoSchema: z.ZodObject<{
|
|
72
|
+
name: z.ZodString;
|
|
73
|
+
idField: z.ZodString;
|
|
74
|
+
submodelMappings: z.ZodArray<z.ZodObject<{
|
|
75
|
+
submodelIdShort: z.ZodString;
|
|
76
|
+
fieldMappings: z.ZodArray<z.ZodObject<{
|
|
77
|
+
input: z.ZodString;
|
|
78
|
+
output: z.ZodString;
|
|
79
|
+
}, z.core.$strip>>;
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
inputSample: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
export type BulkImportConfigUpdateDto = z.input<typeof BulkImportConfigUpdateDtoSchema>;
|
|
84
|
+
//# sourceMappingURL=bulk-import-config.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulk-import-config.dto.d.ts","sourceRoot":"","sources":["../../src/bulk-import/bulk-import-config.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,qBAAqB;;;iBAGhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,6BAA6B;;;;;;iBAGxC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;iBAUpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;iBAKZ,CAAC;AAErC,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG,eAAO,MAAM,+BAA+B;;;;;;;;;;;;iBAM1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,eAAO,MAAM,+BAA+B;;;;;;;;;;;iBAE1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BulkImportConfigUpdateDtoSchema = exports.BulkImportConfigCreateDtoSchema = exports.BulkImportConfigPaginationDtoSchema = exports.BulkImportConfigDtoSchema = exports.SubmodelFieldMappingDtoSchema = exports.FieldMappingDtoSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const digital_product_document_schemas_1 = require("../digital-product-document/digital-product-document.schemas");
|
|
6
|
+
const pagination_dto_1 = require("../shared/pagination.dto");
|
|
7
|
+
exports.FieldMappingDtoSchema = zod_1.z.object({
|
|
8
|
+
input: zod_1.z.string(),
|
|
9
|
+
output: zod_1.z.string(),
|
|
10
|
+
});
|
|
11
|
+
exports.SubmodelFieldMappingDtoSchema = zod_1.z.object({
|
|
12
|
+
submodelIdShort: zod_1.z.string(),
|
|
13
|
+
fieldMappings: exports.FieldMappingDtoSchema.array(),
|
|
14
|
+
});
|
|
15
|
+
exports.BulkImportConfigDtoSchema = zod_1.z.object({
|
|
16
|
+
id: zod_1.z.uuid(),
|
|
17
|
+
organizationId: zod_1.z.string(),
|
|
18
|
+
templateId: zod_1.z.uuid(),
|
|
19
|
+
name: zod_1.z.string(),
|
|
20
|
+
idField: zod_1.z.string(),
|
|
21
|
+
submodelMappings: exports.SubmodelFieldMappingDtoSchema.array(),
|
|
22
|
+
inputSample: zod_1.z.record(zod_1.z.string(), zod_1.z.any()).nullish(),
|
|
23
|
+
createdAt: digital_product_document_schemas_1.DateTimeSchema,
|
|
24
|
+
updatedAt: digital_product_document_schemas_1.DateTimeSchema,
|
|
25
|
+
});
|
|
26
|
+
exports.BulkImportConfigPaginationDtoSchema = zod_1.z
|
|
27
|
+
.object({
|
|
28
|
+
...pagination_dto_1.PagingMetadataDtoSchema.shape,
|
|
29
|
+
result: exports.BulkImportConfigDtoSchema.array(),
|
|
30
|
+
})
|
|
31
|
+
.meta({ id: "BulkImportConfigs" });
|
|
32
|
+
exports.BulkImportConfigCreateDtoSchema = zod_1.z.object({
|
|
33
|
+
templateId: zod_1.z.uuid(),
|
|
34
|
+
name: zod_1.z.string(),
|
|
35
|
+
idField: zod_1.z.string(),
|
|
36
|
+
submodelMappings: exports.SubmodelFieldMappingDtoSchema.array(),
|
|
37
|
+
inputSample: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).nullish(),
|
|
38
|
+
});
|
|
39
|
+
exports.BulkImportConfigUpdateDtoSchema = exports.BulkImportConfigCreateDtoSchema.omit({
|
|
40
|
+
templateId: true,
|
|
41
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Schema for a single row in the parsed file.
|
|
4
|
+
* Keys are column headers from the first row, values are strings or null.
|
|
5
|
+
*/
|
|
6
|
+
export declare const BulkImportRowDtoSchema: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
7
|
+
export type BulkImportRowDto = z.infer<typeof BulkImportRowDtoSchema>;
|
|
8
|
+
/**
|
|
9
|
+
* Result of parsing a bulk import file (CSV, Excel).
|
|
10
|
+
*/
|
|
11
|
+
export declare const BulkImportParseResultDtoSchema: z.ZodObject<{
|
|
12
|
+
rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export type BulkImportParseResultDto = z.infer<typeof BulkImportParseResultDtoSchema>;
|
|
15
|
+
//# sourceMappingURL=bulk-import-parse-result.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulk-import-parse-result.dto.d.ts","sourceRoot":"","sources":["../../src/bulk-import/bulk-import-parse-result.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,sBAAsB,oCAAgC,CAAC;AACpE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,8BAA8B;;iBAEzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BulkImportParseResultDtoSchema = exports.BulkImportRowDtoSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Schema for a single row in the parsed file.
|
|
7
|
+
* Keys are column headers from the first row, values are strings or null.
|
|
8
|
+
*/
|
|
9
|
+
exports.BulkImportRowDtoSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.any());
|
|
10
|
+
/**
|
|
11
|
+
* Result of parsing a bulk import file (CSV, Excel).
|
|
12
|
+
*/
|
|
13
|
+
exports.BulkImportParseResultDtoSchema = zod_1.z.object({
|
|
14
|
+
rows: exports.BulkImportRowDtoSchema.array().min(1).max(1000),
|
|
15
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const BulkImportRunItemStatusDto: {
|
|
3
|
+
readonly Pending: "pending";
|
|
4
|
+
readonly Created: "created";
|
|
5
|
+
readonly Updated: "updated";
|
|
6
|
+
readonly Failed: "failed";
|
|
7
|
+
};
|
|
8
|
+
export declare const BulkImportRunItemStatusDtoEnum: z.ZodEnum<{
|
|
9
|
+
readonly Pending: "pending";
|
|
10
|
+
readonly Created: "created";
|
|
11
|
+
readonly Updated: "updated";
|
|
12
|
+
readonly Failed: "failed";
|
|
13
|
+
}>;
|
|
14
|
+
export type BulkImportRunItemStatusDtoType = z.infer<typeof BulkImportRunItemStatusDtoEnum>;
|
|
15
|
+
export declare const BulkImportRunItemDtoSchema: z.ZodObject<{
|
|
16
|
+
id: z.ZodUUID;
|
|
17
|
+
runId: z.ZodString;
|
|
18
|
+
rowIndex: z.ZodNumber;
|
|
19
|
+
inputData: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
20
|
+
status: z.ZodEnum<{
|
|
21
|
+
readonly Pending: "pending";
|
|
22
|
+
readonly Created: "created";
|
|
23
|
+
readonly Updated: "updated";
|
|
24
|
+
readonly Failed: "failed";
|
|
25
|
+
}>;
|
|
26
|
+
externalId: z.ZodNullable<z.ZodString>;
|
|
27
|
+
passportId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export type BulkImportRunItemDto = z.infer<typeof BulkImportRunItemDtoSchema>;
|
|
31
|
+
export declare const BulkImportRunItemPaginationDtoSchema: z.ZodObject<{
|
|
32
|
+
result: z.ZodArray<z.ZodObject<{
|
|
33
|
+
id: z.ZodUUID;
|
|
34
|
+
runId: z.ZodString;
|
|
35
|
+
rowIndex: z.ZodNumber;
|
|
36
|
+
inputData: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
37
|
+
status: z.ZodEnum<{
|
|
38
|
+
readonly Pending: "pending";
|
|
39
|
+
readonly Created: "created";
|
|
40
|
+
readonly Updated: "updated";
|
|
41
|
+
readonly Failed: "failed";
|
|
42
|
+
}>;
|
|
43
|
+
externalId: z.ZodNullable<z.ZodString>;
|
|
44
|
+
passportId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
45
|
+
error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
paging_metadata: z.ZodObject<{
|
|
48
|
+
cursor: z.ZodNullable<z.ZodString>;
|
|
49
|
+
total_count: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export type BulkImportRunItemPaginationDto = z.infer<typeof BulkImportRunItemPaginationDtoSchema>;
|
|
53
|
+
//# sourceMappingURL=bulk-import-run-item.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulk-import-run-item.dto.d.ts","sourceRoot":"","sources":["../../src/bulk-import/bulk-import-run-item.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,0BAA0B;;;;;CAK7B,CAAC;AAEX,eAAO,MAAM,8BAA8B;;;;;EAAqC,CAAC;AACjF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAE5F,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;iBASrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;iBAKZ,CAAC;AAEtC,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BulkImportRunItemPaginationDtoSchema = exports.BulkImportRunItemDtoSchema = exports.BulkImportRunItemStatusDtoEnum = exports.BulkImportRunItemStatusDto = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const pagination_dto_1 = require("../shared/pagination.dto");
|
|
6
|
+
exports.BulkImportRunItemStatusDto = {
|
|
7
|
+
Pending: "pending",
|
|
8
|
+
Created: "created",
|
|
9
|
+
Updated: "updated",
|
|
10
|
+
Failed: "failed",
|
|
11
|
+
};
|
|
12
|
+
exports.BulkImportRunItemStatusDtoEnum = zod_1.z.enum(exports.BulkImportRunItemStatusDto);
|
|
13
|
+
exports.BulkImportRunItemDtoSchema = zod_1.z.object({
|
|
14
|
+
id: zod_1.z.uuid(),
|
|
15
|
+
runId: zod_1.z.string(),
|
|
16
|
+
rowIndex: zod_1.z.number(),
|
|
17
|
+
inputData: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
|
|
18
|
+
status: exports.BulkImportRunItemStatusDtoEnum,
|
|
19
|
+
externalId: zod_1.z.string().nullable(),
|
|
20
|
+
passportId: zod_1.z.string().nullish(),
|
|
21
|
+
error: zod_1.z.string().nullish(),
|
|
22
|
+
});
|
|
23
|
+
exports.BulkImportRunItemPaginationDtoSchema = zod_1.z
|
|
24
|
+
.object({
|
|
25
|
+
...pagination_dto_1.PagingMetadataDtoSchema.shape,
|
|
26
|
+
result: exports.BulkImportRunItemDtoSchema.array(),
|
|
27
|
+
})
|
|
28
|
+
.meta({ id: "BulkImportRunItems" });
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const BulkImportRunStatusDto: {
|
|
3
|
+
readonly Pending: "pending";
|
|
4
|
+
readonly Running: "running";
|
|
5
|
+
readonly Completed: "completed";
|
|
6
|
+
readonly CompletedWithErrors: "completed_with_errors";
|
|
7
|
+
readonly Interrupted: "interrupted";
|
|
8
|
+
};
|
|
9
|
+
export declare const BulkImportRunStatusDtoEnum: z.ZodEnum<{
|
|
10
|
+
readonly Pending: "pending";
|
|
11
|
+
readonly Running: "running";
|
|
12
|
+
readonly Completed: "completed";
|
|
13
|
+
readonly CompletedWithErrors: "completed_with_errors";
|
|
14
|
+
readonly Interrupted: "interrupted";
|
|
15
|
+
}>;
|
|
16
|
+
export type BulkImportRunStatusDtoType = z.infer<typeof BulkImportRunStatusDtoEnum>;
|
|
17
|
+
export declare const BulkImportRunDtoSchema: z.ZodObject<{
|
|
18
|
+
id: z.ZodUUID;
|
|
19
|
+
bulkImportConfigId: z.ZodUUID;
|
|
20
|
+
organizationId: z.ZodString;
|
|
21
|
+
status: z.ZodEnum<{
|
|
22
|
+
readonly Pending: "pending";
|
|
23
|
+
readonly Running: "running";
|
|
24
|
+
readonly Completed: "completed";
|
|
25
|
+
readonly CompletedWithErrors: "completed_with_errors";
|
|
26
|
+
readonly Interrupted: "interrupted";
|
|
27
|
+
}>;
|
|
28
|
+
userId: z.ZodString;
|
|
29
|
+
totalCount: z.ZodNumber;
|
|
30
|
+
succeededCount: z.ZodNumber;
|
|
31
|
+
failedCount: z.ZodNumber;
|
|
32
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodDate]>>>;
|
|
33
|
+
finishedAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodDate]>>>;
|
|
34
|
+
createdAt: z.ZodUnion<readonly [z.ZodISODateTime, z.ZodDate]>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
export type BulkImportRunDto = z.infer<typeof BulkImportRunDtoSchema>;
|
|
37
|
+
export declare const BulkImportRunPaginationDtoSchema: z.ZodObject<{
|
|
38
|
+
result: z.ZodArray<z.ZodObject<{
|
|
39
|
+
id: z.ZodUUID;
|
|
40
|
+
bulkImportConfigId: z.ZodUUID;
|
|
41
|
+
organizationId: z.ZodString;
|
|
42
|
+
status: z.ZodEnum<{
|
|
43
|
+
readonly Pending: "pending";
|
|
44
|
+
readonly Running: "running";
|
|
45
|
+
readonly Completed: "completed";
|
|
46
|
+
readonly CompletedWithErrors: "completed_with_errors";
|
|
47
|
+
readonly Interrupted: "interrupted";
|
|
48
|
+
}>;
|
|
49
|
+
userId: z.ZodString;
|
|
50
|
+
totalCount: z.ZodNumber;
|
|
51
|
+
succeededCount: z.ZodNumber;
|
|
52
|
+
failedCount: z.ZodNumber;
|
|
53
|
+
startedAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodDate]>>>;
|
|
54
|
+
finishedAt: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodISODateTime, z.ZodDate]>>>;
|
|
55
|
+
createdAt: z.ZodUnion<readonly [z.ZodISODateTime, z.ZodDate]>;
|
|
56
|
+
}, z.core.$strip>>;
|
|
57
|
+
paging_metadata: z.ZodObject<{
|
|
58
|
+
cursor: z.ZodNullable<z.ZodString>;
|
|
59
|
+
total_count: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
export type BulkImportRunPaginationDto = z.infer<typeof BulkImportRunPaginationDtoSchema>;
|
|
63
|
+
export declare const BulkImportRunCreateDtoSchema: z.ZodObject<{
|
|
64
|
+
rows: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
export type BulkImportRunCreateDto = z.input<typeof BulkImportRunCreateDtoSchema>;
|
|
67
|
+
//# sourceMappingURL=bulk-import-run.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bulk-import-run.dto.d.ts","sourceRoot":"","sources":["../../src/bulk-import/bulk-import-run.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,sBAAsB;;;;;;CAMzB,CAAC;AAEX,eAAO,MAAM,0BAA0B;;;;;;EAAiC,CAAC;AACzE,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEpF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;iBAYjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;iBAKZ,CAAC;AAElC,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F,eAAO,MAAM,4BAA4B;;iBAEvC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BulkImportRunCreateDtoSchema = exports.BulkImportRunPaginationDtoSchema = exports.BulkImportRunDtoSchema = exports.BulkImportRunStatusDtoEnum = exports.BulkImportRunStatusDto = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const digital_product_document_schemas_1 = require("../digital-product-document/digital-product-document.schemas");
|
|
6
|
+
const pagination_dto_1 = require("../shared/pagination.dto");
|
|
7
|
+
exports.BulkImportRunStatusDto = {
|
|
8
|
+
Pending: "pending",
|
|
9
|
+
Running: "running",
|
|
10
|
+
Completed: "completed",
|
|
11
|
+
CompletedWithErrors: "completed_with_errors",
|
|
12
|
+
Interrupted: "interrupted",
|
|
13
|
+
};
|
|
14
|
+
exports.BulkImportRunStatusDtoEnum = zod_1.z.enum(exports.BulkImportRunStatusDto);
|
|
15
|
+
exports.BulkImportRunDtoSchema = zod_1.z.object({
|
|
16
|
+
id: zod_1.z.uuid(),
|
|
17
|
+
bulkImportConfigId: zod_1.z.uuid(),
|
|
18
|
+
organizationId: zod_1.z.string(),
|
|
19
|
+
status: exports.BulkImportRunStatusDtoEnum,
|
|
20
|
+
userId: zod_1.z.string(),
|
|
21
|
+
totalCount: zod_1.z.number(),
|
|
22
|
+
succeededCount: zod_1.z.number(),
|
|
23
|
+
failedCount: zod_1.z.number(),
|
|
24
|
+
startedAt: digital_product_document_schemas_1.DateTimeSchema.nullish(),
|
|
25
|
+
finishedAt: digital_product_document_schemas_1.DateTimeSchema.nullish(),
|
|
26
|
+
createdAt: digital_product_document_schemas_1.DateTimeSchema,
|
|
27
|
+
});
|
|
28
|
+
exports.BulkImportRunPaginationDtoSchema = zod_1.z
|
|
29
|
+
.object({
|
|
30
|
+
...pagination_dto_1.PagingMetadataDtoSchema.shape,
|
|
31
|
+
result: exports.BulkImportRunDtoSchema.array(),
|
|
32
|
+
})
|
|
33
|
+
.meta({ id: "BulkImportRuns" });
|
|
34
|
+
exports.BulkImportRunCreateDtoSchema = zod_1.z.object({
|
|
35
|
+
rows: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).array().min(1).max(1000),
|
|
36
|
+
});
|
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,10 @@ export * from "./unique-product-identifiers/gs1/gs1-ai-table";
|
|
|
61
61
|
export * from "./unique-product-identifiers/gs1/gs1-data-attributes.dto";
|
|
62
62
|
export * from "./unique-product-identifiers/gs1/gs1-digital-link";
|
|
63
63
|
export * from "./unique-product-identifiers/gs1/gs1-identity.dto";
|
|
64
|
+
export * from "./bulk-import/bulk-import-config.dto";
|
|
65
|
+
export * from "./bulk-import/bulk-import-run.dto";
|
|
66
|
+
export * from "./bulk-import/bulk-import-run-item.dto";
|
|
67
|
+
export * from "./bulk-import/bulk-import-parse-result.dto";
|
|
64
68
|
export * from "./organizations/member.dto";
|
|
65
69
|
export * from "./passports/passport.dto";
|
|
66
70
|
export * from "./permalinks/permalink.dto";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8CAA8C,CAAC;AAC7D,cAAc,oCAAoC,CAAC;AACnD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wCAAwC,CAAC;AAEvD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yDAAyD,CAA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AAC;AAC5E,cAAc,mDAAmD,CAAC;AAClE,cAAc,qDAAqD,CAAC;AACpE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0DAA0D,CAAC;AACzE,cAAc,mDAAmD,CAAC;AAClE,cAAc,mDAAmD,CAAC;AAClE,cAAc,sCAAsC,CAAC;AACrD,cAAc,mCAAmC,CAAC;AAClD,cAAc,wCAAwC,CAAC;AACvD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8DAA8D,CAAC;AAC7E,cAAc,6DAA6D,CAAC;AAC5E,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AAEjC,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,uCAAuC,CAAC;AACtD,cAAc,sEAAsE,CAAC;AACrF,cAAc,mEAAmE,CAAC;AAClF,cAAc,4EAA4E,CAAC;AAC3F,cAAc,mEAAmE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -77,6 +77,10 @@ __exportStar(require("./unique-product-identifiers/gs1/gs1-ai-table"), exports);
|
|
|
77
77
|
__exportStar(require("./unique-product-identifiers/gs1/gs1-data-attributes.dto"), exports);
|
|
78
78
|
__exportStar(require("./unique-product-identifiers/gs1/gs1-digital-link"), exports);
|
|
79
79
|
__exportStar(require("./unique-product-identifiers/gs1/gs1-identity.dto"), exports);
|
|
80
|
+
__exportStar(require("./bulk-import/bulk-import-config.dto"), exports);
|
|
81
|
+
__exportStar(require("./bulk-import/bulk-import-run.dto"), exports);
|
|
82
|
+
__exportStar(require("./bulk-import/bulk-import-run-item.dto"), exports);
|
|
83
|
+
__exportStar(require("./bulk-import/bulk-import-parse-result.dto"), exports);
|
|
80
84
|
__exportStar(require("./organizations/member.dto"), exports);
|
|
81
85
|
__exportStar(require("./passports/passport.dto"), exports);
|
|
82
86
|
__exportStar(require("./permalinks/permalink.dto"), exports);
|
package/package.json
CHANGED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DateTimeSchema } from "../digital-product-document/digital-product-document.schemas";
|
|
3
|
+
import { PagingMetadataDtoSchema } from "../shared/pagination.dto";
|
|
4
|
+
|
|
5
|
+
export const FieldMappingDtoSchema = z.object({
|
|
6
|
+
input: z.string(),
|
|
7
|
+
output: z.string(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type FieldMappingDto = z.infer<typeof FieldMappingDtoSchema>;
|
|
11
|
+
|
|
12
|
+
export const SubmodelFieldMappingDtoSchema = z.object({
|
|
13
|
+
submodelIdShort: z.string(),
|
|
14
|
+
fieldMappings: FieldMappingDtoSchema.array(),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type SubmodelFieldMappingDto = z.infer<typeof SubmodelFieldMappingDtoSchema>;
|
|
18
|
+
|
|
19
|
+
export const BulkImportConfigDtoSchema = z.object({
|
|
20
|
+
id: z.uuid(),
|
|
21
|
+
organizationId: z.string(),
|
|
22
|
+
templateId: z.uuid(),
|
|
23
|
+
name: z.string(),
|
|
24
|
+
idField: z.string(),
|
|
25
|
+
submodelMappings: SubmodelFieldMappingDtoSchema.array(),
|
|
26
|
+
inputSample: z.record(z.string(), z.any()).nullish(),
|
|
27
|
+
createdAt: DateTimeSchema,
|
|
28
|
+
updatedAt: DateTimeSchema,
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export type BulkImportConfigDto = z.infer<typeof BulkImportConfigDtoSchema>;
|
|
32
|
+
|
|
33
|
+
export const BulkImportConfigPaginationDtoSchema = z
|
|
34
|
+
.object({
|
|
35
|
+
...PagingMetadataDtoSchema.shape,
|
|
36
|
+
result: BulkImportConfigDtoSchema.array(),
|
|
37
|
+
})
|
|
38
|
+
.meta({ id: "BulkImportConfigs" });
|
|
39
|
+
|
|
40
|
+
export type BulkImportConfigPaginationDto = z.infer<typeof BulkImportConfigPaginationDtoSchema>;
|
|
41
|
+
|
|
42
|
+
export const BulkImportConfigCreateDtoSchema = z.object({
|
|
43
|
+
templateId: z.uuid(),
|
|
44
|
+
name: z.string(),
|
|
45
|
+
idField: z.string(),
|
|
46
|
+
submodelMappings: SubmodelFieldMappingDtoSchema.array(),
|
|
47
|
+
inputSample: z.record(z.string(), z.unknown()).nullish(),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export type BulkImportConfigCreateDto = z.input<typeof BulkImportConfigCreateDtoSchema>;
|
|
51
|
+
|
|
52
|
+
export const BulkImportConfigUpdateDtoSchema = BulkImportConfigCreateDtoSchema.omit({
|
|
53
|
+
templateId: true,
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export type BulkImportConfigUpdateDto = z.input<typeof BulkImportConfigUpdateDtoSchema>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Schema for a single row in the parsed file.
|
|
5
|
+
* Keys are column headers from the first row, values are strings or null.
|
|
6
|
+
*/
|
|
7
|
+
export const BulkImportRowDtoSchema = z.record(z.string(), z.any());
|
|
8
|
+
export type BulkImportRowDto = z.infer<typeof BulkImportRowDtoSchema>;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Result of parsing a bulk import file (CSV, Excel).
|
|
12
|
+
*/
|
|
13
|
+
export const BulkImportParseResultDtoSchema = z.object({
|
|
14
|
+
rows: BulkImportRowDtoSchema.array().min(1).max(1000),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type BulkImportParseResultDto = z.infer<typeof BulkImportParseResultDtoSchema>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { PagingMetadataDtoSchema } from "../shared/pagination.dto";
|
|
3
|
+
|
|
4
|
+
export const BulkImportRunItemStatusDto = {
|
|
5
|
+
Pending: "pending",
|
|
6
|
+
Created: "created",
|
|
7
|
+
Updated: "updated",
|
|
8
|
+
Failed: "failed",
|
|
9
|
+
} as const;
|
|
10
|
+
|
|
11
|
+
export const BulkImportRunItemStatusDtoEnum = z.enum(BulkImportRunItemStatusDto);
|
|
12
|
+
export type BulkImportRunItemStatusDtoType = z.infer<typeof BulkImportRunItemStatusDtoEnum>;
|
|
13
|
+
|
|
14
|
+
export const BulkImportRunItemDtoSchema = z.object({
|
|
15
|
+
id: z.uuid(),
|
|
16
|
+
runId: z.string(),
|
|
17
|
+
rowIndex: z.number(),
|
|
18
|
+
inputData: z.record(z.string(), z.unknown()),
|
|
19
|
+
status: BulkImportRunItemStatusDtoEnum,
|
|
20
|
+
externalId: z.string().nullable(),
|
|
21
|
+
passportId: z.string().nullish(),
|
|
22
|
+
error: z.string().nullish(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export type BulkImportRunItemDto = z.infer<typeof BulkImportRunItemDtoSchema>;
|
|
26
|
+
|
|
27
|
+
export const BulkImportRunItemPaginationDtoSchema = z
|
|
28
|
+
.object({
|
|
29
|
+
...PagingMetadataDtoSchema.shape,
|
|
30
|
+
result: BulkImportRunItemDtoSchema.array(),
|
|
31
|
+
})
|
|
32
|
+
.meta({ id: "BulkImportRunItems" });
|
|
33
|
+
|
|
34
|
+
export type BulkImportRunItemPaginationDto = z.infer<typeof BulkImportRunItemPaginationDtoSchema>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DateTimeSchema } from "../digital-product-document/digital-product-document.schemas";
|
|
3
|
+
import { PagingMetadataDtoSchema } from "../shared/pagination.dto";
|
|
4
|
+
|
|
5
|
+
export const BulkImportRunStatusDto = {
|
|
6
|
+
Pending: "pending",
|
|
7
|
+
Running: "running",
|
|
8
|
+
Completed: "completed",
|
|
9
|
+
CompletedWithErrors: "completed_with_errors",
|
|
10
|
+
Interrupted: "interrupted",
|
|
11
|
+
} as const;
|
|
12
|
+
|
|
13
|
+
export const BulkImportRunStatusDtoEnum = z.enum(BulkImportRunStatusDto);
|
|
14
|
+
export type BulkImportRunStatusDtoType = z.infer<typeof BulkImportRunStatusDtoEnum>;
|
|
15
|
+
|
|
16
|
+
export const BulkImportRunDtoSchema = z.object({
|
|
17
|
+
id: z.uuid(),
|
|
18
|
+
bulkImportConfigId: z.uuid(),
|
|
19
|
+
organizationId: z.string(),
|
|
20
|
+
status: BulkImportRunStatusDtoEnum,
|
|
21
|
+
userId: z.string(),
|
|
22
|
+
totalCount: z.number(),
|
|
23
|
+
succeededCount: z.number(),
|
|
24
|
+
failedCount: z.number(),
|
|
25
|
+
startedAt: DateTimeSchema.nullish(),
|
|
26
|
+
finishedAt: DateTimeSchema.nullish(),
|
|
27
|
+
createdAt: DateTimeSchema,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export type BulkImportRunDto = z.infer<typeof BulkImportRunDtoSchema>;
|
|
31
|
+
|
|
32
|
+
export const BulkImportRunPaginationDtoSchema = z
|
|
33
|
+
.object({
|
|
34
|
+
...PagingMetadataDtoSchema.shape,
|
|
35
|
+
result: BulkImportRunDtoSchema.array(),
|
|
36
|
+
})
|
|
37
|
+
.meta({ id: "BulkImportRuns" });
|
|
38
|
+
|
|
39
|
+
export type BulkImportRunPaginationDto = z.infer<typeof BulkImportRunPaginationDtoSchema>;
|
|
40
|
+
|
|
41
|
+
export const BulkImportRunCreateDtoSchema = z.object({
|
|
42
|
+
rows: z.record(z.string(), z.unknown()).array().min(1).max(1000),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export type BulkImportRunCreateDto = z.input<typeof BulkImportRunCreateDtoSchema>;
|
package/src/index.ts
CHANGED
|
@@ -67,6 +67,10 @@ export * from "./unique-product-identifiers/gs1/gs1-ai-table";
|
|
|
67
67
|
export * from "./unique-product-identifiers/gs1/gs1-data-attributes.dto";
|
|
68
68
|
export * from "./unique-product-identifiers/gs1/gs1-digital-link";
|
|
69
69
|
export * from "./unique-product-identifiers/gs1/gs1-identity.dto";
|
|
70
|
+
export * from "./bulk-import/bulk-import-config.dto";
|
|
71
|
+
export * from "./bulk-import/bulk-import-run.dto";
|
|
72
|
+
export * from "./bulk-import/bulk-import-run-item.dto";
|
|
73
|
+
export * from "./bulk-import/bulk-import-parse-result.dto";
|
|
70
74
|
export * from "./organizations/member.dto";
|
|
71
75
|
export * from "./passports/passport.dto";
|
|
72
76
|
export * from "./permalinks/permalink.dto";
|