tapimo 0.2.0 → 0.3.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 (313) hide show
  1. package/README.md +31 -3
  2. package/dist/ApiKey.d.ts +1 -0
  3. package/dist/ApiKey.d.ts.map +1 -1
  4. package/dist/ApiKey.js +5 -2
  5. package/dist/ApiKey.js.map +1 -1
  6. package/dist/ApiKeys.d.ts +28 -1
  7. package/dist/ApiKeys.d.ts.map +1 -1
  8. package/dist/ApiKeys.js +34 -1
  9. package/dist/ApiKeys.js.map +1 -1
  10. package/dist/App.d.ts +7167 -4507
  11. package/dist/App.d.ts.map +1 -1
  12. package/dist/App.js +8 -0
  13. package/dist/App.js.map +1 -1
  14. package/dist/Scope.d.ts +11 -2
  15. package/dist/Scope.d.ts.map +1 -1
  16. package/dist/Scope.js +14 -3
  17. package/dist/Scope.js.map +1 -1
  18. package/dist/admin/App.d.ts +128 -118
  19. package/dist/admin/App.d.ts.map +1 -1
  20. package/dist/admin/apps/api-keys.d.ts +7 -0
  21. package/dist/admin/apps/api-keys.d.ts.map +1 -1
  22. package/dist/admin/apps/scopes.d.ts +8 -0
  23. package/dist/admin/apps/scopes.d.ts.map +1 -1
  24. package/dist/admin/apps/scopes.js +3 -0
  25. package/dist/admin/apps/scopes.js.map +1 -1
  26. package/dist/admin/apps/verified-tokens.d.ts +57 -57
  27. package/dist/admin/ui.generated.d.ts +1 -1
  28. package/dist/admin/ui.generated.js +13 -13
  29. package/dist/admin/ui.generated.js.map +1 -1
  30. package/dist/analytics/Analytics.d.ts +151 -0
  31. package/dist/analytics/Analytics.d.ts.map +1 -0
  32. package/dist/analytics/Analytics.js +212 -0
  33. package/dist/analytics/Analytics.js.map +1 -0
  34. package/dist/analytics/tables/requestEvents.d.ts +215 -0
  35. package/dist/analytics/tables/requestEvents.d.ts.map +1 -0
  36. package/dist/analytics/tables/requestEvents.js +264 -0
  37. package/dist/analytics/tables/requestEvents.js.map +1 -0
  38. package/dist/apps/data/App.d.ts +1024 -624
  39. package/dist/apps/data/App.d.ts.map +1 -1
  40. package/dist/apps/data/App.js +36 -0
  41. package/dist/apps/data/App.js.map +1 -1
  42. package/dist/apps/data/routes/balances.d.ts +45 -45
  43. package/dist/apps/data/routes/coingecko.d.ts +176 -176
  44. package/dist/apps/data/routes/exchanges.d.ts +455 -455
  45. package/dist/apps/data/routes/fee-amm.d.ts +101 -101
  46. package/dist/apps/data/routes/funding.d.ts +765 -0
  47. package/dist/apps/data/routes/funding.d.ts.map +1 -0
  48. package/dist/apps/data/routes/funding.js +383 -0
  49. package/dist/apps/data/routes/funding.js.map +1 -0
  50. package/dist/apps/data/routes/receipts.d.ts.map +1 -1
  51. package/dist/apps/data/routes/receipts.js +2 -8
  52. package/dist/apps/data/routes/receipts.js.map +1 -1
  53. package/dist/apps/data/routes/rpc.d.ts +29 -36
  54. package/dist/apps/data/routes/rpc.d.ts.map +1 -1
  55. package/dist/apps/data/routes/rpc.js +29 -1
  56. package/dist/apps/data/routes/rpc.js.map +1 -1
  57. package/dist/apps/data/routes/tokenlist.d.ts +36 -36
  58. package/dist/apps/data/routes/transfers.d.ts +56 -56
  59. package/dist/apps/data/routes/verified-tokens.d.ts +36 -36
  60. package/dist/apps/data/routes/webhooks.d.ts +45 -45
  61. package/dist/apps/data/routes/webhooks.d.ts.map +1 -1
  62. package/dist/apps/data/routes/webhooks.js +8 -8
  63. package/dist/apps/data/routes/webhooks.js.map +1 -1
  64. package/dist/apps/docs/App.d.ts +4 -2
  65. package/dist/apps/docs/App.d.ts.map +1 -1
  66. package/dist/apps/docs/App.js +27 -95
  67. package/dist/apps/docs/App.js.map +1 -1
  68. package/dist/apps/docs/reference.d.ts +21 -0
  69. package/dist/apps/docs/reference.d.ts.map +1 -0
  70. package/dist/apps/docs/reference.js +112 -0
  71. package/dist/apps/docs/reference.js.map +1 -0
  72. package/dist/apps/index.d.ts +1 -0
  73. package/dist/apps/index.d.ts.map +1 -1
  74. package/dist/apps/index.js +1 -0
  75. package/dist/apps/index.js.map +1 -1
  76. package/dist/apps/mcp.d.ts +76 -0
  77. package/dist/apps/mcp.d.ts.map +1 -0
  78. package/dist/apps/mcp.js +188 -0
  79. package/dist/apps/mcp.js.map +1 -0
  80. package/dist/apps/platform/App.d.ts +3005 -728
  81. package/dist/apps/platform/App.d.ts.map +1 -1
  82. package/dist/apps/platform/App.js +13 -3
  83. package/dist/apps/platform/App.js.map +1 -1
  84. package/dist/apps/platform/Billing.d.ts +279 -0
  85. package/dist/apps/platform/Billing.d.ts.map +1 -0
  86. package/dist/apps/platform/Billing.js +477 -0
  87. package/dist/apps/platform/Billing.js.map +1 -0
  88. package/dist/apps/platform/index.d.ts +1 -0
  89. package/dist/apps/platform/index.d.ts.map +1 -1
  90. package/dist/apps/platform/index.js +1 -0
  91. package/dist/apps/platform/index.js.map +1 -1
  92. package/dist/apps/platform/routes/api-keys.d.ts +341 -49
  93. package/dist/apps/platform/routes/api-keys.d.ts.map +1 -1
  94. package/dist/apps/platform/routes/api-keys.js +115 -13
  95. package/dist/apps/platform/routes/api-keys.js.map +1 -1
  96. package/dist/apps/platform/routes/billing.d.ts +1520 -0
  97. package/dist/apps/platform/routes/billing.d.ts.map +1 -0
  98. package/dist/apps/platform/routes/billing.js +795 -0
  99. package/dist/apps/platform/routes/billing.js.map +1 -0
  100. package/dist/apps/platform/routes/invitations.d.ts +201 -83
  101. package/dist/apps/platform/routes/invitations.d.ts.map +1 -1
  102. package/dist/apps/platform/routes/invitations.js +58 -0
  103. package/dist/apps/platform/routes/invitations.js.map +1 -1
  104. package/dist/apps/platform/routes/me.d.ts +17 -17
  105. package/dist/apps/platform/routes/orgs.d.ts +50 -36
  106. package/dist/apps/platform/routes/orgs.d.ts.map +1 -1
  107. package/dist/apps/platform/routes/orgs.js +14 -3
  108. package/dist/apps/platform/routes/orgs.js.map +1 -1
  109. package/dist/apps/platform/routes/projects.d.ts +97 -97
  110. package/dist/apps/platform/routes/scopes.d.ts +107 -0
  111. package/dist/apps/platform/routes/scopes.d.ts.map +1 -0
  112. package/dist/apps/platform/routes/scopes.js +66 -0
  113. package/dist/apps/platform/routes/scopes.js.map +1 -0
  114. package/dist/apps/platform/routes/usage.d.ts +588 -0
  115. package/dist/apps/platform/routes/usage.d.ts.map +1 -0
  116. package/dist/apps/platform/routes/usage.js +391 -0
  117. package/dist/apps/platform/routes/usage.js.map +1 -0
  118. package/dist/apps/relay/App.d.ts +4 -1
  119. package/dist/apps/relay/App.d.ts.map +1 -1
  120. package/dist/apps/relay/App.js +118 -10
  121. package/dist/apps/relay/App.js.map +1 -1
  122. package/dist/apps/relay/Sponsorships.d.ts.map +1 -1
  123. package/dist/apps/relay/Sponsorships.js +2 -1
  124. package/dist/apps/relay/Sponsorships.js.map +1 -1
  125. package/dist/cli/Cli.d.ts +8 -1
  126. package/dist/cli/Cli.d.ts.map +1 -1
  127. package/dist/cli/Cli.js +11 -3
  128. package/dist/cli/Cli.js.map +1 -1
  129. package/dist/cli/commands/admin.d.ts +4 -0
  130. package/dist/cli/commands/admin.d.ts.map +1 -1
  131. package/dist/cli/commands/admin.js +80 -1
  132. package/dist/cli/commands/admin.js.map +1 -1
  133. package/dist/db/Db.d.ts +7 -0
  134. package/dist/db/Db.d.ts.map +1 -1
  135. package/dist/db/Db.js +126 -0
  136. package/dist/db/Db.js.map +1 -1
  137. package/dist/db/Schema.d.ts +79 -0
  138. package/dist/db/Schema.d.ts.map +1 -1
  139. package/dist/db/Schema.js +88 -2
  140. package/dist/db/Schema.js.map +1 -1
  141. package/dist/db/tables/billingSettings.d.ts +55 -0
  142. package/dist/db/tables/billingSettings.d.ts.map +1 -0
  143. package/dist/db/tables/billingSettings.js +70 -0
  144. package/dist/db/tables/billingSettings.js.map +1 -0
  145. package/dist/db/tables/invitations.js +2 -2
  146. package/dist/db/tables/invitations.js.map +1 -1
  147. package/dist/db/tables/organizations.d.ts +6 -2
  148. package/dist/db/tables/organizations.d.ts.map +1 -1
  149. package/dist/db/tables/organizations.js +10 -4
  150. package/dist/db/tables/organizations.js.map +1 -1
  151. package/dist/db/tables/projects.js +2 -2
  152. package/dist/db/tables/projects.js.map +1 -1
  153. package/dist/db/tables/requestUsage.d.ts +121 -0
  154. package/dist/db/tables/requestUsage.d.ts.map +1 -0
  155. package/dist/db/tables/requestUsage.js +150 -0
  156. package/dist/db/tables/requestUsage.js.map +1 -0
  157. package/dist/db/tables/sponsoredTransactions.d.ts +119 -0
  158. package/dist/db/tables/sponsoredTransactions.d.ts.map +1 -1
  159. package/dist/db/tables/sponsoredTransactions.js +155 -2
  160. package/dist/db/tables/sponsoredTransactions.js.map +1 -1
  161. package/dist/db/tables/stripeCustomers.d.ts +81 -0
  162. package/dist/db/tables/stripeCustomers.d.ts.map +1 -0
  163. package/dist/db/tables/stripeCustomers.js +120 -0
  164. package/dist/db/tables/stripeCustomers.js.map +1 -0
  165. package/dist/db/tables/users.js +2 -2
  166. package/dist/db/tables/users.js.map +1 -1
  167. package/dist/handlers/internal/sponsorship.d.ts +5 -2
  168. package/dist/handlers/internal/sponsorship.d.ts.map +1 -1
  169. package/dist/handlers/internal/sponsorship.js +19 -5
  170. package/dist/handlers/internal/sponsorship.js.map +1 -1
  171. package/dist/handlers/internal/utils.d.ts +10 -3
  172. package/dist/handlers/internal/utils.d.ts.map +1 -1
  173. package/dist/handlers/internal/utils.js +14 -6
  174. package/dist/handlers/internal/utils.js.map +1 -1
  175. package/dist/index.d.ts +1 -0
  176. package/dist/index.d.ts.map +1 -1
  177. package/dist/index.js +1 -0
  178. package/dist/index.js.map +1 -1
  179. package/dist/internal/Auth.d.ts +18 -4
  180. package/dist/internal/Auth.d.ts.map +1 -1
  181. package/dist/internal/Auth.js +148 -76
  182. package/dist/internal/Auth.js.map +1 -1
  183. package/dist/internal/Cache.d.ts.map +1 -1
  184. package/dist/internal/Cache.js +4 -1
  185. package/dist/internal/Cache.js.map +1 -1
  186. package/dist/internal/EdgeCache.d.ts +10 -0
  187. package/dist/internal/EdgeCache.d.ts.map +1 -1
  188. package/dist/internal/EdgeCache.js +39 -8
  189. package/dist/internal/EdgeCache.js.map +1 -1
  190. package/dist/internal/Fees.d.ts +27 -0
  191. package/dist/internal/Fees.d.ts.map +1 -0
  192. package/dist/internal/Fees.js +48 -0
  193. package/dist/internal/Fees.js.map +1 -0
  194. package/dist/internal/FundingRoutes.d.ts +183 -0
  195. package/dist/internal/FundingRoutes.d.ts.map +1 -0
  196. package/dist/internal/FundingRoutes.js +490 -0
  197. package/dist/internal/FundingRoutes.js.map +1 -0
  198. package/dist/internal/Id.d.ts +15 -0
  199. package/dist/internal/Id.d.ts.map +1 -0
  200. package/dist/internal/Id.js +22 -0
  201. package/dist/internal/Id.js.map +1 -0
  202. package/dist/internal/Log.d.ts +2 -0
  203. package/dist/internal/Log.d.ts.map +1 -1
  204. package/dist/internal/Log.js +3 -0
  205. package/dist/internal/Log.js.map +1 -1
  206. package/dist/internal/OpenApi.d.ts +10 -1
  207. package/dist/internal/OpenApi.d.ts.map +1 -1
  208. package/dist/internal/OpenApi.js +8 -1
  209. package/dist/internal/OpenApi.js.map +1 -1
  210. package/dist/internal/RateLimit.d.ts +25 -0
  211. package/dist/internal/RateLimit.d.ts.map +1 -1
  212. package/dist/internal/RateLimit.js +51 -0
  213. package/dist/internal/RateLimit.js.map +1 -1
  214. package/dist/internal/Response.d.ts +1 -1
  215. package/dist/internal/Response.d.ts.map +1 -1
  216. package/dist/internal/Schema.d.ts +8 -0
  217. package/dist/internal/Schema.d.ts.map +1 -1
  218. package/dist/internal/Schema.js +7 -0
  219. package/dist/internal/Schema.js.map +1 -1
  220. package/dist/internal/Webhooks.d.ts.map +1 -1
  221. package/dist/internal/Webhooks.js +3 -3
  222. package/dist/internal/Webhooks.js.map +1 -1
  223. package/package.json +4 -3
  224. package/src/ApiKey.ts +9 -2
  225. package/src/ApiKeys.test.ts +51 -0
  226. package/src/ApiKeys.ts +50 -1
  227. package/src/App.test.ts +33 -86718
  228. package/src/App.ts +18 -0
  229. package/src/Client.test-d.ts +351 -0
  230. package/src/Scope.ts +16 -3
  231. package/src/admin/apps/scopes.test.ts +6 -0
  232. package/src/admin/apps/scopes.ts +3 -0
  233. package/src/admin/ui/src/components/Page.tsx +2 -3
  234. package/src/admin/ui/src/routes/__root.tsx +2 -2
  235. package/src/admin/ui/src/routes/api-keys.tsx +2 -2
  236. package/src/admin/ui.generated.ts +13 -13
  237. package/src/analytics/Analytics.test.ts +527 -0
  238. package/src/analytics/Analytics.ts +318 -0
  239. package/src/analytics/tables/requestEvents.ts +523 -0
  240. package/src/apps/data/App.test.ts +72 -0
  241. package/src/apps/data/App.ts +35 -0
  242. package/src/apps/data/routes/funding.test.ts +214 -0
  243. package/src/apps/data/routes/funding.ts +584 -0
  244. package/src/apps/data/routes/receipts.ts +2 -9
  245. package/src/apps/data/routes/rpc.test.ts +78 -2
  246. package/src/apps/data/routes/rpc.ts +31 -1
  247. package/src/apps/data/routes/webhooks.test.ts +1 -1
  248. package/src/apps/data/routes/webhooks.ts +11 -8
  249. package/src/apps/docs/App.ts +29 -100
  250. package/src/apps/docs/reference.ts +132 -0
  251. package/src/apps/index.ts +1 -0
  252. package/src/apps/mcp.test.ts +206 -0
  253. package/src/apps/mcp.ts +250 -0
  254. package/src/apps/platform/App.ts +43 -4
  255. package/src/apps/platform/Billing.test.ts +530 -0
  256. package/src/apps/platform/Billing.ts +682 -0
  257. package/src/apps/platform/index.ts +1 -0
  258. package/src/apps/platform/routes/api-keys.test.ts +172 -9
  259. package/src/apps/platform/routes/api-keys.ts +136 -20
  260. package/src/apps/platform/routes/billing.test.ts +1100 -0
  261. package/src/apps/platform/routes/billing.ts +966 -0
  262. package/src/apps/platform/routes/invitations.test.ts +55 -7
  263. package/src/apps/platform/routes/invitations.ts +68 -0
  264. package/src/apps/platform/routes/me.test.ts +230 -0
  265. package/src/apps/platform/routes/orgs.ts +26 -4
  266. package/src/apps/platform/routes/scopes.test.ts +29 -0
  267. package/src/apps/platform/routes/scopes.ts +85 -0
  268. package/src/apps/platform/routes/usage.test.ts +422 -0
  269. package/src/apps/platform/routes/usage.ts +527 -0
  270. package/src/apps/relay/App.test.ts +457 -8
  271. package/src/apps/relay/App.ts +120 -12
  272. package/src/apps/relay/Sponsorships.test.ts +1 -1
  273. package/src/apps/relay/Sponsorships.ts +2 -1
  274. package/src/cli/Cli.test.ts +25 -2
  275. package/src/cli/Cli.ts +17 -2
  276. package/src/cli/commands/admin.test.ts +83 -0
  277. package/src/cli/commands/admin.ts +89 -1
  278. package/src/db/Db.ts +137 -0
  279. package/src/db/Schema.ts +104 -2
  280. package/src/db/tables/billingSettings.test.ts +87 -0
  281. package/src/db/tables/billingSettings.ts +108 -0
  282. package/src/db/tables/invitations.ts +2 -2
  283. package/src/db/tables/organizations.test.ts +1 -1
  284. package/src/db/tables/organizations.ts +15 -5
  285. package/src/db/tables/projects.ts +2 -2
  286. package/src/db/tables/requestUsage.ts +231 -0
  287. package/src/db/tables/sponsoredTransactions.test.ts +108 -1
  288. package/src/db/tables/sponsoredTransactions.ts +230 -2
  289. package/src/db/tables/stripeCustomers.test.ts +109 -0
  290. package/src/db/tables/stripeCustomers.ts +162 -0
  291. package/src/db/tables/users.ts +2 -2
  292. package/src/handlers/internal/sponsorship.ts +34 -7
  293. package/src/handlers/internal/utils.ts +19 -7
  294. package/src/index.ts +1 -0
  295. package/src/internal/Auth.test.ts +175 -25
  296. package/src/internal/Auth.ts +175 -86
  297. package/src/internal/Cache.ts +5 -1
  298. package/src/internal/EdgeCache.test.ts +27 -4
  299. package/src/internal/EdgeCache.ts +47 -9
  300. package/src/internal/Fees.test.ts +32 -0
  301. package/src/internal/Fees.ts +51 -0
  302. package/src/internal/FundingRoutes.ts +583 -0
  303. package/src/internal/Id.test.ts +17 -0
  304. package/src/internal/Id.ts +24 -0
  305. package/src/internal/Log.test.ts +1 -0
  306. package/src/internal/Log.ts +5 -0
  307. package/src/internal/OpenApi.ts +12 -1
  308. package/src/internal/RateLimit.test.ts +84 -0
  309. package/src/internal/RateLimit.ts +70 -0
  310. package/src/internal/Response.ts +1 -1
  311. package/src/internal/Schema.ts +8 -0
  312. package/src/internal/Webhooks.test.ts +3 -3
  313. package/src/internal/Webhooks.ts +3 -3
@@ -0,0 +1,477 @@
1
+ import { Hash, Hex, Value } from 'ox';
2
+ import * as ApiKeys from '../../ApiKeys.js';
3
+ import * as Db from '../../db/Db.js';
4
+ import * as Fees from '../../internal/Fees.js';
5
+ import * as RequestUsage from '../../db/tables/requestUsage.js';
6
+ import * as SponsoredTransactions from '../../db/tables/sponsoredTransactions.js';
7
+ import * as StripeCustomers from '../../db/tables/stripeCustomers.js';
8
+ import * as Viem from '../../internal/Viem.js';
9
+ /**
10
+ * Whether the organization has any active billing source — the production
11
+ * sponsorship gate's read. Storage stays one table per source; this resolver
12
+ * is the union across them (Stripe today).
13
+ *
14
+ * @param db - The database.
15
+ * @param orgId - The organization id (`org_…`).
16
+ * @returns Whether any billing source is active.
17
+ */
18
+ export async function active(db, orgId, environment = 'production') {
19
+ return (await status(db, orgId, environment)) === 'active';
20
+ }
21
+ /**
22
+ * The organization's billing status derived from its stored billing source,
23
+ * or undefined when it has none. The sponsorship gate maps non-`active`
24
+ * statuses to distinct refusal reasons.
25
+ *
26
+ * @param db - The database.
27
+ * @param orgId - The organization id (`org_…`).
28
+ * @returns The stored status, or undefined.
29
+ */
30
+ export async function status(db, orgId, environment = 'production') {
31
+ const record = await StripeCustomers.get(db, orgId, environment);
32
+ return record?.status;
33
+ }
34
+ /**
35
+ * Converts a decimal currency string (e.g. `'0.50'`) to fee-token base units.
36
+ *
37
+ * @param amount - The decimal string; at most {@link Fees.tokenDecimals} fraction digits.
38
+ * @returns The amount in base units.
39
+ */
40
+ export function toBaseUnits(amount) {
41
+ return Value.from(amount, Fees.tokenDecimals);
42
+ }
43
+ /**
44
+ * Converts fee-token base units to a decimal currency string with trailing
45
+ * zeros trimmed (e.g. `350000n` → `'0.35'`).
46
+ *
47
+ * @param units - The amount in base units.
48
+ * @returns The decimal string.
49
+ */
50
+ export function fromBaseUnits(units) {
51
+ return Value.format(units, Fees.tokenDecimals);
52
+ }
53
+ /**
54
+ * Start of the limit window containing `now` (ISO 8601); `month` is the UTC
55
+ * calendar month.
56
+ *
57
+ * @param period - The configured window.
58
+ * @param now - Reference time; defaults to now.
59
+ * @returns The window start.
60
+ */
61
+ export function periodStart(period, now = new Date()) {
62
+ // Single-member today; a switch lands with the second period.
63
+ void period;
64
+ return new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), 1)).toISOString();
65
+ }
66
+ /**
67
+ * The metered dimensions and their unit economics. A price pins cents per meter
68
+ * unit; changing them ships a new versioned `lookupKey`, never a mutated price.
69
+ */
70
+ export const meters = {
71
+ apiRequests: {
72
+ displayName: 'API Requests',
73
+ eventName: 'api_request_count',
74
+ lookupKey: 'api-request-count-v1',
75
+ // $0.0001/request → 0.01¢ per unit; the meter value is the integer request count.
76
+ unitAmountDecimal: '0.01',
77
+ },
78
+ feePayerSpend: {
79
+ displayName: 'Sponsor Usage',
80
+ eventName: 'fee_payer_spend',
81
+ lookupKey: 'fee-payer-spend-v1',
82
+ // Meter values are 6-decimal base units: 100¢ per 1e6 units.
83
+ unitAmountDecimal: '0.0001',
84
+ },
85
+ };
86
+ /**
87
+ * The metered dimensions billed in an environment. Production bills sponsorship
88
+ * spend and request counts; sandbox bills request counts only.
89
+ *
90
+ * @param environment - The environment.
91
+ * @returns The metered dimensions for that environment.
92
+ */
93
+ export function kindsFor(environment) {
94
+ return environment === 'production' ? ['feePayerSpend', 'apiRequests'] : ['apiRequests'];
95
+ }
96
+ /** Back-compat: the fee-payer meter event name. */
97
+ export const meterEventName = meters.feePayerSpend.eventName;
98
+ /** Back-compat: the fee-payer metered price lookup key. */
99
+ export const priceLookupKey = meters.feePayerSpend.lookupKey;
100
+ /** Fixture promises memoized per client, per kind; a failed ensure retries on the next call. */
101
+ const fixturesByClient = new WeakMap();
102
+ /**
103
+ * Ensures the account-level metering fixtures exist for a kind: its meter and
104
+ * metered monthly price. Idempotent by lookup (meter `event_name`, price
105
+ * `lookup_key`) and memoized per `(client, kind)`.
106
+ *
107
+ * @param stripe - The Stripe client.
108
+ * @param kind - The metered dimension; defaults to fee-payer spend.
109
+ * @returns The fixture ids.
110
+ */
111
+ export function ensureFixtures(stripe, kind = 'feePayerSpend') {
112
+ let byKind = fixturesByClient.get(stripe);
113
+ if (!byKind) {
114
+ byKind = new Map();
115
+ fixturesByClient.set(stripe, byKind);
116
+ }
117
+ const pending = byKind.get(kind);
118
+ if (pending)
119
+ return pending;
120
+ const descriptor = meters[kind];
121
+ const created = (async () => {
122
+ const meterList = await stripe.billing.meters.list({ limit: 100, status: 'active' });
123
+ const meter = meterList.data.find((meter) => meter.event_name === descriptor.eventName) ??
124
+ (await stripe.billing.meters.create({
125
+ customer_mapping: { event_payload_key: 'stripe_customer_id', type: 'by_id' },
126
+ default_aggregation: { formula: 'sum' },
127
+ display_name: descriptor.displayName,
128
+ event_name: descriptor.eventName,
129
+ value_settings: { event_payload_key: 'value' },
130
+ }));
131
+ const prices = await stripe.prices.list({ limit: 1, lookup_keys: [descriptor.lookupKey] });
132
+ const price = prices.data[0] ??
133
+ (await stripe.prices.create({
134
+ billing_scheme: 'per_unit',
135
+ currency: 'usd',
136
+ lookup_key: descriptor.lookupKey,
137
+ product_data: { name: descriptor.displayName },
138
+ recurring: { interval: 'month', meter: meter.id, usage_type: 'metered' },
139
+ unit_amount_decimal: descriptor.unitAmountDecimal,
140
+ }));
141
+ return { meterId: meter.id, priceId: price.id };
142
+ })();
143
+ byKind.set(kind, created);
144
+ created.catch(() => byKind.delete(kind));
145
+ return created;
146
+ }
147
+ /** Subscription statuses that no longer bill; a new subscription must be created. */
148
+ const terminalStatuses = ['canceled', 'incomplete_expired'];
149
+ /**
150
+ * Ensures the customer holds exactly one live subscription carrying one metered
151
+ * item per requested {@link MeterKind}, creating the subscription or adding
152
+ * missing items as needed. Metered usage bills the customer's default payment
153
+ * method monthly.
154
+ *
155
+ * Fail-closed on more than one live managed subscription: duplicates would
156
+ * double-bill the same meter usage, so the caller must reconcile manually.
157
+ *
158
+ * @param stripe - The Stripe client.
159
+ * @param customerId - The Stripe customer id.
160
+ * @param kinds - The metered dimensions to ensure; defaults to fee-payer spend.
161
+ * @returns The per-kind creation state and whether a subscription was created.
162
+ */
163
+ export async function ensureSubscription(stripe, customerId, kinds = ['feePayerSpend']) {
164
+ const requested = kinds.length ? kinds : ['feePayerSpend'];
165
+ // Resolve every requested kind's price; managed prices are what we reconcile.
166
+ const fixtures = new Map();
167
+ for (const kind of requested)
168
+ fixtures.set(kind, await ensureFixtures(stripe, kind));
169
+ const priceToKind = new Map();
170
+ for (const [kind, fixture] of fixtures)
171
+ priceToKind.set(fixture.priceId, kind);
172
+ const subscriptions = await stripe.subscriptions.list({
173
+ customer: customerId,
174
+ limit: 100,
175
+ status: 'all',
176
+ });
177
+ const liveManaged = subscriptions.data.filter((subscription) => !terminalStatuses.includes(subscription.status) &&
178
+ subscription.items.data.some((item) => priceToKind.has(item.price.id)));
179
+ if (liveManaged.length > 1)
180
+ throw new DuplicateSubscriptionError(customerId);
181
+ const items = {};
182
+ const subscription = liveManaged[0];
183
+ if (subscription) {
184
+ const present = new Set(subscription.items.data
185
+ .map((item) => priceToKind.get(item.price.id))
186
+ .filter((kind) => kind !== undefined));
187
+ for (const kind of requested) {
188
+ if (present.has(kind)) {
189
+ items[kind] = { created: false };
190
+ continue;
191
+ }
192
+ // Add the missing item; the idempotency key absorbs concurrent adds.
193
+ await stripe.subscriptionItems.create({ price: fixtures.get(kind).priceId, subscription: subscription.id }, { idempotencyKey: `${customerId}-item-${meters[kind].lookupKey}` });
194
+ items[kind] = { created: true };
195
+ }
196
+ return { created: false, items };
197
+ }
198
+ // The idempotency key absorbs concurrent activations: a duplicate metered
199
+ // subscription would double-bill the same meter usage.
200
+ await stripe.subscriptions.create({
201
+ collection_method: 'charge_automatically',
202
+ customer: customerId,
203
+ items: requested.map((kind) => ({ price: fixtures.get(kind).priceId })),
204
+ }, { idempotencyKey: `${customerId}-metered-sub-v2` });
205
+ for (const kind of requested)
206
+ items[kind] = { created: true };
207
+ return { created: true, items };
208
+ }
209
+ /** More than one live managed subscription for a customer; requires manual reconcile. */
210
+ export class DuplicateSubscriptionError extends Error {
211
+ constructor(customerId) {
212
+ super(`multiple live metered subscriptions for customer ${customerId}`);
213
+ this.name = 'Billing.DuplicateSubscriptionError';
214
+ }
215
+ }
216
+ /**
217
+ * Creates the metering job: each tick reports finalized, unreported billable
218
+ * mainnet spend to the Stripe meter and marks rows reported. A host runtime
219
+ * drives {@link createReporter.Reporter.tick} on a timer, like the
220
+ * sponsorship finalizer.
221
+ */
222
+ export function createReporter(options) {
223
+ const { batchSize = 100, chainIds = [Viem.chainId.mainnet], db, stripe } = options;
224
+ return {
225
+ async tick() {
226
+ // Resolve per tick so Workers factories build a fresh Hyperdrive-pooled
227
+ // connection each run.
228
+ const database = Db.get(db);
229
+ const rows = await SponsoredTransactions.listUnreported(database, {
230
+ chainIds,
231
+ limit: batchSize,
232
+ });
233
+ // One customer lookup and one subscription ensure per org per tick.
234
+ const customers = new Map();
235
+ const subscriptions = new Map();
236
+ let failed = 0;
237
+ let reported = 0;
238
+ let skipped = 0;
239
+ for (const row of rows) {
240
+ // One poisoned row must not stall the queue: it stays unmarked for
241
+ // retry while the rest keep reporting.
242
+ try {
243
+ let customer = customers.get(row.orgId);
244
+ if (!customers.has(row.orgId)) {
245
+ customer = await StripeCustomers.get(database, row.orgId);
246
+ customers.set(row.orgId, customer);
247
+ }
248
+ if (customer && customer.status !== 'canceled') {
249
+ // Self-heal: guarantee the metered subscription before reporting;
250
+ // meter events without one never reach an invoice. Pass the full
251
+ // production kind set so concurrent creates share idempotency.
252
+ let subscription = subscriptions.get(row.orgId);
253
+ if (!subscription) {
254
+ subscription = await ensureSubscription(stripe, customer.stripeCustomerId, kindsFor('production'));
255
+ subscriptions.set(row.orgId, subscription);
256
+ }
257
+ // Meter timestamps must fall inside Stripe's 35-day ingestion
258
+ // window; older backlog bills into the current period instead. A
259
+ // just-created fee-payer item bills nothing before its start, so
260
+ // its backlog stamps at now too.
261
+ const finalizedAt = new Date(row.finalizedAt).getTime();
262
+ const recent = Date.now() - finalizedAt < 34 * 24 * 60 * 60 * 1000;
263
+ const stamp = recent && !subscription.items.feePayerSpend?.created;
264
+ // The row id makes short-window retries idempotent on Stripe's
265
+ // side; `meter_reported_at` is the durable exactly-once guard.
266
+ await stripe.billing.meterEvents.create({
267
+ event_name: meterEventName,
268
+ identifier: row.id,
269
+ payload: { stripe_customer_id: customer.stripeCustomerId, value: row.feeAmount },
270
+ ...(stamp ? { timestamp: Math.floor(finalizedAt / 1000) } : {}),
271
+ });
272
+ reported++;
273
+ }
274
+ else {
275
+ // Deleted orgs and Stripe-deleted (canceled) customers keep their
276
+ // ledger rows; nobody remains to invoice.
277
+ skipped++;
278
+ }
279
+ // Mark only after the Stripe ack (or a definitive no-customer skip).
280
+ await SponsoredTransactions.markReported(database, row.id, new Date().toISOString());
281
+ }
282
+ catch (error) {
283
+ failed++;
284
+ console.error(`Billing.createReporter: reporting row ${row.id} failed`, error);
285
+ }
286
+ }
287
+ return { failed, reported, skipped };
288
+ },
289
+ };
290
+ }
291
+ /** Default settlement delay: only seal buckets older than this, absorbing normal ingest lag. */
292
+ const defaultSettlementDelayMs = 15 * 60 * 1000;
293
+ /** Default correction window: how far back a tick reconciles late-arriving deltas. */
294
+ const defaultWindowMs = 48 * 60 * 60 * 1000;
295
+ /** One hour in milliseconds. */
296
+ const hourMs = 60 * 60 * 1000;
297
+ /**
298
+ * Creates the request-metered billing job: each tick reports deduped billable
299
+ * request counts to the `api_request_count` meter, per environment, using that
300
+ * environment's Stripe client. Exactly-once from the request analytics stream
301
+ * via a Postgres outbox with frozen counts:
302
+ *
303
+ * - Deduped counts come from `request_events` (`uniqExact(request_id)`), never
304
+ * a raw `count()`, so queue retries never over-bill.
305
+ * - Sandbox rows bill only when billing was active at request time
306
+ * (`billing_active = 1`); production rows always bill.
307
+ * - Each tick first re-sends any `pending` events (crash recovery, idempotent
308
+ * on `identifier`), then seals new additive deltas for buckets older than the
309
+ * settlement delay whose count has grown since the last report.
310
+ *
311
+ * A host runtime drives {@link createRequestUsageReporter.Reporter.tick} on a
312
+ * timer, like the fee-payer meter reporter.
313
+ */
314
+ export function createRequestUsageReporter(options) {
315
+ const { db, now = () => Date.now(), readCounts, sandboxStripe, settlementDelayMs = defaultSettlementDelayMs, stripe, windowMs = defaultWindowMs, } = options;
316
+ const clients = [
317
+ { client: stripe, environment: 'production' },
318
+ ...(sandboxStripe ? [{ client: sandboxStripe, environment: 'sandbox' }] : []),
319
+ ];
320
+ return {
321
+ async tick() {
322
+ const database = Db.get(db);
323
+ let failed = 0;
324
+ let reported = 0;
325
+ let skipped = 0;
326
+ for (const { client, environment } of clients) {
327
+ const nowMs = now();
328
+ const sealCutoff = startOfHour(nowMs - settlementDelayMs);
329
+ const windowStart = new Date(new Date(sealCutoff).getTime() - windowMs).toISOString();
330
+ // Pass A — crash recovery: re-send frozen pending events. Idempotent on
331
+ // `identifier` within Stripe's dedup window; the minutely cadence
332
+ // re-marks well inside it. Buckets that still fail stay blocked so the
333
+ // seal pass never stacks a second delta on them.
334
+ const blocked = new Set();
335
+ for (const event of await RequestUsage.listPending(database, environment)) {
336
+ try {
337
+ await client.billing.meterEvents.create({
338
+ event_name: meters.apiRequests.eventName,
339
+ identifier: event.identifier,
340
+ payload: {
341
+ stripe_customer_id: event.stripeCustomerId,
342
+ value: String(event.deltaCount),
343
+ },
344
+ });
345
+ if (await RequestUsage.settle(database, event.identifier, new Date().toISOString()))
346
+ reported++;
347
+ }
348
+ catch (error) {
349
+ failed++;
350
+ blocked.add(bucketKey(event.orgId, event.bucketStart));
351
+ await RequestUsage.markError(database, event.identifier, String(error));
352
+ }
353
+ }
354
+ // Pass B — seal new deltas for closed buckets whose count has grown.
355
+ const counts = await readCounts({ environment, from: windowStart, to: sealCutoff });
356
+ const customers = new Map();
357
+ const subscriptions = new Map();
358
+ for (const { bucketStart, count, orgId } of counts) {
359
+ const key = { bucketStart, environment, orgId };
360
+ if (blocked.has(bucketKey(orgId, bucketStart)))
361
+ continue;
362
+ try {
363
+ const watermark = await RequestUsage.getBucket(database, key);
364
+ const delta = count - (watermark?.reportedCount ?? 0);
365
+ if (delta <= 0)
366
+ continue;
367
+ let customer = customers.get(orgId);
368
+ if (!customers.has(orgId)) {
369
+ customer = await StripeCustomers.get(database, orgId, environment);
370
+ customers.set(orgId, customer);
371
+ }
372
+ if (!customer || customer.status === 'canceled') {
373
+ skipped++;
374
+ continue;
375
+ }
376
+ let subscription = subscriptions.get(orgId);
377
+ if (!subscription) {
378
+ subscription = await ensureSubscription(client, customer.stripeCustomerId, kindsFor(environment));
379
+ subscriptions.set(orgId, subscription);
380
+ }
381
+ const sequence = await RequestUsage.countReported(database, key);
382
+ const identifier = usageIdentifier(environment, orgId, bucketStart, sequence);
383
+ const inserted = await RequestUsage.insertPending(database, {
384
+ ...key,
385
+ deltaCount: delta,
386
+ identifier,
387
+ sequence,
388
+ stripeCustomerId: customer.stripeCustomerId,
389
+ });
390
+ // A concurrent tick already claimed this delta; leave it to that run.
391
+ if (!inserted)
392
+ continue;
393
+ // Backdate to the bucket hour unless the item was just created (it
394
+ // bills nothing before its start, so its backlog stamps at now).
395
+ const stamp = !subscription.items.apiRequests?.created;
396
+ await client.billing.meterEvents.create({
397
+ event_name: meters.apiRequests.eventName,
398
+ identifier,
399
+ payload: { stripe_customer_id: customer.stripeCustomerId, value: String(delta) },
400
+ ...(stamp ? { timestamp: Math.floor(new Date(bucketStart).getTime() / 1000) } : {}),
401
+ });
402
+ if (await RequestUsage.settle(database, identifier, new Date().toISOString()))
403
+ reported++;
404
+ }
405
+ catch (error) {
406
+ failed++;
407
+ console.error(`Billing.createRequestUsageReporter: reporting ${environment} bucket ${orgId}/${bucketStart} failed`, error);
408
+ }
409
+ }
410
+ }
411
+ return { failed, reported, skipped };
412
+ },
413
+ };
414
+ }
415
+ /** Composite key for the in-tick blocked-bucket set. */
416
+ function bucketKey(orgId, bucketStart) {
417
+ return `${orgId}|${bucketStart}`;
418
+ }
419
+ /** Start of the UTC hour containing `ms` (ISO 8601). */
420
+ function startOfHour(ms) {
421
+ return new Date(Math.floor(ms / hourMs) * hourMs).toISOString();
422
+ }
423
+ /**
424
+ * Deterministic meter-event identifier, bounded under Stripe's 100-char limit:
425
+ * `rq_${env}_${sha(orgId)[:12]}_${bucketEpochHour}_${sequence}`.
426
+ */
427
+ function usageIdentifier(environment, orgId, bucketStart, sequence) {
428
+ const hash = Hash.keccak256(Hex.fromString(orgId)).slice(2, 14);
429
+ const epochHour = Math.floor(new Date(bucketStart).getTime() / hourMs);
430
+ return `rq_${environment}_${hash}_${epochHour}_${sequence}`;
431
+ }
432
+ /**
433
+ * Every organization's billing-active flag in an environment — the driver set
434
+ * for reconciling cached snapshots against this table. Provider-agnostic seam:
435
+ * callers reconcile against `{ orgId, active }`, never the Stripe source shape.
436
+ *
437
+ * @param db - The database.
438
+ * @param environment - The environment to enumerate.
439
+ * @returns One `{ orgId, active }` per billing source in the environment.
440
+ */
441
+ export async function listActive(db, environment) {
442
+ const records = await StripeCustomers.listByEnvironment(db, environment);
443
+ return records.map((record) => ({ active: record.status === 'active', orgId: record.orgId }));
444
+ }
445
+ /**
446
+ * Creates the snapshot reconciler: each tick re-stamps the `billingActive`
447
+ * flag cached on API-key records from the authoritative billing table, so a
448
+ * missed or failed webhook re-sync self-heals within a tick. A host runtime
449
+ * drives {@link createKeyBillingSyncer.Syncer.tick} on a timer, like the meter
450
+ * reporter. Off the request path, so the auth hot path never reads billing.
451
+ *
452
+ * Only environments where keys carry a billing snapshot are reconciled
453
+ * (sandbox today); production keys carry none.
454
+ */
455
+ export function createKeyBillingSyncer(options) {
456
+ const { db, environments = ['sandbox'], kv } = options;
457
+ return {
458
+ async tick() {
459
+ // Resolve per tick so Workers factories build a fresh Hyperdrive-pooled
460
+ // connection each run.
461
+ const database = Db.get(db);
462
+ let checked = 0;
463
+ let updated = 0;
464
+ for (const environment of environments) {
465
+ const rows = await listActive(database, environment);
466
+ for (const { active, orgId } of rows) {
467
+ checked += 1;
468
+ // `setBillingActive` writes only drifted records, so a converged
469
+ // fleet costs list reads and no writes.
470
+ updated += await ApiKeys.setBillingActive(kv, { active, environment, orgId });
471
+ }
472
+ }
473
+ return { checked, updated };
474
+ },
475
+ };
476
+ }
477
+ //# sourceMappingURL=Billing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Billing.js","sourceRoot":"","sources":["../../../src/apps/platform/Billing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,IAAI,CAAA;AAIrC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAE3C,OAAO,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACpC,OAAO,KAAK,IAAI,MAAM,wBAAwB,CAAA;AAC9C,OAAO,KAAK,YAAY,MAAM,iCAAiC,CAAA;AAC/D,OAAO,KAAK,qBAAqB,MAAM,0CAA0C,CAAA;AACjF,OAAO,KAAK,eAAe,MAAM,oCAAoC,CAAA;AACrE,OAAO,KAAK,IAAI,MAAM,wBAAwB,CAAA;AAE9C;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,EAAS,EACT,KAAa,EACb,WAAW,GAA0C,YAAY;IAEjE,OAAO,CAAC,MAAM,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC,KAAK,QAAQ,CAAA;AAC5D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,EAAS,EACT,KAAa,EACb,WAAW,GAA0C,YAAY;IAEjE,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,CAAA;IAChE,OAAO,MAAM,EAAE,MAAM,C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AAQ,EAAE,WAAW,CAAC,CAAA;gBACpD,KAAK,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC;oBACrC,OAAO,IAAI,CAAC,CAAA;oBACZ,iEAAiE;oBACjE,wCAAwC;oBACxC,OAAO,IAAI,MAAM,OAAO,CAAC,gBAAgB,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAA;gBAC/E,CAAC;YACH,CAAC;YACD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA;QAC7B,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export { platform } from './App.js';
2
+ export * as Billing from './Billing.js';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/apps/platform/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/apps/platform/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA"}
@@ -1,2 +1,3 @@
1
1
  export { platform } from './App.js';
2
+ export * as Billing from './Billing.js';
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/apps/platform/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/apps/platform/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA"}