@pithy-sh/payments 0.1.1 → 0.1.3

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 (402) hide show
  1. package/dist/admin/coverage.d.ts +35 -0
  2. package/dist/admin/coverage.d.ts.map +1 -0
  3. package/dist/admin/coverage.js +56 -0
  4. package/dist/admin/read.d.ts +222 -0
  5. package/dist/admin/read.d.ts.map +1 -0
  6. package/dist/admin/read.js +159 -0
  7. package/dist/audit/actions.d.ts +211 -0
  8. package/dist/audit/actions.d.ts.map +1 -0
  9. package/dist/audit/actions.js +211 -0
  10. package/dist/capability.d.ts +72 -0
  11. package/dist/capability.d.ts.map +1 -0
  12. package/dist/capability.js +228 -0
  13. package/dist/client/api.d.ts +435 -0
  14. package/dist/client/api.d.ts.map +1 -0
  15. package/dist/client/api.js +415 -0
  16. package/dist/client/checkout.d.ts +144 -0
  17. package/dist/client/checkout.d.ts.map +1 -0
  18. package/dist/client/checkout.js +173 -0
  19. package/dist/client/fixtures/price-preview-de.js +89 -0
  20. package/dist/client/fixtures/price-preview-gb.js +89 -0
  21. package/dist/client/fixtures/price-preview-jp-yen.js +89 -0
  22. package/dist/client/fixtures/price-preview-us-country-only.js +89 -0
  23. package/dist/client/fixtures/price-preview-us-new-york.js +89 -0
  24. package/dist/client/fixtures/pricePreview.d.ts +54 -0
  25. package/dist/client/fixtures/pricePreview.d.ts.map +1 -0
  26. package/dist/client/fixtures/pricePreview.js +61 -0
  27. package/dist/client/hooks.d.ts +235 -0
  28. package/dist/client/hooks.d.ts.map +1 -0
  29. package/dist/client/hooks.js +428 -0
  30. package/dist/client/paddle.d.ts +433 -0
  31. package/dist/client/paddle.d.ts.map +1 -0
  32. package/dist/client/paddle.js +391 -0
  33. package/dist/client/paddleCache.d.ts +123 -0
  34. package/dist/client/paddleCache.d.ts.map +1 -0
  35. package/dist/client/paddleCache.js +159 -0
  36. package/dist/client/paddlePrices.d.ts +94 -0
  37. package/dist/client/paddlePrices.d.ts.map +1 -0
  38. package/dist/client/paddlePrices.js +55 -0
  39. package/dist/client/paddlePricesTag.d.ts +127 -0
  40. package/dist/client/paddlePricesTag.d.ts.map +1 -0
  41. package/dist/client/paddlePricesTag.js +207 -0
  42. package/dist/client/projection.d.ts +128 -0
  43. package/dist/client/projection.d.ts.map +1 -0
  44. package/dist/client/projection.js +0 -0
  45. package/dist/client/test-utils/cacheStore.d.ts +18 -0
  46. package/dist/client/test-utils/cacheStore.d.ts.map +1 -0
  47. package/dist/client/test-utils/cacheStore.js +42 -0
  48. package/dist/client/wholeUnits.d.ts +18 -0
  49. package/dist/client/wholeUnits.d.ts.map +1 -0
  50. package/dist/client/wholeUnits.js +120 -0
  51. package/dist/config/config.d.ts +238 -0
  52. package/dist/config/config.d.ts.map +1 -0
  53. package/dist/config/config.js +249 -0
  54. package/dist/data/discount.d.ts +127 -0
  55. package/dist/data/discount.d.ts.map +1 -0
  56. package/dist/data/discount.js +91 -0
  57. package/dist/data/entitlement.d.ts +43 -0
  58. package/dist/data/entitlement.d.ts.map +1 -0
  59. package/dist/data/entitlement.js +43 -0
  60. package/dist/data/money.d.ts +15 -0
  61. package/dist/data/money.d.ts.map +1 -0
  62. package/dist/data/money.js +76 -0
  63. package/dist/data/pause.d.ts +133 -0
  64. package/dist/data/pause.d.ts.map +1 -0
  65. package/dist/data/pause.js +63 -0
  66. package/dist/data/providerAccount.d.ts +40 -0
  67. package/dist/data/providerAccount.d.ts.map +1 -0
  68. package/dist/data/providerAccount.js +34 -0
  69. package/dist/data/purchase.d.ts +107 -0
  70. package/dist/data/purchase.d.ts.map +1 -0
  71. package/dist/data/purchase.js +77 -0
  72. package/dist/data/rail.d.ts +74 -0
  73. package/dist/data/rail.d.ts.map +1 -0
  74. package/dist/data/rail.js +74 -0
  75. package/dist/data/reconcileRun.d.ts +120 -0
  76. package/dist/data/reconcileRun.d.ts.map +1 -0
  77. package/dist/data/reconcileRun.js +120 -0
  78. package/dist/data/renderMoney.d.ts +85 -0
  79. package/dist/data/renderMoney.d.ts.map +1 -0
  80. package/dist/data/renderMoney.js +146 -0
  81. package/dist/data/status.d.ts +58 -0
  82. package/dist/data/status.d.ts.map +1 -0
  83. package/dist/data/status.js +68 -0
  84. package/dist/data/subject.d.ts +111 -0
  85. package/dist/data/subject.d.ts.map +1 -0
  86. package/dist/data/subject.js +125 -0
  87. package/dist/data/subscription.d.ts +624 -0
  88. package/dist/data/subscription.d.ts.map +1 -0
  89. package/dist/data/subscription.js +497 -0
  90. package/dist/data/syncCursor.d.ts +33 -0
  91. package/dist/data/syncCursor.d.ts.map +1 -0
  92. package/dist/data/syncCursor.js +29 -0
  93. package/dist/data/tables.d.ts +37 -0
  94. package/dist/data/tables.d.ts.map +1 -0
  95. package/dist/data/tables.js +44 -0
  96. package/dist/data/webhookEvent.d.ts +134 -0
  97. package/dist/data/webhookEvent.d.ts.map +1 -0
  98. package/dist/data/webhookEvent.js +128 -0
  99. package/dist/entitlement/manual.d.ts +101 -0
  100. package/dist/entitlement/manual.d.ts.map +1 -0
  101. package/dist/entitlement/manual.js +84 -0
  102. package/dist/entitlement/resolver.d.ts +60 -0
  103. package/dist/entitlement/resolver.d.ts.map +1 -0
  104. package/dist/entitlement/resolver.js +101 -0
  105. package/dist/entitlement/subjectSeam.d.ts +102 -0
  106. package/dist/entitlement/subjectSeam.d.ts.map +1 -0
  107. package/dist/entitlement/subjectSeam.js +85 -0
  108. package/dist/error/errors.d.ts +247 -0
  109. package/dist/error/errors.d.ts.map +1 -0
  110. package/dist/error/errors.js +326 -0
  111. package/dist/grants/apply.d.ts +74 -0
  112. package/dist/grants/apply.d.ts.map +1 -0
  113. package/dist/grants/apply.js +148 -0
  114. package/dist/grants/clawback.d.ts +43 -0
  115. package/dist/grants/clawback.d.ts.map +1 -0
  116. package/dist/grants/clawback.js +71 -0
  117. package/dist/grants/ledgerSeam.d.ts +89 -0
  118. package/dist/grants/ledgerSeam.d.ts.map +1 -0
  119. package/dist/grants/ledgerSeam.js +66 -0
  120. package/dist/http/dispatch.d.ts +35 -0
  121. package/dist/http/dispatch.d.ts.map +1 -0
  122. package/dist/http/dispatch.js +40 -0
  123. package/dist/http/guards.d.ts +43 -0
  124. package/dist/http/guards.d.ts.map +1 -0
  125. package/dist/http/guards.js +52 -0
  126. package/dist/http/manifestConfig.d.ts +38 -0
  127. package/dist/http/manifestConfig.d.ts.map +1 -0
  128. package/dist/http/manifestConfig.js +49 -0
  129. package/dist/http/responses.d.ts +1455 -0
  130. package/dist/http/responses.d.ts.map +1 -0
  131. package/dist/http/responses.js +728 -0
  132. package/dist/http/routes.d.ts +315 -0
  133. package/dist/http/routes.d.ts.map +1 -0
  134. package/dist/http/routes.js +1966 -0
  135. package/dist/http/schemas.d.ts +404 -0
  136. package/dist/http/schemas.d.ts.map +1 -0
  137. package/dist/http/schemas.js +359 -0
  138. package/dist/http/scopes.d.ts +160 -0
  139. package/dist/http/scopes.d.ts.map +1 -0
  140. package/dist/http/scopes.js +240 -0
  141. package/dist/http/view.d.ts +96 -0
  142. package/dist/http/view.d.ts.map +1 -0
  143. package/dist/http/view.js +170 -0
  144. package/dist/http/webhookGuard.d.ts +109 -0
  145. package/dist/http/webhookGuard.d.ts.map +1 -0
  146. package/dist/http/webhookGuard.js +206 -0
  147. package/dist/index.d.ts +64 -0
  148. package/dist/index.d.ts.map +1 -0
  149. package/dist/index.js +43 -0
  150. package/dist/migrations/0001_purchases.d.ts +35 -0
  151. package/dist/migrations/0001_purchases.d.ts.map +1 -0
  152. package/dist/migrations/0001_purchases.js +80 -0
  153. package/dist/pricing/location.d.ts +138 -0
  154. package/dist/pricing/location.d.ts.map +1 -0
  155. package/dist/pricing/location.js +81 -0
  156. package/dist/pricing/visitor.d.ts +56 -0
  157. package/dist/pricing/visitor.d.ts.map +1 -0
  158. package/dist/pricing/visitor.js +35 -0
  159. package/dist/projection/event.d.ts +66 -0
  160. package/dist/projection/event.d.ts.map +1 -0
  161. package/dist/projection/event.js +45 -0
  162. package/dist/projection/orphans.d.ts +114 -0
  163. package/dist/projection/orphans.d.ts.map +1 -0
  164. package/dist/projection/orphans.js +162 -0
  165. package/dist/projection/owner.d.ts +121 -0
  166. package/dist/projection/owner.d.ts.map +1 -0
  167. package/dist/projection/owner.js +114 -0
  168. package/dist/projection/resolve.d.ts +30 -0
  169. package/dist/projection/resolve.d.ts.map +1 -0
  170. package/dist/projection/resolve.js +42 -0
  171. package/dist/projection/writer.d.ts +103 -0
  172. package/dist/projection/writer.d.ts.map +1 -0
  173. package/dist/projection/writer.js +280 -0
  174. package/dist/provision/resolvePaymentsConfig.d.ts +48 -0
  175. package/dist/provision/resolvePaymentsConfig.d.ts.map +1 -0
  176. package/dist/provision/resolvePaymentsConfig.js +41 -0
  177. package/dist/rails/apple/certs.d.ts +7 -0
  178. package/dist/rails/apple/certs.d.ts.map +1 -0
  179. package/dist/rails/apple/certs.js +8 -0
  180. package/dist/rails/apple/der.d.ts +107 -0
  181. package/dist/rails/apple/der.d.ts.map +1 -0
  182. package/dist/rails/apple/der.js +217 -0
  183. package/dist/rails/apple/fixtures/chain.d.ts +117 -0
  184. package/dist/rails/apple/fixtures/chain.d.ts.map +1 -0
  185. package/dist/rails/apple/fixtures/chain.js +289 -0
  186. package/dist/rails/apple/http.d.ts +74 -0
  187. package/dist/rails/apple/http.d.ts.map +1 -0
  188. package/dist/rails/apple/http.js +32 -0
  189. package/dist/rails/apple/jws.d.ts +17 -0
  190. package/dist/rails/apple/jws.d.ts.map +1 -0
  191. package/dist/rails/apple/jws.js +75 -0
  192. package/dist/rails/apple/notification.d.ts +116 -0
  193. package/dist/rails/apple/notification.d.ts.map +1 -0
  194. package/dist/rails/apple/notification.js +199 -0
  195. package/dist/rails/apple/rail.d.ts +25 -0
  196. package/dist/rails/apple/rail.d.ts.map +1 -0
  197. package/dist/rails/apple/rail.js +68 -0
  198. package/dist/rails/apple/serverApi.d.ts +120 -0
  199. package/dist/rails/apple/serverApi.d.ts.map +1 -0
  200. package/dist/rails/apple/serverApi.js +244 -0
  201. package/dist/rails/apple/verify.d.ts +36 -0
  202. package/dist/rails/apple/verify.d.ts.map +1 -0
  203. package/dist/rails/apple/verify.js +46 -0
  204. package/dist/rails/apple/x509.d.ts +85 -0
  205. package/dist/rails/apple/x509.d.ts.map +1 -0
  206. package/dist/rails/apple/x509.js +273 -0
  207. package/dist/rails/contract.d.ts +871 -0
  208. package/dist/rails/contract.d.ts.map +1 -0
  209. package/dist/rails/contract.js +60 -0
  210. package/dist/rails/google/fixtures/push.d.ts +71 -0
  211. package/dist/rails/google/fixtures/push.d.ts.map +1 -0
  212. package/dist/rails/google/fixtures/push.js +107 -0
  213. package/dist/rails/google/http.d.ts +77 -0
  214. package/dist/rails/google/http.d.ts.map +1 -0
  215. package/dist/rails/google/http.js +39 -0
  216. package/dist/rails/google/jwt.d.ts +53 -0
  217. package/dist/rails/google/jwt.d.ts.map +1 -0
  218. package/dist/rails/google/jwt.js +94 -0
  219. package/dist/rails/google/oidc.d.ts +112 -0
  220. package/dist/rails/google/oidc.d.ts.map +1 -0
  221. package/dist/rails/google/oidc.js +179 -0
  222. package/dist/rails/google/playApi.d.ts +188 -0
  223. package/dist/rails/google/playApi.d.ts.map +1 -0
  224. package/dist/rails/google/playApi.js +350 -0
  225. package/dist/rails/google/rail.d.ts +57 -0
  226. package/dist/rails/google/rail.d.ts.map +1 -0
  227. package/dist/rails/google/rail.js +70 -0
  228. package/dist/rails/google/rtdn.d.ts +105 -0
  229. package/dist/rails/google/rtdn.d.ts.map +1 -0
  230. package/dist/rails/google/rtdn.js +179 -0
  231. package/dist/rails/google/verify.d.ts +20 -0
  232. package/dist/rails/google/verify.d.ts.map +1 -0
  233. package/dist/rails/google/verify.js +76 -0
  234. package/dist/rails/lemonSqueezy/api.d.ts +92 -0
  235. package/dist/rails/lemonSqueezy/api.d.ts.map +1 -0
  236. package/dist/rails/lemonSqueezy/api.js +121 -0
  237. package/dist/rails/lemonSqueezy/checkout.d.ts +52 -0
  238. package/dist/rails/lemonSqueezy/checkout.d.ts.map +1 -0
  239. package/dist/rails/lemonSqueezy/checkout.js +84 -0
  240. package/dist/rails/lemonSqueezy/discounts.d.ts +50 -0
  241. package/dist/rails/lemonSqueezy/discounts.d.ts.map +1 -0
  242. package/dist/rails/lemonSqueezy/discounts.js +75 -0
  243. package/dist/rails/lemonSqueezy/fixtures/events.d.ts +56 -0
  244. package/dist/rails/lemonSqueezy/fixtures/events.d.ts.map +1 -0
  245. package/dist/rails/lemonSqueezy/fixtures/events.js +144 -0
  246. package/dist/rails/lemonSqueezy/objects.d.ts +229 -0
  247. package/dist/rails/lemonSqueezy/objects.d.ts.map +1 -0
  248. package/dist/rails/lemonSqueezy/objects.js +379 -0
  249. package/dist/rails/lemonSqueezy/portal.d.ts +35 -0
  250. package/dist/rails/lemonSqueezy/portal.d.ts.map +1 -0
  251. package/dist/rails/lemonSqueezy/portal.js +18 -0
  252. package/dist/rails/lemonSqueezy/pricing.d.ts +25 -0
  253. package/dist/rails/lemonSqueezy/pricing.d.ts.map +1 -0
  254. package/dist/rails/lemonSqueezy/pricing.js +54 -0
  255. package/dist/rails/lemonSqueezy/rail.d.ts +41 -0
  256. package/dist/rails/lemonSqueezy/rail.d.ts.map +1 -0
  257. package/dist/rails/lemonSqueezy/rail.js +67 -0
  258. package/dist/rails/lemonSqueezy/read.d.ts +28 -0
  259. package/dist/rails/lemonSqueezy/read.d.ts.map +1 -0
  260. package/dist/rails/lemonSqueezy/read.js +37 -0
  261. package/dist/rails/lemonSqueezy/refresh.d.ts +42 -0
  262. package/dist/rails/lemonSqueezy/refresh.d.ts.map +1 -0
  263. package/dist/rails/lemonSqueezy/refresh.js +40 -0
  264. package/dist/rails/lemonSqueezy/signature.d.ts +56 -0
  265. package/dist/rails/lemonSqueezy/signature.d.ts.map +1 -0
  266. package/dist/rails/lemonSqueezy/signature.js +92 -0
  267. package/dist/rails/lemonSqueezy/verify.d.ts +33 -0
  268. package/dist/rails/lemonSqueezy/verify.d.ts.map +1 -0
  269. package/dist/rails/lemonSqueezy/verify.js +41 -0
  270. package/dist/rails/lemonSqueezy/webhook.d.ts +53 -0
  271. package/dist/rails/lemonSqueezy/webhook.d.ts.map +1 -0
  272. package/dist/rails/lemonSqueezy/webhook.js +179 -0
  273. package/dist/rails/paddle/adjustments.d.ts +60 -0
  274. package/dist/rails/paddle/adjustments.d.ts.map +1 -0
  275. package/dist/rails/paddle/adjustments.js +66 -0
  276. package/dist/rails/paddle/api.d.ts +138 -0
  277. package/dist/rails/paddle/api.d.ts.map +1 -0
  278. package/dist/rails/paddle/api.js +152 -0
  279. package/dist/rails/paddle/checkout.d.ts +69 -0
  280. package/dist/rails/paddle/checkout.d.ts.map +1 -0
  281. package/dist/rails/paddle/checkout.js +100 -0
  282. package/dist/rails/paddle/discounts.d.ts +67 -0
  283. package/dist/rails/paddle/discounts.d.ts.map +1 -0
  284. package/dist/rails/paddle/discounts.js +73 -0
  285. package/dist/rails/paddle/events.d.ts +140 -0
  286. package/dist/rails/paddle/events.d.ts.map +1 -0
  287. package/dist/rails/paddle/events.js +183 -0
  288. package/dist/rails/paddle/fixtures/browserForged.d.ts +42 -0
  289. package/dist/rails/paddle/fixtures/browserForged.d.ts.map +1 -0
  290. package/dist/rails/paddle/fixtures/browserForged.js +52 -0
  291. package/dist/rails/paddle/fixtures/pausedSubscription.d.ts +78 -0
  292. package/dist/rails/paddle/fixtures/pausedSubscription.d.ts.map +1 -0
  293. package/dist/rails/paddle/fixtures/pausedSubscription.js +76 -0
  294. package/dist/rails/paddle/objects.d.ts +519 -0
  295. package/dist/rails/paddle/objects.d.ts.map +1 -0
  296. package/dist/rails/paddle/objects.js +588 -0
  297. package/dist/rails/paddle/portal.d.ts +45 -0
  298. package/dist/rails/paddle/portal.d.ts.map +1 -0
  299. package/dist/rails/paddle/portal.js +42 -0
  300. package/dist/rails/paddle/rail.d.ts +55 -0
  301. package/dist/rails/paddle/rail.d.ts.map +1 -0
  302. package/dist/rails/paddle/rail.js +117 -0
  303. package/dist/rails/paddle/read.d.ts +53 -0
  304. package/dist/rails/paddle/read.d.ts.map +1 -0
  305. package/dist/rails/paddle/read.js +66 -0
  306. package/dist/rails/paddle/recorded.d.ts +49 -0
  307. package/dist/rails/paddle/recorded.d.ts.map +1 -0
  308. package/dist/rails/paddle/recorded.js +79 -0
  309. package/dist/rails/paddle/refresh.d.ts +54 -0
  310. package/dist/rails/paddle/refresh.d.ts.map +1 -0
  311. package/dist/rails/paddle/refresh.js +94 -0
  312. package/dist/rails/paddle/refund.d.ts +82 -0
  313. package/dist/rails/paddle/refund.d.ts.map +1 -0
  314. package/dist/rails/paddle/refund.js +175 -0
  315. package/dist/rails/paddle/signature.d.ts +83 -0
  316. package/dist/rails/paddle/signature.d.ts.map +1 -0
  317. package/dist/rails/paddle/signature.js +163 -0
  318. package/dist/rails/paddle/subscription.d.ts +137 -0
  319. package/dist/rails/paddle/subscription.d.ts.map +1 -0
  320. package/dist/rails/paddle/subscription.js +538 -0
  321. package/dist/rails/paddle/verify.d.ts +46 -0
  322. package/dist/rails/paddle/verify.d.ts.map +1 -0
  323. package/dist/rails/paddle/verify.js +43 -0
  324. package/dist/rails/paddle/webhook.d.ts +98 -0
  325. package/dist/rails/paddle/webhook.d.ts.map +1 -0
  326. package/dist/rails/paddle/webhook.js +181 -0
  327. package/dist/rails/providers.d.ts +73 -0
  328. package/dist/rails/providers.d.ts.map +1 -0
  329. package/dist/rails/providers.js +62 -0
  330. package/dist/rails/stripe/api.d.ts +118 -0
  331. package/dist/rails/stripe/api.d.ts.map +1 -0
  332. package/dist/rails/stripe/api.js +153 -0
  333. package/dist/rails/stripe/checkout.d.ts +60 -0
  334. package/dist/rails/stripe/checkout.d.ts.map +1 -0
  335. package/dist/rails/stripe/checkout.js +86 -0
  336. package/dist/rails/stripe/discounts.d.ts +50 -0
  337. package/dist/rails/stripe/discounts.d.ts.map +1 -0
  338. package/dist/rails/stripe/discounts.js +87 -0
  339. package/dist/rails/stripe/fixtures/events.d.ts +64 -0
  340. package/dist/rails/stripe/fixtures/events.d.ts.map +1 -0
  341. package/dist/rails/stripe/fixtures/events.js +67 -0
  342. package/dist/rails/stripe/objects.d.ts +237 -0
  343. package/dist/rails/stripe/objects.d.ts.map +1 -0
  344. package/dist/rails/stripe/objects.js +389 -0
  345. package/dist/rails/stripe/portal.d.ts +29 -0
  346. package/dist/rails/stripe/portal.d.ts.map +1 -0
  347. package/dist/rails/stripe/portal.js +41 -0
  348. package/dist/rails/stripe/pricing.d.ts +25 -0
  349. package/dist/rails/stripe/pricing.d.ts.map +1 -0
  350. package/dist/rails/stripe/pricing.js +68 -0
  351. package/dist/rails/stripe/rail.d.ts +28 -0
  352. package/dist/rails/stripe/rail.d.ts.map +1 -0
  353. package/dist/rails/stripe/rail.js +81 -0
  354. package/dist/rails/stripe/refresh.d.ts +33 -0
  355. package/dist/rails/stripe/refresh.d.ts.map +1 -0
  356. package/dist/rails/stripe/refresh.js +21 -0
  357. package/dist/rails/stripe/signature.d.ts +71 -0
  358. package/dist/rails/stripe/signature.d.ts.map +1 -0
  359. package/dist/rails/stripe/signature.js +92 -0
  360. package/dist/rails/stripe/verify.d.ts +15 -0
  361. package/dist/rails/stripe/verify.d.ts.map +1 -0
  362. package/dist/rails/stripe/verify.js +63 -0
  363. package/dist/rails/stripe/webhook.d.ts +26 -0
  364. package/dist/rails/stripe/webhook.d.ts.map +1 -0
  365. package/dist/rails/stripe/webhook.js +31 -0
  366. package/dist/secret/registry.d.ts +192 -0
  367. package/dist/secret/registry.d.ts.map +1 -0
  368. package/dist/secret/registry.js +154 -0
  369. package/dist/seeds/example.d.ts +3 -0
  370. package/dist/seeds/example.d.ts.map +1 -0
  371. package/dist/seeds/example.js +171 -0
  372. package/dist/version.generated.d.ts +5 -0
  373. package/dist/version.generated.d.ts.map +1 -0
  374. package/dist/version.generated.js +7 -0
  375. package/dist/workflows/paddleSweep.d.ts +175 -0
  376. package/dist/workflows/paddleSweep.d.ts.map +1 -0
  377. package/dist/workflows/paddleSweep.js +433 -0
  378. package/dist/workflows/railAccess.d.ts +48 -0
  379. package/dist/workflows/railAccess.d.ts.map +1 -0
  380. package/dist/workflows/railAccess.js +36 -0
  381. package/dist/workflows/reconcile.d.ts +161 -0
  382. package/dist/workflows/reconcile.d.ts.map +1 -0
  383. package/dist/workflows/reconcile.js +352 -0
  384. package/dist/workflows/report.d.ts +28 -0
  385. package/dist/workflows/report.d.ts.map +1 -0
  386. package/dist/workflows/report.js +54 -0
  387. package/dist/workflows/retryPolicy.d.ts +29 -0
  388. package/dist/workflows/retryPolicy.d.ts.map +1 -0
  389. package/dist/workflows/retryPolicy.js +37 -0
  390. package/dist/workflows/specs.d.ts +102 -0
  391. package/dist/workflows/specs.d.ts.map +1 -0
  392. package/dist/workflows/specs.js +84 -0
  393. package/dist/workflows/worker.d.ts +62 -0
  394. package/dist/workflows/worker.d.ts.map +1 -0
  395. package/dist/workflows/worker.js +92 -0
  396. package/dist/workflows/workerConfig.d.ts +46 -0
  397. package/dist/workflows/workerConfig.d.ts.map +1 -0
  398. package/dist/workflows/workerConfig.js +38 -0
  399. package/package.json +22 -13
  400. package/pithy.manifest.json +19 -13
  401. package/src/version.generated.ts +1 -1
  402. package/src/client/paddlePrices.iife.ts +0 -43
@@ -0,0 +1,1455 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * What the payments routes return, as Zod objects a client can validate against.
4
+ *
5
+ * `schemas.ts` bounds what a caller may send; this file states what it gets back. Both halves are
6
+ * runtime values for the same reason: a management client reading a customer's Worker is crossing a
7
+ * trust boundary and must validate what comes back, and a TypeScript interface is erased before it
8
+ * can help — so every client that had only an interface hand-wrote a mirror, and the mirror drifted
9
+ * the first time a field landed here.
10
+ *
11
+ * **No codecs, and no transform anywhere in this file.** These describe JSON on the wire, so parsing
12
+ * one hands back exactly what went in — which is what lets `responses.test.ts` compare a parsed value
13
+ * with the projection's output and fail on a field either side forgot.
14
+ *
15
+ * **Nothing here is a receipt.** `PaymentsPurchase.payload` is the whole verified provider response,
16
+ * and a bearer artifact; the purchase view is the normalized projection of it, and there is no field
17
+ * that carries the original. The webhook responses are deliberately absent from this file too — they
18
+ * are acknowledgements addressed to Apple, Google and Stripe, not a contract offered to any client.
19
+ *
20
+ * **A client's own views name no subject; the management views name both halves of one.** A player reads
21
+ * its own rows, and who holds them is the answer the request already carried — echoing it back teaches a
22
+ * client that the holder is a value in the protocol, which is the first step towards one sending it. A
23
+ * management client reads everybody's, so every row it sees has to say whose it is, and says it as the
24
+ * pair: nothing keeps an organization id from equalling some user's id, so a view carrying the id alone
25
+ * would render one holder's subscription under the other's name.
26
+ *
27
+ * **A field added here later is `.optional()`, not merely `.nullable()`.** This module is read across a
28
+ * version boundary — a management client validates a response with this schema against a customer's
29
+ * Worker at whatever kit version it is on — so an additive required key fails `safeParse` for everyone
30
+ * below that release and takes the whole pane with it (#450). Absent then means *this Worker cannot
31
+ * say*, which is a different fact from `null`.
32
+ */
33
+ /** One entitlement as a client reads it. */
34
+ export declare const PaymentsEntitlementView: z.ZodObject<{
35
+ key: z.ZodString;
36
+ granted: z.ZodBoolean;
37
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
38
+ }, z.core.$strip>;
39
+ export type PaymentsEntitlementView = z.output<typeof PaymentsEntitlementView>;
40
+ /** One purchase as a client may see it — the normalized projection, never the stored provider payload. */
41
+ export declare const PaymentsPurchaseView: z.ZodObject<{
42
+ id: z.ZodString;
43
+ rail: z.ZodEnum<{
44
+ apple: "apple";
45
+ google: "google";
46
+ lemonSqueezy: "lemonSqueezy";
47
+ paddle: "paddle";
48
+ stripe: "stripe";
49
+ }>;
50
+ productId: z.ZodString;
51
+ type: z.ZodEnum<{
52
+ consumable: "consumable";
53
+ non_consumable: "non_consumable";
54
+ subscription: "subscription";
55
+ }>;
56
+ status: z.ZodEnum<{
57
+ active: "active";
58
+ canceled: "canceled";
59
+ expired: "expired";
60
+ in_grace: "in_grace";
61
+ never_paid: "never_paid";
62
+ on_hold: "on_hold";
63
+ paused: "paused";
64
+ refunded: "refunded";
65
+ revoked: "revoked";
66
+ }>;
67
+ environment: z.ZodEnum<{
68
+ production: "production";
69
+ sandbox: "sandbox";
70
+ }>;
71
+ purchasedAt: z.ZodISODateTime;
72
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
73
+ resumesAt: z.ZodNullable<z.ZodISODateTime>;
74
+ outcome: z.ZodEnum<{
75
+ created: "created";
76
+ ignored: "ignored";
77
+ updated: "updated";
78
+ }>;
79
+ }, z.core.$strip>;
80
+ export type PaymentsPurchaseView = z.output<typeof PaymentsPurchaseView>;
81
+ /** `POST {base}/purchases`. */
82
+ export declare const PaymentsPurchaseResponse: z.ZodObject<{
83
+ purchase: z.ZodObject<{
84
+ id: z.ZodString;
85
+ rail: z.ZodEnum<{
86
+ apple: "apple";
87
+ google: "google";
88
+ lemonSqueezy: "lemonSqueezy";
89
+ paddle: "paddle";
90
+ stripe: "stripe";
91
+ }>;
92
+ productId: z.ZodString;
93
+ type: z.ZodEnum<{
94
+ consumable: "consumable";
95
+ non_consumable: "non_consumable";
96
+ subscription: "subscription";
97
+ }>;
98
+ status: z.ZodEnum<{
99
+ active: "active";
100
+ canceled: "canceled";
101
+ expired: "expired";
102
+ in_grace: "in_grace";
103
+ never_paid: "never_paid";
104
+ on_hold: "on_hold";
105
+ paused: "paused";
106
+ refunded: "refunded";
107
+ revoked: "revoked";
108
+ }>;
109
+ environment: z.ZodEnum<{
110
+ production: "production";
111
+ sandbox: "sandbox";
112
+ }>;
113
+ purchasedAt: z.ZodISODateTime;
114
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
115
+ resumesAt: z.ZodNullable<z.ZodISODateTime>;
116
+ outcome: z.ZodEnum<{
117
+ created: "created";
118
+ ignored: "ignored";
119
+ updated: "updated";
120
+ }>;
121
+ }, z.core.$strip>;
122
+ entitlements: z.ZodArray<z.ZodObject<{
123
+ key: z.ZodString;
124
+ granted: z.ZodBoolean;
125
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
126
+ }, z.core.$strip>>;
127
+ }, z.core.$strip>;
128
+ export type PaymentsPurchaseResponse = z.output<typeof PaymentsPurchaseResponse>;
129
+ /** `GET {base}/entitlements` — always the caller's own. */
130
+ export declare const PaymentsEntitlementsResponse: z.ZodObject<{
131
+ entitlements: z.ZodArray<z.ZodObject<{
132
+ key: z.ZodString;
133
+ granted: z.ZodBoolean;
134
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
135
+ }, z.core.$strip>>;
136
+ }, z.core.$strip>;
137
+ export type PaymentsEntitlementsResponse = z.output<typeof PaymentsEntitlementsResponse>;
138
+ /** `POST {base}/restore`. */
139
+ export declare const PaymentsRestoreResponse: z.ZodObject<{
140
+ purchases: z.ZodArray<z.ZodObject<{
141
+ id: z.ZodString;
142
+ rail: z.ZodEnum<{
143
+ apple: "apple";
144
+ google: "google";
145
+ lemonSqueezy: "lemonSqueezy";
146
+ paddle: "paddle";
147
+ stripe: "stripe";
148
+ }>;
149
+ productId: z.ZodString;
150
+ type: z.ZodEnum<{
151
+ consumable: "consumable";
152
+ non_consumable: "non_consumable";
153
+ subscription: "subscription";
154
+ }>;
155
+ status: z.ZodEnum<{
156
+ active: "active";
157
+ canceled: "canceled";
158
+ expired: "expired";
159
+ in_grace: "in_grace";
160
+ never_paid: "never_paid";
161
+ on_hold: "on_hold";
162
+ paused: "paused";
163
+ refunded: "refunded";
164
+ revoked: "revoked";
165
+ }>;
166
+ environment: z.ZodEnum<{
167
+ production: "production";
168
+ sandbox: "sandbox";
169
+ }>;
170
+ purchasedAt: z.ZodISODateTime;
171
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
172
+ resumesAt: z.ZodNullable<z.ZodISODateTime>;
173
+ outcome: z.ZodEnum<{
174
+ created: "created";
175
+ ignored: "ignored";
176
+ updated: "updated";
177
+ }>;
178
+ }, z.core.$strip>>;
179
+ entitlements: z.ZodArray<z.ZodObject<{
180
+ key: z.ZodString;
181
+ granted: z.ZodBoolean;
182
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
183
+ }, z.core.$strip>>;
184
+ }, z.core.$strip>;
185
+ export type PaymentsRestoreResponse = z.output<typeof PaymentsRestoreResponse>;
186
+ /**
187
+ * `POST {base}/checkout` — how the browser reaches the store's payment page.
188
+ *
189
+ * A discriminated union rather than `{ url }`, because one rail has no URL to give. Stripe and Lemon
190
+ * Squeezy mint a hosted page and answer with its address; Paddle's overlay and inline modes never leave
191
+ * the adopter's page, so the server answers with the transaction the browser opens with Paddle.js and the
192
+ * publishable token it initializes against. A `url` filled with an empty string would be a field a screen
193
+ * navigates to.
194
+ *
195
+ * **Nothing secret crosses.** The client token is publishable exactly as a Stripe price id is. The API
196
+ * key, the webhook signing secret and the resolved discount id are all server-side and none of them is
197
+ * expressible here.
198
+ */
199
+ export declare const PaymentsCheckoutHandoffResponse: z.ZodDiscriminatedUnion<[z.ZodObject<{
200
+ kind: z.ZodLiteral<"redirect">;
201
+ url: z.ZodString;
202
+ }, z.core.$strip>, z.ZodObject<{
203
+ kind: z.ZodLiteral<"paddle">;
204
+ transactionId: z.ZodString;
205
+ clientToken: z.ZodString;
206
+ environment: z.ZodEnum<{
207
+ production: "production";
208
+ sandbox: "sandbox";
209
+ }>;
210
+ displayMode: z.ZodEnum<{
211
+ inline: "inline";
212
+ overlay: "overlay";
213
+ }>;
214
+ successUrl: z.ZodString;
215
+ }, z.core.$strip>], "kind">;
216
+ export type PaymentsCheckoutHandoffResponse = z.output<typeof PaymentsCheckoutHandoffResponse>;
217
+ /**
218
+ * `POST {base}/portal` — the caller's own billing portal.
219
+ *
220
+ * `subscriptions` is present only for a store that mints per-subscription deep links, which is Paddle
221
+ * alone. Every URL in this response is a bearer credential for that customer's billing — Paddle's is good
222
+ * for 24 hours — so nothing here is cached, persisted, or logged.
223
+ */
224
+ export declare const PaymentsPortalHandoffResponse: z.ZodObject<{
225
+ url: z.ZodString;
226
+ subscriptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
227
+ subscriptionId: z.ZodString;
228
+ cancel: z.ZodString;
229
+ updatePaymentMethod: z.ZodString;
230
+ }, z.core.$strip>>>;
231
+ }, z.core.$strip>;
232
+ export type PaymentsPortalHandoffResponse = z.output<typeof PaymentsPortalHandoffResponse>;
233
+ /**
234
+ * `POST {base}/entitlements/grant` and `POST {base}/entitlements/revoke` — the two control-plane routes.
235
+ *
236
+ * One shape for both, because both are the same act read two ways: the entitlement as it now stands.
237
+ * A revoke returns `granted: false` rather than nothing, so a management client renders the state it
238
+ * produced instead of assuming it.
239
+ */
240
+ export declare const PaymentsEntitlementResponse: z.ZodObject<{
241
+ entitlement: z.ZodObject<{
242
+ key: z.ZodString;
243
+ granted: z.ZodBoolean;
244
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
245
+ }, z.core.$strip>;
246
+ }, z.core.$strip>;
247
+ export type PaymentsEntitlementResponse = z.output<typeof PaymentsEntitlementResponse>;
248
+ /**
249
+ * What the caller's own subscription pays now, what it becomes, and when.
250
+ *
251
+ * A **bearer** response, not a management one: this is a customer reading their own bill. Dates cross as
252
+ * ISO-8601 strings like everything else here, and every amount is the store's own figure — nothing in this
253
+ * package multiplies a price by a percentage.
254
+ */
255
+ export declare const PaymentsPricingResponse: z.ZodObject<{
256
+ currency: z.ZodNullable<z.ZodString>;
257
+ currentAmountMinor: z.ZodNullable<z.ZodNumber>;
258
+ listAmountMinor: z.ZodNullable<z.ZodNumber>;
259
+ discountCode: z.ZodNullable<z.ZodString>;
260
+ discountEndsAt: z.ZodNullable<z.ZodString>;
261
+ }, z.core.$strip>;
262
+ export type PaymentsPricingResponse = z.output<typeof PaymentsPricingResponse>;
263
+ /**
264
+ * Who a store prices this caller as — the identity a quote and a charge must both resolve from.
265
+ *
266
+ * **The point of it is agreement, not disclosure.** `POST /payments/checkout` hands this exact value to
267
+ * the rail as the customer being charged, read from the provider-account map keyed on the subject the
268
+ * authenticated caller acts for. A browser quoting a price without it reads an IP-derived estimate and is then charged from a
269
+ * billing address, and the two can differ by up to 15% in the United States alone. So the same row is
270
+ * published here, and the screen asks Paddle about the customer rather than about the network.
271
+ *
272
+ * **An identifier, not a credential.** `ctm_…` names a Paddle customer and authorizes nothing; Paddle's
273
+ * `PricePreview` reads a price with it and the publishable client token, which is the pair Paddle
274
+ * publishes for browsers. The route is `requireAuth()` and answers only about its own caller, so nobody
275
+ * learns anybody else's.
276
+ */
277
+ export declare const PaymentsQuotedFrom: z.ZodObject<{
278
+ rail: z.ZodLiteral<"paddle">;
279
+ providerAccountId: z.ZodString;
280
+ }, z.core.$strip>;
281
+ export type PaymentsQuotedFrom = z.output<typeof PaymentsQuotedFrom>;
282
+ /**
283
+ * What `GET /payments/pricing` answers with.
284
+ *
285
+ * Two independent facts about one caller, and each is null on its own terms. `pricing` is null when no
286
+ * rail can price a subscription they hold — including when they hold none. `quotedFrom` is null when no
287
+ * store holds a customer for them yet, which is the ordinary state of somebody who has not bought
288
+ * anything. A caller can have either without the other, which is why they are siblings rather than one
289
+ * nested in the other.
290
+ */
291
+ export declare const PaymentsPricingEnvelope: z.ZodObject<{
292
+ pricing: z.ZodNullable<z.ZodObject<{
293
+ currency: z.ZodNullable<z.ZodString>;
294
+ currentAmountMinor: z.ZodNullable<z.ZodNumber>;
295
+ listAmountMinor: z.ZodNullable<z.ZodNumber>;
296
+ discountCode: z.ZodNullable<z.ZodString>;
297
+ discountEndsAt: z.ZodNullable<z.ZodString>;
298
+ }, z.core.$strip>>;
299
+ quotedFrom: z.ZodNullable<z.ZodObject<{
300
+ rail: z.ZodLiteral<"paddle">;
301
+ providerAccountId: z.ZodString;
302
+ }, z.core.$strip>>;
303
+ }, z.core.$strip>;
304
+ export type PaymentsPricingEnvelope = z.output<typeof PaymentsPricingEnvelope>;
305
+ /**
306
+ * ## The subscription lifecycle responses
307
+ *
308
+ * What `GET {base}/subscription` reads and what the three writes beside it answer with. **Bearer
309
+ * shapes, not management ones**: this is a customer reading and changing their own bill.
310
+ *
311
+ * **These are wire mirrors of `data/subscription.ts`, and the duplication is forced.** Those shapes
312
+ * carry `JsonDate` codecs so the rail hands the rest of the package real `Date`s; this file declares no
313
+ * codec and no transform anywhere, because these describe the JSON a browser receives — parsing one has
314
+ * to hand back exactly what went in. Re-exporting the data shapes here would give a client `Date`
315
+ * objects it cannot have and would make `responses.test.ts`'s equality check unwritable. So `.encode()`
316
+ * is the bridge, and `responses.test.ts` builds every fixture below by encoding a real
317
+ * `SubscriptionStanding` and a real `SubscriptionChangeQuote` and comparing key sets — which is what
318
+ * keeps two objects that must agree from drifting into a date a screen cannot read.
319
+ *
320
+ * **No store identifier crosses.** No `sub_…`, no `ctm_…`, no `txn_…`, and no price id. A customer's
321
+ * screen addresses their subscription by *being that customer*; the route resolves the row. An
322
+ * identifier published here is a field a request grows next, and the request that grows it is the one
323
+ * that names somebody else's subscription.
324
+ *
325
+ * **Required rather than `.optional()`, unlike a field added to a shape that already shipped.** The
326
+ * module note above is about widening a response an older Worker already answers; these arrive with the
327
+ * routes that answer them, so a Worker too old to have the field is a Worker that 404s the route and
328
+ * never returns a body for a client to validate.
329
+ */
330
+ /**
331
+ * An amount a provider quoted, on the wire: an integer in the currency's minor unit, and the currency.
332
+ *
333
+ * **Signed, because the provider's own figures are.** A credit comes back negative from Paddle and a
334
+ * downgrade's totals are negative throughout; a `.nonnegative()` here would refuse the recorded response
335
+ * of every plan change these routes exist to make. **And never a float** — 6582 is $65.82, so a `65.82`
336
+ * arriving here is somebody reading a rendered figure back in, in a currency whose minor unit may not be
337
+ * a hundredth.
338
+ *
339
+ * `currency` is a plain string, as it is on {@link PaymentsPricingResponse}, and deliberately not the
340
+ * lowercase-only rule `data/subscription.ts` enforces. That rule is where a rail that stopped lowering
341
+ * its provider's casing fails — at the boundary that reads the store. Re-refusing it here would take a
342
+ * customer's whole subscription pane down over a casing difference, which is the failure mode #450
343
+ * names, arrived at from the other direction.
344
+ *
345
+ * **`rendered` is what a screen puts in front of the customer, and it is why this response is usable at
346
+ * all** (#465). Minor units alone cross as bare digits, and a client cannot scale them without carrying
347
+ * the currency exponents itself — which is the table this Worker already has and the client does not. So
348
+ * the figure is rendered here, in the locale the request resolved, and crosses beside the integer rather
349
+ * than instead of it: a client comparing two amounts still reads `amountMinor`.
350
+ *
351
+ * **`.min(1)` on it, unlike a `.string()` elsewhere in this file.** An empty string is a confirmation
352
+ * screen with a blank where the price goes, and a blank is the one thing worse than a figure in the wrong
353
+ * language.
354
+ */
355
+ export declare const PaymentsQuotedMoney: z.ZodObject<{
356
+ amountMinor: z.ZodNumber;
357
+ currency: z.ZodString;
358
+ rendered: z.ZodString;
359
+ }, z.core.$strip>;
360
+ export type PaymentsQuotedMoney = z.output<typeof PaymentsQuotedMoney>;
361
+ /**
362
+ * What settles at one moment — the thing a confirmation screen states.
363
+ *
364
+ * **A discriminated union rather than a signed number**, because the direction must be unreadable
365
+ * without being read: a 6581 credit and a 6581 charge are the same characters and the opposite meaning,
366
+ * and nothing in a type system would object to the swap. Here `amount` cannot be reached without
367
+ * matching `outcome` first.
368
+ *
369
+ * **`nothing` is a member, not a zero**, and it carries no amount — one smuggled in does not survive the
370
+ * parse. "Nothing to pay today" and "a charge of $0.00" are different sentences and only one of them
371
+ * describes what is happening.
372
+ */
373
+ export declare const PaymentsSubscriptionSettlement: z.ZodDiscriminatedUnion<[z.ZodObject<{
374
+ outcome: z.ZodLiteral<"charge">;
375
+ amount: z.ZodObject<{
376
+ amountMinor: z.ZodNumber;
377
+ currency: z.ZodString;
378
+ rendered: z.ZodString;
379
+ }, z.core.$strip>;
380
+ madeUpOf: z.ZodNullable<z.ZodObject<{
381
+ charge: z.ZodObject<{
382
+ amountMinor: z.ZodNumber;
383
+ currency: z.ZodString;
384
+ rendered: z.ZodString;
385
+ }, z.core.$strip>;
386
+ credit: z.ZodObject<{
387
+ amountMinor: z.ZodNumber;
388
+ currency: z.ZodString;
389
+ rendered: z.ZodString;
390
+ }, z.core.$strip>;
391
+ }, z.core.$strip>>;
392
+ }, z.core.$strip>, z.ZodObject<{
393
+ outcome: z.ZodLiteral<"credit">;
394
+ amount: z.ZodObject<{
395
+ amountMinor: z.ZodNumber;
396
+ currency: z.ZodString;
397
+ rendered: z.ZodString;
398
+ }, z.core.$strip>;
399
+ madeUpOf: z.ZodNullable<z.ZodObject<{
400
+ charge: z.ZodObject<{
401
+ amountMinor: z.ZodNumber;
402
+ currency: z.ZodString;
403
+ rendered: z.ZodString;
404
+ }, z.core.$strip>;
405
+ credit: z.ZodObject<{
406
+ amountMinor: z.ZodNumber;
407
+ currency: z.ZodString;
408
+ rendered: z.ZodString;
409
+ }, z.core.$strip>;
410
+ }, z.core.$strip>>;
411
+ }, z.core.$strip>, z.ZodObject<{
412
+ outcome: z.ZodLiteral<"nothing">;
413
+ }, z.core.$strip>], "outcome">;
414
+ export type PaymentsSubscriptionSettlement = z.output<typeof PaymentsSubscriptionSettlement>;
415
+ /**
416
+ * The same settlement minus `nothing` — what lands on an invoice that is not today's.
417
+ *
418
+ * The block holding it is nullable, and null already says nothing lands later. Two spellings of one fact
419
+ * is how a screen checks the block for presence, finds it, and renders "$— credit on 15 Sep": a row
420
+ * about no money, dated.
421
+ */
422
+ export declare const PaymentsDeferredSubscriptionSettlement: z.ZodDiscriminatedUnion<[z.ZodObject<{
423
+ outcome: z.ZodLiteral<"charge">;
424
+ amount: z.ZodObject<{
425
+ amountMinor: z.ZodNumber;
426
+ currency: z.ZodString;
427
+ rendered: z.ZodString;
428
+ }, z.core.$strip>;
429
+ madeUpOf: z.ZodNullable<z.ZodObject<{
430
+ charge: z.ZodObject<{
431
+ amountMinor: z.ZodNumber;
432
+ currency: z.ZodString;
433
+ rendered: z.ZodString;
434
+ }, z.core.$strip>;
435
+ credit: z.ZodObject<{
436
+ amountMinor: z.ZodNumber;
437
+ currency: z.ZodString;
438
+ rendered: z.ZodString;
439
+ }, z.core.$strip>;
440
+ }, z.core.$strip>>;
441
+ }, z.core.$strip>, z.ZodObject<{
442
+ outcome: z.ZodLiteral<"credit">;
443
+ amount: z.ZodObject<{
444
+ amountMinor: z.ZodNumber;
445
+ currency: z.ZodString;
446
+ rendered: z.ZodString;
447
+ }, z.core.$strip>;
448
+ madeUpOf: z.ZodNullable<z.ZodObject<{
449
+ charge: z.ZodObject<{
450
+ amountMinor: z.ZodNumber;
451
+ currency: z.ZodString;
452
+ rendered: z.ZodString;
453
+ }, z.core.$strip>;
454
+ credit: z.ZodObject<{
455
+ amountMinor: z.ZodNumber;
456
+ currency: z.ZodString;
457
+ rendered: z.ZodString;
458
+ }, z.core.$strip>;
459
+ }, z.core.$strip>>;
460
+ }, z.core.$strip>], "outcome">;
461
+ export type PaymentsDeferredSubscriptionSettlement = z.output<typeof PaymentsDeferredSubscriptionSettlement>;
462
+ export declare const PaymentsSubscriptionQuote: z.ZodObject<{
463
+ settlesToday: z.ZodDiscriminatedUnion<[z.ZodObject<{
464
+ outcome: z.ZodLiteral<"charge">;
465
+ amount: z.ZodObject<{
466
+ amountMinor: z.ZodNumber;
467
+ currency: z.ZodString;
468
+ rendered: z.ZodString;
469
+ }, z.core.$strip>;
470
+ madeUpOf: z.ZodNullable<z.ZodObject<{
471
+ charge: z.ZodObject<{
472
+ amountMinor: z.ZodNumber;
473
+ currency: z.ZodString;
474
+ rendered: z.ZodString;
475
+ }, z.core.$strip>;
476
+ credit: z.ZodObject<{
477
+ amountMinor: z.ZodNumber;
478
+ currency: z.ZodString;
479
+ rendered: z.ZodString;
480
+ }, z.core.$strip>;
481
+ }, z.core.$strip>>;
482
+ }, z.core.$strip>, z.ZodObject<{
483
+ outcome: z.ZodLiteral<"credit">;
484
+ amount: z.ZodObject<{
485
+ amountMinor: z.ZodNumber;
486
+ currency: z.ZodString;
487
+ rendered: z.ZodString;
488
+ }, z.core.$strip>;
489
+ madeUpOf: z.ZodNullable<z.ZodObject<{
490
+ charge: z.ZodObject<{
491
+ amountMinor: z.ZodNumber;
492
+ currency: z.ZodString;
493
+ rendered: z.ZodString;
494
+ }, z.core.$strip>;
495
+ credit: z.ZodObject<{
496
+ amountMinor: z.ZodNumber;
497
+ currency: z.ZodString;
498
+ rendered: z.ZodString;
499
+ }, z.core.$strip>;
500
+ }, z.core.$strip>>;
501
+ }, z.core.$strip>, z.ZodObject<{
502
+ outcome: z.ZodLiteral<"nothing">;
503
+ }, z.core.$strip>], "outcome">;
504
+ nextInvoice: z.ZodNullable<z.ZodObject<{
505
+ settlement: z.ZodDiscriminatedUnion<[z.ZodObject<{
506
+ outcome: z.ZodLiteral<"charge">;
507
+ amount: z.ZodObject<{
508
+ amountMinor: z.ZodNumber;
509
+ currency: z.ZodString;
510
+ rendered: z.ZodString;
511
+ }, z.core.$strip>;
512
+ madeUpOf: z.ZodNullable<z.ZodObject<{
513
+ charge: z.ZodObject<{
514
+ amountMinor: z.ZodNumber;
515
+ currency: z.ZodString;
516
+ rendered: z.ZodString;
517
+ }, z.core.$strip>;
518
+ credit: z.ZodObject<{
519
+ amountMinor: z.ZodNumber;
520
+ currency: z.ZodString;
521
+ rendered: z.ZodString;
522
+ }, z.core.$strip>;
523
+ }, z.core.$strip>>;
524
+ }, z.core.$strip>, z.ZodObject<{
525
+ outcome: z.ZodLiteral<"credit">;
526
+ amount: z.ZodObject<{
527
+ amountMinor: z.ZodNumber;
528
+ currency: z.ZodString;
529
+ rendered: z.ZodString;
530
+ }, z.core.$strip>;
531
+ madeUpOf: z.ZodNullable<z.ZodObject<{
532
+ charge: z.ZodObject<{
533
+ amountMinor: z.ZodNumber;
534
+ currency: z.ZodString;
535
+ rendered: z.ZodString;
536
+ }, z.core.$strip>;
537
+ credit: z.ZodObject<{
538
+ amountMinor: z.ZodNumber;
539
+ currency: z.ZodString;
540
+ rendered: z.ZodString;
541
+ }, z.core.$strip>;
542
+ }, z.core.$strip>>;
543
+ }, z.core.$strip>], "outcome">;
544
+ at: z.ZodISODateTime;
545
+ }, z.core.$strip>>;
546
+ recurring: z.ZodNullable<z.ZodObject<{
547
+ amount: z.ZodObject<{
548
+ amountMinor: z.ZodNumber;
549
+ currency: z.ZodString;
550
+ rendered: z.ZodString;
551
+ }, z.core.$strip>;
552
+ startsAt: z.ZodISODateTime;
553
+ madeUpOf: z.ZodNullable<z.ZodObject<{
554
+ beforeTax: z.ZodObject<{
555
+ amountMinor: z.ZodNumber;
556
+ currency: z.ZodString;
557
+ rendered: z.ZodString;
558
+ }, z.core.$strip>;
559
+ tax: z.ZodObject<{
560
+ amountMinor: z.ZodNumber;
561
+ currency: z.ZodString;
562
+ rendered: z.ZodString;
563
+ }, z.core.$strip>;
564
+ }, z.core.$strip>>;
565
+ }, z.core.$strip>>;
566
+ }, z.core.$strip>;
567
+ export type PaymentsSubscriptionQuote = z.output<typeof PaymentsSubscriptionQuote>;
568
+ /**
569
+ * A change the store will apply later — the object that makes an `active` subscription's future
570
+ * different from its present.
571
+ *
572
+ * **This is what distinguishes "renews on the 15th" from "ends on the 15th".** With a cancellation
573
+ * scheduled, Paddle reports `status: "active"`, no cancellation date, and a blank next billing date: two
574
+ * of those say the subscription is fine and the third says nothing. Only this object says what is
575
+ * coming, which is why it crosses to the customer rather than being read into the status server-side.
576
+ *
577
+ * The action enum is imported from `data/subscription.ts` rather than respelled — it is a closed set
578
+ * with no codec in it, so it crosses this seam intact, and a fourth schedulable action cannot then exist
579
+ * on one side only.
580
+ */
581
+ export declare const PaymentsSubscriptionScheduledChange: z.ZodObject<{
582
+ action: z.ZodEnum<{
583
+ cancel: "cancel";
584
+ pause: "pause";
585
+ resume: "resume";
586
+ }>;
587
+ effectiveAt: z.ZodISODateTime;
588
+ resumesAt: z.ZodNullable<z.ZodISODateTime>;
589
+ }, z.core.$strip>;
590
+ export type PaymentsSubscriptionScheduledChange = z.output<typeof PaymentsSubscriptionScheduledChange>;
591
+ /**
592
+ * What happens to this subscription next, and when — the reading of the standing, published rather than
593
+ * left for a screen to derive.
594
+ *
595
+ * **The precedence is the whole point, and it is not obvious**: a scheduled change wins over the next
596
+ * billing date, because Paddle *blanks* that date the moment a cancellation is scheduled. A screen
597
+ * reading the status says the subscription renews; a screen reading the billing date says nothing at
598
+ * all; the date the customer is owed exists only on the scheduled change. Every client would have to
599
+ * rediscover that, and the ones that got it wrong would tell somebody who canceled that they will be
600
+ * billed again.
601
+ *
602
+ * So this is a derived field on purpose, in the register {@link PaymentsAdminEntitlementView}'s
603
+ * `granted` already sets: the rule lives once, on the server, and the answer crosses. It is the answer
604
+ * `nextSubscriptionEvent` gives in `data/subscription.ts`, encoded — a client cannot call that function,
605
+ * because it takes `Date`s and this is JSON.
606
+ *
607
+ * **A union of two members, so `at` is null on exactly one kind.** A caller that has narrowed to any
608
+ * other has a date without checking for one, and `unknown` cannot carry a day a screen would print for
609
+ * an event nobody said was happening.
610
+ */
611
+ export declare const PaymentsSubscriptionNextEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
612
+ kind: z.ZodEnum<{
613
+ ends: "ends";
614
+ pauses: "pauses";
615
+ renews: "renews";
616
+ resumes: "resumes";
617
+ }>;
618
+ at: z.ZodISODateTime;
619
+ }, z.core.$strip>, z.ZodObject<{
620
+ kind: z.ZodLiteral<"unknown">;
621
+ at: z.ZodNull;
622
+ }, z.core.$strip>], "kind">;
623
+ export type PaymentsSubscriptionNextEvent = z.output<typeof PaymentsSubscriptionNextEvent>;
624
+ /**
625
+ * One subscription as its own holder reads it: which plan, where it stands, and what happens next.
626
+ *
627
+ * The standing's own five fields cross verbatim, and two are added.
628
+ *
629
+ * **`productId`, because a screen has to name the plan.** "Team, renews 15 Sep" is unwritable without
630
+ * it, and it is the one fact here a client cannot already know: the route resolved the subscription from
631
+ * this caller's own purchase rows, so which plan they are on is the server's answer. The display name is
632
+ * not copied beside it — that is the catalog's, read once by whatever screen renders a paywall, and a
633
+ * second copy traveling on every standing is a name that goes stale on the customer's screen the day an
634
+ * adopter renames a product.
635
+ *
636
+ * **`nextEvent`, because the precedence rule must not be client-side.** See
637
+ * {@link PaymentsSubscriptionNextEvent}.
638
+ *
639
+ * **Nothing about money.** What the subscription costs is `GET {base}/pricing`'s answer, which already
640
+ * states the discount in force and when it lapses; a second price here would be two figures to keep in
641
+ * step. `currency` crosses so a screen can format that price without a second lookup, which is exactly
642
+ * why it is on the standing in the first place.
643
+ */
644
+ export declare const PaymentsSubscriptionView: z.ZodObject<{
645
+ productId: z.ZodString;
646
+ status: z.ZodEnum<{
647
+ active: "active";
648
+ canceled: "canceled";
649
+ expired: "expired";
650
+ in_grace: "in_grace";
651
+ never_paid: "never_paid";
652
+ on_hold: "on_hold";
653
+ paused: "paused";
654
+ refunded: "refunded";
655
+ revoked: "revoked";
656
+ }>;
657
+ currency: z.ZodNullable<z.ZodString>;
658
+ currentPeriodEndsAt: z.ZodNullable<z.ZodISODateTime>;
659
+ nextBilledAt: z.ZodNullable<z.ZodISODateTime>;
660
+ scheduledChange: z.ZodNullable<z.ZodObject<{
661
+ action: z.ZodEnum<{
662
+ cancel: "cancel";
663
+ pause: "pause";
664
+ resume: "resume";
665
+ }>;
666
+ effectiveAt: z.ZodISODateTime;
667
+ resumesAt: z.ZodNullable<z.ZodISODateTime>;
668
+ }, z.core.$strip>>;
669
+ nextEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
670
+ kind: z.ZodEnum<{
671
+ ends: "ends";
672
+ pauses: "pauses";
673
+ renews: "renews";
674
+ resumes: "resumes";
675
+ }>;
676
+ at: z.ZodISODateTime;
677
+ }, z.core.$strip>, z.ZodObject<{
678
+ kind: z.ZodLiteral<"unknown">;
679
+ at: z.ZodNull;
680
+ }, z.core.$strip>], "kind">;
681
+ }, z.core.$strip>;
682
+ export type PaymentsSubscriptionView = z.output<typeof PaymentsSubscriptionView>;
683
+ /**
684
+ * `GET {base}/subscription` — the caller's own subscription, or that they have none.
685
+ *
686
+ * **The read ships before the writes**, and this is it. A capability that can cancel a subscription and
687
+ * cannot report the cancellation has shipped the half that creates the support ticket; #247 is the
688
+ * larger version of the same mistake, where writes went out with no read beside them and a dashboard's
689
+ * panes dropped out of the rail entirely.
690
+ *
691
+ * `null` is a real answer and a common one: somebody who has never bought anything. It is not an error
692
+ * and not a 404 — a 404 would make this route an existence oracle and would read, to a screen, exactly
693
+ * like a Worker that could not be reached.
694
+ */
695
+ export declare const PaymentsSubscriptionResponse: z.ZodObject<{
696
+ subscription: z.ZodNullable<z.ZodObject<{
697
+ productId: z.ZodString;
698
+ status: z.ZodEnum<{
699
+ active: "active";
700
+ canceled: "canceled";
701
+ expired: "expired";
702
+ in_grace: "in_grace";
703
+ never_paid: "never_paid";
704
+ on_hold: "on_hold";
705
+ paused: "paused";
706
+ refunded: "refunded";
707
+ revoked: "revoked";
708
+ }>;
709
+ currency: z.ZodNullable<z.ZodString>;
710
+ currentPeriodEndsAt: z.ZodNullable<z.ZodISODateTime>;
711
+ nextBilledAt: z.ZodNullable<z.ZodISODateTime>;
712
+ scheduledChange: z.ZodNullable<z.ZodObject<{
713
+ action: z.ZodEnum<{
714
+ cancel: "cancel";
715
+ pause: "pause";
716
+ resume: "resume";
717
+ }>;
718
+ effectiveAt: z.ZodISODateTime;
719
+ resumesAt: z.ZodNullable<z.ZodISODateTime>;
720
+ }, z.core.$strip>>;
721
+ nextEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
722
+ kind: z.ZodEnum<{
723
+ ends: "ends";
724
+ pauses: "pauses";
725
+ renews: "renews";
726
+ resumes: "resumes";
727
+ }>;
728
+ at: z.ZodISODateTime;
729
+ }, z.core.$strip>, z.ZodObject<{
730
+ kind: z.ZodLiteral<"unknown">;
731
+ at: z.ZodNull;
732
+ }, z.core.$strip>], "kind">;
733
+ }, z.core.$strip>>;
734
+ }, z.core.$strip>;
735
+ export type PaymentsSubscriptionResponse = z.output<typeof PaymentsSubscriptionResponse>;
736
+ /**
737
+ * What the three writes answer with — `change`, `cancel` and `keep`.
738
+ *
739
+ * **The store's own answer to where the subscription now stands, not a prediction of it.** The screen
740
+ * that just wrote renders what it wrote, from the state the store reported after applying it. A
741
+ * prediction is how a customer sees a plan they are not on — and it is why nothing in this package
742
+ * writes a purchase row on these routes: the webhook owns that row, and a second producer of it disagrees
743
+ * with the first the moment a webhook is late.
744
+ *
745
+ * **Never null, which is the one way this differs from {@link PaymentsSubscriptionResponse}.** Each of
746
+ * the three resolved a subscription before it ran, so a null here is a case every screen would branch on
747
+ * and none could reach.
748
+ *
749
+ * A no-op answers exactly this shape too, and answers 200: a change to the plan already held, or a
750
+ * cancellation already scheduled for the timing asked for. The subscription is how the caller wanted it,
751
+ * so there is nothing to refuse — and these verbs sit behind a network, where a retried intent must not
752
+ * become a second proration.
753
+ */
754
+ export declare const PaymentsSubscriptionStandingResponse: z.ZodObject<{
755
+ subscription: z.ZodObject<{
756
+ productId: z.ZodString;
757
+ status: z.ZodEnum<{
758
+ active: "active";
759
+ canceled: "canceled";
760
+ expired: "expired";
761
+ in_grace: "in_grace";
762
+ never_paid: "never_paid";
763
+ on_hold: "on_hold";
764
+ paused: "paused";
765
+ refunded: "refunded";
766
+ revoked: "revoked";
767
+ }>;
768
+ currency: z.ZodNullable<z.ZodString>;
769
+ currentPeriodEndsAt: z.ZodNullable<z.ZodISODateTime>;
770
+ nextBilledAt: z.ZodNullable<z.ZodISODateTime>;
771
+ scheduledChange: z.ZodNullable<z.ZodObject<{
772
+ action: z.ZodEnum<{
773
+ cancel: "cancel";
774
+ pause: "pause";
775
+ resume: "resume";
776
+ }>;
777
+ effectiveAt: z.ZodISODateTime;
778
+ resumesAt: z.ZodNullable<z.ZodISODateTime>;
779
+ }, z.core.$strip>>;
780
+ nextEvent: z.ZodDiscriminatedUnion<[z.ZodObject<{
781
+ kind: z.ZodEnum<{
782
+ ends: "ends";
783
+ pauses: "pauses";
784
+ renews: "renews";
785
+ resumes: "resumes";
786
+ }>;
787
+ at: z.ZodISODateTime;
788
+ }, z.core.$strip>, z.ZodObject<{
789
+ kind: z.ZodLiteral<"unknown">;
790
+ at: z.ZodNull;
791
+ }, z.core.$strip>], "kind">;
792
+ }, z.core.$strip>;
793
+ }, z.core.$strip>;
794
+ export type PaymentsSubscriptionStandingResponse = z.output<typeof PaymentsSubscriptionStandingResponse>;
795
+ /**
796
+ * `POST {base}/subscription/preview` — what the change would cost, before anything is committed.
797
+ *
798
+ * The quote alone: it echoes nothing back about what was asked, because the request named the product
799
+ * and the client therefore already holds it. Contrast {@link PaymentsAdminSubjectEntitlementsResponse},
800
+ * which echoes the subject precisely because half of what it renders came from the server.
801
+ */
802
+ export declare const PaymentsSubscriptionQuoteResponse: z.ZodObject<{
803
+ quote: z.ZodObject<{
804
+ settlesToday: z.ZodDiscriminatedUnion<[z.ZodObject<{
805
+ outcome: z.ZodLiteral<"charge">;
806
+ amount: z.ZodObject<{
807
+ amountMinor: z.ZodNumber;
808
+ currency: z.ZodString;
809
+ rendered: z.ZodString;
810
+ }, z.core.$strip>;
811
+ madeUpOf: z.ZodNullable<z.ZodObject<{
812
+ charge: z.ZodObject<{
813
+ amountMinor: z.ZodNumber;
814
+ currency: z.ZodString;
815
+ rendered: z.ZodString;
816
+ }, z.core.$strip>;
817
+ credit: z.ZodObject<{
818
+ amountMinor: z.ZodNumber;
819
+ currency: z.ZodString;
820
+ rendered: z.ZodString;
821
+ }, z.core.$strip>;
822
+ }, z.core.$strip>>;
823
+ }, z.core.$strip>, z.ZodObject<{
824
+ outcome: z.ZodLiteral<"credit">;
825
+ amount: z.ZodObject<{
826
+ amountMinor: z.ZodNumber;
827
+ currency: z.ZodString;
828
+ rendered: z.ZodString;
829
+ }, z.core.$strip>;
830
+ madeUpOf: z.ZodNullable<z.ZodObject<{
831
+ charge: z.ZodObject<{
832
+ amountMinor: z.ZodNumber;
833
+ currency: z.ZodString;
834
+ rendered: z.ZodString;
835
+ }, z.core.$strip>;
836
+ credit: z.ZodObject<{
837
+ amountMinor: z.ZodNumber;
838
+ currency: z.ZodString;
839
+ rendered: z.ZodString;
840
+ }, z.core.$strip>;
841
+ }, z.core.$strip>>;
842
+ }, z.core.$strip>, z.ZodObject<{
843
+ outcome: z.ZodLiteral<"nothing">;
844
+ }, z.core.$strip>], "outcome">;
845
+ nextInvoice: z.ZodNullable<z.ZodObject<{
846
+ settlement: z.ZodDiscriminatedUnion<[z.ZodObject<{
847
+ outcome: z.ZodLiteral<"charge">;
848
+ amount: z.ZodObject<{
849
+ amountMinor: z.ZodNumber;
850
+ currency: z.ZodString;
851
+ rendered: z.ZodString;
852
+ }, z.core.$strip>;
853
+ madeUpOf: z.ZodNullable<z.ZodObject<{
854
+ charge: z.ZodObject<{
855
+ amountMinor: z.ZodNumber;
856
+ currency: z.ZodString;
857
+ rendered: z.ZodString;
858
+ }, z.core.$strip>;
859
+ credit: z.ZodObject<{
860
+ amountMinor: z.ZodNumber;
861
+ currency: z.ZodString;
862
+ rendered: z.ZodString;
863
+ }, z.core.$strip>;
864
+ }, z.core.$strip>>;
865
+ }, z.core.$strip>, z.ZodObject<{
866
+ outcome: z.ZodLiteral<"credit">;
867
+ amount: z.ZodObject<{
868
+ amountMinor: z.ZodNumber;
869
+ currency: z.ZodString;
870
+ rendered: z.ZodString;
871
+ }, z.core.$strip>;
872
+ madeUpOf: z.ZodNullable<z.ZodObject<{
873
+ charge: z.ZodObject<{
874
+ amountMinor: z.ZodNumber;
875
+ currency: z.ZodString;
876
+ rendered: z.ZodString;
877
+ }, z.core.$strip>;
878
+ credit: z.ZodObject<{
879
+ amountMinor: z.ZodNumber;
880
+ currency: z.ZodString;
881
+ rendered: z.ZodString;
882
+ }, z.core.$strip>;
883
+ }, z.core.$strip>>;
884
+ }, z.core.$strip>], "outcome">;
885
+ at: z.ZodISODateTime;
886
+ }, z.core.$strip>>;
887
+ recurring: z.ZodNullable<z.ZodObject<{
888
+ amount: z.ZodObject<{
889
+ amountMinor: z.ZodNumber;
890
+ currency: z.ZodString;
891
+ rendered: z.ZodString;
892
+ }, z.core.$strip>;
893
+ startsAt: z.ZodISODateTime;
894
+ madeUpOf: z.ZodNullable<z.ZodObject<{
895
+ beforeTax: z.ZodObject<{
896
+ amountMinor: z.ZodNumber;
897
+ currency: z.ZodString;
898
+ rendered: z.ZodString;
899
+ }, z.core.$strip>;
900
+ tax: z.ZodObject<{
901
+ amountMinor: z.ZodNumber;
902
+ currency: z.ZodString;
903
+ rendered: z.ZodString;
904
+ }, z.core.$strip>;
905
+ }, z.core.$strip>>;
906
+ }, z.core.$strip>>;
907
+ }, z.core.$strip>;
908
+ }, z.core.$strip>;
909
+ export type PaymentsSubscriptionQuoteResponse = z.output<typeof PaymentsSubscriptionQuoteResponse>;
910
+ /**
911
+ * ## The refund report
912
+ *
913
+ * What `POST {base}/subscription/refund` answers with. **Nothing in it says the money moved**, because at
914
+ * the moment it is produced nobody has decided that: a refund is a request, most live ones sit at the store
915
+ * awaiting a person, and the settlement arrives later as a webhook.
916
+ *
917
+ * **No amount, anywhere.** A figure here would be read as what the customer is getting back, which is the
918
+ * one thing this response cannot know. What a screen renders is *how many* payments were asked about and
919
+ * where each stands — and the customer's own payment history, which they already have, is where the sums
920
+ * are.
921
+ *
922
+ * **No identifier either — not the store's, and not ours.** No `txn_…` and no adjustment id: the module note
923
+ * above bans store identifiers from every bearer response, and an adjustment id published to a browser is a
924
+ * field a request grows next. The purchase id is withheld on the same principle rather than on a rule, since
925
+ * a screen that has just asked to refund a whole subscription needs a count and a state, not a join key. The
926
+ * ids are in the audit trail, where an operator is the reader.
927
+ */
928
+ /** Where one refund request stands. The values come from `data/subscription.ts`, so the wire cannot hold a state the rail cannot produce. */
929
+ export declare const PaymentsRefundRequestStatus: z.ZodEnum<{
930
+ approved: "approved";
931
+ awaiting_review: "awaiting_review";
932
+ rejected: "rejected";
933
+ reversed: "reversed";
934
+ unknown: "unknown";
935
+ }>;
936
+ export type PaymentsRefundRequestStatus = z.output<typeof PaymentsRefundRequestStatus>;
937
+ /** What became of one payment. Three outcomes, and the discriminant is what stops a report reading as a success. */
938
+ export declare const PaymentsRefundOutcome: z.ZodDiscriminatedUnion<[z.ZodObject<{
939
+ outcome: z.ZodLiteral<"requested">;
940
+ status: z.ZodEnum<{
941
+ approved: "approved";
942
+ awaiting_review: "awaiting_review";
943
+ rejected: "rejected";
944
+ reversed: "reversed";
945
+ unknown: "unknown";
946
+ }>;
947
+ }, z.core.$strip>, z.ZodObject<{
948
+ outcome: z.ZodLiteral<"already_requested">;
949
+ status: z.ZodEnum<{
950
+ approved: "approved";
951
+ awaiting_review: "awaiting_review";
952
+ rejected: "rejected";
953
+ reversed: "reversed";
954
+ unknown: "unknown";
955
+ }>;
956
+ }, z.core.$strip>, z.ZodObject<{
957
+ outcome: z.ZodLiteral<"failed">;
958
+ }, z.core.$strip>], "outcome">;
959
+ export type PaymentsRefundOutcome = z.output<typeof PaymentsRefundOutcome>;
960
+ /**
961
+ * What came of asking for a subscription's payments back.
962
+ *
963
+ * **One entry per payment, always** — the report is total over what was asked about, which is what makes a
964
+ * partial impossible to miss. A caller counting entries and a caller counting their own payments get the
965
+ * same number, whatever happened in between.
966
+ *
967
+ * A refund attaches to a *transaction*, and a subscription is a family of them. A customer who joined on one
968
+ * plan, upgraded mid-period and canceled has paid twice; a policy that owes them their money owes both, so
969
+ * this is a list rather than a single outcome even in the common case.
970
+ */
971
+ export declare const PaymentsRefundRequest: z.ZodObject<{
972
+ outcomes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
973
+ outcome: z.ZodLiteral<"requested">;
974
+ status: z.ZodEnum<{
975
+ approved: "approved";
976
+ awaiting_review: "awaiting_review";
977
+ rejected: "rejected";
978
+ reversed: "reversed";
979
+ unknown: "unknown";
980
+ }>;
981
+ }, z.core.$strip>, z.ZodObject<{
982
+ outcome: z.ZodLiteral<"already_requested">;
983
+ status: z.ZodEnum<{
984
+ approved: "approved";
985
+ awaiting_review: "awaiting_review";
986
+ rejected: "rejected";
987
+ reversed: "reversed";
988
+ unknown: "unknown";
989
+ }>;
990
+ }, z.core.$strip>, z.ZodObject<{
991
+ outcome: z.ZodLiteral<"failed">;
992
+ }, z.core.$strip>], "outcome">>;
993
+ }, z.core.$strip>;
994
+ export type PaymentsRefundRequest = z.output<typeof PaymentsRefundRequest>;
995
+ /** The envelope `POST {base}/subscription/refund` answers with. */
996
+ export declare const PaymentsRefundResponse: z.ZodObject<{
997
+ refund: z.ZodObject<{
998
+ outcomes: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
999
+ outcome: z.ZodLiteral<"requested">;
1000
+ status: z.ZodEnum<{
1001
+ approved: "approved";
1002
+ awaiting_review: "awaiting_review";
1003
+ rejected: "rejected";
1004
+ reversed: "reversed";
1005
+ unknown: "unknown";
1006
+ }>;
1007
+ }, z.core.$strip>, z.ZodObject<{
1008
+ outcome: z.ZodLiteral<"already_requested">;
1009
+ status: z.ZodEnum<{
1010
+ approved: "approved";
1011
+ awaiting_review: "awaiting_review";
1012
+ rejected: "rejected";
1013
+ reversed: "reversed";
1014
+ unknown: "unknown";
1015
+ }>;
1016
+ }, z.core.$strip>, z.ZodObject<{
1017
+ outcome: z.ZodLiteral<"failed">;
1018
+ }, z.core.$strip>], "outcome">>;
1019
+ }, z.core.$strip>;
1020
+ }, z.core.$strip>;
1021
+ export type PaymentsRefundResponse = z.output<typeof PaymentsRefundResponse>;
1022
+ /**
1023
+ * The discount codes one store holds.
1024
+ *
1025
+ * A management shape, never a client one: what an adopter has issued is a commercial fact, and the client
1026
+ * projection draws the same line here it draws for SKUs and the `grants` block.
1027
+ */
1028
+ export declare const PaymentsAdminDiscountsResponse: z.ZodObject<{
1029
+ discounts: z.ZodArray<z.ZodObject<{
1030
+ code: z.ZodString;
1031
+ providerDiscountId: z.ZodString;
1032
+ amount: z.ZodString;
1033
+ redemptions: z.ZodNullable<z.ZodNumber>;
1034
+ }, z.core.$strip>>;
1035
+ }, z.core.$strip>;
1036
+ export type PaymentsAdminDiscountsResponse = z.output<typeof PaymentsAdminDiscountsResponse>;
1037
+ /**
1038
+ * A discount as the store minted it.
1039
+ *
1040
+ * The **code** is the point — an adopter mints one per applicant and has to be told what it is — and the
1041
+ * provider id is what finds it in that store's dashboard afterwards. The terms are echoed back as this
1042
+ * package models them rather than as the store recorded them, so a client can show what it asked for
1043
+ * without learning either provider's vocabulary.
1044
+ *
1045
+ * Nothing here is a list. A management client learns the code it just created and no other, because the set
1046
+ * of codes an adopter has issued is a commercial fact and not one this route publishes.
1047
+ */
1048
+ export declare const PaymentsDiscountResponse: z.ZodObject<{
1049
+ code: z.ZodString;
1050
+ providerDiscountId: z.ZodString;
1051
+ rail: z.ZodEnum<{
1052
+ lemonSqueezy: "lemonSqueezy";
1053
+ paddle: "paddle";
1054
+ stripe: "stripe";
1055
+ }>;
1056
+ }, z.core.$strip>;
1057
+ export type PaymentsDiscountResponse = z.output<typeof PaymentsDiscountResponse>;
1058
+ /**
1059
+ * ## The management read surface
1060
+ *
1061
+ * Everything below answers a **control-plane** route, so it is read by a dashboard across a trust
1062
+ * boundary rather than by the adopter's own app. The `Admin` prefix is what keeps the two apart: a
1063
+ * client's view of its own purchase and a management client's view of everybody's are different
1064
+ * projections with different rules, and one schema doing both would be one edit away from serving the
1065
+ * wider shape to the narrower caller.
1066
+ *
1067
+ * **The provider payload appears nowhere in this file and is not even selected by the queries behind
1068
+ * it** — see `admin/read.ts`. That is where an email address would otherwise reach a purchases list,
1069
+ * since payments stores no address of its own.
1070
+ */
1071
+ /**
1072
+ * One catalog product, as a management client sees it.
1073
+ *
1074
+ * **Strictly less than the client projection already ships, and the reasoning is that file's.**
1075
+ * `clientProjection` argues that a product's Apple and Google SKUs stay server-side because a browser has
1076
+ * no use for them, and that the `grants` block stays there because a currency code and an amount describe
1077
+ * the economy. A management client needs less again: it is filling a list of *things that can be comped*,
1078
+ * and a comp names an entitlement key. So there is no Stripe price id here either — publishable in a
1079
+ * paywall, where it is the thing a Checkout Session names, and simply not this surface's business.
1080
+ *
1081
+ * What `controlPlane.workers.test.ts` asserts is the invariant first: every leaf in the response is one of
1082
+ * these four facts about some product. A field added here carrying anything else fails it whatever the
1083
+ * field is called, which is the point — a projection somebody must remember not to widen is not a control.
1084
+ * Beside it sits a hand-written list of the seven keys that may cross, because the value half alone cannot
1085
+ * police a boolean or a null: `true` and `null` are in every JSON document's vocabulary. That list is
1086
+ * deliberately **not** read off this schema. It was, and a field added here and to the view together
1087
+ * widened the gate by the same edit (#308).
1088
+ */
1089
+ export declare const PaymentsAdminCatalogProduct: z.ZodObject<{
1090
+ id: z.ZodString;
1091
+ type: z.ZodEnum<{
1092
+ consumable: "consumable";
1093
+ non_consumable: "non_consumable";
1094
+ subscription: "subscription";
1095
+ }>;
1096
+ name: z.ZodString;
1097
+ entitlements: z.ZodArray<z.ZodString>;
1098
+ }, z.core.$strip>;
1099
+ export type PaymentsAdminCatalogProduct = z.output<typeof PaymentsAdminCatalogProduct>;
1100
+ /**
1101
+ * `GET {base}/admin/catalog` — what this project sells.
1102
+ *
1103
+ * **`enabled` is the same modeled answer `clientProjection` gives, and deliberately the same shape.** A
1104
+ * catalog with nothing in it answers `{ enabled: false }` rather than an empty list, so "composed with
1105
+ * nothing to sell" is a state a client renders as *there is nothing to comp here* instead of as a dropdown
1106
+ * that came back broken. A catalog that failed to load is not this: it is a non-200, or a body that does
1107
+ * not parse, and a client that branches on `enabled` never confuses the two.
1108
+ *
1109
+ * A discriminated union rather than an optional `products`, because the two states are genuinely different
1110
+ * answers and an optional array makes "empty" and "absent" indistinguishable at the exact moment a caller
1111
+ * needs them apart.
1112
+ */
1113
+ export declare const PaymentsAdminCatalogResponse: z.ZodDiscriminatedUnion<[z.ZodObject<{
1114
+ enabled: z.ZodLiteral<false>;
1115
+ }, z.core.$strip>, z.ZodObject<{
1116
+ enabled: z.ZodLiteral<true>;
1117
+ products: z.ZodArray<z.ZodObject<{
1118
+ id: z.ZodString;
1119
+ type: z.ZodEnum<{
1120
+ consumable: "consumable";
1121
+ non_consumable: "non_consumable";
1122
+ subscription: "subscription";
1123
+ }>;
1124
+ name: z.ZodString;
1125
+ entitlements: z.ZodArray<z.ZodString>;
1126
+ }, z.core.$strip>>;
1127
+ manualEntitlements: z.ZodArray<z.ZodString>;
1128
+ }, z.core.$strip>], "enabled">;
1129
+ export type PaymentsAdminCatalogResponse = z.output<typeof PaymentsAdminCatalogResponse>;
1130
+ /**
1131
+ * One purchase, as a management client sees it.
1132
+ *
1133
+ * Wider than {@link PaymentsPurchaseView} in the two ways an operator needs and a buyer does not: it
1134
+ * names the **owner** — as the pair, always — and it names the **money**. Narrower in one: there is no `outcome`, because
1135
+ * `outcome` says what a *write* did — projected, replayed, ignored — and a read of the log has no write
1136
+ * to report.
1137
+ *
1138
+ * The provider identifiers are kept and the provider *payload* is not, and the line between them is
1139
+ * whether the value is a bearer artifact. A transaction id is the join key an operator pastes into App
1140
+ * Store Connect or the Stripe dashboard to settle a dispute; a receipt is the thing that could be
1141
+ * replayed. The first is the whole point of the pane and the second never leaves the Worker.
1142
+ */
1143
+ export declare const PaymentsAdminPurchaseView: z.ZodObject<{
1144
+ id: z.ZodString;
1145
+ subjectType: z.ZodEnum<{
1146
+ organization: "organization";
1147
+ user: "user";
1148
+ }>;
1149
+ subjectId: z.ZodString;
1150
+ rail: z.ZodEnum<{
1151
+ apple: "apple";
1152
+ google: "google";
1153
+ lemonSqueezy: "lemonSqueezy";
1154
+ paddle: "paddle";
1155
+ stripe: "stripe";
1156
+ }>;
1157
+ providerTransactionId: z.ZodString;
1158
+ originalTransactionId: z.ZodNullable<z.ZodString>;
1159
+ productId: z.ZodString;
1160
+ type: z.ZodEnum<{
1161
+ consumable: "consumable";
1162
+ non_consumable: "non_consumable";
1163
+ subscription: "subscription";
1164
+ }>;
1165
+ status: z.ZodEnum<{
1166
+ active: "active";
1167
+ canceled: "canceled";
1168
+ expired: "expired";
1169
+ in_grace: "in_grace";
1170
+ never_paid: "never_paid";
1171
+ on_hold: "on_hold";
1172
+ paused: "paused";
1173
+ refunded: "refunded";
1174
+ revoked: "revoked";
1175
+ }>;
1176
+ environment: z.ZodEnum<{
1177
+ production: "production";
1178
+ sandbox: "sandbox";
1179
+ }>;
1180
+ amountMinor: z.ZodNullable<z.ZodNumber>;
1181
+ currency: z.ZodNullable<z.ZodString>;
1182
+ purchasedAt: z.ZodISODateTime;
1183
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
1184
+ revokedAt: z.ZodNullable<z.ZodISODateTime>;
1185
+ resumesAt: z.ZodNullable<z.ZodISODateTime>;
1186
+ updatedAt: z.ZodISODateTime;
1187
+ }, z.core.$strip>;
1188
+ export type PaymentsAdminPurchaseView = z.output<typeof PaymentsAdminPurchaseView>;
1189
+ /**
1190
+ * One entitlement, as a management client sees it.
1191
+ *
1192
+ * Wider than {@link PaymentsEntitlementView} by the two facts a buyer has no use for and an operator
1193
+ * cannot work without: **whose** it is, and **why** they have it. `manual` is the difference between an
1194
+ * entitlement somebody paid for and one somebody decided; `source` is the purchase currently granting
1195
+ * it, which answers "why is this subject entitled" without a scan.
1196
+ *
1197
+ * Whose it is crosses as the pair the row is keyed on, `UNIQUE (subjectType, subjectId, entitlement)`. A
1198
+ * dashboard that read only the id would show an organization's `pro` beside a person's name the moment
1199
+ * an adopter's two id spaces met on a value.
1200
+ */
1201
+ export declare const PaymentsAdminEntitlementView: z.ZodObject<{
1202
+ subjectType: z.ZodEnum<{
1203
+ organization: "organization";
1204
+ user: "user";
1205
+ }>;
1206
+ subjectId: z.ZodString;
1207
+ key: z.ZodString;
1208
+ granted: z.ZodBoolean;
1209
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
1210
+ manual: z.ZodBoolean;
1211
+ source: z.ZodNullable<z.ZodString>;
1212
+ }, z.core.$strip>;
1213
+ export type PaymentsAdminEntitlementView = z.output<typeof PaymentsAdminEntitlementView>;
1214
+ /**
1215
+ * One reconciliation pass, as a management client sees it.
1216
+ *
1217
+ * **The positive invariant this response is held to: every field is a count, a timestamp, an enum, or this
1218
+ * run's own id.** Not "no payload field" — a list of forbidden names is a list somebody has to keep, and the
1219
+ * field that leaks is the one nobody thought to forbid. There is no field here whose value comes from a
1220
+ * store, because the run record has no column one could be written into.
1221
+ *
1222
+ * It names no account and no transaction either, which is why it sits behind its own scope: reading whether
1223
+ * the nightly repair is firing is not reading anybody's commerce.
1224
+ */
1225
+ export declare const PaymentsAdminReconcileRunView: z.ZodObject<{
1226
+ id: z.ZodString;
1227
+ startedAt: z.ZodISODateTime;
1228
+ finishedAt: z.ZodISODateTime;
1229
+ environment: z.ZodEnum<{
1230
+ production: "production";
1231
+ sandbox: "sandbox";
1232
+ }>;
1233
+ rail: z.ZodNullable<z.ZodEnum<{
1234
+ apple: "apple";
1235
+ google: "google";
1236
+ lemonSqueezy: "lemonSqueezy";
1237
+ paddle: "paddle";
1238
+ stripe: "stripe";
1239
+ }>>;
1240
+ pages: z.ZodNumber;
1241
+ scanned: z.ZodNumber;
1242
+ unchanged: z.ZodNumber;
1243
+ drifted: z.ZodNumber;
1244
+ superseded: z.ZodNumber;
1245
+ skipped: z.ZodNumber;
1246
+ failed: z.ZodNumber;
1247
+ truncated: z.ZodBoolean;
1248
+ dryRun: z.ZodBoolean;
1249
+ }, z.core.$strip>;
1250
+ export type PaymentsAdminReconcileRunView = z.output<typeof PaymentsAdminReconcileRunView>;
1251
+ /**
1252
+ * `GET {base}/admin/reconcile-runs`.
1253
+ *
1254
+ * An empty page is a real answer and a loud one: reconciliation has never run here, which for a project that
1255
+ * has provisioned the Workflow is the failure the read exists to surface.
1256
+ */
1257
+ export declare const PaymentsAdminReconcileRunsResponse: z.ZodObject<{
1258
+ runs: z.ZodArray<z.ZodObject<{
1259
+ id: z.ZodString;
1260
+ startedAt: z.ZodISODateTime;
1261
+ finishedAt: z.ZodISODateTime;
1262
+ environment: z.ZodEnum<{
1263
+ production: "production";
1264
+ sandbox: "sandbox";
1265
+ }>;
1266
+ rail: z.ZodNullable<z.ZodEnum<{
1267
+ apple: "apple";
1268
+ google: "google";
1269
+ lemonSqueezy: "lemonSqueezy";
1270
+ paddle: "paddle";
1271
+ stripe: "stripe";
1272
+ }>>;
1273
+ pages: z.ZodNumber;
1274
+ scanned: z.ZodNumber;
1275
+ unchanged: z.ZodNumber;
1276
+ drifted: z.ZodNumber;
1277
+ superseded: z.ZodNumber;
1278
+ skipped: z.ZodNumber;
1279
+ failed: z.ZodNumber;
1280
+ truncated: z.ZodBoolean;
1281
+ dryRun: z.ZodBoolean;
1282
+ }, z.core.$strip>>;
1283
+ nextCursor: z.ZodNullable<z.ZodString>;
1284
+ }, z.core.$strip>;
1285
+ export type PaymentsAdminReconcileRunsResponse = z.output<typeof PaymentsAdminReconcileRunsResponse>;
1286
+ /**
1287
+ * `POST {base}/admin/reconcile-runs` — a pass was started, and nothing about how it went.
1288
+ *
1289
+ * **It reports a start, never an outcome.** The pass is a Workflow: it is durable, it retries, and it outlives
1290
+ * the request that began it by minutes. A response claiming what was repaired would have to either block on a
1291
+ * job designed not to be blocked on, or invent the answer — and the answer is the one thing an operator pressed
1292
+ * the button to find out. So this says *started, here is its id*, and the run log is where the tally lands.
1293
+ *
1294
+ * **`started: false` is a real answer rather than an error.** The pass is idempotent and the trigger is too: a
1295
+ * second press while a run is in flight starts nothing and says so, which is a true sentence about somebody's
1296
+ * catalog. Turning that into a 409 would make a nervous operator's second click look like a fault.
1297
+ *
1298
+ * No count, no duration, no "queued position". Every one of those is a number a screen would print and nobody
1299
+ * could stand behind.
1300
+ */
1301
+ export declare const PaymentsAdminReconcileRunStarted: z.ZodObject<{
1302
+ started: z.ZodBoolean;
1303
+ runId: z.ZodNullable<z.ZodString>;
1304
+ }, z.core.$strip>;
1305
+ export type PaymentsAdminReconcileRunStarted = z.output<typeof PaymentsAdminReconcileRunStarted>;
1306
+ /** `GET {base}/admin/purchases`. */
1307
+ export declare const PaymentsAdminPurchasesResponse: z.ZodObject<{
1308
+ purchases: z.ZodArray<z.ZodObject<{
1309
+ id: z.ZodString;
1310
+ subjectType: z.ZodEnum<{
1311
+ organization: "organization";
1312
+ user: "user";
1313
+ }>;
1314
+ subjectId: z.ZodString;
1315
+ rail: z.ZodEnum<{
1316
+ apple: "apple";
1317
+ google: "google";
1318
+ lemonSqueezy: "lemonSqueezy";
1319
+ paddle: "paddle";
1320
+ stripe: "stripe";
1321
+ }>;
1322
+ providerTransactionId: z.ZodString;
1323
+ originalTransactionId: z.ZodNullable<z.ZodString>;
1324
+ productId: z.ZodString;
1325
+ type: z.ZodEnum<{
1326
+ consumable: "consumable";
1327
+ non_consumable: "non_consumable";
1328
+ subscription: "subscription";
1329
+ }>;
1330
+ status: z.ZodEnum<{
1331
+ active: "active";
1332
+ canceled: "canceled";
1333
+ expired: "expired";
1334
+ in_grace: "in_grace";
1335
+ never_paid: "never_paid";
1336
+ on_hold: "on_hold";
1337
+ paused: "paused";
1338
+ refunded: "refunded";
1339
+ revoked: "revoked";
1340
+ }>;
1341
+ environment: z.ZodEnum<{
1342
+ production: "production";
1343
+ sandbox: "sandbox";
1344
+ }>;
1345
+ amountMinor: z.ZodNullable<z.ZodNumber>;
1346
+ currency: z.ZodNullable<z.ZodString>;
1347
+ purchasedAt: z.ZodISODateTime;
1348
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
1349
+ revokedAt: z.ZodNullable<z.ZodISODateTime>;
1350
+ resumesAt: z.ZodNullable<z.ZodISODateTime>;
1351
+ updatedAt: z.ZodISODateTime;
1352
+ }, z.core.$strip>>;
1353
+ nextCursor: z.ZodNullable<z.ZodString>;
1354
+ }, z.core.$strip>;
1355
+ export type PaymentsAdminPurchasesResponse = z.output<typeof PaymentsAdminPurchasesResponse>;
1356
+ /** `GET {base}/admin/subscriptions` — the same rows, narrowed to the ones that renew. */
1357
+ export declare const PaymentsAdminSubscriptionsResponse: z.ZodObject<{
1358
+ subscriptions: z.ZodArray<z.ZodObject<{
1359
+ id: z.ZodString;
1360
+ subjectType: z.ZodEnum<{
1361
+ organization: "organization";
1362
+ user: "user";
1363
+ }>;
1364
+ subjectId: z.ZodString;
1365
+ rail: z.ZodEnum<{
1366
+ apple: "apple";
1367
+ google: "google";
1368
+ lemonSqueezy: "lemonSqueezy";
1369
+ paddle: "paddle";
1370
+ stripe: "stripe";
1371
+ }>;
1372
+ providerTransactionId: z.ZodString;
1373
+ originalTransactionId: z.ZodNullable<z.ZodString>;
1374
+ productId: z.ZodString;
1375
+ type: z.ZodEnum<{
1376
+ consumable: "consumable";
1377
+ non_consumable: "non_consumable";
1378
+ subscription: "subscription";
1379
+ }>;
1380
+ status: z.ZodEnum<{
1381
+ active: "active";
1382
+ canceled: "canceled";
1383
+ expired: "expired";
1384
+ in_grace: "in_grace";
1385
+ never_paid: "never_paid";
1386
+ on_hold: "on_hold";
1387
+ paused: "paused";
1388
+ refunded: "refunded";
1389
+ revoked: "revoked";
1390
+ }>;
1391
+ environment: z.ZodEnum<{
1392
+ production: "production";
1393
+ sandbox: "sandbox";
1394
+ }>;
1395
+ amountMinor: z.ZodNullable<z.ZodNumber>;
1396
+ currency: z.ZodNullable<z.ZodString>;
1397
+ purchasedAt: z.ZodISODateTime;
1398
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
1399
+ revokedAt: z.ZodNullable<z.ZodISODateTime>;
1400
+ resumesAt: z.ZodNullable<z.ZodISODateTime>;
1401
+ updatedAt: z.ZodISODateTime;
1402
+ }, z.core.$strip>>;
1403
+ nextCursor: z.ZodNullable<z.ZodString>;
1404
+ }, z.core.$strip>;
1405
+ export type PaymentsAdminSubscriptionsResponse = z.output<typeof PaymentsAdminSubscriptionsResponse>;
1406
+ /** `GET {base}/admin/entitlements`. */
1407
+ export declare const PaymentsAdminEntitlementsResponse: z.ZodObject<{
1408
+ entitlements: z.ZodArray<z.ZodObject<{
1409
+ subjectType: z.ZodEnum<{
1410
+ organization: "organization";
1411
+ user: "user";
1412
+ }>;
1413
+ subjectId: z.ZodString;
1414
+ key: z.ZodString;
1415
+ granted: z.ZodBoolean;
1416
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
1417
+ manual: z.ZodBoolean;
1418
+ source: z.ZodNullable<z.ZodString>;
1419
+ }, z.core.$strip>>;
1420
+ nextCursor: z.ZodNullable<z.ZodString>;
1421
+ }, z.core.$strip>;
1422
+ export type PaymentsAdminEntitlementsResponse = z.output<typeof PaymentsAdminEntitlementsResponse>;
1423
+ /**
1424
+ * `GET {base}/admin/entitlements/:subjectType/:subjectId`.
1425
+ *
1426
+ * No cursor, because there is no page: the table is keyed `UNIQUE (subjectType, subjectId, entitlement)`,
1427
+ * so this is at most one row per key. A subject holding nothing answers an empty list rather than a 404 —
1428
+ * an entitlement row appears with the first purchase that grants one, so its absence is not a missing
1429
+ * holder, and a 404 would make this an existence oracle for ids.
1430
+ *
1431
+ * Both halves are echoed, and that is the reason this response can stand on its own: a body carrying one
1432
+ * id and a list is a body a client has to remember it asked about an organization. The pair it asked with
1433
+ * comes back verbatim, so what it renders is what it requested.
1434
+ */
1435
+ export declare const PaymentsAdminSubjectEntitlementsResponse: z.ZodObject<{
1436
+ subjectType: z.ZodEnum<{
1437
+ organization: "organization";
1438
+ user: "user";
1439
+ }>;
1440
+ subjectId: z.ZodString;
1441
+ entitlements: z.ZodArray<z.ZodObject<{
1442
+ subjectType: z.ZodEnum<{
1443
+ organization: "organization";
1444
+ user: "user";
1445
+ }>;
1446
+ subjectId: z.ZodString;
1447
+ key: z.ZodString;
1448
+ granted: z.ZodBoolean;
1449
+ expiresAt: z.ZodNullable<z.ZodISODateTime>;
1450
+ manual: z.ZodBoolean;
1451
+ source: z.ZodNullable<z.ZodString>;
1452
+ }, z.core.$strip>>;
1453
+ }, z.core.$strip>;
1454
+ export type PaymentsAdminSubjectEntitlementsResponse = z.output<typeof PaymentsAdminSubjectEntitlementsResponse>;
1455
+ //# sourceMappingURL=responses.d.ts.map