@fantastic.dev/better-stripe 0.14.0 → 0.16.0

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 (138) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/MIGRATION.md +6 -0
  3. package/README.md +40 -1
  4. package/dist/client/billing/checkoutOptions.d.ts +27 -0
  5. package/dist/client/billing/checkoutOptions.d.ts.map +1 -0
  6. package/dist/client/billing/checkoutOptions.js +2 -0
  7. package/dist/client/billing/checkoutOptions.js.map +1 -0
  8. package/dist/client/billing/intents.d.ts +32 -0
  9. package/dist/client/billing/intents.d.ts.map +1 -0
  10. package/dist/client/billing/intents.js +71 -0
  11. package/dist/client/billing/intents.js.map +1 -0
  12. package/dist/client/connect/payoutSnapshot.d.ts +2 -0
  13. package/dist/client/connect/payoutSnapshot.d.ts.map +1 -1
  14. package/dist/client/connect/payoutSnapshot.js +2 -0
  15. package/dist/client/connect/payoutSnapshot.js.map +1 -1
  16. package/dist/client/core/fees.d.ts +2 -0
  17. package/dist/client/core/fees.d.ts.map +1 -1
  18. package/dist/client/core/fees.js +7 -0
  19. package/dist/client/core/fees.js.map +1 -1
  20. package/dist/client/index.d.ts +18 -26
  21. package/dist/client/index.d.ts.map +1 -1
  22. package/dist/client/index.js +18 -16
  23. package/dist/client/index.js.map +1 -1
  24. package/dist/client/readContracts.d.ts +50 -0
  25. package/dist/client/readContracts.d.ts.map +1 -0
  26. package/dist/client/readContracts.js +24 -0
  27. package/dist/client/readContracts.js.map +1 -0
  28. package/dist/client/types/documents.d.ts +2 -0
  29. package/dist/client/types/documents.d.ts.map +1 -1
  30. package/dist/client/webhooks/processors.js +2 -0
  31. package/dist/client/webhooks/processors.js.map +1 -1
  32. package/dist/component/_generated/component.d.ts +177 -0
  33. package/dist/component/_generated/component.d.ts.map +1 -1
  34. package/dist/component/connect/mutations.d.ts +2 -0
  35. package/dist/component/connect/mutations.d.ts.map +1 -1
  36. package/dist/component/connect/mutations.js +8 -8
  37. package/dist/component/connect/mutations.js.map +1 -1
  38. package/dist/component/connect/queries.d.ts +102 -2
  39. package/dist/component/connect/queries.d.ts.map +1 -1
  40. package/dist/component/connect/queries.js +88 -45
  41. package/dist/component/connect/queries.js.map +1 -1
  42. package/dist/component/connect/schema.d.ts +12 -2
  43. package/dist/component/connect/schema.d.ts.map +1 -1
  44. package/dist/component/connect/schema.js +10 -1
  45. package/dist/component/connect/schema.js.map +1 -1
  46. package/dist/component/connect/validators.d.ts +13 -2
  47. package/dist/component/connect/validators.d.ts.map +1 -1
  48. package/dist/component/connect/validators.js +4 -0
  49. package/dist/component/connect/validators.js.map +1 -1
  50. package/dist/component/earnings/legacyReads.d.ts +51 -0
  51. package/dist/component/earnings/legacyReads.d.ts.map +1 -0
  52. package/dist/component/earnings/legacyReads.js +43 -0
  53. package/dist/component/earnings/legacyReads.js.map +1 -0
  54. package/dist/component/earnings/mutations.d.ts +9 -0
  55. package/dist/component/earnings/mutations.d.ts.map +1 -0
  56. package/dist/component/earnings/mutations.js +23 -0
  57. package/dist/component/earnings/mutations.js.map +1 -0
  58. package/dist/component/earnings/reads.d.ts +14 -0
  59. package/dist/component/earnings/reads.d.ts.map +1 -0
  60. package/dist/component/earnings/reads.js +28 -0
  61. package/dist/component/earnings/reads.js.map +1 -0
  62. package/dist/component/earnings/schema.d.ts +20 -0
  63. package/dist/component/earnings/schema.d.ts.map +1 -0
  64. package/dist/component/earnings/schema.js +12 -0
  65. package/dist/component/earnings/schema.js.map +1 -0
  66. package/dist/component/earnings/triggers.d.ts +1290 -0
  67. package/dist/component/earnings/triggers.d.ts.map +1 -0
  68. package/dist/component/earnings/triggers.js +68 -0
  69. package/dist/component/earnings/triggers.js.map +1 -0
  70. package/dist/component/products/queries.d.ts +47 -0
  71. package/dist/component/products/queries.d.ts.map +1 -1
  72. package/dist/component/products/queries.js +59 -0
  73. package/dist/component/products/queries.js.map +1 -1
  74. package/dist/component/schema.d.ts +31 -2
  75. package/dist/component/schema.js +2 -0
  76. package/dist/component/schema.js.map +1 -1
  77. package/dist/react/components/EarningsSummary.d.ts +3 -1
  78. package/dist/react/components/EarningsSummary.d.ts.map +1 -1
  79. package/dist/react/components/EarningsSummary.js +3 -3
  80. package/dist/react/components/EarningsSummary.js.map +1 -1
  81. package/dist/react/hooks/useConfirmPayment.d.ts +1 -1
  82. package/dist/react/hooks/useConfirmPayment.d.ts.map +1 -1
  83. package/dist/react/hooks/useConfirmPayment.js +13 -2
  84. package/dist/react/hooks/useConfirmPayment.js.map +1 -1
  85. package/dist/react/hooks/useCurrencyEarnings.d.ts +31 -0
  86. package/dist/react/hooks/useCurrencyEarnings.d.ts.map +1 -0
  87. package/dist/react/hooks/useCurrencyEarnings.js +30 -0
  88. package/dist/react/hooks/useCurrencyEarnings.js.map +1 -0
  89. package/dist/react/index.d.ts +5 -0
  90. package/dist/react/index.d.ts.map +1 -1
  91. package/dist/react/index.js +4 -0
  92. package/dist/react/index.js.map +1 -1
  93. package/dist/react/workflows/SaveCard.d.ts +27 -0
  94. package/dist/react/workflows/SaveCard.d.ts.map +1 -0
  95. package/dist/react/workflows/SaveCard.js +56 -0
  96. package/dist/react/workflows/SaveCard.js.map +1 -0
  97. package/docs/react-workflows.md +47 -0
  98. package/docs/read-contracts.md +136 -0
  99. package/package.json +3 -2
  100. package/src/client/billing/checkoutOptions.ts +27 -0
  101. package/src/client/billing/intents.test.ts +216 -0
  102. package/src/client/billing/intents.ts +120 -0
  103. package/src/client/billing/intentsTransport.test.ts +94 -0
  104. package/src/client/connect/payoutSnapshot.test.ts +27 -0
  105. package/src/client/connect/payoutSnapshot.ts +4 -0
  106. package/src/client/core/fees.ts +8 -0
  107. package/src/client/index.ts +40 -43
  108. package/src/client/readContracts.ts +90 -0
  109. package/src/client/readPagination.test.ts +62 -0
  110. package/src/client/types/documents.ts +2 -0
  111. package/src/client/webhooks/payout-canceled.integration.test.ts +25 -0
  112. package/src/client/webhooks/processors.ts +2 -0
  113. package/src/component/_generated/api.ts +8 -0
  114. package/src/component/_generated/component.ts +201 -0
  115. package/src/component/connect/mutations.ts +8 -8
  116. package/src/component/connect/queries.ts +110 -48
  117. package/src/component/connect/schema.ts +10 -1
  118. package/src/component/connect/validators.ts +4 -0
  119. package/src/component/currency-migration.test.ts +119 -0
  120. package/src/component/currency-totals.test.ts +95 -0
  121. package/src/component/earnings/legacyReads.ts +59 -0
  122. package/src/component/earnings/mutations.ts +21 -0
  123. package/src/component/earnings/reads.ts +41 -0
  124. package/src/component/earnings/schema.ts +11 -0
  125. package/src/component/earnings/triggers.ts +91 -0
  126. package/src/component/products/queries.ts +74 -0
  127. package/src/component/public.test.ts +1 -1
  128. package/src/component/read-pagination.test.ts +193 -0
  129. package/src/component/schema.ts +2 -0
  130. package/src/react/components/EarningsSummary.tsx +5 -2
  131. package/src/react/hooks/useConfirmPayment.test.tsx +47 -0
  132. package/src/react/hooks/useConfirmPayment.ts +16 -2
  133. package/src/react/hooks/useCurrencyEarnings.test.ts +59 -0
  134. package/src/react/hooks/useCurrencyEarnings.ts +73 -0
  135. package/src/react/index.ts +15 -0
  136. package/src/react/read-contracts.render.test.tsx +20 -0
  137. package/src/react/workflows/SaveCard.test.tsx +127 -0
  138. package/src/react/workflows/SaveCard.tsx +117 -0
@@ -0,0 +1,1290 @@
1
+ export declare const mutation: import("convex-helpers/server/customFunctions").CustomBuilder<"mutation", Record<string, never>, import("convex/server").GenericMutationCtx<{
2
+ accounts: {
3
+ document: {
4
+ _creationTime: number;
5
+ _id: import("convex/values").GenericId<"accounts">;
6
+ appliedConfigurations?: ("customer" | "merchant" | "recipient")[] | undefined;
7
+ capabilities?: any;
8
+ configuration?: any;
9
+ country?: string | undefined;
10
+ email?: string | undefined;
11
+ metadata?: any;
12
+ missingRequirements?: string[] | undefined;
13
+ name?: string | undefined;
14
+ onboardingStatus: "complete" | "in_progress" | "pending" | "restricted";
15
+ orgId?: string | undefined;
16
+ requirements?: any;
17
+ statementDescriptor?: string | undefined;
18
+ stripeAccountId: string;
19
+ userId: string;
20
+ };
21
+ fieldPaths: "_id" | ("_creationTime" | "appliedConfigurations" | "capabilities" | "configuration" | "country" | "email" | "metadata" | "missingRequirements" | "name" | "onboardingStatus" | "orgId" | "requirements" | "statementDescriptor" | "stripeAccountId" | "userId" | `capabilities.${string}` | `configuration.${string}` | `metadata.${string}` | `requirements.${string}`);
22
+ indexes: {
23
+ by_id: ["_id"];
24
+ by_creation_time: ["_creationTime"];
25
+ by_onboarding_status: ["onboardingStatus", "_creationTime"];
26
+ by_org_id: ["orgId", "_creationTime"];
27
+ by_stripe_account_id: ["stripeAccountId", "_creationTime"];
28
+ by_user_id: ["userId", "_creationTime"];
29
+ };
30
+ searchIndexes: {};
31
+ vectorIndexes: {};
32
+ };
33
+ checkoutSessions: {
34
+ document: {
35
+ _creationTime: number;
36
+ _id: import("convex/values").GenericId<"checkoutSessions">;
37
+ accountId?: string | undefined;
38
+ applicationFeeAmount?: number | undefined;
39
+ applicationFeePercent?: number | undefined;
40
+ chargeType?: "destination" | "separate" | undefined;
41
+ clientSecret?: string | undefined;
42
+ currency?: string | undefined;
43
+ destinationAccountId?: string | undefined;
44
+ feeCollectedAmount?: number | undefined;
45
+ feeRefundedAmount?: number | undefined;
46
+ metadata?: any;
47
+ mode: "payment" | "setup" | "subscription";
48
+ orgId?: string | undefined;
49
+ priceId?: string | undefined;
50
+ splitRecipients?: {
51
+ amount?: number | undefined;
52
+ destinationAccountId: string;
53
+ percent?: number | undefined;
54
+ role: "affiliate" | "other" | "store";
55
+ }[] | undefined;
56
+ status: "complete" | "expired" | "open";
57
+ stripeSessionId: string;
58
+ url?: string | undefined;
59
+ userId: string;
60
+ };
61
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "applicationFeeAmount" | "applicationFeePercent" | "chargeType" | "clientSecret" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "metadata" | "mode" | "orgId" | "priceId" | "splitRecipients" | "status" | "stripeSessionId" | "url" | "userId" | `metadata.${string}`);
62
+ indexes: {
63
+ by_id: ["_id"];
64
+ by_creation_time: ["_creationTime"];
65
+ by_account_id: ["accountId", "_creationTime"];
66
+ by_stripe_session_id: ["stripeSessionId", "_creationTime"];
67
+ by_user_id: ["userId", "_creationTime"];
68
+ by_user_status: ["userId", "status", "_creationTime"];
69
+ };
70
+ searchIndexes: {};
71
+ vectorIndexes: {};
72
+ };
73
+ commissionDecisions: {
74
+ document: {
75
+ _creationTime: number;
76
+ _id: import("convex/values").GenericId<"commissionDecisions">;
77
+ claimKey: string;
78
+ eligible: boolean;
79
+ invoiceId: string;
80
+ subscriptionId: string;
81
+ };
82
+ fieldPaths: "_id" | ("_creationTime" | "claimKey" | "eligible" | "invoiceId" | "subscriptionId");
83
+ indexes: {
84
+ by_id: ["_id"];
85
+ by_creation_time: ["_creationTime"];
86
+ by_subscription_invoice: ["subscriptionId", "invoiceId", "_creationTime"];
87
+ };
88
+ searchIndexes: {};
89
+ vectorIndexes: {};
90
+ };
91
+ commissionTerms: {
92
+ document: {
93
+ _creationTime: number;
94
+ _id: import("convex/values").GenericId<"commissionTerms">;
95
+ affiliateAccountId?: string | undefined;
96
+ firstPaidInvoiceId: string;
97
+ subscriptionId: string;
98
+ term: "forever" | "one_time";
99
+ };
100
+ fieldPaths: "_id" | ("_creationTime" | "affiliateAccountId" | "firstPaidInvoiceId" | "subscriptionId" | "term");
101
+ indexes: {
102
+ by_id: ["_id"];
103
+ by_creation_time: ["_creationTime"];
104
+ by_subscription: ["subscriptionId", "_creationTime"];
105
+ };
106
+ searchIndexes: {};
107
+ vectorIndexes: {};
108
+ };
109
+ currencyTotals: {
110
+ document: {
111
+ _creationTime: number;
112
+ _id: import("convex/values").GenericId<"currencyTotals">;
113
+ accountId: string;
114
+ count: number;
115
+ currency: string;
116
+ gross: number;
117
+ kind: "earnings" | "payouts";
118
+ paidOut: number;
119
+ reversed: number;
120
+ };
121
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "count" | "currency" | "gross" | "kind" | "paidOut" | "reversed");
122
+ indexes: {
123
+ by_id: ["_id"];
124
+ by_creation_time: ["_creationTime"];
125
+ by_account_kind_currency: ["accountId", "kind", "currency", "_creationTime"];
126
+ };
127
+ searchIndexes: {};
128
+ vectorIndexes: {};
129
+ };
130
+ disputes: {
131
+ document: {
132
+ _creationTime: number;
133
+ _id: import("convex/values").GenericId<"disputes">;
134
+ accountId?: string | undefined;
135
+ amount: number;
136
+ currency: string;
137
+ evidence?: any;
138
+ evidenceDueBy?: string | undefined;
139
+ isChargeRefundable: boolean;
140
+ lastEvent?: string | undefined;
141
+ linkedTransferIds?: string[] | undefined;
142
+ metadata?: any;
143
+ reason: string;
144
+ statementDescriptor?: string | undefined;
145
+ status: "lost" | "needs_response" | "prevented" | "under_review" | "warning_closed" | "warning_needs_response" | "warning_under_review" | "won";
146
+ stripeChargeId?: string | undefined;
147
+ stripeDisputeId: string;
148
+ stripePaymentIntentId?: string | undefined;
149
+ };
150
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "amount" | "currency" | "evidence" | "evidenceDueBy" | "isChargeRefundable" | "lastEvent" | "linkedTransferIds" | "metadata" | "reason" | "statementDescriptor" | "status" | "stripeChargeId" | "stripeDisputeId" | "stripePaymentIntentId" | `evidence.${string}` | `metadata.${string}`);
151
+ indexes: {
152
+ by_id: ["_id"];
153
+ by_creation_time: ["_creationTime"];
154
+ by_account_id: ["accountId", "_creationTime"];
155
+ by_account_id_and_status: ["accountId", "status", "_creationTime"];
156
+ by_payment_intent_id_and_status: ["stripePaymentIntentId", "status", "_creationTime"];
157
+ by_status: ["status", "_creationTime"];
158
+ by_stripe_dispute_id: ["stripeDisputeId", "_creationTime"];
159
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
160
+ };
161
+ searchIndexes: {};
162
+ vectorIndexes: {};
163
+ };
164
+ invoices: {
165
+ document: {
166
+ _creationTime: number;
167
+ _id: import("convex/values").GenericId<"invoices">;
168
+ accountId?: string | undefined;
169
+ amountDue: number;
170
+ amountPaid: number;
171
+ applicationFeeAmount?: number | undefined;
172
+ applicationFeePercent?: number | undefined;
173
+ attemptCount?: number | undefined;
174
+ chargeType?: "destination" | "separate" | undefined;
175
+ currency: string;
176
+ destinationAccountId?: string | undefined;
177
+ feeCollectedAmount?: number | undefined;
178
+ feeRefundedAmount?: number | undefined;
179
+ hostedInvoiceUrl?: string | undefined;
180
+ invoicePdf?: string | undefined;
181
+ metadata?: any;
182
+ nextPaymentAttempt?: string | undefined;
183
+ orgId?: string | undefined;
184
+ periodEnd?: string | undefined;
185
+ periodStart?: string | undefined;
186
+ splitRecipients?: {
187
+ amount?: number | undefined;
188
+ destinationAccountId: string;
189
+ percent?: number | undefined;
190
+ role: "affiliate" | "other" | "store";
191
+ }[] | undefined;
192
+ status: "draft" | "open" | "paid" | "uncollectible" | "void";
193
+ stripeInvoiceId: string;
194
+ subscriptionId?: string | undefined;
195
+ userId: string;
196
+ };
197
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "amountDue" | "amountPaid" | "applicationFeeAmount" | "applicationFeePercent" | "attemptCount" | "chargeType" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "hostedInvoiceUrl" | "invoicePdf" | "metadata" | "nextPaymentAttempt" | "orgId" | "periodEnd" | "periodStart" | "splitRecipients" | "status" | "stripeInvoiceId" | "subscriptionId" | "userId" | `metadata.${string}`);
198
+ indexes: {
199
+ by_id: ["_id"];
200
+ by_creation_time: ["_creationTime"];
201
+ by_account_id: ["accountId", "_creationTime"];
202
+ by_account_status: ["accountId", "status", "_creationTime"];
203
+ by_status: ["status", "_creationTime"];
204
+ by_stripe_invoice_id: ["stripeInvoiceId", "_creationTime"];
205
+ by_subscription_id: ["subscriptionId", "_creationTime"];
206
+ by_subscription_status: ["subscriptionId", "status", "_creationTime"];
207
+ by_user_id: ["userId", "_creationTime"];
208
+ by_user_status: ["userId", "status", "_creationTime"];
209
+ };
210
+ searchIndexes: {};
211
+ vectorIndexes: {};
212
+ };
213
+ payments: {
214
+ document: {
215
+ _creationTime: number;
216
+ _id: import("convex/values").GenericId<"payments">;
217
+ accountId?: string | undefined;
218
+ amount: number;
219
+ applicationFeeAmount?: number | undefined;
220
+ applicationFeePercent?: number | undefined;
221
+ chargeType?: "destination" | "separate" | undefined;
222
+ currency: string;
223
+ destinationAccountId?: string | undefined;
224
+ feeCollectedAmount?: number | undefined;
225
+ feeRefundedAmount?: number | undefined;
226
+ metadata?: any;
227
+ orgId?: string | undefined;
228
+ refundStatus?: "fully_refunded" | "partially_refunded" | undefined;
229
+ refundedAmount?: number | undefined;
230
+ splitRecipients?: {
231
+ amount?: number | undefined;
232
+ destinationAccountId: string;
233
+ percent?: number | undefined;
234
+ role: "affiliate" | "other" | "store";
235
+ }[] | undefined;
236
+ status: "canceled" | "failed" | "processing" | "requires_action" | "succeeded";
237
+ stripePaymentIntentId: string;
238
+ userId: string;
239
+ };
240
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "amount" | "applicationFeeAmount" | "applicationFeePercent" | "chargeType" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "metadata" | "orgId" | "refundStatus" | "refundedAmount" | "splitRecipients" | "status" | "stripePaymentIntentId" | "userId" | `metadata.${string}`);
241
+ indexes: {
242
+ by_id: ["_id"];
243
+ by_creation_time: ["_creationTime"];
244
+ by_account_id: ["accountId", "_creationTime"];
245
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
246
+ by_user_id: ["userId", "_creationTime"];
247
+ };
248
+ searchIndexes: {};
249
+ vectorIndexes: {};
250
+ };
251
+ payouts: {
252
+ document: {
253
+ _creationTime: number;
254
+ _id: import("convex/values").GenericId<"payouts">;
255
+ accountId: string;
256
+ amount: number;
257
+ arrivalDate?: string | undefined;
258
+ currency: string;
259
+ failureCode?: string | undefined;
260
+ failureMessage?: string | undefined;
261
+ metadata?: any;
262
+ method?: string | undefined;
263
+ status: "canceled" | "failed" | "in_transit" | "paid" | "pending";
264
+ stripePayoutId: string;
265
+ totalsRecorded?: true | undefined;
266
+ };
267
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "amount" | "arrivalDate" | "currency" | "failureCode" | "failureMessage" | "metadata" | "method" | "status" | "stripePayoutId" | "totalsRecorded" | `metadata.${string}`);
268
+ indexes: {
269
+ by_id: ["_id"];
270
+ by_creation_time: ["_creationTime"];
271
+ by_account_id: ["accountId", "_creationTime"];
272
+ by_account_status: ["accountId", "status", "_creationTime"];
273
+ by_account_totals_recorded: ["accountId", "totalsRecorded", "_creationTime"];
274
+ by_status: ["status", "_creationTime"];
275
+ by_stripe_payout_id: ["stripePayoutId", "_creationTime"];
276
+ };
277
+ searchIndexes: {};
278
+ vectorIndexes: {};
279
+ };
280
+ pendingFeeRefunds: {
281
+ document: {
282
+ _creationTime: number;
283
+ _id: import("convex/values").GenericId<"pendingFeeRefunds">;
284
+ feeCollectedAmount: number;
285
+ feeRefundedAmount: number;
286
+ stripePaymentIntentId: string;
287
+ };
288
+ fieldPaths: "_id" | ("_creationTime" | "feeCollectedAmount" | "feeRefundedAmount" | "stripePaymentIntentId");
289
+ indexes: {
290
+ by_id: ["_id"];
291
+ by_creation_time: ["_creationTime"];
292
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
293
+ };
294
+ searchIndexes: {};
295
+ vectorIndexes: {};
296
+ };
297
+ prices: {
298
+ document: {
299
+ _creationTime: number;
300
+ _id: import("convex/values").GenericId<"prices">;
301
+ active: boolean;
302
+ currency: string;
303
+ interval?: "day" | "month" | "week" | "year" | undefined;
304
+ intervalCount?: number | undefined;
305
+ metadata?: any;
306
+ nickname?: string | undefined;
307
+ productId: string;
308
+ stripePriceId: string;
309
+ stripeProductId: string;
310
+ type: "one_time" | "recurring";
311
+ unitAmount: number;
312
+ };
313
+ fieldPaths: "_id" | ("_creationTime" | "active" | "currency" | "interval" | "intervalCount" | "metadata" | "nickname" | "productId" | "stripePriceId" | "stripeProductId" | "type" | "unitAmount" | `metadata.${string}`);
314
+ indexes: {
315
+ by_id: ["_id"];
316
+ by_creation_time: ["_creationTime"];
317
+ by_active: ["active", "_creationTime"];
318
+ by_product_active: ["productId", "active", "_creationTime"];
319
+ by_product_id: ["productId", "_creationTime"];
320
+ by_stripe_price_id: ["stripePriceId", "_creationTime"];
321
+ by_stripe_product_id: ["stripeProductId", "_creationTime"];
322
+ };
323
+ searchIndexes: {};
324
+ vectorIndexes: {};
325
+ };
326
+ products: {
327
+ document: {
328
+ _creationTime: number;
329
+ _id: import("convex/values").GenericId<"products">;
330
+ accountId?: string | undefined;
331
+ active: boolean;
332
+ description?: string | undefined;
333
+ metadata?: any;
334
+ name: string;
335
+ stripeProductId: string;
336
+ };
337
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "active" | "description" | "metadata" | "name" | "stripeProductId" | `metadata.${string}`);
338
+ indexes: {
339
+ by_id: ["_id"];
340
+ by_creation_time: ["_creationTime"];
341
+ by_account_active: ["accountId", "active", "_creationTime"];
342
+ by_account_id: ["accountId", "_creationTime"];
343
+ by_active: ["active", "_creationTime"];
344
+ by_stripe_product_id: ["stripeProductId", "_creationTime"];
345
+ };
346
+ searchIndexes: {};
347
+ vectorIndexes: {};
348
+ };
349
+ recoveryBalances: {
350
+ document: {
351
+ _creationTime: number;
352
+ _id: import("convex/values").GenericId<"recoveryBalances">;
353
+ accountId: string;
354
+ activeGroupKey?: string | undefined;
355
+ amountDue: number;
356
+ collectedAmount: number;
357
+ currency: string;
358
+ outstanding: number;
359
+ reservedAmount: number;
360
+ scopeKey: string;
361
+ };
362
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "activeGroupKey" | "amountDue" | "collectedAmount" | "currency" | "outstanding" | "reservedAmount" | "scopeKey");
363
+ indexes: {
364
+ by_id: ["_id"];
365
+ by_creation_time: ["_creationTime"];
366
+ by_scope: ["accountId", "scopeKey", "currency", "_creationTime"];
367
+ };
368
+ searchIndexes: {};
369
+ vectorIndexes: {};
370
+ };
371
+ recoveryClaims: {
372
+ document: {
373
+ _creationTime: number;
374
+ _id: import("convex/values").GenericId<"recoveryClaims">;
375
+ accountId: string;
376
+ amountDue: number;
377
+ claimKey: string;
378
+ collectedAmount: number;
379
+ currency: string;
380
+ openingCollection?: {
381
+ amountDue: number;
382
+ collectedAmount: number;
383
+ operationKey: string;
384
+ revision: number;
385
+ } | undefined;
386
+ outstanding: number;
387
+ reservedAmount: number;
388
+ revision: number;
389
+ scopeKey: string;
390
+ sign: "negative" | "positive" | "zero";
391
+ sourceChargeId: string;
392
+ sourceGross: number;
393
+ sourceProcessingFee: number;
394
+ };
395
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "amountDue" | "claimKey" | "collectedAmount" | "currency" | "openingCollection" | "openingCollection.amountDue" | "openingCollection.collectedAmount" | "openingCollection.operationKey" | "openingCollection.revision" | "outstanding" | "reservedAmount" | "revision" | "scopeKey" | "sign" | "sourceChargeId" | "sourceGross" | "sourceProcessingFee");
396
+ indexes: {
397
+ by_id: ["_id"];
398
+ by_creation_time: ["_creationTime"];
399
+ by_import: ["openingCollection.operationKey", "_creationTime"];
400
+ by_key: ["claimKey", "_creationTime"];
401
+ by_scope: ["accountId", "scopeKey", "currency", "_creationTime"];
402
+ by_sign: ["accountId", "scopeKey", "currency", "sign", "_creationTime"];
403
+ };
404
+ searchIndexes: {};
405
+ vectorIndexes: {};
406
+ };
407
+ recoveryGroups: {
408
+ document: {
409
+ _creationTime: number;
410
+ _id: import("convex/values").GenericId<"recoveryGroups">;
411
+ accountId: string;
412
+ amount: number;
413
+ currency: string;
414
+ groupKey: string;
415
+ invoiceFunding?: {
416
+ sourceChargeId: string;
417
+ sourceGross: number;
418
+ sourceProcessingFee: number;
419
+ } | undefined;
420
+ invoiceItemId?: string | undefined;
421
+ maxCredit: number;
422
+ maxDebit: number;
423
+ pendingOperations: number;
424
+ scopeKey: string;
425
+ sourceGross?: number | undefined;
426
+ sourceId: string;
427
+ sourceKind: "invoice" | "settlement";
428
+ sourceProcessingFee?: number | undefined;
429
+ status: "collected" | "collecting" | "open" | "released" | "releasing" | "sealed";
430
+ };
431
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "amount" | "currency" | "groupKey" | "invoiceFunding" | "invoiceFunding.sourceChargeId" | "invoiceFunding.sourceGross" | "invoiceFunding.sourceProcessingFee" | "invoiceItemId" | "maxCredit" | "maxDebit" | "pendingOperations" | "scopeKey" | "sourceGross" | "sourceId" | "sourceKind" | "sourceProcessingFee" | "status");
432
+ indexes: {
433
+ by_id: ["_id"];
434
+ by_creation_time: ["_creationTime"];
435
+ by_key: ["groupKey", "_creationTime"];
436
+ };
437
+ searchIndexes: {};
438
+ vectorIndexes: {};
439
+ };
440
+ recoveryReservations: {
441
+ document: {
442
+ _creationTime: number;
443
+ _id: import("convex/values").GenericId<"recoveryReservations">;
444
+ allocations: {
445
+ amount: number;
446
+ claimId: import("convex/values").GenericId<"recoveryClaims">;
447
+ claimKey: string;
448
+ }[];
449
+ amount: number;
450
+ groupKey: string;
451
+ limit: number;
452
+ operationKey: string;
453
+ status: "collected" | "empty" | "released" | "reserved";
454
+ };
455
+ fieldPaths: "_id" | ("_creationTime" | "allocations" | "amount" | "groupKey" | "limit" | "operationKey" | "status");
456
+ indexes: {
457
+ by_id: ["_id"];
458
+ by_creation_time: ["_creationTime"];
459
+ by_group_status: ["groupKey", "status", "_creationTime"];
460
+ by_key: ["operationKey", "_creationTime"];
461
+ };
462
+ searchIndexes: {};
463
+ vectorIndexes: {};
464
+ };
465
+ refunds: {
466
+ document: {
467
+ _creationTime: number;
468
+ _id: import("convex/values").GenericId<"refunds">;
469
+ accountId?: string | undefined;
470
+ amount: number;
471
+ currency: string;
472
+ failureReason?: string | undefined;
473
+ metadata?: any;
474
+ reason?: "duplicate" | "expired_uncaptured_charge" | "fraudulent" | "requested_by_customer" | undefined;
475
+ status: "canceled" | "failed" | "pending" | "requires_action" | "succeeded";
476
+ stripeChargeId?: string | undefined;
477
+ stripePaymentIntentId?: string | undefined;
478
+ stripeRefundId: string;
479
+ };
480
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "amount" | "currency" | "failureReason" | "metadata" | "reason" | "status" | "stripeChargeId" | "stripePaymentIntentId" | "stripeRefundId" | `metadata.${string}`);
481
+ indexes: {
482
+ by_id: ["_id"];
483
+ by_creation_time: ["_creationTime"];
484
+ by_account_id: ["accountId", "_creationTime"];
485
+ by_account_id_and_status: ["accountId", "status", "_creationTime"];
486
+ by_payment_intent_id_and_status: ["stripePaymentIntentId", "status", "_creationTime"];
487
+ by_status: ["status", "_creationTime"];
488
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
489
+ by_stripe_refund_id: ["stripeRefundId", "_creationTime"];
490
+ };
491
+ searchIndexes: {};
492
+ vectorIndexes: {};
493
+ };
494
+ settlementAllocations: {
495
+ document: {
496
+ _creationTime: number;
497
+ _id: import("convex/values").GenericId<"settlementAllocations">;
498
+ adjustmentAmount?: number | undefined;
499
+ currency: string;
500
+ gross: number;
501
+ paymentId?: string | undefined;
502
+ paymentIntentId?: string | undefined;
503
+ platformNet: number;
504
+ processingFee: number;
505
+ sourceChargeId: string;
506
+ sourceInvoiceId?: string | undefined;
507
+ transfers: {
508
+ amount: number;
509
+ destinationAccountId: string;
510
+ role: "affiliate" | "other" | "store";
511
+ }[];
512
+ };
513
+ fieldPaths: "_id" | ("_creationTime" | "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers");
514
+ indexes: {
515
+ by_id: ["_id"];
516
+ by_creation_time: ["_creationTime"];
517
+ by_source_charge: ["sourceChargeId", "_creationTime"];
518
+ };
519
+ searchIndexes: {};
520
+ vectorIndexes: {};
521
+ };
522
+ subscriptions: {
523
+ document: {
524
+ _creationTime: number;
525
+ _id: import("convex/values").GenericId<"subscriptions">;
526
+ accountId?: string | undefined;
527
+ applicationFeeAmount?: number | undefined;
528
+ applicationFeePercent?: number | undefined;
529
+ cancelAtPeriodEnd: boolean;
530
+ canceledAt?: string | undefined;
531
+ chargeType?: "destination" | "separate" | undefined;
532
+ currency?: string | undefined;
533
+ currentPeriodEnd?: string | undefined;
534
+ currentPeriodStart?: string | undefined;
535
+ destinationAccountId?: string | undefined;
536
+ feeCollectedAmount?: number | undefined;
537
+ feeRefundedAmount?: number | undefined;
538
+ isCollectionPaused?: boolean | undefined;
539
+ isTrialing: boolean;
540
+ metadata?: any;
541
+ orgId?: string | undefined;
542
+ priceId?: string | undefined;
543
+ quantity?: number | undefined;
544
+ splitRecipients?: {
545
+ amount?: number | undefined;
546
+ destinationAccountId: string;
547
+ percent?: number | undefined;
548
+ role: "affiliate" | "other" | "store";
549
+ }[] | undefined;
550
+ status: "active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid";
551
+ stripeSubscriptionId: string;
552
+ trialEnd?: string | undefined;
553
+ trialStart?: string | undefined;
554
+ userId: string;
555
+ };
556
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "applicationFeeAmount" | "applicationFeePercent" | "cancelAtPeriodEnd" | "canceledAt" | "chargeType" | "currency" | "currentPeriodEnd" | "currentPeriodStart" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "isCollectionPaused" | "isTrialing" | "metadata" | "orgId" | "priceId" | "quantity" | "splitRecipients" | "status" | "stripeSubscriptionId" | "trialEnd" | "trialStart" | "userId" | `metadata.${string}`);
557
+ indexes: {
558
+ by_id: ["_id"];
559
+ by_creation_time: ["_creationTime"];
560
+ by_account_id: ["accountId", "_creationTime"];
561
+ by_account_status: ["accountId", "status", "_creationTime"];
562
+ by_org_id: ["orgId", "_creationTime"];
563
+ by_price_id: ["priceId", "_creationTime"];
564
+ by_status: ["status", "_creationTime"];
565
+ by_stripe_subscription_id: ["stripeSubscriptionId", "_creationTime"];
566
+ by_user_id: ["userId", "_creationTime"];
567
+ };
568
+ searchIndexes: {};
569
+ vectorIndexes: {};
570
+ };
571
+ transferReversalOps: {
572
+ document: {
573
+ _creationTime: number;
574
+ _id: import("convex/values").GenericId<"transferReversalOps">;
575
+ operationId: string;
576
+ slices: {
577
+ from: number;
578
+ stripeTransferId: string;
579
+ to: number;
580
+ }[];
581
+ sourceChargeId: string;
582
+ };
583
+ fieldPaths: "_id" | ("_creationTime" | "operationId" | "slices" | "sourceChargeId");
584
+ indexes: {
585
+ by_id: ["_id"];
586
+ by_creation_time: ["_creationTime"];
587
+ by_operation_id: ["operationId", "_creationTime"];
588
+ };
589
+ searchIndexes: {};
590
+ vectorIndexes: {};
591
+ };
592
+ transfers: {
593
+ document: {
594
+ _creationTime: number;
595
+ _id: import("convex/values").GenericId<"transfers">;
596
+ amount: number;
597
+ currency: string;
598
+ destinationAccountId: string;
599
+ metadata?: any;
600
+ paymentId?: string | undefined;
601
+ reinstatement?: boolean | undefined;
602
+ reversalClaimedAmount?: number | undefined;
603
+ reversalStatus?: "fully_reversed" | "partially_reversed" | undefined;
604
+ reversedAmount?: number | undefined;
605
+ role?: "affiliate" | "other" | "store" | undefined;
606
+ sourceChargeId?: string | undefined;
607
+ sourceInvoiceId?: string | undefined;
608
+ status: "failed" | "paid" | "pending" | "reversed";
609
+ stripeTransferId: string;
610
+ totalsRecorded?: true | undefined;
611
+ };
612
+ fieldPaths: "_id" | ("_creationTime" | "amount" | "currency" | "destinationAccountId" | "metadata" | "paymentId" | "reinstatement" | "reversalClaimedAmount" | "reversalStatus" | "reversedAmount" | "role" | "sourceChargeId" | "sourceInvoiceId" | "status" | "stripeTransferId" | "totalsRecorded" | `metadata.${string}`);
613
+ indexes: {
614
+ by_id: ["_id"];
615
+ by_creation_time: ["_creationTime"];
616
+ by_account_totals_recorded: ["destinationAccountId", "totalsRecorded", "_creationTime"];
617
+ by_destination_account_id: ["destinationAccountId", "_creationTime"];
618
+ by_source_charge_id: ["sourceChargeId", "_creationTime"];
619
+ by_stripe_transfer_id: ["stripeTransferId", "_creationTime"];
620
+ };
621
+ searchIndexes: {};
622
+ vectorIndexes: {};
623
+ };
624
+ webhookEvents: {
625
+ document: {
626
+ _creationTime: number;
627
+ _id: import("convex/values").GenericId<"webhookEvents">;
628
+ eventType: string;
629
+ lastError?: string | undefined;
630
+ livemode?: boolean | undefined;
631
+ processedAt: number;
632
+ status: "failed" | "ignored" | "processed" | "processing";
633
+ stripeEventId: string;
634
+ };
635
+ fieldPaths: "_id" | ("_creationTime" | "eventType" | "lastError" | "livemode" | "processedAt" | "status" | "stripeEventId");
636
+ indexes: {
637
+ by_id: ["_id"];
638
+ by_creation_time: ["_creationTime"];
639
+ by_status: ["status", "_creationTime"];
640
+ by_stripeEventId: ["stripeEventId", "_creationTime"];
641
+ };
642
+ searchIndexes: {};
643
+ vectorIndexes: {};
644
+ };
645
+ }>, Record<string, never>, import("convex/server").GenericMutationCtx<{
646
+ accounts: {
647
+ document: {
648
+ _creationTime: number;
649
+ _id: import("convex/values").GenericId<"accounts">;
650
+ appliedConfigurations?: ("customer" | "merchant" | "recipient")[] | undefined;
651
+ capabilities?: any;
652
+ configuration?: any;
653
+ country?: string | undefined;
654
+ email?: string | undefined;
655
+ metadata?: any;
656
+ missingRequirements?: string[] | undefined;
657
+ name?: string | undefined;
658
+ onboardingStatus: "complete" | "in_progress" | "pending" | "restricted";
659
+ orgId?: string | undefined;
660
+ requirements?: any;
661
+ statementDescriptor?: string | undefined;
662
+ stripeAccountId: string;
663
+ userId: string;
664
+ };
665
+ fieldPaths: "_id" | ("_creationTime" | "appliedConfigurations" | "capabilities" | "configuration" | "country" | "email" | "metadata" | "missingRequirements" | "name" | "onboardingStatus" | "orgId" | "requirements" | "statementDescriptor" | "stripeAccountId" | "userId" | `capabilities.${string}` | `configuration.${string}` | `metadata.${string}` | `requirements.${string}`);
666
+ indexes: {
667
+ by_id: ["_id"];
668
+ by_creation_time: ["_creationTime"];
669
+ by_onboarding_status: ["onboardingStatus", "_creationTime"];
670
+ by_org_id: ["orgId", "_creationTime"];
671
+ by_stripe_account_id: ["stripeAccountId", "_creationTime"];
672
+ by_user_id: ["userId", "_creationTime"];
673
+ };
674
+ searchIndexes: {};
675
+ vectorIndexes: {};
676
+ };
677
+ checkoutSessions: {
678
+ document: {
679
+ _creationTime: number;
680
+ _id: import("convex/values").GenericId<"checkoutSessions">;
681
+ accountId?: string | undefined;
682
+ applicationFeeAmount?: number | undefined;
683
+ applicationFeePercent?: number | undefined;
684
+ chargeType?: "destination" | "separate" | undefined;
685
+ clientSecret?: string | undefined;
686
+ currency?: string | undefined;
687
+ destinationAccountId?: string | undefined;
688
+ feeCollectedAmount?: number | undefined;
689
+ feeRefundedAmount?: number | undefined;
690
+ metadata?: any;
691
+ mode: "payment" | "setup" | "subscription";
692
+ orgId?: string | undefined;
693
+ priceId?: string | undefined;
694
+ splitRecipients?: {
695
+ amount?: number | undefined;
696
+ destinationAccountId: string;
697
+ percent?: number | undefined;
698
+ role: "affiliate" | "other" | "store";
699
+ }[] | undefined;
700
+ status: "complete" | "expired" | "open";
701
+ stripeSessionId: string;
702
+ url?: string | undefined;
703
+ userId: string;
704
+ };
705
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "applicationFeeAmount" | "applicationFeePercent" | "chargeType" | "clientSecret" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "metadata" | "mode" | "orgId" | "priceId" | "splitRecipients" | "status" | "stripeSessionId" | "url" | "userId" | `metadata.${string}`);
706
+ indexes: {
707
+ by_id: ["_id"];
708
+ by_creation_time: ["_creationTime"];
709
+ by_account_id: ["accountId", "_creationTime"];
710
+ by_stripe_session_id: ["stripeSessionId", "_creationTime"];
711
+ by_user_id: ["userId", "_creationTime"];
712
+ by_user_status: ["userId", "status", "_creationTime"];
713
+ };
714
+ searchIndexes: {};
715
+ vectorIndexes: {};
716
+ };
717
+ commissionDecisions: {
718
+ document: {
719
+ _creationTime: number;
720
+ _id: import("convex/values").GenericId<"commissionDecisions">;
721
+ claimKey: string;
722
+ eligible: boolean;
723
+ invoiceId: string;
724
+ subscriptionId: string;
725
+ };
726
+ fieldPaths: "_id" | ("_creationTime" | "claimKey" | "eligible" | "invoiceId" | "subscriptionId");
727
+ indexes: {
728
+ by_id: ["_id"];
729
+ by_creation_time: ["_creationTime"];
730
+ by_subscription_invoice: ["subscriptionId", "invoiceId", "_creationTime"];
731
+ };
732
+ searchIndexes: {};
733
+ vectorIndexes: {};
734
+ };
735
+ commissionTerms: {
736
+ document: {
737
+ _creationTime: number;
738
+ _id: import("convex/values").GenericId<"commissionTerms">;
739
+ affiliateAccountId?: string | undefined;
740
+ firstPaidInvoiceId: string;
741
+ subscriptionId: string;
742
+ term: "forever" | "one_time";
743
+ };
744
+ fieldPaths: "_id" | ("_creationTime" | "affiliateAccountId" | "firstPaidInvoiceId" | "subscriptionId" | "term");
745
+ indexes: {
746
+ by_id: ["_id"];
747
+ by_creation_time: ["_creationTime"];
748
+ by_subscription: ["subscriptionId", "_creationTime"];
749
+ };
750
+ searchIndexes: {};
751
+ vectorIndexes: {};
752
+ };
753
+ currencyTotals: {
754
+ document: {
755
+ _creationTime: number;
756
+ _id: import("convex/values").GenericId<"currencyTotals">;
757
+ accountId: string;
758
+ count: number;
759
+ currency: string;
760
+ gross: number;
761
+ kind: "earnings" | "payouts";
762
+ paidOut: number;
763
+ reversed: number;
764
+ };
765
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "count" | "currency" | "gross" | "kind" | "paidOut" | "reversed");
766
+ indexes: {
767
+ by_id: ["_id"];
768
+ by_creation_time: ["_creationTime"];
769
+ by_account_kind_currency: ["accountId", "kind", "currency", "_creationTime"];
770
+ };
771
+ searchIndexes: {};
772
+ vectorIndexes: {};
773
+ };
774
+ disputes: {
775
+ document: {
776
+ _creationTime: number;
777
+ _id: import("convex/values").GenericId<"disputes">;
778
+ accountId?: string | undefined;
779
+ amount: number;
780
+ currency: string;
781
+ evidence?: any;
782
+ evidenceDueBy?: string | undefined;
783
+ isChargeRefundable: boolean;
784
+ lastEvent?: string | undefined;
785
+ linkedTransferIds?: string[] | undefined;
786
+ metadata?: any;
787
+ reason: string;
788
+ statementDescriptor?: string | undefined;
789
+ status: "lost" | "needs_response" | "prevented" | "under_review" | "warning_closed" | "warning_needs_response" | "warning_under_review" | "won";
790
+ stripeChargeId?: string | undefined;
791
+ stripeDisputeId: string;
792
+ stripePaymentIntentId?: string | undefined;
793
+ };
794
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "amount" | "currency" | "evidence" | "evidenceDueBy" | "isChargeRefundable" | "lastEvent" | "linkedTransferIds" | "metadata" | "reason" | "statementDescriptor" | "status" | "stripeChargeId" | "stripeDisputeId" | "stripePaymentIntentId" | `evidence.${string}` | `metadata.${string}`);
795
+ indexes: {
796
+ by_id: ["_id"];
797
+ by_creation_time: ["_creationTime"];
798
+ by_account_id: ["accountId", "_creationTime"];
799
+ by_account_id_and_status: ["accountId", "status", "_creationTime"];
800
+ by_payment_intent_id_and_status: ["stripePaymentIntentId", "status", "_creationTime"];
801
+ by_status: ["status", "_creationTime"];
802
+ by_stripe_dispute_id: ["stripeDisputeId", "_creationTime"];
803
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
804
+ };
805
+ searchIndexes: {};
806
+ vectorIndexes: {};
807
+ };
808
+ invoices: {
809
+ document: {
810
+ _creationTime: number;
811
+ _id: import("convex/values").GenericId<"invoices">;
812
+ accountId?: string | undefined;
813
+ amountDue: number;
814
+ amountPaid: number;
815
+ applicationFeeAmount?: number | undefined;
816
+ applicationFeePercent?: number | undefined;
817
+ attemptCount?: number | undefined;
818
+ chargeType?: "destination" | "separate" | undefined;
819
+ currency: string;
820
+ destinationAccountId?: string | undefined;
821
+ feeCollectedAmount?: number | undefined;
822
+ feeRefundedAmount?: number | undefined;
823
+ hostedInvoiceUrl?: string | undefined;
824
+ invoicePdf?: string | undefined;
825
+ metadata?: any;
826
+ nextPaymentAttempt?: string | undefined;
827
+ orgId?: string | undefined;
828
+ periodEnd?: string | undefined;
829
+ periodStart?: string | undefined;
830
+ splitRecipients?: {
831
+ amount?: number | undefined;
832
+ destinationAccountId: string;
833
+ percent?: number | undefined;
834
+ role: "affiliate" | "other" | "store";
835
+ }[] | undefined;
836
+ status: "draft" | "open" | "paid" | "uncollectible" | "void";
837
+ stripeInvoiceId: string;
838
+ subscriptionId?: string | undefined;
839
+ userId: string;
840
+ };
841
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "amountDue" | "amountPaid" | "applicationFeeAmount" | "applicationFeePercent" | "attemptCount" | "chargeType" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "hostedInvoiceUrl" | "invoicePdf" | "metadata" | "nextPaymentAttempt" | "orgId" | "periodEnd" | "periodStart" | "splitRecipients" | "status" | "stripeInvoiceId" | "subscriptionId" | "userId" | `metadata.${string}`);
842
+ indexes: {
843
+ by_id: ["_id"];
844
+ by_creation_time: ["_creationTime"];
845
+ by_account_id: ["accountId", "_creationTime"];
846
+ by_account_status: ["accountId", "status", "_creationTime"];
847
+ by_status: ["status", "_creationTime"];
848
+ by_stripe_invoice_id: ["stripeInvoiceId", "_creationTime"];
849
+ by_subscription_id: ["subscriptionId", "_creationTime"];
850
+ by_subscription_status: ["subscriptionId", "status", "_creationTime"];
851
+ by_user_id: ["userId", "_creationTime"];
852
+ by_user_status: ["userId", "status", "_creationTime"];
853
+ };
854
+ searchIndexes: {};
855
+ vectorIndexes: {};
856
+ };
857
+ payments: {
858
+ document: {
859
+ _creationTime: number;
860
+ _id: import("convex/values").GenericId<"payments">;
861
+ accountId?: string | undefined;
862
+ amount: number;
863
+ applicationFeeAmount?: number | undefined;
864
+ applicationFeePercent?: number | undefined;
865
+ chargeType?: "destination" | "separate" | undefined;
866
+ currency: string;
867
+ destinationAccountId?: string | undefined;
868
+ feeCollectedAmount?: number | undefined;
869
+ feeRefundedAmount?: number | undefined;
870
+ metadata?: any;
871
+ orgId?: string | undefined;
872
+ refundStatus?: "fully_refunded" | "partially_refunded" | undefined;
873
+ refundedAmount?: number | undefined;
874
+ splitRecipients?: {
875
+ amount?: number | undefined;
876
+ destinationAccountId: string;
877
+ percent?: number | undefined;
878
+ role: "affiliate" | "other" | "store";
879
+ }[] | undefined;
880
+ status: "canceled" | "failed" | "processing" | "requires_action" | "succeeded";
881
+ stripePaymentIntentId: string;
882
+ userId: string;
883
+ };
884
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "amount" | "applicationFeeAmount" | "applicationFeePercent" | "chargeType" | "currency" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "metadata" | "orgId" | "refundStatus" | "refundedAmount" | "splitRecipients" | "status" | "stripePaymentIntentId" | "userId" | `metadata.${string}`);
885
+ indexes: {
886
+ by_id: ["_id"];
887
+ by_creation_time: ["_creationTime"];
888
+ by_account_id: ["accountId", "_creationTime"];
889
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
890
+ by_user_id: ["userId", "_creationTime"];
891
+ };
892
+ searchIndexes: {};
893
+ vectorIndexes: {};
894
+ };
895
+ payouts: {
896
+ document: {
897
+ _creationTime: number;
898
+ _id: import("convex/values").GenericId<"payouts">;
899
+ accountId: string;
900
+ amount: number;
901
+ arrivalDate?: string | undefined;
902
+ currency: string;
903
+ failureCode?: string | undefined;
904
+ failureMessage?: string | undefined;
905
+ metadata?: any;
906
+ method?: string | undefined;
907
+ status: "canceled" | "failed" | "in_transit" | "paid" | "pending";
908
+ stripePayoutId: string;
909
+ totalsRecorded?: true | undefined;
910
+ };
911
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "amount" | "arrivalDate" | "currency" | "failureCode" | "failureMessage" | "metadata" | "method" | "status" | "stripePayoutId" | "totalsRecorded" | `metadata.${string}`);
912
+ indexes: {
913
+ by_id: ["_id"];
914
+ by_creation_time: ["_creationTime"];
915
+ by_account_id: ["accountId", "_creationTime"];
916
+ by_account_status: ["accountId", "status", "_creationTime"];
917
+ by_account_totals_recorded: ["accountId", "totalsRecorded", "_creationTime"];
918
+ by_status: ["status", "_creationTime"];
919
+ by_stripe_payout_id: ["stripePayoutId", "_creationTime"];
920
+ };
921
+ searchIndexes: {};
922
+ vectorIndexes: {};
923
+ };
924
+ pendingFeeRefunds: {
925
+ document: {
926
+ _creationTime: number;
927
+ _id: import("convex/values").GenericId<"pendingFeeRefunds">;
928
+ feeCollectedAmount: number;
929
+ feeRefundedAmount: number;
930
+ stripePaymentIntentId: string;
931
+ };
932
+ fieldPaths: "_id" | ("_creationTime" | "feeCollectedAmount" | "feeRefundedAmount" | "stripePaymentIntentId");
933
+ indexes: {
934
+ by_id: ["_id"];
935
+ by_creation_time: ["_creationTime"];
936
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
937
+ };
938
+ searchIndexes: {};
939
+ vectorIndexes: {};
940
+ };
941
+ prices: {
942
+ document: {
943
+ _creationTime: number;
944
+ _id: import("convex/values").GenericId<"prices">;
945
+ active: boolean;
946
+ currency: string;
947
+ interval?: "day" | "month" | "week" | "year" | undefined;
948
+ intervalCount?: number | undefined;
949
+ metadata?: any;
950
+ nickname?: string | undefined;
951
+ productId: string;
952
+ stripePriceId: string;
953
+ stripeProductId: string;
954
+ type: "one_time" | "recurring";
955
+ unitAmount: number;
956
+ };
957
+ fieldPaths: "_id" | ("_creationTime" | "active" | "currency" | "interval" | "intervalCount" | "metadata" | "nickname" | "productId" | "stripePriceId" | "stripeProductId" | "type" | "unitAmount" | `metadata.${string}`);
958
+ indexes: {
959
+ by_id: ["_id"];
960
+ by_creation_time: ["_creationTime"];
961
+ by_active: ["active", "_creationTime"];
962
+ by_product_active: ["productId", "active", "_creationTime"];
963
+ by_product_id: ["productId", "_creationTime"];
964
+ by_stripe_price_id: ["stripePriceId", "_creationTime"];
965
+ by_stripe_product_id: ["stripeProductId", "_creationTime"];
966
+ };
967
+ searchIndexes: {};
968
+ vectorIndexes: {};
969
+ };
970
+ products: {
971
+ document: {
972
+ _creationTime: number;
973
+ _id: import("convex/values").GenericId<"products">;
974
+ accountId?: string | undefined;
975
+ active: boolean;
976
+ description?: string | undefined;
977
+ metadata?: any;
978
+ name: string;
979
+ stripeProductId: string;
980
+ };
981
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "active" | "description" | "metadata" | "name" | "stripeProductId" | `metadata.${string}`);
982
+ indexes: {
983
+ by_id: ["_id"];
984
+ by_creation_time: ["_creationTime"];
985
+ by_account_active: ["accountId", "active", "_creationTime"];
986
+ by_account_id: ["accountId", "_creationTime"];
987
+ by_active: ["active", "_creationTime"];
988
+ by_stripe_product_id: ["stripeProductId", "_creationTime"];
989
+ };
990
+ searchIndexes: {};
991
+ vectorIndexes: {};
992
+ };
993
+ recoveryBalances: {
994
+ document: {
995
+ _creationTime: number;
996
+ _id: import("convex/values").GenericId<"recoveryBalances">;
997
+ accountId: string;
998
+ activeGroupKey?: string | undefined;
999
+ amountDue: number;
1000
+ collectedAmount: number;
1001
+ currency: string;
1002
+ outstanding: number;
1003
+ reservedAmount: number;
1004
+ scopeKey: string;
1005
+ };
1006
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "activeGroupKey" | "amountDue" | "collectedAmount" | "currency" | "outstanding" | "reservedAmount" | "scopeKey");
1007
+ indexes: {
1008
+ by_id: ["_id"];
1009
+ by_creation_time: ["_creationTime"];
1010
+ by_scope: ["accountId", "scopeKey", "currency", "_creationTime"];
1011
+ };
1012
+ searchIndexes: {};
1013
+ vectorIndexes: {};
1014
+ };
1015
+ recoveryClaims: {
1016
+ document: {
1017
+ _creationTime: number;
1018
+ _id: import("convex/values").GenericId<"recoveryClaims">;
1019
+ accountId: string;
1020
+ amountDue: number;
1021
+ claimKey: string;
1022
+ collectedAmount: number;
1023
+ currency: string;
1024
+ openingCollection?: {
1025
+ amountDue: number;
1026
+ collectedAmount: number;
1027
+ operationKey: string;
1028
+ revision: number;
1029
+ } | undefined;
1030
+ outstanding: number;
1031
+ reservedAmount: number;
1032
+ revision: number;
1033
+ scopeKey: string;
1034
+ sign: "negative" | "positive" | "zero";
1035
+ sourceChargeId: string;
1036
+ sourceGross: number;
1037
+ sourceProcessingFee: number;
1038
+ };
1039
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "amountDue" | "claimKey" | "collectedAmount" | "currency" | "openingCollection" | "openingCollection.amountDue" | "openingCollection.collectedAmount" | "openingCollection.operationKey" | "openingCollection.revision" | "outstanding" | "reservedAmount" | "revision" | "scopeKey" | "sign" | "sourceChargeId" | "sourceGross" | "sourceProcessingFee");
1040
+ indexes: {
1041
+ by_id: ["_id"];
1042
+ by_creation_time: ["_creationTime"];
1043
+ by_import: ["openingCollection.operationKey", "_creationTime"];
1044
+ by_key: ["claimKey", "_creationTime"];
1045
+ by_scope: ["accountId", "scopeKey", "currency", "_creationTime"];
1046
+ by_sign: ["accountId", "scopeKey", "currency", "sign", "_creationTime"];
1047
+ };
1048
+ searchIndexes: {};
1049
+ vectorIndexes: {};
1050
+ };
1051
+ recoveryGroups: {
1052
+ document: {
1053
+ _creationTime: number;
1054
+ _id: import("convex/values").GenericId<"recoveryGroups">;
1055
+ accountId: string;
1056
+ amount: number;
1057
+ currency: string;
1058
+ groupKey: string;
1059
+ invoiceFunding?: {
1060
+ sourceChargeId: string;
1061
+ sourceGross: number;
1062
+ sourceProcessingFee: number;
1063
+ } | undefined;
1064
+ invoiceItemId?: string | undefined;
1065
+ maxCredit: number;
1066
+ maxDebit: number;
1067
+ pendingOperations: number;
1068
+ scopeKey: string;
1069
+ sourceGross?: number | undefined;
1070
+ sourceId: string;
1071
+ sourceKind: "invoice" | "settlement";
1072
+ sourceProcessingFee?: number | undefined;
1073
+ status: "collected" | "collecting" | "open" | "released" | "releasing" | "sealed";
1074
+ };
1075
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "amount" | "currency" | "groupKey" | "invoiceFunding" | "invoiceFunding.sourceChargeId" | "invoiceFunding.sourceGross" | "invoiceFunding.sourceProcessingFee" | "invoiceItemId" | "maxCredit" | "maxDebit" | "pendingOperations" | "scopeKey" | "sourceGross" | "sourceId" | "sourceKind" | "sourceProcessingFee" | "status");
1076
+ indexes: {
1077
+ by_id: ["_id"];
1078
+ by_creation_time: ["_creationTime"];
1079
+ by_key: ["groupKey", "_creationTime"];
1080
+ };
1081
+ searchIndexes: {};
1082
+ vectorIndexes: {};
1083
+ };
1084
+ recoveryReservations: {
1085
+ document: {
1086
+ _creationTime: number;
1087
+ _id: import("convex/values").GenericId<"recoveryReservations">;
1088
+ allocations: {
1089
+ amount: number;
1090
+ claimId: import("convex/values").GenericId<"recoveryClaims">;
1091
+ claimKey: string;
1092
+ }[];
1093
+ amount: number;
1094
+ groupKey: string;
1095
+ limit: number;
1096
+ operationKey: string;
1097
+ status: "collected" | "empty" | "released" | "reserved";
1098
+ };
1099
+ fieldPaths: "_id" | ("_creationTime" | "allocations" | "amount" | "groupKey" | "limit" | "operationKey" | "status");
1100
+ indexes: {
1101
+ by_id: ["_id"];
1102
+ by_creation_time: ["_creationTime"];
1103
+ by_group_status: ["groupKey", "status", "_creationTime"];
1104
+ by_key: ["operationKey", "_creationTime"];
1105
+ };
1106
+ searchIndexes: {};
1107
+ vectorIndexes: {};
1108
+ };
1109
+ refunds: {
1110
+ document: {
1111
+ _creationTime: number;
1112
+ _id: import("convex/values").GenericId<"refunds">;
1113
+ accountId?: string | undefined;
1114
+ amount: number;
1115
+ currency: string;
1116
+ failureReason?: string | undefined;
1117
+ metadata?: any;
1118
+ reason?: "duplicate" | "expired_uncaptured_charge" | "fraudulent" | "requested_by_customer" | undefined;
1119
+ status: "canceled" | "failed" | "pending" | "requires_action" | "succeeded";
1120
+ stripeChargeId?: string | undefined;
1121
+ stripePaymentIntentId?: string | undefined;
1122
+ stripeRefundId: string;
1123
+ };
1124
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "amount" | "currency" | "failureReason" | "metadata" | "reason" | "status" | "stripeChargeId" | "stripePaymentIntentId" | "stripeRefundId" | `metadata.${string}`);
1125
+ indexes: {
1126
+ by_id: ["_id"];
1127
+ by_creation_time: ["_creationTime"];
1128
+ by_account_id: ["accountId", "_creationTime"];
1129
+ by_account_id_and_status: ["accountId", "status", "_creationTime"];
1130
+ by_payment_intent_id_and_status: ["stripePaymentIntentId", "status", "_creationTime"];
1131
+ by_status: ["status", "_creationTime"];
1132
+ by_stripe_payment_intent_id: ["stripePaymentIntentId", "_creationTime"];
1133
+ by_stripe_refund_id: ["stripeRefundId", "_creationTime"];
1134
+ };
1135
+ searchIndexes: {};
1136
+ vectorIndexes: {};
1137
+ };
1138
+ settlementAllocations: {
1139
+ document: {
1140
+ _creationTime: number;
1141
+ _id: import("convex/values").GenericId<"settlementAllocations">;
1142
+ adjustmentAmount?: number | undefined;
1143
+ currency: string;
1144
+ gross: number;
1145
+ paymentId?: string | undefined;
1146
+ paymentIntentId?: string | undefined;
1147
+ platformNet: number;
1148
+ processingFee: number;
1149
+ sourceChargeId: string;
1150
+ sourceInvoiceId?: string | undefined;
1151
+ transfers: {
1152
+ amount: number;
1153
+ destinationAccountId: string;
1154
+ role: "affiliate" | "other" | "store";
1155
+ }[];
1156
+ };
1157
+ fieldPaths: "_id" | ("_creationTime" | "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers");
1158
+ indexes: {
1159
+ by_id: ["_id"];
1160
+ by_creation_time: ["_creationTime"];
1161
+ by_source_charge: ["sourceChargeId", "_creationTime"];
1162
+ };
1163
+ searchIndexes: {};
1164
+ vectorIndexes: {};
1165
+ };
1166
+ subscriptions: {
1167
+ document: {
1168
+ _creationTime: number;
1169
+ _id: import("convex/values").GenericId<"subscriptions">;
1170
+ accountId?: string | undefined;
1171
+ applicationFeeAmount?: number | undefined;
1172
+ applicationFeePercent?: number | undefined;
1173
+ cancelAtPeriodEnd: boolean;
1174
+ canceledAt?: string | undefined;
1175
+ chargeType?: "destination" | "separate" | undefined;
1176
+ currency?: string | undefined;
1177
+ currentPeriodEnd?: string | undefined;
1178
+ currentPeriodStart?: string | undefined;
1179
+ destinationAccountId?: string | undefined;
1180
+ feeCollectedAmount?: number | undefined;
1181
+ feeRefundedAmount?: number | undefined;
1182
+ isCollectionPaused?: boolean | undefined;
1183
+ isTrialing: boolean;
1184
+ metadata?: any;
1185
+ orgId?: string | undefined;
1186
+ priceId?: string | undefined;
1187
+ quantity?: number | undefined;
1188
+ splitRecipients?: {
1189
+ amount?: number | undefined;
1190
+ destinationAccountId: string;
1191
+ percent?: number | undefined;
1192
+ role: "affiliate" | "other" | "store";
1193
+ }[] | undefined;
1194
+ status: "active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid";
1195
+ stripeSubscriptionId: string;
1196
+ trialEnd?: string | undefined;
1197
+ trialStart?: string | undefined;
1198
+ userId: string;
1199
+ };
1200
+ fieldPaths: "_id" | ("_creationTime" | "accountId" | "applicationFeeAmount" | "applicationFeePercent" | "cancelAtPeriodEnd" | "canceledAt" | "chargeType" | "currency" | "currentPeriodEnd" | "currentPeriodStart" | "destinationAccountId" | "feeCollectedAmount" | "feeRefundedAmount" | "isCollectionPaused" | "isTrialing" | "metadata" | "orgId" | "priceId" | "quantity" | "splitRecipients" | "status" | "stripeSubscriptionId" | "trialEnd" | "trialStart" | "userId" | `metadata.${string}`);
1201
+ indexes: {
1202
+ by_id: ["_id"];
1203
+ by_creation_time: ["_creationTime"];
1204
+ by_account_id: ["accountId", "_creationTime"];
1205
+ by_account_status: ["accountId", "status", "_creationTime"];
1206
+ by_org_id: ["orgId", "_creationTime"];
1207
+ by_price_id: ["priceId", "_creationTime"];
1208
+ by_status: ["status", "_creationTime"];
1209
+ by_stripe_subscription_id: ["stripeSubscriptionId", "_creationTime"];
1210
+ by_user_id: ["userId", "_creationTime"];
1211
+ };
1212
+ searchIndexes: {};
1213
+ vectorIndexes: {};
1214
+ };
1215
+ transferReversalOps: {
1216
+ document: {
1217
+ _creationTime: number;
1218
+ _id: import("convex/values").GenericId<"transferReversalOps">;
1219
+ operationId: string;
1220
+ slices: {
1221
+ from: number;
1222
+ stripeTransferId: string;
1223
+ to: number;
1224
+ }[];
1225
+ sourceChargeId: string;
1226
+ };
1227
+ fieldPaths: "_id" | ("_creationTime" | "operationId" | "slices" | "sourceChargeId");
1228
+ indexes: {
1229
+ by_id: ["_id"];
1230
+ by_creation_time: ["_creationTime"];
1231
+ by_operation_id: ["operationId", "_creationTime"];
1232
+ };
1233
+ searchIndexes: {};
1234
+ vectorIndexes: {};
1235
+ };
1236
+ transfers: {
1237
+ document: {
1238
+ _creationTime: number;
1239
+ _id: import("convex/values").GenericId<"transfers">;
1240
+ amount: number;
1241
+ currency: string;
1242
+ destinationAccountId: string;
1243
+ metadata?: any;
1244
+ paymentId?: string | undefined;
1245
+ reinstatement?: boolean | undefined;
1246
+ reversalClaimedAmount?: number | undefined;
1247
+ reversalStatus?: "fully_reversed" | "partially_reversed" | undefined;
1248
+ reversedAmount?: number | undefined;
1249
+ role?: "affiliate" | "other" | "store" | undefined;
1250
+ sourceChargeId?: string | undefined;
1251
+ sourceInvoiceId?: string | undefined;
1252
+ status: "failed" | "paid" | "pending" | "reversed";
1253
+ stripeTransferId: string;
1254
+ totalsRecorded?: true | undefined;
1255
+ };
1256
+ fieldPaths: "_id" | ("_creationTime" | "amount" | "currency" | "destinationAccountId" | "metadata" | "paymentId" | "reinstatement" | "reversalClaimedAmount" | "reversalStatus" | "reversedAmount" | "role" | "sourceChargeId" | "sourceInvoiceId" | "status" | "stripeTransferId" | "totalsRecorded" | `metadata.${string}`);
1257
+ indexes: {
1258
+ by_id: ["_id"];
1259
+ by_creation_time: ["_creationTime"];
1260
+ by_account_totals_recorded: ["destinationAccountId", "totalsRecorded", "_creationTime"];
1261
+ by_destination_account_id: ["destinationAccountId", "_creationTime"];
1262
+ by_source_charge_id: ["sourceChargeId", "_creationTime"];
1263
+ by_stripe_transfer_id: ["stripeTransferId", "_creationTime"];
1264
+ };
1265
+ searchIndexes: {};
1266
+ vectorIndexes: {};
1267
+ };
1268
+ webhookEvents: {
1269
+ document: {
1270
+ _creationTime: number;
1271
+ _id: import("convex/values").GenericId<"webhookEvents">;
1272
+ eventType: string;
1273
+ lastError?: string | undefined;
1274
+ livemode?: boolean | undefined;
1275
+ processedAt: number;
1276
+ status: "failed" | "ignored" | "processed" | "processing";
1277
+ stripeEventId: string;
1278
+ };
1279
+ fieldPaths: "_id" | ("_creationTime" | "eventType" | "lastError" | "livemode" | "processedAt" | "status" | "stripeEventId");
1280
+ indexes: {
1281
+ by_id: ["_id"];
1282
+ by_creation_time: ["_creationTime"];
1283
+ by_status: ["status", "_creationTime"];
1284
+ by_stripeEventId: ["stripeEventId", "_creationTime"];
1285
+ };
1286
+ searchIndexes: {};
1287
+ vectorIndexes: {};
1288
+ };
1289
+ }>, "public", Record<string, any>>;
1290
+ //# sourceMappingURL=triggers.d.ts.map