@pithy-sh/payments 0.1.3 → 0.1.5

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 (271) hide show
  1. package/dist/admin/coverage.d.ts +2 -0
  2. package/dist/admin/coverage.js +2 -0
  3. package/dist/admin/read.d.ts +2 -0
  4. package/dist/admin/read.js +2 -0
  5. package/dist/audit/actions.d.ts +2 -0
  6. package/dist/audit/actions.js +2 -0
  7. package/dist/capability.d.ts +2 -0
  8. package/dist/capability.js +2 -0
  9. package/dist/client/api.d.ts +2 -0
  10. package/dist/client/api.js +2 -0
  11. package/dist/client/checkout.d.ts +2 -0
  12. package/dist/client/checkout.js +2 -0
  13. package/dist/client/fixtures/price-preview-de.js +2 -0
  14. package/dist/client/fixtures/price-preview-gb.js +2 -0
  15. package/dist/client/fixtures/price-preview-jp-yen.js +2 -0
  16. package/dist/client/fixtures/price-preview-us-country-only.js +2 -0
  17. package/dist/client/fixtures/price-preview-us-new-york.js +2 -0
  18. package/dist/client/fixtures/pricePreview.d.ts +2 -0
  19. package/dist/client/fixtures/pricePreview.js +2 -0
  20. package/dist/client/hooks.d.ts +2 -0
  21. package/dist/client/hooks.js +2 -0
  22. package/dist/client/paddle.d.ts +2 -0
  23. package/dist/client/paddle.js +2 -0
  24. package/dist/client/paddleCache.d.ts +2 -0
  25. package/dist/client/paddleCache.js +2 -0
  26. package/dist/client/paddlePrices.d.ts +2 -0
  27. package/dist/client/paddlePrices.js +2 -0
  28. package/dist/client/paddlePricesTag.d.ts +2 -0
  29. package/dist/client/paddlePricesTag.js +2 -0
  30. package/dist/client/projection.d.ts +2 -0
  31. package/dist/client/projection.js +2 -0
  32. package/dist/client/test-utils/cacheStore.d.ts +2 -0
  33. package/dist/client/test-utils/cacheStore.js +2 -0
  34. package/dist/client/wholeUnits.d.ts +2 -0
  35. package/dist/client/wholeUnits.js +2 -0
  36. package/dist/config/config.d.ts +2 -0
  37. package/dist/config/config.js +2 -0
  38. package/dist/data/discount.d.ts +2 -0
  39. package/dist/data/discount.js +2 -0
  40. package/dist/data/entitlement.d.ts +2 -0
  41. package/dist/data/entitlement.js +2 -0
  42. package/dist/data/money.d.ts +2 -0
  43. package/dist/data/money.js +2 -0
  44. package/dist/data/pause.d.ts +2 -0
  45. package/dist/data/pause.js +2 -0
  46. package/dist/data/providerAccount.d.ts +2 -0
  47. package/dist/data/providerAccount.js +2 -0
  48. package/dist/data/purchase.d.ts +2 -0
  49. package/dist/data/purchase.js +2 -0
  50. package/dist/data/rail.d.ts +2 -0
  51. package/dist/data/rail.js +2 -0
  52. package/dist/data/reconcileRun.d.ts +2 -0
  53. package/dist/data/reconcileRun.js +2 -0
  54. package/dist/data/renderMoney.d.ts +2 -0
  55. package/dist/data/renderMoney.js +2 -0
  56. package/dist/data/status.d.ts +2 -0
  57. package/dist/data/status.js +2 -0
  58. package/dist/data/subject.d.ts +2 -0
  59. package/dist/data/subject.js +2 -0
  60. package/dist/data/subscription.d.ts +2 -0
  61. package/dist/data/subscription.js +2 -0
  62. package/dist/data/syncCursor.d.ts +2 -0
  63. package/dist/data/syncCursor.js +2 -0
  64. package/dist/data/tables.d.ts +2 -0
  65. package/dist/data/tables.js +2 -0
  66. package/dist/data/webhookEvent.d.ts +2 -0
  67. package/dist/data/webhookEvent.js +2 -0
  68. package/dist/entitlement/manual.d.ts +2 -0
  69. package/dist/entitlement/manual.js +2 -0
  70. package/dist/entitlement/resolver.d.ts +2 -0
  71. package/dist/entitlement/resolver.js +2 -0
  72. package/dist/entitlement/subjectSeam.d.ts +2 -0
  73. package/dist/entitlement/subjectSeam.js +2 -0
  74. package/dist/error/errors.d.ts +2 -0
  75. package/dist/error/errors.js +2 -0
  76. package/dist/grants/apply.d.ts +2 -0
  77. package/dist/grants/apply.js +2 -0
  78. package/dist/grants/clawback.d.ts +2 -0
  79. package/dist/grants/clawback.js +2 -0
  80. package/dist/grants/ledgerSeam.d.ts +2 -0
  81. package/dist/grants/ledgerSeam.js +2 -0
  82. package/dist/http/dispatch.d.ts +2 -0
  83. package/dist/http/dispatch.js +2 -0
  84. package/dist/http/guards.d.ts +2 -0
  85. package/dist/http/guards.js +2 -0
  86. package/dist/http/manifestConfig.d.ts +2 -0
  87. package/dist/http/manifestConfig.js +2 -0
  88. package/dist/http/responses.d.ts +2 -0
  89. package/dist/http/responses.js +2 -0
  90. package/dist/http/routes.d.ts +2 -0
  91. package/dist/http/routes.js +2 -0
  92. package/dist/http/schemas.d.ts +2 -0
  93. package/dist/http/schemas.js +2 -0
  94. package/dist/http/scopes.d.ts +2 -0
  95. package/dist/http/scopes.js +2 -0
  96. package/dist/http/view.d.ts +2 -0
  97. package/dist/http/view.js +2 -0
  98. package/dist/http/webhookGuard.d.ts +2 -0
  99. package/dist/http/webhookGuard.js +2 -0
  100. package/dist/index.d.ts +2 -0
  101. package/dist/index.js +2 -0
  102. package/dist/migrations/0001_purchases.d.ts +2 -0
  103. package/dist/migrations/0001_purchases.js +2 -0
  104. package/dist/paddle-prices.iife.js +1 -0
  105. package/dist/pricing/location.d.ts +2 -0
  106. package/dist/pricing/location.js +2 -0
  107. package/dist/pricing/visitor.d.ts +2 -0
  108. package/dist/pricing/visitor.js +2 -0
  109. package/dist/projection/event.d.ts +2 -0
  110. package/dist/projection/event.js +2 -0
  111. package/dist/projection/orphans.d.ts +2 -0
  112. package/dist/projection/orphans.js +2 -0
  113. package/dist/projection/owner.d.ts +2 -0
  114. package/dist/projection/owner.js +2 -0
  115. package/dist/projection/resolve.d.ts +2 -0
  116. package/dist/projection/resolve.js +2 -0
  117. package/dist/projection/writer.d.ts +2 -0
  118. package/dist/projection/writer.js +2 -0
  119. package/dist/provision/resolvePaymentsConfig.d.ts +2 -0
  120. package/dist/provision/resolvePaymentsConfig.js +2 -0
  121. package/dist/rails/apple/certs.d.ts +2 -0
  122. package/dist/rails/apple/certs.js +2 -0
  123. package/dist/rails/apple/der.d.ts +2 -0
  124. package/dist/rails/apple/der.js +2 -0
  125. package/dist/rails/apple/fixtures/chain.d.ts +2 -0
  126. package/dist/rails/apple/fixtures/chain.js +2 -0
  127. package/dist/rails/apple/http.d.ts +2 -0
  128. package/dist/rails/apple/http.js +2 -0
  129. package/dist/rails/apple/jws.d.ts +2 -0
  130. package/dist/rails/apple/jws.js +2 -0
  131. package/dist/rails/apple/notification.d.ts +2 -0
  132. package/dist/rails/apple/notification.js +2 -0
  133. package/dist/rails/apple/rail.d.ts +2 -0
  134. package/dist/rails/apple/rail.js +2 -0
  135. package/dist/rails/apple/serverApi.d.ts +2 -0
  136. package/dist/rails/apple/serverApi.js +2 -0
  137. package/dist/rails/apple/verify.d.ts +2 -0
  138. package/dist/rails/apple/verify.js +2 -0
  139. package/dist/rails/apple/x509.d.ts +2 -0
  140. package/dist/rails/apple/x509.js +2 -0
  141. package/dist/rails/contract.d.ts +2 -0
  142. package/dist/rails/contract.js +2 -0
  143. package/dist/rails/google/fixtures/push.d.ts +2 -0
  144. package/dist/rails/google/fixtures/push.js +2 -0
  145. package/dist/rails/google/http.d.ts +2 -0
  146. package/dist/rails/google/http.js +2 -0
  147. package/dist/rails/google/jwt.d.ts +2 -0
  148. package/dist/rails/google/jwt.js +2 -0
  149. package/dist/rails/google/oidc.d.ts +2 -0
  150. package/dist/rails/google/oidc.js +2 -0
  151. package/dist/rails/google/playApi.d.ts +2 -0
  152. package/dist/rails/google/playApi.js +2 -0
  153. package/dist/rails/google/rail.d.ts +2 -0
  154. package/dist/rails/google/rail.js +2 -0
  155. package/dist/rails/google/rtdn.d.ts +2 -0
  156. package/dist/rails/google/rtdn.js +2 -0
  157. package/dist/rails/google/verify.d.ts +2 -0
  158. package/dist/rails/google/verify.js +2 -0
  159. package/dist/rails/lemonSqueezy/api.d.ts +2 -0
  160. package/dist/rails/lemonSqueezy/api.js +2 -0
  161. package/dist/rails/lemonSqueezy/checkout.d.ts +2 -0
  162. package/dist/rails/lemonSqueezy/checkout.js +2 -0
  163. package/dist/rails/lemonSqueezy/discounts.d.ts +2 -0
  164. package/dist/rails/lemonSqueezy/discounts.js +2 -0
  165. package/dist/rails/lemonSqueezy/fixtures/events.d.ts +2 -0
  166. package/dist/rails/lemonSqueezy/fixtures/events.js +2 -0
  167. package/dist/rails/lemonSqueezy/objects.d.ts +2 -0
  168. package/dist/rails/lemonSqueezy/objects.js +2 -0
  169. package/dist/rails/lemonSqueezy/portal.d.ts +2 -0
  170. package/dist/rails/lemonSqueezy/portal.js +2 -0
  171. package/dist/rails/lemonSqueezy/pricing.d.ts +2 -0
  172. package/dist/rails/lemonSqueezy/pricing.js +2 -0
  173. package/dist/rails/lemonSqueezy/rail.d.ts +2 -0
  174. package/dist/rails/lemonSqueezy/rail.js +2 -0
  175. package/dist/rails/lemonSqueezy/read.d.ts +2 -0
  176. package/dist/rails/lemonSqueezy/read.js +2 -0
  177. package/dist/rails/lemonSqueezy/refresh.d.ts +2 -0
  178. package/dist/rails/lemonSqueezy/refresh.js +2 -0
  179. package/dist/rails/lemonSqueezy/signature.d.ts +2 -0
  180. package/dist/rails/lemonSqueezy/signature.js +2 -0
  181. package/dist/rails/lemonSqueezy/verify.d.ts +2 -0
  182. package/dist/rails/lemonSqueezy/verify.js +2 -0
  183. package/dist/rails/lemonSqueezy/webhook.d.ts +2 -0
  184. package/dist/rails/lemonSqueezy/webhook.js +2 -0
  185. package/dist/rails/paddle/adjustments.d.ts +2 -0
  186. package/dist/rails/paddle/adjustments.js +2 -0
  187. package/dist/rails/paddle/api.d.ts +2 -0
  188. package/dist/rails/paddle/api.js +2 -0
  189. package/dist/rails/paddle/checkout.d.ts +2 -0
  190. package/dist/rails/paddle/checkout.js +2 -0
  191. package/dist/rails/paddle/discounts.d.ts +2 -0
  192. package/dist/rails/paddle/discounts.js +2 -0
  193. package/dist/rails/paddle/events.d.ts +2 -0
  194. package/dist/rails/paddle/events.js +2 -0
  195. package/dist/rails/paddle/fixtures/browserForged.d.ts +2 -0
  196. package/dist/rails/paddle/fixtures/browserForged.js +2 -0
  197. package/dist/rails/paddle/fixtures/pausedSubscription.d.ts +2 -0
  198. package/dist/rails/paddle/fixtures/pausedSubscription.js +2 -0
  199. package/dist/rails/paddle/objects.d.ts +2 -0
  200. package/dist/rails/paddle/objects.js +2 -0
  201. package/dist/rails/paddle/portal.d.ts +2 -0
  202. package/dist/rails/paddle/portal.js +2 -0
  203. package/dist/rails/paddle/rail.d.ts +2 -0
  204. package/dist/rails/paddle/rail.js +2 -0
  205. package/dist/rails/paddle/read.d.ts +2 -0
  206. package/dist/rails/paddle/read.js +2 -0
  207. package/dist/rails/paddle/recorded.d.ts +2 -0
  208. package/dist/rails/paddle/recorded.js +2 -0
  209. package/dist/rails/paddle/refresh.d.ts +2 -0
  210. package/dist/rails/paddle/refresh.js +2 -0
  211. package/dist/rails/paddle/refund.d.ts +2 -0
  212. package/dist/rails/paddle/refund.js +2 -0
  213. package/dist/rails/paddle/signature.d.ts +2 -0
  214. package/dist/rails/paddle/signature.js +2 -0
  215. package/dist/rails/paddle/subscription.d.ts +2 -0
  216. package/dist/rails/paddle/subscription.js +2 -0
  217. package/dist/rails/paddle/verify.d.ts +2 -0
  218. package/dist/rails/paddle/verify.js +2 -0
  219. package/dist/rails/paddle/webhook.d.ts +2 -0
  220. package/dist/rails/paddle/webhook.js +2 -0
  221. package/dist/rails/providers.d.ts +2 -0
  222. package/dist/rails/providers.js +2 -0
  223. package/dist/rails/stripe/api.d.ts +2 -0
  224. package/dist/rails/stripe/api.js +2 -0
  225. package/dist/rails/stripe/checkout.d.ts +2 -0
  226. package/dist/rails/stripe/checkout.js +2 -0
  227. package/dist/rails/stripe/discounts.d.ts +2 -0
  228. package/dist/rails/stripe/discounts.js +2 -0
  229. package/dist/rails/stripe/fixtures/events.d.ts +2 -0
  230. package/dist/rails/stripe/fixtures/events.js +2 -0
  231. package/dist/rails/stripe/objects.d.ts +2 -0
  232. package/dist/rails/stripe/objects.js +2 -0
  233. package/dist/rails/stripe/portal.d.ts +2 -0
  234. package/dist/rails/stripe/portal.js +2 -0
  235. package/dist/rails/stripe/pricing.d.ts +2 -0
  236. package/dist/rails/stripe/pricing.js +2 -0
  237. package/dist/rails/stripe/rail.d.ts +2 -0
  238. package/dist/rails/stripe/rail.js +2 -0
  239. package/dist/rails/stripe/refresh.d.ts +2 -0
  240. package/dist/rails/stripe/refresh.js +2 -0
  241. package/dist/rails/stripe/signature.d.ts +2 -0
  242. package/dist/rails/stripe/signature.js +2 -0
  243. package/dist/rails/stripe/verify.d.ts +2 -0
  244. package/dist/rails/stripe/verify.js +2 -0
  245. package/dist/rails/stripe/webhook.d.ts +2 -0
  246. package/dist/rails/stripe/webhook.js +2 -0
  247. package/dist/secret/registry.d.ts +2 -0
  248. package/dist/secret/registry.js +2 -0
  249. package/dist/seeds/example.d.ts +2 -0
  250. package/dist/seeds/example.js +2 -0
  251. package/dist/version.generated.d.ts +3 -1
  252. package/dist/version.generated.js +3 -1
  253. package/dist/workflows/paddleSweep.d.ts +2 -0
  254. package/dist/workflows/paddleSweep.js +2 -0
  255. package/dist/workflows/railAccess.d.ts +2 -0
  256. package/dist/workflows/railAccess.js +2 -0
  257. package/dist/workflows/reconcile.d.ts +2 -0
  258. package/dist/workflows/reconcile.js +2 -0
  259. package/dist/workflows/report.d.ts +2 -0
  260. package/dist/workflows/report.js +2 -0
  261. package/dist/workflows/retryPolicy.d.ts +2 -0
  262. package/dist/workflows/retryPolicy.js +2 -0
  263. package/dist/workflows/specs.d.ts +2 -0
  264. package/dist/workflows/specs.js +2 -0
  265. package/dist/workflows/worker.d.ts +2 -0
  266. package/dist/workflows/worker.js +2 -0
  267. package/dist/workflows/workerConfig.d.ts +2 -0
  268. package/dist/workflows/workerConfig.js +2 -0
  269. package/package.json +5 -5
  270. package/src/version.generated.ts +1 -1
  271. package/src/workflows/paddleSweep.ts +1 -1
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { ControlPlaneScope } from "@pithy-sh/core/src/controlPlane/scope/scope";
2
4
  import type { PaymentsTables } from "../data/tables";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PAYMENTS_ENTITLEMENTS_READ_SCOPE, PAYMENTS_PURCHASES_READ_SCOPE, PAYMENTS_RECONCILE_READ_SCOPE, PAYMENTS_SUBSCRIPTIONS_READ_SCOPE } from "../http/scopes.js";
2
4
  //#region src/admin/coverage.ts
3
5
  /** Every payments table, and what a management client may learn from it. */
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { D1Database } from "@cloudflare/workers-types";
2
4
  import type { z } from "zod";
3
5
  import { PaymentsEntitlement } from "../data/entitlement";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PaymentsEntitlement } from "../data/entitlement.js";
2
4
  import { PaymentsPurchase } from "../data/purchase.js";
3
5
  import { PaymentsReconcileRun } from "../data/reconcileRun.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  /**
2
4
  * The audit action codes `@pithy-sh/payments` emits, as `domain/reason` strings under the `payments` domain.
3
5
  *
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/audit/actions.ts
2
4
  /**
3
5
  * The audit action codes `@pithy-sh/payments` emits, as `domain/reason` strings under the `payments` domain.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { type Capability } from "@pithy-sh/core/src/capability/capability";
2
4
  import type { DatabaseSpecMap } from "@pithy-sh/core/src/data/databases";
3
5
  import type { KvNamespaceSpecMap } from "@pithy-sh/core/src/kv/namespaces";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PaymentsConfig } from "./config/config.js";
2
4
  import { paymentsTables } from "./data/tables.js";
3
5
  import { installEntitlementResolver } from "./entitlement/resolver.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  /**
2
4
  * The framework-free half of the client surface: five calls against this project's own payments routes,
3
5
  * and the guards that make their answers safe to read.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/client/api.ts
2
4
  /**
3
5
  * The framework-free half of the client surface: five calls against this project's own payments routes,
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { type PaddleCheckoutHandoff, type PaymentsFailure } from "./api";
2
4
  import { type PaddleCheckoutTheme, type PaddleCheckoutVariant, type PaddleOptions } from "./paddle";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PAYMENTS_NO_BROWSER } from "./api.js";
2
4
  import { loadPaddle } from "./paddle.js";
3
5
  //#region src/client/checkout.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/client/fixtures/price-preview-de.json
2
4
  var price_preview_de_default = {
3
5
  customerId: null,
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/client/fixtures/price-preview-gb.json
2
4
  var price_preview_gb_default = {
3
5
  customerId: null,
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/client/fixtures/price-preview-jp-yen.json
2
4
  var price_preview_jp_yen_default = {
3
5
  customerId: null,
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/client/fixtures/price-preview-us-country-only.json
2
4
  var price_preview_us_country_only_default = {
3
5
  customerId: null,
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/client/fixtures/price-preview-us-new-york.json
2
4
  var price_preview_us_new_york_default = {
3
5
  customerId: null,
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  /**
2
4
  * Five real `PricePreview` answers, recorded from the Paddle **sandbox** on 2026-08-13 against one
3
5
  * $5.00/month price with no `unit_price_overrides`.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import price_preview_de_default from "./price-preview-de.js";
2
4
  import price_preview_gb_default from "./price-preview-gb.js";
3
5
  import price_preview_jp_yen_default from "./price-preview-jp-yen.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { type EntitlementView, type PaddleCheckoutHandoff, type PaymentsClientOptions, type PaymentsClientRail, type PaymentsFailure, type PaymentsHostedRail, type PurchaseView } from "./api";
2
4
  import { type PaddleCheckoutOptions } from "./checkout";
3
5
  import { type PaddleJs, type PaddleOptions, type PaddlePriceQuery, type PaddleSetup, type PricePreview } from "./paddle";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { getEntitlements, openBillingPortal, openStoreSubscriptions, restorePurchases, startCheckout, submitPurchase } from "./api.js";
2
4
  import { loadPaddle, previewPrices, priceQueryKey } from "./paddle.js";
3
5
  import { openPaddleCheckout } from "./checkout.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { type PaymentsFailure, type PaymentsPaddleDisplayMode, type PaymentsPaddleEnvironment, type PaymentsResult } from "./api";
2
4
  import { type PaddleQuoteCache } from "./paddleCache";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PAYMENTS_NO_BROWSER, PAYMENTS_UNREADABLE } from "./api.js";
2
4
  import { cachedAnswer, readQuoteCache, rememberAnswer } from "./paddleCache.js";
3
5
  import { withoutZeroFraction } from "./wholeUnits.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  /**
2
4
  * A price nobody has to fetch twice — opt-in, and only ever where the caller said to put it.
3
5
  *
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/client/paddleCache.ts
2
4
  /** What every entry this module writes is stored under, so a store shared with a page stays legible. */
3
5
  const PREFIX = "pithy.paddle.price";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { PaymentsResult } from "./api";
2
4
  import { type PaddleOptions, type PaddlePriceQuery, type PaddleSetup, type PriceSummaryOptions } from "./paddle";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { previewPrices, priceSummary } from "./paddle.js";
2
4
  //#region src/client/paddlePrices.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { PaymentsFailure, PaymentsResult } from "./api";
2
4
  import type { PaddleSetup } from "./paddle";
3
5
  import { type PaddleCacheStore, type PaddleQuoteCache } from "./paddleCache";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { readQuoteCache } from "./paddleCache.js";
2
4
  import { quotePlans } from "./paddlePrices.js";
3
5
  //#region src/client/paddlePricesTag.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  /**
2
4
  * One product, browser-safe — an element of {@link PaymentsClientProjection}'s catalog.
3
5
  *
@@ -0,0 +1,2 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { PaddleCacheStore } from "../paddleCache";
2
4
  /**
3
5
  * A {@link PaddleCacheStore} a test can look inside.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/client/test-utils/cacheStore.ts
2
4
  /**
3
5
  * A {@link PaddleCacheStore} a test can look inside.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  /** One figure, in both of the forms Paddle sends it in, and what it is denominated in. */
2
4
  export interface WholeUnitPrice {
3
5
  /** Paddle's own rendering of the figure for this visitor. The only thing ever returned. */
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { minorUnitDigits } from "../data/money.js";
2
4
  //#region src/client/wholeUnits.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  import { type PaymentsRail } from "../data/rail";
3
5
  export declare const PaymentsRailToggles: z.ZodObject<{
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PAYMENTS_RAILS } from "../data/rail.js";
2
4
  import { PaymentsSubjectType } from "../data/subject.js";
3
5
  import { EntitlementKey } from "@pithy-sh/core/src/entitlement/entitlement";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /** A discount code, as a customer types it. Case is preserved — both providers match case-insensitively. */
3
5
  export declare const DiscountCode: z.ZodString;
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  import { JsonDate } from "@pithy-sh/core/src/data/codecs";
3
5
  /** A discount code, as a customer types it. Case is preserved — both providers match case-insensitively. */
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * One entitlement a subject holds — the row in `pithy_payments_entitlements`, and the materialized read
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PaymentsSubject } from "./subject.js";
2
4
  import { EntitlementKey } from "@pithy-sh/core/src/entitlement/entitlement";
3
5
  import { z } from "zod";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  /** How many digits the currency's minor unit occupies. Two unless ISO 4217 says otherwise. */
2
4
  export declare function minorUnitDigits(currency: string): number;
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/data/money.ts
2
4
  /**
3
5
  * Money, as the three rails report it and as the purchases table stores it.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { PaymentsRail } from "./rail";
2
4
  import type { PurchaseStatus } from "./status";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PaymentsVerificationFailedError } from "../error/errors.js";
2
4
  //#region src/data/pause.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * A provider identity mapped back to the subject that holds it — the row in
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PaymentsRail } from "./rail.js";
2
4
  import { PaymentsSubject } from "./subject.js";
3
5
  import { z } from "zod";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * Which store environment a purchase happened in. Every purchase carries it, and it never widens: a
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PaymentsRail } from "./rail.js";
2
4
  import { PaymentsSubject } from "./subject.js";
3
5
  import { PaymentsProductType } from "../config/config.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * The five payment rails, as one normalized name each. Nothing downstream of a rail's own module ever
package/dist/data/rail.js CHANGED
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  //#region src/data/rail.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { D1Database } from "@cloudflare/workers-types";
2
4
  import { z } from "zod";
3
5
  import { PurchaseEnvironment } from "./purchase";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PaymentsRail } from "./rail.js";
2
4
  import { PurchaseEnvironment } from "./purchase.js";
3
5
  import { PAYMENTS_RECONCILE_RUNS_TABLE, paymentsDatabase } from "./tables.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  /**
2
4
  * An integer in a currency's minor unit, as a sentence a customer reads — `6582` to `$65.82`.
3
5
  *
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { minorUnitDigits } from "./money.js";
2
4
  import { DEFAULT_LOCALE } from "@pithy-sh/core/src/i18n/translator";
3
5
  //#region src/data/renderMoney.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * The normalized purchase status set. Each rail's events map into these nine, so nothing downstream of
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  //#region src/data/status.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * Who holds a purchase and the entitlements it grants — a **subject**, which is not always a person.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  //#region src/data/subject.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * An amount of money a provider quoted: an integer in the currency's minor unit, and the currency.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PurchaseStatus } from "./status.js";
2
4
  import { z } from "zod";
3
5
  import { JsonDate } from "@pithy-sh/core/src/data/codecs";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * Where a resumable sweep of a provider's stream left off — the row in `pithy_payments_sync_cursors`,
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PaymentsRail } from "./rail.js";
2
4
  import { z } from "zod";
3
5
  import { SQLiteDate } from "@pithy-sh/core/src/data/codecs";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { D1Database } from "@cloudflare/workers-types";
2
4
  import { type DatabaseSchema } from "@pithy-sh/core/src/data/db";
3
5
  import type { Kysely } from "kysely";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PaymentsEntitlement } from "./entitlement.js";
2
4
  import { PaymentsProviderAccount } from "./providerAccount.js";
3
5
  import { PaymentsPurchase } from "./purchase.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { SQLiteDate } from "@pithy-sh/core/src/data/codecs";
2
4
  import { z } from "zod";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PaymentsRail } from "./rail.js";
2
4
  import { z } from "zod";
3
5
  import { SQLiteDate, sqliteJson } from "@pithy-sh/core/src/data/codecs";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { D1Database } from "@cloudflare/workers-types";
2
4
  import { type PaymentsConfig } from "../config/config";
3
5
  import { PaymentsEntitlement } from "../data/entitlement";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { encodeSubjectReference } from "../data/subject.js";
2
4
  import { grantableEntitlements } from "../config/config.js";
3
5
  import { PaymentsEntitlement } from "../data/entitlement.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { PithyMiddleware } from "@pithy-sh/core/src/capability/capability";
2
4
  import type { EntitlementHolder, EntitlementResolver } from "@pithy-sh/core/src/entitlement/entitlement";
3
5
  import { type PaymentsSubject } from "../data/subject";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { encodeSubjectReference } from "../data/subject.js";
2
4
  import { resolveEntitlements } from "../projection/resolve.js";
3
5
  import { resolvePaymentsSubject } from "./subjectSeam.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { PithyHonoEnv } from "@pithy-sh/core/src/capability/capability";
2
4
  import type { Context } from "hono";
3
5
  import { PaymentsSubject, type PaymentsSubjectType } from "../data/subject";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PaymentsSubject } from "../data/subject.js";
2
4
  import { PaymentsSubjectUnresolvedError } from "../error/errors.js";
3
5
  //#region src/entitlement/subjectSeam.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PithyError } from "@pithy-sh/core/src/error/pithyError";
2
4
  import type { MessageParams } from "@pithy-sh/core/src/i18n/catalog";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PithyError } from "@pithy-sh/core/src/error/pithyError";
2
4
  //#region src/error/errors.ts
3
5
  /** The receipt could not be read at all. Nothing was asked of the provider. */
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { D1Database } from "@cloudflare/workers-types";
2
4
  import { type AuditEmit } from "@pithy-sh/core/src/audit/recorder";
3
5
  import type { PaymentsConfig, PaymentsLedgerGrant } from "../config/config";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PaymentsAuditActions } from "../audit/actions.js";
2
4
  import { ledgerAccountId, openPaymentsLedger } from "./ledgerSeam.js";
3
5
  import { clawbackGrants } from "./clawback.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PaymentsClawbackFailedError } from "../error/errors";
2
4
  import type { PurchaseProjection } from "../projection/writer";
3
5
  import type { GrantOptions } from "./apply";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PaymentsClawbackFailedError } from "../error/errors.js";
2
4
  import { ledgerAccountId } from "./ledgerSeam.js";
3
5
  import { ledgerGrantFor } from "./apply.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { D1Database } from "@cloudflare/workers-types";
2
4
  import { type PaymentsSubject } from "../data/subject";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { encodeSubjectReference } from "../data/subject.js";
2
4
  import { InternalError } from "@pithy-sh/core/src/error/pithyError";
3
5
  //#region src/grants/ledgerSeam.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { Logger } from "@pithy-sh/core/src/logger/logger";
2
4
  import { type PaymentsReconcileParams } from "../workflows/specs";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PAYMENTS_CAPABILITY, paymentsWorkflowRegistry } from "../workflows/specs.js";
2
4
  import { triggerWorkflow } from "@pithy-sh/core/src/workflow/dispatch";
3
5
  import { workflowKey } from "@pithy-sh/core/src/workflow/naming";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { PithyHonoEnv } from "@pithy-sh/core/src/capability/capability";
2
4
  import type { MiddlewareHandler } from "hono";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { UnauthorizedError } from "@pithy-sh/core/src/error/pithyError";
2
4
  //#region src/http/guards.ts
3
5
  /**