@activepieces/piece-bigcommerce 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +7 -0
  2. package/package.json +32 -0
  3. package/src/index.d.ts +5 -0
  4. package/src/index.js +74 -0
  5. package/src/index.js.map +1 -0
  6. package/src/lib/actions/create-a-product.d.ts +13 -0
  7. package/src/lib/actions/create-a-product.js +74 -0
  8. package/src/lib/actions/create-a-product.js.map +1 -0
  9. package/src/lib/actions/create-blog-post.d.ts +15 -0
  10. package/src/lib/actions/create-blog-post.js +80 -0
  11. package/src/lib/actions/create-blog-post.js.map +1 -0
  12. package/src/lib/actions/create-customer-address.d.ts +16 -0
  13. package/src/lib/actions/create-customer-address.js +78 -0
  14. package/src/lib/actions/create-customer-address.js.map +1 -0
  15. package/src/lib/actions/create-customer.d.ts +12 -0
  16. package/src/lib/actions/create-customer.js +63 -0
  17. package/src/lib/actions/create-customer.js.map +1 -0
  18. package/src/lib/actions/find-or-create-customer.d.ts +12 -0
  19. package/src/lib/actions/find-or-create-customer.js +75 -0
  20. package/src/lib/actions/find-or-create-customer.js.map +1 -0
  21. package/src/lib/actions/find-or-create-customers-address.d.ts +16 -0
  22. package/src/lib/actions/find-or-create-customers-address.js +93 -0
  23. package/src/lib/actions/find-or-create-customers-address.js.map +1 -0
  24. package/src/lib/actions/find-or-create-product.d.ts +13 -0
  25. package/src/lib/actions/find-or-create-product.js +77 -0
  26. package/src/lib/actions/find-or-create-product.js.map +1 -0
  27. package/src/lib/actions/search-customer-address.d.ts +8 -0
  28. package/src/lib/actions/search-customer-address.js +38 -0
  29. package/src/lib/actions/search-customer-address.js.map +1 -0
  30. package/src/lib/actions/search-customer.d.ts +9 -0
  31. package/src/lib/actions/search-customer.js +46 -0
  32. package/src/lib/actions/search-customer.js.map +1 -0
  33. package/src/lib/actions/search-product.d.ts +12 -0
  34. package/src/lib/actions/search-product.js +70 -0
  35. package/src/lib/actions/search-product.js.map +1 -0
  36. package/src/lib/common/auth.d.ts +5 -0
  37. package/src/lib/common/auth.js +48 -0
  38. package/src/lib/common/auth.js.map +1 -0
  39. package/src/lib/common/constants.d.ts +10 -0
  40. package/src/lib/common/constants.js +14 -0
  41. package/src/lib/common/constants.js.map +1 -0
  42. package/src/lib/common/props.d.ts +6 -0
  43. package/src/lib/common/props.js +80 -0
  44. package/src/lib/common/props.js.map +1 -0
  45. package/src/lib/common/requests.d.ts +43 -0
  46. package/src/lib/common/requests.js +115 -0
  47. package/src/lib/common/requests.js.map +1 -0
  48. package/src/lib/triggers/abandoned-cart.d.ts +14 -0
  49. package/src/lib/triggers/abandoned-cart.js +61 -0
  50. package/src/lib/triggers/abandoned-cart.js.map +1 -0
  51. package/src/lib/triggers/cart-created.d.ts +14 -0
  52. package/src/lib/triggers/cart-created.js +63 -0
  53. package/src/lib/triggers/cart-created.js.map +1 -0
  54. package/src/lib/triggers/customer-address-created.d.ts +14 -0
  55. package/src/lib/triggers/customer-address-created.js +63 -0
  56. package/src/lib/triggers/customer-address-created.js.map +1 -0
  57. package/src/lib/triggers/customer-address-updated.d.ts +14 -0
  58. package/src/lib/triggers/customer-address-updated.js +63 -0
  59. package/src/lib/triggers/customer-address-updated.js.map +1 -0
  60. package/src/lib/triggers/customer-created.d.ts +14 -0
  61. package/src/lib/triggers/customer-created.js +65 -0
  62. package/src/lib/triggers/customer-created.js.map +1 -0
  63. package/src/lib/triggers/customer-updated.d.ts +14 -0
  64. package/src/lib/triggers/customer-updated.js +63 -0
  65. package/src/lib/triggers/customer-updated.js.map +1 -0
  66. package/src/lib/triggers/order-created.d.ts +14 -0
  67. package/src/lib/triggers/order-created.js +63 -0
  68. package/src/lib/triggers/order-created.js.map +1 -0
  69. package/src/lib/triggers/order-status-updated.d.ts +14 -0
  70. package/src/lib/triggers/order-status-updated.js +63 -0
  71. package/src/lib/triggers/order-status-updated.js.map +1 -0
  72. package/src/lib/triggers/order-updated.d.ts +14 -0
  73. package/src/lib/triggers/order-updated.js +63 -0
  74. package/src/lib/triggers/order-updated.js.map +1 -0
  75. package/src/lib/triggers/product-created.d.ts +14 -0
  76. package/src/lib/triggers/product-created.js +63 -0
  77. package/src/lib/triggers/product-created.js.map +1 -0
  78. package/src/lib/triggers/shipment-created.d.ts +14 -0
  79. package/src/lib/triggers/shipment-created.js +63 -0
  80. package/src/lib/triggers/shipment-created.js.map +1 -0
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # pieces-bigcommerce
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build pieces-bigcommerce` to build the library.
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@activepieces/piece-bigcommerce",
3
+ "version": "0.0.1",
4
+ "type": "commonjs",
5
+ "main": "./src/index.js",
6
+ "types": "./src/index.d.ts",
7
+ "dependencies": {
8
+ "@sinclair/typebox": "0.34.11",
9
+ "axios": "1.8.3",
10
+ "axios-retry": "4.4.1",
11
+ "deepmerge-ts": "7.1.0",
12
+ "mime-types": "2.1.35",
13
+ "nanoid": "3.3.8",
14
+ "semver": "7.6.0",
15
+ "tslib": "^2.3.0",
16
+ "zod": "3.25.76",
17
+ "@activepieces/pieces-common": "0.8.1",
18
+ "@activepieces/pieces-framework": "0.20.1",
19
+ "@activepieces/shared": "0.25.1"
20
+ },
21
+ "overrides": {
22
+ "@tryfabric/martian": {
23
+ "@notionhq/client": "$@notionhq/client"
24
+ },
25
+ "vite": {
26
+ "rollup": "npm:@rollup/wasm-node"
27
+ }
28
+ },
29
+ "resolutions": {
30
+ "rollup": "npm:@rollup/wasm-node"
31
+ }
32
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export declare const bigcommerce: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
3
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
+ }>>;
package/src/index.js ADDED
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bigcommerce = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const abandoned_cart_1 = require("./lib/triggers/abandoned-cart");
7
+ const cart_created_1 = require("./lib/triggers/cart-created");
8
+ const customer_address_created_1 = require("./lib/triggers/customer-address-created");
9
+ const customer_address_updated_1 = require("./lib/triggers/customer-address-updated");
10
+ const customer_created_1 = require("./lib/triggers/customer-created");
11
+ const customer_updated_1 = require("./lib/triggers/customer-updated");
12
+ const order_created_1 = require("./lib/triggers/order-created");
13
+ const order_updated_1 = require("./lib/triggers/order-updated");
14
+ const order_status_updated_1 = require("./lib/triggers/order-status-updated");
15
+ const product_created_1 = require("./lib/triggers/product-created");
16
+ const shipment_created_1 = require("./lib/triggers/shipment-created");
17
+ const create_customer_1 = require("./lib/actions/create-customer");
18
+ const auth_1 = require("./lib/common/auth");
19
+ const create_a_product_1 = require("./lib/actions/create-a-product");
20
+ const create_blog_post_1 = require("./lib/actions/create-blog-post");
21
+ const create_customer_address_1 = require("./lib/actions/create-customer-address");
22
+ const pieces_common_1 = require("@activepieces/pieces-common");
23
+ const constants_1 = require("./lib/common/constants");
24
+ const search_customer_1 = require("./lib/actions/search-customer");
25
+ const search_product_1 = require("./lib/actions/search-product");
26
+ const search_customer_address_1 = require("./lib/actions/search-customer-address");
27
+ const find_or_create_customer_1 = require("./lib/actions/find-or-create-customer");
28
+ const find_or_create_product_1 = require("./lib/actions/find-or-create-product");
29
+ const find_or_create_customers_address_1 = require("./lib/actions/find-or-create-customers-address");
30
+ exports.bigcommerce = (0, pieces_framework_1.createPiece)({
31
+ displayName: 'Bigcommerce',
32
+ description: 'BigCommerce is a leading e-commerce platform that enables businesses to create and manage online stores.',
33
+ auth: auth_1.bigcommerceAuth,
34
+ minimumSupportedRelease: '0.36.1',
35
+ logoUrl: 'https://cdn.activepieces.com/pieces/bigcommerce.png',
36
+ authors: ['gs03-dev', 'sanket-a11y'],
37
+ actions: [
38
+ create_customer_1.createCustomer,
39
+ create_a_product_1.createAProduct,
40
+ create_blog_post_1.createBlogPost,
41
+ create_customer_address_1.createCustomerAddress,
42
+ search_customer_1.searchCustomer,
43
+ search_product_1.searchProduct,
44
+ search_customer_address_1.searchCustomerAddress,
45
+ find_or_create_customer_1.findOrCreateCustomer,
46
+ find_or_create_product_1.findOrCreateProduct,
47
+ find_or_create_customers_address_1.findOrCreateCustomersAddress,
48
+ (0, pieces_common_1.createCustomApiCallAction)({
49
+ auth: auth_1.bigcommerceAuth,
50
+ baseUrl: (auth) => (0, constants_1.GET_BASE_URL)(auth.storeHash),
51
+ authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
52
+ return {
53
+ 'X-Auth-Token': auth.accessToken,
54
+ 'Content-Type': 'application/json',
55
+ Accept: 'application/json',
56
+ };
57
+ }),
58
+ }),
59
+ ],
60
+ triggers: [
61
+ abandoned_cart_1.abandonedCart,
62
+ cart_created_1.cartCreated,
63
+ customer_address_created_1.customerAddressCreated,
64
+ customer_address_updated_1.customerAddressUpdated,
65
+ customer_created_1.customerCreated,
66
+ customer_updated_1.customerUpdated,
67
+ order_created_1.orderCreated,
68
+ order_updated_1.orderUpdated,
69
+ order_status_updated_1.orderStatusUpdated,
70
+ product_created_1.productCreated,
71
+ shipment_created_1.shipmentCreated,
72
+ ],
73
+ });
74
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/bigcommerce/src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kEAA8D;AAC9D,8DAA0D;AAC1D,sFAAiF;AACjF,sFAAiF;AACjF,sEAAkE;AAClE,sEAAkE;AAClE,gEAA4D;AAC5D,gEAA4D;AAC5D,8EAAyE;AACzE,oEAAgE;AAChE,sEAAkE;AAClE,mEAA+D;AAC/D,4CAAoD;AACpD,qEAAgE;AAChE,qEAAgE;AAChE,mFAA8E;AAC9E,+DAAwE;AACxE,sDAAuE;AACvE,mEAA+D;AAC/D,iEAA6D;AAC7D,mFAA8E;AAC9E,mFAA6E;AAC7E,iFAA2E;AAC3E,qGAA8F;AAEjF,QAAA,WAAW,GAAG,IAAA,8BAAW,EAAC;IACrC,WAAW,EAAE,aAAa;IAC1B,WAAW,EACT,0GAA0G;IAC5G,IAAI,EAAE,sBAAe;IACrB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,qDAAqD;IAC9D,OAAO,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC;IACpC,OAAO,EAAE;QACP,gCAAc;QACd,iCAAc;QACd,iCAAc;QACd,+CAAqB;QACrB,gCAAc;QACd,8BAAa;QACb,+CAAqB;QACrB,8CAAoB;QACpB,4CAAmB;QACnB,+DAA4B;QAC5B,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,sBAAe;YACrB,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,wBAAY,EAAE,IAAwB,CAAC,SAAS,CAAC;YACpE,WAAW,EAAE,CAAO,IAAS,EAAE,EAAE;gBAC/B,OAAO;oBACL,cAAc,EAAG,IAAwB,CAAC,WAAW;oBACrD,cAAc,EAAE,kBAAkB;oBAClC,MAAM,EAAE,kBAAkB;iBAC3B,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE;QACR,8BAAa;QACb,0BAAW;QACX,iDAAsB;QACtB,iDAAsB;QACtB,kCAAe;QACf,kCAAe;QACf,4BAAY;QACZ,4BAAY;QACZ,yCAAkB;QAClB,gCAAc;QACd,kCAAe;KAChB;CACF,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ export declare const createAProduct: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
3
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
8
+ sku: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
+ description: import("@activepieces/pieces-framework").LongTextProperty<false>;
10
+ weight: import("@activepieces/pieces-framework").NumberProperty<true>;
11
+ price: import("@activepieces/pieces-framework").NumberProperty<true>;
12
+ brand_id: import("@activepieces/pieces-framework").NumberProperty<false>;
13
+ }>;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createAProduct = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("../common/auth");
7
+ const requests_1 = require("../common/requests");
8
+ exports.createAProduct = (0, pieces_framework_1.createAction)({
9
+ auth: auth_1.bigcommerceAuth,
10
+ name: 'createAProduct',
11
+ displayName: 'Create a Product',
12
+ description: 'Creates a Product',
13
+ props: {
14
+ name: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Product Name',
16
+ description: 'Name of the product',
17
+ required: true,
18
+ }),
19
+ type: pieces_framework_1.Property.StaticDropdown({
20
+ displayName: 'Product Type',
21
+ description: 'Type of product',
22
+ required: true,
23
+ options: {
24
+ options: [
25
+ { label: 'Physical', value: 'physical' },
26
+ { label: 'Digital', value: 'digital' },
27
+ ],
28
+ },
29
+ }),
30
+ sku: pieces_framework_1.Property.ShortText({
31
+ displayName: 'SKU',
32
+ description: 'Product SKU',
33
+ required: false,
34
+ }),
35
+ description: pieces_framework_1.Property.LongText({
36
+ displayName: 'Description',
37
+ description: 'Product description',
38
+ required: false,
39
+ }),
40
+ weight: pieces_framework_1.Property.Number({
41
+ displayName: 'Weight',
42
+ description: 'Product weight',
43
+ required: true,
44
+ }),
45
+ price: pieces_framework_1.Property.Number({
46
+ displayName: 'Price',
47
+ description: 'Product price',
48
+ required: true,
49
+ }),
50
+ brand_id: pieces_framework_1.Property.Number({
51
+ displayName: 'Brand ID',
52
+ description: 'Brand ID',
53
+ required: false,
54
+ }),
55
+ },
56
+ run(context) {
57
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
58
+ return yield requests_1.bigCommerceApiService.createProduct({
59
+ auth: context.auth,
60
+ payload: {
61
+ name: context.propsValue.name,
62
+ type: context.propsValue.type,
63
+ sku: context.propsValue.sku,
64
+ description: context.propsValue.description,
65
+ weight: context.propsValue.weight,
66
+ price: context.propsValue.price,
67
+ brand_id: context.propsValue.brand_id,
68
+ },
69
+ });
70
+ ;
71
+ });
72
+ },
73
+ });
74
+ //# sourceMappingURL=create-a-product.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-a-product.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/bigcommerce/src/lib/actions/create-a-product.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAAiD;AACjD,iDAA2D;AAE9C,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,mBAAmB;IAChC,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,qBAAqB;YAClC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC5B,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,iBAAiB;YAC9B,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,K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EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ;iBACtC;aACF,CAAC,CAAC;YAAA,CAAC;QACN,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ export declare const createBlogPost: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
3
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ title: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ body: import("@activepieces/pieces-framework").LongTextProperty<true>;
8
+ author: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
+ url: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
+ published_date: import("@activepieces/pieces-framework").DateTimeProperty<false>;
11
+ meta_description: import("@activepieces/pieces-framework").LongTextProperty<false>;
12
+ meta_keywords: import("@activepieces/pieces-framework").LongTextProperty<false>;
13
+ tags: import("@activepieces/pieces-framework").ArrayProperty<false>;
14
+ is_published: import("@activepieces/pieces-framework").CheckboxProperty<false>;
15
+ }>;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createBlogPost = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("../common/auth");
7
+ const requests_1 = require("../common/requests");
8
+ exports.createBlogPost = (0, pieces_framework_1.createAction)({
9
+ auth: auth_1.bigcommerceAuth,
10
+ name: 'createBlogPost',
11
+ displayName: 'Create Blog Post',
12
+ description: 'Creates a blog post',
13
+ props: {
14
+ title: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Title',
16
+ description: 'Blog post title',
17
+ required: true,
18
+ }),
19
+ body: pieces_framework_1.Property.LongText({
20
+ displayName: 'Body',
21
+ description: 'Blog post content (HTML supported)',
22
+ required: true,
23
+ }),
24
+ author: pieces_framework_1.Property.ShortText({
25
+ displayName: 'Author',
26
+ description: 'Author name',
27
+ required: false,
28
+ }),
29
+ url: pieces_framework_1.Property.ShortText({
30
+ displayName: 'URL',
31
+ description: 'URL for the public blog post. Example - /blog/welcome-bigcommerce/',
32
+ required: false,
33
+ }),
34
+ published_date: pieces_framework_1.Property.DateTime({
35
+ displayName: 'Published Date',
36
+ description: 'Published Date for the blog post. Example - Wed, 10 Aug 2022 15:39:15 -0500',
37
+ required: false,
38
+ }),
39
+ meta_description: pieces_framework_1.Property.LongText({
40
+ displayName: 'Meta Description',
41
+ description: 'Description text for this blog post’s <meta/> element.',
42
+ required: false,
43
+ }),
44
+ meta_keywords: pieces_framework_1.Property.LongText({
45
+ displayName: 'Meta Keywords',
46
+ description: 'Comma seperated (,) Keywords for this blog post’s <meta/> element. Eg welcome, bigcommerce',
47
+ required: false,
48
+ }),
49
+ tags: pieces_framework_1.Property.Array({
50
+ displayName: 'Tags',
51
+ description: 'Array of tags',
52
+ required: false,
53
+ }),
54
+ is_published: pieces_framework_1.Property.Checkbox({
55
+ displayName: 'Is Published',
56
+ description: 'Whether the post is published',
57
+ required: false,
58
+ defaultValue: true,
59
+ }),
60
+ },
61
+ run(context) {
62
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
63
+ return yield requests_1.bigCommerceApiService.createBlogPost({
64
+ auth: context.auth,
65
+ payload: {
66
+ title: context.propsValue.title,
67
+ body: context.propsValue.body,
68
+ author: context.propsValue.author,
69
+ tags: context.propsValue.tags,
70
+ is_published: context.propsValue.is_published,
71
+ meta_description: context.propsValue.meta_description,
72
+ meta_keywords: context.propsValue.meta_keywords,
73
+ published_date: context.propsValue.published_date,
74
+ url: context.propsValue.url,
75
+ },
76
+ });
77
+ });
78
+ },
79
+ });
80
+ //# sourceMappingURL=create-blog-post.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-blog-post.js","sourceRoot":"","sources":["../../../../../../../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AC,KAAK,CAAC;YACnB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,eAAe;YAC5B,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC9B,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,+BAA+B;YAC5C,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,IAAI;SACnB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,gCAAqB,CAAC,cAAc,CAAC;gBAChD,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,OAAO,EAAE;oBACP,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;oBAC/B,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;oBAC7B,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM;oBACjC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;oBAC7B,YAAY,EAAE,OAAO,CAAC,UAAU,CAAC,YAAY;oBAC7C,gBAAgB,EAAE,OAAO,CAAC,UAAU,CAAC,gBAAgB;oBACrD,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,aAAa;oBAC/C,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,cAAc;oBACjD,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG;iBAC5B;aACF,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ export declare const createCustomerAddress: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
3
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ customer_id: import("@activepieces/pieces-framework").DropdownProperty<unknown, false> | import("@activepieces/pieces-framework").DropdownProperty<unknown, true>;
7
+ first_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
+ last_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
+ address1: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
+ address2: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
+ city: import("@activepieces/pieces-framework").ShortTextProperty<true>;
12
+ state_or_province: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
+ postal_code: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
+ country_code: import("@activepieces/pieces-framework").ShortTextProperty<true>;
15
+ phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
16
+ }>;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createCustomerAddress = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("../common/auth");
7
+ const props_1 = require("../common/props");
8
+ const requests_1 = require("../common/requests");
9
+ exports.createCustomerAddress = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.bigcommerceAuth,
11
+ name: 'createCustomerAddress',
12
+ displayName: 'Create Customer Address',
13
+ description: "Creates a customer's address",
14
+ props: {
15
+ customer_id: (0, props_1.customerDropdown)({
16
+ required: true
17
+ }),
18
+ first_name: pieces_framework_1.Property.ShortText({
19
+ displayName: 'First Name',
20
+ required: true,
21
+ }),
22
+ last_name: pieces_framework_1.Property.ShortText({
23
+ displayName: 'Last Name',
24
+ required: true,
25
+ }),
26
+ address1: pieces_framework_1.Property.ShortText({
27
+ displayName: 'Address Line 1',
28
+ required: true,
29
+ }),
30
+ address2: pieces_framework_1.Property.ShortText({
31
+ displayName: 'Address Line 2',
32
+ required: false,
33
+ }),
34
+ city: pieces_framework_1.Property.ShortText({
35
+ displayName: 'City',
36
+ required: true,
37
+ }),
38
+ state_or_province: pieces_framework_1.Property.ShortText({
39
+ displayName: 'State/Province',
40
+ required: true,
41
+ }),
42
+ postal_code: pieces_framework_1.Property.ShortText({
43
+ displayName: 'Postal Code',
44
+ required: true,
45
+ }),
46
+ country_code: pieces_framework_1.Property.ShortText({
47
+ displayName: 'Country Code',
48
+ description: 'ISO 3166-1 alpha-2 country code',
49
+ required: true,
50
+ }),
51
+ phone: pieces_framework_1.Property.ShortText({
52
+ displayName: 'Phone',
53
+ required: false,
54
+ }),
55
+ },
56
+ run(context) {
57
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
58
+ return yield requests_1.bigCommerceApiService.createCustomerAddress({
59
+ auth: context.auth,
60
+ payload: [
61
+ {
62
+ customer_id: context.propsValue.customer_id,
63
+ first_name: context.propsValue.first_name,
64
+ last_name: context.propsValue.last_name,
65
+ address1: context.propsValue.address1,
66
+ address2: context.propsValue.address2,
67
+ city: context.propsValue.city,
68
+ state_or_province: context.propsValue.state_or_province,
69
+ postal_code: context.propsValue.postal_code,
70
+ country_code: context.propsValue.country_code,
71
+ phone: context.propsValue.phone,
72
+ },
73
+ ],
74
+ });
75
+ });
76
+ },
77
+ });
78
+ //# sourceMappingURL=create-customer-address.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-customer-address.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/bigcommerce/src/lib/actions/create-customer-address.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAAiD;AACjD,2CAAmD;AACnD,iDAA2D;AAE9C,QAAA,qBAAqB,GAAG,IAAA,+BAAY,EAAC;IAChD,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,8BAA8B;IAC3C,KAAK,EAAE;QACL,WAAW,EAAE,IAAA,wBAAgB,EAAC;YAC5B,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF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AE,OAAO,CAAC,UAAU,CAAC,QAAQ;wBACrC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;wBAC7B,iBAAiB,EAAE,OAAO,CAAC,UAAU,CAAC,iBAAiB;wBACvD,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,WAAW;wBAC3C,YAAY,EAAE,OAAO,CAAC,UAAU,CAAC,YAAY;wBAC7C,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;qBAChC;iBACF;aACF,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare const createCustomer: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
3
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ first_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
+ last_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
+ company: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
+ phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
+ notes: import("@activepieces/pieces-framework").LongTextProperty<false>;
12
+ }>;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createCustomer = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("../common/auth");
7
+ const requests_1 = require("../common/requests");
8
+ exports.createCustomer = (0, pieces_framework_1.createAction)({
9
+ auth: auth_1.bigcommerceAuth,
10
+ name: 'createCustomer',
11
+ displayName: 'Create Customer',
12
+ description: 'Creates a customer',
13
+ props: {
14
+ email: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Email',
16
+ description: 'Customer email address',
17
+ required: true,
18
+ }),
19
+ first_name: pieces_framework_1.Property.ShortText({
20
+ displayName: 'First Name',
21
+ description: 'Customer first name',
22
+ required: true,
23
+ }),
24
+ last_name: pieces_framework_1.Property.ShortText({
25
+ displayName: 'Last Name',
26
+ description: 'Customer last name',
27
+ required: true,
28
+ }),
29
+ company: pieces_framework_1.Property.ShortText({
30
+ displayName: 'Company',
31
+ description: 'Customer company name',
32
+ required: false,
33
+ }),
34
+ phone: pieces_framework_1.Property.ShortText({
35
+ displayName: 'Phone',
36
+ description: 'Customer phone number',
37
+ required: false,
38
+ }),
39
+ notes: pieces_framework_1.Property.LongText({
40
+ displayName: 'Notes',
41
+ description: 'Customer notes',
42
+ required: false,
43
+ }),
44
+ },
45
+ run(context) {
46
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
47
+ return yield requests_1.bigCommerceApiService.createCustomer({
48
+ auth: context.auth,
49
+ payload: [
50
+ {
51
+ email: context.propsValue.email,
52
+ first_name: context.propsValue.first_name,
53
+ last_name: context.propsValue.last_name,
54
+ company: context.propsValue.company,
55
+ phone: context.propsValue.phone,
56
+ notes: context.propsValue.notes,
57
+ },
58
+ ],
59
+ });
60
+ });
61
+ },
62
+ });
63
+ //# sourceMappingURL=create-customer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-customer.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/bigcommerce/src/lib/actions/create-customer.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAAiD;AACjD,iDAA2D;AAE9C,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,oBAAoB;IACjC,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,wBAAw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Customer: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
3
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ email: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ first_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
+ last_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
+ company: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
+ phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
+ notes: import("@activepieces/pieces-framework").LongTextProperty<false>;
12
+ }>;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findOrCreateCustomer = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("../common/auth");
7
+ const requests_1 = require("../common/requests");
8
+ exports.findOrCreateCustomer = (0, pieces_framework_1.createAction)({
9
+ auth: auth_1.bigcommerceAuth,
10
+ name: 'findOrCreateCustomer',
11
+ displayName: 'Find or Create Customer',
12
+ description: 'Finds or creates a customer',
13
+ props: {
14
+ email: pieces_framework_1.Property.ShortText({
15
+ displayName: 'Email',
16
+ description: 'Customer email address',
17
+ required: true,
18
+ }),
19
+ first_name: pieces_framework_1.Property.ShortText({
20
+ displayName: 'First Name',
21
+ description: 'Customer first name',
22
+ required: true,
23
+ }),
24
+ last_name: pieces_framework_1.Property.ShortText({
25
+ displayName: 'Last Name',
26
+ description: 'Customer last name',
27
+ required: true,
28
+ }),
29
+ company: pieces_framework_1.Property.ShortText({
30
+ displayName: 'Company',
31
+ description: 'Customer company name',
32
+ required: false,
33
+ }),
34
+ phone: pieces_framework_1.Property.ShortText({
35
+ displayName: 'Phone',
36
+ description: 'Customer phone number',
37
+ required: false,
38
+ }),
39
+ notes: pieces_framework_1.Property.LongText({
40
+ displayName: 'Notes',
41
+ description: 'Customer notes',
42
+ required: false,
43
+ }),
44
+ },
45
+ run(context) {
46
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
47
+ const params = new URLSearchParams();
48
+ params.append('email:in', context.propsValue.email);
49
+ if (context.propsValue.phone)
50
+ params.append('phone:in', context.propsValue.phone);
51
+ const response = yield requests_1.bigCommerceApiService.fetchCustomers({
52
+ auth: context.auth,
53
+ queryString: params.toString(),
54
+ });
55
+ if (response.data && response.data.length > 0) {
56
+ return { found: true, data: response.data };
57
+ }
58
+ const newCustomer = yield requests_1.bigCommerceApiService.createCustomer({
59
+ auth: context.auth,
60
+ payload: [
61
+ {
62
+ email: context.propsValue.email,
63
+ first_name: context.propsValue.first_name,
64
+ last_name: context.propsValue.last_name,
65
+ company: context.propsValue.company,
66
+ phone: context.propsValue.phone,
67
+ notes: context.propsValue.notes,
68
+ },
69
+ ],
70
+ });
71
+ return { found: false, data: newCustomer.data };
72
+ });
73
+ },
74
+ });
75
+ //# sourceMappingURL=find-or-create-customer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-or-create-customer.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/bigcommerce/src/lib/actions/find-or-create-customer.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,yCAAiD;AACjD,iDAA2D;AAE9C,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,6BAA6B;IAC1C,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,wBAAwB;YACrC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAA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IAAI,EAAE,CAAC;YAC9C,CAAC;YAED,MAAM,WAAW,GAAG,MAAM,gCAAqB,CAAC,cAAc,CAAC;gBAC7D,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,OAAO,EAAE;oBACP;wBACE,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;wBAC/B,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU;wBACzC,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,SAAS;wBACvC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO;wBACnC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;wBAC/B,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;qBAChC;iBACF;aACF,CAAC,CAAC;YAEH,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC;QAClD,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ export declare const findOrCreateCustomersAddress: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
3
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ customer_id: import("@activepieces/pieces-framework").DropdownProperty<unknown, false> | import("@activepieces/pieces-framework").DropdownProperty<unknown, true>;
7
+ first_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
+ last_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
+ address1: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
+ address2: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
+ city: import("@activepieces/pieces-framework").ShortTextProperty<true>;
12
+ state_or_province: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
+ postal_code: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
+ country_code: import("@activepieces/pieces-framework").ShortTextProperty<true>;
15
+ phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
16
+ }>;