@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
@@ -1,5 +1,113 @@
1
1
  export declare function large(count?: number, amount?: number): Promise<{
2
2
  t: import("convex-test").TestConvex<import("convex/server").SchemaDefinition<{
3
+ usageCorrectionClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
4
+ key: string;
5
+ operationKey: string;
6
+ proofJson: string;
7
+ }, {
8
+ key: import("convex/values").VString<string, "required">;
9
+ operationKey: import("convex/values").VString<string, "required">;
10
+ proofJson: import("convex/values").VString<string, "required">;
11
+ }, "required", "key" | "operationKey" | "proofJson">, {
12
+ by_key: ["key", "_creationTime"];
13
+ }, {}, {}>;
14
+ usageCorrections: import("convex/server").TableDefinition<import("convex/values").VObject<{
15
+ adjustmentJson?: string | undefined;
16
+ attempt: number;
17
+ attemptedAt?: number | undefined;
18
+ cashConsequence: "none" | "operator_resolution_required" | "verified_external_adjustment";
19
+ correctionId: string;
20
+ creditNoteId?: string | undefined;
21
+ customerAccount?: string | undefined;
22
+ eventId: import("convex/values").GenericId<"usageEvents">;
23
+ firstAttemptAt: number;
24
+ historyCount: number;
25
+ inputJson: string;
26
+ invoiceId?: string | undefined;
27
+ key: string;
28
+ leaseUntil?: number | undefined;
29
+ nativeAdjustmentId?: string | undefined;
30
+ nativeCreditNoteStatus?: "issued" | "void" | undefined;
31
+ nativeStatus?: "complete" | "pending" | undefined;
32
+ observedAt?: number | undefined;
33
+ quantity: string;
34
+ reason: string;
35
+ recordJson: string;
36
+ refundId?: string | undefined;
37
+ resolution?: "event_cancellation" | "invoice_credit" | undefined;
38
+ restoredQuantity: string;
39
+ scaledQuantity: string;
40
+ scopeKey: string;
41
+ state: "confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported";
42
+ stripeAccountId?: string | undefined;
43
+ subscriptionJson: string;
44
+ }, {
45
+ stripeAccountId: import("convex/values").VString<string | undefined, "optional">;
46
+ customerAccount: import("convex/values").VString<string | undefined, "optional">;
47
+ observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
48
+ nativeCreditNoteStatus: import("convex/values").VUnion<"issued" | "void" | undefined, [import("convex/values").VLiteral<"issued", "required">, import("convex/values").VLiteral<"void", "required">], "optional", never>;
49
+ 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>;
50
+ adjustmentJson: import("convex/values").VString<string | undefined, "optional">;
51
+ key: import("convex/values").VString<string, "required">;
52
+ scopeKey: import("convex/values").VString<string, "required">;
53
+ eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
54
+ correctionId: import("convex/values").VString<string, "required">;
55
+ inputJson: import("convex/values").VString<string, "required">;
56
+ recordJson: import("convex/values").VString<string, "required">;
57
+ subscriptionJson: import("convex/values").VString<string, "required">;
58
+ quantity: import("convex/values").VString<string, "required">;
59
+ scaledQuantity: import("convex/values").VString<string, "required">;
60
+ 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>;
61
+ reason: import("convex/values").VString<string, "required">;
62
+ firstAttemptAt: import("convex/values").VFloat64<number, "required">;
63
+ attemptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
64
+ leaseUntil: import("convex/values").VFloat64<number | undefined, "optional">;
65
+ attempt: import("convex/values").VFloat64<number, "required">;
66
+ nativeAdjustmentId: import("convex/values").VString<string | undefined, "optional">;
67
+ nativeStatus: import("convex/values").VUnion<"complete" | "pending" | undefined, [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"complete", "required">], "optional", never>;
68
+ invoiceId: import("convex/values").VString<string | undefined, "optional">;
69
+ creditNoteId: import("convex/values").VString<string | undefined, "optional">;
70
+ refundId: import("convex/values").VString<string | undefined, "optional">;
71
+ 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>;
72
+ restoredQuantity: import("convex/values").VString<string, "required">;
73
+ historyCount: import("convex/values").VFloat64<number, "required">;
74
+ }, "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">, {
75
+ by_event: ["eventId", "_creationTime"];
76
+ by_key: ["key", "_creationTime"];
77
+ by_payer_state: ["customerAccount", "state", "_creationTime"];
78
+ by_realm_state: ["stripeAccountId", "state", "_creationTime"];
79
+ by_scope: ["scopeKey", "_creationTime"];
80
+ by_scope_state: ["scopeKey", "state", "_creationTime"];
81
+ }, {}, {}>;
82
+ usageCorrectionHistory: import("convex/server").TableDefinition<import("convex/values").VObject<{
83
+ at: number;
84
+ eventId: import("convex/values").GenericId<"usageEvents">;
85
+ evidenceJson: string;
86
+ key: string;
87
+ occurredAt?: number | undefined;
88
+ reason: string;
89
+ recordJson: string;
90
+ scopeKey: string;
91
+ sequence: number;
92
+ state: "confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported";
93
+ subscriptionJson: string;
94
+ }, {
95
+ key: import("convex/values").VString<string, "required">;
96
+ scopeKey: import("convex/values").VString<string, "required">;
97
+ eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
98
+ sequence: import("convex/values").VFloat64<number, "required">;
99
+ 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>;
100
+ reason: import("convex/values").VString<string, "required">;
101
+ recordJson: import("convex/values").VString<string, "required">;
102
+ subscriptionJson: import("convex/values").VString<string, "required">;
103
+ evidenceJson: import("convex/values").VString<string, "required">;
104
+ occurredAt: import("convex/values").VFloat64<number | undefined, "optional">;
105
+ at: import("convex/values").VFloat64<number, "required">;
106
+ }, "required", "at" | "eventId" | "evidenceJson" | "key" | "occurredAt" | "reason" | "recordJson" | "scopeKey" | "sequence" | "state" | "subscriptionJson">, {
107
+ by_event: ["eventId", "_creationTime"];
108
+ by_scope_occurrence: ["scopeKey", "occurredAt", "_creationTime"];
109
+ by_scope_time: ["scopeKey", "at", "_creationTime"];
110
+ }, {}, {}>;
3
111
  usageAllowancePolicies: import("convex/server").TableDefinition<import("convex/values").VObject<{
4
112
  bindingJson: string;
5
113
  consumed: string;
@@ -33,10 +141,10 @@ export declare function large(count?: number, amount?: number): Promise<{
33
141
  at: number;
34
142
  evidenceJson: string;
35
143
  key: string;
36
- kind: "commit" | "policy" | "release" | "reservation";
144
+ kind: "commit" | "correction" | "policy" | "release" | "reservation";
37
145
  }, {
38
146
  key: import("convex/values").VString<string, "required">;
39
- 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>;
147
+ 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>;
40
148
  evidenceJson: import("convex/values").VString<string, "required">;
41
149
  at: import("convex/values").VFloat64<number, "required">;
42
150
  }, "required", "at" | "evidenceJson" | "key" | "kind">, {
@@ -243,6 +351,7 @@ export declare function large(count?: number, amount?: number): Promise<{
243
351
  }, {}, {}>;
244
352
  usageOutbox: import("convex/server").TableDefinition<import("convex/values").VObject<{
245
353
  attempts: number;
354
+ correctionKey?: string | undefined;
246
355
  definitionVersion?: 1 | undefined;
247
356
  dispatch?: string | undefined;
248
357
  eventId: import("convex/values").GenericId<"usageEvents">;
@@ -253,13 +362,13 @@ export declare function large(count?: number, amount?: number): Promise<{
253
362
  nextAttemptAt: number;
254
363
  provider?: string | undefined;
255
364
  providerIdentifier: string;
256
- reason?: "administrative_hold" | "billing_period_closed" | "delivery_window_expired" | "provider_outcome_unknown" | "provider_rejected" | "provider_unavailable" | "rate_limited" | "retry_exhausted" | "scope_busy" | undefined;
365
+ 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;
257
366
  receipt?: {
258
367
  created: number;
259
368
  identifier: string;
260
369
  } | undefined;
261
370
  scopeKey: string;
262
- state: "held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown";
371
+ state: "canceled" | "held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown";
263
372
  workflowId?: string | undefined;
264
373
  }, {
265
374
  historySequence: import("convex/values").VFloat64<number | undefined, "optional">;
@@ -269,7 +378,7 @@ export declare function large(count?: number, amount?: number): Promise<{
269
378
  firstSendAt: import("convex/values").VFloat64<number | undefined, "optional">;
270
379
  leaseUntil: import("convex/values").VFloat64<number | undefined, "optional">;
271
380
  held: import("convex/values").VBoolean<boolean | undefined, "optional">;
272
- 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>;
381
+ 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>;
273
382
  receipt: import("convex/values").VObject<{
274
383
  created: number;
275
384
  identifier: string;
@@ -277,14 +386,15 @@ export declare function large(count?: number, amount?: number): Promise<{
277
386
  identifier: import("convex/values").VString<string, "required">;
278
387
  created: import("convex/values").VFloat64<number, "required">;
279
388
  }, "optional", "created" | "identifier">;
389
+ correctionKey: import("convex/values").VString<string | undefined, "optional">;
280
390
  eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
281
391
  scopeKey: import("convex/values").VString<string, "required">;
282
- 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>;
392
+ 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>;
283
393
  attempts: import("convex/values").VFloat64<number, "required">;
284
394
  nextAttemptAt: import("convex/values").VFloat64<number, "required">;
285
395
  providerIdentifier: import("convex/values").VString<string, "required">;
286
396
  dispatch: import("convex/values").VString<string | undefined, "optional">;
287
- }, "required", "attempts" | "definitionVersion" | "dispatch" | "eventId" | "firstSendAt" | "held" | "historySequence" | "leaseUntil" | "nextAttemptAt" | "provider" | "providerIdentifier" | "reason" | "receipt" | "receipt.created" | "receipt.identifier" | "scopeKey" | "state" | "workflowId">, {
397
+ }, "required", "attempts" | "correctionKey" | "definitionVersion" | "dispatch" | "eventId" | "firstSendAt" | "held" | "historySequence" | "leaseUntil" | "nextAttemptAt" | "provider" | "providerIdentifier" | "reason" | "receipt" | "receipt.created" | "receipt.identifier" | "scopeKey" | "state" | "workflowId">, {
288
398
  by_event: ["eventId", "_creationTime"];
289
399
  by_provider_identifier: ["providerIdentifier", "_creationTime"];
290
400
  by_scope_state: ["scopeKey", "state", "_creationTime"];
@@ -440,13 +550,13 @@ export declare function large(count?: number, amount?: number): Promise<{
440
550
  at: number;
441
551
  evidenceJson: string;
442
552
  fingerprint: string;
443
- kind: "closure" | "commit" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation";
553
+ kind: "closure" | "commit" | "correction" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation";
444
554
  purchaseKey?: string | undefined;
445
555
  sourceKey: string;
446
556
  }, {
447
557
  accountKey: import("convex/values").VString<string, "required">;
448
558
  purchaseKey: import("convex/values").VString<string | undefined, "optional">;
449
- 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>;
559
+ 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>;
450
560
  sourceKey: import("convex/values").VString<string, "required">;
451
561
  fingerprint: import("convex/values").VString<string, "required">;
452
562
  evidenceJson: import("convex/values").VString<string, "required">;
@@ -995,6 +1105,15 @@ export declare function large(count?: number, amount?: number): Promise<{
995
1105
  activePhase?: "execute" | "reconcile" | undefined;
996
1106
  allocation?: {
997
1107
  adjustmentAmount?: number | undefined;
1108
+ creditSource?: {
1109
+ creditGrantId: string;
1110
+ customerAccount: string;
1111
+ livemode: boolean;
1112
+ purchaseId: string;
1113
+ stripeAccountId: string;
1114
+ stripePriceId: string;
1115
+ stripeProductId: string;
1116
+ } | undefined;
998
1117
  currency: string;
999
1118
  gross: number;
1000
1119
  paymentId?: string | undefined;
@@ -1008,6 +1127,22 @@ export declare function large(count?: number, amount?: number): Promise<{
1008
1127
  destinationAccountId: string;
1009
1128
  role: "affiliate" | "other" | "store";
1010
1129
  }[];
1130
+ usageSource?: {
1131
+ customerAccount: string;
1132
+ invoicePaymentId: string;
1133
+ livemode: boolean;
1134
+ meterId: string;
1135
+ model: "included_overage" | "pay_as_you_go";
1136
+ period: {
1137
+ end: number;
1138
+ start: number;
1139
+ };
1140
+ stripeAccountId: string;
1141
+ stripePriceId: string;
1142
+ stripeProductId: string;
1143
+ subscriptionId: string;
1144
+ subscriptionItemId: string;
1145
+ } | undefined;
1011
1146
  } | undefined;
1012
1147
  cancelRequested: boolean;
1013
1148
  completion?: string | undefined;
@@ -1042,6 +1177,15 @@ export declare function large(count?: number, amount?: number): Promise<{
1042
1177
  retryDelayMs: import("convex/values").VFloat64<number, "required">;
1043
1178
  allocation: import("convex/values").VObject<{
1044
1179
  adjustmentAmount?: number | undefined;
1180
+ creditSource?: {
1181
+ creditGrantId: string;
1182
+ customerAccount: string;
1183
+ livemode: boolean;
1184
+ purchaseId: string;
1185
+ stripeAccountId: string;
1186
+ stripePriceId: string;
1187
+ stripeProductId: string;
1188
+ } | undefined;
1045
1189
  currency: string;
1046
1190
  gross: number;
1047
1191
  paymentId?: string | undefined;
@@ -1055,10 +1199,77 @@ export declare function large(count?: number, amount?: number): Promise<{
1055
1199
  destinationAccountId: string;
1056
1200
  role: "affiliate" | "other" | "store";
1057
1201
  }[];
1202
+ usageSource?: {
1203
+ customerAccount: string;
1204
+ invoicePaymentId: string;
1205
+ livemode: boolean;
1206
+ meterId: string;
1207
+ model: "included_overage" | "pay_as_you_go";
1208
+ period: {
1209
+ end: number;
1210
+ start: number;
1211
+ };
1212
+ stripeAccountId: string;
1213
+ stripePriceId: string;
1214
+ stripeProductId: string;
1215
+ subscriptionId: string;
1216
+ subscriptionItemId: string;
1217
+ } | undefined;
1058
1218
  } | undefined, {
1059
1219
  sourceChargeId: import("convex/values").VString<string, "required">;
1060
1220
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
1061
1221
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
1222
+ usageSource: import("convex/values").VObject<{
1223
+ customerAccount: string;
1224
+ invoicePaymentId: string;
1225
+ livemode: boolean;
1226
+ meterId: string;
1227
+ model: "included_overage" | "pay_as_you_go";
1228
+ period: {
1229
+ end: number;
1230
+ start: number;
1231
+ };
1232
+ stripeAccountId: string;
1233
+ stripePriceId: string;
1234
+ stripeProductId: string;
1235
+ subscriptionId: string;
1236
+ subscriptionItemId: string;
1237
+ } | undefined, {
1238
+ stripeAccountId: import("convex/values").VString<string, "required">;
1239
+ customerAccount: import("convex/values").VString<string, "required">;
1240
+ livemode: import("convex/values").VBoolean<boolean, "required">;
1241
+ meterId: import("convex/values").VString<string, "required">;
1242
+ stripePriceId: import("convex/values").VString<string, "required">;
1243
+ stripeProductId: import("convex/values").VString<string, "required">;
1244
+ subscriptionId: import("convex/values").VString<string, "required">;
1245
+ subscriptionItemId: import("convex/values").VString<string, "required">;
1246
+ invoicePaymentId: import("convex/values").VString<string, "required">;
1247
+ period: import("convex/values").VObject<{
1248
+ end: number;
1249
+ start: number;
1250
+ }, {
1251
+ start: import("convex/values").VFloat64<number, "required">;
1252
+ end: import("convex/values").VFloat64<number, "required">;
1253
+ }, "required", "end" | "start">;
1254
+ 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>;
1255
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
1256
+ creditSource: import("convex/values").VObject<{
1257
+ creditGrantId: string;
1258
+ customerAccount: string;
1259
+ livemode: boolean;
1260
+ purchaseId: string;
1261
+ stripeAccountId: string;
1262
+ stripePriceId: string;
1263
+ stripeProductId: string;
1264
+ } | undefined, {
1265
+ stripeAccountId: import("convex/values").VString<string, "required">;
1266
+ customerAccount: import("convex/values").VString<string, "required">;
1267
+ livemode: import("convex/values").VBoolean<boolean, "required">;
1268
+ purchaseId: import("convex/values").VString<string, "required">;
1269
+ creditGrantId: import("convex/values").VString<string, "required">;
1270
+ stripePriceId: import("convex/values").VString<string, "required">;
1271
+ stripeProductId: import("convex/values").VString<string, "required">;
1272
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
1062
1273
  gross: import("convex/values").VFloat64<number, "required">;
1063
1274
  currency: import("convex/values").VString<string, "required">;
1064
1275
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -1078,7 +1289,7 @@ export declare function large(count?: number, amount?: number): Promise<{
1078
1289
  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>;
1079
1290
  amount: import("convex/values").VFloat64<number, "required">;
1080
1291
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
1081
- }, "optional", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">;
1292
+ }, "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">;
1082
1293
  version: import("convex/values").VFloat64<number, "required">;
1083
1294
  sourceKind: import("convex/values").VUnion<"invoice" | "settlement", [import("convex/values").VLiteral<"settlement", "required">, import("convex/values").VLiteral<"invoice", "required">], "required", never>;
1084
1295
  sourceId: import("convex/values").VString<string, "required">;
@@ -1089,7 +1300,7 @@ export declare function large(count?: number, amount?: number): Promise<{
1089
1300
  activePhase: import("convex/values").VUnion<"execute" | "reconcile" | undefined, [import("convex/values").VLiteral<"execute", "required">, import("convex/values").VLiteral<"reconcile", "required">], "optional", never>;
1090
1301
  resumeQueued: import("convex/values").VBoolean<boolean, "required">;
1091
1302
  outcome: import("convex/values").VUnion<"collect" | "release" | undefined, [import("convex/values").VLiteral<"collect", "required">, import("convex/values").VLiteral<"release", "required">], "optional", never>;
1092
- }, "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">, {
1303
+ }, "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">, {
1093
1304
  by_group: ["groupKey", "_creationTime"];
1094
1305
  by_source: ["sourceKind", "sourceId", "_creationTime"];
1095
1306
  }, {}, {}>;
@@ -1098,6 +1309,15 @@ export declare function large(count?: number, amount?: number): Promise<{
1098
1309
  accountId: string;
1099
1310
  allocation?: {
1100
1311
  adjustmentAmount?: number | undefined;
1312
+ creditSource?: {
1313
+ creditGrantId: string;
1314
+ customerAccount: string;
1315
+ livemode: boolean;
1316
+ purchaseId: string;
1317
+ stripeAccountId: string;
1318
+ stripePriceId: string;
1319
+ stripeProductId: string;
1320
+ } | undefined;
1101
1321
  currency: string;
1102
1322
  gross: number;
1103
1323
  paymentId?: string | undefined;
@@ -1111,6 +1331,22 @@ export declare function large(count?: number, amount?: number): Promise<{
1111
1331
  destinationAccountId: string;
1112
1332
  role: "affiliate" | "other" | "store";
1113
1333
  }[];
1334
+ usageSource?: {
1335
+ customerAccount: string;
1336
+ invoicePaymentId: string;
1337
+ livemode: boolean;
1338
+ meterId: string;
1339
+ model: "included_overage" | "pay_as_you_go";
1340
+ period: {
1341
+ end: number;
1342
+ start: number;
1343
+ };
1344
+ stripeAccountId: string;
1345
+ stripePriceId: string;
1346
+ stripeProductId: string;
1347
+ subscriptionId: string;
1348
+ subscriptionItemId: string;
1349
+ } | undefined;
1114
1350
  } | undefined;
1115
1351
  completion?: string | undefined;
1116
1352
  currency: string;
@@ -1131,6 +1367,15 @@ export declare function large(count?: number, amount?: number): Promise<{
1131
1367
  accountId: string;
1132
1368
  allocation?: {
1133
1369
  adjustmentAmount?: number | undefined;
1370
+ creditSource?: {
1371
+ creditGrantId: string;
1372
+ customerAccount: string;
1373
+ livemode: boolean;
1374
+ purchaseId: string;
1375
+ stripeAccountId: string;
1376
+ stripePriceId: string;
1377
+ stripeProductId: string;
1378
+ } | undefined;
1134
1379
  currency: string;
1135
1380
  gross: number;
1136
1381
  paymentId?: string | undefined;
@@ -1144,6 +1389,22 @@ export declare function large(count?: number, amount?: number): Promise<{
1144
1389
  destinationAccountId: string;
1145
1390
  role: "affiliate" | "other" | "store";
1146
1391
  }[];
1392
+ usageSource?: {
1393
+ customerAccount: string;
1394
+ invoicePaymentId: string;
1395
+ livemode: boolean;
1396
+ meterId: string;
1397
+ model: "included_overage" | "pay_as_you_go";
1398
+ period: {
1399
+ end: number;
1400
+ start: number;
1401
+ };
1402
+ stripeAccountId: string;
1403
+ stripePriceId: string;
1404
+ stripeProductId: string;
1405
+ subscriptionId: string;
1406
+ subscriptionItemId: string;
1407
+ } | undefined;
1147
1408
  } | undefined;
1148
1409
  completion?: string | undefined;
1149
1410
  currency: string;
@@ -1169,6 +1430,15 @@ export declare function large(count?: number, amount?: number): Promise<{
1169
1430
  retryDelayMs: import("convex/values").VFloat64<number, "required">;
1170
1431
  allocation: import("convex/values").VObject<{
1171
1432
  adjustmentAmount?: number | undefined;
1433
+ creditSource?: {
1434
+ creditGrantId: string;
1435
+ customerAccount: string;
1436
+ livemode: boolean;
1437
+ purchaseId: string;
1438
+ stripeAccountId: string;
1439
+ stripePriceId: string;
1440
+ stripeProductId: string;
1441
+ } | undefined;
1172
1442
  currency: string;
1173
1443
  gross: number;
1174
1444
  paymentId?: string | undefined;
@@ -1182,10 +1452,77 @@ export declare function large(count?: number, amount?: number): Promise<{
1182
1452
  destinationAccountId: string;
1183
1453
  role: "affiliate" | "other" | "store";
1184
1454
  }[];
1455
+ usageSource?: {
1456
+ customerAccount: string;
1457
+ invoicePaymentId: string;
1458
+ livemode: boolean;
1459
+ meterId: string;
1460
+ model: "included_overage" | "pay_as_you_go";
1461
+ period: {
1462
+ end: number;
1463
+ start: number;
1464
+ };
1465
+ stripeAccountId: string;
1466
+ stripePriceId: string;
1467
+ stripeProductId: string;
1468
+ subscriptionId: string;
1469
+ subscriptionItemId: string;
1470
+ } | undefined;
1185
1471
  } | undefined, {
1186
1472
  sourceChargeId: import("convex/values").VString<string, "required">;
1187
1473
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
1188
1474
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
1475
+ usageSource: import("convex/values").VObject<{
1476
+ customerAccount: string;
1477
+ invoicePaymentId: string;
1478
+ livemode: boolean;
1479
+ meterId: string;
1480
+ model: "included_overage" | "pay_as_you_go";
1481
+ period: {
1482
+ end: number;
1483
+ start: number;
1484
+ };
1485
+ stripeAccountId: string;
1486
+ stripePriceId: string;
1487
+ stripeProductId: string;
1488
+ subscriptionId: string;
1489
+ subscriptionItemId: string;
1490
+ } | undefined, {
1491
+ stripeAccountId: import("convex/values").VString<string, "required">;
1492
+ customerAccount: import("convex/values").VString<string, "required">;
1493
+ livemode: import("convex/values").VBoolean<boolean, "required">;
1494
+ meterId: import("convex/values").VString<string, "required">;
1495
+ stripePriceId: import("convex/values").VString<string, "required">;
1496
+ stripeProductId: import("convex/values").VString<string, "required">;
1497
+ subscriptionId: import("convex/values").VString<string, "required">;
1498
+ subscriptionItemId: import("convex/values").VString<string, "required">;
1499
+ invoicePaymentId: import("convex/values").VString<string, "required">;
1500
+ period: import("convex/values").VObject<{
1501
+ end: number;
1502
+ start: number;
1503
+ }, {
1504
+ start: import("convex/values").VFloat64<number, "required">;
1505
+ end: import("convex/values").VFloat64<number, "required">;
1506
+ }, "required", "end" | "start">;
1507
+ 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>;
1508
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
1509
+ creditSource: import("convex/values").VObject<{
1510
+ creditGrantId: string;
1511
+ customerAccount: string;
1512
+ livemode: boolean;
1513
+ purchaseId: string;
1514
+ stripeAccountId: string;
1515
+ stripePriceId: string;
1516
+ stripeProductId: string;
1517
+ } | undefined, {
1518
+ stripeAccountId: import("convex/values").VString<string, "required">;
1519
+ customerAccount: import("convex/values").VString<string, "required">;
1520
+ livemode: import("convex/values").VBoolean<boolean, "required">;
1521
+ purchaseId: import("convex/values").VString<string, "required">;
1522
+ creditGrantId: import("convex/values").VString<string, "required">;
1523
+ stripePriceId: import("convex/values").VString<string, "required">;
1524
+ stripeProductId: import("convex/values").VString<string, "required">;
1525
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
1189
1526
  gross: import("convex/values").VFloat64<number, "required">;
1190
1527
  currency: import("convex/values").VString<string, "required">;
1191
1528
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -1205,10 +1542,10 @@ export declare function large(count?: number, amount?: number): Promise<{
1205
1542
  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>;
1206
1543
  amount: import("convex/values").VFloat64<number, "required">;
1207
1544
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
1208
- }, "optional", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">;
1209
- }, "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">;
1545
+ }, "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">;
1546
+ }, "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">;
1210
1547
  operationId: import("convex/values").VId<import("convex/values").GenericId<"recoveryWorkflowOperations">, "required">;
1211
- }, "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">, {
1548
+ }, "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">, {
1212
1549
  by_key: ["requestKey", "_creationTime"];
1213
1550
  }, {}, {}>;
1214
1551
  balanceFundingPreparations: import("convex/server").TableDefinition<import("convex/values").VObject<{
@@ -3006,6 +3343,15 @@ export declare function large(count?: number, amount?: number): Promise<{
3006
3343
  }, {}, {}>;
3007
3344
  settlementAllocations: import("convex/server").TableDefinition<import("convex/values").VObject<{
3008
3345
  adjustmentAmount?: number | undefined;
3346
+ creditSource?: {
3347
+ creditGrantId: string;
3348
+ customerAccount: string;
3349
+ livemode: boolean;
3350
+ purchaseId: string;
3351
+ stripeAccountId: string;
3352
+ stripePriceId: string;
3353
+ stripeProductId: string;
3354
+ } | undefined;
3009
3355
  currency: string;
3010
3356
  gross: number;
3011
3357
  paymentId?: string | undefined;
@@ -3019,10 +3365,77 @@ export declare function large(count?: number, amount?: number): Promise<{
3019
3365
  destinationAccountId: string;
3020
3366
  role: "affiliate" | "other" | "store";
3021
3367
  }[];
3368
+ usageSource?: {
3369
+ customerAccount: string;
3370
+ invoicePaymentId: string;
3371
+ livemode: boolean;
3372
+ meterId: string;
3373
+ model: "included_overage" | "pay_as_you_go";
3374
+ period: {
3375
+ end: number;
3376
+ start: number;
3377
+ };
3378
+ stripeAccountId: string;
3379
+ stripePriceId: string;
3380
+ stripeProductId: string;
3381
+ subscriptionId: string;
3382
+ subscriptionItemId: string;
3383
+ } | undefined;
3022
3384
  }, {
3023
3385
  sourceChargeId: import("convex/values").VString<string, "required">;
3024
3386
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
3025
3387
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
3388
+ usageSource: import("convex/values").VObject<{
3389
+ customerAccount: string;
3390
+ invoicePaymentId: string;
3391
+ livemode: boolean;
3392
+ meterId: string;
3393
+ model: "included_overage" | "pay_as_you_go";
3394
+ period: {
3395
+ end: number;
3396
+ start: number;
3397
+ };
3398
+ stripeAccountId: string;
3399
+ stripePriceId: string;
3400
+ stripeProductId: string;
3401
+ subscriptionId: string;
3402
+ subscriptionItemId: string;
3403
+ } | undefined, {
3404
+ stripeAccountId: import("convex/values").VString<string, "required">;
3405
+ customerAccount: import("convex/values").VString<string, "required">;
3406
+ livemode: import("convex/values").VBoolean<boolean, "required">;
3407
+ meterId: import("convex/values").VString<string, "required">;
3408
+ stripePriceId: import("convex/values").VString<string, "required">;
3409
+ stripeProductId: import("convex/values").VString<string, "required">;
3410
+ subscriptionId: import("convex/values").VString<string, "required">;
3411
+ subscriptionItemId: import("convex/values").VString<string, "required">;
3412
+ invoicePaymentId: import("convex/values").VString<string, "required">;
3413
+ period: import("convex/values").VObject<{
3414
+ end: number;
3415
+ start: number;
3416
+ }, {
3417
+ start: import("convex/values").VFloat64<number, "required">;
3418
+ end: import("convex/values").VFloat64<number, "required">;
3419
+ }, "required", "end" | "start">;
3420
+ 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>;
3421
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
3422
+ creditSource: import("convex/values").VObject<{
3423
+ creditGrantId: string;
3424
+ customerAccount: string;
3425
+ livemode: boolean;
3426
+ purchaseId: string;
3427
+ stripeAccountId: string;
3428
+ stripePriceId: string;
3429
+ stripeProductId: string;
3430
+ } | undefined, {
3431
+ stripeAccountId: import("convex/values").VString<string, "required">;
3432
+ customerAccount: import("convex/values").VString<string, "required">;
3433
+ livemode: import("convex/values").VBoolean<boolean, "required">;
3434
+ purchaseId: import("convex/values").VString<string, "required">;
3435
+ creditGrantId: import("convex/values").VString<string, "required">;
3436
+ stripePriceId: import("convex/values").VString<string, "required">;
3437
+ stripeProductId: import("convex/values").VString<string, "required">;
3438
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
3026
3439
  gross: import("convex/values").VFloat64<number, "required">;
3027
3440
  currency: import("convex/values").VString<string, "required">;
3028
3441
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -3042,7 +3455,7 @@ export declare function large(count?: number, amount?: number): Promise<{
3042
3455
  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>;
3043
3456
  amount: import("convex/values").VFloat64<number, "required">;
3044
3457
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
3045
- }, "required", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">, {
3458
+ }, "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">, {
3046
3459
  by_source_charge: ["sourceChargeId", "_creationTime"];
3047
3460
  }, {}, {}>;
3048
3461
  commissionTerms: import("convex/server").TableDefinition<import("convex/values").VObject<{
@@ -3864,6 +4277,114 @@ export declare function large(count?: number, amount?: number): Promise<{
3864
4277
  export declare function withHistory(count?: number, amount?: number): Promise<{
3865
4278
  s: {
3866
4279
  t: import("convex-test").TestConvex<import("convex/server").SchemaDefinition<{
4280
+ usageCorrectionClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
4281
+ key: string;
4282
+ operationKey: string;
4283
+ proofJson: string;
4284
+ }, {
4285
+ key: import("convex/values").VString<string, "required">;
4286
+ operationKey: import("convex/values").VString<string, "required">;
4287
+ proofJson: import("convex/values").VString<string, "required">;
4288
+ }, "required", "key" | "operationKey" | "proofJson">, {
4289
+ by_key: ["key", "_creationTime"];
4290
+ }, {}, {}>;
4291
+ usageCorrections: import("convex/server").TableDefinition<import("convex/values").VObject<{
4292
+ adjustmentJson?: string | undefined;
4293
+ attempt: number;
4294
+ attemptedAt?: number | undefined;
4295
+ cashConsequence: "none" | "operator_resolution_required" | "verified_external_adjustment";
4296
+ correctionId: string;
4297
+ creditNoteId?: string | undefined;
4298
+ customerAccount?: string | undefined;
4299
+ eventId: import("convex/values").GenericId<"usageEvents">;
4300
+ firstAttemptAt: number;
4301
+ historyCount: number;
4302
+ inputJson: string;
4303
+ invoiceId?: string | undefined;
4304
+ key: string;
4305
+ leaseUntil?: number | undefined;
4306
+ nativeAdjustmentId?: string | undefined;
4307
+ nativeCreditNoteStatus?: "issued" | "void" | undefined;
4308
+ nativeStatus?: "complete" | "pending" | undefined;
4309
+ observedAt?: number | undefined;
4310
+ quantity: string;
4311
+ reason: string;
4312
+ recordJson: string;
4313
+ refundId?: string | undefined;
4314
+ resolution?: "event_cancellation" | "invoice_credit" | undefined;
4315
+ restoredQuantity: string;
4316
+ scaledQuantity: string;
4317
+ scopeKey: string;
4318
+ state: "confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported";
4319
+ stripeAccountId?: string | undefined;
4320
+ subscriptionJson: string;
4321
+ }, {
4322
+ stripeAccountId: import("convex/values").VString<string | undefined, "optional">;
4323
+ customerAccount: import("convex/values").VString<string | undefined, "optional">;
4324
+ observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
4325
+ nativeCreditNoteStatus: import("convex/values").VUnion<"issued" | "void" | undefined, [import("convex/values").VLiteral<"issued", "required">, import("convex/values").VLiteral<"void", "required">], "optional", never>;
4326
+ 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>;
4327
+ adjustmentJson: import("convex/values").VString<string | undefined, "optional">;
4328
+ key: import("convex/values").VString<string, "required">;
4329
+ scopeKey: import("convex/values").VString<string, "required">;
4330
+ eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
4331
+ correctionId: import("convex/values").VString<string, "required">;
4332
+ inputJson: import("convex/values").VString<string, "required">;
4333
+ recordJson: import("convex/values").VString<string, "required">;
4334
+ subscriptionJson: import("convex/values").VString<string, "required">;
4335
+ quantity: import("convex/values").VString<string, "required">;
4336
+ scaledQuantity: import("convex/values").VString<string, "required">;
4337
+ 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>;
4338
+ reason: import("convex/values").VString<string, "required">;
4339
+ firstAttemptAt: import("convex/values").VFloat64<number, "required">;
4340
+ attemptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
4341
+ leaseUntil: import("convex/values").VFloat64<number | undefined, "optional">;
4342
+ attempt: import("convex/values").VFloat64<number, "required">;
4343
+ nativeAdjustmentId: import("convex/values").VString<string | undefined, "optional">;
4344
+ nativeStatus: import("convex/values").VUnion<"complete" | "pending" | undefined, [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"complete", "required">], "optional", never>;
4345
+ invoiceId: import("convex/values").VString<string | undefined, "optional">;
4346
+ creditNoteId: import("convex/values").VString<string | undefined, "optional">;
4347
+ refundId: import("convex/values").VString<string | undefined, "optional">;
4348
+ 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>;
4349
+ restoredQuantity: import("convex/values").VString<string, "required">;
4350
+ historyCount: import("convex/values").VFloat64<number, "required">;
4351
+ }, "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">, {
4352
+ by_event: ["eventId", "_creationTime"];
4353
+ by_key: ["key", "_creationTime"];
4354
+ by_payer_state: ["customerAccount", "state", "_creationTime"];
4355
+ by_realm_state: ["stripeAccountId", "state", "_creationTime"];
4356
+ by_scope: ["scopeKey", "_creationTime"];
4357
+ by_scope_state: ["scopeKey", "state", "_creationTime"];
4358
+ }, {}, {}>;
4359
+ usageCorrectionHistory: import("convex/server").TableDefinition<import("convex/values").VObject<{
4360
+ at: number;
4361
+ eventId: import("convex/values").GenericId<"usageEvents">;
4362
+ evidenceJson: string;
4363
+ key: string;
4364
+ occurredAt?: number | undefined;
4365
+ reason: string;
4366
+ recordJson: string;
4367
+ scopeKey: string;
4368
+ sequence: number;
4369
+ state: "confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported";
4370
+ subscriptionJson: string;
4371
+ }, {
4372
+ key: import("convex/values").VString<string, "required">;
4373
+ scopeKey: import("convex/values").VString<string, "required">;
4374
+ eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
4375
+ sequence: import("convex/values").VFloat64<number, "required">;
4376
+ 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>;
4377
+ reason: import("convex/values").VString<string, "required">;
4378
+ recordJson: import("convex/values").VString<string, "required">;
4379
+ subscriptionJson: import("convex/values").VString<string, "required">;
4380
+ evidenceJson: import("convex/values").VString<string, "required">;
4381
+ occurredAt: import("convex/values").VFloat64<number | undefined, "optional">;
4382
+ at: import("convex/values").VFloat64<number, "required">;
4383
+ }, "required", "at" | "eventId" | "evidenceJson" | "key" | "occurredAt" | "reason" | "recordJson" | "scopeKey" | "sequence" | "state" | "subscriptionJson">, {
4384
+ by_event: ["eventId", "_creationTime"];
4385
+ by_scope_occurrence: ["scopeKey", "occurredAt", "_creationTime"];
4386
+ by_scope_time: ["scopeKey", "at", "_creationTime"];
4387
+ }, {}, {}>;
3867
4388
  usageAllowancePolicies: import("convex/server").TableDefinition<import("convex/values").VObject<{
3868
4389
  bindingJson: string;
3869
4390
  consumed: string;
@@ -3897,10 +4418,10 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
3897
4418
  at: number;
3898
4419
  evidenceJson: string;
3899
4420
  key: string;
3900
- kind: "commit" | "policy" | "release" | "reservation";
4421
+ kind: "commit" | "correction" | "policy" | "release" | "reservation";
3901
4422
  }, {
3902
4423
  key: import("convex/values").VString<string, "required">;
3903
- 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>;
4424
+ 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>;
3904
4425
  evidenceJson: import("convex/values").VString<string, "required">;
3905
4426
  at: import("convex/values").VFloat64<number, "required">;
3906
4427
  }, "required", "at" | "evidenceJson" | "key" | "kind">, {
@@ -4107,6 +4628,7 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4107
4628
  }, {}, {}>;
4108
4629
  usageOutbox: import("convex/server").TableDefinition<import("convex/values").VObject<{
4109
4630
  attempts: number;
4631
+ correctionKey?: string | undefined;
4110
4632
  definitionVersion?: 1 | undefined;
4111
4633
  dispatch?: string | undefined;
4112
4634
  eventId: import("convex/values").GenericId<"usageEvents">;
@@ -4117,13 +4639,13 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4117
4639
  nextAttemptAt: number;
4118
4640
  provider?: string | undefined;
4119
4641
  providerIdentifier: string;
4120
- reason?: "administrative_hold" | "billing_period_closed" | "delivery_window_expired" | "provider_outcome_unknown" | "provider_rejected" | "provider_unavailable" | "rate_limited" | "retry_exhausted" | "scope_busy" | undefined;
4642
+ 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;
4121
4643
  receipt?: {
4122
4644
  created: number;
4123
4645
  identifier: string;
4124
4646
  } | undefined;
4125
4647
  scopeKey: string;
4126
- state: "held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown";
4648
+ state: "canceled" | "held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown";
4127
4649
  workflowId?: string | undefined;
4128
4650
  }, {
4129
4651
  historySequence: import("convex/values").VFloat64<number | undefined, "optional">;
@@ -4133,7 +4655,7 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4133
4655
  firstSendAt: import("convex/values").VFloat64<number | undefined, "optional">;
4134
4656
  leaseUntil: import("convex/values").VFloat64<number | undefined, "optional">;
4135
4657
  held: import("convex/values").VBoolean<boolean | undefined, "optional">;
4136
- 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>;
4658
+ 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>;
4137
4659
  receipt: import("convex/values").VObject<{
4138
4660
  created: number;
4139
4661
  identifier: string;
@@ -4141,14 +4663,15 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4141
4663
  identifier: import("convex/values").VString<string, "required">;
4142
4664
  created: import("convex/values").VFloat64<number, "required">;
4143
4665
  }, "optional", "created" | "identifier">;
4666
+ correctionKey: import("convex/values").VString<string | undefined, "optional">;
4144
4667
  eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
4145
4668
  scopeKey: import("convex/values").VString<string, "required">;
4146
- 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>;
4669
+ 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>;
4147
4670
  attempts: import("convex/values").VFloat64<number, "required">;
4148
4671
  nextAttemptAt: import("convex/values").VFloat64<number, "required">;
4149
4672
  providerIdentifier: import("convex/values").VString<string, "required">;
4150
4673
  dispatch: import("convex/values").VString<string | undefined, "optional">;
4151
- }, "required", "attempts" | "definitionVersion" | "dispatch" | "eventId" | "firstSendAt" | "held" | "historySequence" | "leaseUntil" | "nextAttemptAt" | "provider" | "providerIdentifier" | "reason" | "receipt" | "receipt.created" | "receipt.identifier" | "scopeKey" | "state" | "workflowId">, {
4674
+ }, "required", "attempts" | "correctionKey" | "definitionVersion" | "dispatch" | "eventId" | "firstSendAt" | "held" | "historySequence" | "leaseUntil" | "nextAttemptAt" | "provider" | "providerIdentifier" | "reason" | "receipt" | "receipt.created" | "receipt.identifier" | "scopeKey" | "state" | "workflowId">, {
4152
4675
  by_event: ["eventId", "_creationTime"];
4153
4676
  by_provider_identifier: ["providerIdentifier", "_creationTime"];
4154
4677
  by_scope_state: ["scopeKey", "state", "_creationTime"];
@@ -4304,13 +4827,13 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4304
4827
  at: number;
4305
4828
  evidenceJson: string;
4306
4829
  fingerprint: string;
4307
- kind: "closure" | "commit" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation";
4830
+ kind: "closure" | "commit" | "correction" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation";
4308
4831
  purchaseKey?: string | undefined;
4309
4832
  sourceKey: string;
4310
4833
  }, {
4311
4834
  accountKey: import("convex/values").VString<string, "required">;
4312
4835
  purchaseKey: import("convex/values").VString<string | undefined, "optional">;
4313
- 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>;
4836
+ 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>;
4314
4837
  sourceKey: import("convex/values").VString<string, "required">;
4315
4838
  fingerprint: import("convex/values").VString<string, "required">;
4316
4839
  evidenceJson: import("convex/values").VString<string, "required">;
@@ -4859,6 +5382,15 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4859
5382
  activePhase?: "execute" | "reconcile" | undefined;
4860
5383
  allocation?: {
4861
5384
  adjustmentAmount?: number | undefined;
5385
+ creditSource?: {
5386
+ creditGrantId: string;
5387
+ customerAccount: string;
5388
+ livemode: boolean;
5389
+ purchaseId: string;
5390
+ stripeAccountId: string;
5391
+ stripePriceId: string;
5392
+ stripeProductId: string;
5393
+ } | undefined;
4862
5394
  currency: string;
4863
5395
  gross: number;
4864
5396
  paymentId?: string | undefined;
@@ -4872,6 +5404,22 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4872
5404
  destinationAccountId: string;
4873
5405
  role: "affiliate" | "other" | "store";
4874
5406
  }[];
5407
+ usageSource?: {
5408
+ customerAccount: string;
5409
+ invoicePaymentId: string;
5410
+ livemode: boolean;
5411
+ meterId: string;
5412
+ model: "included_overage" | "pay_as_you_go";
5413
+ period: {
5414
+ end: number;
5415
+ start: number;
5416
+ };
5417
+ stripeAccountId: string;
5418
+ stripePriceId: string;
5419
+ stripeProductId: string;
5420
+ subscriptionId: string;
5421
+ subscriptionItemId: string;
5422
+ } | undefined;
4875
5423
  } | undefined;
4876
5424
  cancelRequested: boolean;
4877
5425
  completion?: string | undefined;
@@ -4906,6 +5454,15 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4906
5454
  retryDelayMs: import("convex/values").VFloat64<number, "required">;
4907
5455
  allocation: import("convex/values").VObject<{
4908
5456
  adjustmentAmount?: number | undefined;
5457
+ creditSource?: {
5458
+ creditGrantId: string;
5459
+ customerAccount: string;
5460
+ livemode: boolean;
5461
+ purchaseId: string;
5462
+ stripeAccountId: string;
5463
+ stripePriceId: string;
5464
+ stripeProductId: string;
5465
+ } | undefined;
4909
5466
  currency: string;
4910
5467
  gross: number;
4911
5468
  paymentId?: string | undefined;
@@ -4919,10 +5476,77 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4919
5476
  destinationAccountId: string;
4920
5477
  role: "affiliate" | "other" | "store";
4921
5478
  }[];
5479
+ usageSource?: {
5480
+ customerAccount: string;
5481
+ invoicePaymentId: string;
5482
+ livemode: boolean;
5483
+ meterId: string;
5484
+ model: "included_overage" | "pay_as_you_go";
5485
+ period: {
5486
+ end: number;
5487
+ start: number;
5488
+ };
5489
+ stripeAccountId: string;
5490
+ stripePriceId: string;
5491
+ stripeProductId: string;
5492
+ subscriptionId: string;
5493
+ subscriptionItemId: string;
5494
+ } | undefined;
4922
5495
  } | undefined, {
4923
5496
  sourceChargeId: import("convex/values").VString<string, "required">;
4924
5497
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
4925
5498
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
5499
+ usageSource: import("convex/values").VObject<{
5500
+ customerAccount: string;
5501
+ invoicePaymentId: string;
5502
+ livemode: boolean;
5503
+ meterId: string;
5504
+ model: "included_overage" | "pay_as_you_go";
5505
+ period: {
5506
+ end: number;
5507
+ start: number;
5508
+ };
5509
+ stripeAccountId: string;
5510
+ stripePriceId: string;
5511
+ stripeProductId: string;
5512
+ subscriptionId: string;
5513
+ subscriptionItemId: string;
5514
+ } | undefined, {
5515
+ stripeAccountId: import("convex/values").VString<string, "required">;
5516
+ customerAccount: import("convex/values").VString<string, "required">;
5517
+ livemode: import("convex/values").VBoolean<boolean, "required">;
5518
+ meterId: import("convex/values").VString<string, "required">;
5519
+ stripePriceId: import("convex/values").VString<string, "required">;
5520
+ stripeProductId: import("convex/values").VString<string, "required">;
5521
+ subscriptionId: import("convex/values").VString<string, "required">;
5522
+ subscriptionItemId: import("convex/values").VString<string, "required">;
5523
+ invoicePaymentId: import("convex/values").VString<string, "required">;
5524
+ period: import("convex/values").VObject<{
5525
+ end: number;
5526
+ start: number;
5527
+ }, {
5528
+ start: import("convex/values").VFloat64<number, "required">;
5529
+ end: import("convex/values").VFloat64<number, "required">;
5530
+ }, "required", "end" | "start">;
5531
+ 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>;
5532
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
5533
+ creditSource: import("convex/values").VObject<{
5534
+ creditGrantId: string;
5535
+ customerAccount: string;
5536
+ livemode: boolean;
5537
+ purchaseId: string;
5538
+ stripeAccountId: string;
5539
+ stripePriceId: string;
5540
+ stripeProductId: string;
5541
+ } | undefined, {
5542
+ stripeAccountId: import("convex/values").VString<string, "required">;
5543
+ customerAccount: import("convex/values").VString<string, "required">;
5544
+ livemode: import("convex/values").VBoolean<boolean, "required">;
5545
+ purchaseId: import("convex/values").VString<string, "required">;
5546
+ creditGrantId: import("convex/values").VString<string, "required">;
5547
+ stripePriceId: import("convex/values").VString<string, "required">;
5548
+ stripeProductId: import("convex/values").VString<string, "required">;
5549
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
4926
5550
  gross: import("convex/values").VFloat64<number, "required">;
4927
5551
  currency: import("convex/values").VString<string, "required">;
4928
5552
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -4942,7 +5566,7 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4942
5566
  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>;
4943
5567
  amount: import("convex/values").VFloat64<number, "required">;
4944
5568
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
4945
- }, "optional", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">;
5569
+ }, "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">;
4946
5570
  version: import("convex/values").VFloat64<number, "required">;
4947
5571
  sourceKind: import("convex/values").VUnion<"invoice" | "settlement", [import("convex/values").VLiteral<"settlement", "required">, import("convex/values").VLiteral<"invoice", "required">], "required", never>;
4948
5572
  sourceId: import("convex/values").VString<string, "required">;
@@ -4953,7 +5577,7 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4953
5577
  activePhase: import("convex/values").VUnion<"execute" | "reconcile" | undefined, [import("convex/values").VLiteral<"execute", "required">, import("convex/values").VLiteral<"reconcile", "required">], "optional", never>;
4954
5578
  resumeQueued: import("convex/values").VBoolean<boolean, "required">;
4955
5579
  outcome: import("convex/values").VUnion<"collect" | "release" | undefined, [import("convex/values").VLiteral<"collect", "required">, import("convex/values").VLiteral<"release", "required">], "optional", never>;
4956
- }, "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">, {
5580
+ }, "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">, {
4957
5581
  by_group: ["groupKey", "_creationTime"];
4958
5582
  by_source: ["sourceKind", "sourceId", "_creationTime"];
4959
5583
  }, {}, {}>;
@@ -4962,6 +5586,15 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4962
5586
  accountId: string;
4963
5587
  allocation?: {
4964
5588
  adjustmentAmount?: number | undefined;
5589
+ creditSource?: {
5590
+ creditGrantId: string;
5591
+ customerAccount: string;
5592
+ livemode: boolean;
5593
+ purchaseId: string;
5594
+ stripeAccountId: string;
5595
+ stripePriceId: string;
5596
+ stripeProductId: string;
5597
+ } | undefined;
4965
5598
  currency: string;
4966
5599
  gross: number;
4967
5600
  paymentId?: string | undefined;
@@ -4975,6 +5608,22 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4975
5608
  destinationAccountId: string;
4976
5609
  role: "affiliate" | "other" | "store";
4977
5610
  }[];
5611
+ usageSource?: {
5612
+ customerAccount: string;
5613
+ invoicePaymentId: string;
5614
+ livemode: boolean;
5615
+ meterId: string;
5616
+ model: "included_overage" | "pay_as_you_go";
5617
+ period: {
5618
+ end: number;
5619
+ start: number;
5620
+ };
5621
+ stripeAccountId: string;
5622
+ stripePriceId: string;
5623
+ stripeProductId: string;
5624
+ subscriptionId: string;
5625
+ subscriptionItemId: string;
5626
+ } | undefined;
4978
5627
  } | undefined;
4979
5628
  completion?: string | undefined;
4980
5629
  currency: string;
@@ -4995,6 +5644,15 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4995
5644
  accountId: string;
4996
5645
  allocation?: {
4997
5646
  adjustmentAmount?: number | undefined;
5647
+ creditSource?: {
5648
+ creditGrantId: string;
5649
+ customerAccount: string;
5650
+ livemode: boolean;
5651
+ purchaseId: string;
5652
+ stripeAccountId: string;
5653
+ stripePriceId: string;
5654
+ stripeProductId: string;
5655
+ } | undefined;
4998
5656
  currency: string;
4999
5657
  gross: number;
5000
5658
  paymentId?: string | undefined;
@@ -5008,6 +5666,22 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
5008
5666
  destinationAccountId: string;
5009
5667
  role: "affiliate" | "other" | "store";
5010
5668
  }[];
5669
+ usageSource?: {
5670
+ customerAccount: string;
5671
+ invoicePaymentId: string;
5672
+ livemode: boolean;
5673
+ meterId: string;
5674
+ model: "included_overage" | "pay_as_you_go";
5675
+ period: {
5676
+ end: number;
5677
+ start: number;
5678
+ };
5679
+ stripeAccountId: string;
5680
+ stripePriceId: string;
5681
+ stripeProductId: string;
5682
+ subscriptionId: string;
5683
+ subscriptionItemId: string;
5684
+ } | undefined;
5011
5685
  } | undefined;
5012
5686
  completion?: string | undefined;
5013
5687
  currency: string;
@@ -5033,6 +5707,15 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
5033
5707
  retryDelayMs: import("convex/values").VFloat64<number, "required">;
5034
5708
  allocation: import("convex/values").VObject<{
5035
5709
  adjustmentAmount?: number | undefined;
5710
+ creditSource?: {
5711
+ creditGrantId: string;
5712
+ customerAccount: string;
5713
+ livemode: boolean;
5714
+ purchaseId: string;
5715
+ stripeAccountId: string;
5716
+ stripePriceId: string;
5717
+ stripeProductId: string;
5718
+ } | undefined;
5036
5719
  currency: string;
5037
5720
  gross: number;
5038
5721
  paymentId?: string | undefined;
@@ -5046,10 +5729,77 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
5046
5729
  destinationAccountId: string;
5047
5730
  role: "affiliate" | "other" | "store";
5048
5731
  }[];
5732
+ usageSource?: {
5733
+ customerAccount: string;
5734
+ invoicePaymentId: string;
5735
+ livemode: boolean;
5736
+ meterId: string;
5737
+ model: "included_overage" | "pay_as_you_go";
5738
+ period: {
5739
+ end: number;
5740
+ start: number;
5741
+ };
5742
+ stripeAccountId: string;
5743
+ stripePriceId: string;
5744
+ stripeProductId: string;
5745
+ subscriptionId: string;
5746
+ subscriptionItemId: string;
5747
+ } | undefined;
5049
5748
  } | undefined, {
5050
5749
  sourceChargeId: import("convex/values").VString<string, "required">;
5051
5750
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
5052
5751
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
5752
+ usageSource: import("convex/values").VObject<{
5753
+ customerAccount: string;
5754
+ invoicePaymentId: string;
5755
+ livemode: boolean;
5756
+ meterId: string;
5757
+ model: "included_overage" | "pay_as_you_go";
5758
+ period: {
5759
+ end: number;
5760
+ start: number;
5761
+ };
5762
+ stripeAccountId: string;
5763
+ stripePriceId: string;
5764
+ stripeProductId: string;
5765
+ subscriptionId: string;
5766
+ subscriptionItemId: string;
5767
+ } | undefined, {
5768
+ stripeAccountId: import("convex/values").VString<string, "required">;
5769
+ customerAccount: import("convex/values").VString<string, "required">;
5770
+ livemode: import("convex/values").VBoolean<boolean, "required">;
5771
+ meterId: import("convex/values").VString<string, "required">;
5772
+ stripePriceId: import("convex/values").VString<string, "required">;
5773
+ stripeProductId: import("convex/values").VString<string, "required">;
5774
+ subscriptionId: import("convex/values").VString<string, "required">;
5775
+ subscriptionItemId: import("convex/values").VString<string, "required">;
5776
+ invoicePaymentId: import("convex/values").VString<string, "required">;
5777
+ period: import("convex/values").VObject<{
5778
+ end: number;
5779
+ start: number;
5780
+ }, {
5781
+ start: import("convex/values").VFloat64<number, "required">;
5782
+ end: import("convex/values").VFloat64<number, "required">;
5783
+ }, "required", "end" | "start">;
5784
+ 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>;
5785
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
5786
+ creditSource: import("convex/values").VObject<{
5787
+ creditGrantId: string;
5788
+ customerAccount: string;
5789
+ livemode: boolean;
5790
+ purchaseId: string;
5791
+ stripeAccountId: string;
5792
+ stripePriceId: string;
5793
+ stripeProductId: string;
5794
+ } | undefined, {
5795
+ stripeAccountId: import("convex/values").VString<string, "required">;
5796
+ customerAccount: import("convex/values").VString<string, "required">;
5797
+ livemode: import("convex/values").VBoolean<boolean, "required">;
5798
+ purchaseId: import("convex/values").VString<string, "required">;
5799
+ creditGrantId: import("convex/values").VString<string, "required">;
5800
+ stripePriceId: import("convex/values").VString<string, "required">;
5801
+ stripeProductId: import("convex/values").VString<string, "required">;
5802
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
5053
5803
  gross: import("convex/values").VFloat64<number, "required">;
5054
5804
  currency: import("convex/values").VString<string, "required">;
5055
5805
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -5069,10 +5819,10 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
5069
5819
  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>;
5070
5820
  amount: import("convex/values").VFloat64<number, "required">;
5071
5821
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
5072
- }, "optional", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">;
5073
- }, "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">;
5822
+ }, "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">;
5823
+ }, "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">;
5074
5824
  operationId: import("convex/values").VId<import("convex/values").GenericId<"recoveryWorkflowOperations">, "required">;
5075
- }, "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">, {
5825
+ }, "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">, {
5076
5826
  by_key: ["requestKey", "_creationTime"];
5077
5827
  }, {}, {}>;
5078
5828
  balanceFundingPreparations: import("convex/server").TableDefinition<import("convex/values").VObject<{
@@ -6870,6 +7620,15 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
6870
7620
  }, {}, {}>;
6871
7621
  settlementAllocations: import("convex/server").TableDefinition<import("convex/values").VObject<{
6872
7622
  adjustmentAmount?: number | undefined;
7623
+ creditSource?: {
7624
+ creditGrantId: string;
7625
+ customerAccount: string;
7626
+ livemode: boolean;
7627
+ purchaseId: string;
7628
+ stripeAccountId: string;
7629
+ stripePriceId: string;
7630
+ stripeProductId: string;
7631
+ } | undefined;
6873
7632
  currency: string;
6874
7633
  gross: number;
6875
7634
  paymentId?: string | undefined;
@@ -6883,10 +7642,77 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
6883
7642
  destinationAccountId: string;
6884
7643
  role: "affiliate" | "other" | "store";
6885
7644
  }[];
7645
+ usageSource?: {
7646
+ customerAccount: string;
7647
+ invoicePaymentId: string;
7648
+ livemode: boolean;
7649
+ meterId: string;
7650
+ model: "included_overage" | "pay_as_you_go";
7651
+ period: {
7652
+ end: number;
7653
+ start: number;
7654
+ };
7655
+ stripeAccountId: string;
7656
+ stripePriceId: string;
7657
+ stripeProductId: string;
7658
+ subscriptionId: string;
7659
+ subscriptionItemId: string;
7660
+ } | undefined;
6886
7661
  }, {
6887
7662
  sourceChargeId: import("convex/values").VString<string, "required">;
6888
7663
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
6889
7664
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
7665
+ usageSource: import("convex/values").VObject<{
7666
+ customerAccount: string;
7667
+ invoicePaymentId: string;
7668
+ livemode: boolean;
7669
+ meterId: string;
7670
+ model: "included_overage" | "pay_as_you_go";
7671
+ period: {
7672
+ end: number;
7673
+ start: number;
7674
+ };
7675
+ stripeAccountId: string;
7676
+ stripePriceId: string;
7677
+ stripeProductId: string;
7678
+ subscriptionId: string;
7679
+ subscriptionItemId: string;
7680
+ } | undefined, {
7681
+ stripeAccountId: import("convex/values").VString<string, "required">;
7682
+ customerAccount: import("convex/values").VString<string, "required">;
7683
+ livemode: import("convex/values").VBoolean<boolean, "required">;
7684
+ meterId: import("convex/values").VString<string, "required">;
7685
+ stripePriceId: import("convex/values").VString<string, "required">;
7686
+ stripeProductId: import("convex/values").VString<string, "required">;
7687
+ subscriptionId: import("convex/values").VString<string, "required">;
7688
+ subscriptionItemId: import("convex/values").VString<string, "required">;
7689
+ invoicePaymentId: import("convex/values").VString<string, "required">;
7690
+ period: import("convex/values").VObject<{
7691
+ end: number;
7692
+ start: number;
7693
+ }, {
7694
+ start: import("convex/values").VFloat64<number, "required">;
7695
+ end: import("convex/values").VFloat64<number, "required">;
7696
+ }, "required", "end" | "start">;
7697
+ 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>;
7698
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
7699
+ creditSource: import("convex/values").VObject<{
7700
+ creditGrantId: string;
7701
+ customerAccount: string;
7702
+ livemode: boolean;
7703
+ purchaseId: string;
7704
+ stripeAccountId: string;
7705
+ stripePriceId: string;
7706
+ stripeProductId: string;
7707
+ } | undefined, {
7708
+ stripeAccountId: import("convex/values").VString<string, "required">;
7709
+ customerAccount: import("convex/values").VString<string, "required">;
7710
+ livemode: import("convex/values").VBoolean<boolean, "required">;
7711
+ purchaseId: import("convex/values").VString<string, "required">;
7712
+ creditGrantId: import("convex/values").VString<string, "required">;
7713
+ stripePriceId: import("convex/values").VString<string, "required">;
7714
+ stripeProductId: import("convex/values").VString<string, "required">;
7715
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
6890
7716
  gross: import("convex/values").VFloat64<number, "required">;
6891
7717
  currency: import("convex/values").VString<string, "required">;
6892
7718
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -6906,7 +7732,7 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
6906
7732
  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>;
6907
7733
  amount: import("convex/values").VFloat64<number, "required">;
6908
7734
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
6909
- }, "required", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">, {
7735
+ }, "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">, {
6910
7736
  by_source_charge: ["sourceChargeId", "_creationTime"];
6911
7737
  }, {}, {}>;
6912
7738
  commissionTerms: import("convex/server").TableDefinition<import("convex/values").VObject<{