@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
@@ -14,6 +14,114 @@ type Sync = (stripe: Stripe, component: Component, ctx: RunCtx, opts: {
14
14
  export declare function operation(): Promise<Sync>;
15
15
  export declare function setup(scope?: Scope): Promise<{
16
16
  t: import("convex-test").TestConvex<import("convex/server").SchemaDefinition<{
17
+ usageCorrectionClaims: import("convex/server").TableDefinition<import("convex/values").VObject<{
18
+ key: string;
19
+ operationKey: string;
20
+ proofJson: string;
21
+ }, {
22
+ key: import("convex/values").VString<string, "required">;
23
+ operationKey: import("convex/values").VString<string, "required">;
24
+ proofJson: import("convex/values").VString<string, "required">;
25
+ }, "required", "key" | "operationKey" | "proofJson">, {
26
+ by_key: ["key", "_creationTime"];
27
+ }, {}, {}>;
28
+ usageCorrections: import("convex/server").TableDefinition<import("convex/values").VObject<{
29
+ adjustmentJson?: string | undefined;
30
+ attempt: number;
31
+ attemptedAt?: number | undefined;
32
+ cashConsequence: "none" | "operator_resolution_required" | "verified_external_adjustment";
33
+ correctionId: string;
34
+ creditNoteId?: string | undefined;
35
+ customerAccount?: string | undefined;
36
+ eventId: import("convex/values").GenericId<"usageEvents">;
37
+ firstAttemptAt: number;
38
+ historyCount: number;
39
+ inputJson: string;
40
+ invoiceId?: string | undefined;
41
+ key: string;
42
+ leaseUntil?: number | undefined;
43
+ nativeAdjustmentId?: string | undefined;
44
+ nativeCreditNoteStatus?: "issued" | "void" | undefined;
45
+ nativeStatus?: "complete" | "pending" | undefined;
46
+ observedAt?: number | undefined;
47
+ quantity: string;
48
+ reason: string;
49
+ recordJson: string;
50
+ refundId?: string | undefined;
51
+ resolution?: "event_cancellation" | "invoice_credit" | undefined;
52
+ restoredQuantity: string;
53
+ scaledQuantity: string;
54
+ scopeKey: string;
55
+ state: "confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported";
56
+ stripeAccountId?: string | undefined;
57
+ subscriptionJson: string;
58
+ }, {
59
+ stripeAccountId: import("convex/values").VString<string | undefined, "optional">;
60
+ customerAccount: import("convex/values").VString<string | undefined, "optional">;
61
+ observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
62
+ nativeCreditNoteStatus: import("convex/values").VUnion<"issued" | "void" | undefined, [import("convex/values").VLiteral<"issued", "required">, import("convex/values").VLiteral<"void", "required">], "optional", never>;
63
+ resolution: import("convex/values").VUnion<"event_cancellation" | "invoice_credit" | undefined, [import("convex/values").VLiteral<"event_cancellation", "required">, import("convex/values").VLiteral<"invoice_credit", "required">], "optional", never>;
64
+ adjustmentJson: import("convex/values").VString<string | undefined, "optional">;
65
+ key: import("convex/values").VString<string, "required">;
66
+ scopeKey: import("convex/values").VString<string, "required">;
67
+ eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
68
+ correctionId: import("convex/values").VString<string, "required">;
69
+ inputJson: import("convex/values").VString<string, "required">;
70
+ recordJson: import("convex/values").VString<string, "required">;
71
+ subscriptionJson: import("convex/values").VString<string, "required">;
72
+ quantity: import("convex/values").VString<string, "required">;
73
+ scaledQuantity: import("convex/values").VString<string, "required">;
74
+ state: import("convex/values").VUnion<"confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported", [import("convex/values").VLiteral<"requested", "required">, import("convex/values").VLiteral<"provider_accepted", "required">, import("convex/values").VLiteral<"confirmed", "required">, import("convex/values").VLiteral<"held", "required">, import("convex/values").VLiteral<"unsupported", "required">, import("convex/values").VLiteral<"invoice_adjustment_required", "required">], "required", never>;
75
+ reason: import("convex/values").VString<string, "required">;
76
+ firstAttemptAt: import("convex/values").VFloat64<number, "required">;
77
+ attemptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
78
+ leaseUntil: import("convex/values").VFloat64<number | undefined, "optional">;
79
+ attempt: import("convex/values").VFloat64<number, "required">;
80
+ nativeAdjustmentId: import("convex/values").VString<string | undefined, "optional">;
81
+ nativeStatus: import("convex/values").VUnion<"complete" | "pending" | undefined, [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"complete", "required">], "optional", never>;
82
+ invoiceId: import("convex/values").VString<string | undefined, "optional">;
83
+ creditNoteId: import("convex/values").VString<string | undefined, "optional">;
84
+ refundId: import("convex/values").VString<string | undefined, "optional">;
85
+ cashConsequence: import("convex/values").VUnion<"none" | "operator_resolution_required" | "verified_external_adjustment", [import("convex/values").VLiteral<"none", "required">, import("convex/values").VLiteral<"operator_resolution_required", "required">, import("convex/values").VLiteral<"verified_external_adjustment", "required">], "required", never>;
86
+ restoredQuantity: import("convex/values").VString<string, "required">;
87
+ historyCount: import("convex/values").VFloat64<number, "required">;
88
+ }, "required", "adjustmentJson" | "attempt" | "attemptedAt" | "cashConsequence" | "correctionId" | "creditNoteId" | "customerAccount" | "eventId" | "firstAttemptAt" | "historyCount" | "inputJson" | "invoiceId" | "key" | "leaseUntil" | "nativeAdjustmentId" | "nativeCreditNoteStatus" | "nativeStatus" | "observedAt" | "quantity" | "reason" | "recordJson" | "refundId" | "resolution" | "restoredQuantity" | "scaledQuantity" | "scopeKey" | "state" | "stripeAccountId" | "subscriptionJson">, {
89
+ by_event: ["eventId", "_creationTime"];
90
+ by_key: ["key", "_creationTime"];
91
+ by_payer_state: ["customerAccount", "state", "_creationTime"];
92
+ by_realm_state: ["stripeAccountId", "state", "_creationTime"];
93
+ by_scope: ["scopeKey", "_creationTime"];
94
+ by_scope_state: ["scopeKey", "state", "_creationTime"];
95
+ }, {}, {}>;
96
+ usageCorrectionHistory: import("convex/server").TableDefinition<import("convex/values").VObject<{
97
+ at: number;
98
+ eventId: import("convex/values").GenericId<"usageEvents">;
99
+ evidenceJson: string;
100
+ key: string;
101
+ occurredAt?: number | undefined;
102
+ reason: string;
103
+ recordJson: string;
104
+ scopeKey: string;
105
+ sequence: number;
106
+ state: "confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported";
107
+ subscriptionJson: string;
108
+ }, {
109
+ key: import("convex/values").VString<string, "required">;
110
+ scopeKey: import("convex/values").VString<string, "required">;
111
+ eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
112
+ sequence: import("convex/values").VFloat64<number, "required">;
113
+ state: import("convex/values").VUnion<"confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported", [import("convex/values").VLiteral<"requested", "required">, import("convex/values").VLiteral<"provider_accepted", "required">, import("convex/values").VLiteral<"confirmed", "required">, import("convex/values").VLiteral<"held", "required">, import("convex/values").VLiteral<"unsupported", "required">, import("convex/values").VLiteral<"invoice_adjustment_required", "required">], "required", never>;
114
+ reason: import("convex/values").VString<string, "required">;
115
+ recordJson: import("convex/values").VString<string, "required">;
116
+ subscriptionJson: import("convex/values").VString<string, "required">;
117
+ evidenceJson: import("convex/values").VString<string, "required">;
118
+ occurredAt: import("convex/values").VFloat64<number | undefined, "optional">;
119
+ at: import("convex/values").VFloat64<number, "required">;
120
+ }, "required", "at" | "eventId" | "evidenceJson" | "key" | "occurredAt" | "reason" | "recordJson" | "scopeKey" | "sequence" | "state" | "subscriptionJson">, {
121
+ by_event: ["eventId", "_creationTime"];
122
+ by_scope_occurrence: ["scopeKey", "occurredAt", "_creationTime"];
123
+ by_scope_time: ["scopeKey", "at", "_creationTime"];
124
+ }, {}, {}>;
17
125
  usageAllowancePolicies: import("convex/server").TableDefinition<import("convex/values").VObject<{
18
126
  bindingJson: string;
19
127
  consumed: string;
@@ -47,10 +155,10 @@ export declare function setup(scope?: Scope): Promise<{
47
155
  at: number;
48
156
  evidenceJson: string;
49
157
  key: string;
50
- kind: "commit" | "policy" | "release" | "reservation";
158
+ kind: "commit" | "correction" | "policy" | "release" | "reservation";
51
159
  }, {
52
160
  key: import("convex/values").VString<string, "required">;
53
- kind: import("convex/values").VUnion<"commit" | "policy" | "release" | "reservation", [import("convex/values").VLiteral<"policy", "required">, import("convex/values").VLiteral<"reservation", "required">, import("convex/values").VLiteral<"commit", "required">, import("convex/values").VLiteral<"release", "required">], "required", never>;
161
+ kind: import("convex/values").VUnion<"commit" | "correction" | "policy" | "release" | "reservation", [import("convex/values").VLiteral<"policy", "required">, import("convex/values").VLiteral<"reservation", "required">, import("convex/values").VLiteral<"commit", "required">, import("convex/values").VLiteral<"release", "required">, import("convex/values").VLiteral<"correction", "required">], "required", never>;
54
162
  evidenceJson: import("convex/values").VString<string, "required">;
55
163
  at: import("convex/values").VFloat64<number, "required">;
56
164
  }, "required", "at" | "evidenceJson" | "key" | "kind">, {
@@ -257,6 +365,7 @@ export declare function setup(scope?: Scope): Promise<{
257
365
  }, {}, {}>;
258
366
  usageOutbox: import("convex/server").TableDefinition<import("convex/values").VObject<{
259
367
  attempts: number;
368
+ correctionKey?: string | undefined;
260
369
  definitionVersion?: 1 | undefined;
261
370
  dispatch?: string | undefined;
262
371
  eventId: import("convex/values").GenericId<"usageEvents">;
@@ -267,13 +376,13 @@ export declare function setup(scope?: Scope): Promise<{
267
376
  nextAttemptAt: number;
268
377
  provider?: string | undefined;
269
378
  providerIdentifier: string;
270
- reason?: "administrative_hold" | "billing_period_closed" | "delivery_window_expired" | "provider_outcome_unknown" | "provider_rejected" | "provider_unavailable" | "rate_limited" | "retry_exhausted" | "scope_busy" | undefined;
379
+ reason?: "administrative_hold" | "billing_period_closed" | "delivery_window_expired" | "provider_outcome_unknown" | "provider_rejected" | "provider_unavailable" | "rate_limited" | "retry_exhausted" | "scope_busy" | "usage_canceled" | undefined;
271
380
  receipt?: {
272
381
  created: number;
273
382
  identifier: string;
274
383
  } | undefined;
275
384
  scopeKey: string;
276
- state: "held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown";
385
+ state: "canceled" | "held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown";
277
386
  workflowId?: string | undefined;
278
387
  }, {
279
388
  historySequence: import("convex/values").VFloat64<number | undefined, "optional">;
@@ -283,7 +392,7 @@ export declare function setup(scope?: Scope): Promise<{
283
392
  firstSendAt: import("convex/values").VFloat64<number | undefined, "optional">;
284
393
  leaseUntil: import("convex/values").VFloat64<number | undefined, "optional">;
285
394
  held: import("convex/values").VBoolean<boolean | undefined, "optional">;
286
- reason: import("convex/values").VUnion<"administrative_hold" | "billing_period_closed" | "delivery_window_expired" | "provider_outcome_unknown" | "provider_rejected" | "provider_unavailable" | "rate_limited" | "retry_exhausted" | "scope_busy" | undefined, [import("convex/values").VLiteral<"billing_period_closed", "required">, import("convex/values").VLiteral<"rate_limited", "required">, import("convex/values").VLiteral<"provider_unavailable", "required">, import("convex/values").VLiteral<"provider_outcome_unknown", "required">, import("convex/values").VLiteral<"provider_rejected", "required">, import("convex/values").VLiteral<"retry_exhausted", "required">, import("convex/values").VLiteral<"delivery_window_expired", "required">, import("convex/values").VLiteral<"scope_busy", "required">, import("convex/values").VLiteral<"administrative_hold", "required">], "optional", never>;
395
+ reason: import("convex/values").VUnion<"administrative_hold" | "billing_period_closed" | "delivery_window_expired" | "provider_outcome_unknown" | "provider_rejected" | "provider_unavailable" | "rate_limited" | "retry_exhausted" | "scope_busy" | "usage_canceled" | undefined, [import("convex/values").VLiteral<"usage_canceled", "required">, import("convex/values").VLiteral<"billing_period_closed", "required">, import("convex/values").VLiteral<"rate_limited", "required">, import("convex/values").VLiteral<"provider_unavailable", "required">, import("convex/values").VLiteral<"provider_outcome_unknown", "required">, import("convex/values").VLiteral<"provider_rejected", "required">, import("convex/values").VLiteral<"retry_exhausted", "required">, import("convex/values").VLiteral<"delivery_window_expired", "required">, import("convex/values").VLiteral<"scope_busy", "required">, import("convex/values").VLiteral<"administrative_hold", "required">], "optional", never>;
287
396
  receipt: import("convex/values").VObject<{
288
397
  created: number;
289
398
  identifier: string;
@@ -291,14 +400,15 @@ export declare function setup(scope?: Scope): Promise<{
291
400
  identifier: import("convex/values").VString<string, "required">;
292
401
  created: import("convex/values").VFloat64<number, "required">;
293
402
  }, "optional", "created" | "identifier">;
403
+ correctionKey: import("convex/values").VString<string | undefined, "optional">;
294
404
  eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
295
405
  scopeKey: import("convex/values").VString<string, "required">;
296
- state: import("convex/values").VUnion<"held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown", [import("convex/values").VLiteral<"queued", "required">, import("convex/values").VLiteral<"sending", "required">, import("convex/values").VLiteral<"provider_accepted", "required">, import("convex/values").VLiteral<"rejected", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"held", "required">], "required", never>;
406
+ state: import("convex/values").VUnion<"canceled" | "held" | "provider_accepted" | "queued" | "rejected" | "sending" | "unknown", [import("convex/values").VLiteral<"queued", "required">, import("convex/values").VLiteral<"canceled", "required">, import("convex/values").VLiteral<"sending", "required">, import("convex/values").VLiteral<"provider_accepted", "required">, import("convex/values").VLiteral<"rejected", "required">, import("convex/values").VLiteral<"unknown", "required">, import("convex/values").VLiteral<"held", "required">], "required", never>;
297
407
  attempts: import("convex/values").VFloat64<number, "required">;
298
408
  nextAttemptAt: import("convex/values").VFloat64<number, "required">;
299
409
  providerIdentifier: import("convex/values").VString<string, "required">;
300
410
  dispatch: import("convex/values").VString<string | undefined, "optional">;
301
- }, "required", "attempts" | "definitionVersion" | "dispatch" | "eventId" | "firstSendAt" | "held" | "historySequence" | "leaseUntil" | "nextAttemptAt" | "provider" | "providerIdentifier" | "reason" | "receipt" | "receipt.created" | "receipt.identifier" | "scopeKey" | "state" | "workflowId">, {
411
+ }, "required", "attempts" | "correctionKey" | "definitionVersion" | "dispatch" | "eventId" | "firstSendAt" | "held" | "historySequence" | "leaseUntil" | "nextAttemptAt" | "provider" | "providerIdentifier" | "reason" | "receipt" | "receipt.created" | "receipt.identifier" | "scopeKey" | "state" | "workflowId">, {
302
412
  by_event: ["eventId", "_creationTime"];
303
413
  by_provider_identifier: ["providerIdentifier", "_creationTime"];
304
414
  by_scope_state: ["scopeKey", "state", "_creationTime"];
@@ -454,13 +564,13 @@ export declare function setup(scope?: Scope): Promise<{
454
564
  at: number;
455
565
  evidenceJson: string;
456
566
  fingerprint: string;
457
- kind: "closure" | "commit" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation";
567
+ kind: "closure" | "commit" | "correction" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation";
458
568
  purchaseKey?: string | undefined;
459
569
  sourceKey: string;
460
570
  }, {
461
571
  accountKey: import("convex/values").VString<string, "required">;
462
572
  purchaseKey: import("convex/values").VString<string | undefined, "optional">;
463
- kind: import("convex/values").VUnion<"closure" | "commit" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation", [import("convex/values").VLiteral<"purchase", "required">, import("convex/values").VLiteral<"payment", "required">, import("convex/values").VLiteral<"grant", "required">, import("convex/values").VLiteral<"reservation", "required">, import("convex/values").VLiteral<"commit", "required">, import("convex/values").VLiteral<"release", "required">, import("convex/values").VLiteral<"observation", "required">, import("convex/values").VLiteral<"recovery", "required">, import("convex/values").VLiteral<"closure", "required">], "required", never>;
573
+ kind: import("convex/values").VUnion<"closure" | "commit" | "correction" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation", [import("convex/values").VLiteral<"purchase", "required">, import("convex/values").VLiteral<"payment", "required">, import("convex/values").VLiteral<"grant", "required">, import("convex/values").VLiteral<"reservation", "required">, import("convex/values").VLiteral<"commit", "required">, import("convex/values").VLiteral<"release", "required">, import("convex/values").VLiteral<"observation", "required">, import("convex/values").VLiteral<"recovery", "required">, import("convex/values").VLiteral<"closure", "required">, import("convex/values").VLiteral<"correction", "required">], "required", never>;
464
574
  sourceKey: import("convex/values").VString<string, "required">;
465
575
  fingerprint: import("convex/values").VString<string, "required">;
466
576
  evidenceJson: import("convex/values").VString<string, "required">;
@@ -1 +1 @@
1
- {"version":3,"file":"payoutSyncTestHelpers.d.ts","sourceRoot":"","sources":["../../../src/client/connect/payoutSyncTestHelpers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAIvD,eAAO,MAAM,SAAS,EAIN,SAAS,CAAC;AAC1B,MAAM,MAAM,KAAK,GACf;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AAClE,KAAK,IAAI,GAAG,CACV,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,KAC3C,OAAO,CAAC,OAAO,CAAC,CAAC;AACtB,wBAAsB,SAAS,kBAU9B;AACD,wBAAsB,KAAK,CACzB,KAAK,GAAE,KAAsD;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAKxC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkCzC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQtC"}
@@ -42,7 +42,7 @@ export declare class UsageAllowanceClient extends UsageCreditClient {
42
42
  at: number;
43
43
  evidenceJson: string;
44
44
  key: string;
45
- kind: "commit" | "policy" | "release" | "reservation";
45
+ kind: "commit" | "correction" | "policy" | "release" | "reservation";
46
46
  }[];
47
47
  cursor: string | null;
48
48
  isDone: boolean;
@@ -1,4 +1,4 @@
1
- import { UsageAllowanceClient } from "./allowanceClient.js";
1
+ import { UsageCorrectionClient } from "./correctionClient.js";
2
2
  import type { Component, RunCtx } from "../helpers.js";
3
3
  import { type PreparedUsageRecord, type UsageScope, type UsageDeliveryState } from "./records.js";
4
4
  import { type UsagePageRequest, type UsageSubscriptionBinding, type UsageReceipt } from "./boundaries.js";
@@ -18,7 +18,7 @@ export type UsageEventView = {
18
18
  delivery: UsageDeliveryState;
19
19
  };
20
20
  /** Trusted host facade. Authenticate and authorize each exact scope first. */
21
- export declare class UsageLedgerClient extends UsageAllowanceClient {
21
+ export declare class UsageLedgerClient extends UsageCorrectionClient {
22
22
  constructor(component: Component);
23
23
  record(ctx: RunCtx, opts: RecordUsageOptions): Promise<UsageReceipt>;
24
24
  get(ctx: RunCtx, opts: {
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/client/usage/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAGvD,OAAO,EAEL,KAAK,mBAAmB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AG,IAAI,CAAC,CAMhC;IACK,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,KAAK,EAAE,UAAU,CAAC;QAAC,IAAI,EAAE,gBAAgB,CAAA;KAAE;;;;OAe1E;CACF"}
@@ -1,4 +1,4 @@
1
- import { UsageAllowanceClient } from "./allowanceClient.js";
1
+ import { UsageCorrectionClient } from "./correctionClient.js";
2
2
  import { runMutationOrThrow } from "../helpers.js";
3
3
  import { componentRef } from "../webhooks/helpers.js";
4
4
  import { validateUsageRecordInput, } from "./records.js";
@@ -17,7 +17,7 @@ function decode({ event, delivery }) {
17
17
  };
18
18
  }
19
19
  /** Trusted host facade. Authenticate and authorize each exact scope first. */
20
- export class UsageLedgerClient extends UsageAllowanceClient {
20
+ export class UsageLedgerClient extends UsageCorrectionClient {
21
21
  constructor(component) {
22
22
  super(component);
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/client/usage/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EACL,wBAAwB,GAIzB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,wBAAwB,GAIzB,MAAM,iBAAiB,CAAC;AAiBzB,SAAS,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAc;IAC7C,OAAO;QACL,OAAO,EAAE;YACP,OAAO,EAAE,KAAK,CAAC,GAAG;YAClB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,QAAQ,EAAE,QAAQ;SACnB;QACD,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAwB;QAC3D,YAAY,EAAE,IAAI,CAAC,KAAK,CACtB,KAA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I,CAAC,GAAW,EAAE,IAAmD;QACzE,MAAM,IAAI,GAAG,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,CAAC,MAAM,GAAG,CAAC,QAAQ,CAChC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,EAClD;YACE,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;SAC9D,CACF,CAAoE,CAAC;QACtE,OAAO;YACL,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;YAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc;YACpD,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,33 @@
1
+ import type { UsageInvoiceCorrectionOptions } from "./correctionTerms.js";
2
+ import { type UsageScope } from "./records.js";
3
+ import type { UsagePeriod } from "./boundaries.js";
4
+ import { UsageAllowanceClient } from "./allowanceClient.js";
5
+ import type { RunCtx } from "../helpers.js";
6
+ import type { UsageCorrectionOptions } from "./correctionTerms.js";
7
+ import type { UsageDeliveryProviderOptions } from "./deliveryProvider.js";
8
+ /** Host authenticates and authorizes the actor and original activity before calling. */
9
+ export declare class UsageCorrectionClient extends UsageAllowanceClient {
10
+ getCorrection(ctx: RunCtx, input: {
11
+ scope: UsageScope;
12
+ eventId: string;
13
+ correctionId: string;
14
+ }): Promise<import("./correctionTerms.js").UsageCorrectionView | null>;
15
+ readCorrectionHistory(ctx: RunCtx, input: {
16
+ scope: UsageScope;
17
+ eventId: string;
18
+ limit: number;
19
+ cursor: string | null;
20
+ }): Promise<import("./correctionRead.js").UsageCorrectionHistoryPage>;
21
+ readCorrectionPeriodHistory(ctx: RunCtx, input: {
22
+ scope: UsageScope;
23
+ period: UsagePeriod;
24
+ limit: number;
25
+ cursor: string | null;
26
+ }): Promise<import("./correctionRead.js").UsageCorrectionHistoryPage>;
27
+ observeInvoiceCorrection(ctx: RunCtx, input: UsageInvoiceCorrectionOptions, options: UsageDeliveryProviderOptions): Promise<import("./correctionTerms.js").UsageCorrectionView | {
28
+ status: "held";
29
+ reason: string;
30
+ }>;
31
+ requestCorrection(ctx: RunCtx, input: UsageCorrectionOptions, options?: UsageDeliveryProviderOptions): Promise<import("./correctionTerms.js").UsageCorrectionView>;
32
+ }
33
+ //# sourceMappingURL=correctionClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"correctionClient.d.ts","sourceRoot":"","sources":["../../../src/client/usage/correctionClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAE1E,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAI5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAC1E,wFAAwF;AACxF,qBAAa,qBAAsB,SAAQ,oBAAoB;IACvD,aAAa,CACjB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE;QAAE,KAAK,EAAE,UAAU,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAA;KAAE,sEAOpE;IACD,qBAAqB,CACnB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE;QACL,KAAK,EAAE,UAAU,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;KACvB,qEAGF;IACD,2BAA2B,CACzB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE;QACL,KAAK,EAAE,UAAU,CAAC;QAClB,MAAM,EAAE,WAAW,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;KACvB,qEAGF;IACD,wBAAwB,CACtB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,6BAA6B,EACpC,OAAO,EAAE,4BAA4B;;;OAGtC;IACD,iBAAiB,CACf,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,sBAAsB,EAC7B,OAAO,GAAE,4BAAiC,+DAG3C;CACF"}
@@ -0,0 +1,27 @@
1
+ import { observeInvoiceCorrection } from "./correctionInvoice.js";
2
+ import { readCorrectionEvidence } from "./correctionRead.js";
3
+ import { scopeSchema } from "./records.js";
4
+ import { componentRef } from "../webhooks/helpers.js";
5
+ import { correctionView } from "./correctionTerms.js";
6
+ import { UsageAllowanceClient } from "./allowanceClient.js";
7
+ import { requestUsageCorrection } from "./correctionProvider.js";
8
+ /** Host authenticates and authorizes the actor and original activity before calling. */
9
+ export class UsageCorrectionClient extends UsageAllowanceClient {
10
+ async getCorrection(ctx, input) {
11
+ const row = (await ctx.runQuery(componentRef(this.component, "usageCorrections/queries/get"), { ...input, scope: scopeSchema.parse(input.scope) }));
12
+ return row ? correctionView(row) : null;
13
+ }
14
+ readCorrectionHistory(ctx, input) {
15
+ return readCorrectionEvidence(this.component, ctx, input);
16
+ }
17
+ readCorrectionPeriodHistory(ctx, input) {
18
+ return readCorrectionEvidence(this.component, ctx, input);
19
+ }
20
+ observeInvoiceCorrection(ctx, input, options) {
21
+ return observeInvoiceCorrection(this.component, ctx, input, options);
22
+ }
23
+ requestCorrection(ctx, input, options = {}) {
24
+ return requestUsageCorrection(this.component, ctx, input, options);
25
+ }
26
+ }
27
+ //# sourceMappingURL=correctionClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"correctionClient.js","sourceRoot":"","sources":["../../../src/client/usage/correctionClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAmB,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,wFAAwF;AACxF,MAAM,OAAO,qBAAsB,SAAQ,oBAAoB;IAC7D,KAAK,CAAC,aAAa,CACjB,GAAW,EACX,KAAmE;QAEnE,MAAM,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC,QAAQ,CAC7B,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,8BAA8B,CAAC,EAC5D,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CACpD,CAAmC,CAAC;QACrC,OAAO,GAAG,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1C,CAAC;IACD,qBAAqB,CACnB,GAAW,EACX,KAKC;QAED,OAAO,sBAAsB,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAC5D,CAAC;IACD,2BAA2B,CACzB,GAAW,EACX,KAKC;QAED,OAAO,sBAAsB,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAC5D,CAAC;IACD,wBAAwB,CACtB,GAAW,EACX,KAAoC,EACpC,OAAqC;QAErC,OAAO,wBAAwB,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC;IACD,iBAAiB,CACf,GAAW,EACX,KAA6B,EAC7B,OAAO,GAAiC,EAAE;QAE1C,OAAO,sBAAsB,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ import type { Doc } from "../../component/_generated/dataModel.js";
2
+ /** Local restoration requires proof that no native meter event was accepted. */
3
+ export declare function locallyCancelable(outbox: Pick<Doc<"usageOutbox">, "attempts" | "firstSendAt" | "receipt" | "state" | "reason">): boolean;
4
+ //# sourceMappingURL=correctionEligibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"correctionEligibility.d.ts","sourceRoot":"","sources":["../../../src/client/usage/correctionEligibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,yCAAyC,CAAC;AACnE,gFAAgF;AAChF,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,IAAI,CACV,GAAG,CAAC,aAAa,CAAC,EAClB,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAC5D,GACA,OAAO,CAMT"}
@@ -0,0 +1,7 @@
1
+ /** Local restoration requires proof that no native meter event was accepted. */
2
+ export function locallyCancelable(outbox) {
3
+ return (!outbox.receipt &&
4
+ ((outbox.attempts === 0 && outbox.firstSendAt === undefined) ||
5
+ (outbox.state === "rejected" && outbox.reason === "provider_rejected")));
6
+ }
7
+ //# sourceMappingURL=correctionEligibility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"correctionEligibility.js","sourceRoot":"","sources":["../../../src/client/usage/correctionEligibility.ts"],"names":[],"mappings":"AACA,gFAAgF;AAChF,MAAM,UAAU,iBAAiB,CAC/B,MAGC;IAED,OAAO,CACL,CAAC,MAAM,CAAC,OAAO;QACf,CAAC,CAAC,MAAM,CAAC,QAAQ,KAAK,CAAC,IAAI,MAAM,CAAC,WAAW,KAAK,SAAS,CAAC;YAC1D,CAAC,MAAM,CAAC,KAAK,KAAK,UAAU,IAAI,MAAM,CAAC,MAAM,KAAK,mBAAmB,CAAC,CAAC,CAC1E,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { Component, RunCtx } from "../helpers.js";
2
+ import type { UsageDeliveryProviderOptions } from "./deliveryProvider.js";
3
+ import { type UsageInvoiceCorrectionOptions } from "./correctionTerms.js";
4
+ /** Read-only provider adoption. The operator creates notes/refunds through existing authorized billing workflows. */
5
+ export declare function observeInvoiceCorrection(component: Component, ctx: RunCtx, input: UsageInvoiceCorrectionOptions, options: UsageDeliveryProviderOptions): Promise<import("./correctionTerms.js").UsageCorrectionView | {
6
+ status: "held";
7
+ reason: string;
8
+ }>;
9
+ //# sourceMappingURL=correctionInvoice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"correctionInvoice.d.ts","sourceRoot":"","sources":["../../../src/client/usage/correctionInvoice.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAKvD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAI1E,OAAO,EAGL,KAAK,6BAA6B,EACnC,MAAM,sBAAsB,CAAC;AAU9B,qHAAqH;AACrH,wBAAsB,wBAAwB,CAC5C,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,6BAA6B,EACpC,OAAO,EAAE,4BAA4B;YAyBzB,MAAM;;GAsNnB"}