@activepieces/piece-stripe 0.6.9 → 0.6.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 -42
  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 -91
  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 -59
  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 -113
  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 -97
  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 -97
  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 -89
  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 -77
  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 -110
  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 -31
  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 -37
  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 -42
  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 -37
  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 -37
  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 -37
  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 -47
  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 -199
  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 -100
  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 -116
  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 -94
  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 -104
  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 -99
  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 -94
  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 -102
  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 -117
  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 -79
  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 -161
  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 -94
  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 -200
  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 -207
  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 -130
  137. package/src/lib/trigger/updated-subscription.js.map +0 -1
@@ -1,94 +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
- aiMetadata: {
16
- description: 'Fires when a Stripe Checkout Session is successfully completed (the checkout.session.completed event), emitting the completed session including customer and payment details. An optional customer ID filter narrows firing to one customer. Use to react to a completed hosted checkout, such as fulfilling an order or granting access.',
17
- },
18
- props: {
19
- customer: pieces_framework_1.Property.ShortText({
20
- displayName: 'Customer ID',
21
- description: 'Only trigger for checkout sessions created by this customer ID (e.g., `cus_...`).',
22
- required: false,
23
- }),
24
- },
25
- sampleData: {
26
- id: 'cs_test_a11YYufWQzNY63zpQ6QSNRQhkUpVph4WRmzW0zWJO2znZKdVujZ0N0S22u',
27
- object: 'checkout.session',
28
- amount_subtotal: 2198,
29
- amount_total: 2198,
30
- created: 1679600215,
31
- currency: 'usd',
32
- customer: 'cus_NWSaVkvdacCUi4',
33
- customer_details: {
34
- email: 'jenny.rosen@example.com',
35
- name: 'Jenny Rosen',
36
- phone: null,
37
- },
38
- livemode: false,
39
- mode: 'payment',
40
- payment_intent: 'pi_12345ABC',
41
- payment_status: 'paid',
42
- status: 'complete',
43
- success_url: 'https://example.com/success',
44
- url: null,
45
- },
46
- type: pieces_framework_1.TriggerStrategy.WEBHOOK,
47
- onEnable(context) {
48
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
49
- const webhook = yield common_1.stripeCommon.subscribeWebhook('checkout.session.completed', context.webhookUrl, context.auth.secret_text);
50
- yield context.store.put('_checkout_session_completed_trigger', {
51
- webhookId: webhook.id,
52
- });
53
- });
54
- },
55
- onDisable(context) {
56
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
57
- const webhookInfo = yield context.store.get('_checkout_session_completed_trigger');
58
- if (webhookInfo !== null && webhookInfo !== undefined) {
59
- yield common_1.stripeCommon.unsubscribeWebhook(webhookInfo.webhookId, context.auth.secret_text);
60
- }
61
- });
62
- },
63
- test(context) {
64
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
65
- const response = yield pieces_common_1.httpClient.sendRequest({
66
- method: pieces_common_1.HttpMethod.GET,
67
- url: 'https://api.stripe.com/v1/checkout/sessions',
68
- headers: {
69
- Authorization: 'Bearer ' + context.auth.secret_text,
70
- 'Content-Type': 'application/x-www-form-urlencoded',
71
- },
72
- queryParams: {
73
- status: 'complete',
74
- limit: '5',
75
- },
76
- });
77
- if ((0, shared_1.isEmpty)(response.body) || (0, shared_1.isEmpty)(response.body.data))
78
- return [];
79
- return response.body.data;
80
- });
81
- },
82
- run(context) {
83
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
84
- const payloadBody = context.payload.body;
85
- const sessionObject = payloadBody.data.object;
86
- const { customer } = context.propsValue;
87
- if (customer && sessionObject['customer'] !== customer) {
88
- return [];
89
- }
90
- return [sessionObject];
91
- });
92
- },
93
- });
94
- //# 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,UAAU,EAAE;QACV,WAAW,EACT,2UAA2U;KAC9U;IACD,KAAK,EAAE;QACL,QAAQ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ACH,CAAC;KAAA;IACK,IAAI,CAAC,OAAO;;YAChB,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAA6B;gBACxE,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,6CAA6C;gBAClD,OAAO,EAAE;oBACP,aAAa,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;;;;;;;;EAyGrC,CAAC"}
@@ -1,104 +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
- aiMetadata: {
16
- description: 'Fires when a payment against an invoice fails in Stripe (the invoice.payment_failed event), emitting the affected invoice including the finalization error. An optional customer ID filter narrows firing to one customer. Use to react to failed invoice payments, such as starting a dunning or retry flow.',
17
- },
18
- props: {
19
- customer: pieces_framework_1.Property.ShortText({
20
- displayName: 'Customer ID',
21
- description: 'Only trigger for invoices belonging to this customer ID (e.g., `cus_...`).',
22
- required: false,
23
- }),
24
- },
25
- sampleData: {
26
- id: 'in_1MtHbELkdIwHu7ixl4OzzPMv',
27
- object: 'invoice',
28
- customer: 'cus_NeZwdNtLEOXuvB',
29
- status: 'open',
30
- amount_due: 1500,
31
- amount_paid: 0,
32
- amount_remaining: 1500,
33
- attempt_count: 1,
34
- attempted: true,
35
- billing_reason: 'subscription_cycle',
36
- collection_method: 'charge_automatically',
37
- created: 1680644467,
38
- currency: 'usd',
39
- customer_email: 'jennyrosen@example.com',
40
- customer_name: 'Jenny Rosen',
41
- hosted_invoice_url: 'https://invoice.stripe.com/i/acct_...',
42
- last_finalization_error: {
43
- code: 'card_declined',
44
- doc_url: 'https://stripe.com/docs/error-codes/card-declined',
45
- message: 'Your card was declined.',
46
- param: '',
47
- payment_intent: {
48
- id: 'pi_123',
49
- object: 'payment_intent',
50
- },
51
- type: 'card_error',
52
- },
53
- livemode: false,
54
- next_payment_attempt: 1681251667,
55
- },
56
- type: pieces_framework_1.TriggerStrategy.WEBHOOK,
57
- onEnable(context) {
58
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
59
- const webhook = yield common_1.stripeCommon.subscribeWebhook('invoice.payment_failed', context.webhookUrl, context.auth.secret_text);
60
- yield context.store.put('_invoice_payment_failed_trigger', {
61
- webhookId: webhook.id,
62
- });
63
- });
64
- },
65
- onDisable(context) {
66
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
67
- const webhookInfo = yield context.store.get('_invoice_payment_failed_trigger');
68
- if (webhookInfo !== null && webhookInfo !== undefined) {
69
- yield common_1.stripeCommon.unsubscribeWebhook(webhookInfo.webhookId, context.auth.secret_text);
70
- }
71
- });
72
- },
73
- test(context) {
74
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
75
- const response = yield pieces_common_1.httpClient.sendRequest({
76
- method: pieces_common_1.HttpMethod.GET,
77
- url: 'https://api.stripe.com/v1/invoices',
78
- headers: {
79
- Authorization: 'Bearer ' + context.auth.secret_text,
80
- 'Content-Type': 'application/x-www-form-urlencoded',
81
- },
82
- queryParams: {
83
- status: 'open',
84
- limit: '5',
85
- },
86
- });
87
- if ((0, shared_1.isEmpty)(response.body) || (0, shared_1.isEmpty)(response.body.data))
88
- return [];
89
- return response.body.data;
90
- });
91
- },
92
- run(context) {
93
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
94
- const payloadBody = context.payload.body;
95
- const invoiceObject = payloadBody.data.object;
96
- const { customer } = context.propsValue;
97
- if (customer && invoiceObject['customer'] !== customer) {
98
- return [];
99
- }
100
- return [invoiceObject];
101
- });
102
- },
103
- });
104
- //# 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,UAAU,EAAE;QACV,WAAW,EACT,+SAA+S;KAClT;IACD,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,OAA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AE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW;oBACnD,cAAc,EAAE,mCAAmC;iBACpD;gBACD,WAAW,EAAE;oBACX,MAAM,EAAG,MAAM;oBACf,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,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,klBA6F1B,CAAC"}
@@ -1,99 +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
- aiMetadata: {
16
- description: 'Fires when a charge is successfully completed in Stripe (the charge.succeeded event), emitting the charge record. Use to react to a successful card charge; note this is the charge-level event, distinct from the New Payment trigger which fires on a succeeded payment intent.',
17
- },
18
- props: {},
19
- sampleData: {
20
- id: 'ch_3MmlLrLkdIwHu7ix0snN0B15',
21
- object: 'charge',
22
- amount: 1099,
23
- amount_captured: 1099,
24
- amount_refunded: 0,
25
- application: null,
26
- application_fee: null,
27
- application_fee_amount: null,
28
- balance_transaction: 'txn_3MmlLrLkdIwHu7ix0uke3Ezy',
29
- billing_details: {
30
- address: {
31
- city: null,
32
- country: null,
33
- line1: null,
34
- line2: null,
35
- postal_code: null,
36
- state: null,
37
- },
38
- email: 'customer@example.com',
39
- name: 'John Doe',
40
- phone: null,
41
- },
42
- captured: true,
43
- created: 1679090539,
44
- currency: 'usd',
45
- customer: 'cus_ABC123',
46
- description: 'My First Test Charge',
47
- disputed: false,
48
- paid: true,
49
- payment_intent: 'pi_123',
50
- payment_method: 'pm_123',
51
- receipt_url: 'https://pay.stripe.com/receipts/...',
52
- refunded: false,
53
- status: 'succeeded',
54
- },
55
- type: pieces_framework_1.TriggerStrategy.WEBHOOK,
56
- onEnable(context) {
57
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
58
- const webhook = yield common_1.stripeCommon.subscribeWebhook('charge.succeeded', context.webhookUrl, context.auth.secret_text);
59
- yield context.store.put('_new_charge_trigger', {
60
- webhookId: webhook.id,
61
- });
62
- });
63
- },
64
- onDisable(context) {
65
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
66
- const webhookInfo = yield context.store.get('_new_charge_trigger');
67
- if (webhookInfo !== null && webhookInfo !== undefined) {
68
- yield common_1.stripeCommon.unsubscribeWebhook(webhookInfo.webhookId, context.auth.secret_text);
69
- }
70
- });
71
- },
72
- test(context) {
73
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
74
- const response = yield pieces_common_1.httpClient.sendRequest({
75
- method: pieces_common_1.HttpMethod.GET,
76
- url: 'https://api.stripe.com/v1/charges/search',
77
- headers: {
78
- Authorization: 'Bearer ' + context.auth.secret_text,
79
- 'Content-Type': 'application/x-www-form-urlencoded',
80
- 'Stripe-Version': "2026-02-25.clover",
81
- },
82
- queryParams: {
83
- query: 'status:"succeeded"',
84
- limit: '5',
85
- },
86
- });
87
- if ((0, shared_1.isEmpty)(response.body) || (0, shared_1.isEmpty)(response.body.data))
88
- return [];
89
- return response.body.data;
90
- });
91
- },
92
- run(context) {
93
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
94
- const payloadBody = context.payload.body;
95
- return [payloadBody.data.object];
96
- });
97
- },
98
- });
99
- //# 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;IACl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;aACtB,CAAC,CAAC;QACL,CAAC;KAAA;IAEK,SAAS,CAAC,OAAO;;YACrB,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,GAAG,CACzC,qBAAqB,CACtB,CAAC;YACF,IAAI,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;gBACtD,MAAM,qBAAY,CAAC,kBAAkB,CACnC,WAAW,CAAC,SAAS,EACrB,OAAO,CAAC,IAAI,CAAC,WAAW,CACzB,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;IACK,IAAI,CAAC,OAAO;;YAChB,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAA6B;gBACxE,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,0CAA0C;gBAC/C,OAAO,EAAE;oBACP,aAAa,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,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,klBAiF5B,CAAC"}
@@ -1,94 +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
- aiMetadata: {
17
- description: 'Fires when a new customer is created in Stripe (the customer.created event), emitting the new customer record. Use to react to customer onboarding, such as syncing them to a CRM or sending a welcome flow.',
18
- },
19
- props: {},
20
- sampleData: {
21
- id: 'cus_NGtyEf4hNGTj3p',
22
- object: 'customer',
23
- address: null,
24
- balance: 0,
25
- created: 1675180509,
26
- currency: null,
27
- default_currency: null,
28
- default_source: null,
29
- delinquent: false,
30
- description: null,
31
- discount: null,
32
- email: 'jane@example.com',
33
- invoice_prefix: 'B7162248',
34
- invoice_settings: {
35
- custom_fields: null,
36
- default_payment_method: null,
37
- footer: null,
38
- rendering_options: null,
39
- },
40
- livemode: false,
41
- metadata: {},
42
- name: 'John Doe',
43
- next_invoice_sequence: 1,
44
- phone: null,
45
- preferred_locales: [],
46
- shipping: null,
47
- tax_exempt: 'none',
48
- test_clock: null,
49
- },
50
- type: pieces_framework_2.TriggerStrategy.WEBHOOK,
51
- onEnable(context) {
52
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
53
- const webhook = yield common_1.stripeCommon.subscribeWebhook('customer.created', context.webhookUrl, context.auth.secret_text);
54
- yield context.store.put('_new_customer_trigger', {
55
- webhookId: webhook.id,
56
- });
57
- });
58
- },
59
- onDisable(context) {
60
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
61
- var _a;
62
- const response = yield ((_a = context.store) === null || _a === void 0 ? void 0 : _a.get('_new_customer_trigger'));
63
- if (response !== null && response !== undefined) {
64
- yield common_1.stripeCommon.unsubscribeWebhook(response.webhookId, context.auth.secret_text);
65
- }
66
- });
67
- },
68
- test(context) {
69
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
70
- const response = yield pieces_common_1.httpClient.sendRequest({
71
- method: pieces_common_1.HttpMethod.GET,
72
- url: 'https://api.stripe.com/v1/customers',
73
- headers: {
74
- Authorization: 'Bearer ' + context.auth.secret_text,
75
- 'Content-Type': 'application/x-www-form-urlencoded',
76
- 'Stripe-Version': "2026-02-25.clover",
77
- },
78
- queryParams: {
79
- limit: '5',
80
- },
81
- });
82
- if ((0, shared_1.isEmpty)(response.body) || (0, shared_1.isEmpty)(response.body.data))
83
- return [];
84
- return response.body.data;
85
- });
86
- },
87
- run(context) {
88
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
89
- const payloadBody = context.payload.body;
90
- return [payloadBody.data.object];
91
- });
92
- },
93
- });
94
- //# sourceMappingURL=new-customer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-customer.js","sourceRoot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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;;;;;;;;;;;;EAsG3B,CAAC"}
@@ -1,102 +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
- aiMetadata: {
16
- description: 'Fires when a customer disputes a charge in Stripe (the charge.dispute.created event), emitting the dispute including its reason and evidence due date. Optional filters narrow firing to a specific charge ID or payment intent ID. Use to react to chargebacks, such as alerting a team or gathering evidence.',
17
- },
18
- props: {
19
- charge: pieces_framework_1.Property.ShortText({
20
- displayName: 'Charge ID',
21
- description: 'Only trigger for disputes related to this Charge ID (e.g., `ch_...`).',
22
- required: false,
23
- }),
24
- payment_intent: pieces_framework_1.Property.ShortText({
25
- displayName: 'Payment Intent ID',
26
- description: 'Only trigger for disputes related to this Payment Intent ID (e.g., `pi_...`).',
27
- required: false,
28
- }),
29
- },
30
- sampleData: {
31
- id: 'du_1MtJUT2eZvKYlo2CNaw2HvEv',
32
- object: 'dispute',
33
- amount: 1000,
34
- balance_transactions: [],
35
- charge: 'ch_1AZtxr2eZvKYlo2CJDX8whov',
36
- created: 1680651737,
37
- currency: 'usd',
38
- evidence_details: {
39
- due_by: 1682294399,
40
- has_evidence: false,
41
- past_due: false,
42
- submission_count: 0,
43
- },
44
- is_charge_refundable: true,
45
- livemode: false,
46
- metadata: {},
47
- payment_intent: 'pi_1AZtxr2eZvKYlo2CJDX8whov',
48
- reason: 'general',
49
- status: 'needs_response',
50
- },
51
- type: pieces_framework_1.TriggerStrategy.WEBHOOK,
52
- onEnable(context) {
53
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
54
- const webhook = yield common_1.stripeCommon.subscribeWebhook('charge.dispute.created', context.webhookUrl, context.auth.secret_text);
55
- yield context.store.put('_new_dispute_trigger', {
56
- webhookId: webhook.id,
57
- });
58
- });
59
- },
60
- onDisable(context) {
61
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
62
- const webhookInfo = yield context.store.get('_new_dispute_trigger');
63
- if (webhookInfo !== null && webhookInfo !== undefined) {
64
- yield common_1.stripeCommon.unsubscribeWebhook(webhookInfo.webhookId, context.auth.secret_text);
65
- }
66
- });
67
- },
68
- test(context) {
69
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
70
- const response = yield pieces_common_1.httpClient.sendRequest({
71
- method: pieces_common_1.HttpMethod.GET,
72
- url: 'https://api.stripe.com/v1/issuing/disputes',
73
- headers: {
74
- Authorization: 'Bearer ' + context.auth.secret_text,
75
- 'Content-Type': 'application/x-www-form-urlencoded',
76
- },
77
- queryParams: {
78
- status: 'submitted',
79
- limit: '5',
80
- },
81
- });
82
- if ((0, shared_1.isEmpty)(response.body) || (0, shared_1.isEmpty)(response.body.data))
83
- return [];
84
- return response.body.data;
85
- });
86
- },
87
- run(context) {
88
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
89
- const payloadBody = context.payload.body;
90
- const disputeObject = payloadBody.data.object;
91
- const { charge, payment_intent } = context.propsValue;
92
- if (charge && disputeObject['charge'] !== charge) {
93
- return [];
94
- }
95
- if (payment_intent && disputeObject['payment_intent'] !== payment_intent) {
96
- return [];
97
- }
98
- return [disputeObject];
99
- });
100
- },
101
- });
102
- //# 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,qEAIwC;AACxC,sCAAyC;AAEzC,6BAAmC;AACnC,+DAAqE;AACrE,iDAA+C;AAUlC,QAAA,gBAAgB,GAAG,IAAA,gCAAa,EAAC;IAC5C,IAAI,EAAE,cAAU;IAChB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,0CAA0C;IACvD,UAAU,EAAE;QACV,WAAW,EACT,iTAAiT;KACpT;IACD,KAAK,EAAE;QACL,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,WAAW;YACxB,WA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eNewInvoice: 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;;;;;;;;;;;;;;;;EAoH3B,CAAC"}