@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,136 +1,136 @@
|
|
|
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 ProductUpdateSpecificationSchema: z.
|
|
5
|
-
type: z.
|
|
6
|
-
sequence: z.
|
|
7
|
-
status: z.
|
|
8
|
-
published: z.
|
|
9
|
-
tags: z.
|
|
10
|
-
commerce: z.
|
|
11
|
-
pricing: z.
|
|
12
|
-
amount: z.
|
|
13
|
-
maxQuantity: z.
|
|
14
|
-
isTaxable: z.
|
|
15
|
-
isNetPrice: z.
|
|
16
|
-
currencyCode: z.
|
|
17
|
-
countryCode: z.
|
|
4
|
+
export declare const ProductUpdateSpecificationSchema: z.ZodMiniObject<{
|
|
5
|
+
type: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
6
|
+
sequence: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
7
|
+
status: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
8
|
+
published: z.ZodMiniOptional<z.ZodMiniNullable<z.iso.ZodMiniISODateTime>>;
|
|
9
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
10
|
+
commerce: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
11
|
+
pricing: z.ZodMiniArray<z.ZodMiniObject<{
|
|
12
|
+
amount: z.ZodMiniNumber<number>;
|
|
13
|
+
maxQuantity: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
14
|
+
isTaxable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
15
|
+
isNetPrice: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
16
|
+
currencyCode: z.ZodMiniString<string>;
|
|
17
|
+
countryCode: z.ZodMiniString<string>;
|
|
18
18
|
}, z.core.$strip>>;
|
|
19
19
|
}, z.core.$strip>>;
|
|
20
|
-
warehousing: z.
|
|
21
|
-
sku: z.
|
|
22
|
-
baseUnit: z.
|
|
20
|
+
warehousing: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
21
|
+
sku: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
22
|
+
baseUnit: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
23
23
|
}, z.core.$strip>>;
|
|
24
|
-
supply: z.
|
|
25
|
-
weightInGram: z.
|
|
26
|
-
heightInMillimeters: z.
|
|
27
|
-
lengthInMillimeters: z.
|
|
28
|
-
widthInMillimeters: z.
|
|
24
|
+
supply: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
25
|
+
weightInGram: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
26
|
+
heightInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
27
|
+
lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
28
|
+
widthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
29
29
|
}, z.core.$strip>>;
|
|
30
|
-
bundleItems: z.
|
|
31
|
-
productId: z.
|
|
32
|
-
quantity: z.
|
|
33
|
-
configuration: z.
|
|
34
|
-
key: z.
|
|
35
|
-
value: z.
|
|
30
|
+
bundleItems: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
31
|
+
productId: z.ZodMiniString<string>;
|
|
32
|
+
quantity: z.ZodMiniNumber<number>;
|
|
33
|
+
configuration: z.ZodMiniArray<z.ZodMiniObject<{
|
|
34
|
+
key: z.ZodMiniString<string>;
|
|
35
|
+
value: z.ZodMiniString<string>;
|
|
36
36
|
}, z.core.$strip>>;
|
|
37
37
|
}, z.core.$strip>>>;
|
|
38
|
-
meta: z.
|
|
39
|
-
content: z.
|
|
40
|
-
title: z.
|
|
41
|
-
subtitle: z.
|
|
42
|
-
slug: z.
|
|
43
|
-
description: z.
|
|
44
|
-
brand: z.
|
|
45
|
-
vendor: z.
|
|
46
|
-
labels: z.
|
|
38
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
39
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
40
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
41
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
42
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
43
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
44
|
+
brand: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
45
|
+
vendor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
46
|
+
labels: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
47
47
|
}, z.core.$strip>>>;
|
|
48
|
-
variationResolvers: z.
|
|
49
|
-
vector: z.
|
|
50
|
-
productId: z.
|
|
48
|
+
variationResolvers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
49
|
+
vector: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>;
|
|
50
|
+
productId: z.ZodMiniString<string>;
|
|
51
51
|
}, z.core.$strip>>>;
|
|
52
52
|
}, z.core.$strip>;
|
|
53
|
-
export declare const ProductUpdatePayloadSchema: z.
|
|
54
|
-
_id: z.
|
|
55
|
-
specification: z.
|
|
56
|
-
type: z.
|
|
57
|
-
sequence: z.
|
|
58
|
-
status: z.
|
|
59
|
-
published: z.
|
|
60
|
-
tags: z.
|
|
61
|
-
commerce: z.
|
|
62
|
-
pricing: z.
|
|
63
|
-
amount: z.
|
|
64
|
-
maxQuantity: z.
|
|
65
|
-
isTaxable: z.
|
|
66
|
-
isNetPrice: z.
|
|
67
|
-
currencyCode: z.
|
|
68
|
-
countryCode: z.
|
|
53
|
+
export declare const ProductUpdatePayloadSchema: z.ZodMiniObject<{
|
|
54
|
+
_id: z.ZodMiniString<string>;
|
|
55
|
+
specification: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
56
|
+
type: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
57
|
+
sequence: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
58
|
+
status: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
59
|
+
published: z.ZodMiniOptional<z.ZodMiniNullable<z.iso.ZodMiniISODateTime>>;
|
|
60
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
61
|
+
commerce: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
62
|
+
pricing: z.ZodMiniArray<z.ZodMiniObject<{
|
|
63
|
+
amount: z.ZodMiniNumber<number>;
|
|
64
|
+
maxQuantity: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
65
|
+
isTaxable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
66
|
+
isNetPrice: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
67
|
+
currencyCode: z.ZodMiniString<string>;
|
|
68
|
+
countryCode: z.ZodMiniString<string>;
|
|
69
69
|
}, z.core.$strip>>;
|
|
70
70
|
}, z.core.$strip>>;
|
|
71
|
-
warehousing: z.
|
|
72
|
-
sku: z.
|
|
73
|
-
baseUnit: z.
|
|
71
|
+
warehousing: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
72
|
+
sku: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
73
|
+
baseUnit: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
74
74
|
}, z.core.$strip>>;
|
|
75
|
-
supply: z.
|
|
76
|
-
weightInGram: z.
|
|
77
|
-
heightInMillimeters: z.
|
|
78
|
-
lengthInMillimeters: z.
|
|
79
|
-
widthInMillimeters: z.
|
|
75
|
+
supply: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
76
|
+
weightInGram: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
77
|
+
heightInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
78
|
+
lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
79
|
+
widthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
80
80
|
}, z.core.$strip>>;
|
|
81
|
-
bundleItems: z.
|
|
82
|
-
productId: z.
|
|
83
|
-
quantity: z.
|
|
84
|
-
configuration: z.
|
|
85
|
-
key: z.
|
|
86
|
-
value: z.
|
|
81
|
+
bundleItems: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
82
|
+
productId: z.ZodMiniString<string>;
|
|
83
|
+
quantity: z.ZodMiniNumber<number>;
|
|
84
|
+
configuration: z.ZodMiniArray<z.ZodMiniObject<{
|
|
85
|
+
key: z.ZodMiniString<string>;
|
|
86
|
+
value: z.ZodMiniString<string>;
|
|
87
87
|
}, z.core.$strip>>;
|
|
88
88
|
}, z.core.$strip>>>;
|
|
89
|
-
meta: z.
|
|
90
|
-
content: z.
|
|
91
|
-
title: z.
|
|
92
|
-
subtitle: z.
|
|
93
|
-
slug: z.
|
|
94
|
-
description: z.
|
|
95
|
-
brand: z.
|
|
96
|
-
vendor: z.
|
|
97
|
-
labels: z.
|
|
89
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
90
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
91
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
92
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
93
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
94
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
95
|
+
brand: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
96
|
+
vendor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
97
|
+
labels: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
98
98
|
}, z.core.$strip>>>;
|
|
99
|
-
variationResolvers: z.
|
|
100
|
-
vector: z.
|
|
101
|
-
productId: z.
|
|
99
|
+
variationResolvers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
100
|
+
vector: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>;
|
|
101
|
+
productId: z.ZodMiniString<string>;
|
|
102
102
|
}, z.core.$strip>>>;
|
|
103
103
|
}, z.core.$strip>>;
|
|
104
|
-
media: z.
|
|
105
|
-
_id: z.
|
|
106
|
-
asset: z.
|
|
107
|
-
_id: z.
|
|
108
|
-
url: z.
|
|
109
|
-
meta: z.
|
|
110
|
-
fileName: z.
|
|
111
|
-
headers: z.
|
|
104
|
+
media: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
105
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
106
|
+
asset: z.ZodMiniObject<{
|
|
107
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
108
|
+
url: z.ZodMiniString<string>;
|
|
109
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
110
|
+
fileName: z.ZodMiniString<string>;
|
|
111
|
+
headers: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>>;
|
|
112
112
|
}, z.core.$strip>;
|
|
113
|
-
content: z.
|
|
114
|
-
title: z.
|
|
115
|
-
subtitle: z.
|
|
113
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
114
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
115
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
116
116
|
}, z.core.$strip>>>;
|
|
117
|
-
tags: z.
|
|
118
|
-
sortKey: z.
|
|
117
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
118
|
+
sortKey: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
119
119
|
}, z.core.$strip>>>;
|
|
120
|
-
variations: z.
|
|
121
|
-
_id: z.
|
|
122
|
-
key: z.
|
|
123
|
-
type: z.
|
|
124
|
-
options: z.
|
|
125
|
-
value: z.
|
|
126
|
-
content: z.
|
|
127
|
-
title: z.
|
|
128
|
-
subtitle: z.
|
|
120
|
+
variations: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
121
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
122
|
+
key: z.ZodMiniString<string>;
|
|
123
|
+
type: z.ZodMiniString<string>;
|
|
124
|
+
options: z.ZodMiniArray<z.ZodMiniObject<{
|
|
125
|
+
value: z.ZodMiniString<string>;
|
|
126
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
127
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
128
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
129
129
|
}, z.core.$strip>>>;
|
|
130
130
|
}, z.core.$strip>>;
|
|
131
|
-
content: z.
|
|
132
|
-
title: z.
|
|
133
|
-
subtitle: z.
|
|
131
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
132
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
133
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
134
134
|
}, z.core.$strip>>>;
|
|
135
135
|
}, z.core.$strip>>>;
|
|
136
136
|
}, z.core.$strip>;
|
|
@@ -147,87 +147,87 @@ declare function updateProduct(payload: z.infer<typeof ProductUpdatePayloadSchem
|
|
|
147
147
|
success: boolean;
|
|
148
148
|
}>;
|
|
149
149
|
declare namespace updateProduct {
|
|
150
|
-
var payloadSchema: z.
|
|
151
|
-
_id: z.
|
|
152
|
-
specification: z.
|
|
153
|
-
type: z.
|
|
154
|
-
sequence: z.
|
|
155
|
-
status: z.
|
|
156
|
-
published: z.
|
|
157
|
-
tags: z.
|
|
158
|
-
commerce: z.
|
|
159
|
-
pricing: z.
|
|
160
|
-
amount: z.
|
|
161
|
-
maxQuantity: z.
|
|
162
|
-
isTaxable: z.
|
|
163
|
-
isNetPrice: z.
|
|
164
|
-
currencyCode: z.
|
|
165
|
-
countryCode: z.
|
|
150
|
+
var payloadSchema: z.ZodMiniObject<{
|
|
151
|
+
_id: z.ZodMiniString<string>;
|
|
152
|
+
specification: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
153
|
+
type: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
154
|
+
sequence: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
155
|
+
status: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
156
|
+
published: z.ZodMiniOptional<z.ZodMiniNullable<z.iso.ZodMiniISODateTime>>;
|
|
157
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
158
|
+
commerce: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
159
|
+
pricing: z.ZodMiniArray<z.ZodMiniObject<{
|
|
160
|
+
amount: z.ZodMiniNumber<number>;
|
|
161
|
+
maxQuantity: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
162
|
+
isTaxable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
163
|
+
isNetPrice: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
164
|
+
currencyCode: z.ZodMiniString<string>;
|
|
165
|
+
countryCode: z.ZodMiniString<string>;
|
|
166
166
|
}, z.core.$strip>>;
|
|
167
167
|
}, z.core.$strip>>;
|
|
168
|
-
warehousing: z.
|
|
169
|
-
sku: z.
|
|
170
|
-
baseUnit: z.
|
|
168
|
+
warehousing: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
169
|
+
sku: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
170
|
+
baseUnit: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
171
171
|
}, z.core.$strip>>;
|
|
172
|
-
supply: z.
|
|
173
|
-
weightInGram: z.
|
|
174
|
-
heightInMillimeters: z.
|
|
175
|
-
lengthInMillimeters: z.
|
|
176
|
-
widthInMillimeters: z.
|
|
172
|
+
supply: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
173
|
+
weightInGram: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
174
|
+
heightInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
175
|
+
lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
176
|
+
widthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
177
177
|
}, z.core.$strip>>;
|
|
178
|
-
bundleItems: z.
|
|
179
|
-
productId: z.
|
|
180
|
-
quantity: z.
|
|
181
|
-
configuration: z.
|
|
182
|
-
key: z.
|
|
183
|
-
value: z.
|
|
178
|
+
bundleItems: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
179
|
+
productId: z.ZodMiniString<string>;
|
|
180
|
+
quantity: z.ZodMiniNumber<number>;
|
|
181
|
+
configuration: z.ZodMiniArray<z.ZodMiniObject<{
|
|
182
|
+
key: z.ZodMiniString<string>;
|
|
183
|
+
value: z.ZodMiniString<string>;
|
|
184
184
|
}, z.core.$strip>>;
|
|
185
185
|
}, z.core.$strip>>>;
|
|
186
|
-
meta: z.
|
|
187
|
-
content: z.
|
|
188
|
-
title: z.
|
|
189
|
-
subtitle: z.
|
|
190
|
-
slug: z.
|
|
191
|
-
description: z.
|
|
192
|
-
brand: z.
|
|
193
|
-
vendor: z.
|
|
194
|
-
labels: z.
|
|
186
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
187
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
188
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
189
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
190
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
191
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
192
|
+
brand: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
193
|
+
vendor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
194
|
+
labels: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
195
195
|
}, z.core.$strip>>>;
|
|
196
|
-
variationResolvers: z.
|
|
197
|
-
vector: z.
|
|
198
|
-
productId: z.
|
|
196
|
+
variationResolvers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
197
|
+
vector: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>;
|
|
198
|
+
productId: z.ZodMiniString<string>;
|
|
199
199
|
}, z.core.$strip>>>;
|
|
200
200
|
}, z.core.$strip>>;
|
|
201
|
-
media: z.
|
|
202
|
-
_id: z.
|
|
203
|
-
asset: z.
|
|
204
|
-
_id: z.
|
|
205
|
-
url: z.
|
|
206
|
-
meta: z.
|
|
207
|
-
fileName: z.
|
|
208
|
-
headers: z.
|
|
201
|
+
media: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
202
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
203
|
+
asset: z.ZodMiniObject<{
|
|
204
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
205
|
+
url: z.ZodMiniString<string>;
|
|
206
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
207
|
+
fileName: z.ZodMiniString<string>;
|
|
208
|
+
headers: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>>;
|
|
209
209
|
}, z.core.$strip>;
|
|
210
|
-
content: z.
|
|
211
|
-
title: z.
|
|
212
|
-
subtitle: z.
|
|
210
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
211
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
212
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
213
213
|
}, z.core.$strip>>>;
|
|
214
|
-
tags: z.
|
|
215
|
-
sortKey: z.
|
|
214
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
215
|
+
sortKey: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
216
216
|
}, z.core.$strip>>>;
|
|
217
|
-
variations: z.
|
|
218
|
-
_id: z.
|
|
219
|
-
key: z.
|
|
220
|
-
type: z.
|
|
221
|
-
options: z.
|
|
222
|
-
value: z.
|
|
223
|
-
content: z.
|
|
224
|
-
title: z.
|
|
225
|
-
subtitle: z.
|
|
217
|
+
variations: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
218
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
219
|
+
key: z.ZodMiniString<string>;
|
|
220
|
+
type: z.ZodMiniString<string>;
|
|
221
|
+
options: z.ZodMiniArray<z.ZodMiniObject<{
|
|
222
|
+
value: z.ZodMiniString<string>;
|
|
223
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
224
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
225
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
226
226
|
}, z.core.$strip>>>;
|
|
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
232
|
}, z.core.$strip>>>;
|
|
233
233
|
}, z.core.$strip>;
|
|
@@ -1,74 +1,62 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import upsertVariations, { ProductVariationSchema } from "./upsertVariations.js";
|
|
3
3
|
import upsertMedia, { MediaSchema } from "./upsertMedia.js";
|
|
4
4
|
import createProduct, { ProductCreatePayloadSchema } from "./create.js";
|
|
5
5
|
import convertTagsToLowerCase from "../utils/convertTagsToLowerCase.js";
|
|
6
6
|
export const ProductUpdateSpecificationSchema = z.object({
|
|
7
|
-
type: z.
|
|
8
|
-
sequence: z.
|
|
9
|
-
status: z.
|
|
10
|
-
published: z.
|
|
11
|
-
tags: z.array(z.string())
|
|
12
|
-
commerce: z
|
|
13
|
-
.object({
|
|
7
|
+
type: z.optional(z.string()),
|
|
8
|
+
sequence: z.optional(z.number()),
|
|
9
|
+
status: z.nullish(z.string()),
|
|
10
|
+
published: z.nullish(z.iso.datetime()),
|
|
11
|
+
tags: z.optional(z.array(z.string())),
|
|
12
|
+
commerce: z.optional(z.object({
|
|
14
13
|
pricing: z.array(z.object({
|
|
15
14
|
amount: z.number(),
|
|
16
|
-
maxQuantity: z.
|
|
17
|
-
isTaxable: z.
|
|
18
|
-
isNetPrice: z.
|
|
19
|
-
currencyCode: z.string().
|
|
20
|
-
countryCode: z.string().
|
|
15
|
+
maxQuantity: z.optional(z.number()),
|
|
16
|
+
isTaxable: z.optional(z.boolean()),
|
|
17
|
+
isNetPrice: z.optional(z.boolean()),
|
|
18
|
+
currencyCode: z.string().check(z.minLength(1, 'currencyCode is required')),
|
|
19
|
+
countryCode: z.string().check(z.minLength(1, 'countryCode is required')),
|
|
21
20
|
})),
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
.optional(),
|
|
30
|
-
|
|
31
|
-
.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
lengthInMillimeters: z.number().optional(),
|
|
35
|
-
widthInMillimeters: z.number().optional(),
|
|
36
|
-
})
|
|
37
|
-
.optional(),
|
|
38
|
-
bundleItems: z
|
|
39
|
-
.array(z.object({
|
|
21
|
+
})),
|
|
22
|
+
warehousing: z.optional(z.object({
|
|
23
|
+
sku: z.optional(z.string()),
|
|
24
|
+
baseUnit: z.optional(z.string()),
|
|
25
|
+
})),
|
|
26
|
+
supply: z.optional(z.object({
|
|
27
|
+
weightInGram: z.optional(z.number()),
|
|
28
|
+
heightInMillimeters: z.optional(z.number()),
|
|
29
|
+
lengthInMillimeters: z.optional(z.number()),
|
|
30
|
+
widthInMillimeters: z.optional(z.number()),
|
|
31
|
+
})),
|
|
32
|
+
bundleItems: z.optional(z.array(z.object({
|
|
40
33
|
productId: z.string(),
|
|
41
34
|
quantity: z.number(),
|
|
42
35
|
configuration: z.array(z.object({
|
|
43
36
|
key: z.string(),
|
|
44
37
|
value: z.string(),
|
|
45
38
|
})),
|
|
46
|
-
}))
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}))
|
|
59
|
-
.optional(),
|
|
60
|
-
variationResolvers: z
|
|
61
|
-
.array(z.object({
|
|
39
|
+
}))),
|
|
40
|
+
meta: z.optional(z.record(z.any(), z.any())),
|
|
41
|
+
content: z.optional(z.record(z.string(), z.object({
|
|
42
|
+
title: z.optional(z.string()),
|
|
43
|
+
subtitle: z.optional(z.string()),
|
|
44
|
+
slug: z.optional(z.string()),
|
|
45
|
+
description: z.optional(z.string()),
|
|
46
|
+
brand: z.optional(z.string()),
|
|
47
|
+
vendor: z.optional(z.string()),
|
|
48
|
+
labels: z.optional(z.array(z.string())),
|
|
49
|
+
}))),
|
|
50
|
+
variationResolvers: z.optional(z.array(z.object({
|
|
62
51
|
vector: z.record(z.string(), z.any()),
|
|
63
52
|
productId: z.string(),
|
|
64
|
-
}))
|
|
65
|
-
.optional(),
|
|
53
|
+
}))),
|
|
66
54
|
});
|
|
67
55
|
export const ProductUpdatePayloadSchema = z.object({
|
|
68
56
|
_id: z.string(),
|
|
69
|
-
specification:
|
|
70
|
-
media: z.array(MediaSchema)
|
|
71
|
-
variations: z.array(ProductVariationSchema)
|
|
57
|
+
specification: z.optional(ProductUpdateSpecificationSchema),
|
|
58
|
+
media: z.optional(z.array(MediaSchema)),
|
|
59
|
+
variations: z.optional(z.array(ProductVariationSchema)),
|
|
72
60
|
});
|
|
73
61
|
const transformSpecification = (specification) => {
|
|
74
62
|
const { variationResolvers: assignments, content, supply, warehousing, ...productData } = specification;
|
|
@@ -1,21 +1,21 @@
|
|
|
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 MediaSchema: z.
|
|
5
|
-
_id: z.
|
|
6
|
-
asset: z.
|
|
7
|
-
_id: z.
|
|
8
|
-
url: z.
|
|
9
|
-
meta: z.
|
|
10
|
-
fileName: z.
|
|
11
|
-
headers: z.
|
|
4
|
+
export declare const MediaSchema: z.ZodMiniObject<{
|
|
5
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
6
|
+
asset: z.ZodMiniObject<{
|
|
7
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
8
|
+
url: z.ZodMiniString<string>;
|
|
9
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
10
|
+
fileName: z.ZodMiniString<string>;
|
|
11
|
+
headers: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>>;
|
|
12
12
|
}, z.core.$strip>;
|
|
13
|
-
content: z.
|
|
14
|
-
title: z.
|
|
15
|
-
subtitle: z.
|
|
13
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
14
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
15
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
16
16
|
}, z.core.$strip>>>;
|
|
17
|
-
tags: z.
|
|
18
|
-
sortKey: z.
|
|
17
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
18
|
+
sortKey: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
19
19
|
}, z.core.$strip>;
|
|
20
20
|
export default function upsertMedia({ media, productId }: {
|
|
21
21
|
media: z.infer<typeof MediaSchema>[];
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import convertTagsToLowerCase from "../utils/convertTagsToLowerCase.js";
|
|
3
3
|
import upsertAsset, { AssetSchema } from "../../upsertAsset.js";
|
|
4
4
|
export const MediaSchema = z.object({
|
|
5
|
-
_id: z.
|
|
5
|
+
_id: z.optional(z.string()),
|
|
6
6
|
asset: AssetSchema,
|
|
7
|
-
content: z
|
|
8
|
-
.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
tags: z.array(z.string()).optional(),
|
|
14
|
-
sortKey: z.number().optional(),
|
|
7
|
+
content: z.optional(z.record(z.string(), z.object({
|
|
8
|
+
title: z.optional(z.string()),
|
|
9
|
+
subtitle: z.optional(z.string()),
|
|
10
|
+
}))),
|
|
11
|
+
tags: z.optional(z.array(z.string())),
|
|
12
|
+
sortKey: z.optional(z.number()),
|
|
15
13
|
});
|
|
16
14
|
const upsertProductMedia = async (productMedia, { modules }) => {
|
|
17
15
|
try {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/v4-mini';
|
|
2
2
|
import type { Modules } from '../../../modules.ts';
|
|
3
|
-
export declare const ProductVariationSchema: z.
|
|
4
|
-
_id: z.
|
|
5
|
-
key: z.
|
|
6
|
-
type: z.
|
|
7
|
-
options: z.
|
|
8
|
-
value: z.
|
|
9
|
-
content: z.
|
|
10
|
-
title: z.
|
|
11
|
-
subtitle: z.
|
|
3
|
+
export declare const ProductVariationSchema: z.ZodMiniObject<{
|
|
4
|
+
_id: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
5
|
+
key: z.ZodMiniString<string>;
|
|
6
|
+
type: z.ZodMiniString<string>;
|
|
7
|
+
options: z.ZodMiniArray<z.ZodMiniObject<{
|
|
8
|
+
value: z.ZodMiniString<string>;
|
|
9
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
10
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
11
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
12
12
|
}, z.core.$strip>>>;
|
|
13
13
|
}, z.core.$strip>>;
|
|
14
|
-
content: z.
|
|
15
|
-
title: z.
|
|
16
|
-
subtitle: z.
|
|
14
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
15
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
16
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
17
17
|
}, z.core.$strip>>>;
|
|
18
18
|
}, z.core.$strip>;
|
|
19
19
|
export default function upsertVariations({ variations, productId }: {
|