@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
@@ -12,6 +12,15 @@ export declare const bindingFields: {
12
12
  retryDelayMs: import("convex/values").VFloat64<number, "required">;
13
13
  allocation: import("convex/values").VObject<{
14
14
  adjustmentAmount?: number | undefined;
15
+ creditSource?: {
16
+ creditGrantId: string;
17
+ customerAccount: string;
18
+ livemode: boolean;
19
+ purchaseId: string;
20
+ stripeAccountId: string;
21
+ stripePriceId: string;
22
+ stripeProductId: string;
23
+ } | undefined;
15
24
  currency: string;
16
25
  gross: number;
17
26
  paymentId?: string | undefined;
@@ -25,10 +34,77 @@ export declare const bindingFields: {
25
34
  destinationAccountId: string;
26
35
  role: "affiliate" | "other" | "store";
27
36
  }[];
37
+ usageSource?: {
38
+ customerAccount: string;
39
+ invoicePaymentId: string;
40
+ livemode: boolean;
41
+ meterId: string;
42
+ model: "included_overage" | "pay_as_you_go";
43
+ period: {
44
+ end: number;
45
+ start: number;
46
+ };
47
+ stripeAccountId: string;
48
+ stripePriceId: string;
49
+ stripeProductId: string;
50
+ subscriptionId: string;
51
+ subscriptionItemId: string;
52
+ } | undefined;
28
53
  } | undefined, {
29
54
  sourceChargeId: import("convex/values").VString<string, "required">;
30
55
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
31
56
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
57
+ usageSource: import("convex/values").VObject<{
58
+ customerAccount: string;
59
+ invoicePaymentId: string;
60
+ livemode: boolean;
61
+ meterId: string;
62
+ model: "included_overage" | "pay_as_you_go";
63
+ period: {
64
+ end: number;
65
+ start: number;
66
+ };
67
+ stripeAccountId: string;
68
+ stripePriceId: string;
69
+ stripeProductId: string;
70
+ subscriptionId: string;
71
+ subscriptionItemId: string;
72
+ } | undefined, {
73
+ stripeAccountId: import("convex/values").VString<string, "required">;
74
+ customerAccount: import("convex/values").VString<string, "required">;
75
+ livemode: import("convex/values").VBoolean<boolean, "required">;
76
+ meterId: import("convex/values").VString<string, "required">;
77
+ stripePriceId: import("convex/values").VString<string, "required">;
78
+ stripeProductId: import("convex/values").VString<string, "required">;
79
+ subscriptionId: import("convex/values").VString<string, "required">;
80
+ subscriptionItemId: import("convex/values").VString<string, "required">;
81
+ invoicePaymentId: import("convex/values").VString<string, "required">;
82
+ period: import("convex/values").VObject<{
83
+ end: number;
84
+ start: number;
85
+ }, {
86
+ start: import("convex/values").VFloat64<number, "required">;
87
+ end: import("convex/values").VFloat64<number, "required">;
88
+ }, "required", "end" | "start">;
89
+ 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>;
90
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
91
+ creditSource: import("convex/values").VObject<{
92
+ creditGrantId: string;
93
+ customerAccount: string;
94
+ livemode: boolean;
95
+ purchaseId: string;
96
+ stripeAccountId: string;
97
+ stripePriceId: string;
98
+ stripeProductId: string;
99
+ } | undefined, {
100
+ stripeAccountId: import("convex/values").VString<string, "required">;
101
+ customerAccount: import("convex/values").VString<string, "required">;
102
+ livemode: import("convex/values").VBoolean<boolean, "required">;
103
+ purchaseId: import("convex/values").VString<string, "required">;
104
+ creditGrantId: import("convex/values").VString<string, "required">;
105
+ stripePriceId: import("convex/values").VString<string, "required">;
106
+ stripeProductId: import("convex/values").VString<string, "required">;
107
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
32
108
  gross: import("convex/values").VFloat64<number, "required">;
33
109
  currency: import("convex/values").VString<string, "required">;
34
110
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -48,7 +124,7 @@ export declare const bindingFields: {
48
124
  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>;
49
125
  amount: import("convex/values").VFloat64<number, "required">;
50
126
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
51
- }, "optional", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">;
127
+ }, "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">;
52
128
  };
53
129
  export declare const startFields: {
54
130
  accountId: import("convex/values").VString<string, "required">;
@@ -64,6 +140,15 @@ export declare const startFields: {
64
140
  retryDelayMs: import("convex/values").VFloat64<number, "required">;
65
141
  allocation: import("convex/values").VObject<{
66
142
  adjustmentAmount?: number | undefined;
143
+ creditSource?: {
144
+ creditGrantId: string;
145
+ customerAccount: string;
146
+ livemode: boolean;
147
+ purchaseId: string;
148
+ stripeAccountId: string;
149
+ stripePriceId: string;
150
+ stripeProductId: string;
151
+ } | undefined;
67
152
  currency: string;
68
153
  gross: number;
69
154
  paymentId?: string | undefined;
@@ -77,10 +162,77 @@ export declare const startFields: {
77
162
  destinationAccountId: string;
78
163
  role: "affiliate" | "other" | "store";
79
164
  }[];
165
+ usageSource?: {
166
+ customerAccount: string;
167
+ invoicePaymentId: string;
168
+ livemode: boolean;
169
+ meterId: string;
170
+ model: "included_overage" | "pay_as_you_go";
171
+ period: {
172
+ end: number;
173
+ start: number;
174
+ };
175
+ stripeAccountId: string;
176
+ stripePriceId: string;
177
+ stripeProductId: string;
178
+ subscriptionId: string;
179
+ subscriptionItemId: string;
180
+ } | undefined;
80
181
  } | undefined, {
81
182
  sourceChargeId: import("convex/values").VString<string, "required">;
82
183
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
83
184
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
185
+ usageSource: import("convex/values").VObject<{
186
+ customerAccount: string;
187
+ invoicePaymentId: string;
188
+ livemode: boolean;
189
+ meterId: string;
190
+ model: "included_overage" | "pay_as_you_go";
191
+ period: {
192
+ end: number;
193
+ start: number;
194
+ };
195
+ stripeAccountId: string;
196
+ stripePriceId: string;
197
+ stripeProductId: string;
198
+ subscriptionId: string;
199
+ subscriptionItemId: string;
200
+ } | undefined, {
201
+ stripeAccountId: import("convex/values").VString<string, "required">;
202
+ customerAccount: import("convex/values").VString<string, "required">;
203
+ livemode: import("convex/values").VBoolean<boolean, "required">;
204
+ meterId: import("convex/values").VString<string, "required">;
205
+ stripePriceId: import("convex/values").VString<string, "required">;
206
+ stripeProductId: import("convex/values").VString<string, "required">;
207
+ subscriptionId: import("convex/values").VString<string, "required">;
208
+ subscriptionItemId: import("convex/values").VString<string, "required">;
209
+ invoicePaymentId: import("convex/values").VString<string, "required">;
210
+ period: import("convex/values").VObject<{
211
+ end: number;
212
+ start: number;
213
+ }, {
214
+ start: import("convex/values").VFloat64<number, "required">;
215
+ end: import("convex/values").VFloat64<number, "required">;
216
+ }, "required", "end" | "start">;
217
+ 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>;
218
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
219
+ creditSource: import("convex/values").VObject<{
220
+ creditGrantId: string;
221
+ customerAccount: string;
222
+ livemode: boolean;
223
+ purchaseId: string;
224
+ stripeAccountId: string;
225
+ stripePriceId: string;
226
+ stripeProductId: string;
227
+ } | undefined, {
228
+ stripeAccountId: import("convex/values").VString<string, "required">;
229
+ customerAccount: import("convex/values").VString<string, "required">;
230
+ livemode: import("convex/values").VBoolean<boolean, "required">;
231
+ purchaseId: import("convex/values").VString<string, "required">;
232
+ creditGrantId: import("convex/values").VString<string, "required">;
233
+ stripePriceId: import("convex/values").VString<string, "required">;
234
+ stripeProductId: import("convex/values").VString<string, "required">;
235
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
84
236
  gross: import("convex/values").VFloat64<number, "required">;
85
237
  currency: import("convex/values").VString<string, "required">;
86
238
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -100,7 +252,7 @@ export declare const startFields: {
100
252
  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>;
101
253
  amount: import("convex/values").VFloat64<number, "required">;
102
254
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
103
- }, "optional", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">;
255
+ }, "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">;
104
256
  requestKey: import("convex/values").VString<string, "required">;
105
257
  };
106
258
  export declare const refFields: {
@@ -126,6 +278,15 @@ export declare const operationFields: {
126
278
  retryDelayMs: import("convex/values").VFloat64<number, "required">;
127
279
  allocation: import("convex/values").VObject<{
128
280
  adjustmentAmount?: number | undefined;
281
+ creditSource?: {
282
+ creditGrantId: string;
283
+ customerAccount: string;
284
+ livemode: boolean;
285
+ purchaseId: string;
286
+ stripeAccountId: string;
287
+ stripePriceId: string;
288
+ stripeProductId: string;
289
+ } | undefined;
129
290
  currency: string;
130
291
  gross: number;
131
292
  paymentId?: string | undefined;
@@ -139,10 +300,77 @@ export declare const operationFields: {
139
300
  destinationAccountId: string;
140
301
  role: "affiliate" | "other" | "store";
141
302
  }[];
303
+ usageSource?: {
304
+ customerAccount: string;
305
+ invoicePaymentId: string;
306
+ livemode: boolean;
307
+ meterId: string;
308
+ model: "included_overage" | "pay_as_you_go";
309
+ period: {
310
+ end: number;
311
+ start: number;
312
+ };
313
+ stripeAccountId: string;
314
+ stripePriceId: string;
315
+ stripeProductId: string;
316
+ subscriptionId: string;
317
+ subscriptionItemId: string;
318
+ } | undefined;
142
319
  } | undefined, {
143
320
  sourceChargeId: import("convex/values").VString<string, "required">;
144
321
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
145
322
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
323
+ usageSource: import("convex/values").VObject<{
324
+ customerAccount: string;
325
+ invoicePaymentId: string;
326
+ livemode: boolean;
327
+ meterId: string;
328
+ model: "included_overage" | "pay_as_you_go";
329
+ period: {
330
+ end: number;
331
+ start: number;
332
+ };
333
+ stripeAccountId: string;
334
+ stripePriceId: string;
335
+ stripeProductId: string;
336
+ subscriptionId: string;
337
+ subscriptionItemId: string;
338
+ } | undefined, {
339
+ stripeAccountId: import("convex/values").VString<string, "required">;
340
+ customerAccount: import("convex/values").VString<string, "required">;
341
+ livemode: import("convex/values").VBoolean<boolean, "required">;
342
+ meterId: import("convex/values").VString<string, "required">;
343
+ stripePriceId: import("convex/values").VString<string, "required">;
344
+ stripeProductId: import("convex/values").VString<string, "required">;
345
+ subscriptionId: import("convex/values").VString<string, "required">;
346
+ subscriptionItemId: import("convex/values").VString<string, "required">;
347
+ invoicePaymentId: import("convex/values").VString<string, "required">;
348
+ period: import("convex/values").VObject<{
349
+ end: number;
350
+ start: number;
351
+ }, {
352
+ start: import("convex/values").VFloat64<number, "required">;
353
+ end: import("convex/values").VFloat64<number, "required">;
354
+ }, "required", "end" | "start">;
355
+ 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>;
356
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
357
+ creditSource: import("convex/values").VObject<{
358
+ creditGrantId: string;
359
+ customerAccount: string;
360
+ livemode: boolean;
361
+ purchaseId: string;
362
+ stripeAccountId: string;
363
+ stripePriceId: string;
364
+ stripeProductId: string;
365
+ } | undefined, {
366
+ stripeAccountId: import("convex/values").VString<string, "required">;
367
+ customerAccount: import("convex/values").VString<string, "required">;
368
+ livemode: import("convex/values").VBoolean<boolean, "required">;
369
+ purchaseId: import("convex/values").VString<string, "required">;
370
+ creditGrantId: import("convex/values").VString<string, "required">;
371
+ stripePriceId: import("convex/values").VString<string, "required">;
372
+ stripeProductId: import("convex/values").VString<string, "required">;
373
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
146
374
  gross: import("convex/values").VFloat64<number, "required">;
147
375
  currency: import("convex/values").VString<string, "required">;
148
376
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -162,7 +390,7 @@ export declare const operationFields: {
162
390
  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>;
163
391
  amount: import("convex/values").VFloat64<number, "required">;
164
392
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
165
- }, "optional", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">;
393
+ }, "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">;
166
394
  version: import("convex/values").VFloat64<number, "required">;
167
395
  sourceKind: import("convex/values").VUnion<"invoice" | "settlement", [import("convex/values").VLiteral<"settlement", "required">, import("convex/values").VLiteral<"invoice", "required">], "required", never>;
168
396
  sourceId: import("convex/values").VString<string, "required">;
@@ -179,6 +407,15 @@ export declare const operationsTable: import("convex/server").TableDefinition<im
179
407
  activePhase?: "execute" | "reconcile" | undefined;
180
408
  allocation?: {
181
409
  adjustmentAmount?: number | undefined;
410
+ creditSource?: {
411
+ creditGrantId: string;
412
+ customerAccount: string;
413
+ livemode: boolean;
414
+ purchaseId: string;
415
+ stripeAccountId: string;
416
+ stripePriceId: string;
417
+ stripeProductId: string;
418
+ } | undefined;
182
419
  currency: string;
183
420
  gross: number;
184
421
  paymentId?: string | undefined;
@@ -192,6 +429,22 @@ export declare const operationsTable: import("convex/server").TableDefinition<im
192
429
  destinationAccountId: string;
193
430
  role: "affiliate" | "other" | "store";
194
431
  }[];
432
+ usageSource?: {
433
+ customerAccount: string;
434
+ invoicePaymentId: string;
435
+ livemode: boolean;
436
+ meterId: string;
437
+ model: "included_overage" | "pay_as_you_go";
438
+ period: {
439
+ end: number;
440
+ start: number;
441
+ };
442
+ stripeAccountId: string;
443
+ stripePriceId: string;
444
+ stripeProductId: string;
445
+ subscriptionId: string;
446
+ subscriptionItemId: string;
447
+ } | undefined;
195
448
  } | undefined;
196
449
  cancelRequested: boolean;
197
450
  completion?: string | undefined;
@@ -226,6 +479,15 @@ export declare const operationsTable: import("convex/server").TableDefinition<im
226
479
  retryDelayMs: import("convex/values").VFloat64<number, "required">;
227
480
  allocation: import("convex/values").VObject<{
228
481
  adjustmentAmount?: number | undefined;
482
+ creditSource?: {
483
+ creditGrantId: string;
484
+ customerAccount: string;
485
+ livemode: boolean;
486
+ purchaseId: string;
487
+ stripeAccountId: string;
488
+ stripePriceId: string;
489
+ stripeProductId: string;
490
+ } | undefined;
229
491
  currency: string;
230
492
  gross: number;
231
493
  paymentId?: string | undefined;
@@ -239,10 +501,77 @@ export declare const operationsTable: import("convex/server").TableDefinition<im
239
501
  destinationAccountId: string;
240
502
  role: "affiliate" | "other" | "store";
241
503
  }[];
504
+ usageSource?: {
505
+ customerAccount: string;
506
+ invoicePaymentId: string;
507
+ livemode: boolean;
508
+ meterId: string;
509
+ model: "included_overage" | "pay_as_you_go";
510
+ period: {
511
+ end: number;
512
+ start: number;
513
+ };
514
+ stripeAccountId: string;
515
+ stripePriceId: string;
516
+ stripeProductId: string;
517
+ subscriptionId: string;
518
+ subscriptionItemId: string;
519
+ } | undefined;
242
520
  } | undefined, {
243
521
  sourceChargeId: import("convex/values").VString<string, "required">;
244
522
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
245
523
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
524
+ usageSource: import("convex/values").VObject<{
525
+ customerAccount: string;
526
+ invoicePaymentId: string;
527
+ livemode: boolean;
528
+ meterId: string;
529
+ model: "included_overage" | "pay_as_you_go";
530
+ period: {
531
+ end: number;
532
+ start: number;
533
+ };
534
+ stripeAccountId: string;
535
+ stripePriceId: string;
536
+ stripeProductId: string;
537
+ subscriptionId: string;
538
+ subscriptionItemId: string;
539
+ } | undefined, {
540
+ stripeAccountId: import("convex/values").VString<string, "required">;
541
+ customerAccount: import("convex/values").VString<string, "required">;
542
+ livemode: import("convex/values").VBoolean<boolean, "required">;
543
+ meterId: import("convex/values").VString<string, "required">;
544
+ stripePriceId: import("convex/values").VString<string, "required">;
545
+ stripeProductId: import("convex/values").VString<string, "required">;
546
+ subscriptionId: import("convex/values").VString<string, "required">;
547
+ subscriptionItemId: import("convex/values").VString<string, "required">;
548
+ invoicePaymentId: import("convex/values").VString<string, "required">;
549
+ period: import("convex/values").VObject<{
550
+ end: number;
551
+ start: number;
552
+ }, {
553
+ start: import("convex/values").VFloat64<number, "required">;
554
+ end: import("convex/values").VFloat64<number, "required">;
555
+ }, "required", "end" | "start">;
556
+ 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>;
557
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
558
+ creditSource: import("convex/values").VObject<{
559
+ creditGrantId: string;
560
+ customerAccount: string;
561
+ livemode: boolean;
562
+ purchaseId: string;
563
+ stripeAccountId: string;
564
+ stripePriceId: string;
565
+ stripeProductId: string;
566
+ } | undefined, {
567
+ stripeAccountId: import("convex/values").VString<string, "required">;
568
+ customerAccount: import("convex/values").VString<string, "required">;
569
+ livemode: import("convex/values").VBoolean<boolean, "required">;
570
+ purchaseId: import("convex/values").VString<string, "required">;
571
+ creditGrantId: import("convex/values").VString<string, "required">;
572
+ stripePriceId: import("convex/values").VString<string, "required">;
573
+ stripeProductId: import("convex/values").VString<string, "required">;
574
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
246
575
  gross: import("convex/values").VFloat64<number, "required">;
247
576
  currency: import("convex/values").VString<string, "required">;
248
577
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -262,7 +591,7 @@ export declare const operationsTable: import("convex/server").TableDefinition<im
262
591
  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>;
263
592
  amount: import("convex/values").VFloat64<number, "required">;
264
593
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
265
- }, "optional", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">;
594
+ }, "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">;
266
595
  version: import("convex/values").VFloat64<number, "required">;
267
596
  sourceKind: import("convex/values").VUnion<"invoice" | "settlement", [import("convex/values").VLiteral<"settlement", "required">, import("convex/values").VLiteral<"invoice", "required">], "required", never>;
268
597
  sourceId: import("convex/values").VString<string, "required">;
@@ -273,7 +602,7 @@ export declare const operationsTable: import("convex/server").TableDefinition<im
273
602
  activePhase: import("convex/values").VUnion<"execute" | "reconcile" | undefined, [import("convex/values").VLiteral<"execute", "required">, import("convex/values").VLiteral<"reconcile", "required">], "optional", never>;
274
603
  resumeQueued: import("convex/values").VBoolean<boolean, "required">;
275
604
  outcome: import("convex/values").VUnion<"collect" | "release" | undefined, [import("convex/values").VLiteral<"collect", "required">, import("convex/values").VLiteral<"release", "required">], "optional", never>;
276
- }, "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">, {
605
+ }, "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">, {
277
606
  by_group: ["groupKey", "_creationTime"];
278
607
  by_source: ["sourceKind", "sourceId", "_creationTime"];
279
608
  }, {}, {}>;
@@ -282,6 +611,15 @@ export declare const requestsTable: import("convex/server").TableDefinition<impo
282
611
  accountId: string;
283
612
  allocation?: {
284
613
  adjustmentAmount?: number | undefined;
614
+ creditSource?: {
615
+ creditGrantId: string;
616
+ customerAccount: string;
617
+ livemode: boolean;
618
+ purchaseId: string;
619
+ stripeAccountId: string;
620
+ stripePriceId: string;
621
+ stripeProductId: string;
622
+ } | undefined;
285
623
  currency: string;
286
624
  gross: number;
287
625
  paymentId?: string | undefined;
@@ -295,6 +633,22 @@ export declare const requestsTable: import("convex/server").TableDefinition<impo
295
633
  destinationAccountId: string;
296
634
  role: "affiliate" | "other" | "store";
297
635
  }[];
636
+ usageSource?: {
637
+ customerAccount: string;
638
+ invoicePaymentId: string;
639
+ livemode: boolean;
640
+ meterId: string;
641
+ model: "included_overage" | "pay_as_you_go";
642
+ period: {
643
+ end: number;
644
+ start: number;
645
+ };
646
+ stripeAccountId: string;
647
+ stripePriceId: string;
648
+ stripeProductId: string;
649
+ subscriptionId: string;
650
+ subscriptionItemId: string;
651
+ } | undefined;
298
652
  } | undefined;
299
653
  completion?: string | undefined;
300
654
  currency: string;
@@ -315,6 +669,15 @@ export declare const requestsTable: import("convex/server").TableDefinition<impo
315
669
  accountId: string;
316
670
  allocation?: {
317
671
  adjustmentAmount?: number | undefined;
672
+ creditSource?: {
673
+ creditGrantId: string;
674
+ customerAccount: string;
675
+ livemode: boolean;
676
+ purchaseId: string;
677
+ stripeAccountId: string;
678
+ stripePriceId: string;
679
+ stripeProductId: string;
680
+ } | undefined;
318
681
  currency: string;
319
682
  gross: number;
320
683
  paymentId?: string | undefined;
@@ -328,6 +691,22 @@ export declare const requestsTable: import("convex/server").TableDefinition<impo
328
691
  destinationAccountId: string;
329
692
  role: "affiliate" | "other" | "store";
330
693
  }[];
694
+ usageSource?: {
695
+ customerAccount: string;
696
+ invoicePaymentId: string;
697
+ livemode: boolean;
698
+ meterId: string;
699
+ model: "included_overage" | "pay_as_you_go";
700
+ period: {
701
+ end: number;
702
+ start: number;
703
+ };
704
+ stripeAccountId: string;
705
+ stripePriceId: string;
706
+ stripeProductId: string;
707
+ subscriptionId: string;
708
+ subscriptionItemId: string;
709
+ } | undefined;
331
710
  } | undefined;
332
711
  completion?: string | undefined;
333
712
  currency: string;
@@ -353,6 +732,15 @@ export declare const requestsTable: import("convex/server").TableDefinition<impo
353
732
  retryDelayMs: import("convex/values").VFloat64<number, "required">;
354
733
  allocation: import("convex/values").VObject<{
355
734
  adjustmentAmount?: number | undefined;
735
+ creditSource?: {
736
+ creditGrantId: string;
737
+ customerAccount: string;
738
+ livemode: boolean;
739
+ purchaseId: string;
740
+ stripeAccountId: string;
741
+ stripePriceId: string;
742
+ stripeProductId: string;
743
+ } | undefined;
356
744
  currency: string;
357
745
  gross: number;
358
746
  paymentId?: string | undefined;
@@ -366,10 +754,77 @@ export declare const requestsTable: import("convex/server").TableDefinition<impo
366
754
  destinationAccountId: string;
367
755
  role: "affiliate" | "other" | "store";
368
756
  }[];
757
+ usageSource?: {
758
+ customerAccount: string;
759
+ invoicePaymentId: string;
760
+ livemode: boolean;
761
+ meterId: string;
762
+ model: "included_overage" | "pay_as_you_go";
763
+ period: {
764
+ end: number;
765
+ start: number;
766
+ };
767
+ stripeAccountId: string;
768
+ stripePriceId: string;
769
+ stripeProductId: string;
770
+ subscriptionId: string;
771
+ subscriptionItemId: string;
772
+ } | undefined;
369
773
  } | undefined, {
370
774
  sourceChargeId: import("convex/values").VString<string, "required">;
371
775
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
372
776
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
777
+ usageSource: import("convex/values").VObject<{
778
+ customerAccount: string;
779
+ invoicePaymentId: string;
780
+ livemode: boolean;
781
+ meterId: string;
782
+ model: "included_overage" | "pay_as_you_go";
783
+ period: {
784
+ end: number;
785
+ start: number;
786
+ };
787
+ stripeAccountId: string;
788
+ stripePriceId: string;
789
+ stripeProductId: string;
790
+ subscriptionId: string;
791
+ subscriptionItemId: string;
792
+ } | undefined, {
793
+ stripeAccountId: import("convex/values").VString<string, "required">;
794
+ customerAccount: import("convex/values").VString<string, "required">;
795
+ livemode: import("convex/values").VBoolean<boolean, "required">;
796
+ meterId: import("convex/values").VString<string, "required">;
797
+ stripePriceId: import("convex/values").VString<string, "required">;
798
+ stripeProductId: import("convex/values").VString<string, "required">;
799
+ subscriptionId: import("convex/values").VString<string, "required">;
800
+ subscriptionItemId: import("convex/values").VString<string, "required">;
801
+ invoicePaymentId: import("convex/values").VString<string, "required">;
802
+ period: import("convex/values").VObject<{
803
+ end: number;
804
+ start: number;
805
+ }, {
806
+ start: import("convex/values").VFloat64<number, "required">;
807
+ end: import("convex/values").VFloat64<number, "required">;
808
+ }, "required", "end" | "start">;
809
+ 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>;
810
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
811
+ creditSource: import("convex/values").VObject<{
812
+ creditGrantId: string;
813
+ customerAccount: string;
814
+ livemode: boolean;
815
+ purchaseId: string;
816
+ stripeAccountId: string;
817
+ stripePriceId: string;
818
+ stripeProductId: string;
819
+ } | undefined, {
820
+ stripeAccountId: import("convex/values").VString<string, "required">;
821
+ customerAccount: import("convex/values").VString<string, "required">;
822
+ livemode: import("convex/values").VBoolean<boolean, "required">;
823
+ purchaseId: import("convex/values").VString<string, "required">;
824
+ creditGrantId: import("convex/values").VString<string, "required">;
825
+ stripePriceId: import("convex/values").VString<string, "required">;
826
+ stripeProductId: import("convex/values").VString<string, "required">;
827
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
373
828
  gross: import("convex/values").VFloat64<number, "required">;
374
829
  currency: import("convex/values").VString<string, "required">;
375
830
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -389,10 +844,10 @@ export declare const requestsTable: import("convex/server").TableDefinition<impo
389
844
  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>;
390
845
  amount: import("convex/values").VFloat64<number, "required">;
391
846
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
392
- }, "optional", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">;
393
- }, "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">;
847
+ }, "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">;
848
+ }, "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">;
394
849
  operationId: import("convex/values").VId<import("convex/values").GenericId<"recoveryWorkflowOperations">, "required">;
395
- }, "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">, {
850
+ }, "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">, {
396
851
  by_key: ["requestKey", "_creationTime"];
397
852
  }, {}, {}>;
398
853
  export declare const operationDoc: import("convex/values").VObject<{
@@ -402,6 +857,15 @@ export declare const operationDoc: import("convex/values").VObject<{
402
857
  activePhase?: "execute" | "reconcile" | undefined;
403
858
  allocation?: {
404
859
  adjustmentAmount?: number | undefined;
860
+ creditSource?: {
861
+ creditGrantId: string;
862
+ customerAccount: string;
863
+ livemode: boolean;
864
+ purchaseId: string;
865
+ stripeAccountId: string;
866
+ stripePriceId: string;
867
+ stripeProductId: string;
868
+ } | undefined;
405
869
  currency: string;
406
870
  gross: number;
407
871
  paymentId?: string | undefined;
@@ -415,6 +879,22 @@ export declare const operationDoc: import("convex/values").VObject<{
415
879
  destinationAccountId: string;
416
880
  role: "affiliate" | "other" | "store";
417
881
  }[];
882
+ usageSource?: {
883
+ customerAccount: string;
884
+ invoicePaymentId: string;
885
+ livemode: boolean;
886
+ meterId: string;
887
+ model: "included_overage" | "pay_as_you_go";
888
+ period: {
889
+ end: number;
890
+ start: number;
891
+ };
892
+ stripeAccountId: string;
893
+ stripePriceId: string;
894
+ stripeProductId: string;
895
+ subscriptionId: string;
896
+ subscriptionItemId: string;
897
+ } | undefined;
418
898
  } | undefined;
419
899
  cancelRequested: boolean;
420
900
  completion?: string | undefined;
@@ -449,6 +929,15 @@ export declare const operationDoc: import("convex/values").VObject<{
449
929
  retryDelayMs: import("convex/values").VFloat64<number, "required">;
450
930
  allocation: import("convex/values").VObject<{
451
931
  adjustmentAmount?: number | undefined;
932
+ creditSource?: {
933
+ creditGrantId: string;
934
+ customerAccount: string;
935
+ livemode: boolean;
936
+ purchaseId: string;
937
+ stripeAccountId: string;
938
+ stripePriceId: string;
939
+ stripeProductId: string;
940
+ } | undefined;
452
941
  currency: string;
453
942
  gross: number;
454
943
  paymentId?: string | undefined;
@@ -462,10 +951,77 @@ export declare const operationDoc: import("convex/values").VObject<{
462
951
  destinationAccountId: string;
463
952
  role: "affiliate" | "other" | "store";
464
953
  }[];
954
+ usageSource?: {
955
+ customerAccount: string;
956
+ invoicePaymentId: string;
957
+ livemode: boolean;
958
+ meterId: string;
959
+ model: "included_overage" | "pay_as_you_go";
960
+ period: {
961
+ end: number;
962
+ start: number;
963
+ };
964
+ stripeAccountId: string;
965
+ stripePriceId: string;
966
+ stripeProductId: string;
967
+ subscriptionId: string;
968
+ subscriptionItemId: string;
969
+ } | undefined;
465
970
  } | undefined, {
466
971
  sourceChargeId: import("convex/values").VString<string, "required">;
467
972
  paymentIntentId: import("convex/values").VString<string | undefined, "optional">;
468
973
  sourceInvoiceId: import("convex/values").VString<string | undefined, "optional">;
974
+ usageSource: import("convex/values").VObject<{
975
+ customerAccount: string;
976
+ invoicePaymentId: string;
977
+ livemode: boolean;
978
+ meterId: string;
979
+ model: "included_overage" | "pay_as_you_go";
980
+ period: {
981
+ end: number;
982
+ start: number;
983
+ };
984
+ stripeAccountId: string;
985
+ stripePriceId: string;
986
+ stripeProductId: string;
987
+ subscriptionId: string;
988
+ subscriptionItemId: string;
989
+ } | undefined, {
990
+ stripeAccountId: import("convex/values").VString<string, "required">;
991
+ customerAccount: import("convex/values").VString<string, "required">;
992
+ livemode: import("convex/values").VBoolean<boolean, "required">;
993
+ meterId: import("convex/values").VString<string, "required">;
994
+ stripePriceId: import("convex/values").VString<string, "required">;
995
+ stripeProductId: import("convex/values").VString<string, "required">;
996
+ subscriptionId: import("convex/values").VString<string, "required">;
997
+ subscriptionItemId: import("convex/values").VString<string, "required">;
998
+ invoicePaymentId: import("convex/values").VString<string, "required">;
999
+ period: import("convex/values").VObject<{
1000
+ end: number;
1001
+ start: number;
1002
+ }, {
1003
+ start: import("convex/values").VFloat64<number, "required">;
1004
+ end: import("convex/values").VFloat64<number, "required">;
1005
+ }, "required", "end" | "start">;
1006
+ 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>;
1007
+ }, "optional", "customerAccount" | "invoicePaymentId" | "livemode" | "meterId" | "model" | "period" | "period.end" | "period.start" | "stripeAccountId" | "stripePriceId" | "stripeProductId" | "subscriptionId" | "subscriptionItemId">;
1008
+ creditSource: import("convex/values").VObject<{
1009
+ creditGrantId: string;
1010
+ customerAccount: string;
1011
+ livemode: boolean;
1012
+ purchaseId: string;
1013
+ stripeAccountId: string;
1014
+ stripePriceId: string;
1015
+ stripeProductId: string;
1016
+ } | undefined, {
1017
+ stripeAccountId: import("convex/values").VString<string, "required">;
1018
+ customerAccount: import("convex/values").VString<string, "required">;
1019
+ livemode: import("convex/values").VBoolean<boolean, "required">;
1020
+ purchaseId: import("convex/values").VString<string, "required">;
1021
+ creditGrantId: import("convex/values").VString<string, "required">;
1022
+ stripePriceId: import("convex/values").VString<string, "required">;
1023
+ stripeProductId: import("convex/values").VString<string, "required">;
1024
+ }, "optional", "creditGrantId" | "customerAccount" | "livemode" | "purchaseId" | "stripeAccountId" | "stripePriceId" | "stripeProductId">;
469
1025
  gross: import("convex/values").VFloat64<number, "required">;
470
1026
  currency: import("convex/values").VString<string, "required">;
471
1027
  processingFee: import("convex/values").VFloat64<number, "required">;
@@ -485,7 +1041,7 @@ export declare const operationDoc: import("convex/values").VObject<{
485
1041
  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>;
486
1042
  amount: import("convex/values").VFloat64<number, "required">;
487
1043
  }, "required", "amount" | "destinationAccountId" | "role">, "required">;
488
- }, "optional", "adjustmentAmount" | "currency" | "gross" | "paymentId" | "paymentIntentId" | "platformNet" | "processingFee" | "sourceChargeId" | "sourceInvoiceId" | "transfers">;
1044
+ }, "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">;
489
1045
  version: import("convex/values").VFloat64<number, "required">;
490
1046
  sourceKind: import("convex/values").VUnion<"invoice" | "settlement", [import("convex/values").VLiteral<"settlement", "required">, import("convex/values").VLiteral<"invoice", "required">], "required", never>;
491
1047
  sourceId: import("convex/values").VString<string, "required">;
@@ -498,7 +1054,7 @@ export declare const operationDoc: import("convex/values").VObject<{
498
1054
  outcome: import("convex/values").VUnion<"collect" | "release" | undefined, [import("convex/values").VLiteral<"collect", "required">, import("convex/values").VLiteral<"release", "required">], "optional", never>;
499
1055
  _id: import("convex/values").VId<import("convex/values").GenericId<"recoveryWorkflowOperations">, "required">;
500
1056
  _creationTime: import("convex/values").VFloat64<number, "required">;
501
- }, "required", "_creationTime" | "_id" | "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">;
1057
+ }, "required", "_creationTime" | "_id" | "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">;
502
1058
  export declare const statusFields: {
503
1059
  accountId: import("convex/values").VString<string, "required">;
504
1060
  scopeKey: import("convex/values").VString<string, "required">;