@unchainedshop/core 5.0.0-alpha.1 → 5.0.0-alpha.10
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/README.md +92 -546
- package/lib/bulk-exporter/createBulkExporter.js +1 -1
- package/lib/bulk-exporter/handlers/exportProductsHandler.js +2 -2
- package/lib/bulk-importer/handlers/assortment/create.js +1 -3
- package/lib/bulk-importer/handlers/assortment/update.js +1 -1
- package/lib/bulk-importer/handlers/product/create.d.ts +150 -35
- package/lib/bulk-importer/handlers/product/create.js +35 -16
- package/lib/bulk-importer/handlers/product/update.d.ts +78 -36
- package/lib/bulk-importer/handlers/product/update.js +8 -48
- package/lib/core-index.d.ts +1 -2
- package/lib/core-index.js +2 -18
- package/lib/directors/BaseDiscountAdapter.d.ts +3 -0
- package/lib/directors/BaseDiscountDirector.d.ts +2 -2
- package/lib/directors/BaseDiscountDirector.js +7 -9
- package/lib/directors/BasePricingDirector.d.ts +2 -2
- package/lib/directors/BasePricingDirector.js +3 -6
- package/lib/directors/BaseWorker.js +3 -2
- package/lib/directors/DeliveryDirector.d.ts +1 -1
- package/lib/directors/DeliveryDirector.js +2 -12
- package/lib/directors/DeliveryPricingDirector.js +1 -10
- package/lib/directors/EnrollmentAdapter.js +0 -1
- package/lib/directors/EnrollmentDirector.d.ts +1 -1
- package/lib/directors/EnrollmentDirector.js +3 -15
- package/lib/directors/FileDirector.d.ts +4 -4
- package/lib/directors/FileDirector.js +2 -13
- package/lib/directors/FilterDirector.d.ts +1 -1
- package/lib/directors/FilterDirector.js +25 -32
- package/lib/directors/OrderDiscountDirector.d.ts +1 -15
- package/lib/directors/OrderDiscountDirector.js +1 -13
- package/lib/directors/OrderPricingDirector.js +1 -10
- package/lib/directors/OrderPricingSheet.d.ts +1 -0
- package/lib/directors/OrderPricingSheet.js +17 -17
- package/lib/directors/PaymentDirector.d.ts +1 -1
- package/lib/directors/PaymentDirector.js +2 -12
- package/lib/directors/PaymentPricingDirector.js +1 -10
- package/lib/directors/ProductDiscountDirector.d.ts +1 -15
- package/lib/directors/ProductDiscountDirector.js +1 -13
- package/lib/directors/ProductPricingDirector.js +1 -10
- package/lib/directors/QuotationDirector.d.ts +1 -1
- package/lib/directors/QuotationDirector.js +2 -14
- package/lib/directors/WarehousingDirector.js +16 -34
- package/lib/directors/WorkerDirector.d.ts +7 -1
- package/lib/directors/WorkerDirector.js +29 -29
- package/lib/directors/registryDirector.d.ts +2 -0
- package/lib/directors/registryDirector.js +6 -0
- package/lib/errors.d.ts +1 -0
- package/lib/errors.js +5 -0
- package/lib/factory/index.d.ts +12 -1
- package/lib/factory/index.js +12 -1
- package/lib/factory/registerAssortmentSearchFilter.d.ts +2 -1
- package/lib/factory/registerAssortmentSearchFilter.js +6 -3
- package/lib/factory/registerDeliveryPricing.d.ts +7 -0
- package/lib/factory/registerDeliveryPricing.js +30 -0
- package/lib/factory/registerDeliveryProvider.d.ts +12 -0
- package/lib/factory/registerDeliveryProvider.js +46 -0
- package/lib/factory/registerEnrollment.d.ts +18 -0
- package/lib/factory/registerEnrollment.js +43 -0
- package/lib/factory/registerFileAdapter.d.ts +17 -0
- package/lib/factory/registerFileAdapter.js +24 -0
- package/lib/factory/registerOrderDiscount.d.ts +13 -0
- package/lib/factory/registerOrderDiscount.js +39 -0
- package/lib/factory/registerOrderPricing.d.ts +7 -0
- package/lib/factory/registerOrderPricing.js +30 -0
- package/lib/factory/registerPaymentPricing.d.ts +7 -0
- package/lib/factory/registerPaymentPricing.js +30 -0
- package/lib/factory/registerPaymentProvider.d.ts +15 -0
- package/lib/factory/registerPaymentProvider.js +53 -0
- package/lib/factory/registerProductDiscount.d.ts +20 -0
- package/lib/factory/registerProductDiscount.js +47 -0
- package/lib/factory/registerProductDiscoverabilityFilter.d.ts +2 -1
- package/lib/factory/registerProductDiscoverabilityFilter.js +6 -3
- package/lib/factory/registerProductPricing.d.ts +7 -0
- package/lib/factory/registerProductPricing.js +30 -0
- package/lib/factory/registerProductSearchFilter.d.ts +2 -1
- package/lib/factory/registerProductSearchFilter.js +4 -3
- package/lib/factory/registerQuotation.d.ts +12 -0
- package/lib/factory/registerQuotation.js +52 -0
- package/lib/factory/registerVirtualWarehousing.js +1 -1
- package/lib/factory/registerWorker.js +1 -1
- package/lib/plugins/PluginRegistry.d.ts +1 -0
- package/lib/plugins/PluginRegistry.js +11 -2
- package/lib/services/addMultipleCartProducts.js +3 -2
- package/lib/services/bulkAssignProductsToAssortment.d.ts +8 -0
- package/lib/services/bulkAssignProductsToAssortment.js +11 -0
- package/lib/services/bulkDeleteUsers.d.ts +7 -0
- package/lib/services/bulkDeleteUsers.js +11 -0
- package/lib/services/bulkRemoveFilters.d.ts +7 -0
- package/lib/services/bulkRemoveFilters.js +10 -0
- package/lib/services/bulkRemoveProducts.d.ts +7 -0
- package/lib/services/bulkRemoveProducts.js +23 -0
- package/lib/services/bulkSetFilterActive.d.ts +8 -0
- package/lib/services/bulkSetFilterActive.js +12 -0
- package/lib/services/checkoutOrder.js +4 -0
- package/lib/services/createFilter.d.ts +3 -0
- package/lib/services/createFilter.js +6 -0
- package/lib/services/createFilterOption.d.ts +5 -0
- package/lib/services/createFilterOption.js +8 -0
- package/lib/services/createSignedURL.js +2 -1
- package/lib/services/deleteCart.d.ts +2 -0
- package/lib/services/deleteCart.js +7 -0
- package/lib/services/deleteDeadCarts.d.ts +2 -0
- package/lib/services/deleteDeadCarts.js +17 -0
- package/lib/services/deleteUser.js +2 -5
- package/lib/services/index.d.ts +24 -1
- package/lib/services/index.js +24 -1
- package/lib/services/initCartProviders.js +1 -0
- package/lib/services/isTokenInvalidateable.d.ts +3 -1
- package/lib/services/isTokenInvalidateable.js +2 -2
- package/lib/services/loadFilterOptions.js +3 -3
- package/lib/services/processEnrollment.js +2 -1
- package/lib/services/processOrder.js +3 -2
- package/lib/services/processQuotation.js +11 -13
- package/lib/services/proposeQuotation.js +3 -0
- package/lib/services/removeFilterOption.d.ts +6 -0
- package/lib/services/removeFilterOption.js +8 -0
- package/lib/services/removeProduct.js +2 -1
- package/lib/services/reserveOrderDiscountsForCheckout.d.ts +5 -0
- package/lib/services/reserveOrderDiscountsForCheckout.js +34 -0
- package/lib/services/simulateProductDispatching.d.ts +3 -1
- package/lib/services/simulateProductDispatching.js +3 -3
- package/lib/services/simulateProductInventory.d.ts +3 -1
- package/lib/services/simulateProductInventory.js +3 -3
- package/lib/services/supportedDeliveryProviders.js +9 -0
- package/lib/services/supportedPaymentProviders.js +9 -0
- package/lib/services/supportedWarehousingProviders.js +9 -0
- package/lib/services/updateCalculation.js +2 -1
- package/lib/services/updateFilter.d.ts +3 -0
- package/lib/services/updateFilter.js +8 -0
- package/lib/services/uploadFileFromStream.js +2 -1
- package/lib/services/validateOrder.js +7 -8
- package/package.json +29 -23
|
@@ -30,7 +30,7 @@ export default function createBulkExporterFactory(bulkExporterOptions) {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
catch (e) {
|
|
33
|
-
throw new Error(`${type}: ${e.message}
|
|
33
|
+
throw new Error(`${type}: ${e.message}`, { cause: e });
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
execute: async (payload, locales, unchainedApi) => {
|
|
@@ -21,7 +21,7 @@ const PRODUCT_CSV_SCHEMA = {
|
|
|
21
21
|
'countryCode',
|
|
22
22
|
'isTaxable',
|
|
23
23
|
'isNetPrice',
|
|
24
|
-
'
|
|
24
|
+
'minQuantity',
|
|
25
25
|
],
|
|
26
26
|
bundleItemHeaders: ['productId', 'bundleItemProductId', 'quantity', 'configuration'],
|
|
27
27
|
variationItemHeaders: ['productId', 'variationId', 'key', 'type'],
|
|
@@ -77,7 +77,7 @@ const buildPriceRows = (productId, prices = []) => prices.map((p) => ({
|
|
|
77
77
|
isTaxable: p.isTaxable ?? '',
|
|
78
78
|
currencyCode: p.currency?.isoCode ?? '',
|
|
79
79
|
countryCode: p.country?.isoCode ?? '',
|
|
80
|
-
|
|
80
|
+
minQuantity: p.minQuantity ?? '',
|
|
81
81
|
}));
|
|
82
82
|
const buildBundleRows = (productId, bundles = []) => bundles.map((b) => ({
|
|
83
83
|
productId,
|
|
@@ -41,9 +41,7 @@ export default async function createAssortment(payload, { logger, createShouldUp
|
|
|
41
41
|
if (!createShouldUpsertIfIDExists)
|
|
42
42
|
throw e;
|
|
43
43
|
logger.debug('entity already exists, falling back to update', specification);
|
|
44
|
-
await modules.assortments.update(_id, {
|
|
45
|
-
...specification,
|
|
46
|
-
});
|
|
44
|
+
await modules.assortments.update(_id, { ...specification }, { skipInvalidation: true });
|
|
47
45
|
}
|
|
48
46
|
if (!(await modules.assortments.assortmentExists({ assortmentId: _id }))) {
|
|
49
47
|
throw new Error(`Can't create assortment ${_id}, fields missing?`);
|
|
@@ -45,7 +45,7 @@ export default async function updateAssortment(payload, { logger, createShouldUp
|
|
|
45
45
|
if (specification.tags) {
|
|
46
46
|
specification.tags = convertTagsToLowerCase(specification.tags);
|
|
47
47
|
}
|
|
48
|
-
await unchainedAPI.modules.assortments.update(_id, { ...specification });
|
|
48
|
+
await unchainedAPI.modules.assortments.update(_id, { ...specification }, { skipInvalidation: true });
|
|
49
49
|
if (specification.content) {
|
|
50
50
|
logger.debug('replace localized content for assortment', specification.content);
|
|
51
51
|
await modules.assortments.texts.updateTexts(_id, Object.entries(specification.content).map(([locale, localizedData]) => {
|
|
@@ -1,22 +1,39 @@
|
|
|
1
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
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
readonly
|
|
9
|
-
readonly
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
export declare const DateLikeSchema: z.ZodMiniUnion<readonly [z.ZodMiniDate<Date>, z.ZodMiniString<string>]>;
|
|
5
|
+
export declare const ProductTokenizationSchema: z.ZodMiniObject<{
|
|
6
|
+
contractAddress: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
7
|
+
contractStandard: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
8
|
+
readonly ERC721: "ERC721";
|
|
9
|
+
readonly ERC1155: "ERC1155";
|
|
10
|
+
}>>;
|
|
11
|
+
tokenId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
12
|
+
supply: z.ZodMiniOptional<z.ZodMiniInt>;
|
|
13
|
+
ercMetadataProperties: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export declare const ProductContentSchema: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
16
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
17
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
18
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
19
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
20
|
+
brand: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
21
|
+
vendor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
22
|
+
labels: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
export declare const ProductSpecificationFields: {
|
|
12
25
|
sequence: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
13
|
-
status: z.
|
|
14
|
-
|
|
26
|
+
status: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniEnum<{
|
|
27
|
+
readonly DRAFT: "DRAFT";
|
|
28
|
+
readonly ACTIVE: "ACTIVE";
|
|
29
|
+
readonly DELETED: "DELETED";
|
|
30
|
+
}>>>;
|
|
31
|
+
published: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniDate<Date>, z.ZodMiniString<string>]>>>;
|
|
15
32
|
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
16
33
|
commerce: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
17
34
|
pricing: z.ZodMiniArray<z.ZodMiniObject<{
|
|
18
35
|
amount: z.ZodMiniNumber<number>;
|
|
19
|
-
|
|
36
|
+
minQuantity: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
20
37
|
isTaxable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
21
38
|
isNetPrice: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
22
39
|
currencyCode: z.ZodMiniString<string>;
|
|
@@ -33,6 +50,16 @@ export declare const ProductCreateSpecificationSchema: z.ZodMiniObject<{
|
|
|
33
50
|
lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
34
51
|
widthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
35
52
|
}, z.core.$strip>>;
|
|
53
|
+
tokenization: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
54
|
+
contractAddress: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
55
|
+
contractStandard: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
56
|
+
readonly ERC721: "ERC721";
|
|
57
|
+
readonly ERC1155: "ERC1155";
|
|
58
|
+
}>>;
|
|
59
|
+
tokenId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
60
|
+
supply: z.ZodMiniOptional<z.ZodMiniInt>;
|
|
61
|
+
ercMetadataProperties: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>>;
|
|
62
|
+
}, z.core.$strip>>;
|
|
36
63
|
bundleItems: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
37
64
|
productId: z.ZodMiniString<string>;
|
|
38
65
|
quantity: z.ZodMiniNumber<number>;
|
|
@@ -42,6 +69,19 @@ export declare const ProductCreateSpecificationSchema: z.ZodMiniObject<{
|
|
|
42
69
|
}, z.core.$strip>>;
|
|
43
70
|
}, z.core.$strip>>>;
|
|
44
71
|
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
72
|
+
variationResolvers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
73
|
+
vector: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>;
|
|
74
|
+
productId: z.ZodMiniString<string>;
|
|
75
|
+
}, z.core.$strip>>>;
|
|
76
|
+
};
|
|
77
|
+
export declare const ProductCreateSpecificationSchema: z.ZodMiniObject<{
|
|
78
|
+
type: z.ZodMiniEnum<{
|
|
79
|
+
readonly SIMPLE_PRODUCT: "SIMPLE_PRODUCT";
|
|
80
|
+
readonly CONFIGURABLE_PRODUCT: "CONFIGURABLE_PRODUCT";
|
|
81
|
+
readonly BUNDLE_PRODUCT: "BUNDLE_PRODUCT";
|
|
82
|
+
readonly PLAN_PRODUCT: "PLAN_PRODUCT";
|
|
83
|
+
readonly TOKENIZED_PRODUCT: "TOKENIZED_PRODUCT";
|
|
84
|
+
}>;
|
|
45
85
|
content: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
46
86
|
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
47
87
|
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
@@ -51,6 +91,53 @@ export declare const ProductCreateSpecificationSchema: z.ZodMiniObject<{
|
|
|
51
91
|
vendor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
52
92
|
labels: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
53
93
|
}, z.core.$strip>>;
|
|
94
|
+
sequence: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
95
|
+
status: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniEnum<{
|
|
96
|
+
readonly DRAFT: "DRAFT";
|
|
97
|
+
readonly ACTIVE: "ACTIVE";
|
|
98
|
+
readonly DELETED: "DELETED";
|
|
99
|
+
}>>>;
|
|
100
|
+
published: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniDate<Date>, z.ZodMiniString<string>]>>>;
|
|
101
|
+
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
102
|
+
commerce: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
103
|
+
pricing: z.ZodMiniArray<z.ZodMiniObject<{
|
|
104
|
+
amount: z.ZodMiniNumber<number>;
|
|
105
|
+
minQuantity: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
106
|
+
isTaxable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
107
|
+
isNetPrice: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
108
|
+
currencyCode: z.ZodMiniString<string>;
|
|
109
|
+
countryCode: z.ZodMiniString<string>;
|
|
110
|
+
}, z.core.$strip>>;
|
|
111
|
+
}, z.core.$strip>>;
|
|
112
|
+
warehousing: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
113
|
+
sku: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
114
|
+
baseUnit: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
115
|
+
}, z.core.$strip>>;
|
|
116
|
+
supply: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
117
|
+
weightInGram: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
118
|
+
heightInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
119
|
+
lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
120
|
+
widthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
121
|
+
}, z.core.$strip>>;
|
|
122
|
+
tokenization: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
123
|
+
contractAddress: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
124
|
+
contractStandard: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
125
|
+
readonly ERC721: "ERC721";
|
|
126
|
+
readonly ERC1155: "ERC1155";
|
|
127
|
+
}>>;
|
|
128
|
+
tokenId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
129
|
+
supply: z.ZodMiniOptional<z.ZodMiniInt>;
|
|
130
|
+
ercMetadataProperties: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>>;
|
|
131
|
+
}, z.core.$strip>>;
|
|
132
|
+
bundleItems: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
133
|
+
productId: z.ZodMiniString<string>;
|
|
134
|
+
quantity: z.ZodMiniNumber<number>;
|
|
135
|
+
configuration: z.ZodMiniArray<z.ZodMiniObject<{
|
|
136
|
+
key: z.ZodMiniString<string>;
|
|
137
|
+
value: z.ZodMiniString<string>;
|
|
138
|
+
}, z.core.$strip>>;
|
|
139
|
+
}, z.core.$strip>>>;
|
|
140
|
+
meta: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniAny, z.ZodMiniAny>>;
|
|
54
141
|
variationResolvers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
55
142
|
vector: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>;
|
|
56
143
|
productId: z.ZodMiniString<string>;
|
|
@@ -66,14 +153,27 @@ export declare const ProductCreatePayloadSchema: z.ZodMiniObject<{
|
|
|
66
153
|
readonly PLAN_PRODUCT: "PLAN_PRODUCT";
|
|
67
154
|
readonly TOKENIZED_PRODUCT: "TOKENIZED_PRODUCT";
|
|
68
155
|
}>;
|
|
156
|
+
content: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
157
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
158
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
159
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
160
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
161
|
+
brand: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
162
|
+
vendor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
163
|
+
labels: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
164
|
+
}, z.core.$strip>>;
|
|
69
165
|
sequence: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
70
|
-
status: z.
|
|
71
|
-
|
|
166
|
+
status: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniEnum<{
|
|
167
|
+
readonly DRAFT: "DRAFT";
|
|
168
|
+
readonly ACTIVE: "ACTIVE";
|
|
169
|
+
readonly DELETED: "DELETED";
|
|
170
|
+
}>>>;
|
|
171
|
+
published: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniDate<Date>, z.ZodMiniString<string>]>>>;
|
|
72
172
|
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
73
173
|
commerce: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
74
174
|
pricing: z.ZodMiniArray<z.ZodMiniObject<{
|
|
75
175
|
amount: z.ZodMiniNumber<number>;
|
|
76
|
-
|
|
176
|
+
minQuantity: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
77
177
|
isTaxable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
78
178
|
isNetPrice: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
79
179
|
currencyCode: z.ZodMiniString<string>;
|
|
@@ -90,6 +190,16 @@ export declare const ProductCreatePayloadSchema: z.ZodMiniObject<{
|
|
|
90
190
|
lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
91
191
|
widthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
92
192
|
}, z.core.$strip>>;
|
|
193
|
+
tokenization: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
194
|
+
contractAddress: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
195
|
+
contractStandard: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
196
|
+
readonly ERC721: "ERC721";
|
|
197
|
+
readonly ERC1155: "ERC1155";
|
|
198
|
+
}>>;
|
|
199
|
+
tokenId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
200
|
+
supply: z.ZodMiniOptional<z.ZodMiniInt>;
|
|
201
|
+
ercMetadataProperties: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>>;
|
|
202
|
+
}, z.core.$strip>>;
|
|
93
203
|
bundleItems: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
94
204
|
productId: z.ZodMiniString<string>;
|
|
95
205
|
quantity: z.ZodMiniNumber<number>;
|
|
@@ -99,15 +209,6 @@ export declare const ProductCreatePayloadSchema: z.ZodMiniObject<{
|
|
|
99
209
|
}, z.core.$strip>>;
|
|
100
210
|
}, z.core.$strip>>>;
|
|
101
211
|
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
|
-
}, z.core.$strip>>;
|
|
111
212
|
variationResolvers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
112
213
|
vector: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>;
|
|
113
214
|
productId: z.ZodMiniString<string>;
|
|
@@ -169,14 +270,27 @@ declare namespace createProduct {
|
|
|
169
270
|
readonly PLAN_PRODUCT: "PLAN_PRODUCT";
|
|
170
271
|
readonly TOKENIZED_PRODUCT: "TOKENIZED_PRODUCT";
|
|
171
272
|
}>;
|
|
273
|
+
content: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
274
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
275
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
276
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
277
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
278
|
+
brand: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
279
|
+
vendor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
280
|
+
labels: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
281
|
+
}, z.core.$strip>>;
|
|
172
282
|
sequence: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
173
|
-
status: z.
|
|
174
|
-
|
|
283
|
+
status: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniEnum<{
|
|
284
|
+
readonly DRAFT: "DRAFT";
|
|
285
|
+
readonly ACTIVE: "ACTIVE";
|
|
286
|
+
readonly DELETED: "DELETED";
|
|
287
|
+
}>>>;
|
|
288
|
+
published: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniDate<Date>, z.ZodMiniString<string>]>>>;
|
|
175
289
|
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
176
290
|
commerce: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
177
291
|
pricing: z.ZodMiniArray<z.ZodMiniObject<{
|
|
178
292
|
amount: z.ZodMiniNumber<number>;
|
|
179
|
-
|
|
293
|
+
minQuantity: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
180
294
|
isTaxable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
181
295
|
isNetPrice: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
182
296
|
currencyCode: z.ZodMiniString<string>;
|
|
@@ -193,6 +307,16 @@ declare namespace createProduct {
|
|
|
193
307
|
lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
194
308
|
widthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
195
309
|
}, z.core.$strip>>;
|
|
310
|
+
tokenization: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
311
|
+
contractAddress: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
312
|
+
contractStandard: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
313
|
+
readonly ERC721: "ERC721";
|
|
314
|
+
readonly ERC1155: "ERC1155";
|
|
315
|
+
}>>;
|
|
316
|
+
tokenId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
317
|
+
supply: z.ZodMiniOptional<z.ZodMiniInt>;
|
|
318
|
+
ercMetadataProperties: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>>;
|
|
319
|
+
}, z.core.$strip>>;
|
|
196
320
|
bundleItems: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
197
321
|
productId: z.ZodMiniString<string>;
|
|
198
322
|
quantity: z.ZodMiniNumber<number>;
|
|
@@ -202,15 +326,6 @@ declare namespace createProduct {
|
|
|
202
326
|
}, z.core.$strip>>;
|
|
203
327
|
}, z.core.$strip>>>;
|
|
204
328
|
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
|
-
}, z.core.$strip>>;
|
|
214
329
|
variationResolvers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
215
330
|
vector: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>;
|
|
216
331
|
productId: z.ZodMiniString<string>;
|
|
@@ -3,17 +3,36 @@ import upsertVariations, { ProductVariationSchema } from "./upsertVariations.js"
|
|
|
3
3
|
import upsertMedia from "./upsertMedia.js";
|
|
4
4
|
import { MediaSchema } from "../assortment/upsertMedia.js";
|
|
5
5
|
import convertTagsToLowerCase from "../utils/convertTagsToLowerCase.js";
|
|
6
|
-
import { ProductType } from '@unchainedshop/core-products';
|
|
7
|
-
export const
|
|
8
|
-
|
|
6
|
+
import { ProductContractStandard, ProductStatus, ProductType, } from '@unchainedshop/core-products';
|
|
7
|
+
export const DateLikeSchema = z.union([
|
|
8
|
+
z.date(),
|
|
9
|
+
z.string().check(z.refine((value) => !Number.isNaN(new Date(value).getTime()), 'Invalid date')),
|
|
10
|
+
]);
|
|
11
|
+
export const ProductTokenizationSchema = z.object({
|
|
12
|
+
contractAddress: z.optional(z.string()),
|
|
13
|
+
contractStandard: z.optional(z.enum(ProductContractStandard)),
|
|
14
|
+
tokenId: z.optional(z.string()),
|
|
15
|
+
supply: z.optional(z.int().check(z.gte(0))),
|
|
16
|
+
ercMetadataProperties: z.optional(z.record(z.string(), z.any())),
|
|
17
|
+
});
|
|
18
|
+
export const ProductContentSchema = z.record(z.string(), z.object({
|
|
19
|
+
title: z.optional(z.string()),
|
|
20
|
+
subtitle: z.optional(z.string()),
|
|
21
|
+
slug: z.optional(z.string()),
|
|
22
|
+
description: z.optional(z.string()),
|
|
23
|
+
brand: z.optional(z.string()),
|
|
24
|
+
vendor: z.optional(z.string()),
|
|
25
|
+
labels: z.optional(z.array(z.string())),
|
|
26
|
+
}));
|
|
27
|
+
export const ProductSpecificationFields = {
|
|
9
28
|
sequence: z.optional(z.number()),
|
|
10
|
-
status: z.
|
|
11
|
-
published: z.nullish(
|
|
29
|
+
status: z.nullish(z.enum(ProductStatus)),
|
|
30
|
+
published: z.nullish(DateLikeSchema),
|
|
12
31
|
tags: z.optional(z.array(z.string())),
|
|
13
32
|
commerce: z.optional(z.object({
|
|
14
33
|
pricing: z.array(z.object({
|
|
15
34
|
amount: z.number(),
|
|
16
|
-
|
|
35
|
+
minQuantity: z.optional(z.number().check(z.gte(0))),
|
|
17
36
|
isTaxable: z.optional(z.boolean()),
|
|
18
37
|
isNetPrice: z.optional(z.boolean()),
|
|
19
38
|
currencyCode: z.string().check(z.minLength(1, 'currencyCode is required')),
|
|
@@ -30,6 +49,7 @@ export const ProductCreateSpecificationSchema = z.object({
|
|
|
30
49
|
lengthInMillimeters: z.optional(z.number()),
|
|
31
50
|
widthInMillimeters: z.optional(z.number()),
|
|
32
51
|
})),
|
|
52
|
+
tokenization: z.optional(ProductTokenizationSchema),
|
|
33
53
|
bundleItems: z.optional(z.array(z.object({
|
|
34
54
|
productId: z.string(),
|
|
35
55
|
quantity: z.number(),
|
|
@@ -39,19 +59,15 @@ export const ProductCreateSpecificationSchema = z.object({
|
|
|
39
59
|
})),
|
|
40
60
|
}))),
|
|
41
61
|
meta: z.optional(z.record(z.any(), z.any())),
|
|
42
|
-
content: z.record(z.string(), z.object({
|
|
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())),
|
|
50
|
-
})),
|
|
51
62
|
variationResolvers: z.optional(z.array(z.object({
|
|
52
63
|
vector: z.record(z.string(), z.any()),
|
|
53
64
|
productId: z.string(),
|
|
54
65
|
}))),
|
|
66
|
+
};
|
|
67
|
+
export const ProductCreateSpecificationSchema = z.object({
|
|
68
|
+
...ProductSpecificationFields,
|
|
69
|
+
type: z.enum(ProductType),
|
|
70
|
+
content: ProductContentSchema,
|
|
55
71
|
});
|
|
56
72
|
export const ProductCreatePayloadSchema = z.object({
|
|
57
73
|
_id: z.string(),
|
|
@@ -59,14 +75,17 @@ export const ProductCreatePayloadSchema = z.object({
|
|
|
59
75
|
media: z.optional(z.array(MediaSchema)),
|
|
60
76
|
variations: z.optional(z.array(ProductVariationSchema)),
|
|
61
77
|
});
|
|
78
|
+
const normalizeStatus = (status) => (status === ProductStatus.DRAFT ? null : status);
|
|
62
79
|
const transformSpecification = (specification) => {
|
|
63
|
-
const { variationResolvers: assignments, content, supply, warehousing, sequence, ...productData } = specification;
|
|
80
|
+
const { variationResolvers: assignments, content, supply, warehousing, sequence, tokenization, ...productData } = specification;
|
|
64
81
|
const tags = productData?.tags ? convertTagsToLowerCase(productData.tags) : [];
|
|
65
82
|
const proxy = assignments ? { assignments } : undefined;
|
|
66
83
|
return {
|
|
67
84
|
...productData,
|
|
68
85
|
...(sequence != null && { sequence }),
|
|
69
86
|
published: productData.published ? new Date(productData.published) : undefined,
|
|
87
|
+
...(productData.status !== undefined && { status: normalizeStatus(productData.status) }),
|
|
88
|
+
...(tokenization !== undefined && { tokenization: tokenization }),
|
|
70
89
|
tags,
|
|
71
90
|
warehousing,
|
|
72
91
|
supply,
|
|
@@ -3,14 +3,27 @@ import type { Modules } from '../../../modules.ts';
|
|
|
3
3
|
import type { Services } from '../../../services/index.ts';
|
|
4
4
|
export declare const ProductUpdateSpecificationSchema: z.ZodMiniObject<{
|
|
5
5
|
type: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
6
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
7
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
8
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
9
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
10
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
11
|
+
brand: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
12
|
+
vendor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
13
|
+
labels: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
14
|
+
}, z.core.$strip>>>;
|
|
6
15
|
sequence: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
7
|
-
status: z.
|
|
8
|
-
|
|
16
|
+
status: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniEnum<{
|
|
17
|
+
readonly DRAFT: "DRAFT";
|
|
18
|
+
readonly ACTIVE: "ACTIVE";
|
|
19
|
+
readonly DELETED: "DELETED";
|
|
20
|
+
}>>>;
|
|
21
|
+
published: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniDate<Date>, z.ZodMiniString<string>]>>>;
|
|
9
22
|
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
10
23
|
commerce: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
11
24
|
pricing: z.ZodMiniArray<z.ZodMiniObject<{
|
|
12
25
|
amount: z.ZodMiniNumber<number>;
|
|
13
|
-
|
|
26
|
+
minQuantity: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
14
27
|
isTaxable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
15
28
|
isNetPrice: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
16
29
|
currencyCode: z.ZodMiniString<string>;
|
|
@@ -27,6 +40,16 @@ export declare const ProductUpdateSpecificationSchema: z.ZodMiniObject<{
|
|
|
27
40
|
lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
28
41
|
widthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
29
42
|
}, z.core.$strip>>;
|
|
43
|
+
tokenization: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
44
|
+
contractAddress: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
45
|
+
contractStandard: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
46
|
+
readonly ERC721: "ERC721";
|
|
47
|
+
readonly ERC1155: "ERC1155";
|
|
48
|
+
}>>;
|
|
49
|
+
tokenId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
50
|
+
supply: z.ZodMiniOptional<z.ZodMiniInt>;
|
|
51
|
+
ercMetadataProperties: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>>;
|
|
52
|
+
}, z.core.$strip>>;
|
|
30
53
|
bundleItems: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
31
54
|
productId: z.ZodMiniString<string>;
|
|
32
55
|
quantity: z.ZodMiniNumber<number>;
|
|
@@ -36,15 +59,6 @@ export declare const ProductUpdateSpecificationSchema: z.ZodMiniObject<{
|
|
|
36
59
|
}, z.core.$strip>>;
|
|
37
60
|
}, z.core.$strip>>>;
|
|
38
61
|
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
|
-
}, z.core.$strip>>>;
|
|
48
62
|
variationResolvers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
49
63
|
vector: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>;
|
|
50
64
|
productId: z.ZodMiniString<string>;
|
|
@@ -54,14 +68,27 @@ export declare const ProductUpdatePayloadSchema: z.ZodMiniObject<{
|
|
|
54
68
|
_id: z.ZodMiniString<string>;
|
|
55
69
|
specification: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
56
70
|
type: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
71
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
72
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
73
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
74
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
75
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
76
|
+
brand: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
77
|
+
vendor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
78
|
+
labels: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
79
|
+
}, z.core.$strip>>>;
|
|
57
80
|
sequence: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
58
|
-
status: z.
|
|
59
|
-
|
|
81
|
+
status: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniEnum<{
|
|
82
|
+
readonly DRAFT: "DRAFT";
|
|
83
|
+
readonly ACTIVE: "ACTIVE";
|
|
84
|
+
readonly DELETED: "DELETED";
|
|
85
|
+
}>>>;
|
|
86
|
+
published: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniDate<Date>, z.ZodMiniString<string>]>>>;
|
|
60
87
|
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
61
88
|
commerce: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
62
89
|
pricing: z.ZodMiniArray<z.ZodMiniObject<{
|
|
63
90
|
amount: z.ZodMiniNumber<number>;
|
|
64
|
-
|
|
91
|
+
minQuantity: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
65
92
|
isTaxable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
66
93
|
isNetPrice: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
67
94
|
currencyCode: z.ZodMiniString<string>;
|
|
@@ -78,6 +105,16 @@ export declare const ProductUpdatePayloadSchema: z.ZodMiniObject<{
|
|
|
78
105
|
lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
79
106
|
widthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
80
107
|
}, z.core.$strip>>;
|
|
108
|
+
tokenization: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
109
|
+
contractAddress: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
110
|
+
contractStandard: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
111
|
+
readonly ERC721: "ERC721";
|
|
112
|
+
readonly ERC1155: "ERC1155";
|
|
113
|
+
}>>;
|
|
114
|
+
tokenId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
115
|
+
supply: z.ZodMiniOptional<z.ZodMiniInt>;
|
|
116
|
+
ercMetadataProperties: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>>;
|
|
117
|
+
}, z.core.$strip>>;
|
|
81
118
|
bundleItems: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
82
119
|
productId: z.ZodMiniString<string>;
|
|
83
120
|
quantity: z.ZodMiniNumber<number>;
|
|
@@ -87,15 +124,6 @@ export declare const ProductUpdatePayloadSchema: z.ZodMiniObject<{
|
|
|
87
124
|
}, z.core.$strip>>;
|
|
88
125
|
}, z.core.$strip>>>;
|
|
89
126
|
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
|
-
}, z.core.$strip>>>;
|
|
99
127
|
variationResolvers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
100
128
|
vector: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>;
|
|
101
129
|
productId: z.ZodMiniString<string>;
|
|
@@ -151,14 +179,27 @@ declare namespace updateProduct {
|
|
|
151
179
|
_id: z.ZodMiniString<string>;
|
|
152
180
|
specification: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
153
181
|
type: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
182
|
+
content: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniObject<{
|
|
183
|
+
title: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
184
|
+
subtitle: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
185
|
+
slug: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
186
|
+
description: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
187
|
+
brand: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
188
|
+
vendor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
189
|
+
labels: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
190
|
+
}, z.core.$strip>>>;
|
|
154
191
|
sequence: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
155
|
-
status: z.
|
|
156
|
-
|
|
192
|
+
status: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniEnum<{
|
|
193
|
+
readonly DRAFT: "DRAFT";
|
|
194
|
+
readonly ACTIVE: "ACTIVE";
|
|
195
|
+
readonly DELETED: "DELETED";
|
|
196
|
+
}>>>;
|
|
197
|
+
published: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniUnion<readonly [z.ZodMiniDate<Date>, z.ZodMiniString<string>]>>>;
|
|
157
198
|
tags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniString<string>>>;
|
|
158
199
|
commerce: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
159
200
|
pricing: z.ZodMiniArray<z.ZodMiniObject<{
|
|
160
201
|
amount: z.ZodMiniNumber<number>;
|
|
161
|
-
|
|
202
|
+
minQuantity: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
162
203
|
isTaxable: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
163
204
|
isNetPrice: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
164
205
|
currencyCode: z.ZodMiniString<string>;
|
|
@@ -175,6 +216,16 @@ declare namespace updateProduct {
|
|
|
175
216
|
lengthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
176
217
|
widthInMillimeters: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
177
218
|
}, z.core.$strip>>;
|
|
219
|
+
tokenization: z.ZodMiniOptional<z.ZodMiniObject<{
|
|
220
|
+
contractAddress: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
221
|
+
contractStandard: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
222
|
+
readonly ERC721: "ERC721";
|
|
223
|
+
readonly ERC1155: "ERC1155";
|
|
224
|
+
}>>;
|
|
225
|
+
tokenId: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
226
|
+
supply: z.ZodMiniOptional<z.ZodMiniInt>;
|
|
227
|
+
ercMetadataProperties: z.ZodMiniOptional<z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>>;
|
|
228
|
+
}, z.core.$strip>>;
|
|
178
229
|
bundleItems: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
179
230
|
productId: z.ZodMiniString<string>;
|
|
180
231
|
quantity: z.ZodMiniNumber<number>;
|
|
@@ -184,15 +235,6 @@ declare namespace updateProduct {
|
|
|
184
235
|
}, z.core.$strip>>;
|
|
185
236
|
}, z.core.$strip>>>;
|
|
186
237
|
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
|
-
}, z.core.$strip>>>;
|
|
196
238
|
variationResolvers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
|
|
197
239
|
vector: z.ZodMiniRecord<z.ZodMiniString<string>, z.ZodMiniAny>;
|
|
198
240
|
productId: z.ZodMiniString<string>;
|