@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,173 @@
1
+ import { PAYMENTS_NO_BROWSER } from "./api.js";
2
+ import { loadPaddle } from "./paddle.js";
3
+ //#region src/client/checkout.ts
4
+ /**
5
+ * Opening a Paddle checkout over the adopter's own page, or inside it.
6
+ *
7
+ * This is the half of the rail a redirect cannot do. `startCheckout` on a redirect rail sends the browser
8
+ * to somebody else's domain and the sale finishes there; Paddle's overlay draws the card form over the
9
+ * page the buyer was already on, and its inline mode draws it *in* the page, in a container the screen
10
+ * put there. Nothing about the money moves — Paddle is still the merchant of record, still owns SCA, tax
11
+ * and the card fields — but the buyer never leaves.
12
+ *
13
+ * ## `items[]` or `transactionId`, settled
14
+ *
15
+ * Paddle offers two ways to open a checkout. `items: [{ priceId, quantity }]` needs no server at all: a
16
+ * page with the publishable client token can open a checkout in one click, which is the single most
17
+ * pleasant thing about this provider. `transactionId` needs a round trip first, because a transaction is
18
+ * something the server creates.
19
+ *
20
+ * **This kit only ever opens a transaction, and the reason is the price and the buyer — not the stamp.**
21
+ * `items[]` lets the page name what is being sold and to whom, and every other route in this capability
22
+ * takes the price from the catalog entry a product id resolves to precisely so a client cannot buy Pro
23
+ * for the price of a coin pack. There is no reading under which that rule holds at `POST /checkout` and
24
+ * stops holding here. So the cost is one round trip before the overlay appears, paid once per purchase.
25
+ *
26
+ * **What `transactionId` does not buy is the ownership stamp, and that was measured rather than assumed.**
27
+ * #309 argued the stamp needed no proof because `Paddle.Checkout.open` refuses `customData` beside a
28
+ * transaction id. It does not refuse it. Against the live sandbox on 2026-08-13: a server-created
29
+ * transaction stamped `pithy_user: "server-owner"` was opened with
30
+ * `Paddle.Checkout.open({ transactionId, customData: { pithy_user: "attacker", … } })` from a page holding
31
+ * only the publishable client token, paid with a test card, and came back from `GET /transactions/{id}`
32
+ * carrying the attacker's values — same id, `origin` still `"api"`, stamp replaced. The recording is
33
+ * `../rails/paddle/fixtures/browserForged.ts` and the refusal is gated on it.
34
+ *
35
+ * So the two halves are independent, and both are needed. The transaction fixes what is sold; the MAC over
36
+ * `(environment, user)` keyed on the destination secret is the *only* thing that fixes who it belongs to,
37
+ * on either form of the call. See `../rails/paddle/objects.ts` for that half in full, and
38
+ * {@link PaddleCheckoutOpen} in `./paddle` for the type that keeps this one unrepresentable rather than
39
+ * merely conventional.
40
+ *
41
+ * ## How it looks is the caller's to say, and only what Paddle lets code say
42
+ *
43
+ * `theme`, `locale` and `variant` are passed through from the caller and are **never inferred**. No
44
+ * `prefers-color-scheme`, no `matchMedia`, no reading a computed style off the page. The OS preference is
45
+ * not the app's theme: an app with its own light/dark toggle, or one that is dark whatever the machine
46
+ * says, would get a card form contradicting the page it opened over — and a wrong guess is far harder to
47
+ * find than an option nobody passed. The adopter knows. So this takes it, and defaults to Paddle's default
48
+ * by saying nothing.
49
+ *
50
+ * **Saying nothing is a real message.** An omitted setting must reach `Checkout.open` as an absent key,
51
+ * not as a key holding `undefined`, because these overlay account-level settings a seller configured in
52
+ * the Paddle dashboard. {@link settingsFor} builds them one at a time for that reason, and the tests assert
53
+ * on `Object.keys` rather than on values.
54
+ *
55
+ * **Colors and fonts are not here because they are not anywhere in code.** Paddle configures them in its
56
+ * own dashboard — *Checkout → Branded inline checkout* for the 50-odd inline options, logo and brand
57
+ * color for the overlay. That is Paddle's product decision rather than a missing endpoint, and the one
58
+ * API that writes `primary_checkout_color` is a Partners route for a platform configuring another
59
+ * seller's account. Nothing to add here, and nothing to go looking for.
60
+ *
61
+ * ## Nothing here throws
62
+ *
63
+ * `Paddle.Checkout.open` is synchronous and returns nothing, so its only way to report a problem is to
64
+ * throw — inside a click handler, where an unhandled rejection is what a buyer gets instead of a card
65
+ * form. Every path through this module answers with a {@link PaymentsFailure} or with null.
66
+ */
67
+ /** A screen said `inline`, and there is no element with that class on the page to render into. */
68
+ const PADDLE_NO_CONTAINER = {
69
+ code: "client/paddle_no_container",
70
+ message: "We couldn't show the payment form.",
71
+ action: "Reload the page. If it keeps happening, this screen is missing its checkout container."
72
+ };
73
+ /** Paddle.js refused to open the checkout. A transaction it will not sell, or one already completed. */
74
+ const PADDLE_CHECKOUT_REFUSED = {
75
+ code: "client/paddle_checkout_refused",
76
+ message: "We couldn't open the payment form.",
77
+ action: "Try again in a moment."
78
+ };
79
+ /**
80
+ * The default styling of an inline checkout's container.
81
+ *
82
+ * Paddle's own recommendation, and `min-width` in it is a compliance requirement rather than taste: the
83
+ * inline frame carries the footer naming Paddle as merchant of record, and below 312px that footer is cut
84
+ * off. A default here rather than in the scaffolded screen keeps the number out of a file Pithy may never
85
+ * rewrite — and a screen that wants its own passes one.
86
+ */
87
+ const PADDLE_FRAME_STYLE = "width: 100%; min-width: 312px; background-color: transparent; border: none;";
88
+ /** The container's height in pixels before the frame resizes itself. Paddle's recommended 450. */
89
+ const PADDLE_FRAME_HEIGHT = 450;
90
+ /** The document to consult — the injected one, else the browser's own, else none. */
91
+ function documentOf(options) {
92
+ if (options && "document" in options) return options.document;
93
+ return globalThis.document;
94
+ }
95
+ /**
96
+ * The presentation settings the caller actually named, and no key for the ones they did not.
97
+ *
98
+ * **Assigned one at a time rather than spread, and that is the whole point of the function.**
99
+ * `{ theme: options?.theme }` writes the key whatever the value is, and a key holding `undefined` is not
100
+ * the same object as no key: `"theme" in settings` is true for one and false for the other, and Paddle's
101
+ * settings sit over defaults a seller configured in its dashboard. A caller who passed nothing must not
102
+ * silently overrule an account that did.
103
+ *
104
+ * Nothing is inferred here. There is no branch that reads the environment, because the option not being
105
+ * set is an answer — take Paddle's default — rather than a question to go and resolve.
106
+ */
107
+ function presentationOf(options) {
108
+ const presentation = {};
109
+ if (options?.theme !== void 0) presentation.theme = options.theme;
110
+ if (options?.locale !== void 0) presentation.locale = options.locale;
111
+ if (options?.variant !== void 0) presentation.variant = options.variant;
112
+ return presentation;
113
+ }
114
+ /**
115
+ * How this checkout is presented, or the refusal that stops it being opened at all.
116
+ *
117
+ * Inline is checked here rather than left to Paddle because of what Paddle does instead. Measured against
118
+ * the live sandbox: `Checkout.open` with a `frameTarget` matching no element throws synchronously, out of
119
+ * the call, with `TypeError: Cannot read properties of undefined (reading 'appendChild')`. That is a real
120
+ * refusal and it is caught below — but it is somebody else's minified stack trace, and the honest thing to
121
+ * tell a screen is that it is missing its container.
122
+ */
123
+ function settingsFor(handoff, options) {
124
+ const base = {
125
+ displayMode: handoff.displayMode,
126
+ successUrl: handoff.successUrl,
127
+ ...presentationOf(options)
128
+ };
129
+ if (handoff.displayMode !== "inline") return { settings: base };
130
+ const document = documentOf(options);
131
+ if (document === void 0) return { failure: PAYMENTS_NO_BROWSER };
132
+ const frameTarget = options?.frameTarget;
133
+ if (frameTarget === void 0 || frameTarget === "") return { failure: PADDLE_NO_CONTAINER };
134
+ if (document.getElementsByClassName(frameTarget).length === 0) return { failure: PADDLE_NO_CONTAINER };
135
+ return { settings: {
136
+ ...base,
137
+ frameTarget,
138
+ frameStyle: options?.frameStyle ?? "width: 100%; min-width: 312px; background-color: transparent; border: none;",
139
+ frameInitialHeight: options?.frameInitialHeight ?? 450
140
+ } };
141
+ }
142
+ /**
143
+ * Open the checkout the server handed back, over this page or inside it.
144
+ *
145
+ * Loads Paddle.js if it is not loaded, from the token and environment on the handoff itself — so a screen
146
+ * needs no second source of truth for which Paddle account it is selling through, and a handoff for one
147
+ * account cannot open against another page's Paddle. Returns null when the checkout opened, and a failure
148
+ * to render otherwise.
149
+ *
150
+ * **The container must be on the page before this is called.** In React that means an effect rather than
151
+ * a click handler: the render that reveals the container has to commit first. `usePaddleCheckout` in
152
+ * `./hooks` is that ordering, written once.
153
+ */
154
+ async function openPaddleCheckout(handoff, options) {
155
+ const prepared = settingsFor(handoff, options);
156
+ if ("failure" in prepared) return prepared.failure;
157
+ const loaded = await loadPaddle({
158
+ clientToken: handoff.clientToken,
159
+ environment: handoff.environment
160
+ }, options);
161
+ if (!loaded.ok) return loaded.failure;
162
+ try {
163
+ loaded.value.Checkout.open({
164
+ transactionId: handoff.transactionId,
165
+ settings: prepared.settings
166
+ });
167
+ } catch {
168
+ return PADDLE_CHECKOUT_REFUSED;
169
+ }
170
+ return null;
171
+ }
172
+ //#endregion
173
+ export { PADDLE_CHECKOUT_REFUSED, PADDLE_FRAME_HEIGHT, PADDLE_FRAME_STYLE, PADDLE_NO_CONTAINER, openPaddleCheckout };
@@ -0,0 +1,89 @@
1
+ //#region src/client/fixtures/price-preview-de.json
2
+ var price_preview_de_default = {
3
+ customerId: null,
4
+ addressId: null,
5
+ businessId: null,
6
+ currencyCode: "USD",
7
+ address: {
8
+ "postalCode": "10115",
9
+ "countryCode": "DE"
10
+ },
11
+ customerIpAddress: null,
12
+ discountId: null,
13
+ details: { "lineItems": [{
14
+ "price": {
15
+ "id": "pri_01kzvyz9e21z9vbhd7xqq3csyh",
16
+ "description": "Solo, monthly. $5/month.",
17
+ "type": "standard",
18
+ "name": "Monthly",
19
+ "productId": "pro_01kzvyz95263x6amf3w4cgbqh4",
20
+ "billingCycle": {
21
+ "interval": "month",
22
+ "frequency": 1
23
+ },
24
+ "trialPeriod": null,
25
+ "taxMode": "location",
26
+ "unitPrice": {
27
+ "amount": "500",
28
+ "currencyCode": "USD"
29
+ },
30
+ "unitPriceOverrides": [],
31
+ "customData": { "tier": "solo" },
32
+ "quantity": {
33
+ "minimum": 1,
34
+ "maximum": 1
35
+ },
36
+ "status": "active",
37
+ "createdAt": "2026-08-12T21:45:05.730177Z",
38
+ "updatedAt": "2026-08-12T21:45:05.730178Z",
39
+ "importMeta": null
40
+ },
41
+ "quantity": 1,
42
+ "taxRate": "0.19",
43
+ "unitTotals": {
44
+ "subtotal": "420",
45
+ "discount": "0",
46
+ "tax": "80",
47
+ "total": "500"
48
+ },
49
+ "formattedUnitTotals": {
50
+ "subtotal": "$4.20",
51
+ "discount": "$0.00",
52
+ "tax": "$0.80",
53
+ "total": "$5.00"
54
+ },
55
+ "totals": {
56
+ "subtotal": "420",
57
+ "discount": "0",
58
+ "tax": "80",
59
+ "total": "500"
60
+ },
61
+ "formattedTotals": {
62
+ "subtotal": "$4.20",
63
+ "discount": "$0.00",
64
+ "tax": "$0.80",
65
+ "total": "$5.00"
66
+ },
67
+ "product": {
68
+ "id": "pro_01kzvyz95263x6amf3w4cgbqh4",
69
+ "name": "Solo",
70
+ "description": "One person, working from a browser rather than a terminal.",
71
+ "type": "standard",
72
+ "taxCategory": "saas",
73
+ "imageUrl": null,
74
+ "customData": { "tier": "solo" },
75
+ "status": "active",
76
+ "importMeta": null,
77
+ "createdAt": "2026-08-12T21:45:05.442Z",
78
+ "updatedAt": "2026-08-12T21:45:05.442Z"
79
+ },
80
+ "discounts": []
81
+ }] },
82
+ availablePaymentMethods: [
83
+ "card",
84
+ "paypal",
85
+ "apple_pay"
86
+ ]
87
+ };
88
+ //#endregion
89
+ export { price_preview_de_default as default };
@@ -0,0 +1,89 @@
1
+ //#region src/client/fixtures/price-preview-gb.json
2
+ var price_preview_gb_default = {
3
+ customerId: null,
4
+ addressId: null,
5
+ businessId: null,
6
+ currencyCode: "USD",
7
+ address: {
8
+ "postalCode": "SW1A 1AA",
9
+ "countryCode": "GB"
10
+ },
11
+ customerIpAddress: null,
12
+ discountId: null,
13
+ details: { "lineItems": [{
14
+ "price": {
15
+ "id": "pri_01kzvyz9e21z9vbhd7xqq3csyh",
16
+ "description": "Solo, monthly. $5/month.",
17
+ "type": "standard",
18
+ "name": "Monthly",
19
+ "productId": "pro_01kzvyz95263x6amf3w4cgbqh4",
20
+ "billingCycle": {
21
+ "interval": "month",
22
+ "frequency": 1
23
+ },
24
+ "trialPeriod": null,
25
+ "taxMode": "location",
26
+ "unitPrice": {
27
+ "amount": "500",
28
+ "currencyCode": "USD"
29
+ },
30
+ "unitPriceOverrides": [],
31
+ "customData": { "tier": "solo" },
32
+ "quantity": {
33
+ "minimum": 1,
34
+ "maximum": 1
35
+ },
36
+ "status": "active",
37
+ "createdAt": "2026-08-12T21:45:05.730177Z",
38
+ "updatedAt": "2026-08-12T21:45:05.730178Z",
39
+ "importMeta": null
40
+ },
41
+ "quantity": 1,
42
+ "taxRate": "0.2",
43
+ "unitTotals": {
44
+ "subtotal": "417",
45
+ "discount": "0",
46
+ "tax": "83",
47
+ "total": "500"
48
+ },
49
+ "formattedUnitTotals": {
50
+ "subtotal": "$4.17",
51
+ "discount": "$0.00",
52
+ "tax": "$0.83",
53
+ "total": "$5.00"
54
+ },
55
+ "totals": {
56
+ "subtotal": "417",
57
+ "discount": "0",
58
+ "tax": "83",
59
+ "total": "500"
60
+ },
61
+ "formattedTotals": {
62
+ "subtotal": "$4.17",
63
+ "discount": "$0.00",
64
+ "tax": "$0.83",
65
+ "total": "$5.00"
66
+ },
67
+ "product": {
68
+ "id": "pro_01kzvyz95263x6amf3w4cgbqh4",
69
+ "name": "Solo",
70
+ "description": "One person, working from a browser rather than a terminal.",
71
+ "type": "standard",
72
+ "taxCategory": "saas",
73
+ "imageUrl": null,
74
+ "customData": { "tier": "solo" },
75
+ "status": "active",
76
+ "importMeta": null,
77
+ "createdAt": "2026-08-12T21:45:05.442Z",
78
+ "updatedAt": "2026-08-12T21:45:05.442Z"
79
+ },
80
+ "discounts": []
81
+ }] },
82
+ availablePaymentMethods: [
83
+ "card",
84
+ "paypal",
85
+ "apple_pay"
86
+ ]
87
+ };
88
+ //#endregion
89
+ export { price_preview_gb_default as default };
@@ -0,0 +1,89 @@
1
+ //#region src/client/fixtures/price-preview-jp-yen.json
2
+ var price_preview_jp_yen_default = {
3
+ customerId: null,
4
+ addressId: null,
5
+ businessId: null,
6
+ currencyCode: "JPY",
7
+ address: {
8
+ "postalCode": "1000001",
9
+ "countryCode": "JP"
10
+ },
11
+ customerIpAddress: null,
12
+ discountId: null,
13
+ details: { "lineItems": [{
14
+ "price": {
15
+ "id": "pri_01kzvyz9e21z9vbhd7xqq3csyh",
16
+ "description": "Solo, monthly. $5/month.",
17
+ "type": "standard",
18
+ "name": "Monthly",
19
+ "productId": "pro_01kzvyz95263x6amf3w4cgbqh4",
20
+ "billingCycle": {
21
+ "interval": "month",
22
+ "frequency": 1
23
+ },
24
+ "trialPeriod": null,
25
+ "taxMode": "location",
26
+ "unitPrice": {
27
+ "amount": "500",
28
+ "currencyCode": "USD"
29
+ },
30
+ "unitPriceOverrides": [],
31
+ "customData": { "tier": "solo" },
32
+ "quantity": {
33
+ "minimum": 1,
34
+ "maximum": 1
35
+ },
36
+ "status": "active",
37
+ "createdAt": "2026-08-12T21:45:05.730177Z",
38
+ "updatedAt": "2026-08-12T21:45:05.730178Z",
39
+ "importMeta": null
40
+ },
41
+ "quantity": 1,
42
+ "taxRate": "0.1",
43
+ "unitTotals": {
44
+ "subtotal": "725",
45
+ "discount": "0",
46
+ "tax": "73",
47
+ "total": "798"
48
+ },
49
+ "formattedUnitTotals": {
50
+ "subtotal": "¥725",
51
+ "discount": "¥0",
52
+ "tax": "¥73",
53
+ "total": "¥798"
54
+ },
55
+ "totals": {
56
+ "subtotal": "725",
57
+ "discount": "0",
58
+ "tax": "73",
59
+ "total": "798"
60
+ },
61
+ "formattedTotals": {
62
+ "subtotal": "¥725",
63
+ "discount": "¥0",
64
+ "tax": "¥73",
65
+ "total": "¥798"
66
+ },
67
+ "product": {
68
+ "id": "pro_01kzvyz95263x6amf3w4cgbqh4",
69
+ "name": "Solo",
70
+ "description": "One person, working from a browser rather than a terminal.",
71
+ "type": "standard",
72
+ "taxCategory": "saas",
73
+ "imageUrl": null,
74
+ "customData": { "tier": "solo" },
75
+ "status": "active",
76
+ "importMeta": null,
77
+ "createdAt": "2026-08-12T21:45:05.442Z",
78
+ "updatedAt": "2026-08-12T21:45:05.442Z"
79
+ },
80
+ "discounts": []
81
+ }] },
82
+ availablePaymentMethods: [
83
+ "card",
84
+ "paypal",
85
+ "apple_pay"
86
+ ]
87
+ };
88
+ //#endregion
89
+ export { price_preview_jp_yen_default as default };
@@ -0,0 +1,89 @@
1
+ //#region src/client/fixtures/price-preview-us-country-only.json
2
+ var price_preview_us_country_only_default = {
3
+ customerId: null,
4
+ addressId: null,
5
+ businessId: null,
6
+ currencyCode: "USD",
7
+ address: {
8
+ "postalCode": "",
9
+ "countryCode": "US"
10
+ },
11
+ customerIpAddress: null,
12
+ discountId: null,
13
+ details: { "lineItems": [{
14
+ "price": {
15
+ "id": "pri_01kzvyz9e21z9vbhd7xqq3csyh",
16
+ "description": "Solo, monthly. $5/month.",
17
+ "type": "standard",
18
+ "name": "Monthly",
19
+ "productId": "pro_01kzvyz95263x6amf3w4cgbqh4",
20
+ "billingCycle": {
21
+ "interval": "month",
22
+ "frequency": 1
23
+ },
24
+ "trialPeriod": null,
25
+ "taxMode": "location",
26
+ "unitPrice": {
27
+ "amount": "500",
28
+ "currencyCode": "USD"
29
+ },
30
+ "unitPriceOverrides": [],
31
+ "customData": { "tier": "solo" },
32
+ "quantity": {
33
+ "minimum": 1,
34
+ "maximum": 1
35
+ },
36
+ "status": "active",
37
+ "createdAt": "2026-08-12T21:45:05.730177Z",
38
+ "updatedAt": "2026-08-12T21:45:05.730178Z",
39
+ "importMeta": null
40
+ },
41
+ "quantity": 1,
42
+ "taxRate": "0",
43
+ "unitTotals": {
44
+ "subtotal": "500",
45
+ "discount": "0",
46
+ "tax": "0",
47
+ "total": "500"
48
+ },
49
+ "formattedUnitTotals": {
50
+ "subtotal": "$5.00",
51
+ "discount": "$0.00",
52
+ "tax": "$0.00",
53
+ "total": "$5.00"
54
+ },
55
+ "totals": {
56
+ "subtotal": "500",
57
+ "discount": "0",
58
+ "tax": "0",
59
+ "total": "500"
60
+ },
61
+ "formattedTotals": {
62
+ "subtotal": "$5.00",
63
+ "discount": "$0.00",
64
+ "tax": "$0.00",
65
+ "total": "$5.00"
66
+ },
67
+ "product": {
68
+ "id": "pro_01kzvyz95263x6amf3w4cgbqh4",
69
+ "name": "Solo",
70
+ "description": "One person, working from a browser rather than a terminal.",
71
+ "type": "standard",
72
+ "taxCategory": "saas",
73
+ "imageUrl": null,
74
+ "customData": { "tier": "solo" },
75
+ "status": "active",
76
+ "importMeta": null,
77
+ "createdAt": "2026-08-12T21:45:05.442Z",
78
+ "updatedAt": "2026-08-12T21:45:05.442Z"
79
+ },
80
+ "discounts": []
81
+ }] },
82
+ availablePaymentMethods: [
83
+ "card",
84
+ "paypal",
85
+ "apple_pay"
86
+ ]
87
+ };
88
+ //#endregion
89
+ export { price_preview_us_country_only_default as default };
@@ -0,0 +1,89 @@
1
+ //#region src/client/fixtures/price-preview-us-new-york.json
2
+ var price_preview_us_new_york_default = {
3
+ customerId: null,
4
+ addressId: null,
5
+ businessId: null,
6
+ currencyCode: "USD",
7
+ address: {
8
+ "postalCode": "10001",
9
+ "countryCode": "US"
10
+ },
11
+ customerIpAddress: null,
12
+ discountId: null,
13
+ details: { "lineItems": [{
14
+ "price": {
15
+ "id": "pri_01kzvyz9e21z9vbhd7xqq3csyh",
16
+ "description": "Solo, monthly. $5/month.",
17
+ "type": "standard",
18
+ "name": "Monthly",
19
+ "productId": "pro_01kzvyz95263x6amf3w4cgbqh4",
20
+ "billingCycle": {
21
+ "interval": "month",
22
+ "frequency": 1
23
+ },
24
+ "trialPeriod": null,
25
+ "taxMode": "location",
26
+ "unitPrice": {
27
+ "amount": "500",
28
+ "currencyCode": "USD"
29
+ },
30
+ "unitPriceOverrides": [],
31
+ "customData": { "tier": "solo" },
32
+ "quantity": {
33
+ "minimum": 1,
34
+ "maximum": 1
35
+ },
36
+ "status": "active",
37
+ "createdAt": "2026-08-12T21:45:05.730177Z",
38
+ "updatedAt": "2026-08-12T21:45:05.730178Z",
39
+ "importMeta": null
40
+ },
41
+ "quantity": 1,
42
+ "taxRate": "0.08875",
43
+ "unitTotals": {
44
+ "subtotal": "500",
45
+ "discount": "0",
46
+ "tax": "44",
47
+ "total": "544"
48
+ },
49
+ "formattedUnitTotals": {
50
+ "subtotal": "$5.00",
51
+ "discount": "$0.00",
52
+ "tax": "$0.44",
53
+ "total": "$5.44"
54
+ },
55
+ "totals": {
56
+ "subtotal": "500",
57
+ "discount": "0",
58
+ "tax": "44",
59
+ "total": "544"
60
+ },
61
+ "formattedTotals": {
62
+ "subtotal": "$5.00",
63
+ "discount": "$0.00",
64
+ "tax": "$0.44",
65
+ "total": "$5.44"
66
+ },
67
+ "product": {
68
+ "id": "pro_01kzvyz95263x6amf3w4cgbqh4",
69
+ "name": "Solo",
70
+ "description": "One person, working from a browser rather than a terminal.",
71
+ "type": "standard",
72
+ "taxCategory": "saas",
73
+ "imageUrl": null,
74
+ "customData": { "tier": "solo" },
75
+ "status": "active",
76
+ "importMeta": null,
77
+ "createdAt": "2026-08-12T21:45:05.442Z",
78
+ "updatedAt": "2026-08-12T21:45:05.442Z"
79
+ },
80
+ "discounts": []
81
+ }] },
82
+ availablePaymentMethods: [
83
+ "card",
84
+ "paypal",
85
+ "apple_pay"
86
+ ]
87
+ };
88
+ //#endregion
89
+ export { price_preview_us_new_york_default as default };
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Five real `PricePreview` answers, recorded from the Paddle **sandbox** on 2026-08-13 against one
3
+ * $5.00/month price with no `unit_price_overrides`.
4
+ *
5
+ * They exist because the claim this rail makes — "prices render localized and tax-correct" — is a claim
6
+ * about numbers Paddle chooses, and a test written against numbers *we* chose proves only that our
7
+ * arithmetic agrees with itself. Each of these was fetched, not composed, and each pins a different
8
+ * behavior of Paddle's that the reader has to get right:
9
+ *
10
+ * | Fixture | Subtotal | Tax | Total | What it pins |
11
+ * |---|---|---|---|---|
12
+ * | {@link US_NEW_YORK} | $5.00 | $0.44 | $5.44 | Tax **added** on top of the listed price. |
13
+ * | {@link US_COUNTRY_ONLY} | $5.00 | $0.00 | $5.00 | The same country with no postal code resolves **0% tax**. |
14
+ * | {@link GB} | $4.17 | $0.83 | $5.00 | VAT taken **out of** the listed price. |
15
+ * | {@link DE} | $4.20 | $0.80 | $5.00 | The same convention, a different rate. |
16
+ * | {@link JP_YEN} | ¥725 | ¥73 | ¥798 | A **zero-decimal** currency, and a converted amount. |
17
+ *
18
+ * Two facts these recordings carry that are easy to state wrongly from memory:
19
+ *
20
+ * **Currency is not localized.** Every response but the last is in USD, from a UK, German and Japanese
21
+ * address alike. Currency comes from `unit_price_overrides` in the catalog, and this price has none.
22
+ * What localizes without them is tax and formatting.
23
+ *
24
+ * **A converted amount is not a stable number.** {@link JP_YEN} was fetched twice minutes apart and
25
+ * returned ¥797 then ¥798 — Paddle's FX rate moved between the calls. Nothing may assert an exact
26
+ * converted figure against a live account; that is what a recording is for.
27
+ *
28
+ * **They carry the envelope, because that is what `PricePreview()` resolves.** Each JSON file below
29
+ * holds a recorded `data` payload; the exported value wraps it as `{ data }`, which is the shape the
30
+ * reader is actually handed. That wrapping is not cosmetic and it is the whole of `#416`: these five
31
+ * were originally exported unwrapped, `readPricePreview` was written to match them, and the reader
32
+ * therefore refused every real answer while this suite stayed green. A recording saved at the wrong
33
+ * depth is a gate that cannot fail. The envelope was verified against a live sandbox call on
34
+ * 2026-08-18 — top-level keys `data` and `meta`.
35
+ *
36
+ * `meta` is not recorded here. The live envelope carries `{ requestId: "715c7a82-…" }` — verified, not
37
+ * assumed — and nothing in this package reads it. It is left out because a fixture carrying a field no
38
+ * reader consults is an invitation to start consulting it, and because a per-call id pinned in a
39
+ * checked-in file is a value that was never true twice.
40
+ *
41
+ * Typed `unknown` on purpose. These are the input to {@link readPricePreview}, which is a trust
42
+ * boundary, and handing it a value TypeScript already believes would test the guard against itself.
43
+ */
44
+ /** New York, 10001. 8.875% added on top of a $5.00 listed price. */
45
+ export declare const US_NEW_YORK: unknown;
46
+ /** The United States with no postal code. Tax resolves to zero, and the buyer will still pay $5.44. */
47
+ export declare const US_COUNTRY_ONLY: unknown;
48
+ /** London, SW1A 1AA. 20% VAT taken out of an inclusive $5.00. */
49
+ export declare const GB: unknown;
50
+ /** Berlin, 10115. 19% VAT, same inclusive convention, different rate. */
51
+ export declare const DE: unknown;
52
+ /** Tokyo, with `currencyCode: "JPY"` forced. Whole yen — ¥725, not ¥72500. */
53
+ export declare const JP_YEN: unknown;
54
+ //# sourceMappingURL=pricePreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricePreview.d.ts","sourceRoot":"","sources":["../../../src/client/fixtures/pricePreview.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,oEAAoE;AACpE,eAAO,MAAM,WAAW,EAAE,OAA6B,CAAC;AAExD,uGAAuG;AACvG,eAAO,MAAM,eAAe,EAAE,OAAiC,CAAC;AAEhE,iEAAiE;AACjE,eAAO,MAAM,EAAE,EAAE,OAAsB,CAAC;AAExC,yEAAyE;AACzE,eAAO,MAAM,EAAE,EAAE,OAAsB,CAAC;AAExC,8EAA8E;AAC9E,eAAO,MAAM,MAAM,EAAE,OAAyB,CAAC"}