@edgebound/bigcommerce 0.6.8 → 0.6.9
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/bigcommerce-entities/products/products.service.d.ts +13 -140
- package/dist/bigcommerce-entities/products/products.service.d.ts.map +1 -1
- package/dist/bigcommerce-entities/products/products.service.js +1 -34
- package/dist/bigcommerce-entities/products/products.service.js.map +1 -1
- package/dist/bigcommerce-entities/products/schemas/update-products.schema.d.ts +4 -63
- package/dist/bigcommerce-entities/products/schemas/update-products.schema.d.ts.map +1 -1
- package/dist/bigcommerce-entities/products/schemas/update-products.schema.js +8 -13
- package/dist/bigcommerce-entities/products/schemas/update-products.schema.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
import { BigCommerceFetcherService } from '../../core';
|
|
3
|
-
import { CreateProductInputSchema, DeleteCustomFieldsSchema, FindProductsCriteriaSchema, GetProductDetailsSchema, SetProductInventoryItemSchema,
|
|
3
|
+
import { CreateProductInputSchema, DeleteCustomFieldsSchema, FindProductsCriteriaSchema, GetProductDetailsSchema, SetProductInventoryItemSchema, UpdateProductAttributesSchema, UpdateProductVisibilitySchema } from './schemas';
|
|
4
4
|
/**
|
|
5
5
|
* Service for managing BigCommerce products.
|
|
6
6
|
*
|
|
@@ -93,15 +93,8 @@ export declare class BigCommerceProductsService {
|
|
|
93
93
|
* ]);
|
|
94
94
|
* ```
|
|
95
95
|
*/
|
|
96
|
-
updateProducts(dtos: z.input<typeof
|
|
97
|
-
data:
|
|
98
|
-
id: number;
|
|
99
|
-
custom_fields: {
|
|
100
|
-
name: string;
|
|
101
|
-
value: string;
|
|
102
|
-
id?: number | null | undefined;
|
|
103
|
-
}[];
|
|
104
|
-
} | {
|
|
96
|
+
updateProducts(dtos: z.input<typeof UpdateProductAttributesSchema>[]): import("neverthrow").ResultAsync<{
|
|
97
|
+
data: {
|
|
105
98
|
id: number;
|
|
106
99
|
fixed_cost_shipping_price?: number | null | undefined;
|
|
107
100
|
is_free_shipping?: boolean | undefined;
|
|
@@ -134,7 +127,12 @@ export declare class BigCommerceProductsService {
|
|
|
134
127
|
id?: number | undefined;
|
|
135
128
|
quantity_max?: number | undefined;
|
|
136
129
|
})[] | undefined;
|
|
137
|
-
|
|
130
|
+
custom_fields?: {
|
|
131
|
+
name: string;
|
|
132
|
+
value: string;
|
|
133
|
+
id?: number | null | undefined;
|
|
134
|
+
}[] | undefined;
|
|
135
|
+
}[];
|
|
138
136
|
result: import("neverthrow").Result<{
|
|
139
137
|
data: {
|
|
140
138
|
id: number;
|
|
@@ -156,76 +154,7 @@ export declare class BigCommerceProductsService {
|
|
|
156
154
|
* ```
|
|
157
155
|
*/
|
|
158
156
|
setProductVisibility(dtos: z.input<typeof UpdateProductVisibilitySchema>[]): import("neverthrow").ResultAsync<{
|
|
159
|
-
data:
|
|
160
|
-
id: number;
|
|
161
|
-
custom_fields: {
|
|
162
|
-
name: string;
|
|
163
|
-
value: string;
|
|
164
|
-
id?: number | null | undefined;
|
|
165
|
-
}[];
|
|
166
|
-
} | {
|
|
167
|
-
id: number;
|
|
168
|
-
fixed_cost_shipping_price?: number | null | undefined;
|
|
169
|
-
is_free_shipping?: boolean | undefined;
|
|
170
|
-
name?: string | undefined;
|
|
171
|
-
type?: "physical" | "digital" | undefined;
|
|
172
|
-
sku?: string | undefined;
|
|
173
|
-
description?: string | undefined;
|
|
174
|
-
weight?: number | undefined;
|
|
175
|
-
width?: number | undefined;
|
|
176
|
-
height?: number | undefined;
|
|
177
|
-
depth?: number | undefined;
|
|
178
|
-
price?: number | undefined;
|
|
179
|
-
sale_price?: number | undefined;
|
|
180
|
-
cost_price?: number | undefined;
|
|
181
|
-
categories?: number[] | undefined;
|
|
182
|
-
brand_id?: number | undefined;
|
|
183
|
-
brand_name?: string | undefined;
|
|
184
|
-
inventory_level?: number | undefined;
|
|
185
|
-
inventory_warning_level?: number | undefined;
|
|
186
|
-
inventory_tracking?: "none" | "product" | "variant" | undefined;
|
|
187
|
-
is_visible?: boolean | undefined;
|
|
188
|
-
availability?: "available" | "disabled" | "preorder" | undefined;
|
|
189
|
-
is_featured?: boolean | undefined;
|
|
190
|
-
warranty?: string | undefined;
|
|
191
|
-
bulk_pricing_rules?: ({
|
|
192
|
-
type: "fixed" | "price" | "percent";
|
|
193
|
-
quantity_min: number;
|
|
194
|
-
amount: number;
|
|
195
|
-
} & {
|
|
196
|
-
id?: number | undefined;
|
|
197
|
-
quantity_max?: number | undefined;
|
|
198
|
-
})[] | undefined;
|
|
199
|
-
})[];
|
|
200
|
-
result: import("neverthrow").Result<{
|
|
201
|
-
data: {
|
|
202
|
-
id: number;
|
|
203
|
-
}[];
|
|
204
|
-
}, import("../../core").BigCommerceError>;
|
|
205
|
-
}[], never>;
|
|
206
|
-
/**
|
|
207
|
-
* Updates custom fields for multiple products in batch.
|
|
208
|
-
*
|
|
209
|
-
* @param dtos - Array of product custom fields updates
|
|
210
|
-
* @returns ResultAsync with success/error results for each batch
|
|
211
|
-
*
|
|
212
|
-
* @example
|
|
213
|
-
* ```typescript
|
|
214
|
-
* const result = await productsService.updateCustomFields([
|
|
215
|
-
* { id: 1, custom_fields: [{ name: 'field1', value: 'value1' }] },
|
|
216
|
-
* { id: 2, custom_fields: [{ id: 10, name: 'field2', value: 'value2' }] }
|
|
217
|
-
* ]);
|
|
218
|
-
* ```
|
|
219
|
-
*/
|
|
220
|
-
updateCustomFields(dtos: z.input<typeof UpdateCustomFieldsSchema>[]): import("neverthrow").ResultAsync<{
|
|
221
|
-
data: ({
|
|
222
|
-
id: number;
|
|
223
|
-
custom_fields: {
|
|
224
|
-
name: string;
|
|
225
|
-
value: string;
|
|
226
|
-
id?: number | null | undefined;
|
|
227
|
-
}[];
|
|
228
|
-
} | {
|
|
157
|
+
data: {
|
|
229
158
|
id: number;
|
|
230
159
|
fixed_cost_shipping_price?: number | null | undefined;
|
|
231
160
|
is_free_shipping?: boolean | undefined;
|
|
@@ -258,68 +187,12 @@ export declare class BigCommerceProductsService {
|
|
|
258
187
|
id?: number | undefined;
|
|
259
188
|
quantity_max?: number | undefined;
|
|
260
189
|
})[] | undefined;
|
|
261
|
-
|
|
262
|
-
result: import("neverthrow").Result<{
|
|
263
|
-
data: {
|
|
264
|
-
id: number;
|
|
265
|
-
}[];
|
|
266
|
-
}, import("../../core").BigCommerceError>;
|
|
267
|
-
}[], never>;
|
|
268
|
-
/**
|
|
269
|
-
* Updates product attributes for multiple products in batch.
|
|
270
|
-
*
|
|
271
|
-
* @param dtos - Array of product attributes updates
|
|
272
|
-
* @returns ResultAsync with success/error results for each batch
|
|
273
|
-
*
|
|
274
|
-
* @example
|
|
275
|
-
* ```typescript
|
|
276
|
-
* const result = await productsService.updateProductAttributes([
|
|
277
|
-
* { id: 1, bulk_pricing_rules: [{ quantity_min: 1, quantity_max: 10, type: 'fixed', amount: 10 }] },
|
|
278
|
-
* ]);
|
|
279
|
-
* ```
|
|
280
|
-
*/
|
|
281
|
-
updateProductAttributes(dtos: z.input<typeof UpdateProductAttributesSchema>[]): import("neverthrow").ResultAsync<{
|
|
282
|
-
data: ({
|
|
283
|
-
id: number;
|
|
284
|
-
custom_fields: {
|
|
190
|
+
custom_fields?: {
|
|
285
191
|
name: string;
|
|
286
192
|
value: string;
|
|
287
193
|
id?: number | null | undefined;
|
|
288
|
-
}[];
|
|
289
|
-
}
|
|
290
|
-
id: number;
|
|
291
|
-
fixed_cost_shipping_price?: number | null | undefined;
|
|
292
|
-
is_free_shipping?: boolean | undefined;
|
|
293
|
-
name?: string | undefined;
|
|
294
|
-
type?: "physical" | "digital" | undefined;
|
|
295
|
-
sku?: string | undefined;
|
|
296
|
-
description?: string | undefined;
|
|
297
|
-
weight?: number | undefined;
|
|
298
|
-
width?: number | undefined;
|
|
299
|
-
height?: number | undefined;
|
|
300
|
-
depth?: number | undefined;
|
|
301
|
-
price?: number | undefined;
|
|
302
|
-
sale_price?: number | undefined;
|
|
303
|
-
cost_price?: number | undefined;
|
|
304
|
-
categories?: number[] | undefined;
|
|
305
|
-
brand_id?: number | undefined;
|
|
306
|
-
brand_name?: string | undefined;
|
|
307
|
-
inventory_level?: number | undefined;
|
|
308
|
-
inventory_warning_level?: number | undefined;
|
|
309
|
-
inventory_tracking?: "none" | "product" | "variant" | undefined;
|
|
310
|
-
is_visible?: boolean | undefined;
|
|
311
|
-
availability?: "available" | "disabled" | "preorder" | undefined;
|
|
312
|
-
is_featured?: boolean | undefined;
|
|
313
|
-
warranty?: string | undefined;
|
|
314
|
-
bulk_pricing_rules?: ({
|
|
315
|
-
type: "fixed" | "price" | "percent";
|
|
316
|
-
quantity_min: number;
|
|
317
|
-
amount: number;
|
|
318
|
-
} & {
|
|
319
|
-
id?: number | undefined;
|
|
320
|
-
quantity_max?: number | undefined;
|
|
321
|
-
})[] | undefined;
|
|
322
|
-
})[];
|
|
194
|
+
}[] | undefined;
|
|
195
|
+
}[];
|
|
323
196
|
result: import("neverthrow").Result<{
|
|
324
197
|
data: {
|
|
325
198
|
id: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"products.service.d.ts","sourceRoot":"","sources":["../../../src/bigcommerce-entities/products/products.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAIvD,OAAO,EACL,wBAAwB,EAGxB,wBAAwB,EAExB,0BAA0B,EAE1B,uBAAuB,EAGvB,6BAA6B,EAE7B,
|
|
1
|
+
{"version":3,"file":"products.service.d.ts","sourceRoot":"","sources":["../../../src/bigcommerce-entities/products/products.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAIvD,OAAO,EACL,wBAAwB,EAGxB,wBAAwB,EAExB,0BAA0B,EAE1B,uBAAuB,EAGvB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,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC;;;;IAWlE,OAAO,CAAC,iBAAiB;CAa1B"}
|
|
@@ -160,7 +160,7 @@ let BigCommerceProductsService = class BigCommerceProductsService {
|
|
|
160
160
|
items: dtos,
|
|
161
161
|
batchSize: constants_1.DEFAULTS.products.updateBatchSize,
|
|
162
162
|
limit: constants_1.DEFAULTS.products.updateConcurrency,
|
|
163
|
-
fn: (batch) => (0, validate_1.validateInputData)(z.array(schemas_1.
|
|
163
|
+
fn: (batch) => (0, validate_1.validateInputData)(z.array(schemas_1.UpdateProductAttributesSchema), batch).asyncAndThen((validatedBody) => this.fetcher.fetch({
|
|
164
164
|
isB2B: false,
|
|
165
165
|
method: 'PUT',
|
|
166
166
|
path: 'catalog/products',
|
|
@@ -187,39 +187,6 @@ let BigCommerceProductsService = class BigCommerceProductsService {
|
|
|
187
187
|
setProductVisibility(dtos) {
|
|
188
188
|
return this.updateProducts(dtos);
|
|
189
189
|
}
|
|
190
|
-
/**
|
|
191
|
-
* Updates custom fields for multiple products in batch.
|
|
192
|
-
*
|
|
193
|
-
* @param dtos - Array of product custom fields updates
|
|
194
|
-
* @returns ResultAsync with success/error results for each batch
|
|
195
|
-
*
|
|
196
|
-
* @example
|
|
197
|
-
* ```typescript
|
|
198
|
-
* const result = await productsService.updateCustomFields([
|
|
199
|
-
* { id: 1, custom_fields: [{ name: 'field1', value: 'value1' }] },
|
|
200
|
-
* { id: 2, custom_fields: [{ id: 10, name: 'field2', value: 'value2' }] }
|
|
201
|
-
* ]);
|
|
202
|
-
* ```
|
|
203
|
-
*/
|
|
204
|
-
updateCustomFields(dtos) {
|
|
205
|
-
return this.updateProducts(dtos);
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Updates product attributes for multiple products in batch.
|
|
209
|
-
*
|
|
210
|
-
* @param dtos - Array of product attributes updates
|
|
211
|
-
* @returns ResultAsync with success/error results for each batch
|
|
212
|
-
*
|
|
213
|
-
* @example
|
|
214
|
-
* ```typescript
|
|
215
|
-
* const result = await productsService.updateProductAttributes([
|
|
216
|
-
* { id: 1, bulk_pricing_rules: [{ quantity_min: 1, quantity_max: 10, type: 'fixed', amount: 10 }] },
|
|
217
|
-
* ]);
|
|
218
|
-
* ```
|
|
219
|
-
*/
|
|
220
|
-
updateProductAttributes(dtos) {
|
|
221
|
-
return this.updateProducts(dtos);
|
|
222
|
-
}
|
|
223
190
|
/**
|
|
224
191
|
* Gets detailed information for a specific product.
|
|
225
192
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"products.service.js","sourceRoot":"","sources":["../../../src/bigcommerce-entities/products/products.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,uDAA6C;AAC7C,uCAAyB;AACzB,+CAA2C;AAC3C,qCAAuD;AACvD,yDAAyE;AACzE,mDAAyD;AACzD,6CAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"products.service.js","sourceRoot":"","sources":["../../../src/bigcommerce-entities/products/products.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,uDAA6C;AAC7C,uCAAyB;AACzB,+CAA2C;AAC3C,qCAAuD;AACvD,yDAAyE;AACzE,mDAAyD;AACzD,6CAA8C;AAC9C,uCAgBmB;AAEnB;;;;;;;;;;;;;;;;;;GAkBG;AAEI,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACR;IAA7B,YAA6B,OAAkC;QAAlC,YAAO,GAAP,OAAO,CAA2B;IAAG,CAAC;IAEnE;;;;;;;;;;;;;;;;;OAiBG;IACH,aAAa,CAAC,KAA+C;QAC3D,OAAO,IAAA,4BAAiB,EAAC,kCAAwB,EAAE,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE,CAC9E,IAAI,CAAC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AiB,CAAC,KAAoD;QAC5E,OAAO,IAAA,4BAAiB,EAAC,uCAA6B,EAAE,KAAK,CAAC;aAC3D,YAAY,CAAC,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,EAAE,CAC7C,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;YACjB,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,oBAAoB,SAAS,kBAAkB,aAAa,EAAE;YACpE,YAAY,EAAE,yCAA+B;YAC7C,OAAO,EAAE,IAAI;SACd,CAAC,CACH;aACA,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;CACF,CAAA;AAtPY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,mBAAU,GAAE;qCAE2B,gCAAyB;GADpD,0BAA0B,CAsPtC"}
|
|
@@ -3,14 +3,6 @@ export declare const UpdateProductVisibilitySchema: z.ZodObject<{
|
|
|
3
3
|
id: z.ZodNumber;
|
|
4
4
|
is_visible: z.ZodBoolean;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
|
-
export declare const UpdateCustomFieldsSchema: z.ZodObject<{
|
|
7
|
-
id: z.ZodInt;
|
|
8
|
-
custom_fields: z.ZodArray<z.ZodObject<{
|
|
9
|
-
id: z.ZodNullable<z.ZodOptional<z.ZodInt>>;
|
|
10
|
-
name: z.ZodString;
|
|
11
|
-
value: z.ZodString;
|
|
12
|
-
}, z.core.$strip>>;
|
|
13
|
-
}, z.core.$strip>;
|
|
14
6
|
export declare const UpdateProductAttributesSchema: z.ZodObject<{
|
|
15
7
|
id: z.ZodInt;
|
|
16
8
|
fixed_cost_shipping_price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -59,67 +51,16 @@ export declare const UpdateProductAttributesSchema: z.ZodObject<{
|
|
|
59
51
|
id: z.ZodOptional<z.ZodInt>;
|
|
60
52
|
quantity_max: z.ZodDefault<z.ZodInt>;
|
|
61
53
|
}, z.core.$strip>>>>;
|
|
62
|
-
|
|
63
|
-
export declare const UpdateProductSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
64
|
-
id: z.ZodInt;
|
|
65
|
-
custom_fields: z.ZodArray<z.ZodObject<{
|
|
54
|
+
custom_fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
66
55
|
id: z.ZodNullable<z.ZodOptional<z.ZodInt>>;
|
|
67
56
|
name: z.ZodString;
|
|
68
57
|
value: z.ZodString;
|
|
69
|
-
}, z.core.$strip
|
|
70
|
-
}, z.core.$strip
|
|
71
|
-
id: z.ZodInt;
|
|
72
|
-
fixed_cost_shipping_price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
73
|
-
is_free_shipping: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
-
name: z.ZodOptional<z.ZodString>;
|
|
75
|
-
type: z.ZodOptional<z.ZodEnum<{
|
|
76
|
-
physical: "physical";
|
|
77
|
-
digital: "digital";
|
|
78
|
-
}>>;
|
|
79
|
-
sku: z.ZodOptional<z.ZodString>;
|
|
80
|
-
description: z.ZodOptional<z.ZodString>;
|
|
81
|
-
weight: z.ZodOptional<z.ZodNumber>;
|
|
82
|
-
width: z.ZodOptional<z.ZodNumber>;
|
|
83
|
-
height: z.ZodOptional<z.ZodNumber>;
|
|
84
|
-
depth: z.ZodOptional<z.ZodNumber>;
|
|
85
|
-
price: z.ZodOptional<z.ZodNumber>;
|
|
86
|
-
sale_price: z.ZodOptional<z.ZodNumber>;
|
|
87
|
-
cost_price: z.ZodOptional<z.ZodNumber>;
|
|
88
|
-
categories: z.ZodOptional<z.ZodArray<z.ZodInt>>;
|
|
89
|
-
brand_id: z.ZodOptional<z.ZodInt>;
|
|
90
|
-
brand_name: z.ZodOptional<z.ZodString>;
|
|
91
|
-
inventory_level: z.ZodOptional<z.ZodInt>;
|
|
92
|
-
inventory_warning_level: z.ZodOptional<z.ZodInt>;
|
|
93
|
-
inventory_tracking: z.ZodOptional<z.ZodEnum<{
|
|
94
|
-
none: "none";
|
|
95
|
-
product: "product";
|
|
96
|
-
variant: "variant";
|
|
97
|
-
}>>;
|
|
98
|
-
is_visible: z.ZodOptional<z.ZodBoolean>;
|
|
99
|
-
availability: z.ZodOptional<z.ZodEnum<{
|
|
100
|
-
available: "available";
|
|
101
|
-
disabled: "disabled";
|
|
102
|
-
preorder: "preorder";
|
|
103
|
-
}>>;
|
|
104
|
-
is_featured: z.ZodOptional<z.ZodBoolean>;
|
|
105
|
-
warranty: z.ZodOptional<z.ZodString>;
|
|
106
|
-
bulk_pricing_rules: z.ZodOptional<z.ZodArray<z.ZodIntersection<z.ZodObject<{
|
|
107
|
-
type: z.ZodEnum<{
|
|
108
|
-
fixed: "fixed";
|
|
109
|
-
price: "price";
|
|
110
|
-
percent: "percent";
|
|
111
|
-
}>;
|
|
112
|
-
quantity_min: z.ZodInt;
|
|
113
|
-
amount: z.ZodNumber;
|
|
114
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
115
|
-
id: z.ZodOptional<z.ZodInt>;
|
|
116
|
-
quantity_max: z.ZodDefault<z.ZodInt>;
|
|
117
|
-
}, z.core.$strip>>>>;
|
|
118
|
-
}, z.core.$strip>]>;
|
|
58
|
+
}, z.core.$strip>>>;
|
|
59
|
+
}, z.core.$strip>;
|
|
119
60
|
export declare const UpdateProductsResponseSchema: z.ZodObject<{
|
|
120
61
|
data: z.ZodArray<z.ZodObject<{
|
|
121
62
|
id: z.ZodInt;
|
|
122
63
|
}, z.core.$strip>>;
|
|
123
64
|
}, z.core.$strip>;
|
|
124
|
-
export type BigCommerceUpdateProductInput = z.input<typeof
|
|
65
|
+
export type BigCommerceUpdateProductInput = z.input<typeof UpdateProductAttributesSchema>;
|
|
125
66
|
//# sourceMappingURL=update-products.schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-products.schema.d.ts","sourceRoot":"","sources":["../../../../src/bigcommerce-entities/products/schemas/update-products.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,6BAA6B;;;iBAGxC,CAAC;AAEH,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"update-products.schema.d.ts","sourceRoot":"","sources":["../../../../src/bigcommerce-entities/products/schemas/update-products.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,6BAA6B;;;iBAGxC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6CxC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;iBAEvC,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC"}
|
|
@@ -33,21 +33,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.UpdateProductsResponseSchema = exports.
|
|
36
|
+
exports.UpdateProductsResponseSchema = exports.UpdateProductAttributesSchema = exports.UpdateProductVisibilitySchema = void 0;
|
|
37
37
|
const z = __importStar(require("zod"));
|
|
38
38
|
const price_lists_1 = require("../../price-lists");
|
|
39
39
|
exports.UpdateProductVisibilitySchema = z.object({
|
|
40
40
|
id: z.number(),
|
|
41
41
|
is_visible: z.boolean(),
|
|
42
42
|
});
|
|
43
|
-
exports.UpdateCustomFieldsSchema = z.object({
|
|
44
|
-
id: z.int(),
|
|
45
|
-
custom_fields: z.array(z.object({
|
|
46
|
-
id: z.int().optional().nullable(),
|
|
47
|
-
name: z.string(),
|
|
48
|
-
value: z.string().nonempty(),
|
|
49
|
-
})),
|
|
50
|
-
});
|
|
51
43
|
exports.UpdateProductAttributesSchema = z.object({
|
|
52
44
|
id: z.int(),
|
|
53
45
|
fixed_cost_shipping_price: z.number().nullable().optional(),
|
|
@@ -79,11 +71,14 @@ exports.UpdateProductAttributesSchema = z.object({
|
|
|
79
71
|
quantity_max: z.int().nonnegative().default(0),
|
|
80
72
|
})))
|
|
81
73
|
.optional(),
|
|
74
|
+
custom_fields: z
|
|
75
|
+
.array(z.object({
|
|
76
|
+
id: z.int().optional().nullable(),
|
|
77
|
+
name: z.string(),
|
|
78
|
+
value: z.string().nonempty(),
|
|
79
|
+
}))
|
|
80
|
+
.optional(),
|
|
82
81
|
});
|
|
83
|
-
exports.UpdateProductSchema = z.union([
|
|
84
|
-
exports.UpdateCustomFieldsSchema,
|
|
85
|
-
exports.UpdateProductAttributesSchema,
|
|
86
|
-
]);
|
|
87
82
|
exports.UpdateProductsResponseSchema = z.object({
|
|
88
83
|
data: z.array(z.object({ id: z.int() })),
|
|
89
84
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-products.schema.js","sourceRoot":"","sources":["../../../../src/bigcommerce-entities/products/schemas/update-products.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,mDAA6D;AAChD,QAAA,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE;CACxB,CAAC,CAAC;AAEU,QAAA,
|
|
1
|
+
{"version":3,"file":"update-products.schema.js","sourceRoot":"","sources":["../../../../src/bigcommerce-entities/products/schemas/update-products.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,mDAA6D;AAChD,QAAA,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE;CACxB,CAAC,CAAC;AAEU,QA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CAAC,CAAC,MAAM,CAAC;IACnD,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;CACzC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edgebound/bigcommerce",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.9",
|
|
4
4
|
"types": "./dist/index.d.ts",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"reflect-metadata": "^0.2.2",
|
|
23
23
|
"rxjs": "^7.8.2",
|
|
24
24
|
"zod": "^4.3.3",
|
|
25
|
-
"@edgebound/
|
|
26
|
-
"@edgebound/
|
|
25
|
+
"@edgebound/eslint-config": "0.0.4",
|
|
26
|
+
"@edgebound/typescript-config": "0.0.1"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@nestjs/common": "^11.1.12",
|