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