@bubblelab/bubble-core 0.1.50 → 0.1.52
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.
- package/dist/bubble-bundle.d.ts +126 -106
- package/dist/bubble-factory.d.ts.map +1 -1
- package/dist/bubble-factory.js +4 -0
- package/dist/bubble-factory.js.map +1 -1
- package/dist/bubbles/service-bubble/agi-inc.d.ts +132 -132
- package/dist/bubbles/service-bubble/ai-agent.d.ts +44 -44
- package/dist/bubbles/service-bubble/airtable.d.ts +278 -278
- package/dist/bubbles/service-bubble/apify/apify.d.ts +38 -38
- package/dist/bubbles/service-bubble/ashby/ashby.d.ts +154 -154
- package/dist/bubbles/service-bubble/browserbase/browserbase.d.ts +57 -57
- package/dist/bubbles/service-bubble/crustdata/crustdata.d.ts +94 -94
- package/dist/bubbles/service-bubble/eleven-labs.d.ts +48 -48
- package/dist/bubbles/service-bubble/firecrawl.d.ts +248 -248
- package/dist/bubbles/service-bubble/followupboss.d.ts +306 -306
- package/dist/bubbles/service-bubble/fullenrich/fullenrich.d.ts +64 -64
- package/dist/bubbles/service-bubble/fullenrich/fullenrich.d.ts.map +1 -1
- package/dist/bubbles/service-bubble/fullenrich/fullenrich.js +8 -4
- package/dist/bubbles/service-bubble/fullenrich/fullenrich.js.map +1 -1
- package/dist/bubbles/service-bubble/github.d.ts +180 -180
- package/dist/bubbles/service-bubble/gmail.d.ts +372 -372
- package/dist/bubbles/service-bubble/google-calendar.d.ts +56 -56
- package/dist/bubbles/service-bubble/google-drive.d.ts +128 -128
- package/dist/bubbles/service-bubble/google-sheets/google-sheets.d.ts +54 -54
- package/dist/bubbles/service-bubble/hello-world.d.ts +6 -6
- package/dist/bubbles/service-bubble/http.d.ts +12 -12
- package/dist/bubbles/service-bubble/insforge-db.d.ts +16 -16
- package/dist/bubbles/service-bubble/jira/jira.d.ts +67 -67
- package/dist/bubbles/service-bubble/notion/notion.d.ts +829 -829
- package/dist/bubbles/service-bubble/postgresql.d.ts +16 -16
- package/dist/bubbles/service-bubble/resend.d.ts +24 -24
- package/dist/bubbles/service-bubble/slack/slack.d.ts +360 -360
- package/dist/bubbles/service-bubble/storage.d.ts +40 -40
- package/dist/bubbles/service-bubble/stripe/index.d.ts +4 -0
- package/dist/bubbles/service-bubble/stripe/index.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/stripe/index.js +4 -0
- package/dist/bubbles/service-bubble/stripe/index.js.map +1 -0
- package/dist/bubbles/service-bubble/stripe/stripe.d.ts +1347 -0
- package/dist/bubbles/service-bubble/stripe/stripe.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/stripe/stripe.js +669 -0
- package/dist/bubbles/service-bubble/stripe/stripe.js.map +1 -0
- package/dist/bubbles/service-bubble/stripe/stripe.schema.d.ts +1496 -0
- package/dist/bubbles/service-bubble/stripe/stripe.schema.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/stripe/stripe.schema.js +671 -0
- package/dist/bubbles/service-bubble/stripe/stripe.schema.js.map +1 -0
- package/dist/bubbles/service-bubble/stripe/stripe.utils.d.ts +40 -0
- package/dist/bubbles/service-bubble/stripe/stripe.utils.d.ts.map +1 -0
- package/dist/bubbles/service-bubble/stripe/stripe.utils.js +111 -0
- package/dist/bubbles/service-bubble/stripe/stripe.utils.js.map +1 -0
- package/dist/bubbles/service-bubble/telegram.d.ts +254 -254
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.d.ts +40 -40
- package/dist/bubbles/tool-bubble/amazon-shopping-tool/amazon-shopping-tool.schema.d.ts +6 -6
- package/dist/bubbles/tool-bubble/bubbleflow-validation-tool.d.ts +16 -16
- package/dist/bubbles/tool-bubble/chart-js-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/code-edit-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/company-enrichment-tool.d.ts +22 -22
- package/dist/bubbles/tool-bubble/get-bubble-details-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/get-trigger-detail-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/google-maps-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/instagram-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/linkedin-connection-tool/linkedin-connection-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/linkedin-tool.d.ts +324 -324
- package/dist/bubbles/tool-bubble/list-bubbles-tool.d.ts +12 -12
- package/dist/bubbles/tool-bubble/people-search-tool.d.ts +14 -14
- package/dist/bubbles/tool-bubble/reddit-scrape-tool.d.ts +12 -12
- package/dist/bubbles/tool-bubble/research-agent-tool.d.ts +4 -4
- package/dist/bubbles/tool-bubble/sql-query-tool.d.ts +8 -8
- package/dist/bubbles/tool-bubble/tiktok-tool.d.ts +60 -60
- package/dist/bubbles/tool-bubble/tool-template.d.ts +8 -8
- package/dist/bubbles/tool-bubble/twitter-tool.d.ts +150 -150
- package/dist/bubbles/tool-bubble/web-crawl-tool.d.ts +16 -16
- package/dist/bubbles/tool-bubble/web-extract-tool.d.ts +12 -12
- package/dist/bubbles/tool-bubble/web-scrape-tool.d.ts +12 -12
- package/dist/bubbles/tool-bubble/web-search-tool.d.ts +14 -14
- package/dist/bubbles/tool-bubble/youtube-tool.d.ts +28 -28
- package/dist/bubbles/workflow-bubble/database-analyzer.workflow.d.ts +4 -4
- package/dist/bubbles/workflow-bubble/generate-document.workflow.d.ts +28 -28
- package/dist/bubbles/workflow-bubble/parse-document.workflow.d.ts +8 -8
- package/dist/bubbles/workflow-bubble/pdf-form-operations.workflow.d.ts +88 -88
- package/dist/bubbles/workflow-bubble/pdf-ocr.workflow.d.ts +16 -16
- package/dist/bubbles/workflow-bubble/slack-data-assistant.workflow.d.ts +4 -4
- package/dist/bubbles/workflow-bubble/slack-formatter-agent.d.ts +8 -8
- package/dist/bubbles/workflow-bubble/slack-notifier.workflow.d.ts +4 -4
- package/dist/bubbles.json +2056 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/types/base-bubble-class.d.ts.map +1 -1
- package/dist/types/base-bubble-class.js +12 -0
- package/dist/types/base-bubble-class.js.map +1 -1
- package/dist/utils/schema-comparison.d.ts +10 -0
- package/dist/utils/schema-comparison.d.ts.map +1 -1
- package/dist/utils/schema-comparison.js +215 -0
- package/dist/utils/schema-comparison.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripe.schema.d.ts","sourceRoot":"","sources":["../../../../src/bubbles/service-bubble/stripe/stripe.schema.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,671 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CredentialType } from '@bubblelab/shared-schemas';
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// DATA SCHEMAS - Stripe API Response Objects
|
|
5
|
+
// ============================================================================
|
|
6
|
+
export const StripeCustomerSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
id: z.string().describe('Unique Stripe customer identifier (cus_xxx)'),
|
|
9
|
+
name: z.string().nullable().optional().describe('Customer name'),
|
|
10
|
+
email: z.string().nullable().optional().describe('Customer email address'),
|
|
11
|
+
created: z.number().describe('Unix timestamp of creation'),
|
|
12
|
+
metadata: z
|
|
13
|
+
.record(z.string())
|
|
14
|
+
.optional()
|
|
15
|
+
.describe('Arbitrary metadata attached to the customer'),
|
|
16
|
+
})
|
|
17
|
+
.describe('Stripe customer object');
|
|
18
|
+
export const StripeProductSchema = z
|
|
19
|
+
.object({
|
|
20
|
+
id: z.string().describe('Unique Stripe product identifier (prod_xxx)'),
|
|
21
|
+
name: z.string().describe('Product name'),
|
|
22
|
+
description: z
|
|
23
|
+
.string()
|
|
24
|
+
.nullable()
|
|
25
|
+
.optional()
|
|
26
|
+
.describe('Product description'),
|
|
27
|
+
active: z.boolean().describe('Whether the product is currently available'),
|
|
28
|
+
created: z.number().describe('Unix timestamp of creation'),
|
|
29
|
+
metadata: z
|
|
30
|
+
.record(z.string())
|
|
31
|
+
.optional()
|
|
32
|
+
.describe('Arbitrary metadata attached to the product'),
|
|
33
|
+
})
|
|
34
|
+
.describe('Stripe product object');
|
|
35
|
+
export const StripePriceSchema = z
|
|
36
|
+
.object({
|
|
37
|
+
id: z.string().describe('Unique Stripe price identifier (price_xxx)'),
|
|
38
|
+
product: z.string().describe('ID of the product this price is for'),
|
|
39
|
+
unit_amount: z
|
|
40
|
+
.number()
|
|
41
|
+
.nullable()
|
|
42
|
+
.describe('Price in the smallest currency unit (e.g., cents)'),
|
|
43
|
+
currency: z.string().describe('Three-letter ISO currency code'),
|
|
44
|
+
type: z
|
|
45
|
+
.enum(['one_time', 'recurring'])
|
|
46
|
+
.describe('Type of pricing (one-time or recurring)'),
|
|
47
|
+
active: z.boolean().describe('Whether the price is currently active'),
|
|
48
|
+
created: z.number().describe('Unix timestamp of creation'),
|
|
49
|
+
metadata: z
|
|
50
|
+
.record(z.string())
|
|
51
|
+
.optional()
|
|
52
|
+
.describe('Arbitrary metadata attached to the price'),
|
|
53
|
+
})
|
|
54
|
+
.describe('Stripe price object');
|
|
55
|
+
export const StripePaymentLinkSchema = z
|
|
56
|
+
.object({
|
|
57
|
+
id: z
|
|
58
|
+
.string()
|
|
59
|
+
.describe('Unique Stripe payment link identifier (plink_xxx)'),
|
|
60
|
+
url: z.string().describe('The public URL of the payment link'),
|
|
61
|
+
active: z.boolean().describe('Whether the payment link is active'),
|
|
62
|
+
created: z.number().optional().describe('Unix timestamp of creation'),
|
|
63
|
+
metadata: z
|
|
64
|
+
.record(z.string())
|
|
65
|
+
.optional()
|
|
66
|
+
.describe('Arbitrary metadata attached to the payment link'),
|
|
67
|
+
})
|
|
68
|
+
.describe('Stripe payment link object');
|
|
69
|
+
export const StripeInvoiceSchema = z
|
|
70
|
+
.object({
|
|
71
|
+
id: z.string().describe('Unique Stripe invoice identifier (in_xxx)'),
|
|
72
|
+
customer: z.string().nullable().describe('ID of the customer'),
|
|
73
|
+
status: z
|
|
74
|
+
.enum(['draft', 'open', 'paid', 'uncollectible', 'void'])
|
|
75
|
+
.nullable()
|
|
76
|
+
.describe('Invoice status'),
|
|
77
|
+
total: z.number().describe('Total amount in smallest currency unit'),
|
|
78
|
+
currency: z.string().describe('Three-letter ISO currency code'),
|
|
79
|
+
created: z.number().optional().describe('Unix timestamp of creation'),
|
|
80
|
+
hosted_invoice_url: z
|
|
81
|
+
.string()
|
|
82
|
+
.nullable()
|
|
83
|
+
.optional()
|
|
84
|
+
.describe('URL for the hosted invoice page'),
|
|
85
|
+
invoice_pdf: z
|
|
86
|
+
.string()
|
|
87
|
+
.nullable()
|
|
88
|
+
.optional()
|
|
89
|
+
.describe('URL for the invoice PDF (only available after finalization)'),
|
|
90
|
+
metadata: z
|
|
91
|
+
.record(z.string())
|
|
92
|
+
.optional()
|
|
93
|
+
.describe('Arbitrary metadata attached to the invoice'),
|
|
94
|
+
})
|
|
95
|
+
.describe('Stripe invoice object');
|
|
96
|
+
export const StripeBalanceSchema = z
|
|
97
|
+
.object({
|
|
98
|
+
available: z
|
|
99
|
+
.array(z.object({
|
|
100
|
+
amount: z.number().describe('Amount available'),
|
|
101
|
+
currency: z.string().describe('Currency code'),
|
|
102
|
+
}))
|
|
103
|
+
.describe('Funds available for payout'),
|
|
104
|
+
pending: z
|
|
105
|
+
.array(z.object({
|
|
106
|
+
amount: z.number().describe('Amount pending'),
|
|
107
|
+
currency: z.string().describe('Currency code'),
|
|
108
|
+
}))
|
|
109
|
+
.describe('Funds not yet available'),
|
|
110
|
+
})
|
|
111
|
+
.describe('Stripe account balance');
|
|
112
|
+
export const StripePaymentIntentSchema = z
|
|
113
|
+
.object({
|
|
114
|
+
id: z.string().describe('Unique payment intent identifier (pi_xxx)'),
|
|
115
|
+
amount: z.number().describe('Amount in smallest currency unit'),
|
|
116
|
+
currency: z.string().describe('Three-letter ISO currency code'),
|
|
117
|
+
status: z
|
|
118
|
+
.enum([
|
|
119
|
+
'requires_payment_method',
|
|
120
|
+
'requires_confirmation',
|
|
121
|
+
'requires_action',
|
|
122
|
+
'processing',
|
|
123
|
+
'requires_capture',
|
|
124
|
+
'canceled',
|
|
125
|
+
'succeeded',
|
|
126
|
+
])
|
|
127
|
+
.describe('Payment intent status'),
|
|
128
|
+
customer: z
|
|
129
|
+
.string()
|
|
130
|
+
.nullable()
|
|
131
|
+
.optional()
|
|
132
|
+
.describe('Customer ID if attached'),
|
|
133
|
+
created: z.number().describe('Unix timestamp of creation'),
|
|
134
|
+
metadata: z
|
|
135
|
+
.record(z.string())
|
|
136
|
+
.optional()
|
|
137
|
+
.describe('Arbitrary metadata attached to the payment intent'),
|
|
138
|
+
})
|
|
139
|
+
.describe('Stripe payment intent object');
|
|
140
|
+
export const StripeSubscriptionSchema = z
|
|
141
|
+
.object({
|
|
142
|
+
id: z.string().describe('Unique subscription identifier (sub_xxx)'),
|
|
143
|
+
customer: z.string().describe('Customer ID'),
|
|
144
|
+
status: z
|
|
145
|
+
.enum([
|
|
146
|
+
'incomplete',
|
|
147
|
+
'incomplete_expired',
|
|
148
|
+
'trialing',
|
|
149
|
+
'active',
|
|
150
|
+
'past_due',
|
|
151
|
+
'canceled',
|
|
152
|
+
'unpaid',
|
|
153
|
+
'paused',
|
|
154
|
+
])
|
|
155
|
+
.describe('Subscription status'),
|
|
156
|
+
current_period_start: z
|
|
157
|
+
.number()
|
|
158
|
+
.optional()
|
|
159
|
+
.describe('Start of current billing period (may be absent for incomplete subscriptions)'),
|
|
160
|
+
current_period_end: z
|
|
161
|
+
.number()
|
|
162
|
+
.optional()
|
|
163
|
+
.describe('End of current billing period (may be absent for incomplete subscriptions)'),
|
|
164
|
+
cancel_at_period_end: z
|
|
165
|
+
.boolean()
|
|
166
|
+
.describe('Whether subscription cancels at period end'),
|
|
167
|
+
created: z.number().describe('Unix timestamp of creation'),
|
|
168
|
+
metadata: z
|
|
169
|
+
.record(z.string())
|
|
170
|
+
.optional()
|
|
171
|
+
.describe('Arbitrary metadata attached to the subscription'),
|
|
172
|
+
})
|
|
173
|
+
.describe('Stripe subscription object');
|
|
174
|
+
// ============================================================================
|
|
175
|
+
// CREDENTIALS FIELD - Required for all operations
|
|
176
|
+
// ============================================================================
|
|
177
|
+
const credentialsField = z
|
|
178
|
+
.record(z.nativeEnum(CredentialType), z.string())
|
|
179
|
+
.optional()
|
|
180
|
+
.describe('Object mapping credential types to values (injected at runtime)');
|
|
181
|
+
// ============================================================================
|
|
182
|
+
// PARAMETERS SCHEMA - All Stripe Operations
|
|
183
|
+
// ============================================================================
|
|
184
|
+
export const StripeParamsSchema = z.discriminatedUnion('operation', [
|
|
185
|
+
// Create Customer
|
|
186
|
+
z.object({
|
|
187
|
+
operation: z
|
|
188
|
+
.literal('create_customer')
|
|
189
|
+
.describe('Create a new customer in Stripe'),
|
|
190
|
+
name: z
|
|
191
|
+
.string()
|
|
192
|
+
.min(1, 'Customer name is required')
|
|
193
|
+
.describe('Customer name'),
|
|
194
|
+
email: z
|
|
195
|
+
.string()
|
|
196
|
+
.email('Invalid email format')
|
|
197
|
+
.optional()
|
|
198
|
+
.describe('Customer email address'),
|
|
199
|
+
metadata: z
|
|
200
|
+
.record(z.string())
|
|
201
|
+
.optional()
|
|
202
|
+
.describe('Arbitrary metadata to attach to the customer'),
|
|
203
|
+
credentials: credentialsField,
|
|
204
|
+
}),
|
|
205
|
+
// List Customers
|
|
206
|
+
z.object({
|
|
207
|
+
operation: z
|
|
208
|
+
.literal('list_customers')
|
|
209
|
+
.describe('List customers from Stripe'),
|
|
210
|
+
limit: z
|
|
211
|
+
.number()
|
|
212
|
+
.int()
|
|
213
|
+
.min(1)
|
|
214
|
+
.max(100)
|
|
215
|
+
.optional()
|
|
216
|
+
.default(10)
|
|
217
|
+
.describe('Maximum number of customers to return (1-100)'),
|
|
218
|
+
email: z
|
|
219
|
+
.string()
|
|
220
|
+
.optional()
|
|
221
|
+
.describe('Filter customers by email address (case-sensitive)'),
|
|
222
|
+
credentials: credentialsField,
|
|
223
|
+
}),
|
|
224
|
+
// Create Product
|
|
225
|
+
z.object({
|
|
226
|
+
operation: z
|
|
227
|
+
.literal('create_product')
|
|
228
|
+
.describe('Create a new product in Stripe'),
|
|
229
|
+
name: z
|
|
230
|
+
.string()
|
|
231
|
+
.min(1, 'Product name is required')
|
|
232
|
+
.describe('Product name'),
|
|
233
|
+
description: z.string().optional().describe('Product description'),
|
|
234
|
+
metadata: z
|
|
235
|
+
.record(z.string())
|
|
236
|
+
.optional()
|
|
237
|
+
.describe('Arbitrary metadata to attach to the product'),
|
|
238
|
+
credentials: credentialsField,
|
|
239
|
+
}),
|
|
240
|
+
// List Products
|
|
241
|
+
z.object({
|
|
242
|
+
operation: z.literal('list_products').describe('List products from Stripe'),
|
|
243
|
+
limit: z
|
|
244
|
+
.number()
|
|
245
|
+
.int()
|
|
246
|
+
.min(1)
|
|
247
|
+
.max(100)
|
|
248
|
+
.optional()
|
|
249
|
+
.default(10)
|
|
250
|
+
.describe('Maximum number of products to return (1-100)'),
|
|
251
|
+
active: z.boolean().optional().describe('Filter by active status'),
|
|
252
|
+
credentials: credentialsField,
|
|
253
|
+
}),
|
|
254
|
+
// Create Price
|
|
255
|
+
z.object({
|
|
256
|
+
operation: z
|
|
257
|
+
.literal('create_price')
|
|
258
|
+
.describe('Create a new price for a product'),
|
|
259
|
+
product: z
|
|
260
|
+
.string()
|
|
261
|
+
.min(1, 'Product ID is required')
|
|
262
|
+
.describe('ID of the product this price is for'),
|
|
263
|
+
unit_amount: z
|
|
264
|
+
.number()
|
|
265
|
+
.int()
|
|
266
|
+
.min(0)
|
|
267
|
+
.describe('Price in smallest currency unit (e.g., cents for USD)'),
|
|
268
|
+
currency: z
|
|
269
|
+
.string()
|
|
270
|
+
.length(3, 'Currency must be 3-letter ISO code')
|
|
271
|
+
.default('usd')
|
|
272
|
+
.describe('Three-letter ISO currency code (e.g., "usd")'),
|
|
273
|
+
recurring: z
|
|
274
|
+
.object({
|
|
275
|
+
interval: z
|
|
276
|
+
.enum(['day', 'week', 'month', 'year'])
|
|
277
|
+
.describe('Billing interval'),
|
|
278
|
+
interval_count: z
|
|
279
|
+
.number()
|
|
280
|
+
.int()
|
|
281
|
+
.min(1)
|
|
282
|
+
.optional()
|
|
283
|
+
.default(1)
|
|
284
|
+
.describe('Number of intervals between billings'),
|
|
285
|
+
})
|
|
286
|
+
.optional()
|
|
287
|
+
.describe('Recurring pricing details (omit for one-time prices)'),
|
|
288
|
+
metadata: z
|
|
289
|
+
.record(z.string())
|
|
290
|
+
.optional()
|
|
291
|
+
.describe('Arbitrary metadata to attach to the price'),
|
|
292
|
+
credentials: credentialsField,
|
|
293
|
+
}),
|
|
294
|
+
// List Prices
|
|
295
|
+
z.object({
|
|
296
|
+
operation: z.literal('list_prices').describe('List prices from Stripe'),
|
|
297
|
+
limit: z
|
|
298
|
+
.number()
|
|
299
|
+
.int()
|
|
300
|
+
.min(1)
|
|
301
|
+
.max(100)
|
|
302
|
+
.optional()
|
|
303
|
+
.default(10)
|
|
304
|
+
.describe('Maximum number of prices to return (1-100)'),
|
|
305
|
+
product: z.string().optional().describe('Filter by product ID'),
|
|
306
|
+
active: z.boolean().optional().describe('Filter by active status'),
|
|
307
|
+
credentials: credentialsField,
|
|
308
|
+
}),
|
|
309
|
+
// Create Payment Link
|
|
310
|
+
z.object({
|
|
311
|
+
operation: z
|
|
312
|
+
.literal('create_payment_link')
|
|
313
|
+
.describe('Create a payment link for a price'),
|
|
314
|
+
price: z
|
|
315
|
+
.string()
|
|
316
|
+
.min(1, 'Price ID is required')
|
|
317
|
+
.describe('ID of the price to create payment link for'),
|
|
318
|
+
quantity: z
|
|
319
|
+
.number()
|
|
320
|
+
.int()
|
|
321
|
+
.min(1)
|
|
322
|
+
.default(1)
|
|
323
|
+
.describe('Quantity of items in the payment link'),
|
|
324
|
+
redirect_url: z
|
|
325
|
+
.string()
|
|
326
|
+
.url('Invalid URL format')
|
|
327
|
+
.optional()
|
|
328
|
+
.describe('URL to redirect after successful payment'),
|
|
329
|
+
metadata: z
|
|
330
|
+
.record(z.string())
|
|
331
|
+
.optional()
|
|
332
|
+
.describe('Arbitrary metadata to attach to the payment link'),
|
|
333
|
+
credentials: credentialsField,
|
|
334
|
+
}),
|
|
335
|
+
// Create Invoice
|
|
336
|
+
z.object({
|
|
337
|
+
operation: z
|
|
338
|
+
.literal('create_invoice')
|
|
339
|
+
.describe('Create a new invoice for a customer'),
|
|
340
|
+
customer: z
|
|
341
|
+
.string()
|
|
342
|
+
.min(1, 'Customer ID is required')
|
|
343
|
+
.describe('ID of the customer to invoice'),
|
|
344
|
+
auto_advance: z
|
|
345
|
+
.boolean()
|
|
346
|
+
.optional()
|
|
347
|
+
.default(true)
|
|
348
|
+
.describe('Whether to auto-finalize the invoice'),
|
|
349
|
+
collection_method: z
|
|
350
|
+
.enum(['charge_automatically', 'send_invoice'])
|
|
351
|
+
.optional()
|
|
352
|
+
.default('charge_automatically')
|
|
353
|
+
.describe('How to collect payment'),
|
|
354
|
+
days_until_due: z
|
|
355
|
+
.number()
|
|
356
|
+
.int()
|
|
357
|
+
.min(1)
|
|
358
|
+
.optional()
|
|
359
|
+
.describe('Days until invoice is due (for send_invoice collection)'),
|
|
360
|
+
metadata: z
|
|
361
|
+
.record(z.string())
|
|
362
|
+
.optional()
|
|
363
|
+
.describe('Arbitrary metadata to attach to the invoice'),
|
|
364
|
+
credentials: credentialsField,
|
|
365
|
+
}),
|
|
366
|
+
// List Invoices
|
|
367
|
+
z.object({
|
|
368
|
+
operation: z.literal('list_invoices').describe('List invoices from Stripe'),
|
|
369
|
+
limit: z
|
|
370
|
+
.number()
|
|
371
|
+
.int()
|
|
372
|
+
.min(1)
|
|
373
|
+
.max(100)
|
|
374
|
+
.optional()
|
|
375
|
+
.default(10)
|
|
376
|
+
.describe('Maximum number of invoices to return (1-100)'),
|
|
377
|
+
customer: z.string().optional().describe('Filter by customer ID'),
|
|
378
|
+
status: z
|
|
379
|
+
.enum(['draft', 'open', 'paid', 'uncollectible', 'void'])
|
|
380
|
+
.optional()
|
|
381
|
+
.describe('Filter by invoice status'),
|
|
382
|
+
credentials: credentialsField,
|
|
383
|
+
}),
|
|
384
|
+
// Retrieve Invoice
|
|
385
|
+
z.object({
|
|
386
|
+
operation: z
|
|
387
|
+
.literal('retrieve_invoice')
|
|
388
|
+
.describe('Retrieve a specific invoice by ID'),
|
|
389
|
+
invoice_id: z
|
|
390
|
+
.string()
|
|
391
|
+
.min(1, 'Invoice ID is required')
|
|
392
|
+
.describe('ID of the invoice to retrieve'),
|
|
393
|
+
credentials: credentialsField,
|
|
394
|
+
}),
|
|
395
|
+
// Finalize Invoice
|
|
396
|
+
z.object({
|
|
397
|
+
operation: z
|
|
398
|
+
.literal('finalize_invoice')
|
|
399
|
+
.describe('Finalize a draft invoice to make it ready for payment'),
|
|
400
|
+
invoice_id: z
|
|
401
|
+
.string()
|
|
402
|
+
.min(1, 'Invoice ID is required')
|
|
403
|
+
.describe('ID of the draft invoice to finalize'),
|
|
404
|
+
auto_advance: z
|
|
405
|
+
.boolean()
|
|
406
|
+
.optional()
|
|
407
|
+
.describe('Whether to automatically advance the invoice after finalizing'),
|
|
408
|
+
credentials: credentialsField,
|
|
409
|
+
}),
|
|
410
|
+
// Get Balance
|
|
411
|
+
z.object({
|
|
412
|
+
operation: z
|
|
413
|
+
.literal('get_balance')
|
|
414
|
+
.describe('Retrieve the current account balance'),
|
|
415
|
+
credentials: credentialsField,
|
|
416
|
+
}),
|
|
417
|
+
// List Payment Intents
|
|
418
|
+
z.object({
|
|
419
|
+
operation: z
|
|
420
|
+
.literal('list_payment_intents')
|
|
421
|
+
.describe('List payment intents from Stripe'),
|
|
422
|
+
limit: z
|
|
423
|
+
.number()
|
|
424
|
+
.int()
|
|
425
|
+
.min(1)
|
|
426
|
+
.max(100)
|
|
427
|
+
.optional()
|
|
428
|
+
.default(10)
|
|
429
|
+
.describe('Maximum number of payment intents to return (1-100)'),
|
|
430
|
+
customer: z.string().optional().describe('Filter by customer ID'),
|
|
431
|
+
credentials: credentialsField,
|
|
432
|
+
}),
|
|
433
|
+
// List Subscriptions
|
|
434
|
+
z.object({
|
|
435
|
+
operation: z
|
|
436
|
+
.literal('list_subscriptions')
|
|
437
|
+
.describe('List subscriptions from Stripe'),
|
|
438
|
+
limit: z
|
|
439
|
+
.number()
|
|
440
|
+
.int()
|
|
441
|
+
.min(1)
|
|
442
|
+
.max(100)
|
|
443
|
+
.optional()
|
|
444
|
+
.default(10)
|
|
445
|
+
.describe('Maximum number of subscriptions to return (1-100)'),
|
|
446
|
+
customer: z.string().optional().describe('Filter by customer ID'),
|
|
447
|
+
status: z
|
|
448
|
+
.enum([
|
|
449
|
+
'incomplete',
|
|
450
|
+
'incomplete_expired',
|
|
451
|
+
'trialing',
|
|
452
|
+
'active',
|
|
453
|
+
'past_due',
|
|
454
|
+
'canceled',
|
|
455
|
+
'unpaid',
|
|
456
|
+
'paused',
|
|
457
|
+
'all',
|
|
458
|
+
])
|
|
459
|
+
.optional()
|
|
460
|
+
.describe('Filter by subscription status'),
|
|
461
|
+
credentials: credentialsField,
|
|
462
|
+
}),
|
|
463
|
+
// Cancel Subscription
|
|
464
|
+
z.object({
|
|
465
|
+
operation: z
|
|
466
|
+
.literal('cancel_subscription')
|
|
467
|
+
.describe('Cancel a subscription'),
|
|
468
|
+
subscription_id: z
|
|
469
|
+
.string()
|
|
470
|
+
.min(1, 'Subscription ID is required')
|
|
471
|
+
.describe('ID of the subscription to cancel'),
|
|
472
|
+
cancel_at_period_end: z
|
|
473
|
+
.boolean()
|
|
474
|
+
.optional()
|
|
475
|
+
.default(false)
|
|
476
|
+
.describe('Whether to cancel at the end of the current period'),
|
|
477
|
+
credentials: credentialsField,
|
|
478
|
+
}),
|
|
479
|
+
// List Payment Links
|
|
480
|
+
z.object({
|
|
481
|
+
operation: z
|
|
482
|
+
.literal('list_payment_links')
|
|
483
|
+
.describe('List payment links from Stripe'),
|
|
484
|
+
limit: z
|
|
485
|
+
.number()
|
|
486
|
+
.int()
|
|
487
|
+
.min(1)
|
|
488
|
+
.max(100)
|
|
489
|
+
.optional()
|
|
490
|
+
.default(10)
|
|
491
|
+
.describe('Maximum number of payment links to return (1-100)'),
|
|
492
|
+
active: z.boolean().optional().describe('Filter by active status'),
|
|
493
|
+
credentials: credentialsField,
|
|
494
|
+
}),
|
|
495
|
+
// Create Subscription
|
|
496
|
+
z.object({
|
|
497
|
+
operation: z
|
|
498
|
+
.literal('create_subscription')
|
|
499
|
+
.describe('Create a new subscription for a customer'),
|
|
500
|
+
customer: z
|
|
501
|
+
.string()
|
|
502
|
+
.min(1, 'Customer ID is required')
|
|
503
|
+
.describe('ID of the customer to subscribe'),
|
|
504
|
+
price: z
|
|
505
|
+
.string()
|
|
506
|
+
.min(1, 'Price ID is required')
|
|
507
|
+
.describe('ID of the recurring price to subscribe to'),
|
|
508
|
+
trial_period_days: z
|
|
509
|
+
.number()
|
|
510
|
+
.int()
|
|
511
|
+
.min(1)
|
|
512
|
+
.optional()
|
|
513
|
+
.describe('Number of trial period days before billing starts'),
|
|
514
|
+
payment_behavior: z
|
|
515
|
+
.enum(['default_incomplete', 'error_if_incomplete', 'allow_incomplete'])
|
|
516
|
+
.optional()
|
|
517
|
+
.default('default_incomplete')
|
|
518
|
+
.describe('How to handle payment failures. Use default_incomplete to create without payment method'),
|
|
519
|
+
metadata: z
|
|
520
|
+
.record(z.string())
|
|
521
|
+
.optional()
|
|
522
|
+
.describe('Arbitrary metadata to attach to the subscription'),
|
|
523
|
+
credentials: credentialsField,
|
|
524
|
+
}),
|
|
525
|
+
]);
|
|
526
|
+
// ============================================================================
|
|
527
|
+
// RESULT SCHEMA - All Stripe Operation Results
|
|
528
|
+
// ============================================================================
|
|
529
|
+
export const StripeResultSchema = z.discriminatedUnion('operation', [
|
|
530
|
+
// Create Customer Result
|
|
531
|
+
z.object({
|
|
532
|
+
operation: z.literal('create_customer'),
|
|
533
|
+
success: z.boolean().describe('Whether the operation succeeded'),
|
|
534
|
+
customer: StripeCustomerSchema.optional().describe('Created customer object'),
|
|
535
|
+
error: z.string().describe('Error message if operation failed'),
|
|
536
|
+
}),
|
|
537
|
+
// List Customers Result
|
|
538
|
+
z.object({
|
|
539
|
+
operation: z.literal('list_customers'),
|
|
540
|
+
success: z.boolean().describe('Whether the operation succeeded'),
|
|
541
|
+
customers: z
|
|
542
|
+
.array(StripeCustomerSchema)
|
|
543
|
+
.optional()
|
|
544
|
+
.describe('List of customer objects'),
|
|
545
|
+
error: z.string().describe('Error message if operation failed'),
|
|
546
|
+
}),
|
|
547
|
+
// Create Product Result
|
|
548
|
+
z.object({
|
|
549
|
+
operation: z.literal('create_product'),
|
|
550
|
+
success: z.boolean().describe('Whether the operation succeeded'),
|
|
551
|
+
product: StripeProductSchema.optional().describe('Created product object'),
|
|
552
|
+
error: z.string().describe('Error message if operation failed'),
|
|
553
|
+
}),
|
|
554
|
+
// List Products Result
|
|
555
|
+
z.object({
|
|
556
|
+
operation: z.literal('list_products'),
|
|
557
|
+
success: z.boolean().describe('Whether the operation succeeded'),
|
|
558
|
+
products: z
|
|
559
|
+
.array(StripeProductSchema)
|
|
560
|
+
.optional()
|
|
561
|
+
.describe('List of product objects'),
|
|
562
|
+
error: z.string().describe('Error message if operation failed'),
|
|
563
|
+
}),
|
|
564
|
+
// Create Price Result
|
|
565
|
+
z.object({
|
|
566
|
+
operation: z.literal('create_price'),
|
|
567
|
+
success: z.boolean().describe('Whether the operation succeeded'),
|
|
568
|
+
price: StripePriceSchema.optional().describe('Created price object'),
|
|
569
|
+
error: z.string().describe('Error message if operation failed'),
|
|
570
|
+
}),
|
|
571
|
+
// List Prices Result
|
|
572
|
+
z.object({
|
|
573
|
+
operation: z.literal('list_prices'),
|
|
574
|
+
success: z.boolean().describe('Whether the operation succeeded'),
|
|
575
|
+
prices: z
|
|
576
|
+
.array(StripePriceSchema)
|
|
577
|
+
.optional()
|
|
578
|
+
.describe('List of price objects'),
|
|
579
|
+
error: z.string().describe('Error message if operation failed'),
|
|
580
|
+
}),
|
|
581
|
+
// Create Payment Link Result
|
|
582
|
+
z.object({
|
|
583
|
+
operation: z.literal('create_payment_link'),
|
|
584
|
+
success: z.boolean().describe('Whether the operation succeeded'),
|
|
585
|
+
payment_link: StripePaymentLinkSchema.optional().describe('Created payment link object'),
|
|
586
|
+
error: z.string().describe('Error message if operation failed'),
|
|
587
|
+
}),
|
|
588
|
+
// Create Invoice Result
|
|
589
|
+
z.object({
|
|
590
|
+
operation: z.literal('create_invoice'),
|
|
591
|
+
success: z.boolean().describe('Whether the operation succeeded'),
|
|
592
|
+
invoice: StripeInvoiceSchema.optional().describe('Created invoice object'),
|
|
593
|
+
error: z.string().describe('Error message if operation failed'),
|
|
594
|
+
}),
|
|
595
|
+
// List Invoices Result
|
|
596
|
+
z.object({
|
|
597
|
+
operation: z.literal('list_invoices'),
|
|
598
|
+
success: z.boolean().describe('Whether the operation succeeded'),
|
|
599
|
+
invoices: z
|
|
600
|
+
.array(StripeInvoiceSchema)
|
|
601
|
+
.optional()
|
|
602
|
+
.describe('List of invoice objects'),
|
|
603
|
+
error: z.string().describe('Error message if operation failed'),
|
|
604
|
+
}),
|
|
605
|
+
// Retrieve Invoice Result
|
|
606
|
+
z.object({
|
|
607
|
+
operation: z.literal('retrieve_invoice'),
|
|
608
|
+
success: z.boolean().describe('Whether the operation succeeded'),
|
|
609
|
+
invoice: StripeInvoiceSchema.optional().describe('Retrieved invoice object'),
|
|
610
|
+
error: z.string().describe('Error message if operation failed'),
|
|
611
|
+
}),
|
|
612
|
+
// Finalize Invoice Result
|
|
613
|
+
z.object({
|
|
614
|
+
operation: z.literal('finalize_invoice'),
|
|
615
|
+
success: z.boolean().describe('Whether the operation succeeded'),
|
|
616
|
+
invoice: StripeInvoiceSchema.optional().describe('Finalized invoice object'),
|
|
617
|
+
error: z.string().describe('Error message if operation failed'),
|
|
618
|
+
}),
|
|
619
|
+
// Get Balance Result
|
|
620
|
+
z.object({
|
|
621
|
+
operation: z.literal('get_balance'),
|
|
622
|
+
success: z.boolean().describe('Whether the operation succeeded'),
|
|
623
|
+
balance: StripeBalanceSchema.optional().describe('Account balance'),
|
|
624
|
+
error: z.string().describe('Error message if operation failed'),
|
|
625
|
+
}),
|
|
626
|
+
// List Payment Intents Result
|
|
627
|
+
z.object({
|
|
628
|
+
operation: z.literal('list_payment_intents'),
|
|
629
|
+
success: z.boolean().describe('Whether the operation succeeded'),
|
|
630
|
+
payment_intents: z
|
|
631
|
+
.array(StripePaymentIntentSchema)
|
|
632
|
+
.optional()
|
|
633
|
+
.describe('List of payment intent objects'),
|
|
634
|
+
error: z.string().describe('Error message if operation failed'),
|
|
635
|
+
}),
|
|
636
|
+
// List Subscriptions Result
|
|
637
|
+
z.object({
|
|
638
|
+
operation: z.literal('list_subscriptions'),
|
|
639
|
+
success: z.boolean().describe('Whether the operation succeeded'),
|
|
640
|
+
subscriptions: z
|
|
641
|
+
.array(StripeSubscriptionSchema)
|
|
642
|
+
.optional()
|
|
643
|
+
.describe('List of subscription objects'),
|
|
644
|
+
error: z.string().describe('Error message if operation failed'),
|
|
645
|
+
}),
|
|
646
|
+
// Cancel Subscription Result
|
|
647
|
+
z.object({
|
|
648
|
+
operation: z.literal('cancel_subscription'),
|
|
649
|
+
success: z.boolean().describe('Whether the operation succeeded'),
|
|
650
|
+
subscription: StripeSubscriptionSchema.optional().describe('Canceled subscription object'),
|
|
651
|
+
error: z.string().describe('Error message if operation failed'),
|
|
652
|
+
}),
|
|
653
|
+
// List Payment Links Result
|
|
654
|
+
z.object({
|
|
655
|
+
operation: z.literal('list_payment_links'),
|
|
656
|
+
success: z.boolean().describe('Whether the operation succeeded'),
|
|
657
|
+
payment_links: z
|
|
658
|
+
.array(StripePaymentLinkSchema)
|
|
659
|
+
.optional()
|
|
660
|
+
.describe('List of payment link objects'),
|
|
661
|
+
error: z.string().describe('Error message if operation failed'),
|
|
662
|
+
}),
|
|
663
|
+
// Create Subscription Result
|
|
664
|
+
z.object({
|
|
665
|
+
operation: z.literal('create_subscription'),
|
|
666
|
+
success: z.boolean().describe('Whether the operation succeeded'),
|
|
667
|
+
subscription: StripeSubscriptionSchema.optional().describe('Created subscription object'),
|
|
668
|
+
error: z.string().describe('Error message if operation failed'),
|
|
669
|
+
}),
|
|
670
|
+
]);
|
|
671
|
+
//# sourceMappingURL=stripe.schema.js.map
|