@unchainedshop/core 4.8.0 → 4.8.1
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/lib/bulk-exporter/createBulkExporter.d.ts +2 -2
- package/lib/bulk-exporter/createBulkExporter.js +2 -2
- package/lib/bulk-exporter/handlers/exportAssortmentsHandler.d.ts +19 -19
- package/lib/bulk-exporter/handlers/exportAssortmentsHandler.js +9 -9
- package/lib/bulk-exporter/handlers/exportFiltersHandler.d.ts +11 -11
- package/lib/bulk-exporter/handlers/exportFiltersHandler.js +5 -5
- package/lib/bulk-exporter/handlers/exportProductsHandler.d.ts +19 -19
- package/lib/bulk-exporter/handlers/exportProductsHandler.js +9 -9
- package/lib/bulk-exporter/handlers/exportUsersHandler.d.ts +17 -17
- package/lib/bulk-exporter/handlers/exportUsersHandler.js +8 -8
- package/lib/bulk-importer/createBulkImporter.d.ts +2 -2
- package/lib/bulk-importer/createBulkImporter.js +4 -2
- package/lib/bulk-importer/handlers/assortment/create.d.ts +87 -87
- package/lib/bulk-importer/handlers/assortment/create.js +13 -15
- package/lib/bulk-importer/handlers/assortment/remove.d.ts +5 -5
- package/lib/bulk-importer/handlers/assortment/remove.js +1 -1
- package/lib/bulk-importer/handlers/assortment/update.d.ts +87 -87
- package/lib/bulk-importer/handlers/assortment/update.js +17 -21
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentChildren.d.ts +7 -7
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentChildren.js +5 -5
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentFilters.d.ts +7 -7
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentFilters.js +5 -5
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentProducts.d.ts +7 -7
- package/lib/bulk-importer/handlers/assortment/upsertAssortmentProducts.js +5 -5
- package/lib/bulk-importer/handlers/assortment/upsertMedia.d.ts +14 -14
- package/lib/bulk-importer/handlers/assortment/upsertMedia.js +8 -10
- package/lib/bulk-importer/handlers/filter/create.d.ts +19 -19
- package/lib/bulk-importer/handlers/filter/create.js +8 -10
- package/lib/bulk-importer/handlers/filter/remove.d.ts +3 -3
- package/lib/bulk-importer/handlers/filter/remove.js +1 -1
- package/lib/bulk-importer/handlers/filter/update.d.ts +19 -19
- package/lib/bulk-importer/handlers/filter/update.js +8 -10
- package/lib/bulk-importer/handlers/product/create.d.ts +175 -175
- package/lib/bulk-importer/handlers/product/create.js +35 -45
- package/lib/bulk-importer/handlers/product/remove.d.ts +5 -5
- package/lib/bulk-importer/handlers/product/remove.js +1 -1
- package/lib/bulk-importer/handlers/product/update.d.ts +175 -175
- package/lib/bulk-importer/handlers/product/update.js +40 -52
- package/lib/bulk-importer/handlers/product/upsertMedia.d.ts +14 -14
- package/lib/bulk-importer/handlers/product/upsertMedia.js +8 -10
- package/lib/bulk-importer/handlers/product/upsertVariations.d.ts +13 -13
- package/lib/bulk-importer/handlers/product/upsertVariations.js +10 -14
- package/lib/bulk-importer/upsertAsset.d.ts +7 -7
- package/lib/bulk-importer/upsertAsset.js +4 -4
- package/package.json +1 -1
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import createFilter from "./create.js";
|
|
3
3
|
export const LocalizedContentSchema = z.record(z.string(), z.object({
|
|
4
|
-
title: z.
|
|
5
|
-
subtitle: z.
|
|
4
|
+
title: z.optional(z.string()),
|
|
5
|
+
subtitle: z.optional(z.string()),
|
|
6
6
|
}));
|
|
7
7
|
export const FilterUpdatePayloadSchema = z.object({
|
|
8
8
|
_id: z.string(),
|
|
9
9
|
specification: z.object({
|
|
10
10
|
type: z.string(),
|
|
11
11
|
key: z.string(),
|
|
12
|
-
isActive: z.
|
|
13
|
-
options: z
|
|
14
|
-
.array(z.object({
|
|
12
|
+
isActive: z.optional(z.boolean()),
|
|
13
|
+
options: z.optional(z.array(z.object({
|
|
15
14
|
value: z.string(),
|
|
16
|
-
content:
|
|
17
|
-
}))
|
|
18
|
-
|
|
19
|
-
meta: z.record(z.any(), z.any()).optional(),
|
|
15
|
+
content: z.optional(LocalizedContentSchema),
|
|
16
|
+
}))),
|
|
17
|
+
meta: z.optional(z.record(z.any(), z.any())),
|
|
20
18
|
content: LocalizedContentSchema,
|
|
21
19
|
}),
|
|
22
20
|
});
|
|
@@ -1,148 +1,148 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import type { Modules } from '../../../modules.ts';
|
|
3
3
|
import type { Services } from '../../../services/index.ts';
|
|
4
|
-
export declare const ProductCreateSpecificationSchema: z.
|
|
5
|
-
type: z.
|
|
4
|
+
export declare const ProductCreateSpecificationSchema: z.ZodMiniObject<{
|
|
5
|
+
type: z.ZodMiniEnum<{
|
|
6
6
|
readonly SIMPLE_PRODUCT: "SIMPLE_PRODUCT";
|
|
7
7
|
readonly CONFIGURABLE_PRODUCT: "CONFIGURABLE_PRODUCT";
|
|
8
8
|
readonly BUNDLE_PRODUCT: "BUNDLE_PRODUCT";
|
|
9
9
|
readonly PLAN_PRODUCT: "PLAN_PRODUCT";
|
|
10
10
|
readonly TOKENIZED_PRODUCT: "TOKENIZED_PRODUCT";
|
|
11
11
|
}>;
|
|
12
|
-
sequence: z.
|
|
13
|
-
status: z.
|
|
14
|
-
published: z.
|
|
15
|
-
tags: z.
|
|
16
|
-
commerce: z.
|
|
17
|
-
pricing: z.
|
|
18
|
-
amount: z.
|
|
19
|
-
maxQuantity: z.
|
|
20
|
-
isTaxable: z.
|
|
21
|
-
isNetPrice: z.
|
|
22
|
-
currencyCode: z.
|
|
23
|
-
countryCode: z.
|
|
12
|
+
sequence: z.ZodMiniNumber<number>;
|
|
13
|
+
status: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
14
|
+
published: z.ZodMiniOptional<z.ZodMiniNullable<z.iso.ZodMiniISODateTime>>;
|
|
15
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
16
|
+
commerce: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
17
|
+
pricing: z.ZodMiniArray<z.ZodMiniObject<{
|
|
18
|
+
amount: z.ZodMiniNumber<number>;
|
|
19
|
+
maxQuantity: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
20
|
+
isTaxable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
21
|
+
isNetPrice: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
22
|
+
currencyCode: z.ZodMiniString<string>;
|
|
23
|
+
countryCode: z.ZodMiniString<string>;
|
|
24
24
|
}, z.core.$strip>>;
|
|
25
25
|
}, z.core.$strip>>;
|
|
26
|
-
warehousing: z.
|
|
27
|
-
sku: z.
|
|
28
|
-
baseUnit: z.
|
|
26
|
+
warehousing: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
27
|
+
sku: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
28
|
+
baseUnit: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
29
29
|
}, z.core.$strip>>;
|
|
30
|
-
supply: z.
|
|
31
|
-
weightInGram: z.
|
|
32
|
-
heightInMillimeters: z.
|
|
33
|
-
lengthInMillimeters: z.
|
|
34
|
-
widthInMillimeters: z.
|
|
30
|
+
supply: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
31
|
+
weightInGram: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
32
|
+
heightInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
33
|
+
lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
34
|
+
widthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
35
35
|
}, z.core.$strip>>;
|
|
36
|
-
bundleItems: z.
|
|
37
|
-
productId: z.
|
|
38
|
-
quantity: z.
|
|
39
|
-
configuration: z.
|
|
40
|
-
key: z.
|
|
41
|
-
value: z.
|
|
36
|
+
bundleItems: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
37
|
+
productId: z.ZodMiniString<string>;
|
|
38
|
+
quantity: z.ZodMiniNumber<number>;
|
|
39
|
+
configuration: z.ZodMiniArray<z.ZodMiniObject<{
|
|
40
|
+
key: z.ZodMiniString<string>;
|
|
41
|
+
value: z.ZodMiniString<string>;
|
|
42
42
|
}, z.core.$strip>>;
|
|
43
43
|
}, z.core.$strip>>>;
|
|
44
|
-
meta: z.
|
|
45
|
-
content: z.
|
|
46
|
-
title: z.
|
|
47
|
-
subtitle: z.
|
|
48
|
-
slug: z.
|
|
49
|
-
description: z.
|
|
50
|
-
brand: z.
|
|
51
|
-
vendor: z.
|
|
52
|
-
labels: z.
|
|
44
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
45
|
+
content: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
46
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
47
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
48
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
49
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
50
|
+
brand: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
51
|
+
vendor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
52
|
+
labels: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
53
53
|
}, z.core.$strip>>;
|
|
54
|
-
variationResolvers: z.
|
|
55
|
-
vector: z.
|
|
56
|
-
productId: z.
|
|
54
|
+
variationResolvers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
55
|
+
vector: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>;
|
|
56
|
+
productId: z.ZodMiniString<string>;
|
|
57
57
|
}, z.core.$strip>>>;
|
|
58
58
|
}, z.core.$strip>;
|
|
59
|
-
export declare const ProductCreatePayloadSchema: z.
|
|
60
|
-
_id: z.
|
|
61
|
-
specification: z.
|
|
62
|
-
type: z.
|
|
59
|
+
export declare const ProductCreatePayloadSchema: z.ZodMiniObject<{
|
|
60
|
+
_id: z.ZodMiniString<string>;
|
|
61
|
+
specification: z.ZodMiniObject<{
|
|
62
|
+
type: z.ZodMiniEnum<{
|
|
63
63
|
readonly SIMPLE_PRODUCT: "SIMPLE_PRODUCT";
|
|
64
64
|
readonly CONFIGURABLE_PRODUCT: "CONFIGURABLE_PRODUCT";
|
|
65
65
|
readonly BUNDLE_PRODUCT: "BUNDLE_PRODUCT";
|
|
66
66
|
readonly PLAN_PRODUCT: "PLAN_PRODUCT";
|
|
67
67
|
readonly TOKENIZED_PRODUCT: "TOKENIZED_PRODUCT";
|
|
68
68
|
}>;
|
|
69
|
-
sequence: z.
|
|
70
|
-
status: z.
|
|
71
|
-
published: z.
|
|
72
|
-
tags: z.
|
|
73
|
-
commerce: z.
|
|
74
|
-
pricing: z.
|
|
75
|
-
amount: z.
|
|
76
|
-
maxQuantity: z.
|
|
77
|
-
isTaxable: z.
|
|
78
|
-
isNetPrice: z.
|
|
79
|
-
currencyCode: z.
|
|
80
|
-
countryCode: z.
|
|
69
|
+
sequence: z.ZodMiniNumber<number>;
|
|
70
|
+
status: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
71
|
+
published: z.ZodMiniOptional<z.ZodMiniNullable<z.iso.ZodMiniISODateTime>>;
|
|
72
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
73
|
+
commerce: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
74
|
+
pricing: z.ZodMiniArray<z.ZodMiniObject<{
|
|
75
|
+
amount: z.ZodMiniNumber<number>;
|
|
76
|
+
maxQuantity: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
77
|
+
isTaxable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
78
|
+
isNetPrice: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
79
|
+
currencyCode: z.ZodMiniString<string>;
|
|
80
|
+
countryCode: z.ZodMiniString<string>;
|
|
81
81
|
}, z.core.$strip>>;
|
|
82
82
|
}, z.core.$strip>>;
|
|
83
|
-
warehousing: z.
|
|
84
|
-
sku: z.
|
|
85
|
-
baseUnit: z.
|
|
83
|
+
warehousing: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
84
|
+
sku: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
85
|
+
baseUnit: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
86
86
|
}, z.core.$strip>>;
|
|
87
|
-
supply: z.
|
|
88
|
-
weightInGram: z.
|
|
89
|
-
heightInMillimeters: z.
|
|
90
|
-
lengthInMillimeters: z.
|
|
91
|
-
widthInMillimeters: z.
|
|
87
|
+
supply: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
88
|
+
weightInGram: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
89
|
+
heightInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
90
|
+
lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
91
|
+
widthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
92
92
|
}, z.core.$strip>>;
|
|
93
|
-
bundleItems: z.
|
|
94
|
-
productId: z.
|
|
95
|
-
quantity: z.
|
|
96
|
-
configuration: z.
|
|
97
|
-
key: z.
|
|
98
|
-
value: z.
|
|
93
|
+
bundleItems: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
94
|
+
productId: z.ZodMiniString<string>;
|
|
95
|
+
quantity: z.ZodMiniNumber<number>;
|
|
96
|
+
configuration: z.ZodMiniArray<z.ZodMiniObject<{
|
|
97
|
+
key: z.ZodMiniString<string>;
|
|
98
|
+
value: z.ZodMiniString<string>;
|
|
99
99
|
}, z.core.$strip>>;
|
|
100
100
|
}, z.core.$strip>>>;
|
|
101
|
-
meta: z.
|
|
102
|
-
content: z.
|
|
103
|
-
title: z.
|
|
104
|
-
subtitle: z.
|
|
105
|
-
slug: z.
|
|
106
|
-
description: z.
|
|
107
|
-
brand: z.
|
|
108
|
-
vendor: z.
|
|
109
|
-
labels: z.
|
|
101
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
102
|
+
content: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
103
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
104
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
105
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
106
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
107
|
+
brand: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
108
|
+
vendor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
109
|
+
labels: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
110
110
|
}, z.core.$strip>>;
|
|
111
|
-
variationResolvers: z.
|
|
112
|
-
vector: z.
|
|
113
|
-
productId: z.
|
|
111
|
+
variationResolvers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
112
|
+
vector: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>;
|
|
113
|
+
productId: z.ZodMiniString<string>;
|
|
114
114
|
}, z.core.$strip>>>;
|
|
115
115
|
}, z.core.$strip>;
|
|
116
|
-
media: z.
|
|
117
|
-
_id: z.
|
|
118
|
-
asset: z.
|
|
119
|
-
_id: z.
|
|
120
|
-
url: z.
|
|
121
|
-
meta: z.
|
|
122
|
-
fileName: z.
|
|
123
|
-
headers: z.
|
|
116
|
+
media: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
117
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
118
|
+
asset: z.ZodMiniObject<{
|
|
119
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
120
|
+
url: z.ZodMiniString<string>;
|
|
121
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
122
|
+
fileName: z.ZodMiniString<string>;
|
|
123
|
+
headers: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>>;
|
|
124
124
|
}, z.core.$strip>;
|
|
125
|
-
content: z.
|
|
126
|
-
title: z.
|
|
127
|
-
subtitle: z.
|
|
125
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
126
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
127
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
128
128
|
}, z.core.$strip>>>;
|
|
129
|
-
tags: z.
|
|
130
|
-
sortKey: z.
|
|
129
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
130
|
+
sortKey: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
131
131
|
}, z.core.$strip>>>;
|
|
132
|
-
variations: z.
|
|
133
|
-
_id: z.
|
|
134
|
-
key: z.
|
|
135
|
-
type: z.
|
|
136
|
-
options: z.
|
|
137
|
-
value: z.
|
|
138
|
-
content: z.
|
|
139
|
-
title: z.
|
|
140
|
-
subtitle: z.
|
|
132
|
+
variations: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
133
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
134
|
+
key: z.ZodMiniString<string>;
|
|
135
|
+
type: z.ZodMiniString<string>;
|
|
136
|
+
options: z.ZodMiniArray<z.ZodMiniObject<{
|
|
137
|
+
value: z.ZodMiniString<string>;
|
|
138
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
139
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
140
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
141
141
|
}, z.core.$strip>>>;
|
|
142
142
|
}, z.core.$strip>>;
|
|
143
|
-
content: z.
|
|
144
|
-
title: z.
|
|
145
|
-
subtitle: z.
|
|
143
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
144
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
145
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
146
146
|
}, z.core.$strip>>>;
|
|
147
147
|
}, z.core.$strip>>>;
|
|
148
148
|
}, z.core.$strip>;
|
|
@@ -159,93 +159,93 @@ declare function createProduct(payload: z.infer<typeof ProductCreatePayloadSchem
|
|
|
159
159
|
success: boolean;
|
|
160
160
|
}>;
|
|
161
161
|
declare namespace createProduct {
|
|
162
|
-
var payloadSchema: z.
|
|
163
|
-
_id: z.
|
|
164
|
-
specification: z.
|
|
165
|
-
type: z.
|
|
162
|
+
var payloadSchema: z.ZodMiniObject<{
|
|
163
|
+
_id: z.ZodMiniString<string>;
|
|
164
|
+
specification: z.ZodMiniObject<{
|
|
165
|
+
type: z.ZodMiniEnum<{
|
|
166
166
|
readonly SIMPLE_PRODUCT: "SIMPLE_PRODUCT";
|
|
167
167
|
readonly CONFIGURABLE_PRODUCT: "CONFIGURABLE_PRODUCT";
|
|
168
168
|
readonly BUNDLE_PRODUCT: "BUNDLE_PRODUCT";
|
|
169
169
|
readonly PLAN_PRODUCT: "PLAN_PRODUCT";
|
|
170
170
|
readonly TOKENIZED_PRODUCT: "TOKENIZED_PRODUCT";
|
|
171
171
|
}>;
|
|
172
|
-
sequence: z.
|
|
173
|
-
status: z.
|
|
174
|
-
published: z.
|
|
175
|
-
tags: z.
|
|
176
|
-
commerce: z.
|
|
177
|
-
pricing: z.
|
|
178
|
-
amount: z.
|
|
179
|
-
maxQuantity: z.
|
|
180
|
-
isTaxable: z.
|
|
181
|
-
isNetPrice: z.
|
|
182
|
-
currencyCode: z.
|
|
183
|
-
countryCode: z.
|
|
172
|
+
sequence: z.ZodMiniNumber<number>;
|
|
173
|
+
status: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
174
|
+
published: z.ZodMiniOptional<z.ZodMiniNullable<z.iso.ZodMiniISODateTime>>;
|
|
175
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
176
|
+
commerce: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
177
|
+
pricing: z.ZodMiniArray<z.ZodMiniObject<{
|
|
178
|
+
amount: z.ZodMiniNumber<number>;
|
|
179
|
+
maxQuantity: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
180
|
+
isTaxable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
181
|
+
isNetPrice: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
182
|
+
currencyCode: z.ZodMiniString<string>;
|
|
183
|
+
countryCode: z.ZodMiniString<string>;
|
|
184
184
|
}, z.core.$strip>>;
|
|
185
185
|
}, z.core.$strip>>;
|
|
186
|
-
warehousing: z.
|
|
187
|
-
sku: z.
|
|
188
|
-
baseUnit: z.
|
|
186
|
+
warehousing: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
187
|
+
sku: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
188
|
+
baseUnit: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
189
189
|
}, z.core.$strip>>;
|
|
190
|
-
supply: z.
|
|
191
|
-
weightInGram: z.
|
|
192
|
-
heightInMillimeters: z.
|
|
193
|
-
lengthInMillimeters: z.
|
|
194
|
-
widthInMillimeters: z.
|
|
190
|
+
supply: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
191
|
+
weightInGram: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
192
|
+
heightInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
193
|
+
lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
194
|
+
widthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
195
195
|
}, z.core.$strip>>;
|
|
196
|
-
bundleItems: z.
|
|
197
|
-
productId: z.
|
|
198
|
-
quantity: z.
|
|
199
|
-
configuration: z.
|
|
200
|
-
key: z.
|
|
201
|
-
value: z.
|
|
196
|
+
bundleItems: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
197
|
+
productId: z.ZodMiniString<string>;
|
|
198
|
+
quantity: z.ZodMiniNumber<number>;
|
|
199
|
+
configuration: z.ZodMiniArray<z.ZodMiniObject<{
|
|
200
|
+
key: z.ZodMiniString<string>;
|
|
201
|
+
value: z.ZodMiniString<string>;
|
|
202
202
|
}, z.core.$strip>>;
|
|
203
203
|
}, z.core.$strip>>>;
|
|
204
|
-
meta: z.
|
|
205
|
-
content: z.
|
|
206
|
-
title: z.
|
|
207
|
-
subtitle: z.
|
|
208
|
-
slug: z.
|
|
209
|
-
description: z.
|
|
210
|
-
brand: z.
|
|
211
|
-
vendor: z.
|
|
212
|
-
labels: z.
|
|
204
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
205
|
+
content: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
206
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
207
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
208
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
209
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
210
|
+
brand: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
211
|
+
vendor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
212
|
+
labels: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
213
213
|
}, z.core.$strip>>;
|
|
214
|
-
variationResolvers: z.
|
|
215
|
-
vector: z.
|
|
216
|
-
productId: z.
|
|
214
|
+
variationResolvers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
215
|
+
vector: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>;
|
|
216
|
+
productId: z.ZodMiniString<string>;
|
|
217
217
|
}, z.core.$strip>>>;
|
|
218
218
|
}, z.core.$strip>;
|
|
219
|
-
media: z.
|
|
220
|
-
_id: z.
|
|
221
|
-
asset: z.
|
|
222
|
-
_id: z.
|
|
223
|
-
url: z.
|
|
224
|
-
meta: z.
|
|
225
|
-
fileName: z.
|
|
226
|
-
headers: z.
|
|
219
|
+
media: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
220
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
221
|
+
asset: z.ZodMiniObject<{
|
|
222
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
223
|
+
url: z.ZodMiniString<string>;
|
|
224
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
225
|
+
fileName: z.ZodMiniString<string>;
|
|
226
|
+
headers: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>>;
|
|
227
227
|
}, z.core.$strip>;
|
|
228
|
-
content: z.
|
|
229
|
-
title: z.
|
|
230
|
-
subtitle: z.
|
|
228
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
229
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
230
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
231
231
|
}, z.core.$strip>>>;
|
|
232
|
-
tags: z.
|
|
233
|
-
sortKey: z.
|
|
232
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
233
|
+
sortKey: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
234
234
|
}, z.core.$strip>>>;
|
|
235
|
-
variations: z.
|
|
236
|
-
_id: z.
|
|
237
|
-
key: z.
|
|
238
|
-
type: z.
|
|
239
|
-
options: z.
|
|
240
|
-
value: z.
|
|
241
|
-
content: z.
|
|
242
|
-
title: z.
|
|
243
|
-
subtitle: z.
|
|
235
|
+
variations: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
236
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
237
|
+
key: z.ZodMiniString<string>;
|
|
238
|
+
type: z.ZodMiniString<string>;
|
|
239
|
+
options: z.ZodMiniArray<z.ZodMiniObject<{
|
|
240
|
+
value: z.ZodMiniString<string>;
|
|
241
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
242
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
243
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
244
244
|
}, z.core.$strip>>>;
|
|
245
245
|
}, z.core.$strip>>;
|
|
246
|
-
content: z.
|
|
247
|
-
title: z.
|
|
248
|
-
subtitle: z.
|
|
246
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
247
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
248
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
249
249
|
}, z.core.$strip>>>;
|
|
250
250
|
}, z.core.$strip>>>;
|
|
251
251
|
}, z.core.$strip>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import upsertVariations, { ProductVariationSchema } from "./upsertVariations.js";
|
|
3
3
|
import upsertMedia from "./upsertMedia.js";
|
|
4
4
|
import { MediaSchema } from "../assortment/upsertMedia.js";
|
|
@@ -7,67 +7,57 @@ import { ProductType } from '@unchainedshop/core-products';
|
|
|
7
7
|
export const ProductCreateSpecificationSchema = z.object({
|
|
8
8
|
type: z.enum(ProductType),
|
|
9
9
|
sequence: z.number(),
|
|
10
|
-
status: z.
|
|
11
|
-
published: z.
|
|
12
|
-
tags: z.array(z.string())
|
|
13
|
-
commerce: z
|
|
14
|
-
.object({
|
|
10
|
+
status: z.nullish(z.string()),
|
|
11
|
+
published: z.nullish(z.iso.datetime()),
|
|
12
|
+
tags: z.optional(z.array(z.string())),
|
|
13
|
+
commerce: z.optional(z.object({
|
|
15
14
|
pricing: z.array(z.object({
|
|
16
15
|
amount: z.number(),
|
|
17
|
-
maxQuantity: z.
|
|
18
|
-
isTaxable: z.
|
|
19
|
-
isNetPrice: z.
|
|
20
|
-
currencyCode: z.string().
|
|
21
|
-
countryCode: z.string().
|
|
16
|
+
maxQuantity: z.optional(z.number()),
|
|
17
|
+
isTaxable: z.optional(z.boolean()),
|
|
18
|
+
isNetPrice: z.optional(z.boolean()),
|
|
19
|
+
currencyCode: z.string().check(z.minLength(1, 'currencyCode is required')),
|
|
20
|
+
countryCode: z.string().check(z.minLength(1, 'countryCode is required')),
|
|
22
21
|
})),
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
.optional(),
|
|
31
|
-
|
|
32
|
-
.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
lengthInMillimeters: z.number().optional(),
|
|
36
|
-
widthInMillimeters: z.number().optional(),
|
|
37
|
-
})
|
|
38
|
-
.optional(),
|
|
39
|
-
bundleItems: z
|
|
40
|
-
.array(z.object({
|
|
22
|
+
})),
|
|
23
|
+
warehousing: z.optional(z.object({
|
|
24
|
+
sku: z.optional(z.string()),
|
|
25
|
+
baseUnit: z.optional(z.string()),
|
|
26
|
+
})),
|
|
27
|
+
supply: z.optional(z.object({
|
|
28
|
+
weightInGram: z.optional(z.number()),
|
|
29
|
+
heightInMillimeters: z.optional(z.number()),
|
|
30
|
+
lengthInMillimeters: z.optional(z.number()),
|
|
31
|
+
widthInMillimeters: z.optional(z.number()),
|
|
32
|
+
})),
|
|
33
|
+
bundleItems: z.optional(z.array(z.object({
|
|
41
34
|
productId: z.string(),
|
|
42
35
|
quantity: z.number(),
|
|
43
36
|
configuration: z.array(z.object({
|
|
44
37
|
key: z.string(),
|
|
45
38
|
value: z.string(),
|
|
46
39
|
})),
|
|
47
|
-
}))
|
|
48
|
-
|
|
49
|
-
meta: z.record(z.any(), z.any()).optional(),
|
|
40
|
+
}))),
|
|
41
|
+
meta: z.optional(z.record(z.any(), z.any())),
|
|
50
42
|
content: z.record(z.string(), z.object({
|
|
51
|
-
title: z.
|
|
52
|
-
subtitle: z.
|
|
53
|
-
slug: z.
|
|
54
|
-
description: z.
|
|
55
|
-
brand: z.
|
|
56
|
-
vendor: z.
|
|
57
|
-
labels: z.array(z.string())
|
|
43
|
+
title: z.optional(z.string()),
|
|
44
|
+
subtitle: z.optional(z.string()),
|
|
45
|
+
slug: z.optional(z.string()),
|
|
46
|
+
description: z.optional(z.string()),
|
|
47
|
+
brand: z.optional(z.string()),
|
|
48
|
+
vendor: z.optional(z.string()),
|
|
49
|
+
labels: z.optional(z.array(z.string())),
|
|
58
50
|
})),
|
|
59
|
-
variationResolvers: z
|
|
60
|
-
.array(z.object({
|
|
51
|
+
variationResolvers: z.optional(z.array(z.object({
|
|
61
52
|
vector: z.record(z.string(), z.any()),
|
|
62
53
|
productId: z.string(),
|
|
63
|
-
}))
|
|
64
|
-
.optional(),
|
|
54
|
+
}))),
|
|
65
55
|
});
|
|
66
56
|
export const ProductCreatePayloadSchema = z.object({
|
|
67
57
|
_id: z.string(),
|
|
68
58
|
specification: ProductCreateSpecificationSchema,
|
|
69
|
-
media: z.array(MediaSchema)
|
|
70
|
-
variations: z.array(ProductVariationSchema)
|
|
59
|
+
media: z.optional(z.array(MediaSchema)),
|
|
60
|
+
variations: z.optional(z.array(ProductVariationSchema)),
|
|
71
61
|
});
|
|
72
62
|
const transformSpecification = (specification) => {
|
|
73
63
|
const { variationResolvers: assignments, content, supply, warehousing, ...productData } = specification;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import type { Modules } from '../../../modules.ts';
|
|
3
3
|
import type { Services } from '../../../services/index.ts';
|
|
4
|
-
export declare const ProductRemovePayloadSchema: z.
|
|
5
|
-
_id: z.
|
|
4
|
+
export declare const ProductRemovePayloadSchema: z.ZodMiniObject<{
|
|
5
|
+
_id: z.ZodMiniString<string>;
|
|
6
6
|
}, z.core.$strip>;
|
|
7
7
|
declare function removeProduct(payload: z.infer<typeof ProductRemovePayloadSchema>, { logger }: {
|
|
8
8
|
logger: any;
|
|
@@ -16,8 +16,8 @@ declare function removeProduct(payload: z.infer<typeof ProductRemovePayloadSchem
|
|
|
16
16
|
success: boolean;
|
|
17
17
|
}>;
|
|
18
18
|
declare namespace removeProduct {
|
|
19
|
-
var payloadSchema: z.
|
|
20
|
-
_id: z.
|
|
19
|
+
var payloadSchema: z.ZodMiniObject<{
|
|
20
|
+
_id: z.ZodMiniString<string>;
|
|
21
21
|
}, z.core.$strip>;
|
|
22
22
|
}
|
|
23
23
|
export default removeProduct;
|