@activepieces/piece-bigcommerce 0.1.9 → 0.1.11

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 (125) hide show
  1. package/package.json +7 -12
  2. package/src/index.js +19 -84
  3. package/src/index.d.ts +0 -6
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/create-a-product.d.ts +0 -14
  7. package/src/lib/actions/create-a-product.d.ts.map +0 -1
  8. package/src/lib/actions/create-a-product.js +0 -78
  9. package/src/lib/actions/create-a-product.js.map +0 -1
  10. package/src/lib/actions/create-blog-post.d.ts +0 -16
  11. package/src/lib/actions/create-blog-post.d.ts.map +0 -1
  12. package/src/lib/actions/create-blog-post.js +0 -85
  13. package/src/lib/actions/create-blog-post.js.map +0 -1
  14. package/src/lib/actions/create-customer-address.d.ts +0 -25
  15. package/src/lib/actions/create-customer-address.d.ts.map +0 -1
  16. package/src/lib/actions/create-customer-address.js +0 -83
  17. package/src/lib/actions/create-customer-address.js.map +0 -1
  18. package/src/lib/actions/create-customer.d.ts +0 -13
  19. package/src/lib/actions/create-customer.d.ts.map +0 -1
  20. package/src/lib/actions/create-customer.js +0 -68
  21. package/src/lib/actions/create-customer.js.map +0 -1
  22. package/src/lib/actions/delete-a-product.d.ts +0 -8
  23. package/src/lib/actions/delete-a-product.d.ts.map +0 -1
  24. package/src/lib/actions/delete-a-product.js +0 -34
  25. package/src/lib/actions/delete-a-product.js.map +0 -1
  26. package/src/lib/actions/find-or-create-customer.d.ts +0 -13
  27. package/src/lib/actions/find-or-create-customer.d.ts.map +0 -1
  28. package/src/lib/actions/find-or-create-customer.js +0 -80
  29. package/src/lib/actions/find-or-create-customer.js.map +0 -1
  30. package/src/lib/actions/find-or-create-customers-address.d.ts +0 -25
  31. package/src/lib/actions/find-or-create-customers-address.d.ts.map +0 -1
  32. package/src/lib/actions/find-or-create-customers-address.js +0 -98
  33. package/src/lib/actions/find-or-create-customers-address.js.map +0 -1
  34. package/src/lib/actions/find-or-create-product.d.ts +0 -14
  35. package/src/lib/actions/find-or-create-product.d.ts.map +0 -1
  36. package/src/lib/actions/find-or-create-product.js +0 -82
  37. package/src/lib/actions/find-or-create-product.js.map +0 -1
  38. package/src/lib/actions/get-order.d.ts +0 -8
  39. package/src/lib/actions/get-order.d.ts.map +0 -1
  40. package/src/lib/actions/get-order.js +0 -34
  41. package/src/lib/actions/get-order.js.map +0 -1
  42. package/src/lib/actions/list-categories.d.ts +0 -8
  43. package/src/lib/actions/list-categories.d.ts.map +0 -1
  44. package/src/lib/actions/list-categories.js +0 -37
  45. package/src/lib/actions/list-categories.js.map +0 -1
  46. package/src/lib/actions/list-orders.d.ts +0 -9
  47. package/src/lib/actions/list-orders.d.ts.map +0 -1
  48. package/src/lib/actions/list-orders.js +0 -44
  49. package/src/lib/actions/list-orders.js.map +0 -1
  50. package/src/lib/actions/search-customer-address.d.ts +0 -17
  51. package/src/lib/actions/search-customer-address.d.ts.map +0 -1
  52. package/src/lib/actions/search-customer-address.js +0 -43
  53. package/src/lib/actions/search-customer-address.js.map +0 -1
  54. package/src/lib/actions/search-customer.d.ts +0 -10
  55. package/src/lib/actions/search-customer.d.ts.map +0 -1
  56. package/src/lib/actions/search-customer.js +0 -51
  57. package/src/lib/actions/search-customer.js.map +0 -1
  58. package/src/lib/actions/search-product.d.ts +0 -13
  59. package/src/lib/actions/search-product.d.ts.map +0 -1
  60. package/src/lib/actions/search-product.js +0 -75
  61. package/src/lib/actions/search-product.js.map +0 -1
  62. package/src/lib/actions/update-a-product.d.ts +0 -15
  63. package/src/lib/actions/update-a-product.d.ts.map +0 -1
  64. package/src/lib/actions/update-a-product.js +0 -79
  65. package/src/lib/actions/update-a-product.js.map +0 -1
  66. package/src/lib/common/auth.d.ts +0 -6
  67. package/src/lib/common/auth.d.ts.map +0 -1
  68. package/src/lib/common/auth.js +0 -48
  69. package/src/lib/common/auth.js.map +0 -1
  70. package/src/lib/common/constants.d.ts +0 -11
  71. package/src/lib/common/constants.d.ts.map +0 -1
  72. package/src/lib/common/constants.js +0 -14
  73. package/src/lib/common/constants.js.map +0 -1
  74. package/src/lib/common/props.d.ts +0 -23
  75. package/src/lib/common/props.d.ts.map +0 -1
  76. package/src/lib/common/props.js +0 -83
  77. package/src/lib/common/props.js.map +0 -1
  78. package/src/lib/common/requests.d.ts +0 -65
  79. package/src/lib/common/requests.d.ts.map +0 -1
  80. package/src/lib/common/requests.js +0 -177
  81. package/src/lib/common/requests.js.map +0 -1
  82. package/src/lib/triggers/abandoned-cart.d.ts +0 -19
  83. package/src/lib/triggers/abandoned-cart.d.ts.map +0 -1
  84. package/src/lib/triggers/abandoned-cart.js +0 -64
  85. package/src/lib/triggers/abandoned-cart.js.map +0 -1
  86. package/src/lib/triggers/cart-created.d.ts +0 -19
  87. package/src/lib/triggers/cart-created.d.ts.map +0 -1
  88. package/src/lib/triggers/cart-created.js +0 -66
  89. package/src/lib/triggers/cart-created.js.map +0 -1
  90. package/src/lib/triggers/customer-address-created.d.ts +0 -19
  91. package/src/lib/triggers/customer-address-created.d.ts.map +0 -1
  92. package/src/lib/triggers/customer-address-created.js +0 -66
  93. package/src/lib/triggers/customer-address-created.js.map +0 -1
  94. package/src/lib/triggers/customer-address-updated.d.ts +0 -19
  95. package/src/lib/triggers/customer-address-updated.d.ts.map +0 -1
  96. package/src/lib/triggers/customer-address-updated.js +0 -66
  97. package/src/lib/triggers/customer-address-updated.js.map +0 -1
  98. package/src/lib/triggers/customer-created.d.ts +0 -19
  99. package/src/lib/triggers/customer-created.d.ts.map +0 -1
  100. package/src/lib/triggers/customer-created.js +0 -68
  101. package/src/lib/triggers/customer-created.js.map +0 -1
  102. package/src/lib/triggers/customer-updated.d.ts +0 -19
  103. package/src/lib/triggers/customer-updated.d.ts.map +0 -1
  104. package/src/lib/triggers/customer-updated.js +0 -66
  105. package/src/lib/triggers/customer-updated.js.map +0 -1
  106. package/src/lib/triggers/order-created.d.ts +0 -19
  107. package/src/lib/triggers/order-created.d.ts.map +0 -1
  108. package/src/lib/triggers/order-created.js +0 -66
  109. package/src/lib/triggers/order-created.js.map +0 -1
  110. package/src/lib/triggers/order-status-updated.d.ts +0 -19
  111. package/src/lib/triggers/order-status-updated.d.ts.map +0 -1
  112. package/src/lib/triggers/order-status-updated.js +0 -66
  113. package/src/lib/triggers/order-status-updated.js.map +0 -1
  114. package/src/lib/triggers/order-updated.d.ts +0 -19
  115. package/src/lib/triggers/order-updated.d.ts.map +0 -1
  116. package/src/lib/triggers/order-updated.js +0 -66
  117. package/src/lib/triggers/order-updated.js.map +0 -1
  118. package/src/lib/triggers/product-created.d.ts +0 -19
  119. package/src/lib/triggers/product-created.d.ts.map +0 -1
  120. package/src/lib/triggers/product-created.js +0 -66
  121. package/src/lib/triggers/product-created.js.map +0 -1
  122. package/src/lib/triggers/shipment-created.d.ts +0 -19
  123. package/src/lib/triggers/shipment-created.d.ts.map +0 -1
  124. package/src/lib/triggers/shipment-created.js +0 -66
  125. package/src/lib/triggers/shipment-created.js.map +0 -1
@@ -1,78 +0,0 @@
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
- audience: 'both',
14
- aiMetadata: {
15
- description: 'Creates a new catalog product in a BigCommerce store. Use to add an item to the store. Requires name, type (physical or digital), weight, and price; SKU, description, and brand_id are optional. Not idempotent: each call adds a new product, so search the catalog first if it may already exist.',
16
- idempotent: false,
17
- },
18
- props: {
19
- name: pieces_framework_1.Property.ShortText({
20
- displayName: 'Product Name',
21
- description: 'Name of the product',
22
- required: true,
23
- }),
24
- type: pieces_framework_1.Property.StaticDropdown({
25
- displayName: 'Product Type',
26
- description: 'Type of product',
27
- required: true,
28
- options: {
29
- options: [
30
- { label: 'Physical', value: 'physical' },
31
- { label: 'Digital', value: 'digital' },
32
- ],
33
- },
34
- }),
35
- sku: pieces_framework_1.Property.ShortText({
36
- displayName: 'SKU',
37
- description: 'Product SKU',
38
- required: false,
39
- }),
40
- description: pieces_framework_1.Property.LongText({
41
- displayName: 'Description',
42
- description: 'Product description',
43
- required: false,
44
- }),
45
- weight: pieces_framework_1.Property.Number({
46
- displayName: 'Weight',
47
- description: 'Product weight',
48
- required: true,
49
- }),
50
- price: pieces_framework_1.Property.Number({
51
- displayName: 'Price',
52
- description: 'Product price',
53
- required: true,
54
- }),
55
- brand_id: pieces_framework_1.Property.Number({
56
- displayName: 'Brand ID',
57
- description: 'Brand ID',
58
- required: false,
59
- }),
60
- },
61
- run(context) {
62
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
63
- return yield requests_1.bigCommerceApiService.createProduct({
64
- auth: context.auth.props,
65
- payload: {
66
- name: context.propsValue.name,
67
- type: context.propsValue.type,
68
- sku: context.propsValue.sku,
69
- description: context.propsValue.description,
70
- weight: context.propsValue.weight,
71
- price: context.propsValue.price,
72
- brand_id: context.propsValue.brand_id,
73
- },
74
- });
75
- });
76
- },
77
- });
78
- //# sourceMappingURL=create-a-product.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-a-product.js","sourceRoot":"","sources":["../../../../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,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,sSAAsS;QACxS,UAAU,EAAE,KAAK;KAClB;IACD,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AAO,EAAE;oBACP,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;oBAC7B,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI;oBAC7B,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG;oBAC3B,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,WAAW;oBAC3C,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM;oBACjC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;oBAC/B,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ;iBACtC;aACF,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,16 +0,0 @@
1
- export declare const createBlogPost: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- instruction: import("@activepieces/pieces-framework/dist/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
- }>;
16
- //# sourceMappingURL=create-blog-post.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-blog-post.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-blog-post.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;EA6EzB,CAAC"}
@@ -1,85 +0,0 @@
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
- audience: 'both',
14
- aiMetadata: {
15
- description: "Creates a blog post in a BigCommerce store's blog. Requires a title and body (HTML supported); author, URL, published date, meta description/keywords, tags, and a published flag are optional. Use to publish store blog content. Not idempotent: each call creates a new post.",
16
- idempotent: false,
17
- },
18
- props: {
19
- title: pieces_framework_1.Property.ShortText({
20
- displayName: 'Title',
21
- description: 'Blog post title',
22
- required: true,
23
- }),
24
- body: pieces_framework_1.Property.LongText({
25
- displayName: 'Body',
26
- description: 'Blog post content (HTML supported)',
27
- required: true,
28
- }),
29
- author: pieces_framework_1.Property.ShortText({
30
- displayName: 'Author',
31
- description: 'Author name',
32
- required: false,
33
- }),
34
- url: pieces_framework_1.Property.ShortText({
35
- displayName: 'URL',
36
- description: 'URL for the public blog post. Example - /blog/welcome-bigcommerce/',
37
- required: false,
38
- }),
39
- published_date: pieces_framework_1.Property.DateTime({
40
- displayName: 'Published Date',
41
- description: 'Published Date for the blog post. Example - Wed, 10 Aug 2022 15:39:15 -0500',
42
- required: false,
43
- }),
44
- meta_description: pieces_framework_1.Property.LongText({
45
- displayName: 'Meta Description',
46
- description: 'Description text for this blog post’s <meta/> element.',
47
- required: false,
48
- }),
49
- meta_keywords: pieces_framework_1.Property.LongText({
50
- displayName: 'Meta Keywords',
51
- description: 'Comma seperated (,) Keywords for this blog post’s <meta/> element. Eg welcome, bigcommerce',
52
- required: false,
53
- }),
54
- tags: pieces_framework_1.Property.Array({
55
- displayName: 'Tags',
56
- description: 'Array of tags',
57
- required: false,
58
- }),
59
- is_published: pieces_framework_1.Property.Checkbox({
60
- displayName: 'Is Published',
61
- description: 'Whether the post is published',
62
- required: false,
63
- defaultValue: true,
64
- }),
65
- },
66
- run(context) {
67
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
68
- return yield requests_1.bigCommerceApiService.createBlogPost({
69
- auth: context.auth.props,
70
- payload: {
71
- title: context.propsValue.title,
72
- body: context.propsValue.body,
73
- author: context.propsValue.author,
74
- tags: context.propsValue.tags,
75
- is_published: context.propsValue.is_published,
76
- meta_description: context.propsValue.meta_description,
77
- meta_keywords: context.propsValue.meta_keywords,
78
- published_date: context.propsValue.published_date,
79
- url: context.propsValue.url,
80
- },
81
- });
82
- });
83
- },
84
- });
85
- //# sourceMappingURL=create-blog-post.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-blog-post.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-blog-post.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,qBAAqB;IAClC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,kRAAkR;QACpR,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,iBAAiB;YAC9B,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,oCAAoC;YACjD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,QAAQ;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AC7B,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"}
@@ -1,25 +0,0 @@
1
- export declare const createCustomerAddress: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- instruction: import("@activepieces/pieces-framework/dist/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").CustomAuthProperty<{
7
- instruction: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
8
- storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
- }>> | import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
11
- instruction: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
12
- storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
- accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
- }>>;
15
- first_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
16
- last_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
17
- address1: import("@activepieces/pieces-framework").ShortTextProperty<true>;
18
- address2: import("@activepieces/pieces-framework").ShortTextProperty<false>;
19
- city: import("@activepieces/pieces-framework").ShortTextProperty<true>;
20
- state_or_province: import("@activepieces/pieces-framework").ShortTextProperty<true>;
21
- postal_code: import("@activepieces/pieces-framework").ShortTextProperty<true>;
22
- country_code: import("@activepieces/pieces-framework").ShortTextProperty<true>;
23
- phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
24
- }>;
25
- //# sourceMappingURL=create-customer-address.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-customer-address.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-customer-address.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;EAwEhC,CAAC"}
@@ -1,83 +0,0 @@
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
- audience: 'both',
15
- aiMetadata: {
16
- description: 'Adds a new address to an existing BigCommerce customer, identified by customer_id (selected from a dropdown of store customers). Requires name, address line 1, city, state/province, postal code, and an ISO 3166-1 alpha-2 country code. Use to attach a shipping or billing address to a customer. Not idempotent: each call appends a new address even if an identical one exists, so use Find or Create Customer’s Address to avoid duplicates.',
17
- idempotent: false,
18
- },
19
- props: {
20
- customer_id: (0, props_1.customerDropdown)({
21
- required: true
22
- }),
23
- first_name: pieces_framework_1.Property.ShortText({
24
- displayName: 'First Name',
25
- required: true,
26
- }),
27
- last_name: pieces_framework_1.Property.ShortText({
28
- displayName: 'Last Name',
29
- required: true,
30
- }),
31
- address1: pieces_framework_1.Property.ShortText({
32
- displayName: 'Address Line 1',
33
- required: true,
34
- }),
35
- address2: pieces_framework_1.Property.ShortText({
36
- displayName: 'Address Line 2',
37
- required: false,
38
- }),
39
- city: pieces_framework_1.Property.ShortText({
40
- displayName: 'City',
41
- required: true,
42
- }),
43
- state_or_province: pieces_framework_1.Property.ShortText({
44
- displayName: 'State/Province',
45
- required: true,
46
- }),
47
- postal_code: pieces_framework_1.Property.ShortText({
48
- displayName: 'Postal Code',
49
- required: true,
50
- }),
51
- country_code: pieces_framework_1.Property.ShortText({
52
- displayName: 'Country Code',
53
- description: 'ISO 3166-1 alpha-2 country code',
54
- required: true,
55
- }),
56
- phone: pieces_framework_1.Property.ShortText({
57
- displayName: 'Phone',
58
- required: false,
59
- }),
60
- },
61
- run(context) {
62
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
63
- return yield requests_1.bigCommerceApiService.createCustomerAddress({
64
- auth: context.auth.props,
65
- payload: [
66
- {
67
- customer_id: context.propsValue.customer_id,
68
- first_name: context.propsValue.first_name,
69
- last_name: context.propsValue.last_name,
70
- address1: context.propsValue.address1,
71
- address2: context.propsValue.address2,
72
- city: context.propsValue.city,
73
- state_or_province: context.propsValue.state_or_province,
74
- postal_code: context.propsValue.postal_code,
75
- country_code: context.propsValue.country_code,
76
- phone: context.propsValue.phone,
77
- },
78
- ],
79
- });
80
- });
81
- },
82
- });
83
- //# sourceMappingURL=create-customer-address.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-customer-address.js","sourceRoot":"","sources":["../../../../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,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,sbAAsb;QACxb,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;Q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,CAAC,UAAU,CAAC,WAAW;wBAC3C,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU;wBACzC,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,SAAS;wBACvC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ;wBACrC,QAAQ,EAAE,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"}
@@ -1,13 +0,0 @@
1
- export declare const createCustomer: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- instruction: import("@activepieces/pieces-framework/dist/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
- }>;
13
- //# sourceMappingURL=create-customer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-customer.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-customer.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc;;;;;;;;;;;EA0DzB,CAAC"}
@@ -1,68 +0,0 @@
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
- audience: 'both',
14
- aiMetadata: {
15
- description: 'Creates a new customer record in a BigCommerce store from an email plus first/last name (company, phone, and notes optional). Use to register a shopper or contact. Not idempotent: each call adds a new customer, and BigCommerce rejects a duplicate email rather than returning the existing one, so call Search Customer or Find or Create Customer first if the customer may already exist.',
16
- idempotent: false,
17
- },
18
- props: {
19
- email: pieces_framework_1.Property.ShortText({
20
- displayName: 'Email',
21
- description: 'Customer email address',
22
- required: true,
23
- }),
24
- first_name: pieces_framework_1.Property.ShortText({
25
- displayName: 'First Name',
26
- description: 'Customer first name',
27
- required: true,
28
- }),
29
- last_name: pieces_framework_1.Property.ShortText({
30
- displayName: 'Last Name',
31
- description: 'Customer last name',
32
- required: true,
33
- }),
34
- company: pieces_framework_1.Property.ShortText({
35
- displayName: 'Company',
36
- description: 'Customer company name',
37
- required: false,
38
- }),
39
- phone: pieces_framework_1.Property.ShortText({
40
- displayName: 'Phone',
41
- description: 'Customer phone number',
42
- required: false,
43
- }),
44
- notes: pieces_framework_1.Property.LongText({
45
- displayName: 'Notes',
46
- description: 'Customer notes',
47
- required: false,
48
- }),
49
- },
50
- run(context) {
51
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
52
- return yield requests_1.bigCommerceApiService.createCustomer({
53
- auth: context.auth.props,
54
- payload: [
55
- {
56
- email: context.propsValue.email,
57
- first_name: context.propsValue.first_name,
58
- last_name: context.propsValue.last_name,
59
- company: context.propsValue.company,
60
- phone: context.propsValue.phone,
61
- notes: context.propsValue.notes,
62
- },
63
- ],
64
- });
65
- });
66
- },
67
- });
68
- //# sourceMappingURL=create-customer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-customer.js","sourceRoot":"","sources":["../../../../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,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,kYAAkY;QACpY,UAAU,EAAE,KAAK;KAClB;IACD,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,CAAC;YAC7B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,qBAAqB;YAClC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,uBAAuB;YACpC,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,uBAAuB;YACpC,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACvB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,gBAAgB;YAC7B,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,gCAAqB,CAAC,cAAc,CAAC;gBAChD,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK;gBACxB,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;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- export declare const deleteAProduct: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- instruction: import("@activepieces/pieces-framework/dist/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
- productId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
- }>;
8
- //# sourceMappingURL=delete-a-product.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete-a-product.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/delete-a-product.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc;;;;;;EAwBzB,CAAC"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteAProduct = 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.deleteAProduct = (0, pieces_framework_1.createAction)({
9
- auth: auth_1.bigcommerceAuth,
10
- name: 'deleteAProduct',
11
- displayName: 'Delete a Product',
12
- description: 'Deletes an existing Product',
13
- audience: 'both',
14
- aiMetadata: {
15
- description: 'Permanently deletes a catalog product from a BigCommerce store by its productId. Use to remove an item from the store. This is destructive and cannot be undone. Effectively idempotent: deleting an already-removed product has no further effect, though the call may error if the id no longer exists.',
16
- idempotent: true,
17
- },
18
- props: {
19
- productId: pieces_framework_1.Property.ShortText({
20
- displayName: 'Product ID',
21
- description: 'The ID of the product to delete',
22
- required: true,
23
- }),
24
- },
25
- run(context) {
26
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
27
- return yield requests_1.bigCommerceApiService.deleteProduct({
28
- auth: context.auth.props,
29
- productId: context.propsValue.productId,
30
- });
31
- });
32
- },
33
- });
34
- //# sourceMappingURL=delete-a-product.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete-a-product.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-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,6BAA6B;IAC1C,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,2SAA2S;QAC7S,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,gCAAqB,CAAC,aAAa,CAAC;gBAC/C,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK;gBACxB,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,SAAS;aACxC,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- export declare const findOrCreateCustomer: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- instruction: import("@activepieces/pieces-framework/dist/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
- }>;
13
- //# sourceMappingURL=find-or-create-customer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-or-create-customer.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-or-create-customer.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB;;;;;;;;;;;EA4E/B,CAAC"}
@@ -1,80 +0,0 @@
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
- audience: 'both',
14
- aiMetadata: {
15
- description: 'Looks up a BigCommerce customer by email (and phone if given) and returns the match if found, otherwise creates a new customer from the supplied details. Use this instead of Create Customer when the customer may already exist, to avoid duplicate-email errors. Idempotent: repeated calls match the same existing record rather than creating duplicates.',
16
- idempotent: true,
17
- },
18
- props: {
19
- email: pieces_framework_1.Property.ShortText({
20
- displayName: 'Email',
21
- description: 'Customer email address',
22
- required: true,
23
- }),
24
- first_name: pieces_framework_1.Property.ShortText({
25
- displayName: 'First Name',
26
- description: 'Customer first name',
27
- required: true,
28
- }),
29
- last_name: pieces_framework_1.Property.ShortText({
30
- displayName: 'Last Name',
31
- description: 'Customer last name',
32
- required: true,
33
- }),
34
- company: pieces_framework_1.Property.ShortText({
35
- displayName: 'Company',
36
- description: 'Customer company name',
37
- required: false,
38
- }),
39
- phone: pieces_framework_1.Property.ShortText({
40
- displayName: 'Phone',
41
- description: 'Customer phone number',
42
- required: false,
43
- }),
44
- notes: pieces_framework_1.Property.LongText({
45
- displayName: 'Notes',
46
- description: 'Customer notes',
47
- required: false,
48
- }),
49
- },
50
- run(context) {
51
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
52
- const params = new URLSearchParams();
53
- params.append('email:in', context.propsValue.email);
54
- if (context.propsValue.phone)
55
- params.append('phone:in', context.propsValue.phone);
56
- const response = yield requests_1.bigCommerceApiService.fetchCustomers({
57
- auth: context.auth.props,
58
- queryString: params.toString(),
59
- });
60
- if (response.data && response.data.length > 0) {
61
- return { found: true, data: response.data };
62
- }
63
- const newCustomer = yield requests_1.bigCommerceApiService.createCustomer({
64
- auth: context.auth.props,
65
- payload: [
66
- {
67
- email: context.propsValue.email,
68
- first_name: context.propsValue.first_name,
69
- last_name: context.propsValue.last_name,
70
- company: context.propsValue.company,
71
- phone: context.propsValue.phone,
72
- notes: context.propsValue.notes,
73
- },
74
- ],
75
- });
76
- return { found: false, data: newCustomer.data };
77
- });
78
- },
79
- });
80
- //# sourceMappingURL=find-or-create-customer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-or-create-customer.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-or-create-customer.ts"],"names":[],"mappings":";;;;AAAA,qE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AC,KAAK,CAAC,CAAC;YAEpD,IAAI,OAAO,CAAC,UAAU,CAAC,KAAK;gBAC1B,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAEtD,MAAM,QAAQ,GAAG,MAAM,gCAAqB,CAAC,cAAc,CAAC;gBAC1D,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK;gBACxB,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE;aAC/B,CAAC,CAAC;YAEH,IAAI,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC9C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC9C,CAAC;YAED,MAAM,WAAW,GAAG,MAAM,gCAAqB,CAAC,cAAc,CAAC;gBAC7D,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK;gBACxB,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"}
@@ -1,25 +0,0 @@
1
- export declare const findOrCreateCustomersAddress: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- instruction: import("@activepieces/pieces-framework/dist/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").CustomAuthProperty<{
7
- instruction: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
8
- storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
- }>> | import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
11
- instruction: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
12
- storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
- accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
- }>>;
15
- first_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
16
- last_name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
17
- address1: import("@activepieces/pieces-framework").ShortTextProperty<true>;
18
- address2: import("@activepieces/pieces-framework").ShortTextProperty<false>;
19
- city: import("@activepieces/pieces-framework").ShortTextProperty<true>;
20
- state_or_province: import("@activepieces/pieces-framework").ShortTextProperty<true>;
21
- postal_code: import("@activepieces/pieces-framework").ShortTextProperty<true>;
22
- country_code: import("@activepieces/pieces-framework").ShortTextProperty<true>;
23
- phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
24
- }>;
25
- //# sourceMappingURL=find-or-create-customers-address.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-or-create-customers-address.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-or-create-customers-address.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;EA+FvC,CAAC"}