@fantastic.dev/better-stripe 0.41.0 → 0.43.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 (209) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +1 -1
  3. package/dist/client/balanceFundingWorkflow/client.d.ts +172 -0
  4. package/dist/client/balanceFundingWorkflow/client.d.ts.map +1 -0
  5. package/dist/client/balanceFundingWorkflow/client.js +289 -0
  6. package/dist/client/balanceFundingWorkflow/client.js.map +1 -0
  7. package/dist/client/billing/balanceFunding.d.ts +5 -0
  8. package/dist/client/billing/balanceFunding.d.ts.map +1 -1
  9. package/dist/client/billing/balanceFunding.js +30 -0
  10. package/dist/client/billing/balanceFunding.js.map +1 -1
  11. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +1388 -2
  12. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
  13. package/dist/client/connect/payoutExecutionTestHelpers.d.ts +710 -17
  14. package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
  15. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +1420 -34
  16. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
  17. package/dist/client/connect/payoutSyncTestHelpers.d.ts +694 -1
  18. package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
  19. package/dist/client/costRecovery-invoices.d.ts +3 -2
  20. package/dist/client/costRecovery-invoices.d.ts.map +1 -1
  21. package/dist/client/costRecovery-invoices.js +10 -5
  22. package/dist/client/costRecovery-invoices.js.map +1 -1
  23. package/dist/client/costRecovery.d.ts +4 -2
  24. package/dist/client/costRecovery.d.ts.map +1 -1
  25. package/dist/client/costRecovery.js +2 -2
  26. package/dist/client/costRecovery.js.map +1 -1
  27. package/dist/client/index.d.ts +3 -0
  28. package/dist/client/index.d.ts.map +1 -1
  29. package/dist/client/index.js +4 -0
  30. package/dist/client/index.js.map +1 -1
  31. package/dist/client/processingCostReconciliation/client.d.ts +14 -0
  32. package/dist/client/processingCostReconciliation/client.d.ts.map +1 -0
  33. package/dist/client/processingCostReconciliation/client.js +35 -0
  34. package/dist/client/processingCostReconciliation/client.js.map +1 -0
  35. package/dist/client/processingCostReconciliation/contracts.d.ts +172 -0
  36. package/dist/client/processingCostReconciliation/contracts.d.ts.map +1 -0
  37. package/dist/client/processingCostReconciliation/contracts.js +55 -0
  38. package/dist/client/processingCostReconciliation/contracts.js.map +1 -0
  39. package/dist/client/processingCostReconciliation/invoiceFunding.d.ts +15 -0
  40. package/dist/client/processingCostReconciliation/invoiceFunding.d.ts.map +1 -0
  41. package/dist/client/processingCostReconciliation/invoiceFunding.js +195 -0
  42. package/dist/client/processingCostReconciliation/invoiceFunding.js.map +1 -0
  43. package/dist/client/processingCostReconciliation/provider.d.ts +9 -0
  44. package/dist/client/processingCostReconciliation/provider.d.ts.map +1 -0
  45. package/dist/client/processingCostReconciliation/provider.js +148 -0
  46. package/dist/client/processingCostReconciliation/provider.js.map +1 -0
  47. package/dist/client/settlement/processingCostHistory.d.ts +12 -0
  48. package/dist/client/settlement/processingCostHistory.d.ts.map +1 -0
  49. package/dist/client/settlement/processingCostHistory.js +20 -0
  50. package/dist/client/settlement/processingCostHistory.js.map +1 -0
  51. package/dist/client/settlement/processingCosts.d.ts +3 -0
  52. package/dist/client/settlement/processingCosts.d.ts.map +1 -1
  53. package/dist/client/settlement/processingCosts.js +27 -7
  54. package/dist/client/settlement/processingCosts.js.map +1 -1
  55. package/dist/component/_generated/api.d.ts +36 -0
  56. package/dist/component/_generated/api.d.ts.map +1 -1
  57. package/dist/component/_generated/api.js.map +1 -1
  58. package/dist/component/_generated/component.d.ts +988 -0
  59. package/dist/component/_generated/component.d.ts.map +1 -1
  60. package/dist/component/balanceFunding/helpers.d.ts +42 -0
  61. package/dist/component/balanceFunding/helpers.d.ts.map +1 -1
  62. package/dist/component/balanceFunding/internal/actions.d.ts +39 -0
  63. package/dist/component/balanceFunding/internal/actions.d.ts.map +1 -0
  64. package/dist/component/balanceFunding/internal/actions.js +80 -0
  65. package/dist/component/balanceFunding/internal/actions.js.map +1 -0
  66. package/dist/component/balanceFunding/internal/mutations.d.ts +55 -0
  67. package/dist/component/balanceFunding/internal/mutations.d.ts.map +1 -0
  68. package/dist/component/balanceFunding/internal/mutations.js +54 -0
  69. package/dist/component/balanceFunding/internal/mutations.js.map +1 -0
  70. package/dist/component/balanceFunding/internal/queries.d.ts +116 -0
  71. package/dist/component/balanceFunding/internal/queries.d.ts.map +1 -0
  72. package/dist/component/balanceFunding/internal/queries.js +35 -0
  73. package/dist/component/balanceFunding/internal/queries.js.map +1 -0
  74. package/dist/component/balanceFunding/internal/workflow.d.ts +10 -0
  75. package/dist/component/balanceFunding/internal/workflow.d.ts.map +1 -0
  76. package/dist/component/balanceFunding/internal/workflow.js +31 -0
  77. package/dist/component/balanceFunding/internal/workflow.js.map +1 -0
  78. package/dist/component/balanceFunding/lifecycleHandlers.d.ts +126 -0
  79. package/dist/component/balanceFunding/lifecycleHandlers.d.ts.map +1 -1
  80. package/dist/component/balanceFunding/mutations.d.ts +419 -16
  81. package/dist/component/balanceFunding/mutations.d.ts.map +1 -1
  82. package/dist/component/balanceFunding/mutations.js +24 -0
  83. package/dist/component/balanceFunding/mutations.js.map +1 -1
  84. package/dist/component/balanceFunding/preparationHandlers.d.ts +42 -0
  85. package/dist/component/balanceFunding/preparationHandlers.d.ts.map +1 -1
  86. package/dist/component/balanceFunding/queries.d.ts +78 -0
  87. package/dist/component/balanceFunding/queries.d.ts.map +1 -1
  88. package/dist/component/balanceFunding/queries.js +35 -0
  89. package/dist/component/balanceFunding/queries.js.map +1 -1
  90. package/dist/component/balanceFunding/receipt.d.ts +5 -0
  91. package/dist/component/balanceFunding/receipt.d.ts.map +1 -0
  92. package/dist/component/balanceFunding/receipt.js +37 -0
  93. package/dist/component/balanceFunding/receipt.js.map +1 -0
  94. package/dist/component/balanceFunding/schema.d.ts +506 -2
  95. package/dist/component/balanceFunding/schema.d.ts.map +1 -1
  96. package/dist/component/balanceFunding/schema.js +2 -0
  97. package/dist/component/balanceFunding/schema.js.map +1 -1
  98. package/dist/component/balanceFunding/stateHandlers.d.ts +42 -0
  99. package/dist/component/balanceFunding/stateHandlers.d.ts.map +1 -1
  100. package/dist/component/balanceFunding/workflowControl.d.ts +19 -0
  101. package/dist/component/balanceFunding/workflowControl.d.ts.map +1 -0
  102. package/dist/component/balanceFunding/workflowControl.js +149 -0
  103. package/dist/component/balanceFunding/workflowControl.js.map +1 -0
  104. package/dist/component/balanceFunding/workflowSchema.d.ts +356 -0
  105. package/dist/component/balanceFunding/workflowSchema.d.ts.map +1 -0
  106. package/dist/component/balanceFunding/workflowSchema.js +48 -0
  107. package/dist/component/balanceFunding/workflowSchema.js.map +1 -0
  108. package/dist/component/balanceFunding/workflowState.d.ts +157 -0
  109. package/dist/component/balanceFunding/workflowState.d.ts.map +1 -0
  110. package/dist/component/balanceFunding/workflowState.js +194 -0
  111. package/dist/component/balanceFunding/workflowState.js.map +1 -0
  112. package/dist/component/balanceFunding/workflowValidators.d.ts +306 -0
  113. package/dist/component/balanceFunding/workflowValidators.d.ts.map +1 -0
  114. package/dist/component/balanceFunding/workflowValidators.js +27 -0
  115. package/dist/component/balanceFunding/workflowValidators.js.map +1 -0
  116. package/dist/component/earnings/triggers.d.ts +388 -2
  117. package/dist/component/earnings/triggers.d.ts.map +1 -1
  118. package/dist/component/payoutRelease/queries.d.ts +2 -2
  119. package/dist/component/payoutRelease/queries.d.ts.map +1 -1
  120. package/dist/component/processingCostReconciliation/adoption.d.ts +29 -0
  121. package/dist/component/processingCostReconciliation/adoption.d.ts.map +1 -0
  122. package/dist/component/processingCostReconciliation/adoption.js +58 -0
  123. package/dist/component/processingCostReconciliation/adoption.js.map +1 -0
  124. package/dist/component/processingCostReconciliation/bridge.d.ts +45 -0
  125. package/dist/component/processingCostReconciliation/bridge.d.ts.map +1 -0
  126. package/dist/component/processingCostReconciliation/bridge.js +41 -0
  127. package/dist/component/processingCostReconciliation/bridge.js.map +1 -0
  128. package/dist/component/processingCostReconciliation/helpers.d.ts +327 -0
  129. package/dist/component/processingCostReconciliation/helpers.d.ts.map +1 -0
  130. package/dist/component/processingCostReconciliation/helpers.js +39 -0
  131. package/dist/component/processingCostReconciliation/helpers.js.map +1 -0
  132. package/dist/component/processingCostReconciliation/mutations.d.ts +303 -0
  133. package/dist/component/processingCostReconciliation/mutations.d.ts.map +1 -0
  134. package/dist/component/processingCostReconciliation/mutations.js +121 -0
  135. package/dist/component/processingCostReconciliation/mutations.js.map +1 -0
  136. package/dist/component/processingCostReconciliation/queries.d.ts +422 -0
  137. package/dist/component/processingCostReconciliation/queries.d.ts.map +1 -0
  138. package/dist/component/processingCostReconciliation/queries.js +19 -0
  139. package/dist/component/processingCostReconciliation/queries.js.map +1 -0
  140. package/dist/component/processingCostReconciliation/rollback.d.ts +21 -0
  141. package/dist/component/processingCostReconciliation/rollback.d.ts.map +1 -0
  142. package/dist/component/processingCostReconciliation/rollback.js +54 -0
  143. package/dist/component/processingCostReconciliation/rollback.js.map +1 -0
  144. package/dist/component/processingCostReconciliation/schema.d.ts +2460 -0
  145. package/dist/component/processingCostReconciliation/schema.d.ts.map +1 -0
  146. package/dist/component/processingCostReconciliation/schema.js +137 -0
  147. package/dist/component/processingCostReconciliation/schema.js.map +1 -0
  148. package/dist/component/processingCostReconciliation/steps.d.ts +306 -0
  149. package/dist/component/processingCostReconciliation/steps.d.ts.map +1 -0
  150. package/dist/component/processingCostReconciliation/steps.js +149 -0
  151. package/dist/component/processingCostReconciliation/steps.js.map +1 -0
  152. package/dist/component/processingCostReconciliation/validation.d.ts +13 -0
  153. package/dist/component/processingCostReconciliation/validation.d.ts.map +1 -0
  154. package/dist/component/processingCostReconciliation/validation.js +61 -0
  155. package/dist/component/processingCostReconciliation/validation.js.map +1 -0
  156. package/dist/component/processingCostReconciliation/workflow.d.ts +105 -0
  157. package/dist/component/processingCostReconciliation/workflow.d.ts.map +1 -0
  158. package/dist/component/processingCostReconciliation/workflow.js +33 -0
  159. package/dist/component/processingCostReconciliation/workflow.js.map +1 -0
  160. package/dist/component/schema.d.ts +694 -1
  161. package/dist/component/schema.js +2 -0
  162. package/dist/component/schema.js.map +1 -1
  163. package/package.json +1 -1
  164. package/src/client/balanceFundingWorkflow/capture.test.ts +144 -0
  165. package/src/client/balanceFundingWorkflow/client.ts +419 -0
  166. package/src/client/billing/balanceFunding.ts +50 -0
  167. package/src/client/costRecovery-invoices.ts +19 -4
  168. package/src/client/costRecovery.ts +4 -2
  169. package/src/client/index.ts +15 -0
  170. package/src/client/processingCostReconciliation/client.ts +75 -0
  171. package/src/client/processingCostReconciliation/contracts.ts +176 -0
  172. package/src/client/processingCostReconciliation/invoiceFunding.ts +270 -0
  173. package/src/client/processingCostReconciliation/invoiceProvider.test.ts +353 -0
  174. package/src/client/processingCostReconciliation/provider.test.ts +324 -0
  175. package/src/client/processingCostReconciliation/provider.ts +178 -0
  176. package/src/client/settlement/processingCostHistory.ts +31 -0
  177. package/src/client/settlement/processingCosts.ts +50 -15
  178. package/src/component/_generated/api.ts +36 -0
  179. package/src/component/_generated/component.ts +1094 -0
  180. package/src/component/balanceFunding/internal/actions.ts +107 -0
  181. package/src/component/balanceFunding/internal/mutations.ts +66 -0
  182. package/src/component/balanceFunding/internal/queries.ts +34 -0
  183. package/src/component/balanceFunding/internal/workflow.ts +49 -0
  184. package/src/component/balanceFunding/mutations.ts +34 -0
  185. package/src/component/balanceFunding/queries.ts +38 -0
  186. package/src/component/balanceFunding/receipt.ts +48 -0
  187. package/src/component/balanceFunding/schema.ts +2 -0
  188. package/src/component/balanceFunding/scopeLookup.test.ts +94 -0
  189. package/src/component/balanceFunding/workflow.fixtures.ts +366 -0
  190. package/src/component/balanceFunding/workflow.test.ts +552 -0
  191. package/src/component/balanceFunding/workflowControl.ts +198 -0
  192. package/src/component/balanceFunding/workflowSchema.ts +78 -0
  193. package/src/component/balanceFunding/workflowState.ts +285 -0
  194. package/src/component/balanceFunding/workflowValidators.ts +40 -0
  195. package/src/component/processingCostReconciliation/adoption.test.ts +206 -0
  196. package/src/component/processingCostReconciliation/adoption.ts +77 -0
  197. package/src/component/processingCostReconciliation/bridge.ts +50 -0
  198. package/src/component/processingCostReconciliation/helpers.ts +55 -0
  199. package/src/component/processingCostReconciliation/invoice.test.ts +152 -0
  200. package/src/component/processingCostReconciliation/mutations.ts +148 -0
  201. package/src/component/processingCostReconciliation/queries.ts +18 -0
  202. package/src/component/processingCostReconciliation/rollback.ts +72 -0
  203. package/src/component/processingCostReconciliation/schema.ts +191 -0
  204. package/src/component/processingCostReconciliation/state.test.ts +407 -0
  205. package/src/component/processingCostReconciliation/steps.ts +168 -0
  206. package/src/component/processingCostReconciliation/validation.ts +79 -0
  207. package/src/component/processingCostReconciliation/workflow.test.ts +329 -0
  208. package/src/component/processingCostReconciliation/workflow.ts +50 -0
  209. package/src/component/schema.ts +2 -0
@@ -14,6 +14,517 @@ type Sync = (stripe: Stripe, component: Component, ctx: RunCtx, opts: {
14
14
  export declare function operation(): Promise<Sync>;
15
15
  export declare function setup(scope?: Scope): Promise<{
16
16
  t: import("convex-test").TestConvex<import("convex/server").SchemaDefinition<{
17
+ processingCostReconciliationOperations: import("convex/server").TableDefinition<import("convex/values").VObject<{
18
+ accountId: string;
19
+ claimKey: string;
20
+ currency: string;
21
+ definitionVersion: number;
22
+ expectedRevision: number;
23
+ failure?: {
24
+ reason: "fee_pending" | "history_incomplete" | "provider_pending";
25
+ retryable: true;
26
+ status: "not_ready";
27
+ } | {
28
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
29
+ retryable: false;
30
+ status: "conflict";
31
+ } | {
32
+ reason: "currency_mismatch" | "invalid_scope" | "payment_not_payable" | "policy_invalid" | "unsupported_source";
33
+ retryable: false;
34
+ status: "rejected";
35
+ } | {
36
+ reason: "history_incomplete" | "provider_outcome_unknown";
37
+ retryable: false;
38
+ status: "unknown";
39
+ } | undefined;
40
+ importHook?: string | undefined;
41
+ maxAttempts: number;
42
+ policy: {
43
+ liability: {
44
+ disputeCosts: "all" | "none";
45
+ processingCosts: "all" | "none" | "uncovered";
46
+ };
47
+ rounding: "ceil" | "floor" | "nearest";
48
+ sellingFee: number;
49
+ };
50
+ projection?: string | undefined;
51
+ provider: string;
52
+ providerApiVersion: string;
53
+ requestKey: string;
54
+ result?: {
55
+ claim: {
56
+ _creationTime: number;
57
+ _id: import("convex/values").GenericId<"recoveryClaims">;
58
+ accountId: string;
59
+ amountDue: number;
60
+ claimKey: string;
61
+ collectedAmount: number;
62
+ currency: string;
63
+ openingCollection?: {
64
+ amountDue: number;
65
+ collectedAmount: number;
66
+ operationKey: string;
67
+ revision: number;
68
+ } | undefined;
69
+ outstanding: number;
70
+ reservedAmount: number;
71
+ revision: number;
72
+ scopeKey: string;
73
+ sign: "negative" | "positive" | "zero";
74
+ sourceChargeId: string;
75
+ sourceGross: number;
76
+ sourceProcessingFee: number;
77
+ };
78
+ deficit: {
79
+ amountDue: number;
80
+ currency: string;
81
+ disputeLiability: number;
82
+ processingLiability: number;
83
+ retainedFee: number;
84
+ };
85
+ observation: {
86
+ currency: string;
87
+ disputeFees: number;
88
+ gross: number;
89
+ originalProcessingFee: number;
90
+ paymentIntentId: string;
91
+ principalReturned: number;
92
+ processingFee: number;
93
+ provenance: {
94
+ customerAccountId: string;
95
+ invoiceId: string;
96
+ invoicePaymentId: string;
97
+ recoveryInvoiceItemId?: string | undefined;
98
+ stripePriceId?: string | undefined;
99
+ stripeProductId?: string | undefined;
100
+ subscriptionId?: string | undefined;
101
+ };
102
+ sourceChargeId: string;
103
+ };
104
+ rollbackClaim?: {
105
+ _creationTime: number;
106
+ _id: import("convex/values").GenericId<"recoveryClaims">;
107
+ accountId: string;
108
+ amountDue: number;
109
+ claimKey: string;
110
+ collectedAmount: number;
111
+ currency: string;
112
+ openingCollection?: {
113
+ amountDue: number;
114
+ collectedAmount: number;
115
+ operationKey: string;
116
+ revision: number;
117
+ } | undefined;
118
+ outstanding: number;
119
+ reservedAmount: number;
120
+ revision: number;
121
+ scopeKey: string;
122
+ sign: "negative" | "positive" | "zero";
123
+ sourceChargeId: string;
124
+ sourceGross: number;
125
+ sourceProcessingFee: number;
126
+ } | undefined;
127
+ } | undefined;
128
+ retryDelayMs: number;
129
+ rollback?: {
130
+ expectedRevision: number;
131
+ groupKey: string;
132
+ } | undefined;
133
+ scopeKey: string;
134
+ source: {
135
+ customerAccountId: string;
136
+ gross: number;
137
+ invoiceId?: string | undefined;
138
+ kind: "sale";
139
+ paymentIntentId: string;
140
+ stripeAccountId?: string | undefined;
141
+ stripePriceId?: string | undefined;
142
+ stripeProductId?: string | undefined;
143
+ subscriptionId?: string | undefined;
144
+ } | {
145
+ gross: number;
146
+ groupKey: string;
147
+ kind: "invoice_recovery";
148
+ paymentIntentId: string;
149
+ };
150
+ status: "completed" | "conflict" | "queued" | "rejected" | "running" | "unknown" | "waiting";
151
+ version: number;
152
+ workflowId?: string | undefined;
153
+ }, {
154
+ accountId: import("convex/values").VString<string, "required">;
155
+ scopeKey: import("convex/values").VString<string, "required">;
156
+ currency: import("convex/values").VString<string, "required">;
157
+ claimKey: import("convex/values").VString<string, "required">;
158
+ source: import("convex/values").VUnion<{
159
+ customerAccountId: string;
160
+ gross: number;
161
+ invoiceId?: string | undefined;
162
+ kind: "sale";
163
+ paymentIntentId: string;
164
+ stripeAccountId?: string | undefined;
165
+ stripePriceId?: string | undefined;
166
+ stripeProductId?: string | undefined;
167
+ subscriptionId?: string | undefined;
168
+ } | {
169
+ gross: number;
170
+ groupKey: string;
171
+ kind: "invoice_recovery";
172
+ paymentIntentId: string;
173
+ }, [import("convex/values").VObject<{
174
+ customerAccountId: string;
175
+ gross: number;
176
+ invoiceId?: string | undefined;
177
+ kind: "sale";
178
+ paymentIntentId: string;
179
+ stripeAccountId?: string | undefined;
180
+ stripePriceId?: string | undefined;
181
+ stripeProductId?: string | undefined;
182
+ subscriptionId?: string | undefined;
183
+ }, {
184
+ kind: import("convex/values").VLiteral<"sale", "required">;
185
+ paymentIntentId: import("convex/values").VString<string, "required">;
186
+ gross: import("convex/values").VFloat64<number, "required">;
187
+ customerAccountId: import("convex/values").VString<string, "required">;
188
+ invoiceId: import("convex/values").VString<string | undefined, "optional">;
189
+ subscriptionId: import("convex/values").VString<string | undefined, "optional">;
190
+ stripeAccountId: import("convex/values").VString<string | undefined, "optional">;
191
+ stripePriceId: import("convex/values").VString<string | undefined, "optional">;
192
+ stripeProductId: import("convex/values").VString<string | undefined, "optional">;
193
+ }, "required", "customerAccountId" | "gross" | "invoiceId" | "kind" | "paymentIntentId" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId">, import("convex/values").VObject<{
194
+ gross: number;
195
+ groupKey: string;
196
+ kind: "invoice_recovery";
197
+ paymentIntentId: string;
198
+ }, {
199
+ kind: import("convex/values").VLiteral<"invoice_recovery", "required">;
200
+ paymentIntentId: import("convex/values").VString<string, "required">;
201
+ gross: import("convex/values").VFloat64<number, "required">;
202
+ groupKey: import("convex/values").VString<string, "required">;
203
+ }, "required", "gross" | "groupKey" | "kind" | "paymentIntentId">], "required", "customerAccountId" | "gross" | "groupKey" | "invoiceId" | "kind" | "paymentIntentId" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId">;
204
+ policy: import("convex/values").VObject<{
205
+ liability: {
206
+ disputeCosts: "all" | "none";
207
+ processingCosts: "all" | "none" | "uncovered";
208
+ };
209
+ rounding: "ceil" | "floor" | "nearest";
210
+ sellingFee: number;
211
+ }, {
212
+ sellingFee: import("convex/values").VFloat64<number, "required">;
213
+ liability: import("convex/values").VObject<{
214
+ disputeCosts: "all" | "none";
215
+ processingCosts: "all" | "none" | "uncovered";
216
+ }, {
217
+ processingCosts: import("convex/values").VUnion<"all" | "none" | "uncovered", [import("convex/values").VLiteral<"uncovered", "required">, import("convex/values").VLiteral<"all", "required">, import("convex/values").VLiteral<"none", "required">], "required", never>;
218
+ disputeCosts: import("convex/values").VUnion<"all" | "none", [import("convex/values").VLiteral<"all", "required">, import("convex/values").VLiteral<"none", "required">], "required", never>;
219
+ }, "required", "disputeCosts" | "processingCosts">;
220
+ rounding: import("convex/values").VUnion<"ceil" | "floor" | "nearest", [import("convex/values").VLiteral<"nearest", "required">, import("convex/values").VLiteral<"floor", "required">, import("convex/values").VLiteral<"ceil", "required">], "required", never>;
221
+ }, "required", "liability" | "liability.disputeCosts" | "liability.processingCosts" | "rounding" | "sellingFee">;
222
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
223
+ rollback: import("convex/values").VObject<{
224
+ expectedRevision: number;
225
+ groupKey: string;
226
+ } | undefined, {
227
+ groupKey: import("convex/values").VString<string, "required">;
228
+ expectedRevision: import("convex/values").VFloat64<number, "required">;
229
+ }, "optional", "expectedRevision" | "groupKey">;
230
+ provider: import("convex/values").VString<string, "required">;
231
+ projection: import("convex/values").VString<string | undefined, "optional">;
232
+ importHook: import("convex/values").VString<string | undefined, "optional">;
233
+ providerApiVersion: import("convex/values").VString<string, "required">;
234
+ definitionVersion: import("convex/values").VFloat64<number, "required">;
235
+ maxAttempts: import("convex/values").VFloat64<number, "required">;
236
+ retryDelayMs: import("convex/values").VFloat64<number, "required">;
237
+ requestKey: import("convex/values").VString<string, "required">;
238
+ version: import("convex/values").VFloat64<number, "required">;
239
+ workflowId: import("convex/values").VString<string | undefined, "optional">;
240
+ status: import("convex/values").VUnion<"completed" | "conflict" | "queued" | "rejected" | "running" | "unknown" | "waiting", [import("convex/values").VLiteral<"queued", "required">, import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"waiting", "required">, import("convex/values").VLiteral<"completed", "required">, import("convex/values").VLiteral<"conflict", "required">, import("convex/values").VLiteral<"rejected", "required">, import("convex/values").VLiteral<"unknown", "required">], "required", never>;
241
+ failure: import("convex/values").VUnion<{
242
+ reason: "fee_pending" | "history_incomplete" | "provider_pending";
243
+ retryable: true;
244
+ status: "not_ready";
245
+ } | {
246
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
247
+ retryable: false;
248
+ status: "conflict";
249
+ } | {
250
+ reason: "currency_mismatch" | "invalid_scope" | "payment_not_payable" | "policy_invalid" | "unsupported_source";
251
+ retryable: false;
252
+ status: "rejected";
253
+ } | {
254
+ reason: "history_incomplete" | "provider_outcome_unknown";
255
+ retryable: false;
256
+ status: "unknown";
257
+ } | undefined, [import("convex/values").VObject<{
258
+ reason: "fee_pending" | "history_incomplete" | "provider_pending";
259
+ retryable: true;
260
+ status: "not_ready";
261
+ }, {
262
+ status: import("convex/values").VLiteral<"not_ready", "required">;
263
+ reason: import("convex/values").VUnion<"fee_pending" | "history_incomplete" | "provider_pending", [import("convex/values").VLiteral<"provider_pending", "required">, import("convex/values").VLiteral<"fee_pending", "required">, import("convex/values").VLiteral<"history_incomplete", "required">], "required", never>;
264
+ retryable: import("convex/values").VLiteral<true, "required">;
265
+ }, "required", "reason" | "retryable" | "status">, import("convex/values").VObject<{
266
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
267
+ retryable: false;
268
+ status: "conflict";
269
+ }, {
270
+ status: import("convex/values").VLiteral<"conflict", "required">;
271
+ reason: import("convex/values").VUnion<"identity_changed" | "revision_changed" | "scope_busy", [import("convex/values").VLiteral<"scope_busy", "required">, import("convex/values").VLiteral<"revision_changed", "required">, import("convex/values").VLiteral<"identity_changed", "required">], "required", never>;
272
+ retryable: import("convex/values").VLiteral<false, "required">;
273
+ }, "required", "reason" | "retryable" | "status">, import("convex/values").VObject<{
274
+ reason: "currency_mismatch" | "invalid_scope" | "payment_not_payable" | "policy_invalid" | "unsupported_source";
275
+ retryable: false;
276
+ status: "rejected";
277
+ }, {
278
+ status: import("convex/values").VLiteral<"rejected", "required">;
279
+ reason: import("convex/values").VUnion<"currency_mismatch" | "invalid_scope" | "payment_not_payable" | "policy_invalid" | "unsupported_source", [import("convex/values").VLiteral<"invalid_scope", "required">, import("convex/values").VLiteral<"unsupported_source", "required">, import("convex/values").VLiteral<"policy_invalid", "required">, import("convex/values").VLiteral<"payment_not_payable", "required">, import("convex/values").VLiteral<"currency_mismatch", "required">], "required", never>;
280
+ retryable: import("convex/values").VLiteral<false, "required">;
281
+ }, "required", "reason" | "retryable" | "status">, import("convex/values").VObject<{
282
+ reason: "history_incomplete" | "provider_outcome_unknown";
283
+ retryable: false;
284
+ status: "unknown";
285
+ }, {
286
+ status: import("convex/values").VLiteral<"unknown", "required">;
287
+ reason: import("convex/values").VUnion<"history_incomplete" | "provider_outcome_unknown", [import("convex/values").VLiteral<"provider_outcome_unknown", "required">, import("convex/values").VLiteral<"history_incomplete", "required">], "required", never>;
288
+ retryable: import("convex/values").VLiteral<false, "required">;
289
+ }, "required", "reason" | "retryable" | "status">], "optional", "reason" | "retryable" | "status">;
290
+ result: import("convex/values").VObject<{
291
+ claim: {
292
+ _creationTime: number;
293
+ _id: import("convex/values").GenericId<"recoveryClaims">;
294
+ accountId: string;
295
+ amountDue: number;
296
+ claimKey: string;
297
+ collectedAmount: number;
298
+ currency: string;
299
+ openingCollection?: {
300
+ amountDue: number;
301
+ collectedAmount: number;
302
+ operationKey: string;
303
+ revision: number;
304
+ } | undefined;
305
+ outstanding: number;
306
+ reservedAmount: number;
307
+ revision: number;
308
+ scopeKey: string;
309
+ sign: "negative" | "positive" | "zero";
310
+ sourceChargeId: string;
311
+ sourceGross: number;
312
+ sourceProcessingFee: number;
313
+ };
314
+ deficit: {
315
+ amountDue: number;
316
+ currency: string;
317
+ disputeLiability: number;
318
+ processingLiability: number;
319
+ retainedFee: number;
320
+ };
321
+ observation: {
322
+ currency: string;
323
+ disputeFees: number;
324
+ gross: number;
325
+ originalProcessingFee: number;
326
+ paymentIntentId: string;
327
+ principalReturned: number;
328
+ processingFee: number;
329
+ provenance: {
330
+ customerAccountId: string;
331
+ invoiceId: string;
332
+ invoicePaymentId: string;
333
+ recoveryInvoiceItemId?: string | undefined;
334
+ stripePriceId?: string | undefined;
335
+ stripeProductId?: string | undefined;
336
+ subscriptionId?: string | undefined;
337
+ };
338
+ sourceChargeId: string;
339
+ };
340
+ rollbackClaim?: {
341
+ _creationTime: number;
342
+ _id: import("convex/values").GenericId<"recoveryClaims">;
343
+ accountId: string;
344
+ amountDue: number;
345
+ claimKey: string;
346
+ collectedAmount: number;
347
+ currency: string;
348
+ openingCollection?: {
349
+ amountDue: number;
350
+ collectedAmount: number;
351
+ operationKey: string;
352
+ revision: number;
353
+ } | undefined;
354
+ outstanding: number;
355
+ reservedAmount: number;
356
+ revision: number;
357
+ scopeKey: string;
358
+ sign: "negative" | "positive" | "zero";
359
+ sourceChargeId: string;
360
+ sourceGross: number;
361
+ sourceProcessingFee: number;
362
+ } | undefined;
363
+ } | undefined, {
364
+ claim: import("convex/values").VObject<{
365
+ _creationTime: number;
366
+ _id: import("convex/values").GenericId<"recoveryClaims">;
367
+ accountId: string;
368
+ amountDue: number;
369
+ claimKey: string;
370
+ collectedAmount: number;
371
+ currency: string;
372
+ openingCollection?: {
373
+ amountDue: number;
374
+ collectedAmount: number;
375
+ operationKey: string;
376
+ revision: number;
377
+ } | undefined;
378
+ outstanding: number;
379
+ reservedAmount: number;
380
+ revision: number;
381
+ scopeKey: string;
382
+ sign: "negative" | "positive" | "zero";
383
+ sourceChargeId: string;
384
+ sourceGross: number;
385
+ sourceProcessingFee: number;
386
+ }, {
387
+ accountId: import("convex/values").VString<string, "required">;
388
+ scopeKey: import("convex/values").VString<string, "required">;
389
+ currency: import("convex/values").VString<string, "required">;
390
+ claimKey: import("convex/values").VString<string, "required">;
391
+ sourceChargeId: import("convex/values").VString<string, "required">;
392
+ sourceGross: import("convex/values").VFloat64<number, "required">;
393
+ sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
394
+ amountDue: import("convex/values").VFloat64<number, "required">;
395
+ revision: import("convex/values").VFloat64<number, "required">;
396
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
397
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
398
+ outstanding: import("convex/values").VFloat64<number, "required">;
399
+ sign: import("convex/values").VUnion<"negative" | "positive" | "zero", [import("convex/values").VLiteral<"positive", "required">, import("convex/values").VLiteral<"negative", "required">, import("convex/values").VLiteral<"zero", "required">], "required", never>;
400
+ openingCollection: import("convex/values").VObject<{
401
+ amountDue: number;
402
+ collectedAmount: number;
403
+ operationKey: string;
404
+ revision: number;
405
+ } | undefined, {
406
+ operationKey: import("convex/values").VString<string, "required">;
407
+ amountDue: import("convex/values").VFloat64<number, "required">;
408
+ revision: import("convex/values").VFloat64<number, "required">;
409
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
410
+ }, "optional", "amountDue" | "collectedAmount" | "operationKey" | "revision">;
411
+ _id: import("convex/values").VId<import("convex/values").GenericId<"recoveryClaims">, "required">;
412
+ _creationTime: import("convex/values").VFloat64<number, "required">;
413
+ }, "required", "_creationTime" | "_id" | "accountId" | "amountDue" | "claimKey" | "collectedAmount" | "currency" | "openingCollection" | "openingCollection.amountDue" | "openingCollection.collectedAmount" | "openingCollection.operationKey" | "openingCollection.revision" | "outstanding" | "reservedAmount" | "revision" | "scopeKey" | "sign" | "sourceChargeId" | "sourceGross" | "sourceProcessingFee">;
414
+ rollbackClaim: import("convex/values").VObject<{
415
+ _creationTime: number;
416
+ _id: import("convex/values").GenericId<"recoveryClaims">;
417
+ accountId: string;
418
+ amountDue: number;
419
+ claimKey: string;
420
+ collectedAmount: number;
421
+ currency: string;
422
+ openingCollection?: {
423
+ amountDue: number;
424
+ collectedAmount: number;
425
+ operationKey: string;
426
+ revision: number;
427
+ } | undefined;
428
+ outstanding: number;
429
+ reservedAmount: number;
430
+ revision: number;
431
+ scopeKey: string;
432
+ sign: "negative" | "positive" | "zero";
433
+ sourceChargeId: string;
434
+ sourceGross: number;
435
+ sourceProcessingFee: number;
436
+ } | undefined, {
437
+ accountId: import("convex/values").VString<string, "required">;
438
+ scopeKey: import("convex/values").VString<string, "required">;
439
+ currency: import("convex/values").VString<string, "required">;
440
+ claimKey: import("convex/values").VString<string, "required">;
441
+ sourceChargeId: import("convex/values").VString<string, "required">;
442
+ sourceGross: import("convex/values").VFloat64<number, "required">;
443
+ sourceProcessingFee: import("convex/values").VFloat64<number, "required">;
444
+ amountDue: import("convex/values").VFloat64<number, "required">;
445
+ revision: import("convex/values").VFloat64<number, "required">;
446
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
447
+ reservedAmount: import("convex/values").VFloat64<number, "required">;
448
+ outstanding: import("convex/values").VFloat64<number, "required">;
449
+ sign: import("convex/values").VUnion<"negative" | "positive" | "zero", [import("convex/values").VLiteral<"positive", "required">, import("convex/values").VLiteral<"negative", "required">, import("convex/values").VLiteral<"zero", "required">], "required", never>;
450
+ openingCollection: import("convex/values").VObject<{
451
+ amountDue: number;
452
+ collectedAmount: number;
453
+ operationKey: string;
454
+ revision: number;
455
+ } | undefined, {
456
+ operationKey: import("convex/values").VString<string, "required">;
457
+ amountDue: import("convex/values").VFloat64<number, "required">;
458
+ revision: import("convex/values").VFloat64<number, "required">;
459
+ collectedAmount: import("convex/values").VFloat64<number, "required">;
460
+ }, "optional", "amountDue" | "collectedAmount" | "operationKey" | "revision">;
461
+ _id: import("convex/values").VId<import("convex/values").GenericId<"recoveryClaims">, "required">;
462
+ _creationTime: import("convex/values").VFloat64<number, "required">;
463
+ }, "optional", "_creationTime" | "_id" | "accountId" | "amountDue" | "claimKey" | "collectedAmount" | "currency" | "openingCollection" | "openingCollection.amountDue" | "openingCollection.collectedAmount" | "openingCollection.operationKey" | "openingCollection.revision" | "outstanding" | "reservedAmount" | "revision" | "scopeKey" | "sign" | "sourceChargeId" | "sourceGross" | "sourceProcessingFee">;
464
+ deficit: import("convex/values").VObject<{
465
+ amountDue: number;
466
+ currency: string;
467
+ disputeLiability: number;
468
+ processingLiability: number;
469
+ retainedFee: number;
470
+ }, {
471
+ currency: import("convex/values").VString<string, "required">;
472
+ retainedFee: import("convex/values").VFloat64<number, "required">;
473
+ processingLiability: import("convex/values").VFloat64<number, "required">;
474
+ disputeLiability: import("convex/values").VFloat64<number, "required">;
475
+ amountDue: import("convex/values").VFloat64<number, "required">;
476
+ }, "required", "amountDue" | "currency" | "disputeLiability" | "processingLiability" | "retainedFee">;
477
+ observation: import("convex/values").VObject<{
478
+ currency: string;
479
+ disputeFees: number;
480
+ gross: number;
481
+ originalProcessingFee: number;
482
+ paymentIntentId: string;
483
+ principalReturned: number;
484
+ processingFee: number;
485
+ provenance: {
486
+ customerAccountId: string;
487
+ invoiceId: string;
488
+ invoicePaymentId: string;
489
+ recoveryInvoiceItemId?: string | undefined;
490
+ stripePriceId?: string | undefined;
491
+ stripeProductId?: string | undefined;
492
+ subscriptionId?: string | undefined;
493
+ };
494
+ sourceChargeId: string;
495
+ }, {
496
+ paymentIntentId: import("convex/values").VString<string, "required">;
497
+ sourceChargeId: import("convex/values").VString<string, "required">;
498
+ currency: import("convex/values").VString<string, "required">;
499
+ gross: import("convex/values").VFloat64<number, "required">;
500
+ originalProcessingFee: import("convex/values").VFloat64<number, "required">;
501
+ processingFee: import("convex/values").VFloat64<number, "required">;
502
+ disputeFees: import("convex/values").VFloat64<number, "required">;
503
+ principalReturned: import("convex/values").VFloat64<number, "required">;
504
+ provenance: import("convex/values").VObject<{
505
+ customerAccountId: string;
506
+ invoiceId: string;
507
+ invoicePaymentId: string;
508
+ recoveryInvoiceItemId?: string | undefined;
509
+ stripePriceId?: string | undefined;
510
+ stripeProductId?: string | undefined;
511
+ subscriptionId?: string | undefined;
512
+ }, {
513
+ invoiceId: import("convex/values").VString<string, "required">;
514
+ invoicePaymentId: import("convex/values").VString<string, "required">;
515
+ recoveryInvoiceItemId: import("convex/values").VString<string | undefined, "optional">;
516
+ customerAccountId: import("convex/values").VString<string, "required">;
517
+ subscriptionId: import("convex/values").VString<string | undefined, "optional">;
518
+ stripePriceId: import("convex/values").VString<string | undefined, "optional">;
519
+ stripeProductId: import("convex/values").VString<string | undefined, "optional">;
520
+ }, "required", "customerAccountId" | "invoiceId" | "invoicePaymentId" | "recoveryInvoiceItemId" | "stripePriceId" | "stripeProductId" | "subscriptionId">;
521
+ }, "required", "currency" | "disputeFees" | "gross" | "originalProcessingFee" | "paymentIntentId" | "principalReturned" | "processingFee" | "provenance" | "provenance.customerAccountId" | "provenance.invoiceId" | "provenance.invoicePaymentId" | "provenance.recoveryInvoiceItemId" | "provenance.stripePriceId" | "provenance.stripeProductId" | "provenance.subscriptionId" | "sourceChargeId">;
522
+ }, "optional", "claim" | "claim._creationTime" | "claim._id" | "claim.accountId" | "claim.amountDue" | "claim.claimKey" | "claim.collectedAmount" | "claim.currency" | "claim.openingCollection" | "claim.openingCollection.amountDue" | "claim.openingCollection.collectedAmount" | "claim.openingCollection.operationKey" | "claim.openingCollection.revision" | "claim.outstanding" | "claim.reservedAmount" | "claim.revision" | "claim.scopeKey" | "claim.sign" | "claim.sourceChargeId" | "claim.sourceGross" | "claim.sourceProcessingFee" | "deficit" | "deficit.amountDue" | "deficit.currency" | "deficit.disputeLiability" | "deficit.processingLiability" | "deficit.retainedFee" | "observation" | "observation.currency" | "observation.disputeFees" | "observation.gross" | "observation.originalProcessingFee" | "observation.paymentIntentId" | "observation.principalReturned" | "observation.processingFee" | "observation.provenance" | "observation.provenance.customerAccountId" | "observation.provenance.invoiceId" | "observation.provenance.invoicePaymentId" | "observation.provenance.recoveryInvoiceItemId" | "observation.provenance.stripePriceId" | "observation.provenance.stripeProductId" | "observation.provenance.subscriptionId" | "observation.sourceChargeId" | "rollbackClaim" | "rollbackClaim._creationTime" | "rollbackClaim._id" | "rollbackClaim.accountId" | "rollbackClaim.amountDue" | "rollbackClaim.claimKey" | "rollbackClaim.collectedAmount" | "rollbackClaim.currency" | "rollbackClaim.openingCollection" | "rollbackClaim.openingCollection.amountDue" | "rollbackClaim.openingCollection.collectedAmount" | "rollbackClaim.openingCollection.operationKey" | "rollbackClaim.openingCollection.revision" | "rollbackClaim.outstanding" | "rollbackClaim.reservedAmount" | "rollbackClaim.revision" | "rollbackClaim.scopeKey" | "rollbackClaim.sign" | "rollbackClaim.sourceChargeId" | "rollbackClaim.sourceGross" | "rollbackClaim.sourceProcessingFee">;
523
+ }, "required", "accountId" | "claimKey" | "currency" | "definitionVersion" | "expectedRevision" | "failure" | "failure.reason" | "failure.retryable" | "failure.status" | "importHook" | "maxAttempts" | "policy" | "policy.liability" | "policy.liability.disputeCosts" | "policy.liability.processingCosts" | "policy.rounding" | "policy.sellingFee" | "projection" | "provider" | "providerApiVersion" | "requestKey" | "result" | "result.claim" | "result.claim._creationTime" | "result.claim._id" | "result.claim.accountId" | "result.claim.amountDue" | "result.claim.claimKey" | "result.claim.collectedAmount" | "result.claim.currency" | "result.claim.openingCollection" | "result.claim.openingCollection.amountDue" | "result.claim.openingCollection.collectedAmount" | "result.claim.openingCollection.operationKey" | "result.claim.openingCollection.revision" | "result.claim.outstanding" | "result.claim.reservedAmount" | "result.claim.revision" | "result.claim.scopeKey" | "result.claim.sign" | "result.claim.sourceChargeId" | "result.claim.sourceGross" | "result.claim.sourceProcessingFee" | "result.deficit" | "result.deficit.amountDue" | "result.deficit.currency" | "result.deficit.disputeLiability" | "result.deficit.processingLiability" | "result.deficit.retainedFee" | "result.observation" | "result.observation.currency" | "result.observation.disputeFees" | "result.observation.gross" | "result.observation.originalProcessingFee" | "result.observation.paymentIntentId" | "result.observation.principalReturned" | "result.observation.processingFee" | "result.observation.provenance" | "result.observation.provenance.customerAccountId" | "result.observation.provenance.invoiceId" | "result.observation.provenance.invoicePaymentId" | "result.observation.provenance.recoveryInvoiceItemId" | "result.observation.provenance.stripePriceId" | "result.observation.provenance.stripeProductId" | "result.observation.provenance.subscriptionId" | "result.observation.sourceChargeId" | "result.rollbackClaim" | "result.rollbackClaim._creationTime" | "result.rollbackClaim._id" | "result.rollbackClaim.accountId" | "result.rollbackClaim.amountDue" | "result.rollbackClaim.claimKey" | "result.rollbackClaim.collectedAmount" | "result.rollbackClaim.currency" | "result.rollbackClaim.openingCollection" | "result.rollbackClaim.openingCollection.amountDue" | "result.rollbackClaim.openingCollection.collectedAmount" | "result.rollbackClaim.openingCollection.operationKey" | "result.rollbackClaim.openingCollection.revision" | "result.rollbackClaim.outstanding" | "result.rollbackClaim.reservedAmount" | "result.rollbackClaim.revision" | "result.rollbackClaim.scopeKey" | "result.rollbackClaim.sign" | "result.rollbackClaim.sourceChargeId" | "result.rollbackClaim.sourceGross" | "result.rollbackClaim.sourceProcessingFee" | "retryDelayMs" | "rollback" | "rollback.expectedRevision" | "rollback.groupKey" | "scopeKey" | "source" | "source.customerAccountId" | "source.gross" | "source.groupKey" | "source.invoiceId" | "source.kind" | "source.paymentIntentId" | "source.stripeAccountId" | "source.stripePriceId" | "source.stripeProductId" | "source.subscriptionId" | "status" | "version" | "workflowId">, {
524
+ by_claim_status: ["claimKey", "status", "_creationTime"];
525
+ by_payment_scope: ["accountId", "scopeKey", "currency", "source.paymentIntentId", "_creationTime"];
526
+ by_request: ["requestKey", "_creationTime"];
527
+ }, {}, {}>;
17
528
  recoveryWorkflowOperations: import("convex/server").TableDefinition<import("convex/values").VObject<{
18
529
  accountId: string;
19
530
  activePhase?: "execute" | "reconcile" | undefined;
@@ -286,6 +797,48 @@ export declare function setup(scope?: Scope): Promise<{
286
797
  accountId: string;
287
798
  cancelRequested: boolean;
288
799
  enabled: boolean;
800
+ execution?: {
801
+ apply?: {
802
+ receipt?: {
803
+ customerAccount: string;
804
+ enabled?: boolean | undefined;
805
+ paymentMethodId: string | null;
806
+ paymentMethodTypes?: string[] | null | undefined;
807
+ phase: "apply" | "attach" | "create";
808
+ providerApiVersion: string;
809
+ stripeSubscriptionId: string;
810
+ } | undefined;
811
+ state: "running" | "succeeded" | "unknown";
812
+ } | undefined;
813
+ attach?: {
814
+ receipt?: {
815
+ customerAccount: string;
816
+ enabled?: boolean | undefined;
817
+ paymentMethodId: string | null;
818
+ paymentMethodTypes?: string[] | null | undefined;
819
+ phase: "apply" | "attach" | "create";
820
+ providerApiVersion: string;
821
+ stripeSubscriptionId: string;
822
+ } | undefined;
823
+ state: "running" | "succeeded" | "unknown";
824
+ } | undefined;
825
+ create?: {
826
+ receipt?: {
827
+ customerAccount: string;
828
+ enabled?: boolean | undefined;
829
+ paymentMethodId: string | null;
830
+ paymentMethodTypes?: string[] | null | undefined;
831
+ phase: "apply" | "attach" | "create";
832
+ providerApiVersion: string;
833
+ stripeSubscriptionId: string;
834
+ } | undefined;
835
+ state: "running" | "succeeded" | "unknown";
836
+ } | undefined;
837
+ definitionVersion: string;
838
+ providerAction: string;
839
+ providerApiVersion: string;
840
+ workflowId?: string | undefined;
841
+ } | undefined;
289
842
  failureCode?: "invalid_scope" | "policy_invalid" | "unsupported_source" | undefined;
290
843
  kind: "apply" | "prepare";
291
844
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
@@ -341,7 +894,147 @@ export declare function setup(scope?: Scope): Promise<{
341
894
  paymentMethodTypes: import("convex/values").VUnion<string[] | null, [import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, import("convex/values").VNull<null, "required">], "required", never>;
342
895
  providerApiVersion: import("convex/values").VString<string, "required">;
343
896
  }, "optional", "customerAccount" | "paymentMethodId" | "paymentMethodTypes" | "providerApiVersion" | "stripeSubscriptionId">;
344
- }, "required", "accountId" | "cancelRequested" | "enabled" | "failureCode" | "kind" | "preparationId" | "providerKey" | "providerKeys" | "providerKeys.attach" | "providerKeys.create" | "providerKeys.disable" | "providerKeys.enable" | "receipt" | "receipt.customerAccount" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "scopeKey" | "state" | "version">, {
897
+ execution: import("convex/values").VObject<{
898
+ apply?: {
899
+ receipt?: {
900
+ customerAccount: string;
901
+ enabled?: boolean | undefined;
902
+ paymentMethodId: string | null;
903
+ paymentMethodTypes?: string[] | null | undefined;
904
+ phase: "apply" | "attach" | "create";
905
+ providerApiVersion: string;
906
+ stripeSubscriptionId: string;
907
+ } | undefined;
908
+ state: "running" | "succeeded" | "unknown";
909
+ } | undefined;
910
+ attach?: {
911
+ receipt?: {
912
+ customerAccount: string;
913
+ enabled?: boolean | undefined;
914
+ paymentMethodId: string | null;
915
+ paymentMethodTypes?: string[] | null | undefined;
916
+ phase: "apply" | "attach" | "create";
917
+ providerApiVersion: string;
918
+ stripeSubscriptionId: string;
919
+ } | undefined;
920
+ state: "running" | "succeeded" | "unknown";
921
+ } | undefined;
922
+ create?: {
923
+ receipt?: {
924
+ customerAccount: string;
925
+ enabled?: boolean | undefined;
926
+ paymentMethodId: string | null;
927
+ paymentMethodTypes?: string[] | null | undefined;
928
+ phase: "apply" | "attach" | "create";
929
+ providerApiVersion: string;
930
+ stripeSubscriptionId: string;
931
+ } | undefined;
932
+ state: "running" | "succeeded" | "unknown";
933
+ } | undefined;
934
+ definitionVersion: string;
935
+ providerAction: string;
936
+ providerApiVersion: string;
937
+ workflowId?: string | undefined;
938
+ } | undefined, {
939
+ workflowId: import("convex/values").VString<string | undefined, "optional">;
940
+ definitionVersion: import("convex/values").VString<string, "required">;
941
+ providerApiVersion: import("convex/values").VString<string, "required">;
942
+ providerAction: import("convex/values").VString<string, "required">;
943
+ create: import("convex/values").VObject<{
944
+ receipt?: {
945
+ customerAccount: string;
946
+ enabled?: boolean | undefined;
947
+ paymentMethodId: string | null;
948
+ paymentMethodTypes?: string[] | null | undefined;
949
+ phase: "apply" | "attach" | "create";
950
+ providerApiVersion: string;
951
+ stripeSubscriptionId: string;
952
+ } | undefined;
953
+ state: "running" | "succeeded" | "unknown";
954
+ } | undefined, {
955
+ state: import("convex/values").VUnion<"running" | "succeeded" | "unknown", [import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"succeeded", "required">], "required", never>;
956
+ receipt: import("convex/values").VObject<{
957
+ customerAccount: string;
958
+ enabled?: boolean | undefined;
959
+ paymentMethodId: string | null;
960
+ paymentMethodTypes?: string[] | null | undefined;
961
+ phase: "apply" | "attach" | "create";
962
+ providerApiVersion: string;
963
+ stripeSubscriptionId: string;
964
+ } | undefined, {
965
+ phase: import("convex/values").VUnion<"apply" | "attach" | "create", [import("convex/values").VLiteral<"create", "required">, import("convex/values").VLiteral<"attach", "required">, import("convex/values").VLiteral<"apply", "required">], "required", never>;
966
+ customerAccount: import("convex/values").VString<string, "required">;
967
+ stripeSubscriptionId: import("convex/values").VString<string, "required">;
968
+ paymentMethodId: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
969
+ paymentMethodTypes: import("convex/values").VUnion<string[] | null | undefined, [import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
970
+ enabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
971
+ providerApiVersion: import("convex/values").VString<string, "required">;
972
+ }, "optional", "customerAccount" | "enabled" | "paymentMethodId" | "paymentMethodTypes" | "phase" | "providerApiVersion" | "stripeSubscriptionId">;
973
+ }, "optional", "receipt" | "receipt.customerAccount" | "receipt.enabled" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.phase" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "state">;
974
+ attach: import("convex/values").VObject<{
975
+ receipt?: {
976
+ customerAccount: string;
977
+ enabled?: boolean | undefined;
978
+ paymentMethodId: string | null;
979
+ paymentMethodTypes?: string[] | null | undefined;
980
+ phase: "apply" | "attach" | "create";
981
+ providerApiVersion: string;
982
+ stripeSubscriptionId: string;
983
+ } | undefined;
984
+ state: "running" | "succeeded" | "unknown";
985
+ } | undefined, {
986
+ state: import("convex/values").VUnion<"running" | "succeeded" | "unknown", [import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"succeeded", "required">], "required", never>;
987
+ receipt: import("convex/values").VObject<{
988
+ customerAccount: string;
989
+ enabled?: boolean | undefined;
990
+ paymentMethodId: string | null;
991
+ paymentMethodTypes?: string[] | null | undefined;
992
+ phase: "apply" | "attach" | "create";
993
+ providerApiVersion: string;
994
+ stripeSubscriptionId: string;
995
+ } | undefined, {
996
+ phase: import("convex/values").VUnion<"apply" | "attach" | "create", [import("convex/values").VLiteral<"create", "required">, import("convex/values").VLiteral<"attach", "required">, import("convex/values").VLiteral<"apply", "required">], "required", never>;
997
+ customerAccount: import("convex/values").VString<string, "required">;
998
+ stripeSubscriptionId: import("convex/values").VString<string, "required">;
999
+ paymentMethodId: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
1000
+ paymentMethodTypes: import("convex/values").VUnion<string[] | null | undefined, [import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
1001
+ enabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
1002
+ providerApiVersion: import("convex/values").VString<string, "required">;
1003
+ }, "optional", "customerAccount" | "enabled" | "paymentMethodId" | "paymentMethodTypes" | "phase" | "providerApiVersion" | "stripeSubscriptionId">;
1004
+ }, "optional", "receipt" | "receipt.customerAccount" | "receipt.enabled" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.phase" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "state">;
1005
+ apply: import("convex/values").VObject<{
1006
+ receipt?: {
1007
+ customerAccount: string;
1008
+ enabled?: boolean | undefined;
1009
+ paymentMethodId: string | null;
1010
+ paymentMethodTypes?: string[] | null | undefined;
1011
+ phase: "apply" | "attach" | "create";
1012
+ providerApiVersion: string;
1013
+ stripeSubscriptionId: string;
1014
+ } | undefined;
1015
+ state: "running" | "succeeded" | "unknown";
1016
+ } | undefined, {
1017
+ state: import("convex/values").VUnion<"running" | "succeeded" | "unknown", [import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"succeeded", "required">], "required", never>;
1018
+ receipt: import("convex/values").VObject<{
1019
+ customerAccount: string;
1020
+ enabled?: boolean | undefined;
1021
+ paymentMethodId: string | null;
1022
+ paymentMethodTypes?: string[] | null | undefined;
1023
+ phase: "apply" | "attach" | "create";
1024
+ providerApiVersion: string;
1025
+ stripeSubscriptionId: string;
1026
+ } | undefined, {
1027
+ phase: import("convex/values").VUnion<"apply" | "attach" | "create", [import("convex/values").VLiteral<"create", "required">, import("convex/values").VLiteral<"attach", "required">, import("convex/values").VLiteral<"apply", "required">], "required", never>;
1028
+ customerAccount: import("convex/values").VString<string, "required">;
1029
+ stripeSubscriptionId: import("convex/values").VString<string, "required">;
1030
+ paymentMethodId: import("convex/values").VUnion<string | null, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "required", never>;
1031
+ paymentMethodTypes: import("convex/values").VUnion<string[] | null | undefined, [import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
1032
+ enabled: import("convex/values").VBoolean<boolean | undefined, "optional">;
1033
+ providerApiVersion: import("convex/values").VString<string, "required">;
1034
+ }, "optional", "customerAccount" | "enabled" | "paymentMethodId" | "paymentMethodTypes" | "phase" | "providerApiVersion" | "stripeSubscriptionId">;
1035
+ }, "optional", "receipt" | "receipt.customerAccount" | "receipt.enabled" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.phase" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "state">;
1036
+ }, "optional", "apply" | "apply.receipt" | "apply.receipt.customerAccount" | "apply.receipt.enabled" | "apply.receipt.paymentMethodId" | "apply.receipt.paymentMethodTypes" | "apply.receipt.phase" | "apply.receipt.providerApiVersion" | "apply.receipt.stripeSubscriptionId" | "apply.state" | "attach" | "attach.receipt" | "attach.receipt.customerAccount" | "attach.receipt.enabled" | "attach.receipt.paymentMethodId" | "attach.receipt.paymentMethodTypes" | "attach.receipt.phase" | "attach.receipt.providerApiVersion" | "attach.receipt.stripeSubscriptionId" | "attach.state" | "create" | "create.receipt" | "create.receipt.customerAccount" | "create.receipt.enabled" | "create.receipt.paymentMethodId" | "create.receipt.paymentMethodTypes" | "create.receipt.phase" | "create.receipt.providerApiVersion" | "create.receipt.stripeSubscriptionId" | "create.state" | "definitionVersion" | "providerAction" | "providerApiVersion" | "workflowId">;
1037
+ }, "required", "accountId" | "cancelRequested" | "enabled" | "execution" | "execution.apply" | "execution.apply.receipt" | "execution.apply.receipt.customerAccount" | "execution.apply.receipt.enabled" | "execution.apply.receipt.paymentMethodId" | "execution.apply.receipt.paymentMethodTypes" | "execution.apply.receipt.phase" | "execution.apply.receipt.providerApiVersion" | "execution.apply.receipt.stripeSubscriptionId" | "execution.apply.state" | "execution.attach" | "execution.attach.receipt" | "execution.attach.receipt.customerAccount" | "execution.attach.receipt.enabled" | "execution.attach.receipt.paymentMethodId" | "execution.attach.receipt.paymentMethodTypes" | "execution.attach.receipt.phase" | "execution.attach.receipt.providerApiVersion" | "execution.attach.receipt.stripeSubscriptionId" | "execution.attach.state" | "execution.create" | "execution.create.receipt" | "execution.create.receipt.customerAccount" | "execution.create.receipt.enabled" | "execution.create.receipt.paymentMethodId" | "execution.create.receipt.paymentMethodTypes" | "execution.create.receipt.phase" | "execution.create.receipt.providerApiVersion" | "execution.create.receipt.stripeSubscriptionId" | "execution.create.state" | "execution.definitionVersion" | "execution.providerAction" | "execution.providerApiVersion" | "execution.workflowId" | "failureCode" | "kind" | "preparationId" | "providerKey" | "providerKeys" | "providerKeys.attach" | "providerKeys.create" | "providerKeys.disable" | "providerKeys.enable" | "receipt" | "receipt.customerAccount" | "receipt.paymentMethodId" | "receipt.paymentMethodTypes" | "receipt.providerApiVersion" | "receipt.stripeSubscriptionId" | "scopeKey" | "state" | "version">, {
345
1038
  by_preparation_version: ["preparationId", "version", "_creationTime"];
346
1039
  }, {}, {}>;
347
1040
  balanceFundingRequests: import("convex/server").TableDefinition<import("convex/values").VObject<{