@fantastic.dev/better-stripe 0.57.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 (230) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +3 -1
  3. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts +356 -50
  4. package/dist/client/connect/payoutAdoptionTestHelpers.d.ts.map +1 -1
  5. package/dist/client/connect/payoutExecutionTestHelpers.d.ts +162 -9
  6. package/dist/client/connect/payoutExecutionTestHelpers.d.ts.map +1 -1
  7. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts +356 -50
  8. package/dist/client/connect/payoutLargeAdoptionTestHelpers.d.ts.map +1 -1
  9. package/dist/client/connect/payoutSyncTestHelpers.d.ts +162 -9
  10. package/dist/client/connect/payoutSyncTestHelpers.d.ts.map +1 -1
  11. package/dist/client/usage/allowanceClient.d.ts +51 -0
  12. package/dist/client/usage/allowanceClient.d.ts.map +1 -0
  13. package/dist/client/usage/allowanceClient.js +64 -0
  14. package/dist/client/usage/allowanceClient.js.map +1 -0
  15. package/dist/client/usage/allowanceTerms.d.ts +64 -0
  16. package/dist/client/usage/allowanceTerms.d.ts.map +1 -0
  17. package/dist/client/usage/allowanceTerms.js +101 -0
  18. package/dist/client/usage/allowanceTerms.js.map +1 -0
  19. package/dist/client/usage/client.d.ts +2 -2
  20. package/dist/client/usage/client.d.ts.map +1 -1
  21. package/dist/client/usage/client.js +2 -2
  22. package/dist/client/usage/client.js.map +1 -1
  23. package/dist/client/usage/correctionClient.d.ts +33 -0
  24. package/dist/client/usage/correctionClient.d.ts.map +1 -0
  25. package/dist/client/usage/correctionClient.js +27 -0
  26. package/dist/client/usage/correctionClient.js.map +1 -0
  27. package/dist/client/usage/correctionEligibility.d.ts +4 -0
  28. package/dist/client/usage/correctionEligibility.d.ts.map +1 -0
  29. package/dist/client/usage/correctionEligibility.js +7 -0
  30. package/dist/client/usage/correctionEligibility.js.map +1 -0
  31. package/dist/client/usage/correctionInvoice.d.ts +9 -0
  32. package/dist/client/usage/correctionInvoice.d.ts.map +1 -0
  33. package/dist/client/usage/correctionInvoice.js +218 -0
  34. package/dist/client/usage/correctionInvoice.js.map +1 -0
  35. package/dist/client/usage/correctionInvoiceProof.d.ts +29 -0
  36. package/dist/client/usage/correctionInvoiceProof.d.ts.map +1 -0
  37. package/dist/client/usage/correctionInvoiceProof.js +41 -0
  38. package/dist/client/usage/correctionInvoiceProof.js.map +1 -0
  39. package/dist/client/usage/correctionProofs.d.ts +36 -0
  40. package/dist/client/usage/correctionProofs.d.ts.map +1 -0
  41. package/dist/client/usage/correctionProofs.js +41 -0
  42. package/dist/client/usage/correctionProofs.js.map +1 -0
  43. package/dist/client/usage/correctionProvider.d.ts +6 -0
  44. package/dist/client/usage/correctionProvider.d.ts.map +1 -0
  45. package/dist/client/usage/correctionProvider.js +243 -0
  46. package/dist/client/usage/correctionProvider.js.map +1 -0
  47. package/dist/client/usage/correctionRead.d.ts +27 -0
  48. package/dist/client/usage/correctionRead.d.ts.map +1 -0
  49. package/dist/client/usage/correctionRead.js +36 -0
  50. package/dist/client/usage/correctionRead.js.map +1 -0
  51. package/dist/client/usage/correctionTerms.d.ts +64 -0
  52. package/dist/client/usage/correctionTerms.d.ts.map +1 -0
  53. package/dist/client/usage/correctionTerms.js +65 -0
  54. package/dist/client/usage/correctionTerms.js.map +1 -0
  55. package/dist/client/usage/correctionTransport.fixtures.d.ts +37 -0
  56. package/dist/client/usage/correctionTransport.fixtures.d.ts.map +1 -0
  57. package/dist/client/usage/correctionTransport.fixtures.js +322 -0
  58. package/dist/client/usage/correctionTransport.fixtures.js.map +1 -0
  59. package/dist/client/usage/creditClient.d.ts +1 -1
  60. package/dist/client/usage/index.d.ts +4 -0
  61. package/dist/client/usage/index.d.ts.map +1 -1
  62. package/dist/client/usage/observationClient.d.ts +20 -0
  63. package/dist/client/usage/observationClient.d.ts.map +1 -1
  64. package/dist/client/usage/observationClient.js +20 -6
  65. package/dist/client/usage/observationClient.js.map +1 -1
  66. package/dist/client/usage/records.d.ts +1 -1
  67. package/dist/client/usage/records.d.ts.map +1 -1
  68. package/dist/client/usage/records.js.map +1 -1
  69. package/dist/client/usage/summary.d.ts +3 -0
  70. package/dist/client/usage/summary.d.ts.map +1 -1
  71. package/dist/client/usage/summary.js +9 -4
  72. package/dist/client/usage/summary.js.map +1 -1
  73. package/dist/client/usageExports.d.ts +4 -0
  74. package/dist/client/usageExports.d.ts.map +1 -1
  75. package/dist/component/_generated/api.d.ts +20 -0
  76. package/dist/component/_generated/api.d.ts.map +1 -1
  77. package/dist/component/_generated/api.js.map +1 -1
  78. package/dist/component/_generated/component.d.ts +324 -13
  79. package/dist/component/_generated/component.d.ts.map +1 -1
  80. package/dist/component/accountClosure/mutations.d.ts.map +1 -1
  81. package/dist/component/accountClosure/mutations.js +13 -0
  82. package/dist/component/accountClosure/mutations.js.map +1 -1
  83. package/dist/component/balanceFunding/internal/actions.d.ts +11 -11
  84. package/dist/component/balanceFunding/mutations.d.ts +43 -43
  85. package/dist/component/balanceFunding/workflowValidators.d.ts +16 -16
  86. package/dist/component/earnings/triggers.d.ts +288 -10
  87. package/dist/component/earnings/triggers.d.ts.map +1 -1
  88. package/dist/component/schema.d.ts +162 -9
  89. package/dist/component/schema.js +7 -0
  90. package/dist/component/schema.js.map +1 -1
  91. package/dist/component/usage/mutations.d.ts.map +1 -1
  92. package/dist/component/usage/mutations.js +4 -0
  93. package/dist/component/usage/mutations.js.map +1 -1
  94. package/dist/component/usage/queries.d.ts +2 -2
  95. package/dist/component/usage/schema.d.ts +21 -15
  96. package/dist/component/usage/schema.d.ts.map +1 -1
  97. package/dist/component/usage/schema.js +4 -2
  98. package/dist/component/usage/schema.js.map +1 -1
  99. package/dist/component/usageAllowance/helpers.d.ts +78 -0
  100. package/dist/component/usageAllowance/helpers.d.ts.map +1 -0
  101. package/dist/component/usageAllowance/helpers.js +99 -0
  102. package/dist/component/usageAllowance/helpers.js.map +1 -0
  103. package/dist/component/usageAllowance/mutations.d.ts +37 -0
  104. package/dist/component/usageAllowance/mutations.d.ts.map +1 -0
  105. package/dist/component/usageAllowance/mutations.js +99 -0
  106. package/dist/component/usageAllowance/mutations.js.map +1 -0
  107. package/dist/component/usageAllowance/queries.d.ts +36 -0
  108. package/dist/component/usageAllowance/queries.d.ts.map +1 -0
  109. package/dist/component/usageAllowance/queries.js +122 -0
  110. package/dist/component/usageAllowance/queries.js.map +1 -0
  111. package/dist/component/usageAllowance/reservations.d.ts +25 -0
  112. package/dist/component/usageAllowance/reservations.d.ts.map +1 -0
  113. package/dist/component/usageAllowance/reservations.js +150 -0
  114. package/dist/component/usageAllowance/reservations.js.map +1 -0
  115. package/dist/component/usageAllowance/schema.d.ts +77 -0
  116. package/dist/component/usageAllowance/schema.d.ts.map +1 -0
  117. package/dist/component/usageAllowance/schema.js +32 -0
  118. package/dist/component/usageAllowance/schema.js.map +1 -0
  119. package/dist/component/usageCorrections/accounting.d.ts +5 -0
  120. package/dist/component/usageCorrections/accounting.d.ts.map +1 -0
  121. package/dist/component/usageCorrections/accounting.js +55 -0
  122. package/dist/component/usageCorrections/accounting.js.map +1 -0
  123. package/dist/component/usageCorrections/cancellation.d.ts +6 -0
  124. package/dist/component/usageCorrections/cancellation.d.ts.map +1 -0
  125. package/dist/component/usageCorrections/cancellation.js +29 -0
  126. package/dist/component/usageCorrections/cancellation.js.map +1 -0
  127. package/dist/component/usageCorrections/helpers.d.ts +60 -0
  128. package/dist/component/usageCorrections/helpers.d.ts.map +1 -0
  129. package/dist/component/usageCorrections/helpers.js +52 -0
  130. package/dist/component/usageCorrections/helpers.js.map +1 -0
  131. package/dist/component/usageCorrections/invoice.d.ts +38 -0
  132. package/dist/component/usageCorrections/invoice.d.ts.map +1 -0
  133. package/dist/component/usageCorrections/invoice.js +82 -0
  134. package/dist/component/usageCorrections/invoice.js.map +1 -0
  135. package/dist/component/usageCorrections/mutations.d.ts +121 -0
  136. package/dist/component/usageCorrections/mutations.d.ts.map +1 -0
  137. package/dist/component/usageCorrections/mutations.js +256 -0
  138. package/dist/component/usageCorrections/mutations.js.map +1 -0
  139. package/dist/component/usageCorrections/queries.d.ts +115 -0
  140. package/dist/component/usageCorrections/queries.d.ts.map +1 -0
  141. package/dist/component/usageCorrections/queries.js +84 -0
  142. package/dist/component/usageCorrections/queries.js.map +1 -0
  143. package/dist/component/usageCorrections/schema.d.ts +248 -0
  144. package/dist/component/usageCorrections/schema.d.ts.map +1 -0
  145. package/dist/component/usageCorrections/schema.js +74 -0
  146. package/dist/component/usageCorrections/schema.js.map +1 -0
  147. package/dist/component/usageCredits/queries.d.ts +1 -1
  148. package/dist/component/usageCredits/queries.d.ts.map +1 -1
  149. package/dist/component/usageCredits/queries.js +6 -0
  150. package/dist/component/usageCredits/queries.js.map +1 -1
  151. package/dist/component/usageCredits/schema.d.ts +5 -5
  152. package/dist/component/usageCredits/schema.d.ts.map +1 -1
  153. package/dist/component/usageCredits/schema.js +1 -1
  154. package/dist/component/usageCredits/schema.js.map +1 -1
  155. package/dist/component/usageDelivery/fields.d.ts +2 -2
  156. package/dist/component/usageDelivery/fields.d.ts.map +1 -1
  157. package/dist/component/usageDelivery/fields.js +1 -1
  158. package/dist/component/usageDelivery/fields.js.map +1 -1
  159. package/dist/component/usageDelivery/helpers.d.ts +7 -6
  160. package/dist/component/usageDelivery/helpers.d.ts.map +1 -1
  161. package/dist/component/usageDelivery/mutations.d.ts +6 -6
  162. package/dist/component/usageDelivery/mutations.d.ts.map +1 -1
  163. package/dist/component/usageDelivery/mutations.js +9 -1
  164. package/dist/component/usageDelivery/mutations.js.map +1 -1
  165. package/dist/component/usageDelivery/queries.d.ts +8 -6
  166. package/dist/component/usageDelivery/queries.d.ts.map +1 -1
  167. package/dist/component/usageDelivery/schema.d.ts +4 -4
  168. package/dist/component/usageDelivery/steps.d.ts +2 -2
  169. package/dist/component/usageDelivery/steps.js +1 -1
  170. package/dist/component/usageDelivery/steps.js.map +1 -1
  171. package/dist/component/usageObservations/queries.d.ts.map +1 -1
  172. package/dist/component/usageObservations/queries.js +4 -2
  173. package/dist/component/usageObservations/queries.js.map +1 -1
  174. package/dist/component/usageSubscriptions/retirement.d.ts.map +1 -1
  175. package/dist/component/usageSubscriptions/retirement.js +24 -2
  176. package/dist/component/usageSubscriptions/retirement.js.map +1 -1
  177. package/docs/README.md +4 -0
  178. package/docs/usage-corrections.md +249 -0
  179. package/docs/usage-limits.md +217 -0
  180. package/package.json +3 -1
  181. package/src/client/usage/allowanceClient.test.ts +93 -0
  182. package/src/client/usage/allowanceClient.ts +134 -0
  183. package/src/client/usage/allowanceTerms.test.ts +131 -0
  184. package/src/client/usage/allowanceTerms.ts +172 -0
  185. package/src/client/usage/client.ts +2 -2
  186. package/src/client/usage/correctionClient.test.ts +153 -0
  187. package/src/client/usage/correctionClient.ts +62 -0
  188. package/src/client/usage/correctionCredits.test.ts +156 -0
  189. package/src/client/usage/correctionEligibility.ts +14 -0
  190. package/src/client/usage/correctionInvoice.test.ts +127 -0
  191. package/src/client/usage/correctionInvoice.ts +269 -0
  192. package/src/client/usage/correctionInvoiceProof.ts +40 -0
  193. package/src/client/usage/correctionProofs.ts +40 -0
  194. package/src/client/usage/correctionProvider.ts +326 -0
  195. package/src/client/usage/correctionRead.ts +73 -0
  196. package/src/client/usage/correctionRecovery.test.ts +113 -0
  197. package/src/client/usage/correctionTerms.ts +98 -0
  198. package/src/client/usage/correctionTransport.fixtures.ts +372 -0
  199. package/src/client/usage/index.ts +19 -0
  200. package/src/client/usage/observationClient.ts +20 -6
  201. package/src/client/usage/records.ts +7 -1
  202. package/src/client/usage/summary.ts +12 -4
  203. package/src/client/usageExports.ts +19 -0
  204. package/src/component/_generated/api.ts +20 -0
  205. package/src/component/_generated/component.ts +423 -1
  206. package/src/component/accountClosure/mutations.ts +17 -0
  207. package/src/component/schema.ts +14 -0
  208. package/src/component/usage/allowance.test.ts +435 -0
  209. package/src/component/usage/mutations.ts +13 -0
  210. package/src/component/usage/schema.ts +6 -1
  211. package/src/component/usageAllowance/helpers.ts +137 -0
  212. package/src/component/usageAllowance/mutations.ts +139 -0
  213. package/src/component/usageAllowance/queries.ts +140 -0
  214. package/src/component/usageAllowance/reservations.ts +220 -0
  215. package/src/component/usageAllowance/schema.ts +37 -0
  216. package/src/component/usageCorrections/accounting.ts +79 -0
  217. package/src/component/usageCorrections/cancellation.ts +32 -0
  218. package/src/component/usageCorrections/corrections.test.ts +389 -0
  219. package/src/component/usageCorrections/helpers.ts +57 -0
  220. package/src/component/usageCorrections/invoice.ts +103 -0
  221. package/src/component/usageCorrections/mutations.ts +278 -0
  222. package/src/component/usageCorrections/queries.ts +94 -0
  223. package/src/component/usageCorrections/schema.ts +90 -0
  224. package/src/component/usageCredits/queries.ts +4 -0
  225. package/src/component/usageCredits/schema.ts +1 -0
  226. package/src/component/usageDelivery/fields.ts +1 -0
  227. package/src/component/usageDelivery/mutations.ts +8 -3
  228. package/src/component/usageDelivery/steps.ts +1 -1
  229. package/src/component/usageObservations/queries.ts +5 -2
  230. package/src/component/usageSubscriptions/retirement.ts +31 -2
@@ -0,0 +1,84 @@
1
+ import { scopeValidator } from "../usage/schema.js";
2
+ import { scopeKey } from "../usage/helpers.js";
3
+ import { validateUsagePageRequest } from "../../client/usage/boundaries.js";
4
+ import { paginationOptsValidator, paginationResultValidator, } from "convex/server";
5
+ import { paginator } from "convex-helpers/server/pagination";
6
+ import { v } from "convex/values";
7
+ import { query } from "../_generated/server.js";
8
+ import schema from "../schema.js";
9
+ import { refFields } from "../usageDelivery/schema.js";
10
+ import { read } from "../usageDelivery/helpers.js";
11
+ import { canonicalFingerprint } from "../operationEvidence/canonical.js";
12
+ import { historyDoc, operationDoc } from "./schema.js";
13
+ export const readHistory = query({
14
+ args: { ...refFields, paginationOpts: paginationOptsValidator },
15
+ returns: paginationResultValidator(historyDoc),
16
+ handler: async (ctx, args) => {
17
+ await read(ctx, args);
18
+ if (!Number.isInteger(args.paginationOpts.numItems) ||
19
+ args.paginationOpts.numItems < 1 ||
20
+ args.paginationOpts.numItems > 100)
21
+ throw new Error("Invalid correction history page");
22
+ return paginator(ctx.db, schema)
23
+ .query("usageCorrectionHistory")
24
+ .withIndex("by_event", (q) => q.eq("eventId", args.eventId))
25
+ .order("asc")
26
+ .paginate({
27
+ ...args.paginationOpts,
28
+ maximumRowsRead: 200,
29
+ maximumBytesRead: 1000000,
30
+ });
31
+ },
32
+ });
33
+ export const get = query({
34
+ args: { ...refFields, correctionId: v.string() },
35
+ returns: v.union(operationDoc, v.null()),
36
+ handler: async (ctx, args) => {
37
+ await read(ctx, args);
38
+ if (!args.correctionId || args.correctionId.length > 100)
39
+ throw new Error("Invalid correction identity");
40
+ const key = await canonicalFingerprint([args.scope, args.correctionId]);
41
+ const row = await ctx.db
42
+ .query("usageCorrections")
43
+ .withIndex("by_key", (q) => q.eq("key", key))
44
+ .unique();
45
+ return row?.eventId === args.eventId ? row : null;
46
+ },
47
+ });
48
+ export const periodHistory = query({
49
+ args: {
50
+ scope: scopeValidator,
51
+ period: v.object({ start: v.number(), end: v.number() }),
52
+ paginationOpts: paginationOptsValidator,
53
+ },
54
+ returns: v.object({
55
+ ...paginationResultValidator(historyDoc).fields,
56
+ legacyHistoryMissing: v.boolean(),
57
+ }),
58
+ handler: async (ctx, args) => {
59
+ validateUsagePageRequest({
60
+ period: args.period,
61
+ limit: args.paginationOpts.numItems,
62
+ cursor: args.paginationOpts.cursor,
63
+ });
64
+ const key = scopeKey(args.scope);
65
+ const legacy = await ctx.db
66
+ .query("usageCorrectionHistory")
67
+ .withIndex("by_scope_occurrence", (q) => q.eq("scopeKey", key).eq("occurredAt", undefined))
68
+ .first();
69
+ const result = await paginator(ctx.db, schema)
70
+ .query("usageCorrectionHistory")
71
+ .withIndex("by_scope_occurrence", (q) => q
72
+ .eq("scopeKey", key)
73
+ .gte("occurredAt", args.period.start)
74
+ .lt("occurredAt", args.period.end))
75
+ .order("asc")
76
+ .paginate({
77
+ ...args.paginationOpts,
78
+ maximumRowsRead: 200,
79
+ maximumBytesRead: 1000000,
80
+ });
81
+ return { ...result, legacyHistoryMissing: legacy !== null };
82
+ },
83
+ });
84
+ //# sourceMappingURL=queries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queries.js","sourceRoot":"","sources":["../../../src/component/usageCorrections/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EACL,uBAAuB,EACvB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACvD,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC;IAC/B,IAAI,EAAE,EAAE,GAAG,SAAS,EAAE,cAAc,EAAE,uBAAuB,EAAE;IAC/D,OAAO,EAAE,yBAAyB,CAAC,UAAU,CAAC;IAC9C,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC3B,MAAM,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACtB,IACE,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC;YAC/C,IAAI,CAAC,cAA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AAS,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC;aAC3C,KAAK,CAAC,wBAAwB,CAAC;aAC/B,SAAS,CAAC,qBAAqB,EAAE,CAAC,CAAC,EAAE,EAAE,CACtC,CAAC;aACE,EAAE,CAAC,UAAU,EAAE,GAAG,CAAC;aACnB,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;aACpC,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CACrC;aACA,KAAK,CAAC,KAAK,CAAC;aACZ,QAAQ,CAAC;YACR,GAAG,IAAI,CAAC,cAAc;YACtB,eAAe,EAAE,GAAG;YACpB,gBAAgB,EAAE,OAAO;SAC1B,CAAC,CAAC;QACL,OAAO,EAAE,GAAG,MAAM,EAAE,oBAAoB,EAAE,MAAM,KAAK,IAAI,EAAE,CAAC;IAC9D,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,248 @@
1
+ export declare const 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>;
2
+ export declare const fields: {
3
+ stripeAccountId: import("convex/values").VString<string | undefined, "optional">;
4
+ customerAccount: import("convex/values").VString<string | undefined, "optional">;
5
+ observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
6
+ nativeCreditNoteStatus: import("convex/values").VUnion<"issued" | "void" | undefined, [import("convex/values").VLiteral<"issued", "required">, import("convex/values").VLiteral<"void", "required">], "optional", never>;
7
+ 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>;
8
+ adjustmentJson: import("convex/values").VString<string | undefined, "optional">;
9
+ key: import("convex/values").VString<string, "required">;
10
+ scopeKey: import("convex/values").VString<string, "required">;
11
+ eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
12
+ correctionId: import("convex/values").VString<string, "required">;
13
+ inputJson: import("convex/values").VString<string, "required">;
14
+ recordJson: import("convex/values").VString<string, "required">;
15
+ subscriptionJson: import("convex/values").VString<string, "required">;
16
+ quantity: import("convex/values").VString<string, "required">;
17
+ scaledQuantity: import("convex/values").VString<string, "required">;
18
+ 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>;
19
+ reason: import("convex/values").VString<string, "required">;
20
+ firstAttemptAt: import("convex/values").VFloat64<number, "required">;
21
+ attemptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
22
+ leaseUntil: import("convex/values").VFloat64<number | undefined, "optional">;
23
+ attempt: import("convex/values").VFloat64<number, "required">;
24
+ nativeAdjustmentId: import("convex/values").VString<string | undefined, "optional">;
25
+ nativeStatus: import("convex/values").VUnion<"complete" | "pending" | undefined, [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"complete", "required">], "optional", never>;
26
+ invoiceId: import("convex/values").VString<string | undefined, "optional">;
27
+ creditNoteId: import("convex/values").VString<string | undefined, "optional">;
28
+ refundId: import("convex/values").VString<string | undefined, "optional">;
29
+ 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>;
30
+ restoredQuantity: import("convex/values").VString<string, "required">;
31
+ historyCount: import("convex/values").VFloat64<number, "required">;
32
+ };
33
+ export declare const operationDoc: import("convex/values").VObject<{
34
+ _creationTime: number;
35
+ _id: import("convex/values").GenericId<"usageCorrections">;
36
+ adjustmentJson?: string | undefined;
37
+ attempt: number;
38
+ attemptedAt?: number | undefined;
39
+ cashConsequence: "none" | "operator_resolution_required" | "verified_external_adjustment";
40
+ correctionId: string;
41
+ creditNoteId?: string | undefined;
42
+ customerAccount?: string | undefined;
43
+ eventId: import("convex/values").GenericId<"usageEvents">;
44
+ firstAttemptAt: number;
45
+ historyCount: number;
46
+ inputJson: string;
47
+ invoiceId?: string | undefined;
48
+ key: string;
49
+ leaseUntil?: number | undefined;
50
+ nativeAdjustmentId?: string | undefined;
51
+ nativeCreditNoteStatus?: "issued" | "void" | undefined;
52
+ nativeStatus?: "complete" | "pending" | undefined;
53
+ observedAt?: number | undefined;
54
+ quantity: string;
55
+ reason: string;
56
+ recordJson: string;
57
+ refundId?: string | undefined;
58
+ resolution?: "event_cancellation" | "invoice_credit" | undefined;
59
+ restoredQuantity: string;
60
+ scaledQuantity: string;
61
+ scopeKey: string;
62
+ state: "confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported";
63
+ stripeAccountId?: string | undefined;
64
+ subscriptionJson: string;
65
+ }, {
66
+ stripeAccountId: import("convex/values").VString<string | undefined, "optional">;
67
+ customerAccount: import("convex/values").VString<string | undefined, "optional">;
68
+ observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
69
+ nativeCreditNoteStatus: import("convex/values").VUnion<"issued" | "void" | undefined, [import("convex/values").VLiteral<"issued", "required">, import("convex/values").VLiteral<"void", "required">], "optional", never>;
70
+ 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>;
71
+ adjustmentJson: import("convex/values").VString<string | undefined, "optional">;
72
+ key: import("convex/values").VString<string, "required">;
73
+ scopeKey: import("convex/values").VString<string, "required">;
74
+ eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
75
+ correctionId: import("convex/values").VString<string, "required">;
76
+ inputJson: import("convex/values").VString<string, "required">;
77
+ recordJson: import("convex/values").VString<string, "required">;
78
+ subscriptionJson: import("convex/values").VString<string, "required">;
79
+ quantity: import("convex/values").VString<string, "required">;
80
+ scaledQuantity: import("convex/values").VString<string, "required">;
81
+ 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>;
82
+ reason: import("convex/values").VString<string, "required">;
83
+ firstAttemptAt: import("convex/values").VFloat64<number, "required">;
84
+ attemptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
85
+ leaseUntil: import("convex/values").VFloat64<number | undefined, "optional">;
86
+ attempt: import("convex/values").VFloat64<number, "required">;
87
+ nativeAdjustmentId: import("convex/values").VString<string | undefined, "optional">;
88
+ nativeStatus: import("convex/values").VUnion<"complete" | "pending" | undefined, [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"complete", "required">], "optional", never>;
89
+ invoiceId: import("convex/values").VString<string | undefined, "optional">;
90
+ creditNoteId: import("convex/values").VString<string | undefined, "optional">;
91
+ refundId: import("convex/values").VString<string | undefined, "optional">;
92
+ 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>;
93
+ restoredQuantity: import("convex/values").VString<string, "required">;
94
+ historyCount: import("convex/values").VFloat64<number, "required">;
95
+ _id: import("convex/values").VId<import("convex/values").GenericId<"usageCorrections">, "required">;
96
+ _creationTime: import("convex/values").VFloat64<number, "required">;
97
+ }, "required", "_creationTime" | "_id" | "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">;
98
+ export declare const operationsTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
99
+ adjustmentJson?: string | undefined;
100
+ attempt: number;
101
+ attemptedAt?: number | undefined;
102
+ cashConsequence: "none" | "operator_resolution_required" | "verified_external_adjustment";
103
+ correctionId: string;
104
+ creditNoteId?: string | undefined;
105
+ customerAccount?: string | undefined;
106
+ eventId: import("convex/values").GenericId<"usageEvents">;
107
+ firstAttemptAt: number;
108
+ historyCount: number;
109
+ inputJson: string;
110
+ invoiceId?: string | undefined;
111
+ key: string;
112
+ leaseUntil?: number | undefined;
113
+ nativeAdjustmentId?: string | undefined;
114
+ nativeCreditNoteStatus?: "issued" | "void" | undefined;
115
+ nativeStatus?: "complete" | "pending" | undefined;
116
+ observedAt?: number | undefined;
117
+ quantity: string;
118
+ reason: string;
119
+ recordJson: string;
120
+ refundId?: string | undefined;
121
+ resolution?: "event_cancellation" | "invoice_credit" | undefined;
122
+ restoredQuantity: string;
123
+ scaledQuantity: string;
124
+ scopeKey: string;
125
+ state: "confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported";
126
+ stripeAccountId?: string | undefined;
127
+ subscriptionJson: string;
128
+ }, {
129
+ stripeAccountId: import("convex/values").VString<string | undefined, "optional">;
130
+ customerAccount: import("convex/values").VString<string | undefined, "optional">;
131
+ observedAt: import("convex/values").VFloat64<number | undefined, "optional">;
132
+ nativeCreditNoteStatus: import("convex/values").VUnion<"issued" | "void" | undefined, [import("convex/values").VLiteral<"issued", "required">, import("convex/values").VLiteral<"void", "required">], "optional", never>;
133
+ 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>;
134
+ adjustmentJson: import("convex/values").VString<string | undefined, "optional">;
135
+ key: import("convex/values").VString<string, "required">;
136
+ scopeKey: import("convex/values").VString<string, "required">;
137
+ eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
138
+ correctionId: import("convex/values").VString<string, "required">;
139
+ inputJson: import("convex/values").VString<string, "required">;
140
+ recordJson: import("convex/values").VString<string, "required">;
141
+ subscriptionJson: import("convex/values").VString<string, "required">;
142
+ quantity: import("convex/values").VString<string, "required">;
143
+ scaledQuantity: import("convex/values").VString<string, "required">;
144
+ 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>;
145
+ reason: import("convex/values").VString<string, "required">;
146
+ firstAttemptAt: import("convex/values").VFloat64<number, "required">;
147
+ attemptedAt: import("convex/values").VFloat64<number | undefined, "optional">;
148
+ leaseUntil: import("convex/values").VFloat64<number | undefined, "optional">;
149
+ attempt: import("convex/values").VFloat64<number, "required">;
150
+ nativeAdjustmentId: import("convex/values").VString<string | undefined, "optional">;
151
+ nativeStatus: import("convex/values").VUnion<"complete" | "pending" | undefined, [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"complete", "required">], "optional", never>;
152
+ invoiceId: import("convex/values").VString<string | undefined, "optional">;
153
+ creditNoteId: import("convex/values").VString<string | undefined, "optional">;
154
+ refundId: import("convex/values").VString<string | undefined, "optional">;
155
+ 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>;
156
+ restoredQuantity: import("convex/values").VString<string, "required">;
157
+ historyCount: import("convex/values").VFloat64<number, "required">;
158
+ }, "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">, {
159
+ by_event: ["eventId", "_creationTime"];
160
+ by_key: ["key", "_creationTime"];
161
+ by_payer_state: ["customerAccount", "state", "_creationTime"];
162
+ by_realm_state: ["stripeAccountId", "state", "_creationTime"];
163
+ by_scope: ["scopeKey", "_creationTime"];
164
+ by_scope_state: ["scopeKey", "state", "_creationTime"];
165
+ }, {}, {}>;
166
+ export declare const historyFields: {
167
+ key: import("convex/values").VString<string, "required">;
168
+ scopeKey: import("convex/values").VString<string, "required">;
169
+ eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
170
+ sequence: import("convex/values").VFloat64<number, "required">;
171
+ 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>;
172
+ reason: import("convex/values").VString<string, "required">;
173
+ recordJson: import("convex/values").VString<string, "required">;
174
+ subscriptionJson: import("convex/values").VString<string, "required">;
175
+ evidenceJson: import("convex/values").VString<string, "required">;
176
+ occurredAt: import("convex/values").VFloat64<number | undefined, "optional">;
177
+ at: import("convex/values").VFloat64<number, "required">;
178
+ };
179
+ export declare const historyDoc: import("convex/values").VObject<{
180
+ _creationTime: number;
181
+ _id: import("convex/values").GenericId<"usageCorrectionHistory">;
182
+ at: number;
183
+ eventId: import("convex/values").GenericId<"usageEvents">;
184
+ evidenceJson: string;
185
+ key: string;
186
+ occurredAt?: number | undefined;
187
+ reason: string;
188
+ recordJson: string;
189
+ scopeKey: string;
190
+ sequence: number;
191
+ state: "confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported";
192
+ subscriptionJson: string;
193
+ }, {
194
+ key: import("convex/values").VString<string, "required">;
195
+ scopeKey: import("convex/values").VString<string, "required">;
196
+ eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
197
+ sequence: import("convex/values").VFloat64<number, "required">;
198
+ 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>;
199
+ reason: import("convex/values").VString<string, "required">;
200
+ recordJson: import("convex/values").VString<string, "required">;
201
+ subscriptionJson: import("convex/values").VString<string, "required">;
202
+ evidenceJson: import("convex/values").VString<string, "required">;
203
+ occurredAt: import("convex/values").VFloat64<number | undefined, "optional">;
204
+ at: import("convex/values").VFloat64<number, "required">;
205
+ _id: import("convex/values").VId<import("convex/values").GenericId<"usageCorrectionHistory">, "required">;
206
+ _creationTime: import("convex/values").VFloat64<number, "required">;
207
+ }, "required", "_creationTime" | "_id" | "at" | "eventId" | "evidenceJson" | "key" | "occurredAt" | "reason" | "recordJson" | "scopeKey" | "sequence" | "state" | "subscriptionJson">;
208
+ export declare const historyTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
209
+ at: number;
210
+ eventId: import("convex/values").GenericId<"usageEvents">;
211
+ evidenceJson: string;
212
+ key: string;
213
+ occurredAt?: number | undefined;
214
+ reason: string;
215
+ recordJson: string;
216
+ scopeKey: string;
217
+ sequence: number;
218
+ state: "confirmed" | "held" | "invoice_adjustment_required" | "provider_accepted" | "requested" | "unsupported";
219
+ subscriptionJson: string;
220
+ }, {
221
+ key: import("convex/values").VString<string, "required">;
222
+ scopeKey: import("convex/values").VString<string, "required">;
223
+ eventId: import("convex/values").VId<import("convex/values").GenericId<"usageEvents">, "required">;
224
+ sequence: import("convex/values").VFloat64<number, "required">;
225
+ 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>;
226
+ reason: import("convex/values").VString<string, "required">;
227
+ recordJson: import("convex/values").VString<string, "required">;
228
+ subscriptionJson: import("convex/values").VString<string, "required">;
229
+ evidenceJson: import("convex/values").VString<string, "required">;
230
+ occurredAt: import("convex/values").VFloat64<number | undefined, "optional">;
231
+ at: import("convex/values").VFloat64<number, "required">;
232
+ }, "required", "at" | "eventId" | "evidenceJson" | "key" | "occurredAt" | "reason" | "recordJson" | "scopeKey" | "sequence" | "state" | "subscriptionJson">, {
233
+ by_event: ["eventId", "_creationTime"];
234
+ by_scope_occurrence: ["scopeKey", "occurredAt", "_creationTime"];
235
+ by_scope_time: ["scopeKey", "at", "_creationTime"];
236
+ }, {}, {}>;
237
+ export declare const claimsTable: import("convex/server").TableDefinition<import("convex/values").VObject<{
238
+ key: string;
239
+ operationKey: string;
240
+ proofJson: string;
241
+ }, {
242
+ key: import("convex/values").VString<string, "required">;
243
+ operationKey: import("convex/values").VString<string, "required">;
244
+ proofJson: import("convex/values").VString<string, "required">;
245
+ }, "required", "key" | "operationKey" | "proofJson">, {
246
+ by_key: ["key", "_creationTime"];
247
+ }, {}, {}>;
248
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/component/usageCorrections/schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,whBAOjB,CAAC;AACF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwClB,CAAC;AACF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ggBAIvB,CAAC;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAM4B,CAAC;AACzD,eAAO,MAAM,aAAa;;;;;;;;;;;;CAYzB,CAAC;AACF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;qLAIrB,CAAC;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAGkC,CAAC;AAC5D,eAAO,MAAM,WAAW;;;;;;;;;;UAIG,CAAC"}
@@ -0,0 +1,74 @@
1
+ import { defineTable } from "convex/server";
2
+ import { v } from "convex/values";
3
+ export const state = v.union(v.literal("requested"), v.literal("provider_accepted"), v.literal("confirmed"), v.literal("held"), v.literal("unsupported"), v.literal("invoice_adjustment_required"));
4
+ export const fields = {
5
+ stripeAccountId: v.optional(v.string()),
6
+ customerAccount: v.optional(v.string()),
7
+ observedAt: v.optional(v.number()),
8
+ nativeCreditNoteStatus: v.optional(v.union(v.literal("issued"), v.literal("void"))),
9
+ resolution: v.optional(v.union(v.literal("event_cancellation"), v.literal("invoice_credit"))),
10
+ adjustmentJson: v.optional(v.string()),
11
+ key: v.string(),
12
+ scopeKey: v.string(),
13
+ eventId: v.id("usageEvents"),
14
+ correctionId: v.string(),
15
+ inputJson: v.string(),
16
+ recordJson: v.string(),
17
+ subscriptionJson: v.string(),
18
+ quantity: v.string(),
19
+ scaledQuantity: v.string(),
20
+ state,
21
+ reason: v.string(),
22
+ firstAttemptAt: v.number(),
23
+ attemptedAt: v.optional(v.number()),
24
+ leaseUntil: v.optional(v.number()),
25
+ attempt: v.number(),
26
+ nativeAdjustmentId: v.optional(v.string()),
27
+ nativeStatus: v.optional(v.union(v.literal("pending"), v.literal("complete"))),
28
+ invoiceId: v.optional(v.string()),
29
+ creditNoteId: v.optional(v.string()),
30
+ refundId: v.optional(v.string()),
31
+ cashConsequence: v.union(v.literal("none"), v.literal("operator_resolution_required"), v.literal("verified_external_adjustment")),
32
+ restoredQuantity: v.string(),
33
+ historyCount: v.number(),
34
+ };
35
+ export const operationDoc = v.object({
36
+ _id: v.id("usageCorrections"),
37
+ _creationTime: v.number(),
38
+ ...fields,
39
+ });
40
+ export const operationsTable = defineTable(fields)
41
+ .index("by_key", ["key"])
42
+ .index("by_event", ["eventId"])
43
+ .index("by_scope", ["scopeKey"])
44
+ .index("by_scope_state", ["scopeKey", "state"])
45
+ .index("by_realm_state", ["stripeAccountId", "state"])
46
+ .index("by_payer_state", ["customerAccount", "state"]);
47
+ export const historyFields = {
48
+ key: v.string(),
49
+ scopeKey: v.string(),
50
+ eventId: v.id("usageEvents"),
51
+ sequence: v.number(),
52
+ state,
53
+ reason: v.string(),
54
+ recordJson: v.string(),
55
+ subscriptionJson: v.string(),
56
+ evidenceJson: v.string(),
57
+ occurredAt: v.optional(v.number()),
58
+ at: v.number(),
59
+ };
60
+ export const historyDoc = v.object({
61
+ _id: v.id("usageCorrectionHistory"),
62
+ _creationTime: v.number(),
63
+ ...historyFields,
64
+ });
65
+ export const historyTable = defineTable(historyFields)
66
+ .index("by_event", ["eventId"])
67
+ .index("by_scope_time", ["scopeKey", "at"])
68
+ .index("by_scope_occurrence", ["scopeKey", "occurredAt"]);
69
+ export const claimsTable = defineTable({
70
+ key: v.string(),
71
+ operationKey: v.string(),
72
+ proofJson: v.string(),
73
+ }).index("by_key", ["key"]);
74
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/component/usageCorrections/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAC1B,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,EACtB,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAC9B,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,EACtB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EACjB,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,EACxB,CAAC,CAAC,OAAO,CAAC,6BAA6B,CAAC,CACzC,CAAC;AACF,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,eAAe,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACvC,eAAe,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACvC,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,sBAAsB,EAAE,CAAC,CAAC,QAAQ,CAChC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAChD;IACD,UAAU,EAAE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AAC,CAAC,MAAM,EAAE;IACpB,KAAK;IACL,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,UAAU,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAClC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;CACf,CAAC;AACF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,wBAAwB,CAAC;IACnC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,GAAG,aAAa;CACjB,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC,aAAa,CAAC;KACnD,KAAK,CAAC,UAAU,EAAE,CAAC,SAAS,CAAC,CAAC;KAC9B,KAAK,CAAC,eAAe,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;KAC1C,KAAK,CAAC,qBAAqB,EAAE,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC;AAC5D,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAC;IACrC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC"}
@@ -92,7 +92,7 @@ export declare const readHistory: import("convex/server").RegisteredQuery<"publi
92
92
  at: number;
93
93
  evidenceJson: string;
94
94
  fingerprint: string;
95
- kind: "closure" | "commit" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation";
95
+ kind: "closure" | "commit" | "correction" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation";
96
96
  purchaseKey?: string | undefined;
97
97
  sourceKey: string;
98
98
  }>>>;
@@ -1 +1 @@
1
- {"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/component/usageCredits/queries.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAEV,kBAAkB,EACnB,MAAM,mCAAmC,CAAC;AAE3C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;UAetB,CAAC;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;UAQnB,CAAC;AACH,eAAO,MAAM,OAAO;;+BAyDlB,CAAC;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkBrB,CAAC;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;IAkBtB,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;GASlB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;GA+DvB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsD1B,CAAC;AAEH,eAAO,MAAM,QAAQ;;mBAoBnB,CAAC"}
1
+ {"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../src/component/usageCredits/queries.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAEV,kBAAkB,EACnB,MAAM,mCAAmC,CAAC;AAE3C,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;UAetB,CAAC;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;UAQnB,CAAC;AACH,eAAO,MAAM,OAAO;;+BAyDlB,CAAC;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkBrB,CAAC;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;IAkBtB,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;GASlB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;GAkEvB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsD1B,CAAC;AAEH,eAAO,MAAM,QAAQ;;mBAoBnB,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { verifiedCancellation } from "../usageCorrections/cancellation.js";
1
2
  import { scopeValidator } from "../usage/schema.js";
2
3
  import { scopeKey } from "../usage/helpers.js";
3
4
  import { account, purchase } from "./helpers.js";
@@ -173,6 +174,11 @@ export const invoiceUsage = query({
173
174
  .query("usageDeliveryErrors")
174
175
  .withIndex("by_event", (q) => q.eq("eventId", row._id))
175
176
  .first();
177
+ const canceled = await verifiedCancellation(ctx, row, outbox);
178
+ if (canceled === "confirmed")
179
+ continue;
180
+ if (canceled === "unverified")
181
+ valid = false;
176
182
  if (outbox?.state !== "provider_accepted" || error)
177
183
  valid = false;
178
184
  quantity += BigInt(event.scaledQuantity);
@@ -1 +1 @@
1
- {"version":3,"file":"queries.js","sourceRoot":"","sources":["../../../src/component/usageCredits/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EACL,uBAAuB,EACvB,yBAAyB,GAC1B,MA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,CAAC,MAAM,CAAC;YAChC,MAAM,EAAE,QAAQ;YAChB,SAAS;SACV,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC;IAC5B,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE;IACjC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC3B,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,YAAY,CACpC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAuB,CACpD,CAAC;QACF,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC;YACzB,OAAO,CAAC,KAAK,CAAC,eAAe;YAC7B,OAAO,CAAC,KAAK,CAAC,QAAQ;YACtB,OAAO,CAAC,OAAO,CAAC,gBAAgB;SACjC,CAAC,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,EAAE;aACtB,KAAK,CAAC,sBAAsB,CAAC;aAC7B,SAAS,CAAC,sBAAsB,EAAE,CAAC,CAAC,EAAE,EAAE,CACvC,CAAC,CAAC,EAAE,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAC5D;aACA,IAAI,CAAC,GAAG,CAAC,CAAC;QACb,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF,CAAC,CAAC"}
@@ -231,7 +231,7 @@ export declare const grantsTable: import("convex/server").TableDefinition<import
231
231
  export declare const historyFields: {
232
232
  accountKey: import("convex/values").VString<string, "required">;
233
233
  purchaseKey: import("convex/values").VString<string | undefined, "optional">;
234
- 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>;
234
+ 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>;
235
235
  sourceKey: import("convex/values").VString<string, "required">;
236
236
  fingerprint: import("convex/values").VString<string, "required">;
237
237
  evidenceJson: import("convex/values").VString<string, "required">;
@@ -244,13 +244,13 @@ export declare const historyDoc: import("convex/values").VObject<{
244
244
  at: number;
245
245
  evidenceJson: string;
246
246
  fingerprint: string;
247
- kind: "closure" | "commit" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation";
247
+ kind: "closure" | "commit" | "correction" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation";
248
248
  purchaseKey?: string | undefined;
249
249
  sourceKey: string;
250
250
  }, {
251
251
  accountKey: import("convex/values").VString<string, "required">;
252
252
  purchaseKey: import("convex/values").VString<string | undefined, "optional">;
253
- 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>;
253
+ 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>;
254
254
  sourceKey: import("convex/values").VString<string, "required">;
255
255
  fingerprint: import("convex/values").VString<string, "required">;
256
256
  evidenceJson: import("convex/values").VString<string, "required">;
@@ -263,13 +263,13 @@ export declare const historyTable: import("convex/server").TableDefinition<impor
263
263
  at: number;
264
264
  evidenceJson: string;
265
265
  fingerprint: string;
266
- kind: "closure" | "commit" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation";
266
+ kind: "closure" | "commit" | "correction" | "grant" | "observation" | "payment" | "purchase" | "recovery" | "release" | "reservation";
267
267
  purchaseKey?: string | undefined;
268
268
  sourceKey: string;
269
269
  }, {
270
270
  accountKey: import("convex/values").VString<string, "required">;
271
271
  purchaseKey: import("convex/values").VString<string | undefined, "optional">;
272
- 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>;
272
+ 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>;
273
273
  sourceKey: import("convex/values").VString<string, "required">;
274
274
  fingerprint: import("convex/values").VString<string, "required">;
275
275
  evidenceJson: import("convex/values").VString<string, "required">;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/component/usageCredits/schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;IACxB,GAAG;IACH,QAAQ;IACR,WAAW;IACX,eAAe;IACf,eAAe;IACf,MAAM;IACN,aAAa;IACb,YAAY;IACZ,YAAY;CACb,CAAC;AACF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;UAGgC,CAAC;AAC3D,eAAO,MAAM,cAAc;IACzB,GAAG;IACH,UAAU;IACV,iBAAiB;IACjB,gBAAgB;IAChB,kBAAkB;IAClB,SAAS;IACT,cAAc;IACd,KAAK;IAML,eAAe;IACf,UAAU;IACV,gBAAgB;IAChB,cAAc;IACd,mBAAmB;IACnB,aAAa;CACd,CAAC;AACF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gSAItB,CAAC;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAIW,CAAC;AACvC,eAAO,MAAM,WAAW;IACtB,WAAW;IACX,UAAU;IACV,aAAa;IACb,iBAAiB;IACjB,YAAY;IACZ,aAAa;IACb,eAAe;IACf,QAAQ;IACR,SAAS;IACT,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,SAAS;IACT,MAAM;IACN,aAAa;IACb,qBAAqB;IACrB,UAAU;CACX,CAAC;AACF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4UAInB,CAAC;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAIc,CAAC;AACvC,eAAO,MAAM,aAAa;IACxB,UAAU;IACV,WAAW;IACX,IAAI;IAWJ,SAAS;IACT,WAAW;IACX,YAAY;IACZ,EAAE;CACH,CAAC;AACF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;qIAIrB,CAAC;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;UAG6B,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/component/usageCredits/schema.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;IACxB,GAAG;IACH,QAAQ;IACR,WAAW;IACX,eAAe;IACf,eAAe;IACf,MAAM;IACN,aAAa;IACb,YAAY;IACZ,YAAY;CACb,CAAC;AACF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;UAGgC,CAAC;AAC3D,eAAO,MAAM,cAAc;IACzB,GAAG;IACH,UAAU;IACV,iBAAiB;IACjB,gBAAgB;IAChB,kBAAkB;IAClB,SAAS;IACT,cAAc;IACd,KAAK;IAML,eAAe;IACf,UAAU;IACV,gBAAgB;IAChB,cAAc;IACd,mBAAmB;IACnB,aAAa;CACd,CAAC;AACF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gSAItB,CAAC;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAIW,CAAC;AACvC,eAAO,MAAM,WAAW;IACtB,WAAW;IACX,UAAU;IACV,aAAa;IACb,iBAAiB;IACjB,YAAY;IACZ,aAAa;IACb,eAAe;IACf,QAAQ;IACR,SAAS;IACT,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,WAAW;IACX,SAAS;IACT,MAAM;IACN,aAAa;IACb,qBAAqB;IACrB,UAAU;CACX,CAAC;AACF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4UAInB,CAAC;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAIc,CAAC;AACvC,eAAO,MAAM,aAAa;IACxB,UAAU;IACV,WAAW;IACX,IAAI;IAYJ,SAAS;IACT,WAAW;IACX,YAAY;IACZ,EAAE;CACH,CAAC;AACF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;qIAIrB,CAAC;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;UAG6B,CAAC"}
@@ -74,7 +74,7 @@ export const grantsTable = defineTable(grantFields)
74
74
  export const historyFields = {
75
75
  accountKey: v.string(),
76
76
  purchaseKey: v.optional(v.string()),
77
- kind: v.union(v.literal("purchase"), v.literal("payment"), v.literal("grant"), v.literal("reservation"), v.literal("commit"), v.literal("release"), v.literal("observation"), v.literal("recovery"), v.literal("closure")),
77
+ kind: v.union(v.literal("purchase"), v.literal("payment"), v.literal("grant"), v.literal("reservation"), v.literal("commit"), v.literal("release"), v.literal("observation"), v.literal("recovery"), v.literal("closure"), v.literal("correction")),
78
78
  sourceKey: v.string(),
79
79
  fingerprint: v.string(),
80
80
  evidenceJson: v.string(),