@activepieces/piece-chargebee 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 (65) hide show
  1. package/package.json +17 -0
  2. package/src/index.d.ts +5 -0
  3. package/src/index.d.ts.map +1 -0
  4. package/src/index.js +57 -0
  5. package/src/index.js.map +1 -0
  6. package/src/lib/actions/cancel-subscription.d.ts +21 -0
  7. package/src/lib/actions/cancel-subscription.d.ts.map +1 -0
  8. package/src/lib/actions/cancel-subscription.js +168 -0
  9. package/src/lib/actions/cancel-subscription.js.map +1 -0
  10. package/src/lib/actions/create-customer.d.ts +29 -0
  11. package/src/lib/actions/create-customer.d.ts.map +1 -0
  12. package/src/lib/actions/create-customer.js +169 -0
  13. package/src/lib/actions/create-customer.js.map +1 -0
  14. package/src/lib/actions/create-subscription.d.ts +20 -0
  15. package/src/lib/actions/create-subscription.d.ts.map +1 -0
  16. package/src/lib/actions/create-subscription.js +119 -0
  17. package/src/lib/actions/create-subscription.js.map +1 -0
  18. package/src/lib/actions/get-customer.d.ts +7 -0
  19. package/src/lib/actions/get-customer.d.ts.map +1 -0
  20. package/src/lib/actions/get-customer.js +32 -0
  21. package/src/lib/actions/get-customer.js.map +1 -0
  22. package/src/lib/auth.d.ts +5 -0
  23. package/src/lib/auth.d.ts.map +1 -0
  24. package/src/lib/auth.js +46 -0
  25. package/src/lib/auth.js.map +1 -0
  26. package/src/lib/common/client.d.ts +15 -0
  27. package/src/lib/common/client.d.ts.map +1 -0
  28. package/src/lib/common/client.js +64 -0
  29. package/src/lib/common/client.js.map +1 -0
  30. package/src/lib/common/webhook.d.ts +4 -0
  31. package/src/lib/common/webhook.d.ts.map +1 -0
  32. package/src/lib/common/webhook.js +48 -0
  33. package/src/lib/common/webhook.js.map +1 -0
  34. package/src/lib/triggers/customer-created.d.ts +15 -0
  35. package/src/lib/triggers/customer-created.d.ts.map +1 -0
  36. package/src/lib/triggers/customer-created.js +68 -0
  37. package/src/lib/triggers/customer-created.js.map +1 -0
  38. package/src/lib/triggers/invoice-generated.d.ts +15 -0
  39. package/src/lib/triggers/invoice-generated.d.ts.map +1 -0
  40. package/src/lib/triggers/invoice-generated.js +61 -0
  41. package/src/lib/triggers/invoice-generated.js.map +1 -0
  42. package/src/lib/triggers/payment-failed.d.ts +15 -0
  43. package/src/lib/triggers/payment-failed.d.ts.map +1 -0
  44. package/src/lib/triggers/payment-failed.js +92 -0
  45. package/src/lib/triggers/payment-failed.js.map +1 -0
  46. package/src/lib/triggers/payment-succeeded.d.ts +15 -0
  47. package/src/lib/triggers/payment-succeeded.d.ts.map +1 -0
  48. package/src/lib/triggers/payment-succeeded.js +92 -0
  49. package/src/lib/triggers/payment-succeeded.js.map +1 -0
  50. package/src/lib/triggers/subscription-cancelled.d.ts +15 -0
  51. package/src/lib/triggers/subscription-cancelled.d.ts.map +1 -0
  52. package/src/lib/triggers/subscription-cancelled.js +84 -0
  53. package/src/lib/triggers/subscription-cancelled.js.map +1 -0
  54. package/src/lib/triggers/subscription-changed.d.ts +15 -0
  55. package/src/lib/triggers/subscription-changed.d.ts.map +1 -0
  56. package/src/lib/triggers/subscription-changed.js +84 -0
  57. package/src/lib/triggers/subscription-changed.js.map +1 -0
  58. package/src/lib/triggers/subscription-created.d.ts +15 -0
  59. package/src/lib/triggers/subscription-created.d.ts.map +1 -0
  60. package/src/lib/triggers/subscription-created.js +84 -0
  61. package/src/lib/triggers/subscription-created.js.map +1 -0
  62. package/src/lib/triggers/subscription-renewed.d.ts +15 -0
  63. package/src/lib/triggers/subscription-renewed.d.ts.map +1 -0
  64. package/src/lib/triggers/subscription-renewed.js +84 -0
  65. package/src/lib/triggers/subscription-renewed.js.map +1 -0
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.paymentFailed = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("../auth");
7
+ const webhook_1 = require("../common/webhook");
8
+ const EVENT_TYPE = 'payment_failed';
9
+ const STORE_KEY = '_chargebee_payment_failed_webhook_id';
10
+ exports.paymentFailed = (0, pieces_framework_1.createTrigger)({
11
+ auth: auth_1.chargebeeAuth,
12
+ name: 'payment_failed',
13
+ displayName: 'Payment Failed',
14
+ description: 'Triggers when a payment attempt fails. Useful for dunning and retry workflows.',
15
+ props: {},
16
+ type: pieces_framework_1.TriggerStrategy.WEBHOOK,
17
+ sampleData: {
18
+ id: 'ev_paymentfawwy6gd',
19
+ occurred_at: 1776067863,
20
+ source: 'admin_console',
21
+ object: 'event',
22
+ api_version: 'v2',
23
+ event_type: 'payment_failed',
24
+ webhook_status: 'not_applicable',
25
+ content: {
26
+ transaction: {
27
+ amount: 1395,
28
+ amount_unused: 0,
29
+ currency_code: 'USD',
30
+ customer_id: '__test__KyVnHhSBWlv242pN',
31
+ date: 1517505921,
32
+ '...': '...',
33
+ },
34
+ invoice: {
35
+ adjustment_credit_notes: {},
36
+ amount_adjusted: 0,
37
+ amount_due: 0,
38
+ amount_paid: 1000,
39
+ amount_to_collect: 0,
40
+ '...': '...',
41
+ },
42
+ customer: {
43
+ allow_direct_debit: false,
44
+ auto_collection: 'on',
45
+ billing_address: {
46
+ city: 'Walnut',
47
+ country: 'US',
48
+ first_name: 'John',
49
+ last_name: 'Doe',
50
+ line1: 'PO Box 9999',
51
+ '...': '...',
52
+ },
53
+ card_status: 'no_card',
54
+ created_at: 1517505731,
55
+ '...': '...',
56
+ },
57
+ subscription: {
58
+ activated_at: 1612890920,
59
+ billing_period: 1,
60
+ billing_period_unit: 'month',
61
+ created_at: 1612890920,
62
+ currency_code: 'USD',
63
+ '...': '...',
64
+ },
65
+ },
66
+ },
67
+ onEnable(context) {
68
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
69
+ const webhookId = yield (0, webhook_1.subscribeChargebeeWebhook)(context.auth.props.site, context.auth.props.api_key, context.webhookUrl, EVENT_TYPE);
70
+ yield context.store.put(STORE_KEY, webhookId);
71
+ });
72
+ },
73
+ onDisable(context) {
74
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
75
+ const webhookId = yield context.store.get(STORE_KEY);
76
+ if (webhookId) {
77
+ yield (0, webhook_1.unsubscribeChargebeeWebhook)(context.auth.props.site, context.auth.props.api_key, webhookId);
78
+ }
79
+ });
80
+ },
81
+ test(context) {
82
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
83
+ return (0, webhook_1.fetchRecentEvents)(context.auth.props.site, context.auth.props.api_key, EVENT_TYPE);
84
+ });
85
+ },
86
+ run(context) {
87
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
88
+ return [context.payload.body];
89
+ });
90
+ },
91
+ });
92
+ //# sourceMappingURL=payment-failed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-failed.js","sourceRoot":"","sources":["../../../../src/lib/triggers/payment-failed.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAEhF,kCAAwC;AACxC,+CAI2B;AAE3B,MAAM,UAAU,GAAG,gBAAgB,CAAC;AACpC,MAAM,SAAS,GAAG,sCAAsC,CAAC;AAE5C,QAAA,aAAa,GAAG,IAAA,gCAAa,EAAC;IACzC,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EACT,gFAAgF;IAClF,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,UAAU,EAAE;QACV,EAAE,EAAE,oBAAoB;QACxB,WAAW,EAAE,UAAU;QACvB,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE,OAAO;QACf,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,gBAAgB;QAC5B,cAAc,EAAE,gBAAgB;QAChC,OAAO,EAAE;YACP,WAAW,EAAE;gBACX,MAAM,EAAE,IAAI;gBACZ,aAAa,EAAE,CAAC;gBAChB,aAAa,EAAE,KAAK;gBACpB,WA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A2B,EAC/B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EACvB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAC1B,SAAS,CACV,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;IACK,IAAI,CAAC,OAAO;;YAChB,OAAO,IAAA,2BAAiB,EACtB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EACvB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAC1B,UAAU,CACX,CAAC;QACJ,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,15 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const paymentSucceeded: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
6
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
8
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
9
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
11
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
12
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
14
+ }>, {}>;
15
+ //# sourceMappingURL=payment-succeeded.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-succeeded.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/payment-succeeded.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAYhF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;OAsF3B,CAAC"}
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.paymentSucceeded = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("../auth");
7
+ const webhook_1 = require("../common/webhook");
8
+ const EVENT_TYPE = 'payment_succeeded';
9
+ const STORE_KEY = '_chargebee_payment_succeeded_webhook_id';
10
+ exports.paymentSucceeded = (0, pieces_framework_1.createTrigger)({
11
+ auth: auth_1.chargebeeAuth,
12
+ name: 'payment_succeeded',
13
+ displayName: 'Payment Succeeded',
14
+ description: 'Triggers when a payment is successfully collected.',
15
+ props: {},
16
+ type: pieces_framework_1.TriggerStrategy.WEBHOOK,
17
+ sampleData: {
18
+ id: 'ev_paymentsuwwy8bw',
19
+ occurred_at: 1776067866,
20
+ source: 'admin_console',
21
+ object: 'event',
22
+ api_version: 'v2',
23
+ event_type: 'payment_succeeded',
24
+ webhook_status: 'not_applicable',
25
+ content: {
26
+ transaction: {
27
+ amount: 1395,
28
+ amount_unused: 0,
29
+ currency_code: 'USD',
30
+ customer_id: '__test__KyVnHhSBWlv242pN',
31
+ date: 1517505921,
32
+ '...': '...',
33
+ },
34
+ invoice: {
35
+ adjustment_credit_notes: {},
36
+ amount_adjusted: 0,
37
+ amount_due: 0,
38
+ amount_paid: 1000,
39
+ amount_to_collect: 0,
40
+ '...': '...',
41
+ },
42
+ customer: {
43
+ allow_direct_debit: false,
44
+ auto_collection: 'on',
45
+ billing_address: {
46
+ city: 'Walnut',
47
+ country: 'US',
48
+ first_name: 'John',
49
+ last_name: 'Doe',
50
+ line1: 'PO Box 9999',
51
+ '...': '...',
52
+ },
53
+ card_status: 'no_card',
54
+ created_at: 1517505731,
55
+ '...': '...',
56
+ },
57
+ subscription: {
58
+ activated_at: 1612890920,
59
+ billing_period: 1,
60
+ billing_period_unit: 'month',
61
+ created_at: 1612890920,
62
+ currency_code: 'USD',
63
+ '...': '...',
64
+ },
65
+ },
66
+ },
67
+ onEnable(context) {
68
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
69
+ const webhookId = yield (0, webhook_1.subscribeChargebeeWebhook)(context.auth.props.site, context.auth.props.api_key, context.webhookUrl, EVENT_TYPE);
70
+ yield context.store.put(STORE_KEY, webhookId);
71
+ });
72
+ },
73
+ onDisable(context) {
74
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
75
+ const webhookId = yield context.store.get(STORE_KEY);
76
+ if (webhookId) {
77
+ yield (0, webhook_1.unsubscribeChargebeeWebhook)(context.auth.props.site, context.auth.props.api_key, webhookId);
78
+ }
79
+ });
80
+ },
81
+ test(context) {
82
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
83
+ return (0, webhook_1.fetchRecentEvents)(context.auth.props.site, context.auth.props.api_key, EVENT_TYPE);
84
+ });
85
+ },
86
+ run(context) {
87
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
88
+ return [context.payload.body];
89
+ });
90
+ },
91
+ });
92
+ //# sourceMappingURL=payment-succeeded.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-succeeded.js","sourceRoot":"","sources":["../../../../src/lib/triggers/payment-succeeded.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAEhF,kCAAwC;AACxC,+CAI2B;AAE3B,MAAM,UAAU,GAAG,mBAAmB,CAAC;AACvC,MAAM,SAAS,GAAG,yCAAyC,CAAC;AAE/C,QAAA,gBAAgB,GAAG,IAAA,gCAAa,EAAC;IAC5C,IAAI,EAAE,oBAAa;IACn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;;YACpB,MAAM,SAAS,GAAG,MAAM,IAAA,mCAAyB,EAC/C,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EACvB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAC1B,OAAO,CAAC,UAAU,EAClB,UAAU,CACX,CAAC;YACF,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAS,SAAS,EAAE,SAAS,CAAC,CAAC;QACxD,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAS,SAAS,CAAC,CAAC;YAC7D,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,IAAA,qCAA2B,EAC/B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EACvB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAC1B,SAAS,CACV,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;IACK,IAAI,CAAC,OAAO;;YAChB,OAAO,IAAA,2BAAiB,EACtB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EACvB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAC1B,UAAU,CACX,CAAC;QACJ,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,15 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const subscriptionCancelled: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
6
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
8
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
9
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
11
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
12
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
14
+ }>, {}>;
15
+ //# sourceMappingURL=subscription-cancelled.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-cancelled.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/subscription-cancelled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAYhF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;OA8EhC,CAAC"}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subscriptionCancelled = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("../auth");
7
+ const webhook_1 = require("../common/webhook");
8
+ const EVENT_TYPE = 'subscription_cancelled';
9
+ const STORE_KEY = '_chargebee_subscription_cancelled_webhook_id';
10
+ exports.subscriptionCancelled = (0, pieces_framework_1.createTrigger)({
11
+ auth: auth_1.chargebeeAuth,
12
+ name: 'subscription_cancelled',
13
+ displayName: 'Subscription Cancelled',
14
+ description: 'Triggers when a subscription is cancelled.',
15
+ props: {},
16
+ type: pieces_framework_1.TriggerStrategy.WEBHOOK,
17
+ sampleData: {
18
+ id: 'ev_subscriptiwwy3vs',
19
+ occurred_at: 1776067860,
20
+ source: 'admin_console',
21
+ object: 'event',
22
+ api_version: 'v2',
23
+ event_type: 'subscription_cancelled',
24
+ webhook_status: 'not_applicable',
25
+ content: {
26
+ subscription: {
27
+ activated_at: 1612890920,
28
+ billing_period: 1,
29
+ billing_period_unit: 'month',
30
+ created_at: 1612890920,
31
+ currency_code: 'USD',
32
+ '...': '...',
33
+ },
34
+ customer: {
35
+ allow_direct_debit: false,
36
+ auto_collection: 'on',
37
+ billing_address: {
38
+ city: 'Walnut',
39
+ country: 'US',
40
+ first_name: 'John',
41
+ last_name: 'Doe',
42
+ line1: 'PO Box 9999',
43
+ '...': '...',
44
+ },
45
+ card_status: 'no_card',
46
+ created_at: 1517505731,
47
+ '...': '...',
48
+ },
49
+ invoice: {
50
+ adjustment_credit_notes: {},
51
+ amount_adjusted: 0,
52
+ amount_due: 0,
53
+ amount_paid: 1000,
54
+ amount_to_collect: 0,
55
+ '...': '...',
56
+ },
57
+ },
58
+ },
59
+ onEnable(context) {
60
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
61
+ const webhookId = yield (0, webhook_1.subscribeChargebeeWebhook)(context.auth.props.site, context.auth.props.api_key, context.webhookUrl, EVENT_TYPE);
62
+ yield context.store.put(STORE_KEY, webhookId);
63
+ });
64
+ },
65
+ onDisable(context) {
66
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
67
+ const webhookId = yield context.store.get(STORE_KEY);
68
+ if (webhookId) {
69
+ yield (0, webhook_1.unsubscribeChargebeeWebhook)(context.auth.props.site, context.auth.props.api_key, webhookId);
70
+ }
71
+ });
72
+ },
73
+ test(context) {
74
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
75
+ return (0, webhook_1.fetchRecentEvents)(context.auth.props.site, context.auth.props.api_key, EVENT_TYPE);
76
+ });
77
+ },
78
+ run(context) {
79
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
80
+ return [context.payload.body];
81
+ });
82
+ },
83
+ });
84
+ //# sourceMappingURL=subscription-cancelled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-cancelled.js","sourceRoot":"","sources":["../../../../src/lib/triggers/subscription-cancelled.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAEhF,kCAAwC;AACxC,+CAI2B;AAE3B,MAAM,UAAU,GAAG,wBAAwB,CAAC;AAC5C,MAAM,SAAS,GAAG,8CAA8C,CAAC;AAEpD,QAAA,qBAAqB,GAAG,IAAA,gCAAa,EAAC;IACjD,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,4CAA4C;IACzD,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,UAAU,EAAE;QACV,EAAE,EAAE,qBAAqB;QACzB,WAAW,EAAE,UAAU;QACvB,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE,OAAO;QACf,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,wBAAwB;QACpC,cAAc,EAAE,gBAAgB;QAChC,OAAO,EAAE;YACP,YAAY,EAAE;gBACZ,YAAY,EAAE,UAAU;gBACxB,cAAc,EAAE,CAAC;gBACjB,mBAAmB,EAAE,OAAO;gBAC5B,UAAU,EAAE,UAAU;gBACtB,aAAa,EAAE,KAAK;gBACpB,KAAK,EAAE,KAAK;aACb;YACD,QAAQ,EAAE;gBACR,kBAAkB,EAAE,KAAK;gBACzB,eAAe,EAAE,IAAI;gBACrB,eAAe,EAAE;oBACf,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,IAAI;oBACb,UAAU,EAAE,MAAM;oBAClB,SAAS,EAAE,KAAK;oBAChB,KAAK,EAAE,aAAa;oBACpB,KAAK,EAAE,KAAK;iBACb;gBACD,WAAW,EAAE,SAAS;gBACtB,UAAU,EAAE,UAAU;gBACtB,KAAK,EAAE,KAAK;aACb;YACD,OAAO,EAAE;gBACP,uBAAuB,EAAE,EAAE;gBAC3B,eAAe,EAAE,CAAC;gBAClB,UAAU,EAAE,CAAC;gBACb,WAAW,EAAE,IAAI;gBACjB,iBAAiB,EAAE,CAAC;gBACpB,KAAK,EAAE,KAAK;aACb;SACF;KACF;IACK,QAAQ,CAAC,OAAO;;YACpB,MAAM,SAAS,GAAG,MAAM,IAAA,mCAAyB,EAC/C,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EACvB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAC1B,OAAO,CAAC,UAAU,EAClB,UAAU,CACX,CAAC;YACF,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAS,SAAS,EAAE,SAAS,CAAC,CAAC;QACxD,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CAAS,SAAS,CAAC,CAAC;YAC7D,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,IAAA,qCAA2B,EAC/B,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EACvB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAC1B,SAAS,CACV,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;IACK,IAAI,CAAC,OAAO;;YAChB,OAAO,IAAA,2BAAiB,EACtB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EACvB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAC1B,UAAU,CACX,CAAC;QACJ,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,15 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const subscriptionChanged: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
6
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
8
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
9
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
11
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
12
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
14
+ }>, {}>;
15
+ //# sourceMappingURL=subscription-changed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-changed.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/subscription-changed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAYhF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;OA+E9B,CAAC"}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subscriptionChanged = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("../auth");
7
+ const webhook_1 = require("../common/webhook");
8
+ const EVENT_TYPE = 'subscription_changed';
9
+ const STORE_KEY = '_chargebee_subscription_changed_webhook_id';
10
+ exports.subscriptionChanged = (0, pieces_framework_1.createTrigger)({
11
+ auth: auth_1.chargebeeAuth,
12
+ name: 'subscription_changed',
13
+ displayName: 'Subscription Changed',
14
+ description: 'Triggers when a subscription is updated — plan change, quantity, or add-ons.',
15
+ props: {},
16
+ type: pieces_framework_1.TriggerStrategy.WEBHOOK,
17
+ sampleData: {
18
+ id: 'ev_subscriptiwwy6f7',
19
+ occurred_at: 1776067863,
20
+ source: 'admin_console',
21
+ object: 'event',
22
+ api_version: 'v2',
23
+ event_type: 'subscription_changed',
24
+ webhook_status: 'not_applicable',
25
+ content: {
26
+ subscription: {
27
+ activated_at: 1612890920,
28
+ billing_period: 1,
29
+ billing_period_unit: 'month',
30
+ created_at: 1612890920,
31
+ currency_code: 'USD',
32
+ '...': '...',
33
+ },
34
+ customer: {
35
+ allow_direct_debit: false,
36
+ auto_collection: 'on',
37
+ billing_address: {
38
+ city: 'Walnut',
39
+ country: 'US',
40
+ first_name: 'John',
41
+ last_name: 'Doe',
42
+ line1: 'PO Box 9999',
43
+ '...': '...',
44
+ },
45
+ card_status: 'no_card',
46
+ created_at: 1517505731,
47
+ '...': '...',
48
+ },
49
+ invoice: {
50
+ adjustment_credit_notes: {},
51
+ amount_adjusted: 0,
52
+ amount_due: 0,
53
+ amount_paid: 1000,
54
+ amount_to_collect: 0,
55
+ '...': '...',
56
+ },
57
+ },
58
+ },
59
+ onEnable(context) {
60
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
61
+ const webhookId = yield (0, webhook_1.subscribeChargebeeWebhook)(context.auth.props.site, context.auth.props.api_key, context.webhookUrl, EVENT_TYPE);
62
+ yield context.store.put(STORE_KEY, webhookId);
63
+ });
64
+ },
65
+ onDisable(context) {
66
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
67
+ const webhookId = yield context.store.get(STORE_KEY);
68
+ if (webhookId) {
69
+ yield (0, webhook_1.unsubscribeChargebeeWebhook)(context.auth.props.site, context.auth.props.api_key, webhookId);
70
+ }
71
+ });
72
+ },
73
+ test(context) {
74
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
75
+ return (0, webhook_1.fetchRecentEvents)(context.auth.props.site, context.auth.props.api_key, EVENT_TYPE);
76
+ });
77
+ },
78
+ run(context) {
79
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
80
+ return [context.payload.body];
81
+ });
82
+ },
83
+ });
84
+ //# sourceMappingURL=subscription-changed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-changed.js","sourceRoot":"","sources":["../../../../src/lib/triggers/subscription-changed.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAEhF,kCAAwC;AACxC,+CAI2B;AAE3B,MAAM,UAAU,GAAG,sBAAsB,CAAC;AAC1C,MAAM,SAAS,GAAG,4CAA4C,CAAC;AAElD,QAAA,mBAAmB,GAAG,IAAA,gCAAa,EAAC;IAC/C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EACT,8EAA8E;IAChF,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,UAAU,EAAE;QACV,EAAE,EAAE,qBAAqB;QACzB,WAAW,EAAE,UAAU;QACvB,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE,OAAO;QACf,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,sBAAsB;QAClC,cAAc,EAAE,gBAAgB;QAChC,OAAO,EAAE;YACP,YAAY,EAAE;gBACZ,YAAY,EAAE,UAAU;gBACxB,cAAc,EAAE,CAAC;gBACjB,mBAAmB,EAAE,OAAO;gBAC5B,UAAU,EAAE,UAAU;gBACtB,aAAa,EAAE,KAAK;gBACpB,KAAK,EAAE,KAAK;aACb;YACD,QAAQ,EAAE;gBACR,kBAAkB,EAAE,KAAK;gBACzB,eAAe,EAAE,IAAI;gBACrB,eAAe,EAAE;oBACf,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,IAAI;oBACb,UAAU,EAAE,MAAM;oBAClB,SAAS,EAAE,KAAK;oBAChB,KAAK,EAAE,aAAa;oBACpB,KAAK,EAAE,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
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const subscriptionCreated: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
6
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
8
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
9
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
11
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
12
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
14
+ }>, {}>;
15
+ //# sourceMappingURL=subscription-created.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-created.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/subscription-created.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAYhF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;OA8E9B,CAAC"}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subscriptionCreated = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const auth_1 = require("../auth");
7
+ const webhook_1 = require("../common/webhook");
8
+ const EVENT_TYPE = 'subscription_created';
9
+ const STORE_KEY = '_chargebee_subscription_created_webhook_id';
10
+ exports.subscriptionCreated = (0, pieces_framework_1.createTrigger)({
11
+ auth: auth_1.chargebeeAuth,
12
+ name: 'subscription_created',
13
+ displayName: 'Subscription Created',
14
+ description: 'Triggers when a new subscription is created for a customer.',
15
+ props: {},
16
+ type: pieces_framework_1.TriggerStrategy.WEBHOOK,
17
+ sampleData: {
18
+ id: 'ev_subscriptiwwy7vs',
19
+ occurred_at: 1776067865,
20
+ source: 'admin_console',
21
+ object: 'event',
22
+ api_version: 'v2',
23
+ event_type: 'subscription_created',
24
+ webhook_status: 'not_applicable',
25
+ content: {
26
+ subscription: {
27
+ activated_at: 1612890920,
28
+ billing_period: 1,
29
+ billing_period_unit: 'month',
30
+ created_at: 1612890920,
31
+ currency_code: 'USD',
32
+ '...': '...',
33
+ },
34
+ customer: {
35
+ allow_direct_debit: false,
36
+ auto_collection: 'on',
37
+ billing_address: {
38
+ city: 'Walnut',
39
+ country: 'US',
40
+ first_name: 'John',
41
+ last_name: 'Doe',
42
+ line1: 'PO Box 9999',
43
+ '...': '...',
44
+ },
45
+ card_status: 'no_card',
46
+ created_at: 1517505731,
47
+ '...': '...',
48
+ },
49
+ invoice: {
50
+ adjustment_credit_notes: {},
51
+ amount_adjusted: 0,
52
+ amount_due: 0,
53
+ amount_paid: 1000,
54
+ amount_to_collect: 0,
55
+ '...': '...',
56
+ },
57
+ },
58
+ },
59
+ onEnable(context) {
60
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
61
+ const webhookId = yield (0, webhook_1.subscribeChargebeeWebhook)(context.auth.props.site, context.auth.props.api_key, context.webhookUrl, EVENT_TYPE);
62
+ yield context.store.put(STORE_KEY, webhookId);
63
+ });
64
+ },
65
+ onDisable(context) {
66
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
67
+ const webhookId = yield context.store.get(STORE_KEY);
68
+ if (webhookId) {
69
+ yield (0, webhook_1.unsubscribeChargebeeWebhook)(context.auth.props.site, context.auth.props.api_key, webhookId);
70
+ }
71
+ });
72
+ },
73
+ test(context) {
74
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
75
+ return (0, webhook_1.fetchRecentEvents)(context.auth.props.site, context.auth.props.api_key, EVENT_TYPE);
76
+ });
77
+ },
78
+ run(context) {
79
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
80
+ return [context.payload.body];
81
+ });
82
+ },
83
+ });
84
+ //# sourceMappingURL=subscription-created.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-created.js","sourceRoot":"","sources":["../../../../src/lib/triggers/subscription-created.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAEhF,kCAAwC;AACxC,+CAI2B;AAE3B,MAAM,UAAU,GAAG,sBAAsB,CAAC;AAC1C,MAAM,SAAS,GAAG,4CAA4C,CAAC;AAElD,QAAA,mBAAmB,GAAG,IAAA,gCAAa,EAAC;IAC/C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,6DAA6D;IAC1E,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,UAAU,EAAE;QACV,EAAE,EAAE,qBAAqB;QACzB,WAAW,EAAE,UAAU;QACvB,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE,OAAO;QACf,WAAW,EAAE,IAAI;QACjB,UAAU,EAAE,sBAAsB;QAClC,cAAc,EAAE,gBAAgB;QAChC,OAAO,EAAE;YACP,YAAY,EAAE;gBACZ,YAAY,EAAE,UAAU;gBACxB,cAAc,EAAE,CAAC;gBACjB,mBAAmB,EAAE,OAAO;gBAC5B,UAAU,EAAE,UAAU;gBACtB,aAAa,EAAE,KAAK;gBACpB,KAAK,EAAE,KAAK;aACb;YACD,QAAQ,EAAE;gBACR,kBAAkB,EAAE,KAAK;gBACzB,eAAe,EAAE,IAAI;gBACrB,eAAe,EAAE;oBACf,IAAI,EAAE,QAAQ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AO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const subscriptionRenewed: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
6
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
7
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
8
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
9
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
11
+ }>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
12
+ site: import("@activepieces/pieces-framework").ShortTextProperty<true>;
13
+ api_key: import("@activepieces/pieces-framework").SecretTextProperty<true>;
14
+ }>, {}>;
15
+ //# sourceMappingURL=subscription-renewed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-renewed.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/subscription-renewed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAYhF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;OA8E9B,CAAC"}