@pithy-sh/payments 0.8.7 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../src/capability.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,UAAU,EAGhB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAEvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAI3E,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAoB,MAAM,iBAAiB,CAAC;AAI7F,OAAO,KAAK,EAAE,uBAAuB,EAAuB,MAAM,2BAA2B,CAAC;AAS9F,OAAO,EAAE,KAAK,YAAY,EAAgB,MAAM,QAAQ,CAAC;AAMzD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE9E;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAK7C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG;IAClD;;;;OAIG;IACH,cAAc,CAAC,EAAE,uBAAuB,CAAC;IACzC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,wBAAwB,CAAC;CAC5C,CAAC;AAkQF;;;GAGG;AACH,KAAK,qBAAqB,GAAG,OAAO,iBAAiB,GAAG,OAAO,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE/F,6FAA6F;AAC7F,MAAM,WAAW,kBACf,SAAQ,UAAU,CAAC,eAAe,EAAE,kBAAkB,EAAE,UAAU,EAAE,qBAAqB,CAAC;IAC1F,4BAA4B;IAC5B,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MG;IACH,eAAe,CAAC,EAAE,wBAAwB,CAAC;CAC5C,CAAC;AAkQF;;;GAGG;AACH,KAAK,qBAAqB,GAAG,OAAO,iBAAiB,GAAG,OAAO,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAE/F,6FAA6F;AAC7F,MAAM,WAAW,kBACf,SAAQ,UAAU,CAAC,eAAe,EAAE,kBAAkB,EAAE,UAAU,EAAE,qBAAqB,CAAC;IAC1F,4BAA4B;IAC5B,cAAc,EAAE,cAAc,CAAC;IAC/B;;;;OAIG;IACH,YAAY,EAAE,YAAY,CAAC;IAC3B;;;;OAIG;IACH,UAAU,EAAE,UAAU,CAAC;IACvB;;;;;OAKG;IACH,aAAa,EAAE;QAAE,eAAe,EAAE,wBAAwB,CAAA;KAAE,GAAG,SAAS,CAAC;CAC1E;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,kBAAkB,CAoIrE;AAED,sFAAsF;AACtF,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,IAAI,kBAAkB,CAE7F"}
@@ -15,7 +15,7 @@ import { payments_0002_allowances } from "./migrations/0002_allowances.js";
15
15
  import { payments_0003_webhook_targets } from "./migrations/0003_webhook_targets.js";
16
16
  import { paymentsPeer } from "./peer.js";
17
17
  import { paymentsProcessing } from "./processing/activities.js";
18
- import { paymentsUserPurge } from "./purge/contribution.js";
18
+ import { PAYMENTS_MESSAGES, paymentsUserPurge } from "./purge/contribution.js";
19
19
  import { paymentsInapplicableSecrets, paymentsSecretBranches } from "./secret/branches.js";
20
20
  import { paymentsExampleSeed } from "./seeds/example.js";
21
21
  import { PACKAGE_NAME, PACKAGE_VERSION } from "./version.generated.js";
@@ -304,6 +304,7 @@ function payments(options) {
304
304
  }),
305
305
  seeds: [paymentsExampleSeed],
306
306
  purge: [paymentsUserPurge()],
307
+ messages: PAYMENTS_MESSAGES,
307
308
  processing: paymentsProcessing(resolved.rails)
308
309
  });
309
310
  return Object.assign(capability, {
@@ -1,8 +1,9 @@
1
1
  // SPDX-FileCopyrightText: 2026 Pithy
2
2
  // SPDX-License-Identifier: MIT
3
3
  import type { RetainingPurgeContribution } from "@pithy-sh/core/src/capability/purge";
4
+ import type { LocaleCatalogs } from "@pithy-sh/core/src/i18n/catalog";
4
5
  /**
5
- * What a person's purge means for `@pithy-sh/payments` (#814): **nothing is erased, and the export says so and why.**
6
+ * What a person's purge means for `@pithy-sh/payments`: **nothing is erased, and the export says so and why.**
6
7
  *
7
8
  * A purchase is a financial record, and the law that makes a business keep one for years — for tax, for an audit, for
8
9
  * a chargeback — does not end when the buyer's account does. So this contribution **retains**: the purge records the
@@ -25,6 +26,10 @@ import type { RetainingPurgeContribution } from "@pithy-sh/core/src/capability/p
25
26
  export declare const PAYMENTS_PURGE_SUMMARY = "Keeps the user's purchases, the entitlements they granted, the provider accounts that link them, and the overrides, meter counters and usage reports kept against them.";
26
27
  /** Why, in the sentence the person is told. */
27
28
  export declare const PAYMENTS_RETENTION_BASIS = "Kept for tax and accounting records, which the law requires a business to hold after an account is closed.";
29
+ /** The catalog key that translates {@link PAYMENTS_RETENTION_BASIS}. */
30
+ export declare const PAYMENTS_RETENTION_BASIS_KEY = "payments/purge.retained";
31
+ /** This capability's own English, contributed as its `messages`: the basis, under its key. */
32
+ export declare const PAYMENTS_MESSAGES: LocaleCatalogs;
28
33
  /** A purchase row as the export carries it: a Google Play row never with its purchase token. */
29
34
  export declare function redactPurchase(row: Record<string, unknown>): Record<string, unknown>;
30
35
  /** The user contribution `payments()` declares, over the D1 binding the payments tables live in. */
@@ -1 +1 @@
1
- {"version":3,"file":"contribution.d.ts","sourceRoot":"","sources":["../../src/purge/contribution.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAgBtF;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,yDAAyD;AACzD,eAAO,MAAM,sBAAsB,4KACwI,CAAC;AAE5K,+CAA+C;AAC/C,eAAO,MAAM,wBAAwB,+GACyE,CAAC;AAa/G,gGAAgG;AAChG,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQpF;AAED,oGAAoG;AACpG,wBAAgB,iBAAiB,CAAC,QAAQ,SAAO,GAAG,0BAA0B,CA8D7E"}
1
+ {"version":3,"file":"contribution.d.ts","sourceRoot":"","sources":["../../src/purge/contribution.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAgBtE;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,yDAAyD;AACzD,eAAO,MAAM,sBAAsB,4KACwI,CAAC;AAE5K,+CAA+C;AAC/C,eAAO,MAAM,wBAAwB,+GACyE,CAAC;AAE/G,wEAAwE;AACxE,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AAEtE,8FAA8F;AAC9F,eAAO,MAAM,iBAAiB,EAAE,cAAqF,CAAC;AAatH,gGAAgG;AAChG,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQpF;AAED,oGAAoG;AACpG,wBAAgB,iBAAiB,CAAC,QAAQ,SAAO,GAAG,0BAA0B,CA8D7E"}
@@ -10,7 +10,7 @@ import { PAYMENTS_ENTITLEMENTS_TABLE, PAYMENTS_METER_COUNTERS_TABLE, PAYMENTS_OV
10
10
  import { personRowsExport } from "@pithy-sh/core/src/capability/personRows";
11
11
  //#region src/purge/contribution.ts
12
12
  /**
13
- * What a person's purge means for `@pithy-sh/payments` (#814): **nothing is erased, and the export says so and why.**
13
+ * What a person's purge means for `@pithy-sh/payments`: **nothing is erased, and the export says so and why.**
14
14
  *
15
15
  * A purchase is a financial record, and the law that makes a business keep one for years — for tax, for an audit, for
16
16
  * a chargeback — does not end when the buyer's account does. So this contribution **retains**: the purge records the
@@ -33,6 +33,10 @@ import { personRowsExport } from "@pithy-sh/core/src/capability/personRows";
33
33
  const PAYMENTS_PURGE_SUMMARY = "Keeps the user's purchases, the entitlements they granted, the provider accounts that link them, and the overrides, meter counters and usage reports kept against them.";
34
34
  /** Why, in the sentence the person is told. */
35
35
  const PAYMENTS_RETENTION_BASIS = "Kept for tax and accounting records, which the law requires a business to hold after an account is closed.";
36
+ /** The catalog key that translates {@link PAYMENTS_RETENTION_BASIS}. */
37
+ const PAYMENTS_RETENTION_BASIS_KEY = "payments/purge.retained";
38
+ /** This capability's own English, contributed as its `messages`: the basis, under its key. */
39
+ const PAYMENTS_MESSAGES = { en: { [PAYMENTS_RETENTION_BASIS_KEY]: PAYMENTS_RETENTION_BASIS } };
36
40
  /** A person's rows only — an organization's share the id column and are the organization's. */
37
41
  const USER = { subjectType: "user" };
38
42
  /** The order id a Play purchase reports — `latestOrderId` on a subscription, `orderId` on a one-time purchase. */
@@ -57,7 +61,10 @@ function paymentsUserPurge(database = "DB") {
57
61
  return {
58
62
  subject: "user",
59
63
  summary: PAYMENTS_PURGE_SUMMARY,
60
- retain: { basis: PAYMENTS_RETENTION_BASIS },
64
+ retain: {
65
+ basis: PAYMENTS_RETENTION_BASIS,
66
+ basisKey: PAYMENTS_RETENTION_BASIS_KEY
67
+ },
61
68
  export: personRowsExport({
62
69
  capability: "payments",
63
70
  database,
@@ -117,4 +124,4 @@ function paymentsUserPurge(database = "DB") {
117
124
  };
118
125
  }
119
126
  //#endregion
120
- export { PAYMENTS_PURGE_SUMMARY, PAYMENTS_RETENTION_BASIS, paymentsUserPurge, redactPurchase };
127
+ export { PAYMENTS_MESSAGES, PAYMENTS_PURGE_SUMMARY, PAYMENTS_RETENTION_BASIS, PAYMENTS_RETENTION_BASIS_KEY, paymentsUserPurge, redactPurchase };
@@ -3,5 +3,5 @@
3
3
  /** This package's npm name — the join key against a release feed. */
4
4
  export declare const PACKAGE_NAME = "@pithy-sh/payments";
5
5
  /** This package's version, stamped from its own package.json at generation time. */
6
- export declare const PACKAGE_VERSION = "0.8.7";
6
+ export declare const PACKAGE_VERSION = "0.9.0";
7
7
  //# sourceMappingURL=version.generated.d.ts.map
@@ -4,6 +4,6 @@
4
4
  /** This package's npm name — the join key against a release feed. */
5
5
  const PACKAGE_NAME = "@pithy-sh/payments";
6
6
  /** This package's version, stamped from its own package.json at generation time. */
7
- const PACKAGE_VERSION = "0.8.7";
7
+ const PACKAGE_VERSION = "0.9.0";
8
8
  //#endregion
9
9
  export { PACKAGE_NAME, PACKAGE_VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pithy-sh/payments",
3
- "version": "0.8.7",
3
+ "version": "0.9.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -42,9 +42,9 @@
42
42
  "@paddle/paddle-js": "^1.6.4"
43
43
  },
44
44
  "peerDependencies": {
45
- "@pithy-sh/core": "^0.24.0",
46
- "@pithy-sh/ledger": "^0.6.10",
47
- "@pithy-sh/secrets": "^0.6.12",
45
+ "@pithy-sh/core": "^0.25.0",
46
+ "@pithy-sh/ledger": "^0.6.11",
47
+ "@pithy-sh/secrets": "^0.6.13",
48
48
  "@pithy-sh/ui-core": "^0.1.0",
49
49
  "hono": "^4.13.2",
50
50
  "kysely": "^0.29.0",
package/src/capability.ts CHANGED
@@ -29,7 +29,7 @@ import { payments_0002_allowances } from "./migrations/0002_allowances";
29
29
  import { payments_0003_webhook_targets } from "./migrations/0003_webhook_targets";
30
30
  import { type PaymentsPeer, paymentsPeer } from "./peer";
31
31
  import { paymentsProcessing } from "./processing/activities";
32
- import { paymentsUserPurge } from "./purge/contribution";
32
+ import { PAYMENTS_MESSAGES, paymentsUserPurge } from "./purge/contribution";
33
33
  import { paymentsInapplicableSecrets, paymentsSecretBranches } from "./secret/branches";
34
34
  import { paymentsSecretsRegistry } from "./secret/registry";
35
35
  import { paymentsExampleSeed } from "./seeds/example";
@@ -517,6 +517,7 @@ export function payments(options: PaymentsOptions): PaymentsCapability {
517
517
  // A person's purchases and what they granted are kept through their purge, for tax law, and exported on an access
518
518
  // request with the basis that keeps them.
519
519
  purge: [paymentsUserPurge()],
520
+ messages: PAYMENTS_MESSAGES,
520
521
  // Each rail the config turns on is named as a recipient of the purchases made on it.
521
522
  processing: paymentsProcessing(resolved.rails),
522
523
  });
@@ -3,6 +3,7 @@
3
3
 
4
4
  import { personRowsExport } from "@pithy-sh/core/src/capability/personRows";
5
5
  import type { RetainingPurgeContribution } from "@pithy-sh/core/src/capability/purge";
6
+ import type { LocaleCatalogs } from "@pithy-sh/core/src/i18n/catalog";
6
7
  import { PaymentsEntitlement } from "../data/entitlement";
7
8
  import { PaymentsMeterCounter } from "../data/meterCounter";
8
9
  import { PaymentsOverride } from "../data/override";
@@ -19,7 +20,7 @@ import {
19
20
  import { PaymentsUsageReport } from "../data/usageReport";
20
21
 
21
22
  /**
22
- * What a person's purge means for `@pithy-sh/payments` (#814): **nothing is erased, and the export says so and why.**
23
+ * What a person's purge means for `@pithy-sh/payments`: **nothing is erased, and the export says so and why.**
23
24
  *
24
25
  * A purchase is a financial record, and the law that makes a business keep one for years — for tax, for an audit, for
25
26
  * a chargeback — does not end when the buyer's account does. So this contribution **retains**: the purge records the
@@ -47,6 +48,12 @@ export const PAYMENTS_PURGE_SUMMARY =
47
48
  export const PAYMENTS_RETENTION_BASIS =
48
49
  "Kept for tax and accounting records, which the law requires a business to hold after an account is closed.";
49
50
 
51
+ /** The catalog key that translates {@link PAYMENTS_RETENTION_BASIS}. */
52
+ export const PAYMENTS_RETENTION_BASIS_KEY = "payments/purge.retained";
53
+
54
+ /** This capability's own English, contributed as its `messages`: the basis, under its key. */
55
+ export const PAYMENTS_MESSAGES: LocaleCatalogs = { en: { [PAYMENTS_RETENTION_BASIS_KEY]: PAYMENTS_RETENTION_BASIS } };
56
+
50
57
  /** A person's rows only — an organization's share the id column and are the organization's. */
51
58
  const USER = { subjectType: "user" } as const;
52
59
 
@@ -74,7 +81,7 @@ export function paymentsUserPurge(database = "DB"): RetainingPurgeContribution {
74
81
  return {
75
82
  subject: "user",
76
83
  summary: PAYMENTS_PURGE_SUMMARY,
77
- retain: { basis: PAYMENTS_RETENTION_BASIS },
84
+ retain: { basis: PAYMENTS_RETENTION_BASIS, basisKey: PAYMENTS_RETENTION_BASIS_KEY },
78
85
  export: personRowsExport({
79
86
  capability: "payments",
80
87
  database,
@@ -13,4 +13,4 @@
13
13
  export const PACKAGE_NAME = "@pithy-sh/payments";
14
14
 
15
15
  /** This package's version, stamped from its own package.json at generation time. */
16
- export const PACKAGE_VERSION = "0.8.7";
16
+ export const PACKAGE_VERSION = "0.9.0";