@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
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bigCommerceApiService = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@activepieces/pieces-common");
6
+ const constants_1 = require("./constants");
7
+ function fireHttpRequest(_a) {
8
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ method, path, body, auth, }) {
9
+ const BASE_URL = (0, constants_1.GET_BASE_URL)(auth.storeHash);
10
+ return yield pieces_common_1.httpClient
11
+ .sendRequest({
12
+ method,
13
+ url: `${BASE_URL}${path}`,
14
+ headers: {
15
+ 'X-Auth-Token': auth.accessToken,
16
+ 'Content-Type': 'application/json',
17
+ Accept: 'application/json',
18
+ },
19
+ body,
20
+ })
21
+ .then((res) => res.body)
22
+ .catch((err) => {
23
+ throw new Error(`Error in request to ${path}: ${err.message || JSON.stringify(err)}`);
24
+ });
25
+ });
26
+ }
27
+ exports.bigCommerceApiService = {
28
+ createWebhook(_a) {
29
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, payload, }) {
30
+ return yield fireHttpRequest({
31
+ auth,
32
+ path: '/v3/hooks',
33
+ method: pieces_common_1.HttpMethod.POST,
34
+ body: payload,
35
+ });
36
+ });
37
+ },
38
+ createCustomer(_a) {
39
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, payload, }) {
40
+ return yield fireHttpRequest({
41
+ auth,
42
+ path: '/v3/customers',
43
+ method: pieces_common_1.HttpMethod.POST,
44
+ body: payload,
45
+ });
46
+ });
47
+ },
48
+ fetchCustomers(_a) {
49
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, queryString, }) {
50
+ return yield fireHttpRequest({
51
+ auth,
52
+ path: `/v3/customers${queryString ? `?${queryString}` : ''}`,
53
+ method: pieces_common_1.HttpMethod.GET,
54
+ });
55
+ });
56
+ },
57
+ fetchCustomerAddresses(_a) {
58
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, queryString, }) {
59
+ return yield fireHttpRequest({
60
+ auth,
61
+ path: `/v3/customers/addresses${queryString ? `?${queryString}` : ''}`,
62
+ method: pieces_common_1.HttpMethod.GET,
63
+ });
64
+ });
65
+ },
66
+ fetchProducts(_a) {
67
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, queryString, }) {
68
+ return yield fireHttpRequest({
69
+ auth,
70
+ path: `/v3/catalog/products${queryString ? `?${queryString}` : ''}`,
71
+ method: pieces_common_1.HttpMethod.GET,
72
+ });
73
+ });
74
+ },
75
+ createProduct(_a) {
76
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, payload, }) {
77
+ return yield fireHttpRequest({
78
+ auth,
79
+ path: '/v3/catalog/products',
80
+ method: pieces_common_1.HttpMethod.POST,
81
+ body: payload,
82
+ });
83
+ });
84
+ },
85
+ createBlogPost(_a) {
86
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, payload, }) {
87
+ return yield fireHttpRequest({
88
+ auth,
89
+ path: '/v2/blog/posts',
90
+ method: pieces_common_1.HttpMethod.POST,
91
+ body: payload,
92
+ });
93
+ });
94
+ },
95
+ createCustomerAddress(_a) {
96
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, payload, }) {
97
+ return yield fireHttpRequest({
98
+ auth,
99
+ path: '/v3/customers/addresses',
100
+ method: pieces_common_1.HttpMethod.POST,
101
+ body: payload,
102
+ });
103
+ });
104
+ },
105
+ deleteWebhook(_a) {
106
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, webhookId, }) {
107
+ return yield fireHttpRequest({
108
+ auth,
109
+ path: `/v3/hooks/${webhookId}`,
110
+ method: pieces_common_1.HttpMethod.DELETE,
111
+ });
112
+ });
113
+ },
114
+ };
115
+ //# sourceMappingURL=requests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/bigcommerce/src/lib/common/requests.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,14 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const abandonedCart: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
4
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
7
+ instruction: import("dist/packages/pieces/community/framework/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").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
11
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
12
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
+ }>, {}>;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.abandonedCart = 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
+ const TRIGGER_NAME = 'abandoned cart';
9
+ const CACHE_KEY = `${TRIGGER_NAME}-trigger-store-key`;
10
+ const TRIGGER_SCOPE = 'store/cart/abandoned';
11
+ exports.abandonedCart = (0, pieces_framework_1.createTrigger)({
12
+ auth: auth_1.bigcommerceAuth,
13
+ name: 'abandonedCart',
14
+ displayName: 'Abandoned Cart',
15
+ description: 'Triggers when a cart is abandoned',
16
+ props: {},
17
+ sampleData: {
18
+ producer: 'stores/dxqdddcaklwsso',
19
+ hash: '3610addd127e330084ddddd7ddd09b78abfd1a85',
20
+ created_at: 1761809622,
21
+ store_id: '1003425529',
22
+ scope: 'store/cart/abandoned',
23
+ data: {
24
+ type: 'cart',
25
+ id: 'ss-598f-4c95-813b-0ess950562770d',
26
+ },
27
+ },
28
+ type: pieces_framework_1.TriggerStrategy.WEBHOOK,
29
+ onEnable(context) {
30
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
31
+ const webhook = yield requests_1.bigCommerceApiService.createWebhook({
32
+ auth: context.auth,
33
+ payload: {
34
+ scope: TRIGGER_SCOPE,
35
+ destination: context.webhookUrl,
36
+ is_active: true,
37
+ },
38
+ });
39
+ yield context.store.put(CACHE_KEY, webhook.data.id);
40
+ });
41
+ },
42
+ onDisable(context) {
43
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
44
+ const webhookId = yield context.store.get(CACHE_KEY);
45
+ if (webhookId) {
46
+ yield requests_1.bigCommerceApiService.deleteWebhook({
47
+ auth: context.auth,
48
+ webhookId,
49
+ }).then(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
50
+ yield context.store.delete(CACHE_KEY);
51
+ }));
52
+ }
53
+ });
54
+ },
55
+ run(context) {
56
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
57
+ return [context.payload.body];
58
+ });
59
+ },
60
+ });
61
+ //# sourceMappingURL=abandoned-cart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abandoned-cart.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/bigcommerce/src/lib/triggers/abandoned-cart.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,yCAAiD;AACjD,iDAA2D;AAE3D,MAAM,YAAY,GAAG,gBAAgB,CAAC;AACtC,MAAM,SAAS,GAAG,GAAG,YAAY,oBAAoB,CAAC;AACtD,MAAM,aAAa,GAAG,sBAAsB,CAAC;AAEhC,QAAA,aAAa,GAAG,IAAA,gCAAa,EAAC;IACzC,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,mCAAmC;IAChD,KAAK,EAAE,EAAE;IACT,UAAU,EAAC;QACT,QAAQ,EAAE,uBAAuB;QACjC,IAAI,EAAE,0CAA0C;QAChD,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,YAAY;QACtB,KAAK,EAAE,sBAAsB;QAC7B,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,EAAE,EAAE,kCAAkC;SACvC;KACF;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ,CAAC,OAAO;;YACpB,MAAM,OAAO,GAAG,MAAM,gCAAqB,CAAC,aAAa,CAAC;gBACxD,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,OAAO,EAAE;oBACP,KAAK,EAAE,aAAa;oBACpB,WAAW,EAAE,OAAO,CAAC,UAAU;oBAC/B,SAAS,EAAE,IAAI;iBAChB;aACF,CAAC,CAAC;YAEH,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtD,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAW,CAAC;YAE/D,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,gCAAqB,CAAC,aAAa,CAAC;oBACxC,IAAI,EAAE,OAAO,CAAC,IAAI;oBAClB,SAAS;iBACV,CAAC,CAAC,IAAI,CAAC,GAAS,EAAE;oBACjB,MAAM,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;gBACvC,CAAC,CAAA,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const cartCreated: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
4
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
7
+ instruction: import("dist/packages/pieces/community/framework/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").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
11
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
12
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
+ }>, {}>;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cartCreated = 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
+ const TRIGGER_NAME = 'cart created';
9
+ const CACHE_KEY = `${TRIGGER_NAME}-trigger-store-key`;
10
+ const TRIGGER_SCOPE = 'store/cart/created';
11
+ exports.cartCreated = (0, pieces_framework_1.createTrigger)({
12
+ auth: auth_1.bigcommerceAuth,
13
+ name: 'cartCreated',
14
+ displayName: 'Cart Created',
15
+ description: 'Triggers when a new cart is created',
16
+ props: {},
17
+ sampleData: {
18
+ producer: 'stores/dxqdddcaklwsso',
19
+ hash: '3610addd127e330084ddddd7ddd09b78abfd1a85',
20
+ created_at: 1761809622,
21
+ store_id: '1003425529',
22
+ scope: 'store/cart/created',
23
+ data: {
24
+ type: 'cart',
25
+ id: 'ss-598f-4c95-813b-0ess950562770d',
26
+ },
27
+ },
28
+ type: pieces_framework_1.TriggerStrategy.WEBHOOK,
29
+ onEnable(context) {
30
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
31
+ const webhook = yield requests_1.bigCommerceApiService.createWebhook({
32
+ auth: context.auth,
33
+ payload: {
34
+ scope: TRIGGER_SCOPE,
35
+ destination: context.webhookUrl,
36
+ is_active: true,
37
+ },
38
+ });
39
+ yield context.store.put(CACHE_KEY, webhook.data.id);
40
+ });
41
+ },
42
+ onDisable(context) {
43
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
44
+ const webhookId = (yield context.store.get(CACHE_KEY));
45
+ if (webhookId) {
46
+ yield requests_1.bigCommerceApiService
47
+ .deleteWebhook({
48
+ auth: context.auth,
49
+ webhookId,
50
+ })
51
+ .then(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
52
+ yield context.store.delete(CACHE_KEY);
53
+ }));
54
+ }
55
+ });
56
+ },
57
+ run(context) {
58
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
59
+ return [context.payload.body];
60
+ });
61
+ },
62
+ });
63
+ //# sourceMappingURL=cart-created.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cart-created.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/bigcommerce/src/lib/triggers/cart-created.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,yCAAiD;AACjD,iDAA2D;AAE3D,MAAM,YAAY,GAAG,cAAc,CAAC;AACpC,MAAM,SAAS,GAAG,GAAG,YAAY,oBAAoB,CAAC;AACtD,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAE9B,QAAA,WAAW,GAAG,IAAA,gCAAa,EAAC;IACvC,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,qCAAqC;IAClD,KAAK,EAAE,EAAE;IACT,UAAU,EAAE;QACV,QAAQ,EAAE,uBAAuB;QACjC,IAAI,EAAE,0CAA0C;QAChD,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,YAAY;QACtB,KAAK,EAAE,oBAAoB;QAC3B,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,EAAE,EAAE,kCAAkC;SACvC;KACF;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ,CAAC,OAAO;;YACpB,MAAM,OAAO,GAAG,MAAM,gCAAqB,CAAC,aAAa,CAAC;gBACxD,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,OAAO,EAAE;oBACP,KAAK,EAAE,aAAa;oBACpB,WAAW,EAAE,OAAO,CAAC,UAAU;oBAC/B,SAAS,EAAE,IAAI;iBAChB;aACF,CAAC,CAAC;YAEH,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtD,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,SAAS,GAAG,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAW,CAAC;YAEjE,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,gCAAqB;qBACxB,aAAa,CAAC;oBACb,IAAI,EAAE,OAAO,CAAC,IAAI;oBAClB,SAAS;iBACV,CAAC;qBACD,IAAI,CAAC,GAAS,EAAE;oBACf,MAAM,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;gBACxC,CAAC,CAAA,CAAC,CAAC;YACP,CAAC;QACH,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const customerAddressCreated: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
4
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
7
+ instruction: import("dist/packages/pieces/community/framework/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").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
11
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
12
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
+ }>, {}>;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.customerAddressCreated = 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
+ const TRIGGER_NAME = 'customer address created';
9
+ const CACHE_KEY = `${TRIGGER_NAME}-trigger-store-key`;
10
+ const TRIGGER_SCOPE = 'store/customer/address/created';
11
+ exports.customerAddressCreated = (0, pieces_framework_1.createTrigger)({
12
+ auth: auth_1.bigcommerceAuth,
13
+ name: 'customerAddressCreated',
14
+ displayName: 'Customer Address Created',
15
+ description: 'Triggers when a new customer address is created',
16
+ props: {},
17
+ sampleData: {
18
+ producer: 'stores/xqcaklwsso',
19
+ hash: 'd7b899890f5e0e98a3e074f018b14b07d5d89360',
20
+ created_at: 1761808595,
21
+ store_id: '1003425529',
22
+ scope: 'store/customer/address/created',
23
+ data: {
24
+ type: 'customer',
25
+ id: 2,
26
+ },
27
+ },
28
+ type: pieces_framework_1.TriggerStrategy.WEBHOOK,
29
+ onEnable(context) {
30
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
31
+ const webhook = yield requests_1.bigCommerceApiService.createWebhook({
32
+ auth: context.auth,
33
+ payload: {
34
+ scope: TRIGGER_SCOPE,
35
+ destination: context.webhookUrl,
36
+ is_active: true,
37
+ },
38
+ });
39
+ yield context.store.put(CACHE_KEY, webhook.data.id);
40
+ });
41
+ },
42
+ onDisable(context) {
43
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
44
+ const webhookId = (yield context.store.get(CACHE_KEY));
45
+ if (webhookId) {
46
+ yield requests_1.bigCommerceApiService
47
+ .deleteWebhook({
48
+ auth: context.auth,
49
+ webhookId,
50
+ })
51
+ .then(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
52
+ yield context.store.delete(CACHE_KEY);
53
+ }));
54
+ }
55
+ });
56
+ },
57
+ run(context) {
58
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
59
+ return [context.payload.body];
60
+ });
61
+ },
62
+ });
63
+ //# sourceMappingURL=customer-address-created.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customer-address-created.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/bigcommerce/src/lib/triggers/customer-address-created.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,yCAAiD;AACjD,iDAA2D;AAE3D,MAAM,YAAY,GAAG,0BAA0B,CAAC;AAChD,MAAM,SAAS,GAAG,GAAG,YAAY,oBAAoB,CAAC;AACtD,MAAM,aAAa,GAAG,gCAAgC,CAAC;AAE1C,QAAA,sBAAsB,GAAG,IAAA,gCAAa,EAAC;IAClD,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,0BAA0B;IACvC,WAAW,EAAE,iDAAiD;IAC9D,KAAK,EAAE,EAAE;IACT,UAAU,EAAE;QACV,QAAQ,EAAE,mBAAmB;QAC7B,IAAI,EAAE,0CAA0C;QAChD,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,YAAY;QACtB,KAAK,EAAE,gCAAgC;QACvC,IAAI,EAAE;YACJ,IAAI,EAAE,UAAU;YAChB,EAAE,EAAE,CAAC;SACN;KACF;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ,CAAC,OAAO;;YACpB,MAAM,OAAO,GAAG,MAAM,gCAAqB,CAAC,aAAa,CAAC;gBACxD,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,OAAO,EAAE;oBACP,KAAK,EAAE,aAAa;oBACpB,WAAW,EAAE,OAAO,CAAC,UAAU;oBAC/B,SAAS,EAAE,IAAI;iBAChB;aACF,CAAC,CAAC;YAEH,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtD,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,SAAS,GAAG,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAW,CAAC;YAEjE,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,gCAAqB;qBACxB,aAAa,CAAC;oBACb,IAAI,EAAE,OAAO,CAAC,IAAI;oBAClB,SAAS;iBACV,CAAC;qBACD,IAAI,CAAC,GAAS,EAAE;oBACf,MAAM,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;gBACxC,CAAC,CAAA,CAAC,CAAC;YACP,CAAC;QACH,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const customerAddressUpdated: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
4
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
7
+ instruction: import("dist/packages/pieces/community/framework/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").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
11
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
12
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
+ }>, {}>;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.customerAddressUpdated = 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
+ const TRIGGER_NAME = 'customer address updated';
9
+ const CACHE_KEY = `${TRIGGER_NAME}-trigger-store-key`;
10
+ const TRIGGER_SCOPE = 'store/customer/address/updated';
11
+ exports.customerAddressUpdated = (0, pieces_framework_1.createTrigger)({
12
+ auth: auth_1.bigcommerceAuth,
13
+ name: 'customerAddressUpdated',
14
+ displayName: 'Customer Address Updated',
15
+ description: 'Triggers when a new customer address is updated',
16
+ props: {},
17
+ sampleData: {
18
+ producer: 'stores/xqcaklwsso',
19
+ hash: 'd7b899890f5e0e98a3e074f018b14b07d5d89360',
20
+ created_at: 1761808595,
21
+ store_id: '1003425529',
22
+ scope: 'store/customer/address/updated',
23
+ data: {
24
+ type: 'customer',
25
+ id: 2,
26
+ },
27
+ },
28
+ type: pieces_framework_1.TriggerStrategy.WEBHOOK,
29
+ onEnable(context) {
30
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
31
+ const webhook = yield requests_1.bigCommerceApiService.createWebhook({
32
+ auth: context.auth,
33
+ payload: {
34
+ scope: TRIGGER_SCOPE,
35
+ destination: context.webhookUrl,
36
+ is_active: true,
37
+ },
38
+ });
39
+ yield context.store.put(CACHE_KEY, webhook.data.id);
40
+ });
41
+ },
42
+ onDisable(context) {
43
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
44
+ const webhookId = (yield context.store.get(CACHE_KEY));
45
+ if (webhookId) {
46
+ yield requests_1.bigCommerceApiService
47
+ .deleteWebhook({
48
+ auth: context.auth,
49
+ webhookId,
50
+ })
51
+ .then(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
52
+ yield context.store.delete(CACHE_KEY);
53
+ }));
54
+ }
55
+ });
56
+ },
57
+ run(context) {
58
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
59
+ return [context.payload.body];
60
+ });
61
+ },
62
+ });
63
+ //# sourceMappingURL=customer-address-updated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customer-address-updated.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/bigcommerce/src/lib/triggers/customer-address-updated.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,yCAAiD;AACjD,iDAA2D;AAE3D,MAAM,YAAY,GAAG,0BAA0B,CAAC;AAChD,MAAM,SAAS,GAAG,GAAG,YAAY,oBAAoB,CAAC;AACtD,MAAM,aAAa,GAAG,gCAAgC,CAAC;AAE1C,QAAA,sBAAsB,GAAG,IAAA,gCAAa,EAAC;IAClD,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,0BAA0B;IACvC,WAAW,EAAE,iDAAiD;IAC9D,KAAK,EAAE,EAAE;IACT,UAAU,EAAC;QACT,QAAQ,EAAE,mBAAmB;QAC7B,IAAI,EAAE,0CAA0C;QAChD,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,YAAY;QACtB,KAAK,EAAE,gCAAgC;QACvC,IAAI,EAAE;YACJ,IAAI,EAAE,UAAU;YAChB,EAAE,EAAE,CAAC;SACN;KACF;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ,CAAC,OAAO;;YACpB,MAAM,OAAO,GAAG,MAAM,gCAAqB,CAAC,aAAa,CAAC;gBACxD,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,OAAO,EAAE;oBACP,KAAK,EAAE,aAAa;oBACpB,WAAW,EAAE,OAAO,CAAC,UAAU;oBAC/B,SAAS,EAAE,IAAI;iBAChB;aACF,CAAC,CAAC;YAEH,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtD,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,SAAS,GAAG,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAW,CAAC;YAEjE,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,gCAAqB;qBACxB,aAAa,CAAC;oBACb,IAAI,EAAE,OAAO,CAAC,IAAI;oBAClB,SAAS;iBACV,CAAC;qBACD,IAAI,CAAC,GAAS,EAAE;oBACf,MAAM,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;gBACxC,CAAC,CAAA,CAAC,CAAC;YACP,CAAC;QACH,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const customerCreated: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
4
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
7
+ instruction: import("dist/packages/pieces/community/framework/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").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
11
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
12
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
+ }>, {}>;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.customerCreated = 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
+ const TRIGGER_NAME = 'customer created';
9
+ const CACHE_KEY = `${TRIGGER_NAME}-trigger-store-key`;
10
+ const TRIGGER_SCOPE = 'store/customer/created';
11
+ exports.customerCreated = (0, pieces_framework_1.createTrigger)({
12
+ auth: auth_1.bigcommerceAuth,
13
+ name: 'customerCreated',
14
+ displayName: 'Customer Created',
15
+ description: 'Triggers when a new customer is created',
16
+ props: {},
17
+ sampleData: {
18
+ producer: 'stores/xqcaklwsso',
19
+ hash: 'd7b899890f5e0e98a3e074f018b14b07d5d89360',
20
+ created_at: 1761808595,
21
+ store_id: '1003425529',
22
+ scope: 'store/customer/created',
23
+ data: {
24
+ type: 'customer',
25
+ id: 2,
26
+ origin_channel_id: 1,
27
+ channel_ids: [1],
28
+ },
29
+ },
30
+ type: pieces_framework_1.TriggerStrategy.WEBHOOK,
31
+ onEnable(context) {
32
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
33
+ const webhook = yield requests_1.bigCommerceApiService.createWebhook({
34
+ auth: context.auth,
35
+ payload: {
36
+ scope: TRIGGER_SCOPE,
37
+ destination: context.webhookUrl,
38
+ is_active: true,
39
+ },
40
+ });
41
+ yield context.store.put(CACHE_KEY, webhook.data.id);
42
+ });
43
+ },
44
+ onDisable(context) {
45
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
46
+ const webhookId = (yield context.store.get(CACHE_KEY));
47
+ if (webhookId) {
48
+ yield requests_1.bigCommerceApiService
49
+ .deleteWebhook({
50
+ auth: context.auth,
51
+ webhookId,
52
+ })
53
+ .then(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
54
+ yield context.store.delete(CACHE_KEY);
55
+ }));
56
+ }
57
+ });
58
+ },
59
+ run(context) {
60
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
61
+ return [context.payload.body];
62
+ });
63
+ },
64
+ });
65
+ //# sourceMappingURL=customer-created.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customer-created.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/bigcommerce/src/lib/triggers/customer-created.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,yCAAiD;AACjD,iDAA2D;AAE3D,MAAM,YAAY,GAAG,kBAAkB,CAAC;AACxC,MAAM,SAAS,GAAG,GAAG,YAAY,oBAAoB,CAAC;AACtD,MAAM,aAAa,GAAG,wBAAwB,CAAC;AAElC,QAAA,eAAe,GAAG,IAAA,gCAAa,EAAC;IAC3C,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,yCAAyC;IACtD,KAAK,EAAE,EAAE;IACT,UAAU,EAAE;QACV,QAAQ,EAAE,mBAAmB;QAC7B,IAAI,EAAE,0CAA0C;QAChD,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,YAAY;QACtB,KAAK,EAAE,wBAAwB;QAC/B,IAAI,EAAE;YACJ,IAAI,EAAE,UAAU;YAChB,EAAE,EAAE,CAAC;YACL,iBAAiB,EAAE,CAAC;YACpB,WAAW,EAAE,CAAC,CAAC,CAAC;SACjB;KACF;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ,CAAC,OAAO;;YACpB,MAAM,OAAO,GAAG,MAAM,gCAAqB,CAAC,aAAa,CAAC;gBACxD,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,OAAO,EAAE;oBACP,KAAK,EAAE,aAAa;oBACpB,WAAW,EAAE,OAAO,CAAC,UAAU;oBAC/B,SAAS,EAAE,IAAI;iBAChB;aACF,CAAC,CAAC;YAEH,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtD,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,SAAS,GAAG,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAW,CAAC;YAEjE,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,gCAAqB;qBACxB,aAAa,CAAC;oBACb,IAAI,EAAE,OAAO,CAAC,IAAI;oBAClB,SAAS;iBACV,CAAC;qBACD,IAAI,CAAC,GAAS,EAAE;oBACf,MAAM,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;gBACxC,CAAC,CAAA,CAAC,CAAC;YACP,CAAC;QACH,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const customerUpdated: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
4
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
7
+ instruction: import("dist/packages/pieces/community/framework/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").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
11
+ instruction: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
12
+ storeHash: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
+ accessToken: import("@activepieces/pieces-framework").ShortTextProperty<true>;
14
+ }>, {}>;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.customerUpdated = 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
+ const TRIGGER_NAME = 'customer updated';
9
+ const CACHE_KEY = `${TRIGGER_NAME}-trigger-store-key`;
10
+ const TRIGGER_SCOPE = 'store/customer/updated';
11
+ exports.customerUpdated = (0, pieces_framework_1.createTrigger)({
12
+ auth: auth_1.bigcommerceAuth,
13
+ name: 'customerUpdated',
14
+ displayName: 'Customer Updated',
15
+ description: 'Triggers when a customer is updated',
16
+ props: {},
17
+ sampleData: {
18
+ producer: 'stores/xqcaklwsso',
19
+ hash: 'd7b899890f5e0e98a3e074f018b14b07d5d89360',
20
+ created_at: 1761808595,
21
+ store_id: '1003425529',
22
+ scope: 'store/customer/updated',
23
+ data: {
24
+ type: 'customer',
25
+ id: 2,
26
+ },
27
+ },
28
+ type: pieces_framework_1.TriggerStrategy.WEBHOOK,
29
+ onEnable(context) {
30
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
31
+ const webhook = yield requests_1.bigCommerceApiService.createWebhook({
32
+ auth: context.auth,
33
+ payload: {
34
+ scope: TRIGGER_SCOPE,
35
+ destination: context.webhookUrl,
36
+ is_active: true,
37
+ },
38
+ });
39
+ yield context.store.put(CACHE_KEY, webhook.data.id);
40
+ });
41
+ },
42
+ onDisable(context) {
43
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
44
+ const webhookId = (yield context.store.get(CACHE_KEY));
45
+ if (webhookId) {
46
+ yield requests_1.bigCommerceApiService
47
+ .deleteWebhook({
48
+ auth: context.auth,
49
+ webhookId,
50
+ })
51
+ .then(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
52
+ yield context.store.delete(CACHE_KEY);
53
+ }));
54
+ }
55
+ });
56
+ },
57
+ run(context) {
58
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
59
+ return [context.payload.body];
60
+ });
61
+ },
62
+ });
63
+ //# sourceMappingURL=customer-updated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customer-updated.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/bigcommerce/src/lib/triggers/customer-updated.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,yCAAiD;AACjD,iDAA2D;AAE3D,MAAM,YAAY,GAAG,kBAAkB,CAAC;AACxC,MAAM,SAAS,GAAG,GAAG,YAAY,oBAAoB,CAAC;AACtD,MAAM,aAAa,GAAG,wBAAwB,CAAC;AAElC,QAAA,eAAe,GAAG,IAAA,gCAAa,EAAC;IAC3C,IAAI,EAAE,sBAAe;IACrB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,qCAAqC;IAClD,KAAK,EAAE,EAAE;IACT,UAAU,EAAE;QACV,QAAQ,EAAE,mBAAmB;QAC7B,IAAI,EAAE,0CAA0C;QAChD,UAAU,EAAE,UAAU;QACtB,QAAQ,EAAE,YAAY;QACtB,KAAK,EAAE,wBAAwB;QAC/B,IAAI,EAAE;YACJ,IAAI,EAAE,UAAU;YAChB,EAAE,EAAE,CAAC;SACN;KACF;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ,CAAC,OAAO;;YACpB,MAAM,OAAO,GAAG,MAAM,gCAAqB,CAAC,aAAa,CAAC;gBACxD,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,OAAO,EAAE;oBACP,KAAK,EAAE,aAAa;oBACpB,WAAW,EAAE,OAAO,CAAC,UAAU;oBAC/B,SAAS,EAAE,IAAI;iBAChB;aACF,CAAC,CAAC;YAEH,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtD,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,SAAS,GAAG,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAW,CAAC;YAEjE,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,gCAAqB;qBACxB,aAAa,CAAC;oBACb,IAAI,EAAE,OAAO,CAAC,IAAI;oBAClB,SAAS;iBACV,CAAC;qBACD,IAAI,CAAC,GAAS,EAAE;oBACf,MAAM,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;gBACxC,CAAC,CAAA,CAAC,CAAC;YACP,CAAC;QACH,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}