@activepieces/piece-stripe 0.6.8 → 0.6.10

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 (137) hide show
  1. package/package.json +7 -13
  2. package/src/index.js +26 -127
  3. package/src/index.d.ts +0 -3
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/cancel-subscription.d.ts +0 -5
  7. package/src/lib/actions/cancel-subscription.d.ts.map +0 -1
  8. package/src/lib/actions/cancel-subscription.js +0 -37
  9. package/src/lib/actions/cancel-subscription.js.map +0 -1
  10. package/src/lib/actions/create-customer.d.ts +0 -12
  11. package/src/lib/actions/create-customer.d.ts.map +0 -1
  12. package/src/lib/actions/create-customer.js +0 -86
  13. package/src/lib/actions/create-customer.js.map +0 -1
  14. package/src/lib/actions/create-invoice.d.ts +0 -6
  15. package/src/lib/actions/create-invoice.d.ts.map +0 -1
  16. package/src/lib/actions/create-invoice.js +0 -54
  17. package/src/lib/actions/create-invoice.js.map +0 -1
  18. package/src/lib/actions/create-payment-intent.d.ts +0 -11
  19. package/src/lib/actions/create-payment-intent.d.ts.map +0 -1
  20. package/src/lib/actions/create-payment-intent.js +0 -108
  21. package/src/lib/actions/create-payment-intent.js.map +0 -1
  22. package/src/lib/actions/create-payment-link.d.ts +0 -9
  23. package/src/lib/actions/create-payment-link.d.ts.map +0 -1
  24. package/src/lib/actions/create-payment-link.js +0 -92
  25. package/src/lib/actions/create-payment-link.js.map +0 -1
  26. package/src/lib/actions/create-price.d.ts +0 -8
  27. package/src/lib/actions/create-price.d.ts.map +0 -1
  28. package/src/lib/actions/create-price.js +0 -92
  29. package/src/lib/actions/create-price.js.map +0 -1
  30. package/src/lib/actions/create-product.d.ts +0 -9
  31. package/src/lib/actions/create-product.d.ts.map +0 -1
  32. package/src/lib/actions/create-product.js +0 -84
  33. package/src/lib/actions/create-product.js.map +0 -1
  34. package/src/lib/actions/create-refund.d.ts +0 -7
  35. package/src/lib/actions/create-refund.d.ts.map +0 -1
  36. package/src/lib/actions/create-refund.js +0 -72
  37. package/src/lib/actions/create-refund.js.map +0 -1
  38. package/src/lib/actions/create-subscription.d.ts +0 -10
  39. package/src/lib/actions/create-subscription.d.ts.map +0 -1
  40. package/src/lib/actions/create-subscription.js +0 -105
  41. package/src/lib/actions/create-subscription.js.map +0 -1
  42. package/src/lib/actions/deactivate-payment-link.d.ts +0 -4
  43. package/src/lib/actions/deactivate-payment-link.d.ts.map +0 -1
  44. package/src/lib/actions/deactivate-payment-link.js +0 -26
  45. package/src/lib/actions/deactivate-payment-link.js.map +0 -1
  46. package/src/lib/actions/find-invoice.d.ts +0 -4
  47. package/src/lib/actions/find-invoice.d.ts.map +0 -1
  48. package/src/lib/actions/find-invoice.js +0 -32
  49. package/src/lib/actions/find-invoice.js.map +0 -1
  50. package/src/lib/actions/retrieve-customer.d.ts +0 -4
  51. package/src/lib/actions/retrieve-customer.d.ts.map +0 -1
  52. package/src/lib/actions/retrieve-customer.js +0 -37
  53. package/src/lib/actions/retrieve-customer.js.map +0 -1
  54. package/src/lib/actions/retrieve-invoice.d.ts +0 -4
  55. package/src/lib/actions/retrieve-invoice.d.ts.map +0 -1
  56. package/src/lib/actions/retrieve-invoice.js +0 -32
  57. package/src/lib/actions/retrieve-invoice.js.map +0 -1
  58. package/src/lib/actions/retrieve-payment-intent.d.ts +0 -4
  59. package/src/lib/actions/retrieve-payment-intent.d.ts.map +0 -1
  60. package/src/lib/actions/retrieve-payment-intent.js +0 -32
  61. package/src/lib/actions/retrieve-payment-intent.js.map +0 -1
  62. package/src/lib/actions/retrieve-payout.d.ts +0 -4
  63. package/src/lib/actions/retrieve-payout.d.ts.map +0 -1
  64. package/src/lib/actions/retrieve-payout.js +0 -32
  65. package/src/lib/actions/retrieve-payout.js.map +0 -1
  66. package/src/lib/actions/search-customer.d.ts +0 -4
  67. package/src/lib/actions/search-customer.d.ts.map +0 -1
  68. package/src/lib/actions/search-customer.js +0 -42
  69. package/src/lib/actions/search-customer.js.map +0 -1
  70. package/src/lib/actions/search-subscriptions.d.ts +0 -11
  71. package/src/lib/actions/search-subscriptions.d.ts.map +0 -1
  72. package/src/lib/actions/search-subscriptions.js +0 -194
  73. package/src/lib/actions/search-subscriptions.js.map +0 -1
  74. package/src/lib/actions/update-customer.d.ts +0 -13
  75. package/src/lib/actions/update-customer.d.ts.map +0 -1
  76. package/src/lib/actions/update-customer.js +0 -95
  77. package/src/lib/actions/update-customer.js.map +0 -1
  78. package/src/lib/common/index.d.ts +0 -18
  79. package/src/lib/common/index.d.ts.map +0 -1
  80. package/src/lib/common/index.js +0 -405
  81. package/src/lib/common/index.js.map +0 -1
  82. package/src/lib/common/types.d.ts +0 -59
  83. package/src/lib/common/types.d.ts.map +0 -1
  84. package/src/lib/common/types.js +0 -3
  85. package/src/lib/common/types.js.map +0 -1
  86. package/src/lib/trigger/canceled-subscription.d.ts +0 -11
  87. package/src/lib/trigger/canceled-subscription.d.ts.map +0 -1
  88. package/src/lib/trigger/canceled-subscription.js +0 -113
  89. package/src/lib/trigger/canceled-subscription.js.map +0 -1
  90. package/src/lib/trigger/checkout-session-completed.d.ts +0 -11
  91. package/src/lib/trigger/checkout-session-completed.d.ts.map +0 -1
  92. package/src/lib/trigger/checkout-session-completed.js +0 -91
  93. package/src/lib/trigger/checkout-session-completed.js.map +0 -1
  94. package/src/lib/trigger/invoice-payment-failed.d.ts +0 -11
  95. package/src/lib/trigger/invoice-payment-failed.d.ts.map +0 -1
  96. package/src/lib/trigger/invoice-payment-failed.js +0 -101
  97. package/src/lib/trigger/invoice-payment-failed.js.map +0 -1
  98. package/src/lib/trigger/new-charge.d.ts +0 -3
  99. package/src/lib/trigger/new-charge.d.ts.map +0 -1
  100. package/src/lib/trigger/new-charge.js +0 -96
  101. package/src/lib/trigger/new-charge.js.map +0 -1
  102. package/src/lib/trigger/new-customer.d.ts +0 -3
  103. package/src/lib/trigger/new-customer.d.ts.map +0 -1
  104. package/src/lib/trigger/new-customer.js +0 -91
  105. package/src/lib/trigger/new-customer.js.map +0 -1
  106. package/src/lib/trigger/new-dispute.d.ts +0 -15
  107. package/src/lib/trigger/new-dispute.d.ts.map +0 -1
  108. package/src/lib/trigger/new-dispute.js +0 -99
  109. package/src/lib/trigger/new-dispute.js.map +0 -1
  110. package/src/lib/trigger/new-invoice.d.ts +0 -19
  111. package/src/lib/trigger/new-invoice.d.ts.map +0 -1
  112. package/src/lib/trigger/new-invoice.js +0 -114
  113. package/src/lib/trigger/new-invoice.js.map +0 -1
  114. package/src/lib/trigger/new-payment-link.d.ts +0 -3
  115. package/src/lib/trigger/new-payment-link.d.ts.map +0 -1
  116. package/src/lib/trigger/new-payment-link.js +0 -76
  117. package/src/lib/trigger/new-payment-link.js.map +0 -1
  118. package/src/lib/trigger/new-payment.d.ts +0 -3
  119. package/src/lib/trigger/new-payment.d.ts.map +0 -1
  120. package/src/lib/trigger/new-payment.js +0 -158
  121. package/src/lib/trigger/new-payment.js.map +0 -1
  122. package/src/lib/trigger/new-refund.d.ts +0 -15
  123. package/src/lib/trigger/new-refund.d.ts.map +0 -1
  124. package/src/lib/trigger/new-refund.js +0 -91
  125. package/src/lib/trigger/new-refund.js.map +0 -1
  126. package/src/lib/trigger/new-subscription.d.ts +0 -3
  127. package/src/lib/trigger/new-subscription.d.ts.map +0 -1
  128. package/src/lib/trigger/new-subscription.js +0 -197
  129. package/src/lib/trigger/new-subscription.js.map +0 -1
  130. package/src/lib/trigger/payment-failed.d.ts +0 -3
  131. package/src/lib/trigger/payment-failed.d.ts.map +0 -1
  132. package/src/lib/trigger/payment-failed.js +0 -204
  133. package/src/lib/trigger/payment-failed.js.map +0 -1
  134. package/src/lib/trigger/updated-subscription.d.ts +0 -15
  135. package/src/lib/trigger/updated-subscription.d.ts.map +0 -1
  136. package/src/lib/trigger/updated-subscription.js +0 -127
  137. package/src/lib/trigger/updated-subscription.js.map +0 -1
@@ -1,91 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stripeCheckoutSessionCompleted = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const common_1 = require("../common");
7
- const __1 = require("../..");
8
- const shared_1 = require("@activepieces/shared");
9
- const pieces_common_1 = require("@activepieces/pieces-common");
10
- exports.stripeCheckoutSessionCompleted = (0, pieces_framework_1.createTrigger)({
11
- auth: __1.stripeAuth,
12
- name: 'checkout_session_completed',
13
- displayName: 'Checkout Session Completed',
14
- description: 'Fires when a Stripe Checkout Session is successfully completed.',
15
- props: {
16
- customer: pieces_framework_1.Property.ShortText({
17
- displayName: 'Customer ID',
18
- description: 'Only trigger for checkout sessions created by this customer ID (e.g., `cus_...`).',
19
- required: false,
20
- }),
21
- },
22
- sampleData: {
23
- id: 'cs_test_a11YYufWQzNY63zpQ6QSNRQhkUpVph4WRmzW0zWJO2znZKdVujZ0N0S22u',
24
- object: 'checkout.session',
25
- amount_subtotal: 2198,
26
- amount_total: 2198,
27
- created: 1679600215,
28
- currency: 'usd',
29
- customer: 'cus_NWSaVkvdacCUi4',
30
- customer_details: {
31
- email: 'jenny.rosen@example.com',
32
- name: 'Jenny Rosen',
33
- phone: null,
34
- },
35
- livemode: false,
36
- mode: 'payment',
37
- payment_intent: 'pi_12345ABC',
38
- payment_status: 'paid',
39
- status: 'complete',
40
- success_url: 'https://example.com/success',
41
- url: null,
42
- },
43
- type: pieces_framework_1.TriggerStrategy.WEBHOOK,
44
- onEnable(context) {
45
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
46
- const webhook = yield common_1.stripeCommon.subscribeWebhook('checkout.session.completed', context.webhookUrl, context.auth.secret_text);
47
- yield context.store.put('_checkout_session_completed_trigger', {
48
- webhookId: webhook.id,
49
- });
50
- });
51
- },
52
- onDisable(context) {
53
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
54
- const webhookInfo = yield context.store.get('_checkout_session_completed_trigger');
55
- if (webhookInfo !== null && webhookInfo !== undefined) {
56
- yield common_1.stripeCommon.unsubscribeWebhook(webhookInfo.webhookId, context.auth.secret_text);
57
- }
58
- });
59
- },
60
- test(context) {
61
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
62
- const response = yield pieces_common_1.httpClient.sendRequest({
63
- method: pieces_common_1.HttpMethod.GET,
64
- url: 'https://api.stripe.com/v1/checkout/sessions',
65
- headers: {
66
- Authorization: 'Bearer ' + context.auth.secret_text,
67
- 'Content-Type': 'application/x-www-form-urlencoded',
68
- },
69
- queryParams: {
70
- status: 'complete',
71
- limit: '5',
72
- },
73
- });
74
- if ((0, shared_1.isEmpty)(response.body) || (0, shared_1.isEmpty)(response.body.data))
75
- return [];
76
- return response.body.data;
77
- });
78
- },
79
- run(context) {
80
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
81
- const payloadBody = context.payload.body;
82
- const sessionObject = payloadBody.data.object;
83
- const { customer } = context.propsValue;
84
- if (customer && sessionObject['customer'] !== customer) {
85
- return [];
86
- }
87
- return [sessionObject];
88
- });
89
- },
90
- });
91
- //# sourceMappingURL=checkout-session-completed.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkout-session-completed.js","sourceRoot":"","sources":["../../../../src/lib/trigger/checkout-session-completed.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,sCAAyC;AAEzC,6BAAmC;AACnC,iDAA+C;AAC/C,+DAAqE;AASxD,QAAA,8BAA8B,GAAG,IAAA,gCAAa,EAAC;IAC1D,IAAI,EAAE,cAAU;IAChB,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,4BAA4B;IACzC,WAAW,EACT,iEAAiE;IACnE,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,mFAAmF;YACrF,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACD,UAAU,EAAE;QACV,EAAE,EAAE,oEAAoE;QACxE,MAAM,EAAE,kBAAkB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EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW;oBACnD,cAAc,EAAE,mCAAmC;iBACpD;gBACD,WAAW,EAAE;oBACX,MAAM,EAAE,UAAU;oBAClB,KAAK,EAAE,GAAG;iBACX;aACF,CAAC,CAAC;YAEH,IAAI,IAAA,gBAAO,EAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAA,gBAAO,EAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,OAAO,EAAE,CAAC;YAErE,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5B,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,IAA4B,CAAC;YACjE,MAAM,aAAa,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;YAC9C,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAExC,IAAI,QAAQ,IAAI,aAAa,CAAC,UAAU,CAAC,KAAK,QAAQ,EAAE,CAAC;gBACvD,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,OAAO,CAAC,aAAa,CAAC,CAAC;QACzB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const stripeInvoicePaymentFailed: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
3
- customer: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
5
- customer: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
7
- customer: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
9
- customer: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
- }>;
11
- //# sourceMappingURL=invoice-payment-failed.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invoice-payment-failed.d.ts","sourceRoot":"","sources":["../../../../src/lib/trigger/invoice-payment-failed.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAexC,eAAO,MAAM,0BAA0B;;;;;;;;EAqGrC,CAAC"}
@@ -1,101 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stripeInvoicePaymentFailed = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const common_1 = require("../common");
7
- const __1 = require("../..");
8
- const pieces_common_1 = require("@activepieces/pieces-common");
9
- const shared_1 = require("@activepieces/shared");
10
- exports.stripeInvoicePaymentFailed = (0, pieces_framework_1.createTrigger)({
11
- auth: __1.stripeAuth,
12
- name: 'invoice_payment_failed',
13
- displayName: 'Invoice Payment Failed',
14
- description: 'Fires when a payment against an invoice fails.',
15
- props: {
16
- customer: pieces_framework_1.Property.ShortText({
17
- displayName: 'Customer ID',
18
- description: 'Only trigger for invoices belonging to this customer ID (e.g., `cus_...`).',
19
- required: false,
20
- }),
21
- },
22
- sampleData: {
23
- id: 'in_1MtHbELkdIwHu7ixl4OzzPMv',
24
- object: 'invoice',
25
- customer: 'cus_NeZwdNtLEOXuvB',
26
- status: 'open',
27
- amount_due: 1500,
28
- amount_paid: 0,
29
- amount_remaining: 1500,
30
- attempt_count: 1,
31
- attempted: true,
32
- billing_reason: 'subscription_cycle',
33
- collection_method: 'charge_automatically',
34
- created: 1680644467,
35
- currency: 'usd',
36
- customer_email: 'jennyrosen@example.com',
37
- customer_name: 'Jenny Rosen',
38
- hosted_invoice_url: 'https://invoice.stripe.com/i/acct_...',
39
- last_finalization_error: {
40
- code: 'card_declined',
41
- doc_url: 'https://stripe.com/docs/error-codes/card-declined',
42
- message: 'Your card was declined.',
43
- param: '',
44
- payment_intent: {
45
- id: 'pi_123',
46
- object: 'payment_intent',
47
- },
48
- type: 'card_error',
49
- },
50
- livemode: false,
51
- next_payment_attempt: 1681251667,
52
- },
53
- type: pieces_framework_1.TriggerStrategy.WEBHOOK,
54
- onEnable(context) {
55
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
56
- const webhook = yield common_1.stripeCommon.subscribeWebhook('invoice.payment_failed', context.webhookUrl, context.auth.secret_text);
57
- yield context.store.put('_invoice_payment_failed_trigger', {
58
- webhookId: webhook.id,
59
- });
60
- });
61
- },
62
- onDisable(context) {
63
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
64
- const webhookInfo = yield context.store.get('_invoice_payment_failed_trigger');
65
- if (webhookInfo !== null && webhookInfo !== undefined) {
66
- yield common_1.stripeCommon.unsubscribeWebhook(webhookInfo.webhookId, context.auth.secret_text);
67
- }
68
- });
69
- },
70
- test(context) {
71
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
72
- const response = yield pieces_common_1.httpClient.sendRequest({
73
- method: pieces_common_1.HttpMethod.GET,
74
- url: 'https://api.stripe.com/v1/invoices',
75
- headers: {
76
- Authorization: 'Bearer ' + context.auth.secret_text,
77
- 'Content-Type': 'application/x-www-form-urlencoded',
78
- },
79
- queryParams: {
80
- status: 'open',
81
- limit: '5',
82
- },
83
- });
84
- if ((0, shared_1.isEmpty)(response.body) || (0, shared_1.isEmpty)(response.body.data))
85
- return [];
86
- return response.body.data;
87
- });
88
- },
89
- run(context) {
90
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
91
- const payloadBody = context.payload.body;
92
- const invoiceObject = payloadBody.data.object;
93
- const { customer } = context.propsValue;
94
- if (customer && invoiceObject['customer'] !== customer) {
95
- return [];
96
- }
97
- return [invoiceObject];
98
- });
99
- },
100
- });
101
- //# sourceMappingURL=invoice-payment-failed.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invoice-payment-failed.js","sourceRoot":"","sources":["../../../../src/lib/trigger/invoice-payment-failed.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,sCAAyC;AAEzC,6BAAmC;AACnC,+DAAqE;AACrE,iDAA+C;AAUlC,QAAA,0BAA0B,GAAG,IAAA,gCAAa,EAAC;IACtD,IAAI,EAAE,cAAU;IAChB,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,gDAAgD;IAC7D,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,4EAA4E;YAC9E,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IAED,UAAU,EAAE;QACV,EAAE,EAAE,6BAA6B;QACjC,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,oBAAoB;QAC9B,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,IAAI;QAChB,WAAW,EAAE,CAAC;QACd,gBAAgB,EAAE,IAAI;QACtB,aAAa,EAAE,CAAC;QAChB,SAAS,EAAE,IAAI;QACf,cAAc,EAAE,oBAAoB;QACpC,iBAAiB,EAAE,sBAAsB;QACzC,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,KAAK;QACf,cAAc,EAAE,wBAAwB;QACxC,aAAa,EAAE,aAAa;QAC5B,kBAAkB,EAAE,uCAAuC;QAC3D,uBAAuB,EAAE;YACvB,IAAI,EAAE,eAAe;YACrB,OAAO,EAAE,mDAAmD;YAC5D,OAAO,EAAE,yBAAyB;YAClC,KAAK,EAAE,EAAE;YACT,cAAc,EAAE;gBACd,EAAE,EAAE,QAAQ;gBACZ,MAAM,EAAE,gBAAgB;aACzB;YACD,IAAI,EAAE,YAAY;SACnB;QACD,QAAQ,EAAE,KAAK;QACf,oBAAoB,E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,GAAG,CAAC,OAAO;;YACf,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,IAA4B,CAAC;YACjE,MAAM,aAAa,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;YAC9C,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAExC,IAAI,QAAQ,IAAI,aAAa,CAAC,UAAU,CAAC,KAAK,QAAQ,EAAE,CAAC;gBACvD,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,OAAO,CAAC,aAAa,CAAC,CAAC;QACzB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const stripeNewCharge: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}>;
3
- //# sourceMappingURL=new-charge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-charge.d.ts","sourceRoot":"","sources":["../../../../src/lib/trigger/new-charge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAahF,eAAO,MAAM,eAAe,klBAyF1B,CAAC"}
@@ -1,96 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stripeNewCharge = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const common_1 = require("../common");
7
- const __1 = require("../..");
8
- const pieces_common_1 = require("@activepieces/pieces-common");
9
- const shared_1 = require("@activepieces/shared");
10
- exports.stripeNewCharge = (0, pieces_framework_1.createTrigger)({
11
- auth: __1.stripeAuth,
12
- name: 'new_charge',
13
- displayName: 'New Charge',
14
- description: 'Fires when a charge is successfully completed.',
15
- props: {},
16
- sampleData: {
17
- id: 'ch_3MmlLrLkdIwHu7ix0snN0B15',
18
- object: 'charge',
19
- amount: 1099,
20
- amount_captured: 1099,
21
- amount_refunded: 0,
22
- application: null,
23
- application_fee: null,
24
- application_fee_amount: null,
25
- balance_transaction: 'txn_3MmlLrLkdIwHu7ix0uke3Ezy',
26
- billing_details: {
27
- address: {
28
- city: null,
29
- country: null,
30
- line1: null,
31
- line2: null,
32
- postal_code: null,
33
- state: null,
34
- },
35
- email: 'customer@example.com',
36
- name: 'John Doe',
37
- phone: null,
38
- },
39
- captured: true,
40
- created: 1679090539,
41
- currency: 'usd',
42
- customer: 'cus_ABC123',
43
- description: 'My First Test Charge',
44
- disputed: false,
45
- paid: true,
46
- payment_intent: 'pi_123',
47
- payment_method: 'pm_123',
48
- receipt_url: 'https://pay.stripe.com/receipts/...',
49
- refunded: false,
50
- status: 'succeeded',
51
- },
52
- type: pieces_framework_1.TriggerStrategy.WEBHOOK,
53
- onEnable(context) {
54
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
55
- const webhook = yield common_1.stripeCommon.subscribeWebhook('charge.succeeded', context.webhookUrl, context.auth.secret_text);
56
- yield context.store.put('_new_charge_trigger', {
57
- webhookId: webhook.id,
58
- });
59
- });
60
- },
61
- onDisable(context) {
62
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
63
- const webhookInfo = yield context.store.get('_new_charge_trigger');
64
- if (webhookInfo !== null && webhookInfo !== undefined) {
65
- yield common_1.stripeCommon.unsubscribeWebhook(webhookInfo.webhookId, context.auth.secret_text);
66
- }
67
- });
68
- },
69
- test(context) {
70
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
71
- const response = yield pieces_common_1.httpClient.sendRequest({
72
- method: pieces_common_1.HttpMethod.GET,
73
- url: 'https://api.stripe.com/v1/charges/search',
74
- headers: {
75
- Authorization: 'Bearer ' + context.auth.secret_text,
76
- 'Content-Type': 'application/x-www-form-urlencoded',
77
- 'Stripe-Version': "2026-02-25.clover",
78
- },
79
- queryParams: {
80
- query: 'status:"succeeded"',
81
- limit: '5',
82
- },
83
- });
84
- if ((0, shared_1.isEmpty)(response.body) || (0, shared_1.isEmpty)(response.body.data))
85
- return [];
86
- return response.body.data;
87
- });
88
- },
89
- run(context) {
90
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
91
- const payloadBody = context.payload.body;
92
- return [payloadBody.data.object];
93
- });
94
- },
95
- });
96
- //# sourceMappingURL=new-charge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-charge.js","sourceRoot":"","sources":["../../../../src/lib/trigger/new-charge.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,sCAAyC;AAEzC,6BAAmC;AACnC,+DAAqE;AACrE,iDAA+C;AAQlC,QAAA,eAAe,GAAG,IAAA,gCAAa,EAAC;IAC3C,IAAI,EAAE,cAAU;IAChB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,gDAAgD;IAC7D,KAAK,EAAE,EAAE;IACT,UAAU,EAAE;QACV,EAAE,EAAE,6BAA6B;QACjC,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,IAAI;QACZ,eAAe,EAAE,IAAI;QACrB,eAAe,EAAE,CAAC;QAClB,WAAW,EAAE,IAAI;QACjB,eAAe,EAAE,IAAI;QACrB,sBAAsB,EAAE,IAAI;QAC5B,mBAAmB,EAAE,8BAA8B;QACnD,eAAe,EAAE;YACf,OAAO,EAAE;gBACP,IAAI,EAAE,IAAI;gBACV,OAAO,EAAE,IAAI;gBACb,KAAK,EAAE,IAAI;gBACX,KAAK,EAAE,IAAI;gBACX,WAAW,EAAE,IAAI;gBACjB,KAAK,EAAE,IAAI;aACZ;YACD,KAAK,EAAE,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AAC,WAAW;oBACnD,cAAc,EAAE,mCAAmC;oBAClD,gBAAgB,EAAE,mBAAmB;iBACvC;gBACD,WAAW,EAAE;oBACX,KAAK,EAAE,oBAAoB;oBAC3B,KAAK,EAAE,GAAG;iBACX;aACF,CAAC,CAAC;YAEH,IAAI,IAAA,gBAAO,EAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAA,gBAAO,EAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,OAAO,EAAE,CAAC;YAErE,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5B,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,IAA4B,CAAC;YACjE,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const stripeNewCustomer: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {}>;
3
- //# sourceMappingURL=new-customer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-customer.d.ts","sourceRoot":"","sources":["../../../../src/lib/trigger/new-customer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAMjE,eAAO,MAAM,iBAAiB,klBA6E5B,CAAC"}
@@ -1,91 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stripeNewCustomer = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_framework_2 = require("@activepieces/pieces-framework");
7
- const common_1 = require("../common");
8
- const __1 = require("../..");
9
- const pieces_common_1 = require("@activepieces/pieces-common");
10
- const shared_1 = require("@activepieces/shared");
11
- exports.stripeNewCustomer = (0, pieces_framework_1.createTrigger)({
12
- auth: __1.stripeAuth,
13
- name: 'new_customer',
14
- displayName: 'New Customer',
15
- description: 'Triggers when a new customer is created',
16
- props: {},
17
- sampleData: {
18
- id: 'cus_NGtyEf4hNGTj3p',
19
- object: 'customer',
20
- address: null,
21
- balance: 0,
22
- created: 1675180509,
23
- currency: null,
24
- default_currency: null,
25
- default_source: null,
26
- delinquent: false,
27
- description: null,
28
- discount: null,
29
- email: 'jane@example.com',
30
- invoice_prefix: 'B7162248',
31
- invoice_settings: {
32
- custom_fields: null,
33
- default_payment_method: null,
34
- footer: null,
35
- rendering_options: null,
36
- },
37
- livemode: false,
38
- metadata: {},
39
- name: 'John Doe',
40
- next_invoice_sequence: 1,
41
- phone: null,
42
- preferred_locales: [],
43
- shipping: null,
44
- tax_exempt: 'none',
45
- test_clock: null,
46
- },
47
- type: pieces_framework_2.TriggerStrategy.WEBHOOK,
48
- onEnable(context) {
49
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
50
- const webhook = yield common_1.stripeCommon.subscribeWebhook('customer.created', context.webhookUrl, context.auth.secret_text);
51
- yield context.store.put('_new_customer_trigger', {
52
- webhookId: webhook.id,
53
- });
54
- });
55
- },
56
- onDisable(context) {
57
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
58
- var _a;
59
- const response = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_new_customer_trigger'));
60
- if (response !== null && response !== undefined) {
61
- yield common_1.stripeCommon.unsubscribeWebhook(response.webhookId, context.auth.secret_text);
62
- }
63
- });
64
- },
65
- test(context) {
66
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
67
- const response = yield pieces_common_1.httpClient.sendRequest({
68
- method: pieces_common_1.HttpMethod.GET,
69
- url: 'https://api.stripe.com/v1/customers',
70
- headers: {
71
- Authorization: 'Bearer ' + context.auth.secret_text,
72
- 'Content-Type': 'application/x-www-form-urlencoded',
73
- 'Stripe-Version': "2026-02-25.clover",
74
- },
75
- queryParams: {
76
- limit: '5',
77
- },
78
- });
79
- if ((0, shared_1.isEmpty)(response.body) || (0, shared_1.isEmpty)(response.body.data))
80
- return [];
81
- return response.body.data;
82
- });
83
- },
84
- run(context) {
85
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
86
- const payloadBody = context.payload.body;
87
- return [payloadBody.data.object];
88
- });
89
- },
90
- });
91
- //# sourceMappingURL=new-customer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-customer.js","sourceRoot":"","sources":["../../../../src/lib/trigger/new-customer.ts"],"names":[],"mappings":";;;;AAAA,qEAA+D;AAC/D,qEAAiE;AACjE,sCAAyC;AACzC,6BAAmC;AACnC,+DAAqE;AACrE,iDAA+C;AAElC,QAAA,iBAAiB,GAAG,IAAA,gCAAa,EAAC;IAC7C,IAAI,EAAE,cAAU;IAChB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,yCAAyC;IACtD,KAAK,EAAE,EAAE;IACT,UAAU,EAAE;QACV,EAAE,EAAE,oBAAoB;QACxB,MAAM,EAAE,UAAU;QAClB,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,IAAI;QACd,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,IAAI;QACpB,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,IAAI;QACjB,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,kBAAkB;QACzB,cAAc,EAAE,UAAU;QAC1B,gBAAgB,EAAE;YAChB,aAAa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cAAc,EAAE,mCAAmC;oBACnD,gBAAgB,EAAE,mBAAmB;iBACtC;gBACD,WAAW,EAAE;oBACX,KAAK,EAAE,GAAG;iBACX;aACF,CAAC,CAAC;YAEH,IAAI,IAAA,gBAAO,EAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAA,gBAAO,EAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,OAAO,EAAE,CAAC;YAErE,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5B,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,IAAmB,CAAC;YACxD,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const stripeNewDispute: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
3
- charge: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
- payment_intent: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
6
- charge: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
- payment_intent: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
9
- charge: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
- payment_intent: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
12
- charge: import("@activepieces/pieces-framework").ShortTextProperty<false>;
13
- payment_intent: import("@activepieces/pieces-framework").ShortTextProperty<false>;
14
- }>;
15
- //# sourceMappingURL=new-dispute.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-dispute.d.ts","sourceRoot":"","sources":["../../../../src/lib/trigger/new-dispute.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAexC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EAkG3B,CAAC"}
@@ -1,99 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stripeNewDispute = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const common_1 = require("../common");
7
- const __1 = require("../..");
8
- const pieces_common_1 = require("@activepieces/pieces-common");
9
- const shared_1 = require("@activepieces/shared");
10
- exports.stripeNewDispute = (0, pieces_framework_1.createTrigger)({
11
- auth: __1.stripeAuth,
12
- name: 'new_dispute',
13
- displayName: 'New Dispute',
14
- description: 'Fires when a customer disputes a charge.',
15
- props: {
16
- charge: pieces_framework_1.Property.ShortText({
17
- displayName: 'Charge ID',
18
- description: 'Only trigger for disputes related to this Charge ID (e.g., `ch_...`).',
19
- required: false,
20
- }),
21
- payment_intent: pieces_framework_1.Property.ShortText({
22
- displayName: 'Payment Intent ID',
23
- description: 'Only trigger for disputes related to this Payment Intent ID (e.g., `pi_...`).',
24
- required: false,
25
- }),
26
- },
27
- sampleData: {
28
- id: 'du_1MtJUT2eZvKYlo2CNaw2HvEv',
29
- object: 'dispute',
30
- amount: 1000,
31
- balance_transactions: [],
32
- charge: 'ch_1AZtxr2eZvKYlo2CJDX8whov',
33
- created: 1680651737,
34
- currency: 'usd',
35
- evidence_details: {
36
- due_by: 1682294399,
37
- has_evidence: false,
38
- past_due: false,
39
- submission_count: 0,
40
- },
41
- is_charge_refundable: true,
42
- livemode: false,
43
- metadata: {},
44
- payment_intent: 'pi_1AZtxr2eZvKYlo2CJDX8whov',
45
- reason: 'general',
46
- status: 'needs_response',
47
- },
48
- type: pieces_framework_1.TriggerStrategy.WEBHOOK,
49
- onEnable(context) {
50
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
51
- const webhook = yield common_1.stripeCommon.subscribeWebhook('charge.dispute.created', context.webhookUrl, context.auth.secret_text);
52
- yield context.store.put('_new_dispute_trigger', {
53
- webhookId: webhook.id,
54
- });
55
- });
56
- },
57
- onDisable(context) {
58
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
59
- const webhookInfo = yield context.store.get('_new_dispute_trigger');
60
- if (webhookInfo !== null && webhookInfo !== undefined) {
61
- yield common_1.stripeCommon.unsubscribeWebhook(webhookInfo.webhookId, context.auth.secret_text);
62
- }
63
- });
64
- },
65
- test(context) {
66
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
67
- const response = yield pieces_common_1.httpClient.sendRequest({
68
- method: pieces_common_1.HttpMethod.GET,
69
- url: 'https://api.stripe.com/v1/issuing/disputes',
70
- headers: {
71
- Authorization: 'Bearer ' + context.auth.secret_text,
72
- 'Content-Type': 'application/x-www-form-urlencoded',
73
- },
74
- queryParams: {
75
- status: 'submitted',
76
- limit: '5',
77
- },
78
- });
79
- if ((0, shared_1.isEmpty)(response.body) || (0, shared_1.isEmpty)(response.body.data))
80
- return [];
81
- return response.body.data;
82
- });
83
- },
84
- run(context) {
85
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
86
- const payloadBody = context.payload.body;
87
- const disputeObject = payloadBody.data.object;
88
- const { charge, payment_intent } = context.propsValue;
89
- if (charge && disputeObject['charge'] !== charge) {
90
- return [];
91
- }
92
- if (payment_intent && disputeObject['payment_intent'] !== payment_intent) {
93
- return [];
94
- }
95
- return [disputeObject];
96
- });
97
- },
98
- });
99
- //# sourceMappingURL=new-dispute.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-dispute.js","sourceRoot":"","sources":["../../../../src/lib/trigger/new-dispute.ts"],"names":[],"mappings":";;;;AAAA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KAAK,MAAM,EAAE,CAAC;gBACjD,OAAO,EAAE,CAAC;YACZ,CAAC;YACD,IAAI,cAAc,IAAI,aAAa,CAAC,gBAAgB,CAAC,KAAK,cAAc,EAAE,CAAC;gBACzE,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,OAAO,CAAC,aAAa,CAAC,CAAC;QACzB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,19 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const stripeNewInvoice: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
3
- status: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
4
- customer: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
- subscription: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
7
- status: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
8
- customer: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
- subscription: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
11
- status: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
12
- customer: import("@activepieces/pieces-framework").ShortTextProperty<false>;
13
- subscription: import("@activepieces/pieces-framework").ShortTextProperty<false>;
14
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").SecretTextProperty<true>, {
15
- status: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
16
- customer: import("@activepieces/pieces-framework").ShortTextProperty<false>;
17
- subscription: import("@activepieces/pieces-framework").ShortTextProperty<false>;
18
- }>;
19
- //# sourceMappingURL=new-invoice.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-invoice.d.ts","sourceRoot":"","sources":["../../../../src/lib/trigger/new-invoice.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAexC,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;EAgH3B,CAAC"}