@arascreative/erp-api-client 1.2.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +698 -284
- package/dist/index.d.ts +698 -284
- package/dist/index.js +545 -263
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +468 -234
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31,22 +31,31 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
ConsumeBatchSourceType: () => ConsumeBatchSourceType,
|
|
34
|
+
ProductClassification: () => ProductClassification,
|
|
35
|
+
ProductStatus: () => ProductStatus,
|
|
34
36
|
SourceTypeEnum: () => SourceTypeEnum,
|
|
35
37
|
consumeBatch: () => consumeBatch,
|
|
36
38
|
consumeBatchBody: () => consumeBatchBody,
|
|
37
39
|
consumeBatchParams: () => consumeBatchParams,
|
|
38
40
|
createBatch: () => createBatch,
|
|
39
41
|
createBatchBody: () => createBatchBody,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
createProduct: () => createProduct,
|
|
43
|
+
createProductBody: () => createProductBody,
|
|
42
44
|
createStockItems: () => createStockItems,
|
|
43
45
|
createStockItemsBody: () => createStockItemsBody,
|
|
46
|
+
createVariant: () => createVariant,
|
|
47
|
+
createVariantBody: () => createVariantBody,
|
|
48
|
+
createVariantParams: () => createVariantParams,
|
|
44
49
|
createWarehouse: () => createWarehouse,
|
|
45
50
|
createWarehouseBody: () => createWarehouseBody,
|
|
46
51
|
deleteApiIdentityAdminRolesId: () => deleteApiIdentityAdminRolesId,
|
|
47
52
|
deleteApiIdentityAdminRolesIdParams: () => deleteApiIdentityAdminRolesIdParams,
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
deleteProduct: () => deleteProduct,
|
|
54
|
+
deleteProductParams: () => deleteProductParams,
|
|
55
|
+
deleteVariant: () => deleteVariant,
|
|
56
|
+
deleteVariantParams: () => deleteVariantParams,
|
|
57
|
+
deleteVariantPricing: () => deleteVariantPricing,
|
|
58
|
+
deleteVariantPricingParams: () => deleteVariantPricingParams,
|
|
50
59
|
deleteWarehouse: () => deleteWarehouse,
|
|
51
60
|
deleteWarehouseParams: () => deleteWarehouseParams,
|
|
52
61
|
getApiIdentityAdminPermissions: () => getApiIdentityAdminPermissions,
|
|
@@ -75,16 +84,16 @@ __export(index_exports, {
|
|
|
75
84
|
getApiIdentityManage2faResponse: () => getApiIdentityManage2faResponse,
|
|
76
85
|
getApiIdentityManageInfo: () => getApiIdentityManageInfo,
|
|
77
86
|
getApiIdentityManageInfoResponse: () => getApiIdentityManageInfoResponse,
|
|
78
|
-
getCatalogItem: () => getCatalogItem,
|
|
79
|
-
getCatalogItemParams: () => getCatalogItemParams,
|
|
80
|
-
getCatalogItemResponse: () => getCatalogItemResponse,
|
|
81
87
|
getConsumeBatchMutationOptions: () => getConsumeBatchMutationOptions,
|
|
82
88
|
getCreateBatchMutationOptions: () => getCreateBatchMutationOptions,
|
|
83
|
-
|
|
89
|
+
getCreateProductMutationOptions: () => getCreateProductMutationOptions,
|
|
84
90
|
getCreateStockItemsMutationOptions: () => getCreateStockItemsMutationOptions,
|
|
91
|
+
getCreateVariantMutationOptions: () => getCreateVariantMutationOptions,
|
|
85
92
|
getCreateWarehouseMutationOptions: () => getCreateWarehouseMutationOptions,
|
|
86
93
|
getDeleteApiIdentityAdminRolesIdMutationOptions: () => getDeleteApiIdentityAdminRolesIdMutationOptions,
|
|
87
|
-
|
|
94
|
+
getDeleteProductMutationOptions: () => getDeleteProductMutationOptions,
|
|
95
|
+
getDeleteVariantMutationOptions: () => getDeleteVariantMutationOptions,
|
|
96
|
+
getDeleteVariantPricingMutationOptions: () => getDeleteVariantPricingMutationOptions,
|
|
88
97
|
getDeleteWarehouseMutationOptions: () => getDeleteWarehouseMutationOptions,
|
|
89
98
|
getGetApiIdentityAdminPermissionsQueryKey: () => getGetApiIdentityAdminPermissionsQueryKey,
|
|
90
99
|
getGetApiIdentityAdminPermissionsQueryOptions: () => getGetApiIdentityAdminPermissionsQueryOptions,
|
|
@@ -104,21 +113,27 @@ __export(index_exports, {
|
|
|
104
113
|
getGetApiIdentityManage2faQueryOptions: () => getGetApiIdentityManage2faQueryOptions,
|
|
105
114
|
getGetApiIdentityManageInfoQueryKey: () => getGetApiIdentityManageInfoQueryKey,
|
|
106
115
|
getGetApiIdentityManageInfoQueryOptions: () => getGetApiIdentityManageInfoQueryOptions,
|
|
107
|
-
getGetCatalogItemQueryKey: () => getGetCatalogItemQueryKey,
|
|
108
|
-
getGetCatalogItemQueryOptions: () => getGetCatalogItemQueryOptions,
|
|
109
116
|
getGetHealthQueryKey: () => getGetHealthQueryKey,
|
|
110
117
|
getGetHealthQueryOptions: () => getGetHealthQueryOptions,
|
|
118
|
+
getGetProductQueryKey: () => getGetProductQueryKey,
|
|
119
|
+
getGetProductQueryOptions: () => getGetProductQueryOptions,
|
|
120
|
+
getGetVariantPricingQueryKey: () => getGetVariantPricingQueryKey,
|
|
121
|
+
getGetVariantPricingQueryOptions: () => getGetVariantPricingQueryOptions,
|
|
122
|
+
getGetVariantQueryKey: () => getGetVariantQueryKey,
|
|
123
|
+
getGetVariantQueryOptions: () => getGetVariantQueryOptions,
|
|
111
124
|
getGetWarehouseByIdQueryKey: () => getGetWarehouseByIdQueryKey,
|
|
112
125
|
getGetWarehouseByIdQueryOptions: () => getGetWarehouseByIdQueryOptions,
|
|
113
126
|
getGetWarehouseOptionsQueryKey: () => getGetWarehouseOptionsQueryKey,
|
|
114
127
|
getGetWarehouseOptionsQueryOptions: () => getGetWarehouseOptionsQueryOptions,
|
|
115
128
|
getHealth: () => getHealth,
|
|
116
|
-
|
|
117
|
-
|
|
129
|
+
getListProductsQueryKey: () => getListProductsQueryKey,
|
|
130
|
+
getListProductsQueryOptions: () => getListProductsQueryOptions,
|
|
118
131
|
getListStockItemsQueryKey: () => getListStockItemsQueryKey,
|
|
119
132
|
getListStockItemsQueryOptions: () => getListStockItemsQueryOptions,
|
|
120
133
|
getListStockMovementsQueryKey: () => getListStockMovementsQueryKey,
|
|
121
134
|
getListStockMovementsQueryOptions: () => getListStockMovementsQueryOptions,
|
|
135
|
+
getListVariantsQueryKey: () => getListVariantsQueryKey,
|
|
136
|
+
getListVariantsQueryOptions: () => getListVariantsQueryOptions,
|
|
122
137
|
getListWarehousesQueryKey: () => getListWarehousesQueryKey,
|
|
123
138
|
getListWarehousesQueryOptions: () => getListWarehousesQueryOptions,
|
|
124
139
|
getPostApiIdentityAdminRolesMutationOptions: () => getPostApiIdentityAdminRolesMutationOptions,
|
|
@@ -129,6 +144,9 @@ __export(index_exports, {
|
|
|
129
144
|
getPostApiIdentityManage2faMutationOptions: () => getPostApiIdentityManage2faMutationOptions,
|
|
130
145
|
getPostApiIdentityManageInfoMutationOptions: () => getPostApiIdentityManageInfoMutationOptions,
|
|
131
146
|
getPostApiIdentityResetPasswordMutationOptions: () => getPostApiIdentityResetPasswordMutationOptions,
|
|
147
|
+
getProduct: () => getProduct,
|
|
148
|
+
getProductParams: () => getProductParams,
|
|
149
|
+
getProductResponse: () => getProductResponse,
|
|
132
150
|
getPutApiIdentityAdminRolesIdMutationOptions: () => getPutApiIdentityAdminRolesIdMutationOptions,
|
|
133
151
|
getPutApiIdentityAdminRolesIdPermissionsMutationOptions: () => getPutApiIdentityAdminRolesIdPermissionsMutationOptions,
|
|
134
152
|
getPutApiIdentityAdminUsersIdActiveMutationOptions: () => getPutApiIdentityAdminUsersIdActiveMutationOptions,
|
|
@@ -136,19 +154,27 @@ __export(index_exports, {
|
|
|
136
154
|
getSearchAddressesQueryKey: () => getSearchAddressesQueryKey,
|
|
137
155
|
getSearchAddressesQueryOptions: () => getSearchAddressesQueryOptions,
|
|
138
156
|
getToggleWarehouseStatusMutationOptions: () => getToggleWarehouseStatusMutationOptions,
|
|
139
|
-
|
|
157
|
+
getUpdateProductMutationOptions: () => getUpdateProductMutationOptions,
|
|
158
|
+
getUpdateVariantMutationOptions: () => getUpdateVariantMutationOptions,
|
|
140
159
|
getUpdateWarehouseMutationOptions: () => getUpdateWarehouseMutationOptions,
|
|
160
|
+
getUpsertVariantPricingMutationOptions: () => getUpsertVariantPricingMutationOptions,
|
|
161
|
+
getVariant: () => getVariant,
|
|
162
|
+
getVariantParams: () => getVariantParams,
|
|
163
|
+
getVariantPricing: () => getVariantPricing,
|
|
164
|
+
getVariantPricingParams: () => getVariantPricingParams,
|
|
165
|
+
getVariantPricingResponse: () => getVariantPricingResponse,
|
|
166
|
+
getVariantResponse: () => getVariantResponse,
|
|
141
167
|
getWarehouseById: () => getWarehouseById,
|
|
142
168
|
getWarehouseByIdParams: () => getWarehouseByIdParams,
|
|
143
169
|
getWarehouseByIdResponse: () => getWarehouseByIdResponse,
|
|
144
170
|
getWarehouseOptions: () => getWarehouseOptions,
|
|
145
171
|
getWarehouseOptionsResponse: () => getWarehouseOptionsResponse,
|
|
146
172
|
getWarehouseOptionsResponseItem: () => getWarehouseOptionsResponseItem,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
173
|
+
listProducts: () => listProducts,
|
|
174
|
+
listProductsQueryPageDefault: () => listProductsQueryPageDefault,
|
|
175
|
+
listProductsQueryPageSizeDefault: () => listProductsQueryPageSizeDefault,
|
|
176
|
+
listProductsQueryParams: () => listProductsQueryParams,
|
|
177
|
+
listProductsResponse: () => listProductsResponse,
|
|
152
178
|
listStockItems: () => listStockItems,
|
|
153
179
|
listStockItemsQueryDescendingDefault: () => listStockItemsQueryDescendingDefault,
|
|
154
180
|
listStockItemsQueryPageDefault: () => listStockItemsQueryPageDefault,
|
|
@@ -161,6 +187,12 @@ __export(index_exports, {
|
|
|
161
187
|
listStockMovementsQueryPageSizeDefault: () => listStockMovementsQueryPageSizeDefault,
|
|
162
188
|
listStockMovementsQueryParams: () => listStockMovementsQueryParams,
|
|
163
189
|
listStockMovementsResponse: () => listStockMovementsResponse,
|
|
190
|
+
listVariants: () => listVariants,
|
|
191
|
+
listVariantsParams: () => listVariantsParams,
|
|
192
|
+
listVariantsQueryPageDefault: () => listVariantsQueryPageDefault,
|
|
193
|
+
listVariantsQueryPageSizeDefault: () => listVariantsQueryPageSizeDefault,
|
|
194
|
+
listVariantsQueryParams: () => listVariantsQueryParams,
|
|
195
|
+
listVariantsResponse: () => listVariantsResponse,
|
|
164
196
|
listWarehouses: () => listWarehouses,
|
|
165
197
|
listWarehousesQueryPageDefault: () => listWarehousesQueryPageDefault,
|
|
166
198
|
listWarehousesQueryPageSizeDefault: () => listWarehousesQueryPageSizeDefault,
|
|
@@ -203,20 +235,31 @@ __export(index_exports, {
|
|
|
203
235
|
searchAddressesResponseItem: () => searchAddressesResponseItem,
|
|
204
236
|
toggleWarehouseStatus: () => toggleWarehouseStatus,
|
|
205
237
|
toggleWarehouseStatusParams: () => toggleWarehouseStatusParams,
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
238
|
+
updateProduct: () => updateProduct,
|
|
239
|
+
updateProductBody: () => updateProductBody,
|
|
240
|
+
updateProductParams: () => updateProductParams,
|
|
241
|
+
updateProductResponse: () => updateProductResponse,
|
|
242
|
+
updateVariant: () => updateVariant,
|
|
243
|
+
updateVariantBody: () => updateVariantBody,
|
|
244
|
+
updateVariantParams: () => updateVariantParams,
|
|
245
|
+
updateVariantResponse: () => updateVariantResponse,
|
|
210
246
|
updateWarehouse: () => updateWarehouse,
|
|
211
247
|
updateWarehouseBody: () => updateWarehouseBody,
|
|
212
248
|
updateWarehouseParams: () => updateWarehouseParams,
|
|
249
|
+
upsertVariantPricing: () => upsertVariantPricing,
|
|
250
|
+
upsertVariantPricingBody: () => upsertVariantPricingBody,
|
|
251
|
+
upsertVariantPricingParams: () => upsertVariantPricingParams,
|
|
252
|
+
upsertVariantPricingResponse: () => upsertVariantPricingResponse,
|
|
213
253
|
useConsumeBatch: () => useConsumeBatch,
|
|
214
254
|
useCreateBatch: () => useCreateBatch,
|
|
215
|
-
|
|
255
|
+
useCreateProduct: () => useCreateProduct,
|
|
216
256
|
useCreateStockItems: () => useCreateStockItems,
|
|
257
|
+
useCreateVariant: () => useCreateVariant,
|
|
217
258
|
useCreateWarehouse: () => useCreateWarehouse,
|
|
218
259
|
useDeleteApiIdentityAdminRolesId: () => useDeleteApiIdentityAdminRolesId,
|
|
219
|
-
|
|
260
|
+
useDeleteProduct: () => useDeleteProduct,
|
|
261
|
+
useDeleteVariant: () => useDeleteVariant,
|
|
262
|
+
useDeleteVariantPricing: () => useDeleteVariantPricing,
|
|
220
263
|
useDeleteWarehouse: () => useDeleteWarehouse,
|
|
221
264
|
useGetApiIdentityAdminPermissions: () => useGetApiIdentityAdminPermissions,
|
|
222
265
|
useGetApiIdentityAdminRoles: () => useGetApiIdentityAdminRoles,
|
|
@@ -227,13 +270,16 @@ __export(index_exports, {
|
|
|
227
270
|
useGetApiIdentityAntiforgery: () => useGetApiIdentityAntiforgery,
|
|
228
271
|
useGetApiIdentityManage2fa: () => useGetApiIdentityManage2fa,
|
|
229
272
|
useGetApiIdentityManageInfo: () => useGetApiIdentityManageInfo,
|
|
230
|
-
useGetCatalogItem: () => useGetCatalogItem,
|
|
231
273
|
useGetHealth: () => useGetHealth,
|
|
274
|
+
useGetProduct: () => useGetProduct,
|
|
275
|
+
useGetVariant: () => useGetVariant,
|
|
276
|
+
useGetVariantPricing: () => useGetVariantPricing,
|
|
232
277
|
useGetWarehouseById: () => useGetWarehouseById,
|
|
233
278
|
useGetWarehouseOptions: () => useGetWarehouseOptions,
|
|
234
|
-
|
|
279
|
+
useListProducts: () => useListProducts,
|
|
235
280
|
useListStockItems: () => useListStockItems,
|
|
236
281
|
useListStockMovements: () => useListStockMovements,
|
|
282
|
+
useListVariants: () => useListVariants,
|
|
237
283
|
useListWarehouses: () => useListWarehouses,
|
|
238
284
|
usePostApiIdentityAdminRoles: () => usePostApiIdentityAdminRoles,
|
|
239
285
|
usePostApiIdentityAdminUsersIdLogout: () => usePostApiIdentityAdminUsersIdLogout,
|
|
@@ -249,8 +295,10 @@ __export(index_exports, {
|
|
|
249
295
|
usePutApiIdentityAdminUsersIdRoles: () => usePutApiIdentityAdminUsersIdRoles,
|
|
250
296
|
useSearchAddresses: () => useSearchAddresses,
|
|
251
297
|
useToggleWarehouseStatus: () => useToggleWarehouseStatus,
|
|
252
|
-
|
|
253
|
-
|
|
298
|
+
useUpdateProduct: () => useUpdateProduct,
|
|
299
|
+
useUpdateVariant: () => useUpdateVariant,
|
|
300
|
+
useUpdateWarehouse: () => useUpdateWarehouse,
|
|
301
|
+
useUpsertVariantPricing: () => useUpsertVariantPricing
|
|
254
302
|
});
|
|
255
303
|
module.exports = __toCommonJS(index_exports);
|
|
256
304
|
|
|
@@ -265,6 +313,15 @@ var ConsumeBatchSourceType = {
|
|
|
265
313
|
DAMAGED: "DAMAGED",
|
|
266
314
|
INTERNAL_USE: "INTERNAL_USE"
|
|
267
315
|
};
|
|
316
|
+
var ProductClassification = {
|
|
317
|
+
Physical: "Physical",
|
|
318
|
+
Digital: "Digital"
|
|
319
|
+
};
|
|
320
|
+
var ProductStatus = {
|
|
321
|
+
Tes: "Tes",
|
|
322
|
+
Live: "Live",
|
|
323
|
+
Archived: "Archived"
|
|
324
|
+
};
|
|
268
325
|
var SourceTypeEnum = {
|
|
269
326
|
PURCHASE: "PURCHASE",
|
|
270
327
|
CUSTOMER_RETURN: "CUSTOMER_RETURN",
|
|
@@ -430,91 +487,236 @@ function useSearchAddresses(params, options, queryClient) {
|
|
|
430
487
|
query.queryKey = queryOptions.queryKey;
|
|
431
488
|
return query;
|
|
432
489
|
}
|
|
433
|
-
var
|
|
434
|
-
return import_axios.default.post(`/api/catalog`,
|
|
490
|
+
var createProduct = (createProductRequest, options) => {
|
|
491
|
+
return import_axios.default.post(`/api/catalog/products`, createProductRequest, options);
|
|
435
492
|
};
|
|
436
|
-
var
|
|
437
|
-
const mutationKey = ["
|
|
493
|
+
var getCreateProductMutationOptions = (options) => {
|
|
494
|
+
const mutationKey = ["createProduct"];
|
|
438
495
|
const { mutation: mutationOptions, axios: axiosOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, axios: void 0 };
|
|
439
496
|
const mutationFn = (props) => {
|
|
440
497
|
const { data } = props ?? {};
|
|
441
|
-
return
|
|
498
|
+
return createProduct(data, axiosOptions);
|
|
442
499
|
};
|
|
443
500
|
return { mutationFn, ...mutationOptions };
|
|
444
501
|
};
|
|
445
|
-
var
|
|
446
|
-
const mutationOptions =
|
|
502
|
+
var useCreateProduct = (options, queryClient) => {
|
|
503
|
+
const mutationOptions = getCreateProductMutationOptions(options);
|
|
447
504
|
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
448
505
|
};
|
|
449
|
-
var
|
|
450
|
-
return import_axios.default.get(`/api/catalog`, {
|
|
506
|
+
var listProducts = (params, options) => {
|
|
507
|
+
return import_axios.default.get(`/api/catalog/products`, {
|
|
451
508
|
...options,
|
|
452
509
|
params: { ...params, ...options?.params }
|
|
453
510
|
});
|
|
454
511
|
};
|
|
455
|
-
var
|
|
456
|
-
return [`/api/catalog`, ...params ? [params] : []];
|
|
512
|
+
var getListProductsQueryKey = (params) => {
|
|
513
|
+
return [`/api/catalog/products`, ...params ? [params] : []];
|
|
457
514
|
};
|
|
458
|
-
var
|
|
515
|
+
var getListProductsQueryOptions = (params, options) => {
|
|
459
516
|
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
460
|
-
const queryKey = queryOptions?.queryKey ??
|
|
461
|
-
const queryFn = ({ signal }) =>
|
|
517
|
+
const queryKey = queryOptions?.queryKey ?? getListProductsQueryKey(params);
|
|
518
|
+
const queryFn = ({ signal }) => listProducts(params, { signal, ...axiosOptions });
|
|
462
519
|
return { queryKey, queryFn, ...queryOptions };
|
|
463
520
|
};
|
|
464
|
-
function
|
|
465
|
-
const queryOptions =
|
|
521
|
+
function useListProducts(params, options, queryClient) {
|
|
522
|
+
const queryOptions = getListProductsQueryOptions(params, options);
|
|
523
|
+
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
524
|
+
query.queryKey = queryOptions.queryKey;
|
|
525
|
+
return query;
|
|
526
|
+
}
|
|
527
|
+
var getProduct = (id, options) => {
|
|
528
|
+
return import_axios.default.get(`/api/catalog/products/${id}`, options);
|
|
529
|
+
};
|
|
530
|
+
var getGetProductQueryKey = (id) => {
|
|
531
|
+
return [`/api/catalog/products/${id}`];
|
|
532
|
+
};
|
|
533
|
+
var getGetProductQueryOptions = (id, options) => {
|
|
534
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
535
|
+
const queryKey = queryOptions?.queryKey ?? getGetProductQueryKey(id);
|
|
536
|
+
const queryFn = ({ signal }) => getProduct(id, { signal, ...axiosOptions });
|
|
537
|
+
return { queryKey, queryFn, enabled: !!id, ...queryOptions };
|
|
538
|
+
};
|
|
539
|
+
function useGetProduct(id, options, queryClient) {
|
|
540
|
+
const queryOptions = getGetProductQueryOptions(id, options);
|
|
466
541
|
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
467
542
|
query.queryKey = queryOptions.queryKey;
|
|
468
543
|
return query;
|
|
469
544
|
}
|
|
470
|
-
var
|
|
471
|
-
return import_axios.default.put(`/api/catalog/${id}`,
|
|
545
|
+
var updateProduct = (id, updateProductRequest, options) => {
|
|
546
|
+
return import_axios.default.put(`/api/catalog/products/${id}`, updateProductRequest, options);
|
|
472
547
|
};
|
|
473
|
-
var
|
|
474
|
-
const mutationKey = ["
|
|
548
|
+
var getUpdateProductMutationOptions = (options) => {
|
|
549
|
+
const mutationKey = ["updateProduct"];
|
|
475
550
|
const { mutation: mutationOptions, axios: axiosOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, axios: void 0 };
|
|
476
551
|
const mutationFn = (props) => {
|
|
477
552
|
const { id, data } = props ?? {};
|
|
478
|
-
return
|
|
553
|
+
return updateProduct(id, data, axiosOptions);
|
|
479
554
|
};
|
|
480
555
|
return { mutationFn, ...mutationOptions };
|
|
481
556
|
};
|
|
482
|
-
var
|
|
483
|
-
const mutationOptions =
|
|
557
|
+
var useUpdateProduct = (options, queryClient) => {
|
|
558
|
+
const mutationOptions = getUpdateProductMutationOptions(options);
|
|
484
559
|
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
485
560
|
};
|
|
486
|
-
var
|
|
487
|
-
return import_axios.default.
|
|
561
|
+
var deleteProduct = (id, options) => {
|
|
562
|
+
return import_axios.default.delete(`/api/catalog/products/${id}`, options);
|
|
488
563
|
};
|
|
489
|
-
var
|
|
490
|
-
|
|
564
|
+
var getDeleteProductMutationOptions = (options) => {
|
|
565
|
+
const mutationKey = ["deleteProduct"];
|
|
566
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, axios: void 0 };
|
|
567
|
+
const mutationFn = (props) => {
|
|
568
|
+
const { id } = props ?? {};
|
|
569
|
+
return deleteProduct(id, axiosOptions);
|
|
570
|
+
};
|
|
571
|
+
return { mutationFn, ...mutationOptions };
|
|
491
572
|
};
|
|
492
|
-
var
|
|
573
|
+
var useDeleteProduct = (options, queryClient) => {
|
|
574
|
+
const mutationOptions = getDeleteProductMutationOptions(options);
|
|
575
|
+
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
576
|
+
};
|
|
577
|
+
var createVariant = (productId, createVariantRequest, options) => {
|
|
578
|
+
return import_axios.default.post(`/api/catalog/products/${productId}/variants`, createVariantRequest, options);
|
|
579
|
+
};
|
|
580
|
+
var getCreateVariantMutationOptions = (options) => {
|
|
581
|
+
const mutationKey = ["createVariant"];
|
|
582
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, axios: void 0 };
|
|
583
|
+
const mutationFn = (props) => {
|
|
584
|
+
const { productId, data } = props ?? {};
|
|
585
|
+
return createVariant(productId, data, axiosOptions);
|
|
586
|
+
};
|
|
587
|
+
return { mutationFn, ...mutationOptions };
|
|
588
|
+
};
|
|
589
|
+
var useCreateVariant = (options, queryClient) => {
|
|
590
|
+
const mutationOptions = getCreateVariantMutationOptions(options);
|
|
591
|
+
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
592
|
+
};
|
|
593
|
+
var listVariants = (productId, params, options) => {
|
|
594
|
+
return import_axios.default.get(`/api/catalog/products/${productId}/variants`, {
|
|
595
|
+
...options,
|
|
596
|
+
params: { ...params, ...options?.params }
|
|
597
|
+
});
|
|
598
|
+
};
|
|
599
|
+
var getListVariantsQueryKey = (productId, params) => {
|
|
600
|
+
return [`/api/catalog/products/${productId}/variants`, ...params ? [params] : []];
|
|
601
|
+
};
|
|
602
|
+
var getListVariantsQueryOptions = (productId, params, options) => {
|
|
493
603
|
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
494
|
-
const queryKey = queryOptions?.queryKey ??
|
|
495
|
-
const queryFn = ({ signal }) =>
|
|
496
|
-
return { queryKey, queryFn, enabled: !!
|
|
604
|
+
const queryKey = queryOptions?.queryKey ?? getListVariantsQueryKey(productId, params);
|
|
605
|
+
const queryFn = ({ signal }) => listVariants(productId, params, { signal, ...axiosOptions });
|
|
606
|
+
return { queryKey, queryFn, enabled: !!productId, ...queryOptions };
|
|
497
607
|
};
|
|
498
|
-
function
|
|
499
|
-
const queryOptions =
|
|
608
|
+
function useListVariants(productId, params, options, queryClient) {
|
|
609
|
+
const queryOptions = getListVariantsQueryOptions(productId, params, options);
|
|
500
610
|
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
501
611
|
query.queryKey = queryOptions.queryKey;
|
|
502
612
|
return query;
|
|
503
613
|
}
|
|
504
|
-
var
|
|
505
|
-
return import_axios.default.
|
|
614
|
+
var getVariant = (productId, id, options) => {
|
|
615
|
+
return import_axios.default.get(`/api/catalog/products/${productId}/variants/${id}`, options);
|
|
616
|
+
};
|
|
617
|
+
var getGetVariantQueryKey = (productId, id) => {
|
|
618
|
+
return [`/api/catalog/products/${productId}/variants/${id}`];
|
|
506
619
|
};
|
|
507
|
-
var
|
|
508
|
-
const
|
|
620
|
+
var getGetVariantQueryOptions = (productId, id, options) => {
|
|
621
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
622
|
+
const queryKey = queryOptions?.queryKey ?? getGetVariantQueryKey(productId, id);
|
|
623
|
+
const queryFn = ({ signal }) => getVariant(productId, id, { signal, ...axiosOptions });
|
|
624
|
+
return { queryKey, queryFn, enabled: !!(productId && id), ...queryOptions };
|
|
625
|
+
};
|
|
626
|
+
function useGetVariant(productId, id, options, queryClient) {
|
|
627
|
+
const queryOptions = getGetVariantQueryOptions(productId, id, options);
|
|
628
|
+
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
629
|
+
query.queryKey = queryOptions.queryKey;
|
|
630
|
+
return query;
|
|
631
|
+
}
|
|
632
|
+
var updateVariant = (productId, id, updateVariantRequest, options) => {
|
|
633
|
+
return import_axios.default.put(
|
|
634
|
+
`/api/catalog/products/${productId}/variants/${id}`,
|
|
635
|
+
updateVariantRequest,
|
|
636
|
+
options
|
|
637
|
+
);
|
|
638
|
+
};
|
|
639
|
+
var getUpdateVariantMutationOptions = (options) => {
|
|
640
|
+
const mutationKey = ["updateVariant"];
|
|
509
641
|
const { mutation: mutationOptions, axios: axiosOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, axios: void 0 };
|
|
510
642
|
const mutationFn = (props) => {
|
|
511
|
-
const { id } = props ?? {};
|
|
512
|
-
return
|
|
643
|
+
const { productId, id, data } = props ?? {};
|
|
644
|
+
return updateVariant(productId, id, data, axiosOptions);
|
|
645
|
+
};
|
|
646
|
+
return { mutationFn, ...mutationOptions };
|
|
647
|
+
};
|
|
648
|
+
var useUpdateVariant = (options, queryClient) => {
|
|
649
|
+
const mutationOptions = getUpdateVariantMutationOptions(options);
|
|
650
|
+
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
651
|
+
};
|
|
652
|
+
var deleteVariant = (productId, id, options) => {
|
|
653
|
+
return import_axios.default.delete(`/api/catalog/products/${productId}/variants/${id}`, options);
|
|
654
|
+
};
|
|
655
|
+
var getDeleteVariantMutationOptions = (options) => {
|
|
656
|
+
const mutationKey = ["deleteVariant"];
|
|
657
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, axios: void 0 };
|
|
658
|
+
const mutationFn = (props) => {
|
|
659
|
+
const { productId, id } = props ?? {};
|
|
660
|
+
return deleteVariant(productId, id, axiosOptions);
|
|
661
|
+
};
|
|
662
|
+
return { mutationFn, ...mutationOptions };
|
|
663
|
+
};
|
|
664
|
+
var useDeleteVariant = (options, queryClient) => {
|
|
665
|
+
const mutationOptions = getDeleteVariantMutationOptions(options);
|
|
666
|
+
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
667
|
+
};
|
|
668
|
+
var getVariantPricing = (variantId, options) => {
|
|
669
|
+
return import_axios.default.get(`/api/catalog/variants/${variantId}/pricing`, options);
|
|
670
|
+
};
|
|
671
|
+
var getGetVariantPricingQueryKey = (variantId) => {
|
|
672
|
+
return [`/api/catalog/variants/${variantId}/pricing`];
|
|
673
|
+
};
|
|
674
|
+
var getGetVariantPricingQueryOptions = (variantId, options) => {
|
|
675
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
676
|
+
const queryKey = queryOptions?.queryKey ?? getGetVariantPricingQueryKey(variantId);
|
|
677
|
+
const queryFn = ({ signal }) => getVariantPricing(variantId, { signal, ...axiosOptions });
|
|
678
|
+
return { queryKey, queryFn, enabled: !!variantId, ...queryOptions };
|
|
679
|
+
};
|
|
680
|
+
function useGetVariantPricing(variantId, options, queryClient) {
|
|
681
|
+
const queryOptions = getGetVariantPricingQueryOptions(variantId, options);
|
|
682
|
+
const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
|
|
683
|
+
query.queryKey = queryOptions.queryKey;
|
|
684
|
+
return query;
|
|
685
|
+
}
|
|
686
|
+
var upsertVariantPricing = (variantId, upsertVariantPricingRequest, options) => {
|
|
687
|
+
return import_axios.default.put(
|
|
688
|
+
`/api/catalog/variants/${variantId}/pricing`,
|
|
689
|
+
upsertVariantPricingRequest,
|
|
690
|
+
options
|
|
691
|
+
);
|
|
692
|
+
};
|
|
693
|
+
var getUpsertVariantPricingMutationOptions = (options) => {
|
|
694
|
+
const mutationKey = ["upsertVariantPricing"];
|
|
695
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, axios: void 0 };
|
|
696
|
+
const mutationFn = (props) => {
|
|
697
|
+
const { variantId, data } = props ?? {};
|
|
698
|
+
return upsertVariantPricing(variantId, data, axiosOptions);
|
|
513
699
|
};
|
|
514
700
|
return { mutationFn, ...mutationOptions };
|
|
515
701
|
};
|
|
516
|
-
var
|
|
517
|
-
const mutationOptions =
|
|
702
|
+
var useUpsertVariantPricing = (options, queryClient) => {
|
|
703
|
+
const mutationOptions = getUpsertVariantPricingMutationOptions(options);
|
|
704
|
+
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
705
|
+
};
|
|
706
|
+
var deleteVariantPricing = (variantId, options) => {
|
|
707
|
+
return import_axios.default.delete(`/api/catalog/variants/${variantId}/pricing`, options);
|
|
708
|
+
};
|
|
709
|
+
var getDeleteVariantPricingMutationOptions = (options) => {
|
|
710
|
+
const mutationKey = ["deleteVariantPricing"];
|
|
711
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, axios: void 0 };
|
|
712
|
+
const mutationFn = (props) => {
|
|
713
|
+
const { variantId } = props ?? {};
|
|
714
|
+
return deleteVariantPricing(variantId, axiosOptions);
|
|
715
|
+
};
|
|
716
|
+
return { mutationFn, ...mutationOptions };
|
|
717
|
+
};
|
|
718
|
+
var useDeleteVariantPricing = (options, queryClient) => {
|
|
719
|
+
const mutationOptions = getDeleteVariantPricingMutationOptions(options);
|
|
518
720
|
return (0, import_react_query.useMutation)(mutationOptions, queryClient);
|
|
519
721
|
};
|
|
520
722
|
var createStockItems = (createStockItemCommand, options) => {
|
|
@@ -1103,66 +1305,28 @@ var searchAddressesResponseItem = zod.strictObject({
|
|
|
1103
1305
|
zipCode: zod.string().optional()
|
|
1104
1306
|
});
|
|
1105
1307
|
var searchAddressesResponse = zod.array(searchAddressesResponseItem);
|
|
1106
|
-
var
|
|
1308
|
+
var createProductBody = zod.strictObject({
|
|
1107
1309
|
categoryId: zod.uuid(),
|
|
1108
1310
|
name: zod.string(),
|
|
1109
1311
|
slug: zod.string(),
|
|
1110
|
-
status: zod.
|
|
1111
|
-
classification: zod.
|
|
1112
|
-
variants: zod.array(
|
|
1113
|
-
zod.strictObject({
|
|
1114
|
-
id: zod.uuid().nullish(),
|
|
1115
|
-
code: zod.string(),
|
|
1116
|
-
itemId: zod.uuid(),
|
|
1117
|
-
multiplier: zod.number(),
|
|
1118
|
-
attributes: zod.array(
|
|
1119
|
-
zod.strictObject({
|
|
1120
|
-
name: zod.string(),
|
|
1121
|
-
value: zod.string()
|
|
1122
|
-
})
|
|
1123
|
-
),
|
|
1124
|
-
weight: zod.strictObject({
|
|
1125
|
-
value: zod.number(),
|
|
1126
|
-
unit: zod.string()
|
|
1127
|
-
}),
|
|
1128
|
-
price: zod.strictObject({
|
|
1129
|
-
baseAmount: zod.number(),
|
|
1130
|
-
baseCurrency: zod.string(),
|
|
1131
|
-
sale: zod.union([
|
|
1132
|
-
zod.null(),
|
|
1133
|
-
zod.strictObject({
|
|
1134
|
-
amount: zod.number(),
|
|
1135
|
-
currency: zod.string(),
|
|
1136
|
-
startAt: zod.iso.datetime({}),
|
|
1137
|
-
endAt: zod.iso.datetime({})
|
|
1138
|
-
})
|
|
1139
|
-
]).optional(),
|
|
1140
|
-
wholesale: zod.array(
|
|
1141
|
-
zod.strictObject({
|
|
1142
|
-
minQty: zod.number(),
|
|
1143
|
-
amount: zod.number(),
|
|
1144
|
-
currency: zod.string()
|
|
1145
|
-
})
|
|
1146
|
-
).nullish()
|
|
1147
|
-
})
|
|
1148
|
-
})
|
|
1149
|
-
)
|
|
1312
|
+
status: zod.enum(["Tes", "Live", "Archived"]).optional(),
|
|
1313
|
+
classification: zod.enum(["Physical", "Digital"])
|
|
1150
1314
|
});
|
|
1151
|
-
var
|
|
1152
|
-
var
|
|
1153
|
-
var
|
|
1154
|
-
page: zod.coerce.number().default(
|
|
1155
|
-
pageSize: zod.coerce.number().default(
|
|
1315
|
+
var listProductsQueryPageDefault = 1;
|
|
1316
|
+
var listProductsQueryPageSizeDefault = 10;
|
|
1317
|
+
var listProductsQueryParams = zod.strictObject({
|
|
1318
|
+
page: zod.coerce.number().default(listProductsQueryPageDefault),
|
|
1319
|
+
pageSize: zod.coerce.number().default(listProductsQueryPageSizeDefault)
|
|
1156
1320
|
});
|
|
1157
|
-
var
|
|
1321
|
+
var listProductsResponse = zod.strictObject({
|
|
1158
1322
|
items: zod.array(
|
|
1159
1323
|
zod.strictObject({
|
|
1160
1324
|
id: zod.uuid(),
|
|
1161
1325
|
categoryId: zod.uuid(),
|
|
1162
1326
|
name: zod.string(),
|
|
1163
1327
|
slug: zod.string(),
|
|
1164
|
-
status: zod.
|
|
1165
|
-
classification: zod.
|
|
1328
|
+
status: zod.enum(["Tes", "Live", "Archived"]),
|
|
1329
|
+
classification: zod.enum(["Physical", "Digital"]),
|
|
1166
1330
|
variantCount: zod.number()
|
|
1167
1331
|
})
|
|
1168
1332
|
),
|
|
@@ -1173,152 +1337,222 @@ var listCatalogItemsResponse = zod.strictObject({
|
|
|
1173
1337
|
hasNextPage: zod.boolean().optional(),
|
|
1174
1338
|
hasPreviousPage: zod.boolean().optional()
|
|
1175
1339
|
});
|
|
1176
|
-
var
|
|
1340
|
+
var getProductParams = zod.strictObject({
|
|
1177
1341
|
id: zod.uuid()
|
|
1178
1342
|
});
|
|
1179
|
-
var
|
|
1343
|
+
var getProductResponse = zod.strictObject({
|
|
1344
|
+
id: zod.uuid(),
|
|
1180
1345
|
categoryId: zod.uuid(),
|
|
1181
1346
|
name: zod.string(),
|
|
1182
1347
|
slug: zod.string(),
|
|
1183
|
-
status: zod.
|
|
1184
|
-
classification: zod.
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
itemId: zod.uuid(),
|
|
1190
|
-
multiplier: zod.number(),
|
|
1191
|
-
attributes: zod.array(
|
|
1192
|
-
zod.strictObject({
|
|
1193
|
-
name: zod.string(),
|
|
1194
|
-
value: zod.string()
|
|
1195
|
-
})
|
|
1196
|
-
),
|
|
1197
|
-
weight: zod.strictObject({
|
|
1198
|
-
value: zod.number(),
|
|
1199
|
-
unit: zod.string()
|
|
1200
|
-
}),
|
|
1201
|
-
price: zod.strictObject({
|
|
1202
|
-
baseAmount: zod.number(),
|
|
1203
|
-
baseCurrency: zod.string(),
|
|
1204
|
-
sale: zod.union([
|
|
1205
|
-
zod.null(),
|
|
1206
|
-
zod.strictObject({
|
|
1207
|
-
amount: zod.number(),
|
|
1208
|
-
currency: zod.string(),
|
|
1209
|
-
startAt: zod.iso.datetime({}),
|
|
1210
|
-
endAt: zod.iso.datetime({})
|
|
1211
|
-
})
|
|
1212
|
-
]).optional(),
|
|
1213
|
-
wholesale: zod.array(
|
|
1214
|
-
zod.strictObject({
|
|
1215
|
-
minQty: zod.number(),
|
|
1216
|
-
amount: zod.number(),
|
|
1217
|
-
currency: zod.string()
|
|
1218
|
-
})
|
|
1219
|
-
).nullish()
|
|
1220
|
-
})
|
|
1221
|
-
})
|
|
1222
|
-
)
|
|
1348
|
+
status: zod.enum(["Tes", "Live", "Archived"]),
|
|
1349
|
+
classification: zod.enum(["Physical", "Digital"]),
|
|
1350
|
+
variantCount: zod.number()
|
|
1351
|
+
});
|
|
1352
|
+
var updateProductParams = zod.strictObject({
|
|
1353
|
+
id: zod.uuid()
|
|
1223
1354
|
});
|
|
1224
|
-
var
|
|
1355
|
+
var updateProductBody = zod.strictObject({
|
|
1356
|
+
categoryId: zod.uuid(),
|
|
1357
|
+
name: zod.string(),
|
|
1358
|
+
slug: zod.string(),
|
|
1359
|
+
status: zod.enum(["Tes", "Live", "Archived"]),
|
|
1360
|
+
classification: zod.enum(["Physical", "Digital"])
|
|
1361
|
+
});
|
|
1362
|
+
var updateProductResponse = zod.strictObject({
|
|
1225
1363
|
id: zod.uuid(),
|
|
1226
1364
|
categoryId: zod.uuid(),
|
|
1227
1365
|
name: zod.string(),
|
|
1228
1366
|
slug: zod.string(),
|
|
1229
|
-
status: zod.
|
|
1230
|
-
classification: zod.
|
|
1231
|
-
|
|
1367
|
+
status: zod.enum(["Tes", "Live", "Archived"]),
|
|
1368
|
+
classification: zod.enum(["Physical", "Digital"]),
|
|
1369
|
+
variantCount: zod.number()
|
|
1370
|
+
});
|
|
1371
|
+
var deleteProductParams = zod.strictObject({
|
|
1372
|
+
id: zod.uuid()
|
|
1373
|
+
});
|
|
1374
|
+
var createVariantParams = zod.strictObject({
|
|
1375
|
+
productId: zod.uuid()
|
|
1376
|
+
});
|
|
1377
|
+
var createVariantBody = zod.strictObject({
|
|
1378
|
+
code: zod.string(),
|
|
1379
|
+
attributes: zod.array(
|
|
1232
1380
|
zod.strictObject({
|
|
1233
|
-
|
|
1381
|
+
name: zod.string(),
|
|
1382
|
+
value: zod.string()
|
|
1383
|
+
})
|
|
1384
|
+
).optional(),
|
|
1385
|
+
weight: zod.strictObject({
|
|
1386
|
+
value: zod.number(),
|
|
1387
|
+
unit: zod.string()
|
|
1388
|
+
})
|
|
1389
|
+
});
|
|
1390
|
+
var listVariantsParams = zod.strictObject({
|
|
1391
|
+
productId: zod.uuid()
|
|
1392
|
+
});
|
|
1393
|
+
var listVariantsQueryPageDefault = 1;
|
|
1394
|
+
var listVariantsQueryPageSizeDefault = 10;
|
|
1395
|
+
var listVariantsQueryParams = zod.strictObject({
|
|
1396
|
+
page: zod.coerce.number().default(listVariantsQueryPageDefault),
|
|
1397
|
+
pageSize: zod.coerce.number().default(listVariantsQueryPageSizeDefault)
|
|
1398
|
+
});
|
|
1399
|
+
var listVariantsResponse = zod.strictObject({
|
|
1400
|
+
items: zod.array(
|
|
1401
|
+
zod.strictObject({
|
|
1402
|
+
id: zod.uuid(),
|
|
1403
|
+
productId: zod.uuid(),
|
|
1234
1404
|
code: zod.string(),
|
|
1235
|
-
itemId: zod.uuid(),
|
|
1236
|
-
multiplier: zod.number(),
|
|
1237
1405
|
attributes: zod.array(
|
|
1238
1406
|
zod.strictObject({
|
|
1239
1407
|
name: zod.string(),
|
|
1240
1408
|
value: zod.string()
|
|
1241
1409
|
})
|
|
1242
|
-
),
|
|
1410
|
+
).optional(),
|
|
1243
1411
|
weight: zod.strictObject({
|
|
1244
1412
|
value: zod.number(),
|
|
1245
1413
|
unit: zod.string()
|
|
1246
|
-
}),
|
|
1247
|
-
price: zod.strictObject({
|
|
1248
|
-
baseAmount: zod.number(),
|
|
1249
|
-
baseCurrency: zod.string(),
|
|
1250
|
-
sale: zod.union([
|
|
1251
|
-
zod.null(),
|
|
1252
|
-
zod.strictObject({
|
|
1253
|
-
amount: zod.number(),
|
|
1254
|
-
currency: zod.string(),
|
|
1255
|
-
startAt: zod.iso.datetime({}),
|
|
1256
|
-
endAt: zod.iso.datetime({})
|
|
1257
|
-
})
|
|
1258
|
-
]).optional(),
|
|
1259
|
-
wholesale: zod.array(
|
|
1260
|
-
zod.strictObject({
|
|
1261
|
-
minQty: zod.number(),
|
|
1262
|
-
amount: zod.number(),
|
|
1263
|
-
currency: zod.string()
|
|
1264
|
-
})
|
|
1265
|
-
).nullish()
|
|
1266
1414
|
})
|
|
1267
1415
|
})
|
|
1268
|
-
)
|
|
1416
|
+
),
|
|
1417
|
+
page: zod.number(),
|
|
1418
|
+
pageSize: zod.number(),
|
|
1419
|
+
totalCount: zod.number(),
|
|
1420
|
+
totalPages: zod.number().optional(),
|
|
1421
|
+
hasNextPage: zod.boolean().optional(),
|
|
1422
|
+
hasPreviousPage: zod.boolean().optional()
|
|
1269
1423
|
});
|
|
1270
|
-
var
|
|
1424
|
+
var getVariantParams = zod.strictObject({
|
|
1425
|
+
productId: zod.uuid(),
|
|
1271
1426
|
id: zod.uuid()
|
|
1272
1427
|
});
|
|
1273
|
-
var
|
|
1428
|
+
var getVariantResponse = zod.strictObject({
|
|
1274
1429
|
id: zod.uuid(),
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
status: zod.string(),
|
|
1279
|
-
classification: zod.string(),
|
|
1280
|
-
variants: zod.array(
|
|
1430
|
+
productId: zod.uuid(),
|
|
1431
|
+
code: zod.string(),
|
|
1432
|
+
attributes: zod.array(
|
|
1281
1433
|
zod.strictObject({
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
itemId: zod.uuid(),
|
|
1285
|
-
multiplier: zod.number(),
|
|
1286
|
-
attributes: zod.array(
|
|
1287
|
-
zod.strictObject({
|
|
1288
|
-
name: zod.string(),
|
|
1289
|
-
value: zod.string()
|
|
1290
|
-
})
|
|
1291
|
-
),
|
|
1292
|
-
weight: zod.strictObject({
|
|
1293
|
-
value: zod.number(),
|
|
1294
|
-
unit: zod.string()
|
|
1295
|
-
}),
|
|
1296
|
-
price: zod.strictObject({
|
|
1297
|
-
baseAmount: zod.number(),
|
|
1298
|
-
baseCurrency: zod.string(),
|
|
1299
|
-
sale: zod.union([
|
|
1300
|
-
zod.null(),
|
|
1301
|
-
zod.strictObject({
|
|
1302
|
-
amount: zod.number(),
|
|
1303
|
-
currency: zod.string(),
|
|
1304
|
-
startAt: zod.iso.datetime({}),
|
|
1305
|
-
endAt: zod.iso.datetime({})
|
|
1306
|
-
})
|
|
1307
|
-
]).optional(),
|
|
1308
|
-
wholesale: zod.array(
|
|
1309
|
-
zod.strictObject({
|
|
1310
|
-
minQty: zod.number(),
|
|
1311
|
-
amount: zod.number(),
|
|
1312
|
-
currency: zod.string()
|
|
1313
|
-
})
|
|
1314
|
-
).nullish()
|
|
1315
|
-
})
|
|
1434
|
+
name: zod.string(),
|
|
1435
|
+
value: zod.string()
|
|
1316
1436
|
})
|
|
1317
|
-
)
|
|
1437
|
+
).optional(),
|
|
1438
|
+
weight: zod.strictObject({
|
|
1439
|
+
value: zod.number(),
|
|
1440
|
+
unit: zod.string()
|
|
1441
|
+
})
|
|
1318
1442
|
});
|
|
1319
|
-
var
|
|
1443
|
+
var updateVariantParams = zod.strictObject({
|
|
1444
|
+
productId: zod.uuid(),
|
|
1320
1445
|
id: zod.uuid()
|
|
1321
1446
|
});
|
|
1447
|
+
var updateVariantBody = zod.strictObject({
|
|
1448
|
+
code: zod.string(),
|
|
1449
|
+
attributes: zod.array(
|
|
1450
|
+
zod.strictObject({
|
|
1451
|
+
name: zod.string(),
|
|
1452
|
+
value: zod.string()
|
|
1453
|
+
})
|
|
1454
|
+
).optional(),
|
|
1455
|
+
weight: zod.strictObject({
|
|
1456
|
+
value: zod.number(),
|
|
1457
|
+
unit: zod.string()
|
|
1458
|
+
})
|
|
1459
|
+
});
|
|
1460
|
+
var updateVariantResponse = zod.strictObject({
|
|
1461
|
+
id: zod.uuid(),
|
|
1462
|
+
productId: zod.uuid(),
|
|
1463
|
+
code: zod.string(),
|
|
1464
|
+
attributes: zod.array(
|
|
1465
|
+
zod.strictObject({
|
|
1466
|
+
name: zod.string(),
|
|
1467
|
+
value: zod.string()
|
|
1468
|
+
})
|
|
1469
|
+
).optional(),
|
|
1470
|
+
weight: zod.strictObject({
|
|
1471
|
+
value: zod.number(),
|
|
1472
|
+
unit: zod.string()
|
|
1473
|
+
})
|
|
1474
|
+
});
|
|
1475
|
+
var deleteVariantParams = zod.strictObject({
|
|
1476
|
+
productId: zod.uuid(),
|
|
1477
|
+
id: zod.uuid()
|
|
1478
|
+
});
|
|
1479
|
+
var getVariantPricingParams = zod.strictObject({
|
|
1480
|
+
variantId: zod.uuid()
|
|
1481
|
+
});
|
|
1482
|
+
var getVariantPricingResponse = zod.strictObject({
|
|
1483
|
+
variantId: zod.uuid(),
|
|
1484
|
+
baseAmount: zod.number(),
|
|
1485
|
+
baseCurrency: zod.string(),
|
|
1486
|
+
effectiveAmount: zod.number(),
|
|
1487
|
+
effectiveCurrency: zod.string(),
|
|
1488
|
+
sale: zod.union([
|
|
1489
|
+
zod.null(),
|
|
1490
|
+
zod.strictObject({
|
|
1491
|
+
amount: zod.number(),
|
|
1492
|
+
currency: zod.string(),
|
|
1493
|
+
startAt: zod.iso.datetime({}),
|
|
1494
|
+
endAt: zod.iso.datetime({}),
|
|
1495
|
+
isActive: zod.boolean()
|
|
1496
|
+
})
|
|
1497
|
+
]).optional(),
|
|
1498
|
+
wholesale: zod.array(
|
|
1499
|
+
zod.strictObject({
|
|
1500
|
+
minQty: zod.number(),
|
|
1501
|
+
amount: zod.number(),
|
|
1502
|
+
currency: zod.string()
|
|
1503
|
+
})
|
|
1504
|
+
).optional()
|
|
1505
|
+
});
|
|
1506
|
+
var upsertVariantPricingParams = zod.strictObject({
|
|
1507
|
+
variantId: zod.uuid()
|
|
1508
|
+
});
|
|
1509
|
+
var upsertVariantPricingBody = zod.strictObject({
|
|
1510
|
+
baseAmount: zod.number(),
|
|
1511
|
+
baseCurrency: zod.string(),
|
|
1512
|
+
sale: zod.union([
|
|
1513
|
+
zod.null(),
|
|
1514
|
+
zod.strictObject({
|
|
1515
|
+
amount: zod.number(),
|
|
1516
|
+
currency: zod.string(),
|
|
1517
|
+
startAt: zod.iso.datetime({}),
|
|
1518
|
+
endAt: zod.iso.datetime({})
|
|
1519
|
+
})
|
|
1520
|
+
]).optional(),
|
|
1521
|
+
wholesale: zod.array(
|
|
1522
|
+
zod.strictObject({
|
|
1523
|
+
minQty: zod.number(),
|
|
1524
|
+
amount: zod.number(),
|
|
1525
|
+
currency: zod.string()
|
|
1526
|
+
})
|
|
1527
|
+
).optional()
|
|
1528
|
+
});
|
|
1529
|
+
var upsertVariantPricingResponse = zod.strictObject({
|
|
1530
|
+
variantId: zod.uuid(),
|
|
1531
|
+
baseAmount: zod.number(),
|
|
1532
|
+
baseCurrency: zod.string(),
|
|
1533
|
+
effectiveAmount: zod.number(),
|
|
1534
|
+
effectiveCurrency: zod.string(),
|
|
1535
|
+
sale: zod.union([
|
|
1536
|
+
zod.null(),
|
|
1537
|
+
zod.strictObject({
|
|
1538
|
+
amount: zod.number(),
|
|
1539
|
+
currency: zod.string(),
|
|
1540
|
+
startAt: zod.iso.datetime({}),
|
|
1541
|
+
endAt: zod.iso.datetime({}),
|
|
1542
|
+
isActive: zod.boolean()
|
|
1543
|
+
})
|
|
1544
|
+
]).optional(),
|
|
1545
|
+
wholesale: zod.array(
|
|
1546
|
+
zod.strictObject({
|
|
1547
|
+
minQty: zod.number(),
|
|
1548
|
+
amount: zod.number(),
|
|
1549
|
+
currency: zod.string()
|
|
1550
|
+
})
|
|
1551
|
+
).optional()
|
|
1552
|
+
});
|
|
1553
|
+
var deleteVariantPricingParams = zod.strictObject({
|
|
1554
|
+
variantId: zod.uuid()
|
|
1555
|
+
});
|
|
1322
1556
|
var createStockItemsBody = zod.strictObject({
|
|
1323
1557
|
name: zod.string(),
|
|
1324
1558
|
sku: zod.string(),
|
|
@@ -1560,22 +1794,31 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
|
|
|
1560
1794
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1561
1795
|
0 && (module.exports = {
|
|
1562
1796
|
ConsumeBatchSourceType,
|
|
1797
|
+
ProductClassification,
|
|
1798
|
+
ProductStatus,
|
|
1563
1799
|
SourceTypeEnum,
|
|
1564
1800
|
consumeBatch,
|
|
1565
1801
|
consumeBatchBody,
|
|
1566
1802
|
consumeBatchParams,
|
|
1567
1803
|
createBatch,
|
|
1568
1804
|
createBatchBody,
|
|
1569
|
-
|
|
1570
|
-
|
|
1805
|
+
createProduct,
|
|
1806
|
+
createProductBody,
|
|
1571
1807
|
createStockItems,
|
|
1572
1808
|
createStockItemsBody,
|
|
1809
|
+
createVariant,
|
|
1810
|
+
createVariantBody,
|
|
1811
|
+
createVariantParams,
|
|
1573
1812
|
createWarehouse,
|
|
1574
1813
|
createWarehouseBody,
|
|
1575
1814
|
deleteApiIdentityAdminRolesId,
|
|
1576
1815
|
deleteApiIdentityAdminRolesIdParams,
|
|
1577
|
-
|
|
1578
|
-
|
|
1816
|
+
deleteProduct,
|
|
1817
|
+
deleteProductParams,
|
|
1818
|
+
deleteVariant,
|
|
1819
|
+
deleteVariantParams,
|
|
1820
|
+
deleteVariantPricing,
|
|
1821
|
+
deleteVariantPricingParams,
|
|
1579
1822
|
deleteWarehouse,
|
|
1580
1823
|
deleteWarehouseParams,
|
|
1581
1824
|
getApiIdentityAdminPermissions,
|
|
@@ -1604,16 +1847,16 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
|
|
|
1604
1847
|
getApiIdentityManage2faResponse,
|
|
1605
1848
|
getApiIdentityManageInfo,
|
|
1606
1849
|
getApiIdentityManageInfoResponse,
|
|
1607
|
-
getCatalogItem,
|
|
1608
|
-
getCatalogItemParams,
|
|
1609
|
-
getCatalogItemResponse,
|
|
1610
1850
|
getConsumeBatchMutationOptions,
|
|
1611
1851
|
getCreateBatchMutationOptions,
|
|
1612
|
-
|
|
1852
|
+
getCreateProductMutationOptions,
|
|
1613
1853
|
getCreateStockItemsMutationOptions,
|
|
1854
|
+
getCreateVariantMutationOptions,
|
|
1614
1855
|
getCreateWarehouseMutationOptions,
|
|
1615
1856
|
getDeleteApiIdentityAdminRolesIdMutationOptions,
|
|
1616
|
-
|
|
1857
|
+
getDeleteProductMutationOptions,
|
|
1858
|
+
getDeleteVariantMutationOptions,
|
|
1859
|
+
getDeleteVariantPricingMutationOptions,
|
|
1617
1860
|
getDeleteWarehouseMutationOptions,
|
|
1618
1861
|
getGetApiIdentityAdminPermissionsQueryKey,
|
|
1619
1862
|
getGetApiIdentityAdminPermissionsQueryOptions,
|
|
@@ -1633,21 +1876,27 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
|
|
|
1633
1876
|
getGetApiIdentityManage2faQueryOptions,
|
|
1634
1877
|
getGetApiIdentityManageInfoQueryKey,
|
|
1635
1878
|
getGetApiIdentityManageInfoQueryOptions,
|
|
1636
|
-
getGetCatalogItemQueryKey,
|
|
1637
|
-
getGetCatalogItemQueryOptions,
|
|
1638
1879
|
getGetHealthQueryKey,
|
|
1639
1880
|
getGetHealthQueryOptions,
|
|
1881
|
+
getGetProductQueryKey,
|
|
1882
|
+
getGetProductQueryOptions,
|
|
1883
|
+
getGetVariantPricingQueryKey,
|
|
1884
|
+
getGetVariantPricingQueryOptions,
|
|
1885
|
+
getGetVariantQueryKey,
|
|
1886
|
+
getGetVariantQueryOptions,
|
|
1640
1887
|
getGetWarehouseByIdQueryKey,
|
|
1641
1888
|
getGetWarehouseByIdQueryOptions,
|
|
1642
1889
|
getGetWarehouseOptionsQueryKey,
|
|
1643
1890
|
getGetWarehouseOptionsQueryOptions,
|
|
1644
1891
|
getHealth,
|
|
1645
|
-
|
|
1646
|
-
|
|
1892
|
+
getListProductsQueryKey,
|
|
1893
|
+
getListProductsQueryOptions,
|
|
1647
1894
|
getListStockItemsQueryKey,
|
|
1648
1895
|
getListStockItemsQueryOptions,
|
|
1649
1896
|
getListStockMovementsQueryKey,
|
|
1650
1897
|
getListStockMovementsQueryOptions,
|
|
1898
|
+
getListVariantsQueryKey,
|
|
1899
|
+
getListVariantsQueryOptions,
|
|
1651
1900
|
getListWarehousesQueryKey,
|
|
1652
1901
|
getListWarehousesQueryOptions,
|
|
1653
1902
|
getPostApiIdentityAdminRolesMutationOptions,
|
|
@@ -1658,6 +1907,9 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
|
|
|
1658
1907
|
getPostApiIdentityManage2faMutationOptions,
|
|
1659
1908
|
getPostApiIdentityManageInfoMutationOptions,
|
|
1660
1909
|
getPostApiIdentityResetPasswordMutationOptions,
|
|
1910
|
+
getProduct,
|
|
1911
|
+
getProductParams,
|
|
1912
|
+
getProductResponse,
|
|
1661
1913
|
getPutApiIdentityAdminRolesIdMutationOptions,
|
|
1662
1914
|
getPutApiIdentityAdminRolesIdPermissionsMutationOptions,
|
|
1663
1915
|
getPutApiIdentityAdminUsersIdActiveMutationOptions,
|
|
@@ -1665,19 +1917,27 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
|
|
|
1665
1917
|
getSearchAddressesQueryKey,
|
|
1666
1918
|
getSearchAddressesQueryOptions,
|
|
1667
1919
|
getToggleWarehouseStatusMutationOptions,
|
|
1668
|
-
|
|
1920
|
+
getUpdateProductMutationOptions,
|
|
1921
|
+
getUpdateVariantMutationOptions,
|
|
1669
1922
|
getUpdateWarehouseMutationOptions,
|
|
1923
|
+
getUpsertVariantPricingMutationOptions,
|
|
1924
|
+
getVariant,
|
|
1925
|
+
getVariantParams,
|
|
1926
|
+
getVariantPricing,
|
|
1927
|
+
getVariantPricingParams,
|
|
1928
|
+
getVariantPricingResponse,
|
|
1929
|
+
getVariantResponse,
|
|
1670
1930
|
getWarehouseById,
|
|
1671
1931
|
getWarehouseByIdParams,
|
|
1672
1932
|
getWarehouseByIdResponse,
|
|
1673
1933
|
getWarehouseOptions,
|
|
1674
1934
|
getWarehouseOptionsResponse,
|
|
1675
1935
|
getWarehouseOptionsResponseItem,
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1936
|
+
listProducts,
|
|
1937
|
+
listProductsQueryPageDefault,
|
|
1938
|
+
listProductsQueryPageSizeDefault,
|
|
1939
|
+
listProductsQueryParams,
|
|
1940
|
+
listProductsResponse,
|
|
1681
1941
|
listStockItems,
|
|
1682
1942
|
listStockItemsQueryDescendingDefault,
|
|
1683
1943
|
listStockItemsQueryPageDefault,
|
|
@@ -1690,6 +1950,12 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
|
|
|
1690
1950
|
listStockMovementsQueryPageSizeDefault,
|
|
1691
1951
|
listStockMovementsQueryParams,
|
|
1692
1952
|
listStockMovementsResponse,
|
|
1953
|
+
listVariants,
|
|
1954
|
+
listVariantsParams,
|
|
1955
|
+
listVariantsQueryPageDefault,
|
|
1956
|
+
listVariantsQueryPageSizeDefault,
|
|
1957
|
+
listVariantsQueryParams,
|
|
1958
|
+
listVariantsResponse,
|
|
1693
1959
|
listWarehouses,
|
|
1694
1960
|
listWarehousesQueryPageDefault,
|
|
1695
1961
|
listWarehousesQueryPageSizeDefault,
|
|
@@ -1732,20 +1998,31 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
|
|
|
1732
1998
|
searchAddressesResponseItem,
|
|
1733
1999
|
toggleWarehouseStatus,
|
|
1734
2000
|
toggleWarehouseStatusParams,
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
2001
|
+
updateProduct,
|
|
2002
|
+
updateProductBody,
|
|
2003
|
+
updateProductParams,
|
|
2004
|
+
updateProductResponse,
|
|
2005
|
+
updateVariant,
|
|
2006
|
+
updateVariantBody,
|
|
2007
|
+
updateVariantParams,
|
|
2008
|
+
updateVariantResponse,
|
|
1739
2009
|
updateWarehouse,
|
|
1740
2010
|
updateWarehouseBody,
|
|
1741
2011
|
updateWarehouseParams,
|
|
2012
|
+
upsertVariantPricing,
|
|
2013
|
+
upsertVariantPricingBody,
|
|
2014
|
+
upsertVariantPricingParams,
|
|
2015
|
+
upsertVariantPricingResponse,
|
|
1742
2016
|
useConsumeBatch,
|
|
1743
2017
|
useCreateBatch,
|
|
1744
|
-
|
|
2018
|
+
useCreateProduct,
|
|
1745
2019
|
useCreateStockItems,
|
|
2020
|
+
useCreateVariant,
|
|
1746
2021
|
useCreateWarehouse,
|
|
1747
2022
|
useDeleteApiIdentityAdminRolesId,
|
|
1748
|
-
|
|
2023
|
+
useDeleteProduct,
|
|
2024
|
+
useDeleteVariant,
|
|
2025
|
+
useDeleteVariantPricing,
|
|
1749
2026
|
useDeleteWarehouse,
|
|
1750
2027
|
useGetApiIdentityAdminPermissions,
|
|
1751
2028
|
useGetApiIdentityAdminRoles,
|
|
@@ -1756,13 +2033,16 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
|
|
|
1756
2033
|
useGetApiIdentityAntiforgery,
|
|
1757
2034
|
useGetApiIdentityManage2fa,
|
|
1758
2035
|
useGetApiIdentityManageInfo,
|
|
1759
|
-
useGetCatalogItem,
|
|
1760
2036
|
useGetHealth,
|
|
2037
|
+
useGetProduct,
|
|
2038
|
+
useGetVariant,
|
|
2039
|
+
useGetVariantPricing,
|
|
1761
2040
|
useGetWarehouseById,
|
|
1762
2041
|
useGetWarehouseOptions,
|
|
1763
|
-
|
|
2042
|
+
useListProducts,
|
|
1764
2043
|
useListStockItems,
|
|
1765
2044
|
useListStockMovements,
|
|
2045
|
+
useListVariants,
|
|
1766
2046
|
useListWarehouses,
|
|
1767
2047
|
usePostApiIdentityAdminRoles,
|
|
1768
2048
|
usePostApiIdentityAdminUsersIdLogout,
|
|
@@ -1778,7 +2058,9 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
|
|
|
1778
2058
|
usePutApiIdentityAdminUsersIdRoles,
|
|
1779
2059
|
useSearchAddresses,
|
|
1780
2060
|
useToggleWarehouseStatus,
|
|
1781
|
-
|
|
1782
|
-
|
|
2061
|
+
useUpdateProduct,
|
|
2062
|
+
useUpdateVariant,
|
|
2063
|
+
useUpdateWarehouse,
|
|
2064
|
+
useUpsertVariantPricing
|
|
1783
2065
|
});
|
|
1784
2066
|
//# sourceMappingURL=index.js.map
|