@agnocon/piece-bigcommerce 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 (157) hide show
  1. package/LICENSE.MIT-AP +24 -0
  2. package/dist/index.d.ts +6 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +86 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/lib/actions/create-a-product.d.ts +14 -0
  7. package/dist/lib/actions/create-a-product.d.ts.map +1 -0
  8. package/dist/lib/actions/create-a-product.js +80 -0
  9. package/dist/lib/actions/create-a-product.js.map +1 -0
  10. package/dist/lib/actions/create-blog-post.d.ts +16 -0
  11. package/dist/lib/actions/create-blog-post.d.ts.map +1 -0
  12. package/dist/lib/actions/create-blog-post.js +87 -0
  13. package/dist/lib/actions/create-blog-post.js.map +1 -0
  14. package/dist/lib/actions/create-customer-address.d.ts +25 -0
  15. package/dist/lib/actions/create-customer-address.d.ts.map +1 -0
  16. package/dist/lib/actions/create-customer-address.js +85 -0
  17. package/dist/lib/actions/create-customer-address.js.map +1 -0
  18. package/dist/lib/actions/create-customer.d.ts +13 -0
  19. package/dist/lib/actions/create-customer.d.ts.map +1 -0
  20. package/dist/lib/actions/create-customer.js +70 -0
  21. package/dist/lib/actions/create-customer.js.map +1 -0
  22. package/dist/lib/actions/delete-a-product.d.ts +8 -0
  23. package/dist/lib/actions/delete-a-product.d.ts.map +1 -0
  24. package/dist/lib/actions/delete-a-product.js +36 -0
  25. package/dist/lib/actions/delete-a-product.js.map +1 -0
  26. package/dist/lib/actions/find-or-create-customer.d.ts +13 -0
  27. package/dist/lib/actions/find-or-create-customer.d.ts.map +1 -0
  28. package/dist/lib/actions/find-or-create-customer.js +82 -0
  29. package/dist/lib/actions/find-or-create-customer.js.map +1 -0
  30. package/dist/lib/actions/find-or-create-customers-address.d.ts +25 -0
  31. package/dist/lib/actions/find-or-create-customers-address.d.ts.map +1 -0
  32. package/dist/lib/actions/find-or-create-customers-address.js +100 -0
  33. package/dist/lib/actions/find-or-create-customers-address.js.map +1 -0
  34. package/dist/lib/actions/find-or-create-product.d.ts +14 -0
  35. package/dist/lib/actions/find-or-create-product.d.ts.map +1 -0
  36. package/dist/lib/actions/find-or-create-product.js +84 -0
  37. package/dist/lib/actions/find-or-create-product.js.map +1 -0
  38. package/dist/lib/actions/get-order.d.ts +8 -0
  39. package/dist/lib/actions/get-order.d.ts.map +1 -0
  40. package/dist/lib/actions/get-order.js +36 -0
  41. package/dist/lib/actions/get-order.js.map +1 -0
  42. package/dist/lib/actions/list-categories.d.ts +8 -0
  43. package/dist/lib/actions/list-categories.d.ts.map +1 -0
  44. package/dist/lib/actions/list-categories.js +39 -0
  45. package/dist/lib/actions/list-categories.js.map +1 -0
  46. package/dist/lib/actions/list-orders.d.ts +9 -0
  47. package/dist/lib/actions/list-orders.d.ts.map +1 -0
  48. package/dist/lib/actions/list-orders.js +46 -0
  49. package/dist/lib/actions/list-orders.js.map +1 -0
  50. package/dist/lib/actions/search-customer-address.d.ts +17 -0
  51. package/dist/lib/actions/search-customer-address.d.ts.map +1 -0
  52. package/dist/lib/actions/search-customer-address.js +45 -0
  53. package/dist/lib/actions/search-customer-address.js.map +1 -0
  54. package/dist/lib/actions/search-customer.d.ts +10 -0
  55. package/dist/lib/actions/search-customer.d.ts.map +1 -0
  56. package/dist/lib/actions/search-customer.js +53 -0
  57. package/dist/lib/actions/search-customer.js.map +1 -0
  58. package/dist/lib/actions/search-product.d.ts +13 -0
  59. package/dist/lib/actions/search-product.d.ts.map +1 -0
  60. package/dist/lib/actions/search-product.js +77 -0
  61. package/dist/lib/actions/search-product.js.map +1 -0
  62. package/dist/lib/actions/update-a-product.d.ts +15 -0
  63. package/dist/lib/actions/update-a-product.d.ts.map +1 -0
  64. package/dist/lib/actions/update-a-product.js +81 -0
  65. package/dist/lib/actions/update-a-product.js.map +1 -0
  66. package/dist/lib/common/auth.d.ts +6 -0
  67. package/dist/lib/common/auth.d.ts.map +1 -0
  68. package/dist/lib/common/auth.js +50 -0
  69. package/dist/lib/common/auth.js.map +1 -0
  70. package/dist/lib/common/constants.d.ts +11 -0
  71. package/dist/lib/common/constants.d.ts.map +1 -0
  72. package/dist/lib/common/constants.js +14 -0
  73. package/dist/lib/common/constants.js.map +1 -0
  74. package/dist/lib/common/props.d.ts +23 -0
  75. package/dist/lib/common/props.d.ts.map +1 -0
  76. package/dist/lib/common/props.js +85 -0
  77. package/dist/lib/common/props.js.map +1 -0
  78. package/dist/lib/common/requests.d.ts +65 -0
  79. package/dist/lib/common/requests.d.ts.map +1 -0
  80. package/dist/lib/common/requests.js +179 -0
  81. package/dist/lib/common/requests.js.map +1 -0
  82. package/dist/lib/triggers/abandoned-cart.d.ts +19 -0
  83. package/dist/lib/triggers/abandoned-cart.d.ts.map +1 -0
  84. package/dist/lib/triggers/abandoned-cart.js +66 -0
  85. package/dist/lib/triggers/abandoned-cart.js.map +1 -0
  86. package/dist/lib/triggers/cart-created.d.ts +19 -0
  87. package/dist/lib/triggers/cart-created.d.ts.map +1 -0
  88. package/dist/lib/triggers/cart-created.js +68 -0
  89. package/dist/lib/triggers/cart-created.js.map +1 -0
  90. package/dist/lib/triggers/customer-address-created.d.ts +19 -0
  91. package/dist/lib/triggers/customer-address-created.d.ts.map +1 -0
  92. package/dist/lib/triggers/customer-address-created.js +68 -0
  93. package/dist/lib/triggers/customer-address-created.js.map +1 -0
  94. package/dist/lib/triggers/customer-address-updated.d.ts +19 -0
  95. package/dist/lib/triggers/customer-address-updated.d.ts.map +1 -0
  96. package/dist/lib/triggers/customer-address-updated.js +68 -0
  97. package/dist/lib/triggers/customer-address-updated.js.map +1 -0
  98. package/dist/lib/triggers/customer-created.d.ts +19 -0
  99. package/dist/lib/triggers/customer-created.d.ts.map +1 -0
  100. package/dist/lib/triggers/customer-created.js +70 -0
  101. package/dist/lib/triggers/customer-created.js.map +1 -0
  102. package/dist/lib/triggers/customer-updated.d.ts +19 -0
  103. package/dist/lib/triggers/customer-updated.d.ts.map +1 -0
  104. package/dist/lib/triggers/customer-updated.js +68 -0
  105. package/dist/lib/triggers/customer-updated.js.map +1 -0
  106. package/dist/lib/triggers/order-created.d.ts +19 -0
  107. package/dist/lib/triggers/order-created.d.ts.map +1 -0
  108. package/dist/lib/triggers/order-created.js +68 -0
  109. package/dist/lib/triggers/order-created.js.map +1 -0
  110. package/dist/lib/triggers/order-status-updated.d.ts +19 -0
  111. package/dist/lib/triggers/order-status-updated.d.ts.map +1 -0
  112. package/dist/lib/triggers/order-status-updated.js +68 -0
  113. package/dist/lib/triggers/order-status-updated.js.map +1 -0
  114. package/dist/lib/triggers/order-updated.d.ts +19 -0
  115. package/dist/lib/triggers/order-updated.d.ts.map +1 -0
  116. package/dist/lib/triggers/order-updated.js +68 -0
  117. package/dist/lib/triggers/order-updated.js.map +1 -0
  118. package/dist/lib/triggers/product-created.d.ts +19 -0
  119. package/dist/lib/triggers/product-created.d.ts.map +1 -0
  120. package/dist/lib/triggers/product-created.js +68 -0
  121. package/dist/lib/triggers/product-created.js.map +1 -0
  122. package/dist/lib/triggers/shipment-created.d.ts +19 -0
  123. package/dist/lib/triggers/shipment-created.d.ts.map +1 -0
  124. package/dist/lib/triggers/shipment-created.js +68 -0
  125. package/dist/lib/triggers/shipment-created.js.map +1 -0
  126. package/package.json +46 -0
  127. package/src/index.ts +81 -0
  128. package/src/lib/actions/create-a-product.ts +73 -0
  129. package/src/lib/actions/create-blog-post.ts +82 -0
  130. package/src/lib/actions/create-customer-address.ts +78 -0
  131. package/src/lib/actions/create-customer.ts +63 -0
  132. package/src/lib/actions/delete-a-product.ts +29 -0
  133. package/src/lib/actions/find-or-create-customer.ts +81 -0
  134. package/src/lib/actions/find-or-create-customers-address.ts +101 -0
  135. package/src/lib/actions/find-or-create-product.ts +81 -0
  136. package/src/lib/actions/get-order.ts +29 -0
  137. package/src/lib/actions/list-categories.ts +31 -0
  138. package/src/lib/actions/list-orders.ts +38 -0
  139. package/src/lib/actions/search-customer-address.ts +42 -0
  140. package/src/lib/actions/search-customer.ts +47 -0
  141. package/src/lib/actions/search-product.ts +69 -0
  142. package/src/lib/actions/update-a-product.ts +78 -0
  143. package/src/lib/common/auth.ts +44 -0
  144. package/src/lib/common/constants.ts +15 -0
  145. package/src/lib/common/props.ts +90 -0
  146. package/src/lib/common/requests.ts +252 -0
  147. package/src/lib/triggers/abandoned-cart.ts +58 -0
  148. package/src/lib/triggers/cart-created.ts +60 -0
  149. package/src/lib/triggers/customer-address-created.ts +60 -0
  150. package/src/lib/triggers/customer-address-updated.ts +60 -0
  151. package/src/lib/triggers/customer-created.ts +62 -0
  152. package/src/lib/triggers/customer-updated.ts +60 -0
  153. package/src/lib/triggers/order-created.ts +60 -0
  154. package/src/lib/triggers/order-status-updated.ts +60 -0
  155. package/src/lib/triggers/order-updated.ts +60 -0
  156. package/src/lib/triggers/product-created.ts +60 -0
  157. package/src/lib/triggers/shipment-created.ts +61 -0
@@ -0,0 +1,13 @@
1
+ export declare const findOrCreateCustomer: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ instruction: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
3
+ storeHash: import("@agnocon/pieces-framework").ShortTextProperty<true>;
4
+ accessToken: import("@agnocon/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ email: import("@agnocon/pieces-framework").ShortTextProperty<true>;
7
+ first_name: import("@agnocon/pieces-framework").ShortTextProperty<true>;
8
+ last_name: import("@agnocon/pieces-framework").ShortTextProperty<true>;
9
+ company: import("@agnocon/pieces-framework").ShortTextProperty<false>;
10
+ phone: import("@agnocon/pieces-framework").ShortTextProperty<false>;
11
+ notes: import("@agnocon/pieces-framework").LongTextProperty<false>;
12
+ }>;
13
+ //# sourceMappingURL=find-or-create-customer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-or-create-customer.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/find-or-create-customer.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,oBAAoB;;;;;;;;;;;EA4E/B,CAAC"}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findOrCreateCustomer = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bigcommerce/src/lib/actions/find-or-create-customer.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const auth_1 = require("../common/auth");
9
+ const requests_1 = require("../common/requests");
10
+ exports.findOrCreateCustomer = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.bigcommerceAuth,
12
+ name: 'findOrCreateCustomer',
13
+ displayName: 'Find or Create Customer',
14
+ description: 'Finds or creates a customer',
15
+ audience: 'both',
16
+ aiMetadata: {
17
+ 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.',
18
+ idempotent: true,
19
+ },
20
+ props: {
21
+ email: pieces_framework_1.Property.ShortText({
22
+ displayName: 'Email',
23
+ description: 'Customer email address',
24
+ required: true,
25
+ }),
26
+ first_name: pieces_framework_1.Property.ShortText({
27
+ displayName: 'First Name',
28
+ description: 'Customer first name',
29
+ required: true,
30
+ }),
31
+ last_name: pieces_framework_1.Property.ShortText({
32
+ displayName: 'Last Name',
33
+ description: 'Customer last name',
34
+ required: true,
35
+ }),
36
+ company: pieces_framework_1.Property.ShortText({
37
+ displayName: 'Company',
38
+ description: 'Customer company name',
39
+ required: false,
40
+ }),
41
+ phone: pieces_framework_1.Property.ShortText({
42
+ displayName: 'Phone',
43
+ description: 'Customer phone number',
44
+ required: false,
45
+ }),
46
+ notes: pieces_framework_1.Property.LongText({
47
+ displayName: 'Notes',
48
+ description: 'Customer notes',
49
+ required: false,
50
+ }),
51
+ },
52
+ run(context) {
53
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
54
+ const params = new URLSearchParams();
55
+ params.append('email:in', context.propsValue.email);
56
+ if (context.propsValue.phone)
57
+ params.append('phone:in', context.propsValue.phone);
58
+ const response = yield requests_1.bigCommerceApiService.fetchCustomers({
59
+ auth: context.auth.props,
60
+ queryString: params.toString(),
61
+ });
62
+ if (response.data && response.data.length > 0) {
63
+ return { found: true, data: response.data };
64
+ }
65
+ const newCustomer = yield requests_1.bigCommerceApiService.createCustomer({
66
+ auth: context.auth.props,
67
+ payload: [
68
+ {
69
+ email: context.propsValue.email,
70
+ first_name: context.propsValue.first_name,
71
+ last_name: context.propsValue.last_name,
72
+ company: context.propsValue.company,
73
+ phone: context.propsValue.phone,
74
+ notes: context.propsValue.notes,
75
+ },
76
+ ],
77
+ });
78
+ return { found: false, data: newCustomer.data };
79
+ });
80
+ },
81
+ });
82
+ //# sourceMappingURL=find-or-create-customer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-or-create-customer.js","sourceRoot":"","sources":["../../../src/lib/actions/find-or-create-customer.ts"],"names":[],"mappings":";;;;AAAA,qHAAqH;AACrH,qEAAqE;AACrE,gEAAmE;AACnE,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,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,gWAAgW;QAClW,UAAU,EAAE,IAAI;KACjB;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;YAC7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AAC,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"}
@@ -0,0 +1,25 @@
1
+ export declare const findOrCreateCustomersAddress: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ instruction: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
3
+ storeHash: import("@agnocon/pieces-framework").ShortTextProperty<true>;
4
+ accessToken: import("@agnocon/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ customer_id: import("@agnocon/pieces-framework").DropdownProperty<unknown, false, import("@agnocon/pieces-framework").CustomAuthProperty<{
7
+ instruction: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
8
+ storeHash: import("@agnocon/pieces-framework").ShortTextProperty<true>;
9
+ accessToken: import("@agnocon/pieces-framework").ShortTextProperty<true>;
10
+ }>> | import("@agnocon/pieces-framework").DropdownProperty<unknown, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
11
+ instruction: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
12
+ storeHash: import("@agnocon/pieces-framework").ShortTextProperty<true>;
13
+ accessToken: import("@agnocon/pieces-framework").ShortTextProperty<true>;
14
+ }>>;
15
+ first_name: import("@agnocon/pieces-framework").ShortTextProperty<true>;
16
+ last_name: import("@agnocon/pieces-framework").ShortTextProperty<true>;
17
+ address1: import("@agnocon/pieces-framework").ShortTextProperty<true>;
18
+ address2: import("@agnocon/pieces-framework").ShortTextProperty<false>;
19
+ city: import("@agnocon/pieces-framework").ShortTextProperty<true>;
20
+ state_or_province: import("@agnocon/pieces-framework").ShortTextProperty<true>;
21
+ postal_code: import("@agnocon/pieces-framework").ShortTextProperty<true>;
22
+ country_code: import("@agnocon/pieces-framework").ShortTextProperty<true>;
23
+ phone: import("@agnocon/pieces-framework").ShortTextProperty<false>;
24
+ }>;
25
+ //# sourceMappingURL=find-or-create-customers-address.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-or-create-customers-address.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/find-or-create-customers-address.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;EA+FvC,CAAC"}
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findOrCreateCustomersAddress = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bigcommerce/src/lib/actions/find-or-create-customers-address.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const auth_1 = require("../common/auth");
9
+ const props_1 = require("../common/props");
10
+ const requests_1 = require("../common/requests");
11
+ exports.findOrCreateCustomersAddress = (0, pieces_framework_1.createAction)({
12
+ auth: auth_1.bigcommerceAuth,
13
+ name: 'findOrCreateCustomersAddress',
14
+ displayName: 'Find or Create Customer’s Address',
15
+ description: 'Finds or creates a customer’s address',
16
+ audience: 'both',
17
+ aiMetadata: {
18
+ description: 'For a given customer_id, looks up that customer’s addresses and returns the one matching the supplied address line 1, city, and postal code if it exists, otherwise creates a new address from the supplied details. Use instead of Create Customer Address when the address may already be on file, to avoid duplicates. Idempotent: repeated calls reuse the matching address rather than appending duplicates.',
19
+ idempotent: true,
20
+ },
21
+ props: {
22
+ customer_id: (0, props_1.customerDropdown)({
23
+ required: true,
24
+ }),
25
+ first_name: pieces_framework_1.Property.ShortText({
26
+ displayName: 'First Name',
27
+ required: true,
28
+ }),
29
+ last_name: pieces_framework_1.Property.ShortText({
30
+ displayName: 'Last Name',
31
+ required: true,
32
+ }),
33
+ address1: pieces_framework_1.Property.ShortText({
34
+ displayName: 'Address Line 1',
35
+ required: true,
36
+ }),
37
+ address2: pieces_framework_1.Property.ShortText({
38
+ displayName: 'Address Line 2',
39
+ required: false,
40
+ }),
41
+ city: pieces_framework_1.Property.ShortText({
42
+ displayName: 'City',
43
+ required: true,
44
+ }),
45
+ state_or_province: pieces_framework_1.Property.ShortText({
46
+ displayName: 'State/Province',
47
+ required: true,
48
+ }),
49
+ postal_code: pieces_framework_1.Property.ShortText({
50
+ displayName: 'Postal Code',
51
+ required: true,
52
+ }),
53
+ country_code: pieces_framework_1.Property.ShortText({
54
+ displayName: 'Country Code',
55
+ description: 'ISO 3166-1 alpha-2 country code',
56
+ required: true,
57
+ }),
58
+ phone: pieces_framework_1.Property.ShortText({
59
+ displayName: 'Phone',
60
+ required: false,
61
+ }),
62
+ },
63
+ run(context) {
64
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
65
+ const params = new URLSearchParams();
66
+ params.append('customer_id:in', context.propsValue.customer_id);
67
+ const response = yield requests_1.bigCommerceApiService.fetchCustomerAddresses({
68
+ auth: context.auth.props,
69
+ queryString: params.toString(),
70
+ });
71
+ if (response.data && response.data.length > 0) {
72
+ const existingAddress = response.data.find((addr) => addr.address1 === context.propsValue.address1 &&
73
+ addr.city === context.propsValue.city &&
74
+ addr.postal_code === context.propsValue.postal_code);
75
+ if (existingAddress) {
76
+ return { found: true, data: existingAddress };
77
+ }
78
+ }
79
+ const newAddress = yield requests_1.bigCommerceApiService.createCustomerAddress({
80
+ auth: context.auth.props,
81
+ payload: [
82
+ {
83
+ customer_id: context.propsValue.customer_id,
84
+ first_name: context.propsValue.first_name,
85
+ last_name: context.propsValue.last_name,
86
+ address1: context.propsValue.address1,
87
+ address2: context.propsValue.address2,
88
+ city: context.propsValue.city,
89
+ state_or_province: context.propsValue.state_or_province,
90
+ postal_code: context.propsValue.postal_code,
91
+ country_code: context.propsValue.country_code,
92
+ phone: context.propsValue.phone,
93
+ },
94
+ ],
95
+ });
96
+ return { found: false, data: newAddress.data };
97
+ });
98
+ },
99
+ });
100
+ //# sourceMappingURL=find-or-create-customers-address.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-or-create-customers-address.js","sourceRoot":"","sources":["../../../src/lib/actions/find-or-create-customers-address.ts"],"names":[],"mappings":";;;;AAAA,8HAA8H;AAC9H,qEAAqE;AACrE,gEAAmE;AACnE,yCAAiD;AACjD,2CAAmD;AACnD,iDAA2D;AAE9C,QAAA,4BAA4B,GAAG,IAAA,+BAAY,EAAC;IACvD,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,mCAAmC;IAChD,WAAW,EAAE,uCAAuC;IACpD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,mZAAmZ;QACrZ,UAAU,EAAE,IAAI;KACjB;IACD,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,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,IAAI;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: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ instruction: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
3
+ storeHash: import("@agnocon/pieces-framework").ShortTextProperty<true>;
4
+ accessToken: import("@agnocon/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ name: import("@agnocon/pieces-framework").ShortTextProperty<true>;
7
+ sku: import("@agnocon/pieces-framework").ShortTextProperty<false>;
8
+ type: import("@agnocon/pieces-framework").StaticDropdownProperty<string, true>;
9
+ weight: import("@agnocon/pieces-framework").NumberProperty<true>;
10
+ price: import("@agnocon/pieces-framework").NumberProperty<true>;
11
+ description: import("@agnocon/pieces-framework").LongTextProperty<false>;
12
+ brand_id: import("@agnocon/pieces-framework").NumberProperty<false>;
13
+ }>;
14
+ //# sourceMappingURL=find-or-create-product.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-or-create-product.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/find-or-create-product.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EA4E9B,CAAC"}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findOrCreateProduct = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bigcommerce/src/lib/actions/find-or-create-product.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const auth_1 = require("../common/auth");
9
+ const requests_1 = require("../common/requests");
10
+ exports.findOrCreateProduct = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.bigcommerceAuth,
12
+ name: 'findOrCreateProduct',
13
+ displayName: 'Find or Create Product',
14
+ description: 'Finds or creates a product',
15
+ audience: 'both',
16
+ aiMetadata: {
17
+ description: 'Looks up a catalog product by exact name and returns the match if found, otherwise creates a new product from the supplied details (type, weight, and price required). Use instead of Create a Product when the item may already exist, to avoid duplicates. Idempotent: repeated calls match the same existing product by name rather than creating duplicates.',
18
+ idempotent: true,
19
+ },
20
+ props: {
21
+ name: pieces_framework_1.Property.ShortText({
22
+ displayName: 'Product Name',
23
+ required: true,
24
+ }),
25
+ sku: pieces_framework_1.Property.ShortText({
26
+ displayName: 'SKU',
27
+ required: false,
28
+ }),
29
+ type: pieces_framework_1.Property.StaticDropdown({
30
+ displayName: 'Product Type',
31
+ required: true,
32
+ options: {
33
+ options: [
34
+ { label: 'Physical', value: 'physical' },
35
+ { label: 'Digital', value: 'digital' },
36
+ ],
37
+ },
38
+ }),
39
+ weight: pieces_framework_1.Property.Number({
40
+ displayName: 'Weight',
41
+ required: true,
42
+ }),
43
+ price: pieces_framework_1.Property.Number({
44
+ displayName: 'Price',
45
+ required: true,
46
+ }),
47
+ description: pieces_framework_1.Property.LongText({
48
+ displayName: 'Description',
49
+ required: false,
50
+ }),
51
+ brand_id: pieces_framework_1.Property.Number({
52
+ displayName: 'Brand ID',
53
+ description: 'Brand ID',
54
+ required: false,
55
+ }),
56
+ },
57
+ run(context) {
58
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
59
+ const params = new URLSearchParams();
60
+ params.append('name', context.propsValue.name);
61
+ const response = yield requests_1.bigCommerceApiService.fetchProducts({
62
+ auth: context.auth.props,
63
+ queryString: params.toString(),
64
+ });
65
+ if (response.data && response.data.length > 0) {
66
+ return { found: true, data: response.data };
67
+ }
68
+ const newProduct = yield requests_1.bigCommerceApiService.createProduct({
69
+ auth: context.auth.props,
70
+ payload: {
71
+ name: context.propsValue.name,
72
+ type: context.propsValue.type,
73
+ sku: context.propsValue.sku,
74
+ description: context.propsValue.description,
75
+ weight: context.propsValue.weight,
76
+ price: context.propsValue.price,
77
+ brand_id: context.propsValue.brand_id,
78
+ },
79
+ });
80
+ return { found: false, data: newProduct.data };
81
+ });
82
+ },
83
+ });
84
+ //# sourceMappingURL=find-or-create-product.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-or-create-product.js","sourceRoot":"","sources":["../../../src/lib/actions/find-or-create-product.ts"],"names":[],"mappings":";;;;AAAA,oHAAoH;AACpH,qEAAqE;AACrE,gEAAmE;AACnE,yCAAiD;AACjD,iDAA2D;AAE9C,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,4BAA4B;IACzC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,kWAAkW;QACpW,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,cAAc;YAC3B,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,GAAG,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,KAAK;YAClB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC5B,WAAW,EAAE,cAAc;YAC3B,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;oBACxC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;iBACvC;aACF;SACF,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,QAAQ;YACrB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,OAAO;YACpB,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC7B,WAAW,EAAE,aAAa;YAC1B,QAAQ,E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E,UAAU,CAAC,IAAI,EAAE,CAAC;QACjD,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const getOrder: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ instruction: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
3
+ storeHash: import("@agnocon/pieces-framework").ShortTextProperty<true>;
4
+ accessToken: import("@agnocon/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ orderId: import("@agnocon/pieces-framework").ShortTextProperty<true>;
7
+ }>;
8
+ //# sourceMappingURL=get-order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-order.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/get-order.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,QAAQ;;;;;;EAwBnB,CAAC"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getOrder = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bigcommerce/src/lib/actions/get-order.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const auth_1 = require("../common/auth");
9
+ const requests_1 = require("../common/requests");
10
+ exports.getOrder = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.bigcommerceAuth,
12
+ name: 'getOrder',
13
+ displayName: 'Get Order',
14
+ description: 'Gets details of an order',
15
+ audience: 'both',
16
+ aiMetadata: {
17
+ description: 'Retrieves the full details of a single BigCommerce order by its orderId. Use when you already have an order id (e.g. from an order trigger or List Orders) and need its data. Idempotent read-only lookup with no side effects.',
18
+ idempotent: true,
19
+ },
20
+ props: {
21
+ orderId: pieces_framework_1.Property.ShortText({
22
+ displayName: 'Order ID',
23
+ description: 'The ID of the order to retrieve',
24
+ required: true,
25
+ }),
26
+ },
27
+ run(context) {
28
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
29
+ return yield requests_1.bigCommerceApiService.fetchOrder({
30
+ auth: context.auth.props,
31
+ orderId: context.propsValue.orderId,
32
+ });
33
+ });
34
+ },
35
+ });
36
+ //# sourceMappingURL=get-order.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-order.js","sourceRoot":"","sources":["../../../src/lib/actions/get-order.ts"],"names":[],"mappings":";;;;AAAA,uGAAuG;AACvG,qEAAqE;AACrE,gEAAmE;AACnE,yCAAiD;AACjD,iDAA2D;AAE9C,QAAA,QAAQ,GAAG,IAAA,+BAAY,EAAC;IACnC,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,0BAA0B;IACvC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,iOAAiO;QACnO,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC1B,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,iCAAiC;YAC9C,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,MAAM,gCAAqB,CAAC,UAAU,CAAC;gBAC5C,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK;gBACxB,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO;aACpC,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const listCategories: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ instruction: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
3
+ storeHash: import("@agnocon/pieces-framework").ShortTextProperty<true>;
4
+ accessToken: import("@agnocon/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ name: import("@agnocon/pieces-framework").ShortTextProperty<false>;
7
+ }>;
8
+ //# sourceMappingURL=list-categories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-categories.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/list-categories.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc;;;;;;EA0BzB,CAAC"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listCategories = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bigcommerce/src/lib/actions/list-categories.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const auth_1 = require("../common/auth");
9
+ const requests_1 = require("../common/requests");
10
+ exports.listCategories = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.bigcommerceAuth,
12
+ name: 'listCategories',
13
+ displayName: 'List Categories',
14
+ description: 'Lists all categories',
15
+ audience: 'both',
16
+ aiMetadata: {
17
+ description: 'Lists product categories from a BigCommerce store. With no name filter it returns all categories; provide a name to filter to matching categories. Use to discover category names or ids before assigning products. Idempotent read-only query with no side effects.',
18
+ idempotent: true,
19
+ },
20
+ props: {
21
+ name: pieces_framework_1.Property.ShortText({
22
+ displayName: 'Category Name',
23
+ description: 'Filter by category name',
24
+ required: false,
25
+ }),
26
+ },
27
+ run(context) {
28
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
29
+ const qParams = new URLSearchParams();
30
+ if (context.propsValue.name)
31
+ qParams.append('name', context.propsValue.name);
32
+ return yield requests_1.bigCommerceApiService.fetchCategories({
33
+ auth: context.auth.props,
34
+ queryString: qParams.toString(),
35
+ });
36
+ });
37
+ },
38
+ });
39
+ //# sourceMappingURL=list-categories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-categories.js","sourceRoot":"","sources":["../../../src/lib/actions/list-categories.ts"],"names":[],"mappings":";;;;AAAA,6GAA6G;AAC7G,qEAAqE;AACrE,gEAAmE;AACnE,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,sBAAsB;IACnC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,sQAAsQ;QACxQ,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,yBAAyB;YACtC,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,OAAO,GAAG,IAAI,eAAe,EAAE,CAAC;YACtC,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI;gBAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAC7E,OAAO,MAAM,gCAAqB,CAAC,eAAe,CAAC;gBACjD,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK;gBACxB,WAAW,EAAE,OAAO,CAAC,QAAQ,EAAE;aAChC,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ export declare const listOrders: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ instruction: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
3
+ storeHash: import("@agnocon/pieces-framework").ShortTextProperty<true>;
4
+ accessToken: import("@agnocon/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ customer_id: import("@agnocon/pieces-framework").NumberProperty<false>;
7
+ status_id: import("@agnocon/pieces-framework").NumberProperty<false>;
8
+ }>;
9
+ //# sourceMappingURL=list-orders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-orders.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/list-orders.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,UAAU;;;;;;;EAiCrB,CAAC"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listOrders = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bigcommerce/src/lib/actions/list-orders.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const auth_1 = require("../common/auth");
9
+ const requests_1 = require("../common/requests");
10
+ exports.listOrders = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.bigcommerceAuth,
12
+ name: 'listOrders',
13
+ displayName: 'List Orders',
14
+ description: 'Lists all orders',
15
+ audience: 'both',
16
+ aiMetadata: {
17
+ description: 'Lists orders from a BigCommerce store. With no filters it returns all orders; optionally narrow by customer_id and/or status_id to a subset. Use to browse or find orders when you do not have a specific order id. Idempotent read-only query with no side effects.',
18
+ idempotent: true,
19
+ },
20
+ props: {
21
+ customer_id: pieces_framework_1.Property.Number({
22
+ displayName: 'Customer ID',
23
+ description: 'Filter by customer ID',
24
+ required: false,
25
+ }),
26
+ status_id: pieces_framework_1.Property.Number({
27
+ displayName: 'Status ID',
28
+ description: 'Filter by status ID',
29
+ required: false,
30
+ }),
31
+ },
32
+ run(context) {
33
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
34
+ const qParams = new URLSearchParams();
35
+ if (context.propsValue.customer_id !== undefined && context.propsValue.customer_id !== null)
36
+ qParams.append('customer_id', context.propsValue.customer_id.toString());
37
+ if (context.propsValue.status_id !== undefined && context.propsValue.status_id !== null)
38
+ qParams.append('status_id', context.propsValue.status_id.toString());
39
+ return yield requests_1.bigCommerceApiService.fetchOrders({
40
+ auth: context.auth.props,
41
+ queryString: qParams.toString(),
42
+ });
43
+ });
44
+ },
45
+ });
46
+ //# sourceMappingURL=list-orders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-orders.js","sourceRoot":"","sources":["../../../src/lib/actions/list-orders.ts"],"names":[],"mappings":";;;;AAAA,yGAAyG;AACzG,qEAAqE;AACrE,gEAAmE;AACnE,yCAAiD;AACjD,iDAA2D;AAE9C,QAAA,UAAU,GAAG,IAAA,+BAAY,EAAC;IACrC,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,kBAAkB;IAC/B,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,sQAAsQ;QACxQ,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC3B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,uBAAuB;YACpC,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,SAAS,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACzB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,qBAAqB;YAClC,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,OAAO,GAAG,IAAI,eAAe,EAAE,CAAC;YACtC,IAAI,OAAO,CAAC,UAAU,CAAC,WAAW,KAAK,SAAS,IAAI,OAAO,CAAC,UAAU,CAAC,WAAW,KAAK,IAAI;gBAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;YACtK,IAAI,OAAO,CAAC,UAAU,CAAC,SAAS,KAAK,SAAS,IAAI,OAAO,CAAC,UAAU,CAAC,SAAS,KAAK,IAAI;gBAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;YAE9J,OAAO,MAAM,gCAAqB,CAAC,WAAW,CAAC;gBAC7C,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK;gBACxB,WAAW,EAAE,OAAO,CAAC,QAAQ,EAAE;aAChC,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ export declare const searchCustomerAddress: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ instruction: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
3
+ storeHash: import("@agnocon/pieces-framework").ShortTextProperty<true>;
4
+ accessToken: import("@agnocon/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ customer_ids: import("@agnocon/pieces-framework").MultiSelectDropdownProperty<unknown, false, import("@agnocon/pieces-framework").CustomAuthProperty<{
7
+ instruction: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
8
+ storeHash: import("@agnocon/pieces-framework").ShortTextProperty<true>;
9
+ accessToken: import("@agnocon/pieces-framework").ShortTextProperty<true>;
10
+ }>> | import("@agnocon/pieces-framework").MultiSelectDropdownProperty<unknown, true, import("@agnocon/pieces-framework").CustomAuthProperty<{
11
+ instruction: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
12
+ storeHash: import("@agnocon/pieces-framework").ShortTextProperty<true>;
13
+ accessToken: import("@agnocon/pieces-framework").ShortTextProperty<true>;
14
+ }>>;
15
+ name: import("@agnocon/pieces-framework").ShortTextProperty<false>;
16
+ }>;
17
+ //# sourceMappingURL=search-customer-address.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-customer-address.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/search-customer-address.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;EAoChC,CAAC"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.searchCustomerAddress = void 0;
4
+ const tslib_1 = require("tslib");
5
+ // Vendored from Activepieces packages/pieces/community/bigcommerce/src/lib/actions/search-customer-address.ts (MIT).
6
+ // Generated by packages/scripts/vendor-ap.mjs - do not edit by hand.
7
+ const pieces_framework_1 = require("@agnocon/pieces-framework");
8
+ const requests_1 = require("../common/requests");
9
+ const auth_1 = require("../common/auth");
10
+ const props_1 = require("../common/props");
11
+ exports.searchCustomerAddress = (0, pieces_framework_1.createAction)({
12
+ auth: auth_1.bigcommerceAuth,
13
+ name: 'searchCustomerAddress',
14
+ displayName: 'Search Customer Address',
15
+ description: 'Searches for a customer’s address',
16
+ audience: 'both',
17
+ aiMetadata: {
18
+ description: 'Searches customer addresses in a BigCommerce store, optionally filtered by one or more customer ids and/or a name. With no filters it returns all addresses; supplying filters narrows to matches. Use to look up addresses belonging to specific customers. Idempotent read-only query with no side effects.',
19
+ idempotent: true,
20
+ },
21
+ props: {
22
+ customer_ids: (0, props_1.multiCustomerDropdown)({
23
+ required: false,
24
+ }),
25
+ name: pieces_framework_1.Property.ShortText({
26
+ displayName: 'Name',
27
+ description: 'Customer name to search for',
28
+ required: false,
29
+ }),
30
+ },
31
+ run(context) {
32
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
33
+ const params = new URLSearchParams();
34
+ if (context.propsValue.customer_ids)
35
+ params.append('customer_ids:in', context.propsValue.customer_ids.join(','));
36
+ if (context.propsValue.name)
37
+ params.append('name:in', `${context.propsValue.name}`);
38
+ return yield requests_1.bigCommerceApiService.fetchCustomerAddresses({
39
+ auth: context.auth.props,
40
+ queryString: params.toString(),
41
+ });
42
+ });
43
+ },
44
+ });
45
+ //# sourceMappingURL=search-customer-address.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-customer-address.js","sourceRoot":"","sources":["../../../src/lib/actions/search-customer-address.ts"],"names":[],"mappings":";;;;AAAA,qHAAqH;AACrH,qEAAqE;AACrE,gEAAmE;AACnE,iDAA2D;AAC3D,yCAAiD;AACjD,2CAAwD;AAE3C,QAAA,qBAAqB,GAAG,IAAA,+BAAY,EAAC;IAChD,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,mCAAmC;IAChD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,+SAA+S;QACjT,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,YAAY,EAAE,IAAA,6BAAqB,EAAC;YAClC,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,6BAA6B;YAC1C,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;YACrC,IAAI,OAAO,CAAC,UAAU,CAAC,YAAY;gBACjC,MAAM,CAAC,MAAM,CACX,iBAAiB,EAChB,OAAO,CAAC,UAAU,CAAC,YAAyB,CAAC,IAAI,CAAC,GAAG,CAAC,CACxD,CAAC;YACJ,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI;gBACzB,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;YAEzD,OAAO,MAAM,gCAAqB,CAAC,sBAAsB,CAAC;gBACxD,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK;gBACxB,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE;aAC/B,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare const searchCustomer: import("@agnocon/pieces-framework").IAction<import("@agnocon/pieces-framework").CustomAuthProperty<{
2
+ instruction: import("@agnocon/pieces-framework/dist/lib/property/input/markdown-property").MarkDownProperty;
3
+ storeHash: import("@agnocon/pieces-framework").ShortTextProperty<true>;
4
+ accessToken: import("@agnocon/pieces-framework").ShortTextProperty<true>;
5
+ }>, {
6
+ email: import("@agnocon/pieces-framework").ShortTextProperty<false>;
7
+ phone: import("@agnocon/pieces-framework").ShortTextProperty<false>;
8
+ name: import("@agnocon/pieces-framework").ShortTextProperty<false>;
9
+ }>;
10
+ //# sourceMappingURL=search-customer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-customer.d.ts","sourceRoot":"","sources":["../../../src/lib/actions/search-customer.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc;;;;;;;;EA0CzB,CAAC"}