@edgebound/bigcommerce 0.5.40 → 0.5.41
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 +24 -1
- package/dist/bigcommerce-entities/products/products.service.d.ts.map +1 -1
- package/dist/bigcommerce-entities/products/products.service.js +28 -0
- package/dist/bigcommerce-entities/products/products.service.js.map +1 -1
- package/dist/bigcommerce-entities/products/schemas/create-product.schema.d.ts +52 -0
- package/dist/bigcommerce-entities/products/schemas/create-product.schema.d.ts.map +1 -0
- package/dist/bigcommerce-entities/products/schemas/create-product.schema.js +75 -0
- package/dist/bigcommerce-entities/products/schemas/create-product.schema.js.map +1 -0
- package/dist/bigcommerce-entities/products/schemas/get-product-details.schema.d.ts +2 -2
- package/dist/bigcommerce-entities/products/schemas/index.d.ts +1 -0
- package/dist/bigcommerce-entities/products/schemas/index.d.ts.map +1 -1
- package/dist/bigcommerce-entities/products/schemas/index.js +1 -0
- package/dist/bigcommerce-entities/products/schemas/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
import { BigCommerceFetcherService } from '../../core';
|
|
3
|
-
import { DeleteCustomFieldsSchema, GetProductDetailsSchema, SetProductInventoryItemSchema, UpdateCustomFieldsSchema, UpdateProductAttributesSchema, UpdateProductSchema, UpdateProductVisibilitySchema } from './schemas';
|
|
3
|
+
import { CreateProductInputSchema, DeleteCustomFieldsSchema, GetProductDetailsSchema, SetProductInventoryItemSchema, UpdateCustomFieldsSchema, UpdateProductAttributesSchema, UpdateProductSchema, UpdateProductVisibilitySchema } from './schemas';
|
|
4
4
|
/**
|
|
5
5
|
* Service for managing BigCommerce products.
|
|
6
6
|
*
|
|
@@ -23,6 +23,29 @@ import { DeleteCustomFieldsSchema, GetProductDetailsSchema, SetProductInventoryI
|
|
|
23
23
|
export declare class BigCommerceProductsService {
|
|
24
24
|
private readonly fetcher;
|
|
25
25
|
constructor(fetcher: BigCommerceFetcherService);
|
|
26
|
+
/**
|
|
27
|
+
* Creates a new product in the BigCommerce catalog.
|
|
28
|
+
*
|
|
29
|
+
* @param input - Product data including name, sku, type, price, and other attributes
|
|
30
|
+
* @returns ResultAsync with the created product's id
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const result = await productsService.createProduct({
|
|
35
|
+
* name: 'New Product',
|
|
36
|
+
* sku: 'SKU-001',
|
|
37
|
+
* type: 'physical',
|
|
38
|
+
* price: 29.99,
|
|
39
|
+
* weight: 1.5,
|
|
40
|
+
* custom_fields: [{ name: 'Color', value: 'Red' }]
|
|
41
|
+
* });
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
createProduct(input: z.input<typeof CreateProductInputSchema>): import("neverthrow").ResultAsync<{
|
|
45
|
+
data: {
|
|
46
|
+
id: number;
|
|
47
|
+
};
|
|
48
|
+
}, import("../../core").BigCommerceError>;
|
|
26
49
|
/**
|
|
27
50
|
* Sets product inventory levels in batch with automatic concurrency control.
|
|
28
51
|
*
|
|
@@ -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,
|
|
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,EAGxB,uBAAuB,EAGvB,6BAA6B,EAE7B,wBAAwB,EACxB,6BAA6B,EAE7B,mBAAmB,E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) {
|
|
77
77
|
this.fetcher = fetcher;
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Creates a new product in the BigCommerce catalog.
|
|
81
|
+
*
|
|
82
|
+
* @param input - Product data including name, sku, type, price, and other attributes
|
|
83
|
+
* @returns ResultAsync with the created product's id
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```typescript
|
|
87
|
+
* const result = await productsService.createProduct({
|
|
88
|
+
* name: 'New Product',
|
|
89
|
+
* sku: 'SKU-001',
|
|
90
|
+
* type: 'physical',
|
|
91
|
+
* price: 29.99,
|
|
92
|
+
* weight: 1.5,
|
|
93
|
+
* custom_fields: [{ name: 'Color', value: 'Red' }]
|
|
94
|
+
* });
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
createProduct(input) {
|
|
98
|
+
return (0, validate_1.validateInputData)(schemas_1.CreateProductInputSchema, input).asyncAndThen((body) => this.fetcher.fetch({
|
|
99
|
+
isB2B: false,
|
|
100
|
+
method: 'POST',
|
|
101
|
+
path: 'catalog/products',
|
|
102
|
+
version: 'v3',
|
|
103
|
+
body,
|
|
104
|
+
resultSchema: schemas_1.CreateProductResponseSchema,
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
79
107
|
/**
|
|
80
108
|
* Sets product inventory levels in batch with automatic concurrency control.
|
|
81
109
|
*
|
|
@@ -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":";;;;;;;;;;;;;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odEnum<{
|
|
6
|
+
physical: "physical";
|
|
7
|
+
digital: "digital";
|
|
8
|
+
}>;
|
|
9
|
+
custom_fields: z.ZodArray<z.ZodObject<{
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
value: z.ZodString;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
fixed_cost_shipping_price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
14
|
+
is_free_shipping: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
description: z.ZodOptional<z.ZodString>;
|
|
16
|
+
weight: z.ZodNumber;
|
|
17
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
price: z.ZodNumber;
|
|
21
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodInt>>;
|
|
22
|
+
brand_id: z.ZodOptional<z.ZodInt>;
|
|
23
|
+
brand_name: z.ZodOptional<z.ZodString>;
|
|
24
|
+
inventory_level: z.ZodOptional<z.ZodInt>;
|
|
25
|
+
inventory_warning_level: z.ZodOptional<z.ZodInt>;
|
|
26
|
+
inventory_tracking: z.ZodOptional<z.ZodEnum<{
|
|
27
|
+
none: "none";
|
|
28
|
+
product: "product";
|
|
29
|
+
variant: "variant";
|
|
30
|
+
}>>;
|
|
31
|
+
is_visible: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
is_featured: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
warranty: z.ZodOptional<z.ZodString>;
|
|
34
|
+
bulk_pricing_rules: z.ZodOptional<z.ZodArray<z.ZodIntersection<z.ZodObject<{
|
|
35
|
+
type: z.ZodEnum<{
|
|
36
|
+
fixed: "fixed";
|
|
37
|
+
price: "price";
|
|
38
|
+
percent: "percent";
|
|
39
|
+
}>;
|
|
40
|
+
quantity_min: z.ZodInt;
|
|
41
|
+
amount: z.ZodNumber;
|
|
42
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
43
|
+
quantity_max: z.ZodDefault<z.ZodInt>;
|
|
44
|
+
}, z.core.$strip>>>>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
export declare const CreateProductResponseSchema: z.ZodObject<{
|
|
47
|
+
data: z.ZodObject<{
|
|
48
|
+
id: z.ZodInt;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export type BigCommerceCreateProductInput = z.input<typeof CreateProductInputSchema>;
|
|
52
|
+
//# sourceMappingURL=create-product.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-product.schema.d.ts","sourceRoot":"","sources":["../../../../src/bigcommerce-entities/products/schemas/create-product.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoCnC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;iBAItC,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.CreateProductResponseSchema = exports.CreateProductInputSchema = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const price_lists_1 = require("../../price-lists");
|
|
39
|
+
exports.CreateProductInputSchema = z.object({
|
|
40
|
+
name: z.string().nonempty(),
|
|
41
|
+
sku: z.string().nonempty(),
|
|
42
|
+
type: z.enum(['physical', 'digital']),
|
|
43
|
+
custom_fields: z.array(z.object({
|
|
44
|
+
name: z.string(),
|
|
45
|
+
value: z.string().nonempty(),
|
|
46
|
+
})),
|
|
47
|
+
fixed_cost_shipping_price: z.number().nullable().optional(),
|
|
48
|
+
is_free_shipping: z.boolean().optional(),
|
|
49
|
+
description: z.string().optional(),
|
|
50
|
+
weight: z.number(),
|
|
51
|
+
width: z.number().optional(),
|
|
52
|
+
height: z.number().optional(),
|
|
53
|
+
depth: z.number().optional(),
|
|
54
|
+
price: z.number().nonnegative(),
|
|
55
|
+
categories: z.array(z.int()).optional(),
|
|
56
|
+
brand_id: z.int().optional(),
|
|
57
|
+
brand_name: z.string().nonempty().optional(),
|
|
58
|
+
inventory_level: z.int().optional(),
|
|
59
|
+
inventory_warning_level: z.int().optional(),
|
|
60
|
+
inventory_tracking: z.enum(['none', 'product', 'variant']).optional(),
|
|
61
|
+
is_visible: z.boolean().optional(),
|
|
62
|
+
is_featured: z.boolean().optional(),
|
|
63
|
+
warranty: z.string().optional(),
|
|
64
|
+
bulk_pricing_rules: z
|
|
65
|
+
.array(price_lists_1.PriceListBulkInputSchema.omit({ quantity_max: true }).and(z.object({
|
|
66
|
+
quantity_max: z.int().nonnegative().default(0),
|
|
67
|
+
})))
|
|
68
|
+
.optional(),
|
|
69
|
+
});
|
|
70
|
+
exports.CreateProductResponseSchema = z.object({
|
|
71
|
+
data: z.object({
|
|
72
|
+
id: z.int(),
|
|
73
|
+
}),
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=create-product.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-product.schema.js","sourceRoot":"","sources":["../../../../src/bigcommerce-entities/products/schemas/create-product.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,mDAA6D;AAChD,QAAA,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IACrC,aAAa,EAAE,CAAC,CAAC,KAAK,CACpB,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,KAAK,EAAE,CAAC,CAAC,MAAM,E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ClB,KAAK,CACJ,sCAAwB,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,CACvD,CAAC,CAAC,MAAM,CAAC;QACP,YAAY,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;KAC/C,CAAC,CACH,CACF;SACA,QAAQ,EAAE;CACd,CAAC,CAAC;AAEU,QAAA,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE;KACZ,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -8,9 +8,9 @@ export declare const GetProductDetailsSchema: z.ZodObject<{
|
|
|
8
8
|
id: z.ZodInt;
|
|
9
9
|
query: z.ZodOptional<z.ZodObject<{
|
|
10
10
|
include: z.ZodOptional<z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
11
|
+
custom_fields: "custom_fields";
|
|
11
12
|
bulk_pricing_rules: "bulk_pricing_rules";
|
|
12
13
|
channels: "channels";
|
|
13
|
-
custom_fields: "custom_fields";
|
|
14
14
|
images: "images";
|
|
15
15
|
modifiers: "modifiers";
|
|
16
16
|
options: "options";
|
|
@@ -19,7 +19,7 @@ export declare const GetProductDetailsSchema: z.ZodObject<{
|
|
|
19
19
|
reviews: "reviews";
|
|
20
20
|
variants: "variants";
|
|
21
21
|
videos: "videos";
|
|
22
|
-
}>>, z.ZodTransform<string, ("
|
|
22
|
+
}>>, z.ZodTransform<string, ("custom_fields" | "bulk_pricing_rules" | "channels" | "images" | "modifiers" | "options" | "parent_relations" | "primary_image" | "reviews" | "variants" | "videos")[]>>>;
|
|
23
23
|
}, z.core.$strip>>;
|
|
24
24
|
}, z.core.$strip>;
|
|
25
25
|
export declare const ProductPricingBulkSchema: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bigcommerce-entities/products/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/bigcommerce-entities/products/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC"}
|
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./create-product.schema"), exports);
|
|
17
18
|
__exportStar(require("./delete-custom-field.schema"), exports);
|
|
18
19
|
__exportStar(require("./get-all-products.schema"), exports);
|
|
19
20
|
__exportStar(require("./get-product-details.schema"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/bigcommerce-entities/products/schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,4DAA0C;AAC1C,+DAA6C;AAC7C,yDAAuC;AACvC,2DAAyC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/bigcommerce-entities/products/schemas/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,+DAA6C;AAC7C,4DAA0C;AAC1C,+DAA6C;AAC7C,yDAAuC;AACvC,2DAAyC"}
|