@fantastic.dev/better-stripe 0.58.0 → 0.60.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 (294) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +3 -1
  3. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +888 -62
  4. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
  5. package/dist/client/connect/payoutExecutionTestHelpers.d.ts +428 -15
  6. package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
  7. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +856 -30
  8. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
  9. package/dist/client/connect/payoutSyncTestHelpers.d.ts +444 -31
  10. package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
  11. package/dist/client/index.d.ts +4 -0
  12. package/dist/client/index.d.ts.map +1 -1
  13. package/dist/client/paymentSource/resolver.d.ts +12 -1
  14. package/dist/client/paymentSource/resolver.d.ts.map +1 -1
  15. package/dist/client/paymentSource/resolver.fixtures.d.ts +220 -0
  16. package/dist/client/paymentSource/resolver.fixtures.d.ts.map +1 -0
  17. package/dist/client/paymentSource/resolver.fixtures.js +189 -0
  18. package/dist/client/paymentSource/resolver.fixtures.js.map +1 -0
  19. package/dist/client/paymentSource/resolver.js +28 -3
  20. package/dist/client/paymentSource/resolver.js.map +1 -1
  21. package/dist/client/settlement/execution.d.ts +25 -0
  22. package/dist/client/settlement/execution.d.ts.map +1 -1
  23. package/dist/client/settlement/execution.js +2 -0
  24. package/dist/client/settlement/execution.js.map +1 -1
  25. package/dist/client/usage/allowanceClient.d.ts +1 -1
  26. package/dist/client/usage/catalogPrices.d.ts +1 -1
  27. package/dist/client/usage/catalogPrices.d.ts.map +1 -1
  28. package/dist/client/usage/catalogPrices.js +4 -4
  29. package/dist/client/usage/catalogPrices.js.map +1 -1
  30. package/dist/client/usage/client.d.ts +2 -2
  31. package/dist/client/usage/client.d.ts.map +1 -1
  32. package/dist/client/usage/client.js +2 -2
  33. package/dist/client/usage/client.js.map +1 -1
  34. package/dist/client/usage/correctionClient.d.ts +33 -0
  35. package/dist/client/usage/correctionClient.d.ts.map +1 -0
  36. package/dist/client/usage/correctionClient.js +27 -0
  37. package/dist/client/usage/correctionClient.js.map +1 -0
  38. package/dist/client/usage/correctionEligibility.d.ts +4 -0
  39. package/dist/client/usage/correctionEligibility.d.ts.map +1 -0
  40. package/dist/client/usage/correctionEligibility.js +7 -0
  41. package/dist/client/usage/correctionEligibility.js.map +1 -0
  42. package/dist/client/usage/correctionInvoice.d.ts +9 -0
  43. package/dist/client/usage/correctionInvoice.d.ts.map +1 -0
  44. package/dist/client/usage/correctionInvoice.js +218 -0
  45. package/dist/client/usage/correctionInvoice.js.map +1 -0
  46. package/dist/client/usage/correctionInvoiceProof.d.ts +29 -0
  47. package/dist/client/usage/correctionInvoiceProof.d.ts.map +1 -0
  48. package/dist/client/usage/correctionInvoiceProof.js +41 -0
  49. package/dist/client/usage/correctionInvoiceProof.js.map +1 -0
  50. package/dist/client/usage/correctionProofs.d.ts +36 -0
  51. package/dist/client/usage/correctionProofs.d.ts.map +1 -0
  52. package/dist/client/usage/correctionProofs.js +41 -0
  53. package/dist/client/usage/correctionProofs.js.map +1 -0
  54. package/dist/client/usage/correctionProvider.d.ts +6 -0
  55. package/dist/client/usage/correctionProvider.d.ts.map +1 -0
  56. package/dist/client/usage/correctionProvider.js +243 -0
  57. package/dist/client/usage/correctionProvider.js.map +1 -0
  58. package/dist/client/usage/correctionRead.d.ts +27 -0
  59. package/dist/client/usage/correctionRead.d.ts.map +1 -0
  60. package/dist/client/usage/correctionRead.js +36 -0
  61. package/dist/client/usage/correctionRead.js.map +1 -0
  62. package/dist/client/usage/correctionTerms.d.ts +64 -0
  63. package/dist/client/usage/correctionTerms.d.ts.map +1 -0
  64. package/dist/client/usage/correctionTerms.js +65 -0
  65. package/dist/client/usage/correctionTerms.js.map +1 -0
  66. package/dist/client/usage/correctionTransport.fixtures.d.ts +37 -0
  67. package/dist/client/usage/correctionTransport.fixtures.d.ts.map +1 -0
  68. package/dist/client/usage/correctionTransport.fixtures.js +322 -0
  69. package/dist/client/usage/correctionTransport.fixtures.js.map +1 -0
  70. package/dist/client/usage/creditClient.d.ts +1 -1
  71. package/dist/client/usage/creditRevenue.d.ts +22 -0
  72. package/dist/client/usage/creditRevenue.d.ts.map +1 -0
  73. package/dist/client/usage/creditRevenue.js +118 -0
  74. package/dist/client/usage/creditRevenue.js.map +1 -0
  75. package/dist/client/usage/creditSettlement.d.ts +29 -0
  76. package/dist/client/usage/creditSettlement.d.ts.map +1 -0
  77. package/dist/client/usage/creditSettlement.fixtures.d.ts +215 -0
  78. package/dist/client/usage/creditSettlement.fixtures.d.ts.map +1 -0
  79. package/dist/client/usage/creditSettlement.fixtures.js +59 -0
  80. package/dist/client/usage/creditSettlement.fixtures.js.map +1 -0
  81. package/dist/client/usage/creditSettlement.js +70 -0
  82. package/dist/client/usage/creditSettlement.js.map +1 -0
  83. package/dist/client/usage/creditTransport.fixtures.d.ts +7 -1
  84. package/dist/client/usage/creditTransport.fixtures.d.ts.map +1 -1
  85. package/dist/client/usage/creditTransport.fixtures.js +25 -4
  86. package/dist/client/usage/creditTransport.fixtures.js.map +1 -1
  87. package/dist/client/usage/index.d.ts +6 -0
  88. package/dist/client/usage/index.d.ts.map +1 -1
  89. package/dist/client/usage/invoiceSale.d.ts +22 -0
  90. package/dist/client/usage/invoiceSale.d.ts.map +1 -0
  91. package/dist/client/usage/invoiceSale.fixtures.d.ts +285 -0
  92. package/dist/client/usage/invoiceSale.fixtures.d.ts.map +1 -0
  93. package/dist/client/usage/invoiceSale.fixtures.js +104 -0
  94. package/dist/client/usage/invoiceSale.fixtures.js.map +1 -0
  95. package/dist/client/usage/invoiceSale.js +117 -0
  96. package/dist/client/usage/invoiceSale.js.map +1 -0
  97. package/dist/client/usage/observationClient.d.ts +20 -0
  98. package/dist/client/usage/observationClient.d.ts.map +1 -1
  99. package/dist/client/usage/observationClient.js +20 -6
  100. package/dist/client/usage/observationClient.js.map +1 -1
  101. package/dist/client/usage/records.d.ts +1 -1
  102. package/dist/client/usage/records.d.ts.map +1 -1
  103. package/dist/client/usage/records.js.map +1 -1
  104. package/dist/client/usage/settlement.d.ts +32 -0
  105. package/dist/client/usage/settlement.d.ts.map +1 -0
  106. package/dist/client/usage/settlement.js +60 -0
  107. package/dist/client/usage/settlement.js.map +1 -0
  108. package/dist/client/usage/settlementClient.d.ts +51 -0
  109. package/dist/client/usage/settlementClient.d.ts.map +1 -0
  110. package/dist/client/usage/settlementClient.js +35 -0
  111. package/dist/client/usage/settlementClient.js.map +1 -0
  112. package/dist/client/usage/summary.d.ts +3 -0
  113. package/dist/client/usage/summary.d.ts.map +1 -1
  114. package/dist/client/usage/summary.js +9 -4
  115. package/dist/client/usage/summary.js.map +1 -1
  116. package/dist/client/usageExports.d.ts +2 -0
  117. package/dist/client/usageExports.d.ts.map +1 -1
  118. package/dist/component/_generated/api.d.ts +12 -0
  119. package/dist/component/_generated/api.d.ts.map +1 -1
  120. package/dist/component/_generated/api.js.map +1 -1
  121. package/dist/component/_generated/component.d.ts +380 -14
  122. package/dist/component/_generated/component.d.ts.map +1 -1
  123. package/dist/component/accountClosure/mutations.d.ts.map +1 -1
  124. package/dist/component/accountClosure/mutations.js +13 -0
  125. package/dist/component/accountClosure/mutations.js.map +1 -1
  126. package/dist/component/balanceFunding/internal/actions.d.ts +11 -11
  127. package/dist/component/balanceFunding/stateHandlers.d.ts +8 -8
  128. package/dist/component/earnings/triggers.d.ts +368 -32
  129. package/dist/component/earnings/triggers.d.ts.map +1 -1
  130. package/dist/component/financialObservations/settlementHelpers.d.ts.map +1 -1
  131. package/dist/component/financialObservations/settlementHelpers.js +2 -0
  132. package/dist/component/financialObservations/settlementHelpers.js.map +1 -1
  133. package/dist/component/recoveryWorkflow/helpers.d.ts +25 -0
  134. package/dist/component/recoveryWorkflow/helpers.d.ts.map +1 -1
  135. package/dist/component/recoveryWorkflow/mutations.d.ts +25 -0
  136. package/dist/component/recoveryWorkflow/mutations.d.ts.map +1 -1
  137. package/dist/component/recoveryWorkflow/queries.d.ts +50 -0
  138. package/dist/component/recoveryWorkflow/queries.d.ts.map +1 -1
  139. package/dist/component/recoveryWorkflow/schema.d.ts +566 -10
  140. package/dist/component/recoveryWorkflow/schema.d.ts.map +1 -1
  141. package/dist/component/schema.d.ts +428 -15
  142. package/dist/component/schema.js +4 -0
  143. package/dist/component/schema.js.map +1 -1
  144. package/dist/component/settlement/mutations.d.ts +50 -0
  145. package/dist/component/settlement/mutations.d.ts.map +1 -1
  146. package/dist/component/settlement/mutations.js +8 -1
  147. package/dist/component/settlement/mutations.js.map +1 -1
  148. package/dist/component/settlement/queries.d.ts +25 -0
  149. package/dist/component/settlement/queries.d.ts.map +1 -1
  150. package/dist/component/settlement/schema.d.ts +128 -1
  151. package/dist/component/settlement/schema.d.ts.map +1 -1
  152. package/dist/component/settlement/schema.js +22 -0
  153. package/dist/component/settlement/schema.js.map +1 -1
  154. package/dist/component/usage/queries.d.ts +2 -2
  155. package/dist/component/usage/schema.d.ts +18 -13
  156. package/dist/component/usage/schema.d.ts.map +1 -1
  157. package/dist/component/usage/schema.js +2 -1
  158. package/dist/component/usage/schema.js.map +1 -1
  159. package/dist/component/usageAllowance/queries.d.ts +1 -1
  160. package/dist/component/usageAllowance/queries.d.ts.map +1 -1
  161. package/dist/component/usageAllowance/queries.js +10 -1
  162. package/dist/component/usageAllowance/queries.js.map +1 -1
  163. package/dist/component/usageAllowance/schema.d.ts +5 -5
  164. package/dist/component/usageAllowance/schema.d.ts.map +1 -1
  165. package/dist/component/usageAllowance/schema.js +1 -1
  166. package/dist/component/usageAllowance/schema.js.map +1 -1
  167. package/dist/component/usageCorrections/accounting.d.ts +5 -0
  168. package/dist/component/usageCorrections/accounting.d.ts.map +1 -0
  169. package/dist/component/usageCorrections/accounting.js +55 -0
  170. package/dist/component/usageCorrections/accounting.js.map +1 -0
  171. package/dist/component/usageCorrections/cancellation.d.ts +6 -0
  172. package/dist/component/usageCorrections/cancellation.d.ts.map +1 -0
  173. package/dist/component/usageCorrections/cancellation.js +29 -0
  174. package/dist/component/usageCorrections/cancellation.js.map +1 -0
  175. package/dist/component/usageCorrections/helpers.d.ts +60 -0
  176. package/dist/component/usageCorrections/helpers.d.ts.map +1 -0
  177. package/dist/component/usageCorrections/helpers.js +52 -0
  178. package/dist/component/usageCorrections/helpers.js.map +1 -0
  179. package/dist/component/usageCorrections/invoice.d.ts +38 -0
  180. package/dist/component/usageCorrections/invoice.d.ts.map +1 -0
  181. package/dist/component/usageCorrections/invoice.js +82 -0
  182. package/dist/component/usageCorrections/invoice.js.map +1 -0
  183. package/dist/component/usageCorrections/mutations.d.ts +121 -0
  184. package/dist/component/usageCorrections/mutations.d.ts.map +1 -0
  185. package/dist/component/usageCorrections/mutations.js +256 -0
  186. package/dist/component/usageCorrections/mutations.js.map +1 -0
  187. package/dist/component/usageCorrections/queries.d.ts +115 -0
  188. package/dist/component/usageCorrections/queries.d.ts.map +1 -0
  189. package/dist/component/usageCorrections/queries.js +84 -0
  190. package/dist/component/usageCorrections/queries.js.map +1 -0
  191. package/dist/component/usageCorrections/schema.d.ts +248 -0
  192. package/dist/component/usageCorrections/schema.d.ts.map +1 -0
  193. package/dist/component/usageCorrections/schema.js +74 -0
  194. package/dist/component/usageCorrections/schema.js.map +1 -0
  195. package/dist/component/usageCredits/queries.d.ts +1 -1
  196. package/dist/component/usageCredits/queries.d.ts.map +1 -1
  197. package/dist/component/usageCredits/queries.js +6 -0
  198. package/dist/component/usageCredits/queries.js.map +1 -1
  199. package/dist/component/usageCredits/schema.d.ts +5 -5
  200. package/dist/component/usageCredits/schema.d.ts.map +1 -1
  201. package/dist/component/usageCredits/schema.js +1 -1
  202. package/dist/component/usageCredits/schema.js.map +1 -1
  203. package/dist/component/usageDelivery/fields.d.ts +2 -2
  204. package/dist/component/usageDelivery/fields.d.ts.map +1 -1
  205. package/dist/component/usageDelivery/fields.js +1 -1
  206. package/dist/component/usageDelivery/fields.js.map +1 -1
  207. package/dist/component/usageDelivery/helpers.d.ts +7 -6
  208. package/dist/component/usageDelivery/helpers.d.ts.map +1 -1
  209. package/dist/component/usageDelivery/mutations.d.ts +6 -6
  210. package/dist/component/usageDelivery/mutations.d.ts.map +1 -1
  211. package/dist/component/usageDelivery/mutations.js +9 -1
  212. package/dist/component/usageDelivery/mutations.js.map +1 -1
  213. package/dist/component/usageDelivery/queries.d.ts +8 -6
  214. package/dist/component/usageDelivery/queries.d.ts.map +1 -1
  215. package/dist/component/usageDelivery/schema.d.ts +4 -4
  216. package/dist/component/usageDelivery/steps.d.ts +2 -2
  217. package/dist/component/usageDelivery/steps.js +1 -1
  218. package/dist/component/usageDelivery/steps.js.map +1 -1
  219. package/dist/component/usageObservations/queries.d.ts.map +1 -1
  220. package/dist/component/usageObservations/queries.js +4 -2
  221. package/dist/component/usageObservations/queries.js.map +1 -1
  222. package/dist/component/usageSubscriptions/retirement.d.ts.map +1 -1
  223. package/dist/component/usageSubscriptions/retirement.js +24 -2
  224. package/dist/component/usageSubscriptions/retirement.js.map +1 -1
  225. package/docs/README.md +4 -0
  226. package/docs/settlement.md +4 -0
  227. package/docs/usage-corrections.md +249 -0
  228. package/docs/usage-limits.md +1 -1
  229. package/docs/usage-settlement.md +162 -0
  230. package/package.json +3 -1
  231. package/src/client/index.ts +9 -0
  232. package/src/client/paymentSource/resolver.fixtures.ts +216 -0
  233. package/src/client/paymentSource/resolver.test.ts +11 -207
  234. package/src/client/paymentSource/resolver.ts +54 -2
  235. package/src/client/settlement/execution.ts +24 -0
  236. package/src/client/usage/catalogPrices.ts +4 -2
  237. package/src/client/usage/client.ts +2 -2
  238. package/src/client/usage/correctionClient.test.ts +153 -0
  239. package/src/client/usage/correctionClient.ts +62 -0
  240. package/src/client/usage/correctionCredits.test.ts +156 -0
  241. package/src/client/usage/correctionEligibility.ts +14 -0
  242. package/src/client/usage/correctionInvoice.test.ts +127 -0
  243. package/src/client/usage/correctionInvoice.ts +269 -0
  244. package/src/client/usage/correctionInvoiceProof.ts +40 -0
  245. package/src/client/usage/correctionProofs.ts +40 -0
  246. package/src/client/usage/correctionProvider.ts +326 -0
  247. package/src/client/usage/correctionRead.ts +73 -0
  248. package/src/client/usage/correctionRecovery.test.ts +113 -0
  249. package/src/client/usage/correctionTerms.ts +98 -0
  250. package/src/client/usage/correctionTransport.fixtures.ts +372 -0
  251. package/src/client/usage/creditRevenue.test.ts +105 -0
  252. package/src/client/usage/creditRevenue.ts +163 -0
  253. package/src/client/usage/creditSettlement.fixtures.ts +70 -0
  254. package/src/client/usage/creditSettlement.test.ts +66 -0
  255. package/src/client/usage/creditSettlement.ts +94 -0
  256. package/src/client/usage/creditSettlementRecovery.test.ts +173 -0
  257. package/src/client/usage/creditTransport.fixtures.ts +29 -4
  258. package/src/client/usage/index.ts +20 -0
  259. package/src/client/usage/invoiceSale.fixtures.ts +103 -0
  260. package/src/client/usage/invoiceSale.test.ts +184 -0
  261. package/src/client/usage/invoiceSale.ts +155 -0
  262. package/src/client/usage/observationClient.ts +20 -6
  263. package/src/client/usage/records.ts +7 -1
  264. package/src/client/usage/settlement.test.ts +179 -0
  265. package/src/client/usage/settlement.ts +81 -0
  266. package/src/client/usage/settlementClient.ts +84 -0
  267. package/src/client/usage/summary.ts +12 -4
  268. package/src/client/usageExports.ts +11 -0
  269. package/src/component/_generated/api.ts +12 -0
  270. package/src/component/_generated/component.ts +440 -2
  271. package/src/component/accountClosure/mutations.ts +17 -0
  272. package/src/component/financialObservations/settlementHelpers.ts +2 -0
  273. package/src/component/schema.ts +8 -0
  274. package/src/component/settlement/mutations.ts +10 -1
  275. package/src/component/settlement/schema.ts +26 -0
  276. package/src/component/settlement/settlement-claims.test.ts +54 -0
  277. package/src/component/usage/schema.ts +2 -0
  278. package/src/component/usageAllowance/queries.ts +8 -1
  279. package/src/component/usageAllowance/schema.ts +1 -0
  280. package/src/component/usageCorrections/accounting.ts +79 -0
  281. package/src/component/usageCorrections/cancellation.ts +32 -0
  282. package/src/component/usageCorrections/corrections.test.ts +389 -0
  283. package/src/component/usageCorrections/helpers.ts +57 -0
  284. package/src/component/usageCorrections/invoice.ts +103 -0
  285. package/src/component/usageCorrections/mutations.ts +278 -0
  286. package/src/component/usageCorrections/queries.ts +94 -0
  287. package/src/component/usageCorrections/schema.ts +90 -0
  288. package/src/component/usageCredits/queries.ts +4 -0
  289. package/src/component/usageCredits/schema.ts +1 -0
  290. package/src/component/usageDelivery/fields.ts +1 -0
  291. package/src/component/usageDelivery/mutations.ts +8 -3
  292. package/src/component/usageDelivery/steps.ts +1 -1
  293. package/src/component/usageObservations/queries.ts +5 -2
  294. package/src/component/usageSubscriptions/retirement.ts +31 -2
@@ -14,6 +14,114 @@ 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
+ usageCorrectionClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
18
+ key: string;
19
+ operationKey: string;
20
+ proofJson: string;
21
+ }, {
22
+ key: import("convex/values").VString<string, "required">;
23
+ operationKey: import("convex/values").VString<string, "required">;
24
+ proofJson: import("convex/values").VString<string, "required">;
25
+ }, "required", "key" | "operationKey" | "proofJson">, {
26
+ by_key: ["key", "_creationTime"];
27
+ }, {}, {}>;
28
+ usageCorrections: import("convex/server").TableDefinition<import("convex/values").VObject<{
29
+ adjustmentJson?: string | undefined;
30
+ attempt: number;
31
+ attemptedAt?: number | undefined;
32
+ cashConsequence: "none" | "operator_resolution_required" | "verified_external_adjustment";
33
+ correctionId: string;
34
+ creditNoteId?: string | undefined;
35
+ customerAccount?: string | undefined;
36
+ eventId: import("convex/values").GenericId<"usageEvents">;
37
+ firstAttemptAt: number;
38
+ historyCount: number;
39
+ inputJson: string;
40
+ invoiceId?: string | undefined;
41
+ key: string;
42
+ leaseUntil?: number | undefined;
43
+ nativeAdjustmentId?: string | undefined;
44
+ nativeCreditNoteStatus?: "issued" | "void" | undefined;
45
+ nativeStatus?: "complete" | "pending" | undefined;
46
+ observedAt?: number | undefined;
47
+ quantity: string;
48
+ reason: string;
49
+ recordJson: string;
50
+ refundId?: string | undefined;
51
+ resolution?: "event_cancellation" | "invoice_credit" | undefined;
52
+ restoredQuantity: string;
53
+ scaledQuantity: string;
54
+ scopeKey: string;
55
+ state: "confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported";
56
+ stripeAccountId?: string | undefined;
57
+ subscriptionJson: string;
58
+ }, {
59
+ stripeAccountId: import("convex/values").VString<string | undefined, "optional">;
60
+ customerAccount: import("convex/values").VString<string | undefined, "optional">;
61
+ observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
62
+ nativeCreditNoteStatus: import("convex/values").VUnion<"issued" | "void" | undefined, [import("convex/values").VLiteral<"issued", "required">, import("convex/values").VLiteral<"void", "required">], "optional", never>;
63
+ resolution: import("convex/values").VUnion<"event_cancellation" | "invoice_credit" | undefined, [import("convex/values").VLiteral<"event_cancellation", "required">, import("convex/values").VLiteral<"invoice_credit", "required">], "optional", never>;
64
+ adjustmentJson: import("convex/values").VString<string | undefined, "optional">;
65
+ key: import("convex/values").VString<string, "required">;
66
+ scopeKey: import("convex/values").VString<string, "required">;
67
+ eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
68
+ correctionId: import("convex/values").VString<string, "required">;
69
+ inputJson: import("convex/values").VString<string, "required">;
70
+ recordJson: import("convex/values").VString<string, "required">;
71
+ subscriptionJson: import("convex/values").VString<string, "required">;
72
+ quantity: import("convex/values").VString<string, "required">;
73
+ scaledQuantity: import("convex/values").VString<string, "required">;
74
+ state: import("convex/values").VUnion<"confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported", [import("convex/values").VLiteral<"requested", "required">, import("convex/values").VLiteral<"provider_accepted", "required">, import("convex/values").VLiteral<"confirmed", "required">, import("convex/values").VLiteral<"held", "required">, import("convex/values").VLiteral<"unsupported", "required">, import("convex/values").VLiteral<"invoice_adjustment_required", "required">], "required", never>;
75
+ reason: import("convex/values").VString<string, "required">;
76
+ firstAttemptAt: import("convex/values").VFloat64<number, "required">;
77
+ attemptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
78
+ leaseUntil: import("convex/values").VFloat64<number | undefined, "optional">;
79
+ attempt: import("convex/values").VFloat64<number, "required">;
80
+ nativeAdjustmentId: import("convex/values").VString<string | undefined, "optional">;
81
+ nativeStatus: import("convex/values").VUnion<"complete" | "pending" | undefined, [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"complete", "required">], "optional", never>;
82
+ invoiceId: import("convex/values").VString<string | undefined, "optional">;
83
+ creditNoteId: import("convex/values").VString<string | undefined, "optional">;
84
+ refundId: import("convex/values").VString<string | undefined, "optional">;
85
+ cashConsequence: import("convex/values").VUnion<"none" | "operator_resolution_required" | "verified_external_adjustment", [import("convex/values").VLiteral<"none", "required">, import("convex/values").VLiteral<"operator_resolution_required", "required">, import("convex/values").VLiteral<"verified_external_adjustment", "required">], "required", never>;
86
+ restoredQuantity: import("convex/values").VString<string, "required">;
87
+ historyCount: import("convex/values").VFloat64<number, "required">;
88
+ }, "required", "adjustmentJson" | "attempt" | "attemptedAt" | "cashConsequence" | "correctionId" | "creditNoteId" | "customerAccount" | "eventId" | "firstAttemptAt" | "historyCount" | "inputJson" | "invoiceId" | "key" | "leaseUntil" | "nativeAdjustmentId" | "nativeCreditNoteStatus" | "nativeStatus" | "observedAt" | "quantity" | "reason" | "recordJson" | "refundId" | "resolution" | "restoredQuantity" | "scaledQuantity" | "scopeKey" | "state" | "stripeAccountId" | "subscriptionJson">, {
89
+ by_event: ["eventId", "_creationTime"];
90
+ by_key: ["key", "_creationTime"];
91
+ by_payer_state: ["customerAccount", "state", "_creationTime"];
92
+ by_realm_state: ["stripeAccountId", "state", "_creationTime"];
93
+ by_scope: ["scopeKey", "_creationTime"];
94
+ by_scope_state: ["scopeKey", "state", "_creationTime"];
95
+ }, {}, {}>;
96
+ usageCorrectionHistory: import("convex/server").TableDefinition<import("convex/values").VObject<{
97
+ at: number;
98
+ eventId: import("convex/values").GenericId<"usageEvents">;
99
+ evidenceJson: string;
100
+ key: string;
101
+ occurredAt?: number | undefined;
102
+ reason: string;
103
+ recordJson: string;
104
+ scopeKey: string;
105
+ sequence: number;
106
+ state: "confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported";
107
+ subscriptionJson: string;
108
+ }, {
109
+ key: import("convex/values").VString<string, "required">;
110
+ scopeKey: import("convex/values").VString<string, "required">;
111
+ eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
112
+ sequence: import("convex/values").VFloat64<number, "required">;
113
+ state: import("convex/values").VUnion<"confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported", [import("convex/values").VLiteral<"requested", "required">, import("convex/values").VLiteral<"provider_accepted", "required">, import("convex/values").VLiteral<"confirmed", "required">, import("convex/values").VLiteral<"held", "required">, import("convex/values").VLiteral<"unsupported", "required">, import("convex/values").VLiteral<"invoice_adjustment_required", "required">], "required", never>;
114
+ reason: import("convex/values").VString<string, "required">;
115
+ recordJson: import("convex/values").VString<string, "required">;
116
+ subscriptionJson: import("convex/values").VString<string, "required">;
117
+ evidenceJson: import("convex/values").VString<string, "required">;
118
+ occurredAt: import("convex/values").VFloat64<number | undefined, "optional">;
119
+ at: import("convex/values").VFloat64<number, "required">;
120
+ }, "required", "at" | "eventId" | "evidenceJson" | "key" | "occurredAt" | "reason" | "recordJson" | "scopeKey" | "sequence" | "state" | "subscriptionJson">, {
121
+ by_event: ["eventId", "_creationTime"];
122
+ by_scope_occurrence: ["scopeKey", "occurredAt", "_creationTime"];
123
+ by_scope_time: ["scopeKey", "at", "_creationTime"];
124
+ }, {}, {}>;
17
125
  usageAllowancePolicies: import("convex/server").TableDefinition<import("convex/values").VObject<{
18
126
  bindingJson: string;
19
127
  consumed: string;
@@ -47,10 +155,10 @@ export declare function setup(scope?: Scope): Promise<{
47
155
  at: number;
48
156
  evidenceJson: string;
49
157
  key: string;
50
- kind: "commit" | "policy" | "release" | "reservation";
158
+ kind: "commit" | "correction" | "policy" | "release" | "reservation";
51
159
  }, {
52
160
  key: import("convex/values").VString<string, "required">;
53
- kind: import("convex/values").VUnion<"commit" | "policy" | "release" | "reservation", [import("convex/values").VLiteral<"policy", "required">, import("convex/values").VLiteral<"reservation", "required">, import("convex/values").VLiteral<"commit", "required">, import("convex/values").VLiteral<"release", "required">], "required", never>;
161
+ kind: import("convex/values").VUnion<"commit" | "correction" | "policy" | "release" | "reservation", [import("convex/values").VLiteral<"policy", "required">, import("convex/values").VLiteral<"reservation", "required">, import("convex/values").VLiteral<"commit", "required">, import("convex/values").VLiteral<"release", "required">, import("convex/values").VLiteral<"correction", "required">], "required", never>;
54
162
  evidenceJson: import("convex/values").VString<string, "required">;
55
163
  at: import("convex/values").VFloat64<number, "required">;
56
164
  }, "required", "at" | "evidenceJson" | "key" | "kind">, {
@@ -257,6 +365,7 @@ export declare function setup(scope?: Scope): Promise<{
257
365
  }, {}, {}>;
258
366
  usageOutbox: import("convex/server").TableDefinition<import("convex/values").VObject<{
259
367
  attempts: number;
368
+ correctionKey?: string | undefined;
260
369
  definitionVersion?: 1 | undefined;
261
370
  dispatch?: string | undefined;
262
371
  eventId: import("convex/values").GenericId<"usageEvents">;
@@ -267,13 +376,13 @@ export declare function setup(scope?: Scope): Promise<{
267
376
  nextAttemptAt: number;
268
377
  provider?: string | undefined;
269
378
  providerIdentifier: string;
270
- reason?: "administrative_hold" | "billing_period_closed" | "delivery_window_expired" | "provider_outcome_unknown" | "provider_rejected" | "provider_unavailable" | "rate_limited" | "retry_exhausted" | "scope_busy" | undefined;
379
+ reason?: "administrative_hold" | "billing_period_closed" | "delivery_window_expired" | "provider_outcome_unknown" | "provider_rejected" | "provider_unavailable" | "rate_limited" | "retry_exhausted" | "scope_busy" | "usage_canceled" | undefined;
271
380
  receipt?: {
272
381
  created: number;
273
382
  identifier: string;
274
383
  } | undefined;
275
384
  scopeKey: string;
276
- state: "held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown";
385
+ state: "canceled" | "held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown";
277
386
  workflowId?: string | undefined;
278
387
  }, {
279
388
  historySequence: import("convex/values").VFloat64<number | undefined, "optional">;
@@ -283,7 +392,7 @@ export declare function setup(scope?: Scope): Promise<{
283
392
  firstSendAt: import("convex/values").VFloat64<number | undefined, "optional">;
284
393
  leaseUntil: import("convex/values").VFloat64<number | undefined, "optional">;
285
394
  held: import("convex/values").VBoolean<boolean | undefined, "optional">;
286
- reason: import("convex/values").VUnion<"administrative_hold" | "billing_period_closed" | "delivery_window_expired" | "provider_outcome_unknown" | "provider_rejected" | "provider_unavailable" | "rate_limited" | "retry_exhausted" | "scope_busy" | undefined, [import("convex/values").VLiteral<"billing_period_closed", "required">, import("convex/values").VLiteral<"rate_limited", "required">, import("convex/values").VLiteral<"provider_unavailable", "required">, import("convex/values").VLiteral<"provider_outcome_unknown", "required">, import("convex/values").VLiteral<"provider_rejected", "required">, import("convex/values").VLiteral<"retry_exhausted", "required">, import("convex/values").VLiteral<"delivery_window_expired", "required">, import("convex/values").VLiteral<"scope_busy", "required">, import("convex/values").VLiteral<"administrative_hold", "required">], "optional", never>;
395
+ reason: import("convex/values").VUnion<"administrative_hold" | "billing_period_closed" | "delivery_window_expired" | "provider_outcome_unknown" | "provider_rejected" | "provider_unavailable" | "rate_limited" | "retry_exhausted" | "scope_busy" | "usage_canceled" | undefined, [import("convex/values").VLiteral<"usage_canceled", "required">, import("convex/values").VLiteral<"billing_period_closed", "required">, import("convex/values").VLiteral<"rate_limited", "required">, import("convex/values").VLiteral<"provider_unavailable", "required">, import("convex/values").VLiteral<"provider_outcome_unknown", "required">, import("convex/values").VLiteral<"provider_rejected", "required">, import("convex/values").VLiteral<"retry_exhausted", "required">, import("convex/values").VLiteral<"delivery_window_expired", "required">, import("convex/values").VLiteral<"scope_busy", "required">, import("convex/values").VLiteral<"administrative_hold", "required">], "optional", never>;
287
396
  receipt: import("convex/values").VObject<{
288
397
  created: number;
289
398
  identifier: string;
@@ -291,14 +400,15 @@ export declare function setup(scope?: Scope): Promise<{
291
400
  identifier: import("convex/values").VString<string, "required">;
292
401
  created: import("convex/values").VFloat64<number, "required">;
293
402
  }, "optional", "created" | "identifier">;
403
+ correctionKey: import("convex/values").VString<string | undefined, "optional">;
294
404
  eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
295
405
  scopeKey: import("convex/values").VString<string, "required">;
296
- state: import("convex/values").VUnion<"held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown", [import("convex/values").VLiteral<"queued", "required">, import("convex/values").VLiteral<"sending", "required">, import("convex/values").VLiteral<"provider_accepted", "required">, import("convex/values").VLiteral<"rejected", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"held", "required">], "required", never>;
406
+ state: import("convex/values").VUnion<"canceled" | "held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown", [import("convex/values").VLiteral<"queued", "required">, import("convex/values").VLiteral<"canceled", "required">, import("convex/values").VLiteral<"sending", "required">, import("convex/values").VLiteral<"provider_accepted", "required">, import("convex/values").VLiteral<"rejected", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"held", "required">], "required", never>;
297
407
  attempts: import("convex/values").VFloat64<number, "required">;
298
408
  nextAttemptAt: import("convex/values").VFloat64<number, "required">;
299
409
  providerIdentifier: import("convex/values").VString<string, "required">;
300
410
  dispatch: import("convex/values").VString<string | undefined, "optional">;
301
- }, "required", "attempts" | "definitionVersion" | "dispatch" | "eventId" | "firstSendAt" | "held" | "historySequence" | "leaseUntil" | "nextAttemptAt" | "provider" | "providerIdentifier" | "reason" | "receipt" | "receipt.created" | "receipt.identifier" | "scopeKey" | "state" | "workflowId">, {
411
+ }, "required", "attempts" | "correctionKey" | "definitionVersion" | "dispatch" | "eventId" | "firstSendAt" | "held" | "historySequence" | "leaseUntil" | "nextAttemptAt" | "provider" | "providerIdentifier" | "reason" | "receipt" | "receipt.created" | "receipt.identifier" | "scopeKey" | "state" | "workflowId">, {
302
412
  by_event: ["eventId", "_creationTime"];
303
413
  by_provider_identifier: ["providerIdentifier", "_creationTime"];
304
414
  by_scope_state: ["scopeKey", "state", "_creationTime"];
@@ -454,13 +564,13 @@ export declare function setup(scope?: Scope): Promise<{
454
564
  at: number;
455
565
  evidenceJson: string;
456
566
  fingerprint: string;
457
- kind: "closure" | "commit" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation";
567
+ kind: "closure" | "commit" | "correction" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation";
458
568
  purchaseKey?: string | undefined;
459
569
  sourceKey: string;
460
570
  }, {
461
571
  accountKey: import("convex/values").VString<string, "required">;
462
572
  purchaseKey: import("convex/values").VString<string | undefined, "optional">;
463
- kind: import("convex/values").VUnion<"closure" | "commit" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation", [import("convex/values").VLiteral<"purchase", "required">, import("convex/values").VLiteral<"payment", "required">, import("convex/values").VLiteral<"grant", "required">, import("convex/values").VLiteral<"reservation", "required">, import("convex/values").VLiteral<"commit", "required">, import("convex/values").VLiteral<"release", "required">, import("convex/values").VLiteral<"observation", "required">, import("convex/values").VLiteral<"recovery", "required">, import("convex/values").VLiteral<"closure", "required">], "required", never>;
573
+ kind: import("convex/values").VUnion<"closure" | "commit" | "correction" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation", [import("convex/values").VLiteral<"purchase", "required">, import("convex/values").VLiteral<"payment", "required">, import("convex/values").VLiteral<"grant", "required">, import("convex/values").VLiteral<"reservation", "required">, import("convex/values").VLiteral<"commit", "required">, import("convex/values").VLiteral<"release", "required">, import("convex/values").VLiteral<"observation", "required">, import("convex/values").VLiteral<"recovery", "required">, import("convex/values").VLiteral<"closure", "required">, import("convex/values").VLiteral<"correction", "required">], "required", never>;
464
574
  sourceKey: import("convex/values").VString<string, "required">;
465
575
  fingerprint: import("convex/values").VString<string, "required">;
466
576
  evidenceJson: import("convex/values").VString<string, "required">;
@@ -1009,6 +1119,15 @@ export declare function setup(scope?: Scope): Promise<{
1009
1119
  activePhase?: "execute" | "reconcile" | undefined;
1010
1120
  allocation?: {
1011
1121
  adjustmentAmount?: number | undefined;
1122
+ creditSource?: {
1123
+ creditGrantId: string;
1124
+ customerAccount: string;
1125
+ livemode: boolean;
1126
+ purchaseId: string;
1127
+ stripeAccountId: string;
1128
+ stripePriceId: string;
1129
+ stripeProductId: string;
1130
+ } | undefined;
1012
1131
  currency: string;
1013
1132
  gross: number;
1014
1133
  paymentId?: string | undefined;
@@ -1022,6 +1141,22 @@ export declare function setup(scope?: Scope): Promise<{
1022
1141
  destinationAccountId: string;
1023
1142
  role: "affiliate" | "other" | "store";
1024
1143
  }[];
1144
+ usageSource?: {
1145
+ customerAccount: string;
1146
+ invoicePaymentId: string;
1147
+ livemode: boolean;
1148
+ meterId: string;
1149
+ model: "included_overage" | "pay_as_you_go";
1150
+ period: {
1151
+ end: number;
1152
+ start: number;
1153
+ };
1154
+ stripeAccountId: string;
1155
+ stripePriceId: string;
1156
+ stripeProductId: string;
1157
+ subscriptionId: string;
1158
+ subscriptionItemId: string;
1159
+ } | undefined;
1025
1160
  } | undefined;
1026
1161
  cancelRequested: boolean;
1027
1162
  completion?: string | undefined;
@@ -1056,6 +1191,15 @@ export declare function setup(scope?: Scope): Promise<{
1056
1191
  retryDelayMs: import("convex/values").VFloat64<number, "required">;
1057
1192
  allocation: import("convex/values").VObject<{
1058
1193
  adjustmentAmount?: number | undefined;
1194
+ creditSource?: {
1195
+ creditGrantId: string;
1196
+ customerAccount: string;
1197
+ livemode: boolean;
1198
+ purchaseId: string;
1199
+ stripeAccountId: string;
1200
+ stripePriceId: string;
1201
+ stripeProductId: string;
1202
+ } | undefined;
1059
1203
  currency: string;
1060
1204
  gross: number;
1061
1205
  paymentId?: string | undefined;
@@ -1069,10 +1213,77 @@ export declare function setup(scope?: Scope): Promise<{
1069
1213
  destinationAccountId: string;
1070
1214
  role: "affiliate" | "other" | "store";
1071
1215
  }[];
1216
+ usageSource?: {
1217
+ customerAccount: string;
1218
+ invoicePaymentId: string;
1219
+ livemode: boolean;
1220
+ meterId: string;
1221
+ model: "included_overage" | "pay_as_you_go";
1222
+ period: {
1223
+ end: number;
1224
+ start: number;
1225
+ };
1226
+ stripeAccountId: string;
1227
+ stripePriceId: string;
1228
+ stripeProductId: string;
1229
+ subscriptionId: string;
1230
+ subscriptionItemId: string;
1231
+ } | undefined;
1072
1232
  } | undefined, {
1073
1233
  sourceChargeId: import("convex/values").VString<string, "required">;
1074
1234
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
1075
1235
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
1236
+ usageSource: import("convex/values").VObject<{
1237
+ customerAccount: string;
1238
+ invoicePaymentId: string;
1239
+ livemode: boolean;
1240
+ meterId: string;
1241
+ model: "included_overage" | "pay_as_you_go";
1242
+ period: {
1243
+ end: number;
1244
+ start: number;
1245
+ };
1246
+ stripeAccountId: string;
1247
+ stripePriceId: string;
1248
+ stripeProductId: string;
1249
+ subscriptionId: string;
1250
+ subscriptionItemId: string;
1251
+ } | undefined, {
1252
+ stripeAccountId: import("convex/values").VString<string, "required">;
1253
+ customerAccount: import("convex/values").VString<string, "required">;
1254
+ livemode: import("convex/values").VBoolean<boolean, "required">;
1255
+ meterId: import("convex/values").VString<string, "required">;
1256
+ stripePriceId: import("convex/values").VString<string, "required">;
1257
+ stripeProductId: import("convex/values").VString<string, "required">;
1258
+ subscriptionId: import("convex/values").VString<string, "required">;
1259
+ subscriptionItemId: import("convex/values").VString<string, "required">;
1260
+ invoicePaymentId: import("convex/values").VString<string, "required">;
1261
+ period: import("convex/values").VObject<{
1262
+ end: number;
1263
+ start: number;
1264
+ }, {
1265
+ start: import("convex/values").VFloat64<number, "required">;
1266
+ end: import("convex/values").VFloat64<number, "required">;
1267
+ }, "required", "end" | "start">;
1268
+ model: import("convex/values").VUnion<"included_overage" | "pay_as_you_go", [import("convex/values").VLiteral<"pay_as_you_go", "required">, import("convex/values").VLiteral<"included_overage", "required">], "required", never>;
1269
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
1270
+ creditSource: import("convex/values").VObject<{
1271
+ creditGrantId: string;
1272
+ customerAccount: string;
1273
+ livemode: boolean;
1274
+ purchaseId: string;
1275
+ stripeAccountId: string;
1276
+ stripePriceId: string;
1277
+ stripeProductId: string;
1278
+ } | undefined, {
1279
+ stripeAccountId: import("convex/values").VString<string, "required">;
1280
+ customerAccount: import("convex/values").VString<string, "required">;
1281
+ livemode: import("convex/values").VBoolean<boolean, "required">;
1282
+ purchaseId: import("convex/values").VString<string, "required">;
1283
+ creditGrantId: import("convex/values").VString<string, "required">;
1284
+ stripePriceId: import("convex/values").VString<string, "required">;
1285
+ stripeProductId: import("convex/values").VString<string, "required">;
1286
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
1076
1287
  gross: import("convex/values").VFloat64<number, "required">;
1077
1288
  currency: import("convex/values").VString<string, "required">;
1078
1289
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -1092,7 +1303,7 @@ export declare function setup(scope?: Scope): Promise<{
1092
1303
  role: import("convex/values").VUnion<"affiliate" | "other" | "store", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
1093
1304
  amount: import("convex/values").VFloat64<number, "required">;
1094
1305
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
1095
- }, "optional", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">;
1306
+ }, "optional", "adjustmentAmount" | "creditSource" | "creditSource.creditGrantId" | "creditSource.customerAccount" | "creditSource.livemode" | "creditSource.purchaseId" | "creditSource.stripeAccountId" | "creditSource.stripePriceId" | "creditSource.stripeProductId" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers" | "usageSource" | "usageSource.customerAccount" | "usageSource.invoicePaymentId" | "usageSource.livemode" | "usageSource.meterId" | "usageSource.model" | "usageSource.period" | "usageSource.period.end" | "usageSource.period.start" | "usageSource.stripeAccountId" | "usageSource.stripePriceId" | "usageSource.stripeProductId" | "usageSource.subscriptionId" | "usageSource.subscriptionItemId">;
1096
1307
  version: import("convex/values").VFloat64<number, "required">;
1097
1308
  sourceKind: import("convex/values").VUnion<"invoice" | "settlement", [import("convex/values").VLiteral<"settlement", "required">, import("convex/values").VLiteral<"invoice", "required">], "required", never>;
1098
1309
  sourceId: import("convex/values").VString<string, "required">;
@@ -1103,7 +1314,7 @@ export declare function setup(scope?: Scope): Promise<{
1103
1314
  activePhase: import("convex/values").VUnion<"execute" | "reconcile" | undefined, [import("convex/values").VLiteral<"execute", "required">, import("convex/values").VLiteral<"reconcile", "required">], "optional", never>;
1104
1315
  resumeQueued: import("convex/values").VBoolean<boolean, "required">;
1105
1316
  outcome: import("convex/values").VUnion<"collect" | "release" | undefined, [import("convex/values").VLiteral<"collect", "required">, import("convex/values").VLiteral<"release", "required">], "optional", never>;
1106
- }, "required", "accountId" | "activePhase" | "allocation" | "allocation.adjustmentAmount" | "allocation.currency" | "allocation.gross" | "allocation.paymentId" | "allocation.paymentIntentId" | "allocation.platformNet" | "allocation.processingFee" | "allocation.sourceChargeId" | "allocation.sourceInvoiceId" | "allocation.transfers" | "cancelRequested" | "completion" | "currency" | "definitionVersion" | "groupKey" | "maxAttempts" | "outcome" | "provider" | "providerApiVersion" | "providerStarted" | "releaseUncollectible" | "resumeQueued" | "retryDelayMs" | "scopeKey" | "sourceId" | "sourceKind" | "status" | "version" | "workflowId">, {
1317
+ }, "required", "accountId" | "activePhase" | "allocation" | "allocation.adjustmentAmount" | "allocation.creditSource" | "allocation.creditSource.creditGrantId" | "allocation.creditSource.customerAccount" | "allocation.creditSource.livemode" | "allocation.creditSource.purchaseId" | "allocation.creditSource.stripeAccountId" | "allocation.creditSource.stripePriceId" | "allocation.creditSource.stripeProductId" | "allocation.currency" | "allocation.gross" | "allocation.paymentId" | "allocation.paymentIntentId" | "allocation.platformNet" | "allocation.processingFee" | "allocation.sourceChargeId" | "allocation.sourceInvoiceId" | "allocation.transfers" | "allocation.usageSource" | "allocation.usageSource.customerAccount" | "allocation.usageSource.invoicePaymentId" | "allocation.usageSource.livemode" | "allocation.usageSource.meterId" | "allocation.usageSource.model" | "allocation.usageSource.period" | "allocation.usageSource.period.end" | "allocation.usageSource.period.start" | "allocation.usageSource.stripeAccountId" | "allocation.usageSource.stripePriceId" | "allocation.usageSource.stripeProductId" | "allocation.usageSource.subscriptionId" | "allocation.usageSource.subscriptionItemId" | "cancelRequested" | "completion" | "currency" | "definitionVersion" | "groupKey" | "maxAttempts" | "outcome" | "provider" | "providerApiVersion" | "providerStarted" | "releaseUncollectible" | "resumeQueued" | "retryDelayMs" | "scopeKey" | "sourceId" | "sourceKind" | "status" | "version" | "workflowId">, {
1107
1318
  by_group: ["groupKey", "_creationTime"];
1108
1319
  by_source: ["sourceKind", "sourceId", "_creationTime"];
1109
1320
  }, {}, {}>;
@@ -1112,6 +1323,15 @@ export declare function setup(scope?: Scope): Promise<{
1112
1323
  accountId: string;
1113
1324
  allocation?: {
1114
1325
  adjustmentAmount?: number | undefined;
1326
+ creditSource?: {
1327
+ creditGrantId: string;
1328
+ customerAccount: string;
1329
+ livemode: boolean;
1330
+ purchaseId: string;
1331
+ stripeAccountId: string;
1332
+ stripePriceId: string;
1333
+ stripeProductId: string;
1334
+ } | undefined;
1115
1335
  currency: string;
1116
1336
  gross: number;
1117
1337
  paymentId?: string | undefined;
@@ -1125,6 +1345,22 @@ export declare function setup(scope?: Scope): Promise<{
1125
1345
  destinationAccountId: string;
1126
1346
  role: "affiliate" | "other" | "store";
1127
1347
  }[];
1348
+ usageSource?: {
1349
+ customerAccount: string;
1350
+ invoicePaymentId: string;
1351
+ livemode: boolean;
1352
+ meterId: string;
1353
+ model: "included_overage" | "pay_as_you_go";
1354
+ period: {
1355
+ end: number;
1356
+ start: number;
1357
+ };
1358
+ stripeAccountId: string;
1359
+ stripePriceId: string;
1360
+ stripeProductId: string;
1361
+ subscriptionId: string;
1362
+ subscriptionItemId: string;
1363
+ } | undefined;
1128
1364
  } | undefined;
1129
1365
  completion?: string | undefined;
1130
1366
  currency: string;
@@ -1145,6 +1381,15 @@ export declare function setup(scope?: Scope): Promise<{
1145
1381
  accountId: string;
1146
1382
  allocation?: {
1147
1383
  adjustmentAmount?: number | undefined;
1384
+ creditSource?: {
1385
+ creditGrantId: string;
1386
+ customerAccount: string;
1387
+ livemode: boolean;
1388
+ purchaseId: string;
1389
+ stripeAccountId: string;
1390
+ stripePriceId: string;
1391
+ stripeProductId: string;
1392
+ } | undefined;
1148
1393
  currency: string;
1149
1394
  gross: number;
1150
1395
  paymentId?: string | undefined;
@@ -1158,6 +1403,22 @@ export declare function setup(scope?: Scope): Promise<{
1158
1403
  destinationAccountId: string;
1159
1404
  role: "affiliate" | "other" | "store";
1160
1405
  }[];
1406
+ usageSource?: {
1407
+ customerAccount: string;
1408
+ invoicePaymentId: string;
1409
+ livemode: boolean;
1410
+ meterId: string;
1411
+ model: "included_overage" | "pay_as_you_go";
1412
+ period: {
1413
+ end: number;
1414
+ start: number;
1415
+ };
1416
+ stripeAccountId: string;
1417
+ stripePriceId: string;
1418
+ stripeProductId: string;
1419
+ subscriptionId: string;
1420
+ subscriptionItemId: string;
1421
+ } | undefined;
1161
1422
  } | undefined;
1162
1423
  completion?: string | undefined;
1163
1424
  currency: string;
@@ -1183,6 +1444,15 @@ export declare function setup(scope?: Scope): Promise<{
1183
1444
  retryDelayMs: import("convex/values").VFloat64<number, "required">;
1184
1445
  allocation: import("convex/values").VObject<{
1185
1446
  adjustmentAmount?: number | undefined;
1447
+ creditSource?: {
1448
+ creditGrantId: string;
1449
+ customerAccount: string;
1450
+ livemode: boolean;
1451
+ purchaseId: string;
1452
+ stripeAccountId: string;
1453
+ stripePriceId: string;
1454
+ stripeProductId: string;
1455
+ } | undefined;
1186
1456
  currency: string;
1187
1457
  gross: number;
1188
1458
  paymentId?: string | undefined;
@@ -1196,10 +1466,77 @@ export declare function setup(scope?: Scope): Promise<{
1196
1466
  destinationAccountId: string;
1197
1467
  role: "affiliate" | "other" | "store";
1198
1468
  }[];
1469
+ usageSource?: {
1470
+ customerAccount: string;
1471
+ invoicePaymentId: string;
1472
+ livemode: boolean;
1473
+ meterId: string;
1474
+ model: "included_overage" | "pay_as_you_go";
1475
+ period: {
1476
+ end: number;
1477
+ start: number;
1478
+ };
1479
+ stripeAccountId: string;
1480
+ stripePriceId: string;
1481
+ stripeProductId: string;
1482
+ subscriptionId: string;
1483
+ subscriptionItemId: string;
1484
+ } | undefined;
1199
1485
  } | undefined, {
1200
1486
  sourceChargeId: import("convex/values").VString<string, "required">;
1201
1487
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
1202
1488
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
1489
+ usageSource: import("convex/values").VObject<{
1490
+ customerAccount: string;
1491
+ invoicePaymentId: string;
1492
+ livemode: boolean;
1493
+ meterId: string;
1494
+ model: "included_overage" | "pay_as_you_go";
1495
+ period: {
1496
+ end: number;
1497
+ start: number;
1498
+ };
1499
+ stripeAccountId: string;
1500
+ stripePriceId: string;
1501
+ stripeProductId: string;
1502
+ subscriptionId: string;
1503
+ subscriptionItemId: string;
1504
+ } | undefined, {
1505
+ stripeAccountId: import("convex/values").VString<string, "required">;
1506
+ customerAccount: import("convex/values").VString<string, "required">;
1507
+ livemode: import("convex/values").VBoolean<boolean, "required">;
1508
+ meterId: import("convex/values").VString<string, "required">;
1509
+ stripePriceId: import("convex/values").VString<string, "required">;
1510
+ stripeProductId: import("convex/values").VString<string, "required">;
1511
+ subscriptionId: import("convex/values").VString<string, "required">;
1512
+ subscriptionItemId: import("convex/values").VString<string, "required">;
1513
+ invoicePaymentId: import("convex/values").VString<string, "required">;
1514
+ period: import("convex/values").VObject<{
1515
+ end: number;
1516
+ start: number;
1517
+ }, {
1518
+ start: import("convex/values").VFloat64<number, "required">;
1519
+ end: import("convex/values").VFloat64<number, "required">;
1520
+ }, "required", "end" | "start">;
1521
+ model: import("convex/values").VUnion<"included_overage" | "pay_as_you_go", [import("convex/values").VLiteral<"pay_as_you_go", "required">, import("convex/values").VLiteral<"included_overage", "required">], "required", never>;
1522
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
1523
+ creditSource: import("convex/values").VObject<{
1524
+ creditGrantId: string;
1525
+ customerAccount: string;
1526
+ livemode: boolean;
1527
+ purchaseId: string;
1528
+ stripeAccountId: string;
1529
+ stripePriceId: string;
1530
+ stripeProductId: string;
1531
+ } | undefined, {
1532
+ stripeAccountId: import("convex/values").VString<string, "required">;
1533
+ customerAccount: import("convex/values").VString<string, "required">;
1534
+ livemode: import("convex/values").VBoolean<boolean, "required">;
1535
+ purchaseId: import("convex/values").VString<string, "required">;
1536
+ creditGrantId: import("convex/values").VString<string, "required">;
1537
+ stripePriceId: import("convex/values").VString<string, "required">;
1538
+ stripeProductId: import("convex/values").VString<string, "required">;
1539
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
1203
1540
  gross: import("convex/values").VFloat64<number, "required">;
1204
1541
  currency: import("convex/values").VString<string, "required">;
1205
1542
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -1219,10 +1556,10 @@ export declare function setup(scope?: Scope): Promise<{
1219
1556
  role: import("convex/values").VUnion<"affiliate" | "other" | "store", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
1220
1557
  amount: import("convex/values").VFloat64<number, "required">;
1221
1558
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
1222
- }, "optional", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">;
1223
- }, "required", "accountId" | "allocation" | "allocation.adjustmentAmount" | "allocation.currency" | "allocation.gross" | "allocation.paymentId" | "allocation.paymentIntentId" | "allocation.platformNet" | "allocation.processingFee" | "allocation.sourceChargeId" | "allocation.sourceInvoiceId" | "allocation.transfers" | "completion" | "currency" | "definitionVersion" | "groupKey" | "maxAttempts" | "provider" | "providerApiVersion" | "releaseUncollectible" | "retryDelayMs" | "scopeKey">;
1559
+ }, "optional", "adjustmentAmount" | "creditSource" | "creditSource.creditGrantId" | "creditSource.customerAccount" | "creditSource.livemode" | "creditSource.purchaseId" | "creditSource.stripeAccountId" | "creditSource.stripePriceId" | "creditSource.stripeProductId" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers" | "usageSource" | "usageSource.customerAccount" | "usageSource.invoicePaymentId" | "usageSource.livemode" | "usageSource.meterId" | "usageSource.model" | "usageSource.period" | "usageSource.period.end" | "usageSource.period.start" | "usageSource.stripeAccountId" | "usageSource.stripePriceId" | "usageSource.stripeProductId" | "usageSource.subscriptionId" | "usageSource.subscriptionItemId">;
1560
+ }, "required", "accountId" | "allocation" | "allocation.adjustmentAmount" | "allocation.creditSource" | "allocation.creditSource.creditGrantId" | "allocation.creditSource.customerAccount" | "allocation.creditSource.livemode" | "allocation.creditSource.purchaseId" | "allocation.creditSource.stripeAccountId" | "allocation.creditSource.stripePriceId" | "allocation.creditSource.stripeProductId" | "allocation.currency" | "allocation.gross" | "allocation.paymentId" | "allocation.paymentIntentId" | "allocation.platformNet" | "allocation.processingFee" | "allocation.sourceChargeId" | "allocation.sourceInvoiceId" | "allocation.transfers" | "allocation.usageSource" | "allocation.usageSource.customerAccount" | "allocation.usageSource.invoicePaymentId" | "allocation.usageSource.livemode" | "allocation.usageSource.meterId" | "allocation.usageSource.model" | "allocation.usageSource.period" | "allocation.usageSource.period.end" | "allocation.usageSource.period.start" | "allocation.usageSource.stripeAccountId" | "allocation.usageSource.stripePriceId" | "allocation.usageSource.stripeProductId" | "allocation.usageSource.subscriptionId" | "allocation.usageSource.subscriptionItemId" | "completion" | "currency" | "definitionVersion" | "groupKey" | "maxAttempts" | "provider" | "providerApiVersion" | "releaseUncollectible" | "retryDelayMs" | "scopeKey">;
1224
1561
  operationId: import("convex/values").VId<import("convex/values").GenericId<"recoveryWorkflowOperations">, "required">;
1225
- }, "required", "binding" | "binding.accountId" | "binding.allocation" | "binding.allocation.adjustmentAmount" | "binding.allocation.currency" | "binding.allocation.gross" | "binding.allocation.paymentId" | "binding.allocation.paymentIntentId" | "binding.allocation.platformNet" | "binding.allocation.processingFee" | "binding.allocation.sourceChargeId" | "binding.allocation.sourceInvoiceId" | "binding.allocation.transfers" | "binding.completion" | "binding.currency" | "binding.definitionVersion" | "binding.groupKey" | "binding.maxAttempts" | "binding.provider" | "binding.providerApiVersion" | "binding.releaseUncollectible" | "binding.retryDelayMs" | "binding.scopeKey" | "operationId" | "requestKey">, {
1562
+ }, "required", "binding" | "binding.accountId" | "binding.allocation" | "binding.allocation.adjustmentAmount" | "binding.allocation.creditSource" | "binding.allocation.creditSource.creditGrantId" | "binding.allocation.creditSource.customerAccount" | "binding.allocation.creditSource.livemode" | "binding.allocation.creditSource.purchaseId" | "binding.allocation.creditSource.stripeAccountId" | "binding.allocation.creditSource.stripePriceId" | "binding.allocation.creditSource.stripeProductId" | "binding.allocation.currency" | "binding.allocation.gross" | "binding.allocation.paymentId" | "binding.allocation.paymentIntentId" | "binding.allocation.platformNet" | "binding.allocation.processingFee" | "binding.allocation.sourceChargeId" | "binding.allocation.sourceInvoiceId" | "binding.allocation.transfers" | "binding.allocation.usageSource" | "binding.allocation.usageSource.customerAccount" | "binding.allocation.usageSource.invoicePaymentId" | "binding.allocation.usageSource.livemode" | "binding.allocation.usageSource.meterId" | "binding.allocation.usageSource.model" | "binding.allocation.usageSource.period" | "binding.allocation.usageSource.period.end" | "binding.allocation.usageSource.period.start" | "binding.allocation.usageSource.stripeAccountId" | "binding.allocation.usageSource.stripePriceId" | "binding.allocation.usageSource.stripeProductId" | "binding.allocation.usageSource.subscriptionId" | "binding.allocation.usageSource.subscriptionItemId" | "binding.completion" | "binding.currency" | "binding.definitionVersion" | "binding.groupKey" | "binding.maxAttempts" | "binding.provider" | "binding.providerApiVersion" | "binding.releaseUncollectible" | "binding.retryDelayMs" | "binding.scopeKey" | "operationId" | "requestKey">, {
1226
1563
  by_key: ["requestKey", "_creationTime"];
1227
1564
  }, {}, {}>;
1228
1565
  balanceFundingPreparations: import("convex/server").TableDefinition<import("convex/values").VObject<{
@@ -1530,6 +1867,14 @@ export declare function setup(scope?: Scope): Promise<{
1530
1867
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
1531
1868
  requestKey: string;
1532
1869
  result?: {
1870
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
1871
+ retryable: false;
1872
+ status: "conflict";
1873
+ } | {
1874
+ reason: "policy_invalid";
1875
+ retryable: false;
1876
+ status: "rejected";
1877
+ } | {
1533
1878
  operation: {
1534
1879
  accountId: string;
1535
1880
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -1540,14 +1885,6 @@ export declare function setup(scope?: Scope): Promise<{
1540
1885
  } | {
1541
1886
  enabled: boolean;
1542
1887
  status: "unchanged";
1543
- } | {
1544
- reason: "identity_changed" | "revision_changed" | "scope_busy";
1545
- retryable: false;
1546
- status: "conflict";
1547
- } | {
1548
- reason: "policy_invalid";
1549
- retryable: false;
1550
- status: "rejected";
1551
1888
  } | {
1552
1889
  reason: "provider_pending";
1553
1890
  retryable: true;
@@ -1558,6 +1895,14 @@ export declare function setup(scope?: Scope): Promise<{
1558
1895
  payload: import("convex/values").VString<string, "required">;
1559
1896
  preparationId: import("convex/values").VId<import("convex/values").GenericId<"balanceFundingPreparations">, "required">;
1560
1897
  result: import("convex/values").VUnion<{
1898
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
1899
+ retryable: false;
1900
+ status: "conflict";
1901
+ } | {
1902
+ reason: "policy_invalid";
1903
+ retryable: false;
1904
+ status: "rejected";
1905
+ } | {
1561
1906
  operation: {
1562
1907
  accountId: string;
1563
1908
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -1568,14 +1913,6 @@ export declare function setup(scope?: Scope): Promise<{
1568
1913
  } | {
1569
1914
  enabled: boolean;
1570
1915
  status: "unchanged";
1571
- } | {
1572
- reason: "identity_changed" | "revision_changed" | "scope_busy";
1573
- retryable: false;
1574
- status: "conflict";
1575
- } | {
1576
- reason: "policy_invalid";
1577
- retryable: false;
1578
- status: "rejected";
1579
1916
  } | {
1580
1917
  reason: "provider_pending";
1581
1918
  retryable: true;
@@ -3020,6 +3357,15 @@ export declare function setup(scope?: Scope): Promise<{
3020
3357
  }, {}, {}>;
3021
3358
  settlementAllocations: import("convex/server").TableDefinition<import("convex/values").VObject<{
3022
3359
  adjustmentAmount?: number | undefined;
3360
+ creditSource?: {
3361
+ creditGrantId: string;
3362
+ customerAccount: string;
3363
+ livemode: boolean;
3364
+ purchaseId: string;
3365
+ stripeAccountId: string;
3366
+ stripePriceId: string;
3367
+ stripeProductId: string;
3368
+ } | undefined;
3023
3369
  currency: string;
3024
3370
  gross: number;
3025
3371
  paymentId?: string | undefined;
@@ -3033,10 +3379,77 @@ export declare function setup(scope?: Scope): Promise<{
3033
3379
  destinationAccountId: string;
3034
3380
  role: "affiliate" | "other" | "store";
3035
3381
  }[];
3382
+ usageSource?: {
3383
+ customerAccount: string;
3384
+ invoicePaymentId: string;
3385
+ livemode: boolean;
3386
+ meterId: string;
3387
+ model: "included_overage" | "pay_as_you_go";
3388
+ period: {
3389
+ end: number;
3390
+ start: number;
3391
+ };
3392
+ stripeAccountId: string;
3393
+ stripePriceId: string;
3394
+ stripeProductId: string;
3395
+ subscriptionId: string;
3396
+ subscriptionItemId: string;
3397
+ } | undefined;
3036
3398
  }, {
3037
3399
  sourceChargeId: import("convex/values").VString<string, "required">;
3038
3400
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
3039
3401
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
3402
+ usageSource: import("convex/values").VObject<{
3403
+ customerAccount: string;
3404
+ invoicePaymentId: string;
3405
+ livemode: boolean;
3406
+ meterId: string;
3407
+ model: "included_overage" | "pay_as_you_go";
3408
+ period: {
3409
+ end: number;
3410
+ start: number;
3411
+ };
3412
+ stripeAccountId: string;
3413
+ stripePriceId: string;
3414
+ stripeProductId: string;
3415
+ subscriptionId: string;
3416
+ subscriptionItemId: string;
3417
+ } | undefined, {
3418
+ stripeAccountId: import("convex/values").VString<string, "required">;
3419
+ customerAccount: import("convex/values").VString<string, "required">;
3420
+ livemode: import("convex/values").VBoolean<boolean, "required">;
3421
+ meterId: import("convex/values").VString<string, "required">;
3422
+ stripePriceId: import("convex/values").VString<string, "required">;
3423
+ stripeProductId: import("convex/values").VString<string, "required">;
3424
+ subscriptionId: import("convex/values").VString<string, "required">;
3425
+ subscriptionItemId: import("convex/values").VString<string, "required">;
3426
+ invoicePaymentId: import("convex/values").VString<string, "required">;
3427
+ period: import("convex/values").VObject<{
3428
+ end: number;
3429
+ start: number;
3430
+ }, {
3431
+ start: import("convex/values").VFloat64<number, "required">;
3432
+ end: import("convex/values").VFloat64<number, "required">;
3433
+ }, "required", "end" | "start">;
3434
+ model: import("convex/values").VUnion<"included_overage" | "pay_as_you_go", [import("convex/values").VLiteral<"pay_as_you_go", "required">, import("convex/values").VLiteral<"included_overage", "required">], "required", never>;
3435
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
3436
+ creditSource: import("convex/values").VObject<{
3437
+ creditGrantId: string;
3438
+ customerAccount: string;
3439
+ livemode: boolean;
3440
+ purchaseId: string;
3441
+ stripeAccountId: string;
3442
+ stripePriceId: string;
3443
+ stripeProductId: string;
3444
+ } | undefined, {
3445
+ stripeAccountId: import("convex/values").VString<string, "required">;
3446
+ customerAccount: import("convex/values").VString<string, "required">;
3447
+ livemode: import("convex/values").VBoolean<boolean, "required">;
3448
+ purchaseId: import("convex/values").VString<string, "required">;
3449
+ creditGrantId: import("convex/values").VString<string, "required">;
3450
+ stripePriceId: import("convex/values").VString<string, "required">;
3451
+ stripeProductId: import("convex/values").VString<string, "required">;
3452
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
3040
3453
  gross: import("convex/values").VFloat64<number, "required">;
3041
3454
  currency: import("convex/values").VString<string, "required">;
3042
3455
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -3056,7 +3469,7 @@ export declare function setup(scope?: Scope): Promise<{
3056
3469
  role: import("convex/values").VUnion<"affiliate" | "other" | "store", [import("convex/values").VLiteral<"store", "required">, import("convex/values").VLiteral<"affiliate", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
3057
3470
  amount: import("convex/values").VFloat64<number, "required">;
3058
3471
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
3059
- }, "required", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">, {
3472
+ }, "required", "adjustmentAmount" | "creditSource" | "creditSource.creditGrantId" | "creditSource.customerAccount" | "creditSource.livemode" | "creditSource.purchaseId" | "creditSource.stripeAccountId" | "creditSource.stripePriceId" | "creditSource.stripeProductId" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers" | "usageSource" | "usageSource.customerAccount" | "usageSource.invoicePaymentId" | "usageSource.livemode" | "usageSource.meterId" | "usageSource.model" | "usageSource.period" | "usageSource.period.end" | "usageSource.period.start" | "usageSource.stripeAccountId" | "usageSource.stripePriceId" | "usageSource.stripeProductId" | "usageSource.subscriptionId" | "usageSource.subscriptionItemId">, {
3060
3473
  by_source_charge: ["sourceChargeId", "_creationTime"];
3061
3474
  }, {}, {}>;
3062
3475
  commissionTerms: import("convex/server").TableDefinition<import("convex/values").VObject<{