@fantastic.dev/better-stripe 0.59.0 → 0.60.1

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 (230) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +5 -1
  3. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +676 -50
  4. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
  5. package/dist/client/connect/payoutExecutionTestHelpers.d.ts +322 -9
  6. package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
  7. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +644 -18
  8. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
  9. package/dist/client/connect/payoutSyncTestHelpers.d.ts +338 -25
  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/catalogPrices.d.ts +1 -1
  26. package/dist/client/usage/catalogPrices.d.ts.map +1 -1
  27. package/dist/client/usage/catalogPrices.js +4 -4
  28. package/dist/client/usage/catalogPrices.js.map +1 -1
  29. package/dist/client/usage/client.d.ts +2 -2
  30. package/dist/client/usage/client.js +2 -2
  31. package/dist/client/usage/creditCapacity.d.ts.map +1 -1
  32. package/dist/client/usage/creditCapacity.js +7 -1
  33. package/dist/client/usage/creditCapacity.js.map +1 -1
  34. package/dist/client/usage/creditClient.d.ts +3 -0
  35. package/dist/client/usage/creditClient.d.ts.map +1 -1
  36. package/dist/client/usage/creditDelivery.d.ts.map +1 -1
  37. package/dist/client/usage/creditDelivery.js +4 -1
  38. package/dist/client/usage/creditDelivery.js.map +1 -1
  39. package/dist/client/usage/creditLifecycle.d.ts.map +1 -1
  40. package/dist/client/usage/creditLifecycle.js +2 -1
  41. package/dist/client/usage/creditLifecycle.js.map +1 -1
  42. package/dist/client/usage/creditNative.d.ts +3 -0
  43. package/dist/client/usage/creditNative.d.ts.map +1 -1
  44. package/dist/client/usage/creditNative.js +3 -0
  45. package/dist/client/usage/creditNative.js.map +1 -1
  46. package/dist/client/usage/creditProvider.d.ts.map +1 -1
  47. package/dist/client/usage/creditProvider.js +2 -1
  48. package/dist/client/usage/creditProvider.js.map +1 -1
  49. package/dist/client/usage/creditRead.d.ts +1 -0
  50. package/dist/client/usage/creditRead.d.ts.map +1 -1
  51. package/dist/client/usage/creditReconciliation.d.ts.map +1 -1
  52. package/dist/client/usage/creditReconciliation.js +11 -3
  53. package/dist/client/usage/creditReconciliation.js.map +1 -1
  54. package/dist/client/usage/creditRevenue.d.ts +22 -0
  55. package/dist/client/usage/creditRevenue.d.ts.map +1 -0
  56. package/dist/client/usage/creditRevenue.js +118 -0
  57. package/dist/client/usage/creditRevenue.js.map +1 -0
  58. package/dist/client/usage/creditSettlement.d.ts +29 -0
  59. package/dist/client/usage/creditSettlement.d.ts.map +1 -0
  60. package/dist/client/usage/creditSettlement.fixtures.d.ts +216 -0
  61. package/dist/client/usage/creditSettlement.fixtures.d.ts.map +1 -0
  62. package/dist/client/usage/creditSettlement.fixtures.js +59 -0
  63. package/dist/client/usage/creditSettlement.fixtures.js.map +1 -0
  64. package/dist/client/usage/creditSettlement.js +70 -0
  65. package/dist/client/usage/creditSettlement.js.map +1 -0
  66. package/dist/client/usage/creditTransport.fixtures.d.ts +8 -1
  67. package/dist/client/usage/creditTransport.fixtures.d.ts.map +1 -1
  68. package/dist/client/usage/creditTransport.fixtures.js +27 -5
  69. package/dist/client/usage/creditTransport.fixtures.js.map +1 -1
  70. package/dist/client/usage/index.d.ts +4 -0
  71. package/dist/client/usage/index.d.ts.map +1 -1
  72. package/dist/client/usage/invoiceSale.d.ts +22 -0
  73. package/dist/client/usage/invoiceSale.d.ts.map +1 -0
  74. package/dist/client/usage/invoiceSale.fixtures.d.ts +285 -0
  75. package/dist/client/usage/invoiceSale.fixtures.d.ts.map +1 -0
  76. package/dist/client/usage/invoiceSale.fixtures.js +104 -0
  77. package/dist/client/usage/invoiceSale.fixtures.js.map +1 -0
  78. package/dist/client/usage/invoiceSale.js +117 -0
  79. package/dist/client/usage/invoiceSale.js.map +1 -0
  80. package/dist/client/usage/observationClient.d.ts +2 -2
  81. package/dist/client/usage/observationClient.d.ts.map +1 -1
  82. package/dist/client/usage/settlement.d.ts +32 -0
  83. package/dist/client/usage/settlement.d.ts.map +1 -0
  84. package/dist/client/usage/settlement.js +60 -0
  85. package/dist/client/usage/settlement.js.map +1 -0
  86. package/dist/client/usage/settlementClient.d.ts +51 -0
  87. package/dist/client/usage/settlementClient.d.ts.map +1 -0
  88. package/dist/client/usage/settlementClient.js +35 -0
  89. package/dist/client/usage/settlementClient.js.map +1 -0
  90. package/dist/client/usage/subscriptionCancellation.d.ts.map +1 -1
  91. package/dist/client/usage/subscriptionCancellation.js +3 -2
  92. package/dist/client/usage/subscriptionCancellation.js.map +1 -1
  93. package/dist/client/usage/subscriptionCheckout.d.ts.map +1 -1
  94. package/dist/client/usage/subscriptionCheckout.js +3 -2
  95. package/dist/client/usage/subscriptionCheckout.js.map +1 -1
  96. package/dist/client/usage/subscriptionLifecycle.d.ts +1 -0
  97. package/dist/client/usage/subscriptionLifecycle.d.ts.map +1 -1
  98. package/dist/client/usage/subscriptionLifecycle.js +3 -2
  99. package/dist/client/usage/subscriptionLifecycle.js.map +1 -1
  100. package/dist/client/usage/subscriptionProvider.d.ts +2 -0
  101. package/dist/client/usage/subscriptionProvider.d.ts.map +1 -1
  102. package/dist/client/usage/subscriptionProvider.js +9 -2
  103. package/dist/client/usage/subscriptionProvider.js.map +1 -1
  104. package/dist/component/_generated/component.d.ts +146 -0
  105. package/dist/component/_generated/component.d.ts.map +1 -1
  106. package/dist/component/balanceFunding/internal/actions.d.ts +11 -11
  107. package/dist/component/balanceFunding/mutations.d.ts +27 -27
  108. package/dist/component/earnings/triggers.d.ts +172 -12
  109. package/dist/component/earnings/triggers.d.ts.map +1 -1
  110. package/dist/component/financialObservations/settlementHelpers.d.ts.map +1 -1
  111. package/dist/component/financialObservations/settlementHelpers.js +2 -0
  112. package/dist/component/financialObservations/settlementHelpers.js.map +1 -1
  113. package/dist/component/recoveryWorkflow/helpers.d.ts +25 -0
  114. package/dist/component/recoveryWorkflow/helpers.d.ts.map +1 -1
  115. package/dist/component/recoveryWorkflow/mutations.d.ts +25 -0
  116. package/dist/component/recoveryWorkflow/mutations.d.ts.map +1 -1
  117. package/dist/component/recoveryWorkflow/queries.d.ts +50 -0
  118. package/dist/component/recoveryWorkflow/queries.d.ts.map +1 -1
  119. package/dist/component/recoveryWorkflow/schema.d.ts +566 -10
  120. package/dist/component/recoveryWorkflow/schema.d.ts.map +1 -1
  121. package/dist/component/schema.d.ts +322 -9
  122. package/dist/component/settlement/mutations.d.ts +50 -0
  123. package/dist/component/settlement/mutations.d.ts.map +1 -1
  124. package/dist/component/settlement/mutations.js +8 -1
  125. package/dist/component/settlement/mutations.js.map +1 -1
  126. package/dist/component/settlement/queries.d.ts +25 -0
  127. package/dist/component/settlement/queries.d.ts.map +1 -1
  128. package/dist/component/settlement/schema.d.ts +128 -1
  129. package/dist/component/settlement/schema.d.ts.map +1 -1
  130. package/dist/component/settlement/schema.js +22 -0
  131. package/dist/component/settlement/schema.js.map +1 -1
  132. package/dist/component/usage/allowance.fixtures.d.ts +4212 -0
  133. package/dist/component/usage/allowance.fixtures.d.ts.map +1 -0
  134. package/dist/component/usage/allowance.fixtures.js +67 -0
  135. package/dist/component/usage/allowance.fixtures.js.map +1 -0
  136. package/dist/component/usageCredits/accounting.fixtures.d.ts +4235 -0
  137. package/dist/component/usageCredits/accounting.fixtures.d.ts.map +1 -0
  138. package/dist/component/usageCredits/accounting.fixtures.js +89 -0
  139. package/dist/component/usageCredits/accounting.fixtures.js.map +1 -0
  140. package/dist/component/usageCredits/helpers.d.ts +7 -0
  141. package/dist/component/usageCredits/helpers.d.ts.map +1 -1
  142. package/dist/component/usageCredits/helpers.js +5 -0
  143. package/dist/component/usageCredits/helpers.js.map +1 -1
  144. package/dist/component/usageCredits/mutations.d.ts +6 -0
  145. package/dist/component/usageCredits/mutations.d.ts.map +1 -1
  146. package/dist/component/usageCredits/mutations.js +70 -7
  147. package/dist/component/usageCredits/mutations.js.map +1 -1
  148. package/dist/component/usageCredits/purchase.d.ts +1 -0
  149. package/dist/component/usageCredits/purchase.d.ts.map +1 -1
  150. package/dist/component/usageCredits/queries.d.ts +10 -0
  151. package/dist/component/usageCredits/queries.d.ts.map +1 -1
  152. package/dist/component/usageCredits/schema.d.ts +24 -4
  153. package/dist/component/usageCredits/schema.d.ts.map +1 -1
  154. package/dist/component/usageCredits/schema.js +4 -0
  155. package/dist/component/usageCredits/schema.js.map +1 -1
  156. package/dist/component/usageSubscriptions/history.d.ts.map +1 -1
  157. package/dist/component/usageSubscriptions/history.js +3 -1
  158. package/dist/component/usageSubscriptions/history.js.map +1 -1
  159. package/dist/component/usageSubscriptions/mutations.d.ts +5 -0
  160. package/dist/component/usageSubscriptions/mutations.d.ts.map +1 -1
  161. package/dist/component/usageSubscriptions/mutations.js +19 -0
  162. package/dist/component/usageSubscriptions/mutations.js.map +1 -1
  163. package/dist/component/usageSubscriptions/queries.d.ts +2 -0
  164. package/dist/component/usageSubscriptions/queries.d.ts.map +1 -1
  165. package/dist/component/usageSubscriptions/schema.d.ts +7 -2
  166. package/dist/component/usageSubscriptions/schema.d.ts.map +1 -1
  167. package/dist/component/usageSubscriptions/schema.js +1 -0
  168. package/dist/component/usageSubscriptions/schema.js.map +1 -1
  169. package/docs/README.md +4 -0
  170. package/docs/settlement.md +4 -0
  171. package/docs/usage-credits.md +6 -1
  172. package/docs/usage-security.md +130 -0
  173. package/docs/usage-settlement.md +162 -0
  174. package/package.json +3 -1
  175. package/src/client/index.ts +9 -0
  176. package/src/client/paymentSource/resolver.fixtures.ts +216 -0
  177. package/src/client/paymentSource/resolver.test.ts +11 -207
  178. package/src/client/paymentSource/resolver.ts +54 -2
  179. package/src/client/settlement/execution.ts +24 -0
  180. package/src/client/usage/catalogPrices.ts +4 -2
  181. package/src/client/usage/client.ts +2 -2
  182. package/src/client/usage/creditBackingIsolation.test.ts +110 -0
  183. package/src/client/usage/creditCapacity.test.ts +80 -1
  184. package/src/client/usage/creditCapacity.ts +10 -1
  185. package/src/client/usage/creditDelivery.ts +4 -0
  186. package/src/client/usage/creditLifecycle.ts +2 -0
  187. package/src/client/usage/creditNative.ts +5 -0
  188. package/src/client/usage/creditProofBounds.test.ts +187 -0
  189. package/src/client/usage/creditProvider.test.ts +74 -0
  190. package/src/client/usage/creditProvider.ts +2 -0
  191. package/src/client/usage/creditReconciliation.ts +18 -3
  192. package/src/client/usage/creditRevenue.test.ts +105 -0
  193. package/src/client/usage/creditRevenue.ts +163 -0
  194. package/src/client/usage/creditSettlement.fixtures.ts +70 -0
  195. package/src/client/usage/creditSettlement.test.ts +66 -0
  196. package/src/client/usage/creditSettlement.ts +94 -0
  197. package/src/client/usage/creditSettlementRecovery.test.ts +173 -0
  198. package/src/client/usage/creditTransport.fixtures.ts +31 -5
  199. package/src/client/usage/index.ts +9 -0
  200. package/src/client/usage/invoiceSale.fixtures.ts +103 -0
  201. package/src/client/usage/invoiceSale.test.ts +184 -0
  202. package/src/client/usage/invoiceSale.ts +155 -0
  203. package/src/client/usage/settlement.test.ts +179 -0
  204. package/src/client/usage/settlement.ts +81 -0
  205. package/src/client/usage/settlementClient.ts +84 -0
  206. package/src/client/usage/subscriptionCancellation.ts +3 -2
  207. package/src/client/usage/subscriptionCheckout.ts +7 -2
  208. package/src/client/usage/subscriptionClient.test.ts +60 -1
  209. package/src/client/usage/subscriptionLifecycle.ts +3 -2
  210. package/src/client/usage/subscriptionProvider.ts +27 -3
  211. package/src/component/_generated/component.ts +150 -1
  212. package/src/component/financialObservations/settlementHelpers.ts +2 -0
  213. package/src/component/settlement/mutations.ts +10 -1
  214. package/src/component/settlement/schema.ts +26 -0
  215. package/src/component/settlement/settlement-claims.test.ts +54 -0
  216. package/src/component/usage/allowance.fixtures.ts +77 -0
  217. package/src/component/usage/allowance.test.ts +3 -66
  218. package/src/component/usage/allowanceBounds.test.ts +79 -0
  219. package/src/component/usage/historyIsolation.test.ts +124 -0
  220. package/src/component/usageCredits/accounting.fixtures.ts +96 -0
  221. package/src/component/usageCredits/accounting.test.ts +176 -82
  222. package/src/component/usageCredits/freshness.test.ts +33 -0
  223. package/src/component/usageCredits/helpers.ts +8 -0
  224. package/src/component/usageCredits/mutations.ts +83 -5
  225. package/src/component/usageCredits/quotas.test.ts +63 -0
  226. package/src/component/usageCredits/schema.ts +10 -0
  227. package/src/component/usageSubscriptions/history.test.ts +57 -0
  228. package/src/component/usageSubscriptions/history.ts +3 -1
  229. package/src/component/usageSubscriptions/mutations.ts +23 -0
  230. package/src/component/usageSubscriptions/schema.ts +1 -0
@@ -175,6 +175,7 @@ export declare function large(count?: number, amount?: number): Promise<{
175
175
  historyCount?: number | undefined;
176
176
  key: string;
177
177
  method: "checkout" | "direct";
178
+ observationStartedAt?: number | undefined;
178
179
  providerId?: string | undefined;
179
180
  retiredAt?: number | undefined;
180
181
  retirementInvoiceId?: string | undefined;
@@ -192,12 +193,13 @@ export declare function large(count?: number, amount?: number): Promise<{
192
193
  checkoutId: import("convex/values").VString<string | undefined, "optional">;
193
194
  viewJson: import("convex/values").VString<string | undefined, "optional">;
194
195
  startedAt: import("convex/values").VFloat64<number | undefined, "optional">;
196
+ observationStartedAt: import("convex/values").VFloat64<number | undefined, "optional">;
195
197
  controlKey: import("convex/values").VString<string | undefined, "optional">;
196
198
  historyCount: import("convex/values").VFloat64<number | undefined, "optional">;
197
199
  retiredAt: import("convex/values").VFloat64<number | undefined, "optional">;
198
200
  abandonedId: import("convex/values").VString<string | undefined, "optional">;
199
201
  retirementInvoiceId: import("convex/values").VString<string | undefined, "optional">;
200
- }, "required", "abandonedId" | "checkoutId" | "controlKey" | "firstAttemptAt" | "historyCount" | "key" | "method" | "providerId" | "retiredAt" | "retirementInvoiceId" | "scopeKey" | "startedAt" | "termsJson" | "viewJson">, {
202
+ }, "required", "abandonedId" | "checkoutId" | "controlKey" | "firstAttemptAt" | "historyCount" | "key" | "method" | "observationStartedAt" | "providerId" | "retiredAt" | "retirementInvoiceId" | "scopeKey" | "startedAt" | "termsJson" | "viewJson">, {
201
203
  by_key: ["key", "_creationTime"];
202
204
  by_provider: ["providerId", "_creationTime"];
203
205
  }, {}, {}>;
@@ -477,6 +479,7 @@ export declare function large(count?: number, amount?: number): Promise<{
477
479
  paymentIntentId?: string | undefined;
478
480
  paymentKey?: string | undefined;
479
481
  paymentProofJson?: string | undefined;
482
+ recoveryReason?: "native_state_changed" | "payment_disputed" | "payment_refunded" | undefined;
480
483
  refundedAmount?: number | undefined;
481
484
  state: "canceled" | "frozen" | "pending" | "ready";
482
485
  termsJson: string;
@@ -493,9 +496,10 @@ export declare function large(count?: number, amount?: number): Promise<{
493
496
  paymentKey: import("convex/values").VString<string | undefined, "optional">;
494
497
  paymentProofJson: import("convex/values").VString<string | undefined, "optional">;
495
498
  refundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
499
+ recoveryReason: import("convex/values").VUnion<"native_state_changed" | "payment_disputed" | "payment_refunded" | undefined, [import("convex/values").VLiteral<"payment_refunded", "required">, import("convex/values").VLiteral<"payment_disputed", "required">, import("convex/values").VLiteral<"native_state_changed", "required">], "optional", never>;
496
500
  grantFirstAttemptAt: import("convex/values").VFloat64<number | undefined, "optional">;
497
501
  creditGrantId: import("convex/values").VString<string | undefined, "optional">;
498
- }, "required", "accountKey" | "capacityReserved" | "creditGrantId" | "firstAttemptAt" | "grantFirstAttemptAt" | "key" | "nativeCustomerKey" | "paymentAttemptedAt" | "paymentIntentId" | "paymentKey" | "paymentProofJson" | "refundedAmount" | "state" | "termsJson">, {
502
+ }, "required", "accountKey" | "capacityReserved" | "creditGrantId" | "firstAttemptAt" | "grantFirstAttemptAt" | "key" | "nativeCustomerKey" | "paymentAttemptedAt" | "paymentIntentId" | "paymentKey" | "paymentProofJson" | "recoveryReason" | "refundedAmount" | "state" | "termsJson">, {
499
503
  by_account: ["accountKey", "_creationTime"];
500
504
  by_customer_capacity: ["nativeCustomerKey", "capacityReserved", "_creationTime"];
501
505
  by_key: ["key", "_creationTime"];
@@ -515,9 +519,12 @@ export declare function large(count?: number, amount?: number): Promise<{
515
519
  nativeExpired?: boolean | undefined;
516
520
  nativeObservationJson?: string | undefined;
517
521
  nativeUnused: boolean;
522
+ observationConflictAt?: number | undefined;
523
+ observationStartedAt?: number | undefined;
518
524
  observedAt?: number | undefined;
519
525
  paymentIntentId: string;
520
526
  proofJson: string;
527
+ proofStartedAt?: number | undefined;
521
528
  purchaseKey: string;
522
529
  reserved: string;
523
530
  }, {
@@ -539,7 +546,10 @@ export declare function large(count?: number, amount?: number): Promise<{
539
546
  nativeExpired: import("convex/values").VBoolean<boolean | undefined, "optional">;
540
547
  nativeObservationJson: import("convex/values").VString<string | undefined, "optional">;
541
548
  observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
542
- }, "required", "accountKey" | "available" | "chargeId" | "consumed" | "creditGrantId" | "effectiveAt" | "expiresAt" | "frozen" | "nativeCreated" | "nativeCustomerKey" | "nativeExpired" | "nativeObservationJson" | "nativeUnused" | "observedAt" | "paymentIntentId" | "proofJson" | "purchaseKey" | "reserved">, {
549
+ proofStartedAt: import("convex/values").VFloat64<number | undefined, "optional">;
550
+ observationStartedAt: import("convex/values").VFloat64<number | undefined, "optional">;
551
+ observationConflictAt: import("convex/values").VFloat64<number | undefined, "optional">;
552
+ }, "required", "accountKey" | "available" | "chargeId" | "consumed" | "creditGrantId" | "effectiveAt" | "expiresAt" | "frozen" | "nativeCreated" | "nativeCustomerKey" | "nativeExpired" | "nativeObservationJson" | "nativeUnused" | "observationConflictAt" | "observationStartedAt" | "observedAt" | "paymentIntentId" | "proofJson" | "proofStartedAt" | "purchaseKey" | "reserved">, {
543
553
  by_account: ["accountKey", "_creationTime"];
544
554
  by_customer_unused: ["nativeCustomerKey", "nativeUnused", "_creationTime"];
545
555
  by_native: ["creditGrantId", "_creationTime"];
@@ -1105,6 +1115,15 @@ export declare function large(count?: number, amount?: number): Promise<{
1105
1115
  activePhase?: "execute" | "reconcile" | undefined;
1106
1116
  allocation?: {
1107
1117
  adjustmentAmount?: number | undefined;
1118
+ creditSource?: {
1119
+ creditGrantId: string;
1120
+ customerAccount: string;
1121
+ livemode: boolean;
1122
+ purchaseId: string;
1123
+ stripeAccountId: string;
1124
+ stripePriceId: string;
1125
+ stripeProductId: string;
1126
+ } | undefined;
1108
1127
  currency: string;
1109
1128
  gross: number;
1110
1129
  paymentId?: string | undefined;
@@ -1118,6 +1137,22 @@ export declare function large(count?: number, amount?: number): Promise<{
1118
1137
  destinationAccountId: string;
1119
1138
  role: "affiliate" | "other" | "store";
1120
1139
  }[];
1140
+ usageSource?: {
1141
+ customerAccount: string;
1142
+ invoicePaymentId: string;
1143
+ livemode: boolean;
1144
+ meterId: string;
1145
+ model: "included_overage" | "pay_as_you_go";
1146
+ period: {
1147
+ end: number;
1148
+ start: number;
1149
+ };
1150
+ stripeAccountId: string;
1151
+ stripePriceId: string;
1152
+ stripeProductId: string;
1153
+ subscriptionId: string;
1154
+ subscriptionItemId: string;
1155
+ } | undefined;
1121
1156
  } | undefined;
1122
1157
  cancelRequested: boolean;
1123
1158
  completion?: string | undefined;
@@ -1152,6 +1187,15 @@ export declare function large(count?: number, amount?: number): Promise<{
1152
1187
  retryDelayMs: import("convex/values").VFloat64<number, "required">;
1153
1188
  allocation: import("convex/values").VObject<{
1154
1189
  adjustmentAmount?: number | undefined;
1190
+ creditSource?: {
1191
+ creditGrantId: string;
1192
+ customerAccount: string;
1193
+ livemode: boolean;
1194
+ purchaseId: string;
1195
+ stripeAccountId: string;
1196
+ stripePriceId: string;
1197
+ stripeProductId: string;
1198
+ } | undefined;
1155
1199
  currency: string;
1156
1200
  gross: number;
1157
1201
  paymentId?: string | undefined;
@@ -1165,10 +1209,77 @@ export declare function large(count?: number, amount?: number): Promise<{
1165
1209
  destinationAccountId: string;
1166
1210
  role: "affiliate" | "other" | "store";
1167
1211
  }[];
1212
+ usageSource?: {
1213
+ customerAccount: string;
1214
+ invoicePaymentId: string;
1215
+ livemode: boolean;
1216
+ meterId: string;
1217
+ model: "included_overage" | "pay_as_you_go";
1218
+ period: {
1219
+ end: number;
1220
+ start: number;
1221
+ };
1222
+ stripeAccountId: string;
1223
+ stripePriceId: string;
1224
+ stripeProductId: string;
1225
+ subscriptionId: string;
1226
+ subscriptionItemId: string;
1227
+ } | undefined;
1168
1228
  } | undefined, {
1169
1229
  sourceChargeId: import("convex/values").VString<string, "required">;
1170
1230
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
1171
1231
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
1232
+ usageSource: import("convex/values").VObject<{
1233
+ customerAccount: string;
1234
+ invoicePaymentId: string;
1235
+ livemode: boolean;
1236
+ meterId: string;
1237
+ model: "included_overage" | "pay_as_you_go";
1238
+ period: {
1239
+ end: number;
1240
+ start: number;
1241
+ };
1242
+ stripeAccountId: string;
1243
+ stripePriceId: string;
1244
+ stripeProductId: string;
1245
+ subscriptionId: string;
1246
+ subscriptionItemId: string;
1247
+ } | undefined, {
1248
+ stripeAccountId: import("convex/values").VString<string, "required">;
1249
+ customerAccount: import("convex/values").VString<string, "required">;
1250
+ livemode: import("convex/values").VBoolean<boolean, "required">;
1251
+ meterId: import("convex/values").VString<string, "required">;
1252
+ stripePriceId: import("convex/values").VString<string, "required">;
1253
+ stripeProductId: import("convex/values").VString<string, "required">;
1254
+ subscriptionId: import("convex/values").VString<string, "required">;
1255
+ subscriptionItemId: import("convex/values").VString<string, "required">;
1256
+ invoicePaymentId: import("convex/values").VString<string, "required">;
1257
+ period: import("convex/values").VObject<{
1258
+ end: number;
1259
+ start: number;
1260
+ }, {
1261
+ start: import("convex/values").VFloat64<number, "required">;
1262
+ end: import("convex/values").VFloat64<number, "required">;
1263
+ }, "required", "end" | "start">;
1264
+ 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>;
1265
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
1266
+ creditSource: import("convex/values").VObject<{
1267
+ creditGrantId: string;
1268
+ customerAccount: string;
1269
+ livemode: boolean;
1270
+ purchaseId: string;
1271
+ stripeAccountId: string;
1272
+ stripePriceId: string;
1273
+ stripeProductId: string;
1274
+ } | undefined, {
1275
+ stripeAccountId: import("convex/values").VString<string, "required">;
1276
+ customerAccount: import("convex/values").VString<string, "required">;
1277
+ livemode: import("convex/values").VBoolean<boolean, "required">;
1278
+ purchaseId: import("convex/values").VString<string, "required">;
1279
+ creditGrantId: import("convex/values").VString<string, "required">;
1280
+ stripePriceId: import("convex/values").VString<string, "required">;
1281
+ stripeProductId: import("convex/values").VString<string, "required">;
1282
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
1172
1283
  gross: import("convex/values").VFloat64<number, "required">;
1173
1284
  currency: import("convex/values").VString<string, "required">;
1174
1285
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -1188,7 +1299,7 @@ export declare function large(count?: number, amount?: number): Promise<{
1188
1299
  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>;
1189
1300
  amount: import("convex/values").VFloat64<number, "required">;
1190
1301
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
1191
- }, "optional", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">;
1302
+ }, "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">;
1192
1303
  version: import("convex/values").VFloat64<number, "required">;
1193
1304
  sourceKind: import("convex/values").VUnion<"invoice" | "settlement", [import("convex/values").VLiteral<"settlement", "required">, import("convex/values").VLiteral<"invoice", "required">], "required", never>;
1194
1305
  sourceId: import("convex/values").VString<string, "required">;
@@ -1199,7 +1310,7 @@ export declare function large(count?: number, amount?: number): Promise<{
1199
1310
  activePhase: import("convex/values").VUnion<"execute" | "reconcile" | undefined, [import("convex/values").VLiteral<"execute", "required">, import("convex/values").VLiteral<"reconcile", "required">], "optional", never>;
1200
1311
  resumeQueued: import("convex/values").VBoolean<boolean, "required">;
1201
1312
  outcome: import("convex/values").VUnion<"collect" | "release" | undefined, [import("convex/values").VLiteral<"collect", "required">, import("convex/values").VLiteral<"release", "required">], "optional", never>;
1202
- }, "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">, {
1313
+ }, "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">, {
1203
1314
  by_group: ["groupKey", "_creationTime"];
1204
1315
  by_source: ["sourceKind", "sourceId", "_creationTime"];
1205
1316
  }, {}, {}>;
@@ -1208,6 +1319,15 @@ export declare function large(count?: number, amount?: number): Promise<{
1208
1319
  accountId: string;
1209
1320
  allocation?: {
1210
1321
  adjustmentAmount?: number | undefined;
1322
+ creditSource?: {
1323
+ creditGrantId: string;
1324
+ customerAccount: string;
1325
+ livemode: boolean;
1326
+ purchaseId: string;
1327
+ stripeAccountId: string;
1328
+ stripePriceId: string;
1329
+ stripeProductId: string;
1330
+ } | undefined;
1211
1331
  currency: string;
1212
1332
  gross: number;
1213
1333
  paymentId?: string | undefined;
@@ -1221,6 +1341,22 @@ export declare function large(count?: number, amount?: number): Promise<{
1221
1341
  destinationAccountId: string;
1222
1342
  role: "affiliate" | "other" | "store";
1223
1343
  }[];
1344
+ usageSource?: {
1345
+ customerAccount: string;
1346
+ invoicePaymentId: string;
1347
+ livemode: boolean;
1348
+ meterId: string;
1349
+ model: "included_overage" | "pay_as_you_go";
1350
+ period: {
1351
+ end: number;
1352
+ start: number;
1353
+ };
1354
+ stripeAccountId: string;
1355
+ stripePriceId: string;
1356
+ stripeProductId: string;
1357
+ subscriptionId: string;
1358
+ subscriptionItemId: string;
1359
+ } | undefined;
1224
1360
  } | undefined;
1225
1361
  completion?: string | undefined;
1226
1362
  currency: string;
@@ -1241,6 +1377,15 @@ export declare function large(count?: number, amount?: number): Promise<{
1241
1377
  accountId: string;
1242
1378
  allocation?: {
1243
1379
  adjustmentAmount?: number | undefined;
1380
+ creditSource?: {
1381
+ creditGrantId: string;
1382
+ customerAccount: string;
1383
+ livemode: boolean;
1384
+ purchaseId: string;
1385
+ stripeAccountId: string;
1386
+ stripePriceId: string;
1387
+ stripeProductId: string;
1388
+ } | undefined;
1244
1389
  currency: string;
1245
1390
  gross: number;
1246
1391
  paymentId?: string | undefined;
@@ -1254,6 +1399,22 @@ export declare function large(count?: number, amount?: number): Promise<{
1254
1399
  destinationAccountId: string;
1255
1400
  role: "affiliate" | "other" | "store";
1256
1401
  }[];
1402
+ usageSource?: {
1403
+ customerAccount: string;
1404
+ invoicePaymentId: string;
1405
+ livemode: boolean;
1406
+ meterId: string;
1407
+ model: "included_overage" | "pay_as_you_go";
1408
+ period: {
1409
+ end: number;
1410
+ start: number;
1411
+ };
1412
+ stripeAccountId: string;
1413
+ stripePriceId: string;
1414
+ stripeProductId: string;
1415
+ subscriptionId: string;
1416
+ subscriptionItemId: string;
1417
+ } | undefined;
1257
1418
  } | undefined;
1258
1419
  completion?: string | undefined;
1259
1420
  currency: string;
@@ -1279,6 +1440,15 @@ export declare function large(count?: number, amount?: number): Promise<{
1279
1440
  retryDelayMs: import("convex/values").VFloat64<number, "required">;
1280
1441
  allocation: import("convex/values").VObject<{
1281
1442
  adjustmentAmount?: number | undefined;
1443
+ creditSource?: {
1444
+ creditGrantId: string;
1445
+ customerAccount: string;
1446
+ livemode: boolean;
1447
+ purchaseId: string;
1448
+ stripeAccountId: string;
1449
+ stripePriceId: string;
1450
+ stripeProductId: string;
1451
+ } | undefined;
1282
1452
  currency: string;
1283
1453
  gross: number;
1284
1454
  paymentId?: string | undefined;
@@ -1292,10 +1462,77 @@ export declare function large(count?: number, amount?: number): Promise<{
1292
1462
  destinationAccountId: string;
1293
1463
  role: "affiliate" | "other" | "store";
1294
1464
  }[];
1465
+ usageSource?: {
1466
+ customerAccount: string;
1467
+ invoicePaymentId: string;
1468
+ livemode: boolean;
1469
+ meterId: string;
1470
+ model: "included_overage" | "pay_as_you_go";
1471
+ period: {
1472
+ end: number;
1473
+ start: number;
1474
+ };
1475
+ stripeAccountId: string;
1476
+ stripePriceId: string;
1477
+ stripeProductId: string;
1478
+ subscriptionId: string;
1479
+ subscriptionItemId: string;
1480
+ } | undefined;
1295
1481
  } | undefined, {
1296
1482
  sourceChargeId: import("convex/values").VString<string, "required">;
1297
1483
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
1298
1484
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
1485
+ usageSource: import("convex/values").VObject<{
1486
+ customerAccount: string;
1487
+ invoicePaymentId: string;
1488
+ livemode: boolean;
1489
+ meterId: string;
1490
+ model: "included_overage" | "pay_as_you_go";
1491
+ period: {
1492
+ end: number;
1493
+ start: number;
1494
+ };
1495
+ stripeAccountId: string;
1496
+ stripePriceId: string;
1497
+ stripeProductId: string;
1498
+ subscriptionId: string;
1499
+ subscriptionItemId: string;
1500
+ } | undefined, {
1501
+ stripeAccountId: import("convex/values").VString<string, "required">;
1502
+ customerAccount: import("convex/values").VString<string, "required">;
1503
+ livemode: import("convex/values").VBoolean<boolean, "required">;
1504
+ meterId: import("convex/values").VString<string, "required">;
1505
+ stripePriceId: import("convex/values").VString<string, "required">;
1506
+ stripeProductId: import("convex/values").VString<string, "required">;
1507
+ subscriptionId: import("convex/values").VString<string, "required">;
1508
+ subscriptionItemId: import("convex/values").VString<string, "required">;
1509
+ invoicePaymentId: import("convex/values").VString<string, "required">;
1510
+ period: import("convex/values").VObject<{
1511
+ end: number;
1512
+ start: number;
1513
+ }, {
1514
+ start: import("convex/values").VFloat64<number, "required">;
1515
+ end: import("convex/values").VFloat64<number, "required">;
1516
+ }, "required", "end" | "start">;
1517
+ 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>;
1518
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
1519
+ creditSource: import("convex/values").VObject<{
1520
+ creditGrantId: string;
1521
+ customerAccount: string;
1522
+ livemode: boolean;
1523
+ purchaseId: string;
1524
+ stripeAccountId: string;
1525
+ stripePriceId: string;
1526
+ stripeProductId: string;
1527
+ } | undefined, {
1528
+ stripeAccountId: import("convex/values").VString<string, "required">;
1529
+ customerAccount: import("convex/values").VString<string, "required">;
1530
+ livemode: import("convex/values").VBoolean<boolean, "required">;
1531
+ purchaseId: import("convex/values").VString<string, "required">;
1532
+ creditGrantId: import("convex/values").VString<string, "required">;
1533
+ stripePriceId: import("convex/values").VString<string, "required">;
1534
+ stripeProductId: import("convex/values").VString<string, "required">;
1535
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
1299
1536
  gross: import("convex/values").VFloat64<number, "required">;
1300
1537
  currency: import("convex/values").VString<string, "required">;
1301
1538
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -1315,10 +1552,10 @@ export declare function large(count?: number, amount?: number): Promise<{
1315
1552
  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>;
1316
1553
  amount: import("convex/values").VFloat64<number, "required">;
1317
1554
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
1318
- }, "optional", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">;
1319
- }, "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">;
1555
+ }, "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">;
1556
+ }, "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">;
1320
1557
  operationId: import("convex/values").VId<import("convex/values").GenericId<"recoveryWorkflowOperations">, "required">;
1321
- }, "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">, {
1558
+ }, "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">, {
1322
1559
  by_key: ["requestKey", "_creationTime"];
1323
1560
  }, {}, {}>;
1324
1561
  balanceFundingPreparations: import("convex/server").TableDefinition<import("convex/values").VObject<{
@@ -3116,6 +3353,15 @@ export declare function large(count?: number, amount?: number): Promise<{
3116
3353
  }, {}, {}>;
3117
3354
  settlementAllocations: import("convex/server").TableDefinition<import("convex/values").VObject<{
3118
3355
  adjustmentAmount?: number | undefined;
3356
+ creditSource?: {
3357
+ creditGrantId: string;
3358
+ customerAccount: string;
3359
+ livemode: boolean;
3360
+ purchaseId: string;
3361
+ stripeAccountId: string;
3362
+ stripePriceId: string;
3363
+ stripeProductId: string;
3364
+ } | undefined;
3119
3365
  currency: string;
3120
3366
  gross: number;
3121
3367
  paymentId?: string | undefined;
@@ -3129,10 +3375,77 @@ export declare function large(count?: number, amount?: number): Promise<{
3129
3375
  destinationAccountId: string;
3130
3376
  role: "affiliate" | "other" | "store";
3131
3377
  }[];
3378
+ usageSource?: {
3379
+ customerAccount: string;
3380
+ invoicePaymentId: string;
3381
+ livemode: boolean;
3382
+ meterId: string;
3383
+ model: "included_overage" | "pay_as_you_go";
3384
+ period: {
3385
+ end: number;
3386
+ start: number;
3387
+ };
3388
+ stripeAccountId: string;
3389
+ stripePriceId: string;
3390
+ stripeProductId: string;
3391
+ subscriptionId: string;
3392
+ subscriptionItemId: string;
3393
+ } | undefined;
3132
3394
  }, {
3133
3395
  sourceChargeId: import("convex/values").VString<string, "required">;
3134
3396
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
3135
3397
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
3398
+ usageSource: import("convex/values").VObject<{
3399
+ customerAccount: string;
3400
+ invoicePaymentId: string;
3401
+ livemode: boolean;
3402
+ meterId: string;
3403
+ model: "included_overage" | "pay_as_you_go";
3404
+ period: {
3405
+ end: number;
3406
+ start: number;
3407
+ };
3408
+ stripeAccountId: string;
3409
+ stripePriceId: string;
3410
+ stripeProductId: string;
3411
+ subscriptionId: string;
3412
+ subscriptionItemId: string;
3413
+ } | undefined, {
3414
+ stripeAccountId: import("convex/values").VString<string, "required">;
3415
+ customerAccount: import("convex/values").VString<string, "required">;
3416
+ livemode: import("convex/values").VBoolean<boolean, "required">;
3417
+ meterId: import("convex/values").VString<string, "required">;
3418
+ stripePriceId: import("convex/values").VString<string, "required">;
3419
+ stripeProductId: import("convex/values").VString<string, "required">;
3420
+ subscriptionId: import("convex/values").VString<string, "required">;
3421
+ subscriptionItemId: import("convex/values").VString<string, "required">;
3422
+ invoicePaymentId: import("convex/values").VString<string, "required">;
3423
+ period: import("convex/values").VObject<{
3424
+ end: number;
3425
+ start: number;
3426
+ }, {
3427
+ start: import("convex/values").VFloat64<number, "required">;
3428
+ end: import("convex/values").VFloat64<number, "required">;
3429
+ }, "required", "end" | "start">;
3430
+ 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>;
3431
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
3432
+ creditSource: import("convex/values").VObject<{
3433
+ creditGrantId: string;
3434
+ customerAccount: string;
3435
+ livemode: boolean;
3436
+ purchaseId: string;
3437
+ stripeAccountId: string;
3438
+ stripePriceId: string;
3439
+ stripeProductId: string;
3440
+ } | undefined, {
3441
+ stripeAccountId: import("convex/values").VString<string, "required">;
3442
+ customerAccount: import("convex/values").VString<string, "required">;
3443
+ livemode: import("convex/values").VBoolean<boolean, "required">;
3444
+ purchaseId: import("convex/values").VString<string, "required">;
3445
+ creditGrantId: import("convex/values").VString<string, "required">;
3446
+ stripePriceId: import("convex/values").VString<string, "required">;
3447
+ stripeProductId: import("convex/values").VString<string, "required">;
3448
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
3136
3449
  gross: import("convex/values").VFloat64<number, "required">;
3137
3450
  currency: import("convex/values").VString<string, "required">;
3138
3451
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -3152,7 +3465,7 @@ export declare function large(count?: number, amount?: number): Promise<{
3152
3465
  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>;
3153
3466
  amount: import("convex/values").VFloat64<number, "required">;
3154
3467
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
3155
- }, "required", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">, {
3468
+ }, "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">, {
3156
3469
  by_source_charge: ["sourceChargeId", "_creationTime"];
3157
3470
  }, {}, {}>;
3158
3471
  commissionTerms: import("convex/server").TableDefinition<import("convex/values").VObject<{
@@ -4149,6 +4462,7 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4149
4462
  historyCount?: number | undefined;
4150
4463
  key: string;
4151
4464
  method: "checkout" | "direct";
4465
+ observationStartedAt?: number | undefined;
4152
4466
  providerId?: string | undefined;
4153
4467
  retiredAt?: number | undefined;
4154
4468
  retirementInvoiceId?: string | undefined;
@@ -4166,12 +4480,13 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4166
4480
  checkoutId: import("convex/values").VString<string | undefined, "optional">;
4167
4481
  viewJson: import("convex/values").VString<string | undefined, "optional">;
4168
4482
  startedAt: import("convex/values").VFloat64<number | undefined, "optional">;
4483
+ observationStartedAt: import("convex/values").VFloat64<number | undefined, "optional">;
4169
4484
  controlKey: import("convex/values").VString<string | undefined, "optional">;
4170
4485
  historyCount: import("convex/values").VFloat64<number | undefined, "optional">;
4171
4486
  retiredAt: import("convex/values").VFloat64<number | undefined, "optional">;
4172
4487
  abandonedId: import("convex/values").VString<string | undefined, "optional">;
4173
4488
  retirementInvoiceId: import("convex/values").VString<string | undefined, "optional">;
4174
- }, "required", "abandonedId" | "checkoutId" | "controlKey" | "firstAttemptAt" | "historyCount" | "key" | "method" | "providerId" | "retiredAt" | "retirementInvoiceId" | "scopeKey" | "startedAt" | "termsJson" | "viewJson">, {
4489
+ }, "required", "abandonedId" | "checkoutId" | "controlKey" | "firstAttemptAt" | "historyCount" | "key" | "method" | "observationStartedAt" | "providerId" | "retiredAt" | "retirementInvoiceId" | "scopeKey" | "startedAt" | "termsJson" | "viewJson">, {
4175
4490
  by_key: ["key", "_creationTime"];
4176
4491
  by_provider: ["providerId", "_creationTime"];
4177
4492
  }, {}, {}>;
@@ -4451,6 +4766,7 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4451
4766
  paymentIntentId?: string | undefined;
4452
4767
  paymentKey?: string | undefined;
4453
4768
  paymentProofJson?: string | undefined;
4769
+ recoveryReason?: "native_state_changed" | "payment_disputed" | "payment_refunded" | undefined;
4454
4770
  refundedAmount?: number | undefined;
4455
4771
  state: "canceled" | "frozen" | "pending" | "ready";
4456
4772
  termsJson: string;
@@ -4467,9 +4783,10 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4467
4783
  paymentKey: import("convex/values").VString<string | undefined, "optional">;
4468
4784
  paymentProofJson: import("convex/values").VString<string | undefined, "optional">;
4469
4785
  refundedAmount: import("convex/values").VFloat64<number | undefined, "optional">;
4786
+ recoveryReason: import("convex/values").VUnion<"native_state_changed" | "payment_disputed" | "payment_refunded" | undefined, [import("convex/values").VLiteral<"payment_refunded", "required">, import("convex/values").VLiteral<"payment_disputed", "required">, import("convex/values").VLiteral<"native_state_changed", "required">], "optional", never>;
4470
4787
  grantFirstAttemptAt: import("convex/values").VFloat64<number | undefined, "optional">;
4471
4788
  creditGrantId: import("convex/values").VString<string | undefined, "optional">;
4472
- }, "required", "accountKey" | "capacityReserved" | "creditGrantId" | "firstAttemptAt" | "grantFirstAttemptAt" | "key" | "nativeCustomerKey" | "paymentAttemptedAt" | "paymentIntentId" | "paymentKey" | "paymentProofJson" | "refundedAmount" | "state" | "termsJson">, {
4789
+ }, "required", "accountKey" | "capacityReserved" | "creditGrantId" | "firstAttemptAt" | "grantFirstAttemptAt" | "key" | "nativeCustomerKey" | "paymentAttemptedAt" | "paymentIntentId" | "paymentKey" | "paymentProofJson" | "recoveryReason" | "refundedAmount" | "state" | "termsJson">, {
4473
4790
  by_account: ["accountKey", "_creationTime"];
4474
4791
  by_customer_capacity: ["nativeCustomerKey", "capacityReserved", "_creationTime"];
4475
4792
  by_key: ["key", "_creationTime"];
@@ -4489,9 +4806,12 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4489
4806
  nativeExpired?: boolean | undefined;
4490
4807
  nativeObservationJson?: string | undefined;
4491
4808
  nativeUnused: boolean;
4809
+ observationConflictAt?: number | undefined;
4810
+ observationStartedAt?: number | undefined;
4492
4811
  observedAt?: number | undefined;
4493
4812
  paymentIntentId: string;
4494
4813
  proofJson: string;
4814
+ proofStartedAt?: number | undefined;
4495
4815
  purchaseKey: string;
4496
4816
  reserved: string;
4497
4817
  }, {
@@ -4513,7 +4833,10 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
4513
4833
  nativeExpired: import("convex/values").VBoolean<boolean | undefined, "optional">;
4514
4834
  nativeObservationJson: import("convex/values").VString<string | undefined, "optional">;
4515
4835
  observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
4516
- }, "required", "accountKey" | "available" | "chargeId" | "consumed" | "creditGrantId" | "effectiveAt" | "expiresAt" | "frozen" | "nativeCreated" | "nativeCustomerKey" | "nativeExpired" | "nativeObservationJson" | "nativeUnused" | "observedAt" | "paymentIntentId" | "proofJson" | "purchaseKey" | "reserved">, {
4836
+ proofStartedAt: import("convex/values").VFloat64<number | undefined, "optional">;
4837
+ observationStartedAt: import("convex/values").VFloat64<number | undefined, "optional">;
4838
+ observationConflictAt: import("convex/values").VFloat64<number | undefined, "optional">;
4839
+ }, "required", "accountKey" | "available" | "chargeId" | "consumed" | "creditGrantId" | "effectiveAt" | "expiresAt" | "frozen" | "nativeCreated" | "nativeCustomerKey" | "nativeExpired" | "nativeObservationJson" | "nativeUnused" | "observationConflictAt" | "observationStartedAt" | "observedAt" | "paymentIntentId" | "proofJson" | "proofStartedAt" | "purchaseKey" | "reserved">, {
4517
4840
  by_account: ["accountKey", "_creationTime"];
4518
4841
  by_customer_unused: ["nativeCustomerKey", "nativeUnused", "_creationTime"];
4519
4842
  by_native: ["creditGrantId", "_creationTime"];
@@ -5079,6 +5402,15 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
5079
5402
  activePhase?: "execute" | "reconcile" | undefined;
5080
5403
  allocation?: {
5081
5404
  adjustmentAmount?: number | undefined;
5405
+ creditSource?: {
5406
+ creditGrantId: string;
5407
+ customerAccount: string;
5408
+ livemode: boolean;
5409
+ purchaseId: string;
5410
+ stripeAccountId: string;
5411
+ stripePriceId: string;
5412
+ stripeProductId: string;
5413
+ } | undefined;
5082
5414
  currency: string;
5083
5415
  gross: number;
5084
5416
  paymentId?: string | undefined;
@@ -5092,6 +5424,22 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
5092
5424
  destinationAccountId: string;
5093
5425
  role: "affiliate" | "other" | "store";
5094
5426
  }[];
5427
+ usageSource?: {
5428
+ customerAccount: string;
5429
+ invoicePaymentId: string;
5430
+ livemode: boolean;
5431
+ meterId: string;
5432
+ model: "included_overage" | "pay_as_you_go";
5433
+ period: {
5434
+ end: number;
5435
+ start: number;
5436
+ };
5437
+ stripeAccountId: string;
5438
+ stripePriceId: string;
5439
+ stripeProductId: string;
5440
+ subscriptionId: string;
5441
+ subscriptionItemId: string;
5442
+ } | undefined;
5095
5443
  } | undefined;
5096
5444
  cancelRequested: boolean;
5097
5445
  completion?: string | undefined;
@@ -5126,6 +5474,15 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
5126
5474
  retryDelayMs: import("convex/values").VFloat64<number, "required">;
5127
5475
  allocation: import("convex/values").VObject<{
5128
5476
  adjustmentAmount?: number | undefined;
5477
+ creditSource?: {
5478
+ creditGrantId: string;
5479
+ customerAccount: string;
5480
+ livemode: boolean;
5481
+ purchaseId: string;
5482
+ stripeAccountId: string;
5483
+ stripePriceId: string;
5484
+ stripeProductId: string;
5485
+ } | undefined;
5129
5486
  currency: string;
5130
5487
  gross: number;
5131
5488
  paymentId?: string | undefined;
@@ -5139,10 +5496,77 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
5139
5496
  destinationAccountId: string;
5140
5497
  role: "affiliate" | "other" | "store";
5141
5498
  }[];
5499
+ usageSource?: {
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;
5142
5515
  } | undefined, {
5143
5516
  sourceChargeId: import("convex/values").VString<string, "required">;
5144
5517
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
5145
5518
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
5519
+ usageSource: import("convex/values").VObject<{
5520
+ customerAccount: string;
5521
+ invoicePaymentId: string;
5522
+ livemode: boolean;
5523
+ meterId: string;
5524
+ model: "included_overage" | "pay_as_you_go";
5525
+ period: {
5526
+ end: number;
5527
+ start: number;
5528
+ };
5529
+ stripeAccountId: string;
5530
+ stripePriceId: string;
5531
+ stripeProductId: string;
5532
+ subscriptionId: string;
5533
+ subscriptionItemId: string;
5534
+ } | undefined, {
5535
+ stripeAccountId: import("convex/values").VString<string, "required">;
5536
+ customerAccount: import("convex/values").VString<string, "required">;
5537
+ livemode: import("convex/values").VBoolean<boolean, "required">;
5538
+ meterId: import("convex/values").VString<string, "required">;
5539
+ stripePriceId: import("convex/values").VString<string, "required">;
5540
+ stripeProductId: import("convex/values").VString<string, "required">;
5541
+ subscriptionId: import("convex/values").VString<string, "required">;
5542
+ subscriptionItemId: import("convex/values").VString<string, "required">;
5543
+ invoicePaymentId: import("convex/values").VString<string, "required">;
5544
+ period: import("convex/values").VObject<{
5545
+ end: number;
5546
+ start: number;
5547
+ }, {
5548
+ start: import("convex/values").VFloat64<number, "required">;
5549
+ end: import("convex/values").VFloat64<number, "required">;
5550
+ }, "required", "end" | "start">;
5551
+ 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>;
5552
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
5553
+ creditSource: import("convex/values").VObject<{
5554
+ creditGrantId: string;
5555
+ customerAccount: string;
5556
+ livemode: boolean;
5557
+ purchaseId: string;
5558
+ stripeAccountId: string;
5559
+ stripePriceId: string;
5560
+ stripeProductId: string;
5561
+ } | undefined, {
5562
+ stripeAccountId: import("convex/values").VString<string, "required">;
5563
+ customerAccount: import("convex/values").VString<string, "required">;
5564
+ livemode: import("convex/values").VBoolean<boolean, "required">;
5565
+ purchaseId: import("convex/values").VString<string, "required">;
5566
+ creditGrantId: import("convex/values").VString<string, "required">;
5567
+ stripePriceId: import("convex/values").VString<string, "required">;
5568
+ stripeProductId: import("convex/values").VString<string, "required">;
5569
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
5146
5570
  gross: import("convex/values").VFloat64<number, "required">;
5147
5571
  currency: import("convex/values").VString<string, "required">;
5148
5572
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -5162,7 +5586,7 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
5162
5586
  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>;
5163
5587
  amount: import("convex/values").VFloat64<number, "required">;
5164
5588
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
5165
- }, "optional", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">;
5589
+ }, "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">;
5166
5590
  version: import("convex/values").VFloat64<number, "required">;
5167
5591
  sourceKind: import("convex/values").VUnion<"invoice" | "settlement", [import("convex/values").VLiteral<"settlement", "required">, import("convex/values").VLiteral<"invoice", "required">], "required", never>;
5168
5592
  sourceId: import("convex/values").VString<string, "required">;
@@ -5173,7 +5597,7 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
5173
5597
  activePhase: import("convex/values").VUnion<"execute" | "reconcile" | undefined, [import("convex/values").VLiteral<"execute", "required">, import("convex/values").VLiteral<"reconcile", "required">], "optional", never>;
5174
5598
  resumeQueued: import("convex/values").VBoolean<boolean, "required">;
5175
5599
  outcome: import("convex/values").VUnion<"collect" | "release" | undefined, [import("convex/values").VLiteral<"collect", "required">, import("convex/values").VLiteral<"release", "required">], "optional", never>;
5176
- }, "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">, {
5600
+ }, "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">, {
5177
5601
  by_group: ["groupKey", "_creationTime"];
5178
5602
  by_source: ["sourceKind", "sourceId", "_creationTime"];
5179
5603
  }, {}, {}>;
@@ -5182,6 +5606,15 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
5182
5606
  accountId: string;
5183
5607
  allocation?: {
5184
5608
  adjustmentAmount?: number | undefined;
5609
+ creditSource?: {
5610
+ creditGrantId: string;
5611
+ customerAccount: string;
5612
+ livemode: boolean;
5613
+ purchaseId: string;
5614
+ stripeAccountId: string;
5615
+ stripePriceId: string;
5616
+ stripeProductId: string;
5617
+ } | undefined;
5185
5618
  currency: string;
5186
5619
  gross: number;
5187
5620
  paymentId?: string | undefined;
@@ -5195,6 +5628,22 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
5195
5628
  destinationAccountId: string;
5196
5629
  role: "affiliate" | "other" | "store";
5197
5630
  }[];
5631
+ usageSource?: {
5632
+ customerAccount: string;
5633
+ invoicePaymentId: string;
5634
+ livemode: boolean;
5635
+ meterId: string;
5636
+ model: "included_overage" | "pay_as_you_go";
5637
+ period: {
5638
+ end: number;
5639
+ start: number;
5640
+ };
5641
+ stripeAccountId: string;
5642
+ stripePriceId: string;
5643
+ stripeProductId: string;
5644
+ subscriptionId: string;
5645
+ subscriptionItemId: string;
5646
+ } | undefined;
5198
5647
  } | undefined;
5199
5648
  completion?: string | undefined;
5200
5649
  currency: string;
@@ -5215,6 +5664,15 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
5215
5664
  accountId: string;
5216
5665
  allocation?: {
5217
5666
  adjustmentAmount?: number | undefined;
5667
+ creditSource?: {
5668
+ creditGrantId: string;
5669
+ customerAccount: string;
5670
+ livemode: boolean;
5671
+ purchaseId: string;
5672
+ stripeAccountId: string;
5673
+ stripePriceId: string;
5674
+ stripeProductId: string;
5675
+ } | undefined;
5218
5676
  currency: string;
5219
5677
  gross: number;
5220
5678
  paymentId?: string | undefined;
@@ -5228,6 +5686,22 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
5228
5686
  destinationAccountId: string;
5229
5687
  role: "affiliate" | "other" | "store";
5230
5688
  }[];
5689
+ usageSource?: {
5690
+ customerAccount: string;
5691
+ invoicePaymentId: string;
5692
+ livemode: boolean;
5693
+ meterId: string;
5694
+ model: "included_overage" | "pay_as_you_go";
5695
+ period: {
5696
+ end: number;
5697
+ start: number;
5698
+ };
5699
+ stripeAccountId: string;
5700
+ stripePriceId: string;
5701
+ stripeProductId: string;
5702
+ subscriptionId: string;
5703
+ subscriptionItemId: string;
5704
+ } | undefined;
5231
5705
  } | undefined;
5232
5706
  completion?: string | undefined;
5233
5707
  currency: string;
@@ -5253,6 +5727,15 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
5253
5727
  retryDelayMs: import("convex/values").VFloat64<number, "required">;
5254
5728
  allocation: import("convex/values").VObject<{
5255
5729
  adjustmentAmount?: number | undefined;
5730
+ creditSource?: {
5731
+ creditGrantId: string;
5732
+ customerAccount: string;
5733
+ livemode: boolean;
5734
+ purchaseId: string;
5735
+ stripeAccountId: string;
5736
+ stripePriceId: string;
5737
+ stripeProductId: string;
5738
+ } | undefined;
5256
5739
  currency: string;
5257
5740
  gross: number;
5258
5741
  paymentId?: string | undefined;
@@ -5266,10 +5749,77 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
5266
5749
  destinationAccountId: string;
5267
5750
  role: "affiliate" | "other" | "store";
5268
5751
  }[];
5752
+ usageSource?: {
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;
5269
5768
  } | undefined, {
5270
5769
  sourceChargeId: import("convex/values").VString<string, "required">;
5271
5770
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
5272
5771
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
5772
+ usageSource: import("convex/values").VObject<{
5773
+ customerAccount: string;
5774
+ invoicePaymentId: string;
5775
+ livemode: boolean;
5776
+ meterId: string;
5777
+ model: "included_overage" | "pay_as_you_go";
5778
+ period: {
5779
+ end: number;
5780
+ start: number;
5781
+ };
5782
+ stripeAccountId: string;
5783
+ stripePriceId: string;
5784
+ stripeProductId: string;
5785
+ subscriptionId: string;
5786
+ subscriptionItemId: string;
5787
+ } | undefined, {
5788
+ stripeAccountId: import("convex/values").VString<string, "required">;
5789
+ customerAccount: import("convex/values").VString<string, "required">;
5790
+ livemode: import("convex/values").VBoolean<boolean, "required">;
5791
+ meterId: import("convex/values").VString<string, "required">;
5792
+ stripePriceId: import("convex/values").VString<string, "required">;
5793
+ stripeProductId: import("convex/values").VString<string, "required">;
5794
+ subscriptionId: import("convex/values").VString<string, "required">;
5795
+ subscriptionItemId: import("convex/values").VString<string, "required">;
5796
+ invoicePaymentId: import("convex/values").VString<string, "required">;
5797
+ period: import("convex/values").VObject<{
5798
+ end: number;
5799
+ start: number;
5800
+ }, {
5801
+ start: import("convex/values").VFloat64<number, "required">;
5802
+ end: import("convex/values").VFloat64<number, "required">;
5803
+ }, "required", "end" | "start">;
5804
+ 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>;
5805
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
5806
+ creditSource: import("convex/values").VObject<{
5807
+ creditGrantId: string;
5808
+ customerAccount: string;
5809
+ livemode: boolean;
5810
+ purchaseId: string;
5811
+ stripeAccountId: string;
5812
+ stripePriceId: string;
5813
+ stripeProductId: string;
5814
+ } | undefined, {
5815
+ stripeAccountId: import("convex/values").VString<string, "required">;
5816
+ customerAccount: import("convex/values").VString<string, "required">;
5817
+ livemode: import("convex/values").VBoolean<boolean, "required">;
5818
+ purchaseId: import("convex/values").VString<string, "required">;
5819
+ creditGrantId: import("convex/values").VString<string, "required">;
5820
+ stripePriceId: import("convex/values").VString<string, "required">;
5821
+ stripeProductId: import("convex/values").VString<string, "required">;
5822
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
5273
5823
  gross: import("convex/values").VFloat64<number, "required">;
5274
5824
  currency: import("convex/values").VString<string, "required">;
5275
5825
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -5289,10 +5839,10 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
5289
5839
  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>;
5290
5840
  amount: import("convex/values").VFloat64<number, "required">;
5291
5841
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
5292
- }, "optional", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">;
5293
- }, "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">;
5842
+ }, "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">;
5843
+ }, "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">;
5294
5844
  operationId: import("convex/values").VId<import("convex/values").GenericId<"recoveryWorkflowOperations">, "required">;
5295
- }, "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">, {
5845
+ }, "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">, {
5296
5846
  by_key: ["requestKey", "_creationTime"];
5297
5847
  }, {}, {}>;
5298
5848
  balanceFundingPreparations: import("convex/server").TableDefinition<import("convex/values").VObject<{
@@ -7090,6 +7640,15 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
7090
7640
  }, {}, {}>;
7091
7641
  settlementAllocations: import("convex/server").TableDefinition<import("convex/values").VObject<{
7092
7642
  adjustmentAmount?: number | undefined;
7643
+ creditSource?: {
7644
+ creditGrantId: string;
7645
+ customerAccount: string;
7646
+ livemode: boolean;
7647
+ purchaseId: string;
7648
+ stripeAccountId: string;
7649
+ stripePriceId: string;
7650
+ stripeProductId: string;
7651
+ } | undefined;
7093
7652
  currency: string;
7094
7653
  gross: number;
7095
7654
  paymentId?: string | undefined;
@@ -7103,10 +7662,77 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
7103
7662
  destinationAccountId: string;
7104
7663
  role: "affiliate" | "other" | "store";
7105
7664
  }[];
7665
+ usageSource?: {
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;
7106
7681
  }, {
7107
7682
  sourceChargeId: import("convex/values").VString<string, "required">;
7108
7683
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
7109
7684
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
7685
+ usageSource: import("convex/values").VObject<{
7686
+ customerAccount: string;
7687
+ invoicePaymentId: string;
7688
+ livemode: boolean;
7689
+ meterId: string;
7690
+ model: "included_overage" | "pay_as_you_go";
7691
+ period: {
7692
+ end: number;
7693
+ start: number;
7694
+ };
7695
+ stripeAccountId: string;
7696
+ stripePriceId: string;
7697
+ stripeProductId: string;
7698
+ subscriptionId: string;
7699
+ subscriptionItemId: string;
7700
+ } | undefined, {
7701
+ stripeAccountId: import("convex/values").VString<string, "required">;
7702
+ customerAccount: import("convex/values").VString<string, "required">;
7703
+ livemode: import("convex/values").VBoolean<boolean, "required">;
7704
+ meterId: import("convex/values").VString<string, "required">;
7705
+ stripePriceId: import("convex/values").VString<string, "required">;
7706
+ stripeProductId: import("convex/values").VString<string, "required">;
7707
+ subscriptionId: import("convex/values").VString<string, "required">;
7708
+ subscriptionItemId: import("convex/values").VString<string, "required">;
7709
+ invoicePaymentId: import("convex/values").VString<string, "required">;
7710
+ period: import("convex/values").VObject<{
7711
+ end: number;
7712
+ start: number;
7713
+ }, {
7714
+ start: import("convex/values").VFloat64<number, "required">;
7715
+ end: import("convex/values").VFloat64<number, "required">;
7716
+ }, "required", "end" | "start">;
7717
+ 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>;
7718
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
7719
+ creditSource: import("convex/values").VObject<{
7720
+ creditGrantId: string;
7721
+ customerAccount: string;
7722
+ livemode: boolean;
7723
+ purchaseId: string;
7724
+ stripeAccountId: string;
7725
+ stripePriceId: string;
7726
+ stripeProductId: string;
7727
+ } | undefined, {
7728
+ stripeAccountId: import("convex/values").VString<string, "required">;
7729
+ customerAccount: import("convex/values").VString<string, "required">;
7730
+ livemode: import("convex/values").VBoolean<boolean, "required">;
7731
+ purchaseId: import("convex/values").VString<string, "required">;
7732
+ creditGrantId: import("convex/values").VString<string, "required">;
7733
+ stripePriceId: import("convex/values").VString<string, "required">;
7734
+ stripeProductId: import("convex/values").VString<string, "required">;
7735
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
7110
7736
  gross: import("convex/values").VFloat64<number, "required">;
7111
7737
  currency: import("convex/values").VString<string, "required">;
7112
7738
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -7126,7 +7752,7 @@ export declare function withHistory(count?: number, amount?: number): Promise<{
7126
7752
  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>;
7127
7753
  amount: import("convex/values").VFloat64<number, "required">;
7128
7754
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
7129
- }, "required", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">, {
7755
+ }, "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">, {
7130
7756
  by_source_charge: ["sourceChargeId", "_creationTime"];
7131
7757
  }, {}, {}>;
7132
7758
  commissionTerms: import("convex/server").TableDefinition<import("convex/values").VObject<{