@fantastic.dev/better-stripe 0.58.0 → 0.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +238 -18
  4. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
  5. package/dist/client/connect/payoutExecutionTestHelpers.d.ts +119 -9
  6. package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
  7. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +238 -18
  8. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
  9. package/dist/client/connect/payoutSyncTestHelpers.d.ts +119 -9
  10. package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
  11. package/dist/client/usage/allowanceClient.d.ts +1 -1
  12. package/dist/client/usage/client.d.ts +2 -2
  13. package/dist/client/usage/client.d.ts.map +1 -1
  14. package/dist/client/usage/client.js +2 -2
  15. package/dist/client/usage/client.js.map +1 -1
  16. package/dist/client/usage/correctionClient.d.ts +33 -0
  17. package/dist/client/usage/correctionClient.d.ts.map +1 -0
  18. package/dist/client/usage/correctionClient.js +27 -0
  19. package/dist/client/usage/correctionClient.js.map +1 -0
  20. package/dist/client/usage/correctionEligibility.d.ts +4 -0
  21. package/dist/client/usage/correctionEligibility.d.ts.map +1 -0
  22. package/dist/client/usage/correctionEligibility.js +7 -0
  23. package/dist/client/usage/correctionEligibility.js.map +1 -0
  24. package/dist/client/usage/correctionInvoice.d.ts +9 -0
  25. package/dist/client/usage/correctionInvoice.d.ts.map +1 -0
  26. package/dist/client/usage/correctionInvoice.js +218 -0
  27. package/dist/client/usage/correctionInvoice.js.map +1 -0
  28. package/dist/client/usage/correctionInvoiceProof.d.ts +29 -0
  29. package/dist/client/usage/correctionInvoiceProof.d.ts.map +1 -0
  30. package/dist/client/usage/correctionInvoiceProof.js +41 -0
  31. package/dist/client/usage/correctionInvoiceProof.js.map +1 -0
  32. package/dist/client/usage/correctionProofs.d.ts +36 -0
  33. package/dist/client/usage/correctionProofs.d.ts.map +1 -0
  34. package/dist/client/usage/correctionProofs.js +41 -0
  35. package/dist/client/usage/correctionProofs.js.map +1 -0
  36. package/dist/client/usage/correctionProvider.d.ts +6 -0
  37. package/dist/client/usage/correctionProvider.d.ts.map +1 -0
  38. package/dist/client/usage/correctionProvider.js +243 -0
  39. package/dist/client/usage/correctionProvider.js.map +1 -0
  40. package/dist/client/usage/correctionRead.d.ts +27 -0
  41. package/dist/client/usage/correctionRead.d.ts.map +1 -0
  42. package/dist/client/usage/correctionRead.js +36 -0
  43. package/dist/client/usage/correctionRead.js.map +1 -0
  44. package/dist/client/usage/correctionTerms.d.ts +64 -0
  45. package/dist/client/usage/correctionTerms.d.ts.map +1 -0
  46. package/dist/client/usage/correctionTerms.js +65 -0
  47. package/dist/client/usage/correctionTerms.js.map +1 -0
  48. package/dist/client/usage/correctionTransport.fixtures.d.ts +37 -0
  49. package/dist/client/usage/correctionTransport.fixtures.d.ts.map +1 -0
  50. package/dist/client/usage/correctionTransport.fixtures.js +322 -0
  51. package/dist/client/usage/correctionTransport.fixtures.js.map +1 -0
  52. package/dist/client/usage/creditClient.d.ts +1 -1
  53. package/dist/client/usage/index.d.ts +2 -0
  54. package/dist/client/usage/index.d.ts.map +1 -1
  55. package/dist/client/usage/observationClient.d.ts +20 -0
  56. package/dist/client/usage/observationClient.d.ts.map +1 -1
  57. package/dist/client/usage/observationClient.js +20 -6
  58. package/dist/client/usage/observationClient.js.map +1 -1
  59. package/dist/client/usage/records.d.ts +1 -1
  60. package/dist/client/usage/records.d.ts.map +1 -1
  61. package/dist/client/usage/records.js.map +1 -1
  62. package/dist/client/usage/summary.d.ts +3 -0
  63. package/dist/client/usage/summary.d.ts.map +1 -1
  64. package/dist/client/usage/summary.js +9 -4
  65. package/dist/client/usage/summary.js.map +1 -1
  66. package/dist/client/usageExports.d.ts +2 -0
  67. package/dist/client/usageExports.d.ts.map +1 -1
  68. package/dist/component/_generated/api.d.ts +12 -0
  69. package/dist/component/_generated/api.d.ts.map +1 -1
  70. package/dist/component/_generated/api.js.map +1 -1
  71. package/dist/component/_generated/component.d.ts +255 -14
  72. package/dist/component/_generated/component.d.ts.map +1 -1
  73. package/dist/component/accountClosure/mutations.d.ts.map +1 -1
  74. package/dist/component/accountClosure/mutations.js +13 -0
  75. package/dist/component/accountClosure/mutations.js.map +1 -1
  76. package/dist/component/balanceFunding/mutations.d.ts +27 -27
  77. package/dist/component/balanceFunding/stateHandlers.d.ts +8 -8
  78. package/dist/component/earnings/triggers.d.ts +212 -26
  79. package/dist/component/earnings/triggers.d.ts.map +1 -1
  80. package/dist/component/schema.d.ts +119 -9
  81. package/dist/component/schema.js +4 -0
  82. package/dist/component/schema.js.map +1 -1
  83. package/dist/component/usage/queries.d.ts +2 -2
  84. package/dist/component/usage/schema.d.ts +18 -13
  85. package/dist/component/usage/schema.d.ts.map +1 -1
  86. package/dist/component/usage/schema.js +2 -1
  87. package/dist/component/usage/schema.js.map +1 -1
  88. package/dist/component/usageAllowance/queries.d.ts +1 -1
  89. package/dist/component/usageAllowance/queries.d.ts.map +1 -1
  90. package/dist/component/usageAllowance/queries.js +10 -1
  91. package/dist/component/usageAllowance/queries.js.map +1 -1
  92. package/dist/component/usageAllowance/schema.d.ts +5 -5
  93. package/dist/component/usageAllowance/schema.d.ts.map +1 -1
  94. package/dist/component/usageAllowance/schema.js +1 -1
  95. package/dist/component/usageAllowance/schema.js.map +1 -1
  96. package/dist/component/usageCorrections/accounting.d.ts +5 -0
  97. package/dist/component/usageCorrections/accounting.d.ts.map +1 -0
  98. package/dist/component/usageCorrections/accounting.js +55 -0
  99. package/dist/component/usageCorrections/accounting.js.map +1 -0
  100. package/dist/component/usageCorrections/cancellation.d.ts +6 -0
  101. package/dist/component/usageCorrections/cancellation.d.ts.map +1 -0
  102. package/dist/component/usageCorrections/cancellation.js +29 -0
  103. package/dist/component/usageCorrections/cancellation.js.map +1 -0
  104. package/dist/component/usageCorrections/helpers.d.ts +60 -0
  105. package/dist/component/usageCorrections/helpers.d.ts.map +1 -0
  106. package/dist/component/usageCorrections/helpers.js +52 -0
  107. package/dist/component/usageCorrections/helpers.js.map +1 -0
  108. package/dist/component/usageCorrections/invoice.d.ts +38 -0
  109. package/dist/component/usageCorrections/invoice.d.ts.map +1 -0
  110. package/dist/component/usageCorrections/invoice.js +82 -0
  111. package/dist/component/usageCorrections/invoice.js.map +1 -0
  112. package/dist/component/usageCorrections/mutations.d.ts +121 -0
  113. package/dist/component/usageCorrections/mutations.d.ts.map +1 -0
  114. package/dist/component/usageCorrections/mutations.js +256 -0
  115. package/dist/component/usageCorrections/mutations.js.map +1 -0
  116. package/dist/component/usageCorrections/queries.d.ts +115 -0
  117. package/dist/component/usageCorrections/queries.d.ts.map +1 -0
  118. package/dist/component/usageCorrections/queries.js +84 -0
  119. package/dist/component/usageCorrections/queries.js.map +1 -0
  120. package/dist/component/usageCorrections/schema.d.ts +248 -0
  121. package/dist/component/usageCorrections/schema.d.ts.map +1 -0
  122. package/dist/component/usageCorrections/schema.js +74 -0
  123. package/dist/component/usageCorrections/schema.js.map +1 -0
  124. package/dist/component/usageCredits/queries.d.ts +1 -1
  125. package/dist/component/usageCredits/queries.d.ts.map +1 -1
  126. package/dist/component/usageCredits/queries.js +6 -0
  127. package/dist/component/usageCredits/queries.js.map +1 -1
  128. package/dist/component/usageCredits/schema.d.ts +5 -5
  129. package/dist/component/usageCredits/schema.d.ts.map +1 -1
  130. package/dist/component/usageCredits/schema.js +1 -1
  131. package/dist/component/usageCredits/schema.js.map +1 -1
  132. package/dist/component/usageDelivery/fields.d.ts +2 -2
  133. package/dist/component/usageDelivery/fields.d.ts.map +1 -1
  134. package/dist/component/usageDelivery/fields.js +1 -1
  135. package/dist/component/usageDelivery/fields.js.map +1 -1
  136. package/dist/component/usageDelivery/helpers.d.ts +7 -6
  137. package/dist/component/usageDelivery/helpers.d.ts.map +1 -1
  138. package/dist/component/usageDelivery/mutations.d.ts +6 -6
  139. package/dist/component/usageDelivery/mutations.d.ts.map +1 -1
  140. package/dist/component/usageDelivery/mutations.js +9 -1
  141. package/dist/component/usageDelivery/mutations.js.map +1 -1
  142. package/dist/component/usageDelivery/queries.d.ts +8 -6
  143. package/dist/component/usageDelivery/queries.d.ts.map +1 -1
  144. package/dist/component/usageDelivery/schema.d.ts +4 -4
  145. package/dist/component/usageDelivery/steps.d.ts +2 -2
  146. package/dist/component/usageDelivery/steps.js +1 -1
  147. package/dist/component/usageDelivery/steps.js.map +1 -1
  148. package/dist/component/usageObservations/queries.d.ts.map +1 -1
  149. package/dist/component/usageObservations/queries.js +4 -2
  150. package/dist/component/usageObservations/queries.js.map +1 -1
  151. package/dist/component/usageSubscriptions/retirement.d.ts.map +1 -1
  152. package/dist/component/usageSubscriptions/retirement.js +24 -2
  153. package/dist/component/usageSubscriptions/retirement.js.map +1 -1
  154. package/docs/README.md +2 -0
  155. package/docs/usage-corrections.md +249 -0
  156. package/docs/usage-limits.md +1 -1
  157. package/package.json +2 -1
  158. package/src/client/usage/client.ts +2 -2
  159. package/src/client/usage/correctionClient.test.ts +153 -0
  160. package/src/client/usage/correctionClient.ts +62 -0
  161. package/src/client/usage/correctionCredits.test.ts +156 -0
  162. package/src/client/usage/correctionEligibility.ts +14 -0
  163. package/src/client/usage/correctionInvoice.test.ts +127 -0
  164. package/src/client/usage/correctionInvoice.ts +269 -0
  165. package/src/client/usage/correctionInvoiceProof.ts +40 -0
  166. package/src/client/usage/correctionProofs.ts +40 -0
  167. package/src/client/usage/correctionProvider.ts +326 -0
  168. package/src/client/usage/correctionRead.ts +73 -0
  169. package/src/client/usage/correctionRecovery.test.ts +113 -0
  170. package/src/client/usage/correctionTerms.ts +98 -0
  171. package/src/client/usage/correctionTransport.fixtures.ts +372 -0
  172. package/src/client/usage/index.ts +11 -0
  173. package/src/client/usage/observationClient.ts +20 -6
  174. package/src/client/usage/records.ts +7 -1
  175. package/src/client/usage/summary.ts +12 -4
  176. package/src/client/usageExports.ts +11 -0
  177. package/src/component/_generated/api.ts +12 -0
  178. package/src/component/_generated/component.ts +330 -2
  179. package/src/component/accountClosure/mutations.ts +17 -0
  180. package/src/component/schema.ts +8 -0
  181. package/src/component/usage/schema.ts +2 -0
  182. package/src/component/usageAllowance/queries.ts +8 -1
  183. package/src/component/usageAllowance/schema.ts +1 -0
  184. package/src/component/usageCorrections/accounting.ts +79 -0
  185. package/src/component/usageCorrections/cancellation.ts +32 -0
  186. package/src/component/usageCorrections/corrections.test.ts +389 -0
  187. package/src/component/usageCorrections/helpers.ts +57 -0
  188. package/src/component/usageCorrections/invoice.ts +103 -0
  189. package/src/component/usageCorrections/mutations.ts +278 -0
  190. package/src/component/usageCorrections/queries.ts +94 -0
  191. package/src/component/usageCorrections/schema.ts +90 -0
  192. package/src/component/usageCredits/queries.ts +4 -0
  193. package/src/component/usageCredits/schema.ts +1 -0
  194. package/src/component/usageDelivery/fields.ts +1 -0
  195. package/src/component/usageDelivery/mutations.ts +8 -3
  196. package/src/component/usageDelivery/steps.ts +1 -1
  197. package/src/component/usageObservations/queries.ts +5 -2
  198. package/src/component/usageSubscriptions/retirement.ts +31 -2
@@ -1 +1 @@
1
- {"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/component/accountClosure/mutations.ts"],"names":[],"mappings":"AAIA,yFAAyF;AACzF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;GAiDlB,CAAC;AAEH,eAAO,MAAM,QAAQ;;iBAyBnB,CAAC"}
1
+ {"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../../src/component/accountClosure/mutations.ts"],"names":[],"mappings":"AAKA,yFAAyF;AACzF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;GAiElB,CAAC;AAEH,eAAO,MAAM,QAAQ;;iBAyBnB,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { unresolvedCorrectionStates } from "../usageCorrections/cancellation.js";
1
2
  import { v } from "convex/values";
2
3
  import { mutation } from "../_generated/server.js";
3
4
  import { closureByStripeId } from "./helpers.js";
@@ -7,6 +8,18 @@ export const prepare = mutation({
7
8
  args: { stripeAccountId: v.string() },
8
9
  returns: v.object({ closure: closureDoc, isRetry: v.boolean() }),
9
10
  handler: async (ctx, { stripeAccountId }) => {
11
+ for (const state of unresolvedCorrectionStates) {
12
+ const payerCorrection = await ctx.db
13
+ .query("usageCorrections")
14
+ .withIndex("by_payer_state", (q) => q.eq("customerAccount", stripeAccountId).eq("state", state))
15
+ .first();
16
+ const realmCorrection = await ctx.db
17
+ .query("usageCorrections")
18
+ .withIndex("by_realm_state", (q) => q.eq("stripeAccountId", stripeAccountId).eq("state", state))
19
+ .first();
20
+ if (payerCorrection || realmCorrection)
21
+ throw new Error("Resolve usage corrections before account closure");
22
+ }
10
23
  const payerLock = await ctx.db
11
24
  .query("usageSubscriptionLocks")
12
25
  .withIndex("by_payer", (q) => q.eq("customerAccount", stripeAccountId))
@@ -1 +1 @@
1
- {"version":3,"file":"mutations.js","sourceRoot":"","sources":["../../../src/component/accountClosure/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,yFAAyF;AACzF,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC;IAC9B,IAAI,EAAE,EAAE,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;IAChE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EA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AAC,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC;YAEtE,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAC9D,MAAM,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,EAAE,OAAO,CAAC,GAAG,EAAE;YACjD,KAAK,EAAE,QAAQ;YACf,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE;SACrB,CAAC,CAAC;QACH,IAAI,OAAO;YAAE,MAAM,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC,CAAC"}
@@ -595,22 +595,6 @@ export declare const startWorkflow: import("convex/server").RegisteredMutation<"
595
595
  } & {
596
596
  providerAction: string;
597
597
  }, Promise<{
598
- reason: "history_incomplete" | "provider_outcome_unknown";
599
- retryable: false;
600
- status: "unknown";
601
- } | {
602
- reason: "identity_changed" | "revision_changed" | "scope_busy";
603
- retryable: false;
604
- status: "conflict";
605
- } | {
606
- reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
607
- retryable: false;
608
- status: "rejected";
609
- } | {
610
- reason: "provider_pending";
611
- retryable: true;
612
- status: "not_ready";
613
- } | {
614
598
  operation: {
615
599
  accountId: string;
616
600
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -627,16 +611,7 @@ export declare const startWorkflow: import("convex/server").RegisteredMutation<"
627
611
  version: number;
628
612
  };
629
613
  status: "canceled";
630
- }>>;
631
- export declare const resumeWorkflow: import("convex/server").RegisteredMutation<"public", {
632
- accountId: string;
633
- definitionVersion: string;
634
- operationId: import("convex/values").GenericId<"balanceFundingOperations">;
635
- providerApiVersion: string;
636
- scopeKey: string;
637
- stripeSubscriptionId: string;
638
- version: number;
639
- }, Promise<{
614
+ } | {
640
615
  reason: "history_incomplete" | "provider_outcome_unknown";
641
616
  retryable: false;
642
617
  status: "unknown";
@@ -652,7 +627,16 @@ export declare const resumeWorkflow: import("convex/server").RegisteredMutation<
652
627
  reason: "provider_pending";
653
628
  retryable: true;
654
629
  status: "not_ready";
655
- } | {
630
+ }>>;
631
+ export declare const resumeWorkflow: import("convex/server").RegisteredMutation<"public", {
632
+ accountId: string;
633
+ definitionVersion: string;
634
+ operationId: import("convex/values").GenericId<"balanceFundingOperations">;
635
+ providerApiVersion: string;
636
+ scopeKey: string;
637
+ stripeSubscriptionId: string;
638
+ version: number;
639
+ }, Promise<{
656
640
  operation: {
657
641
  accountId: string;
658
642
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -669,6 +653,22 @@ export declare const resumeWorkflow: import("convex/server").RegisteredMutation<
669
653
  version: number;
670
654
  };
671
655
  status: "canceled";
656
+ } | {
657
+ reason: "history_incomplete" | "provider_outcome_unknown";
658
+ retryable: false;
659
+ status: "unknown";
660
+ } | {
661
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
662
+ retryable: false;
663
+ status: "conflict";
664
+ } | {
665
+ reason: "invalid_scope" | "policy_invalid" | "unsupported_source";
666
+ retryable: false;
667
+ status: "rejected";
668
+ } | {
669
+ reason: "provider_pending";
670
+ retryable: true;
671
+ status: "not_ready";
672
672
  }>>;
673
673
  export declare const cancelWorkflow: import("convex/server").RegisteredMutation<"public", {
674
674
  accountId: string;
@@ -5,14 +5,6 @@ export declare function savePreparationHandler(ctx: MutationCtx, args: Infer<typ
5
5
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
6
6
  }>;
7
7
  export declare function beginHandler(ctx: MutationCtx, args: Infer<typeof beginArgs>): Promise<{
8
- reason: "identity_changed" | "revision_changed" | "scope_busy";
9
- retryable: false;
10
- status: "conflict";
11
- } | {
12
- reason: "policy_invalid";
13
- retryable: false;
14
- status: "rejected";
15
- } | {
16
8
  operation: {
17
9
  accountId: string;
18
10
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -23,6 +15,14 @@ export declare function beginHandler(ctx: MutationCtx, args: Infer<typeof beginA
23
15
  } | {
24
16
  enabled: boolean;
25
17
  status: "unchanged";
18
+ } | {
19
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
20
+ retryable: false;
21
+ status: "conflict";
22
+ } | {
23
+ reason: "policy_invalid";
24
+ retryable: false;
25
+ status: "rejected";
26
26
  } | {
27
27
  reason: "provider_pending";
28
28
  retryable: true;
@@ -372,14 +372,6 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
372
372
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
373
373
  requestKey: string;
374
374
  result?: {
375
- reason: "identity_changed" | "revision_changed" | "scope_busy";
376
- retryable: false;
377
- status: "conflict";
378
- } | {
379
- reason: "policy_invalid";
380
- retryable: false;
381
- status: "rejected";
382
- } | {
383
375
  operation: {
384
376
  accountId: string;
385
377
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -390,6 +382,14 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
390
382
  } | {
391
383
  enabled: boolean;
392
384
  status: "unchanged";
385
+ } | {
386
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
387
+ retryable: false;
388
+ status: "conflict";
389
+ } | {
390
+ reason: "policy_invalid";
391
+ retryable: false;
392
+ status: "rejected";
393
393
  } | {
394
394
  reason: "provider_pending";
395
395
  retryable: true;
@@ -2000,7 +2000,7 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
2000
2000
  at: number;
2001
2001
  evidenceJson: string;
2002
2002
  key: string;
2003
- kind: "commit" | "policy" | "release" | "reservation";
2003
+ kind: "commit" | "correction" | "policy" | "release" | "reservation";
2004
2004
  };
2005
2005
  fieldPaths: "_id" | ("_creationTime" | "at" | "evidenceJson" | "key" | "kind");
2006
2006
  indexes: {
@@ -2061,6 +2061,98 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
2061
2061
  searchIndexes: {};
2062
2062
  vectorIndexes: {};
2063
2063
  };
2064
+ usageCorrectionClaims: {
2065
+ document: {
2066
+ _creationTime: number;
2067
+ _id: import("convex/values").GenericId<"usageCorrectionClaims">;
2068
+ key: string;
2069
+ operationKey: string;
2070
+ proofJson: string;
2071
+ };
2072
+ fieldPaths: "_id" | ("_creationTime" | "key" | "operationKey" | "proofJson");
2073
+ indexes: {
2074
+ by_id: ["_id"];
2075
+ by_creation_time: ["_creationTime"];
2076
+ by_key: ["key", "_creationTime"];
2077
+ };
2078
+ searchIndexes: {};
2079
+ vectorIndexes: {};
2080
+ };
2081
+ usageCorrectionHistory: {
2082
+ document: {
2083
+ _creationTime: number;
2084
+ _id: import("convex/values").GenericId<"usageCorrectionHistory">;
2085
+ at: number;
2086
+ eventId: import("convex/values").GenericId<"usageEvents">;
2087
+ evidenceJson: string;
2088
+ key: string;
2089
+ occurredAt?: number | undefined;
2090
+ reason: string;
2091
+ recordJson: string;
2092
+ scopeKey: string;
2093
+ sequence: number;
2094
+ state: "confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported";
2095
+ subscriptionJson: string;
2096
+ };
2097
+ fieldPaths: "_id" | ("_creationTime" | "at" | "eventId" | "evidenceJson" | "key" | "occurredAt" | "reason" | "recordJson" | "scopeKey" | "sequence" | "state" | "subscriptionJson");
2098
+ indexes: {
2099
+ by_id: ["_id"];
2100
+ by_creation_time: ["_creationTime"];
2101
+ by_event: ["eventId", "_creationTime"];
2102
+ by_scope_occurrence: ["scopeKey", "occurredAt", "_creationTime"];
2103
+ by_scope_time: ["scopeKey", "at", "_creationTime"];
2104
+ };
2105
+ searchIndexes: {};
2106
+ vectorIndexes: {};
2107
+ };
2108
+ usageCorrections: {
2109
+ document: {
2110
+ _creationTime: number;
2111
+ _id: import("convex/values").GenericId<"usageCorrections">;
2112
+ adjustmentJson?: string | undefined;
2113
+ attempt: number;
2114
+ attemptedAt?: number | undefined;
2115
+ cashConsequence: "none" | "operator_resolution_required" | "verified_external_adjustment";
2116
+ correctionId: string;
2117
+ creditNoteId?: string | undefined;
2118
+ customerAccount?: string | undefined;
2119
+ eventId: import("convex/values").GenericId<"usageEvents">;
2120
+ firstAttemptAt: number;
2121
+ historyCount: number;
2122
+ inputJson: string;
2123
+ invoiceId?: string | undefined;
2124
+ key: string;
2125
+ leaseUntil?: number | undefined;
2126
+ nativeAdjustmentId?: string | undefined;
2127
+ nativeCreditNoteStatus?: "issued" | "void" | undefined;
2128
+ nativeStatus?: "complete" | "pending" | undefined;
2129
+ observedAt?: number | undefined;
2130
+ quantity: string;
2131
+ reason: string;
2132
+ recordJson: string;
2133
+ refundId?: string | undefined;
2134
+ resolution?: "event_cancellation" | "invoice_credit" | undefined;
2135
+ restoredQuantity: string;
2136
+ scaledQuantity: string;
2137
+ scopeKey: string;
2138
+ state: "confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported";
2139
+ stripeAccountId?: string | undefined;
2140
+ subscriptionJson: string;
2141
+ };
2142
+ fieldPaths: "_id" | ("_creationTime" | "adjustmentJson" | "attempt" | "attemptedAt" | "cashConsequence" | "correctionId" | "creditNoteId" | "customerAccount" | "eventId" | "firstAttemptAt" | "historyCount" | "inputJson" | "invoiceId" | "key" | "leaseUntil" | "nativeAdjustmentId" | "nativeCreditNoteStatus" | "nativeStatus" | "observedAt" | "quantity" | "reason" | "recordJson" | "refundId" | "resolution" | "restoredQuantity" | "scaledQuantity" | "scopeKey" | "state" | "stripeAccountId" | "subscriptionJson");
2143
+ indexes: {
2144
+ by_id: ["_id"];
2145
+ by_creation_time: ["_creationTime"];
2146
+ by_event: ["eventId", "_creationTime"];
2147
+ by_key: ["key", "_creationTime"];
2148
+ by_payer_state: ["customerAccount", "state", "_creationTime"];
2149
+ by_realm_state: ["stripeAccountId", "state", "_creationTime"];
2150
+ by_scope: ["scopeKey", "_creationTime"];
2151
+ by_scope_state: ["scopeKey", "state", "_creationTime"];
2152
+ };
2153
+ searchIndexes: {};
2154
+ vectorIndexes: {};
2155
+ };
2064
2156
  usageCreditAccounts: {
2065
2157
  document: {
2066
2158
  _creationTime: number;
@@ -2129,7 +2221,7 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
2129
2221
  at: number;
2130
2222
  evidenceJson: string;
2131
2223
  fingerprint: string;
2132
- kind: "closure" | "commit" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation";
2224
+ kind: "closure" | "commit" | "correction" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation";
2133
2225
  purchaseKey?: string | undefined;
2134
2226
  sourceKey: string;
2135
2227
  };
@@ -2268,6 +2360,7 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
2268
2360
  _creationTime: number;
2269
2361
  _id: import("convex/values").GenericId<"usageOutbox">;
2270
2362
  attempts: number;
2363
+ correctionKey?: string | undefined;
2271
2364
  definitionVersion?: 1 | undefined;
2272
2365
  dispatch?: string | undefined;
2273
2366
  eventId: import("convex/values").GenericId<"usageEvents">;
@@ -2278,16 +2371,16 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
2278
2371
  nextAttemptAt: number;
2279
2372
  provider?: string | undefined;
2280
2373
  providerIdentifier: string;
2281
- reason?: "administrative_hold" | "billing_period_closed" | "delivery_window_expired" | "provider_outcome_unknown" | "provider_rejected" | "provider_unavailable" | "rate_limited" | "retry_exhausted" | "scope_busy" | undefined;
2374
+ reason?: "administrative_hold" | "billing_period_closed" | "delivery_window_expired" | "provider_outcome_unknown" | "provider_rejected" | "provider_unavailable" | "rate_limited" | "retry_exhausted" | "scope_busy" | "usage_canceled" | undefined;
2282
2375
  receipt?: {
2283
2376
  created: number;
2284
2377
  identifier: string;
2285
2378
  } | undefined;
2286
2379
  scopeKey: string;
2287
- state: "held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown";
2380
+ state: "canceled" | "held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown";
2288
2381
  workflowId?: string | undefined;
2289
2382
  };
2290
- fieldPaths: "_id" | ("_creationTime" | "attempts" | "definitionVersion" | "dispatch" | "eventId" | "firstSendAt" | "held" | "historySequence" | "leaseUntil" | "nextAttemptAt" | "provider" | "providerIdentifier" | "reason" | "receipt" | "receipt.created" | "receipt.identifier" | "scopeKey" | "state" | "workflowId");
2383
+ fieldPaths: "_id" | ("_creationTime" | "attempts" | "correctionKey" | "definitionVersion" | "dispatch" | "eventId" | "firstSendAt" | "held" | "historySequence" | "leaseUntil" | "nextAttemptAt" | "provider" | "providerIdentifier" | "reason" | "receipt" | "receipt.created" | "receipt.identifier" | "scopeKey" | "state" | "workflowId");
2291
2384
  indexes: {
2292
2385
  by_id: ["_id"];
2293
2386
  by_creation_time: ["_creationTime"];
@@ -2847,14 +2940,6 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
2847
2940
  preparationId: import("convex/values").GenericId<"balanceFundingPreparations">;
2848
2941
  requestKey: string;
2849
2942
  result?: {
2850
- reason: "identity_changed" | "revision_changed" | "scope_busy";
2851
- retryable: false;
2852
- status: "conflict";
2853
- } | {
2854
- reason: "policy_invalid";
2855
- retryable: false;
2856
- status: "rejected";
2857
- } | {
2858
2943
  operation: {
2859
2944
  accountId: string;
2860
2945
  operationId: import("convex/values").GenericId<"balanceFundingOperations">;
@@ -2865,6 +2950,14 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
2865
2950
  } | {
2866
2951
  enabled: boolean;
2867
2952
  status: "unchanged";
2953
+ } | {
2954
+ reason: "identity_changed" | "revision_changed" | "scope_busy";
2955
+ retryable: false;
2956
+ status: "conflict";
2957
+ } | {
2958
+ reason: "policy_invalid";
2959
+ retryable: false;
2960
+ status: "rejected";
2868
2961
  } | {
2869
2962
  reason: "provider_pending";
2870
2963
  retryable: true;
@@ -4475,7 +4568,7 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
4475
4568
  at: number;
4476
4569
  evidenceJson: string;
4477
4570
  key: string;
4478
- kind: "commit" | "policy" | "release" | "reservation";
4571
+ kind: "commit" | "correction" | "policy" | "release" | "reservation";
4479
4572
  };
4480
4573
  fieldPaths: "_id" | ("_creationTime" | "at" | "evidenceJson" | "key" | "kind");
4481
4574
  indexes: {
@@ -4536,6 +4629,98 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
4536
4629
  searchIndexes: {};
4537
4630
  vectorIndexes: {};
4538
4631
  };
4632
+ usageCorrectionClaims: {
4633
+ document: {
4634
+ _creationTime: number;
4635
+ _id: import("convex/values").GenericId<"usageCorrectionClaims">;
4636
+ key: string;
4637
+ operationKey: string;
4638
+ proofJson: string;
4639
+ };
4640
+ fieldPaths: "_id" | ("_creationTime" | "key" | "operationKey" | "proofJson");
4641
+ indexes: {
4642
+ by_id: ["_id"];
4643
+ by_creation_time: ["_creationTime"];
4644
+ by_key: ["key", "_creationTime"];
4645
+ };
4646
+ searchIndexes: {};
4647
+ vectorIndexes: {};
4648
+ };
4649
+ usageCorrectionHistory: {
4650
+ document: {
4651
+ _creationTime: number;
4652
+ _id: import("convex/values").GenericId<"usageCorrectionHistory">;
4653
+ at: number;
4654
+ eventId: import("convex/values").GenericId<"usageEvents">;
4655
+ evidenceJson: string;
4656
+ key: string;
4657
+ occurredAt?: number | undefined;
4658
+ reason: string;
4659
+ recordJson: string;
4660
+ scopeKey: string;
4661
+ sequence: number;
4662
+ state: "confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported";
4663
+ subscriptionJson: string;
4664
+ };
4665
+ fieldPaths: "_id" | ("_creationTime" | "at" | "eventId" | "evidenceJson" | "key" | "occurredAt" | "reason" | "recordJson" | "scopeKey" | "sequence" | "state" | "subscriptionJson");
4666
+ indexes: {
4667
+ by_id: ["_id"];
4668
+ by_creation_time: ["_creationTime"];
4669
+ by_event: ["eventId", "_creationTime"];
4670
+ by_scope_occurrence: ["scopeKey", "occurredAt", "_creationTime"];
4671
+ by_scope_time: ["scopeKey", "at", "_creationTime"];
4672
+ };
4673
+ searchIndexes: {};
4674
+ vectorIndexes: {};
4675
+ };
4676
+ usageCorrections: {
4677
+ document: {
4678
+ _creationTime: number;
4679
+ _id: import("convex/values").GenericId<"usageCorrections">;
4680
+ adjustmentJson?: string | undefined;
4681
+ attempt: number;
4682
+ attemptedAt?: number | undefined;
4683
+ cashConsequence: "none" | "operator_resolution_required" | "verified_external_adjustment";
4684
+ correctionId: string;
4685
+ creditNoteId?: string | undefined;
4686
+ customerAccount?: string | undefined;
4687
+ eventId: import("convex/values").GenericId<"usageEvents">;
4688
+ firstAttemptAt: number;
4689
+ historyCount: number;
4690
+ inputJson: string;
4691
+ invoiceId?: string | undefined;
4692
+ key: string;
4693
+ leaseUntil?: number | undefined;
4694
+ nativeAdjustmentId?: string | undefined;
4695
+ nativeCreditNoteStatus?: "issued" | "void" | undefined;
4696
+ nativeStatus?: "complete" | "pending" | undefined;
4697
+ observedAt?: number | undefined;
4698
+ quantity: string;
4699
+ reason: string;
4700
+ recordJson: string;
4701
+ refundId?: string | undefined;
4702
+ resolution?: "event_cancellation" | "invoice_credit" | undefined;
4703
+ restoredQuantity: string;
4704
+ scaledQuantity: string;
4705
+ scopeKey: string;
4706
+ state: "confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported";
4707
+ stripeAccountId?: string | undefined;
4708
+ subscriptionJson: string;
4709
+ };
4710
+ fieldPaths: "_id" | ("_creationTime" | "adjustmentJson" | "attempt" | "attemptedAt" | "cashConsequence" | "correctionId" | "creditNoteId" | "customerAccount" | "eventId" | "firstAttemptAt" | "historyCount" | "inputJson" | "invoiceId" | "key" | "leaseUntil" | "nativeAdjustmentId" | "nativeCreditNoteStatus" | "nativeStatus" | "observedAt" | "quantity" | "reason" | "recordJson" | "refundId" | "resolution" | "restoredQuantity" | "scaledQuantity" | "scopeKey" | "state" | "stripeAccountId" | "subscriptionJson");
4711
+ indexes: {
4712
+ by_id: ["_id"];
4713
+ by_creation_time: ["_creationTime"];
4714
+ by_event: ["eventId", "_creationTime"];
4715
+ by_key: ["key", "_creationTime"];
4716
+ by_payer_state: ["customerAccount", "state", "_creationTime"];
4717
+ by_realm_state: ["stripeAccountId", "state", "_creationTime"];
4718
+ by_scope: ["scopeKey", "_creationTime"];
4719
+ by_scope_state: ["scopeKey", "state", "_creationTime"];
4720
+ };
4721
+ searchIndexes: {};
4722
+ vectorIndexes: {};
4723
+ };
4539
4724
  usageCreditAccounts: {
4540
4725
  document: {
4541
4726
  _creationTime: number;
@@ -4604,7 +4789,7 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
4604
4789
  at: number;
4605
4790
  evidenceJson: string;
4606
4791
  fingerprint: string;
4607
- kind: "closure" | "commit" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation";
4792
+ kind: "closure" | "commit" | "correction" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation";
4608
4793
  purchaseKey?: string | undefined;
4609
4794
  sourceKey: string;
4610
4795
  };
@@ -4743,6 +4928,7 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
4743
4928
  _creationTime: number;
4744
4929
  _id: import("convex/values").GenericId<"usageOutbox">;
4745
4930
  attempts: number;
4931
+ correctionKey?: string | undefined;
4746
4932
  definitionVersion?: 1 | undefined;
4747
4933
  dispatch?: string | undefined;
4748
4934
  eventId: import("convex/values").GenericId<"usageEvents">;
@@ -4753,16 +4939,16 @@ export declare const mutation: import("convex-helpers/server/customFunctions").C
4753
4939
  nextAttemptAt: number;
4754
4940
  provider?: string | undefined;
4755
4941
  providerIdentifier: string;
4756
- reason?: "administrative_hold" | "billing_period_closed" | "delivery_window_expired" | "provider_outcome_unknown" | "provider_rejected" | "provider_unavailable" | "rate_limited" | "retry_exhausted" | "scope_busy" | undefined;
4942
+ reason?: "administrative_hold" | "billing_period_closed" | "delivery_window_expired" | "provider_outcome_unknown" | "provider_rejected" | "provider_unavailable" | "rate_limited" | "retry_exhausted" | "scope_busy" | "usage_canceled" | undefined;
4757
4943
  receipt?: {
4758
4944
  created: number;
4759
4945
  identifier: string;
4760
4946
  } | undefined;
4761
4947
  scopeKey: string;
4762
- state: "held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown";
4948
+ state: "canceled" | "held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown";
4763
4949
  workflowId?: string | undefined;
4764
4950
  };
4765
- fieldPaths: "_id" | ("_creationTime" | "attempts" | "definitionVersion" | "dispatch" | "eventId" | "firstSendAt" | "held" | "historySequence" | "leaseUntil" | "nextAttemptAt" | "provider" | "providerIdentifier" | "reason" | "receipt" | "receipt.created" | "receipt.identifier" | "scopeKey" | "state" | "workflowId");
4951
+ fieldPaths: "_id" | ("_creationTime" | "attempts" | "correctionKey" | "definitionVersion" | "dispatch" | "eventId" | "firstSendAt" | "held" | "historySequence" | "leaseUntil" | "nextAttemptAt" | "provider" | "providerIdentifier" | "reason" | "receipt" | "receipt.created" | "receipt.identifier" | "scopeKey" | "state" | "workflowId");
4766
4952
  indexes: {
4767
4953
  by_id: ["_id"];
4768
4954
  by_creation_time: ["_creationTime"];
@@ -1 +1 @@
1
- {"version":3,"file":"triggers.d.ts","sourceRoot":"","sources":["../../../src/component/earnings/triggers.ts"],"names":[],"mappings":"AA6GA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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