@peable.to/shared-types 0.3.2-oxy-one.0 → 0.3.3-oxy-one.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.
@@ -11,14 +11,29 @@ function encode(value) {
11
11
  return JSON.stringify(value);
12
12
  if (Array.isArray(value))
13
13
  return `[${value.map(encode).join(',')}]`;
14
- if (typeof value !== 'object' || value === null || Object.getPrototypeOf(value) !== Object.prototype)
14
+ if (typeof value !== 'object' ||
15
+ value === null ||
16
+ Object.getPrototypeOf(value) !== Object.prototype)
15
17
  throw new Error('Invalid authority JSON');
16
18
  const object = value;
17
- return `{${Object.keys(object).sort().filter((key) => object[key] !== undefined).map((key) => `${JSON.stringify(key)}:${encode(object[key])}`).join(',')}}`;
19
+ return `{${Object.keys(object)
20
+ .sort()
21
+ .filter((key) => object[key] !== undefined)
22
+ .map((key) => `${JSON.stringify(key)}:${encode(object[key])}`)
23
+ .join(',')}}`;
18
24
  }
19
25
  function canonicalBillingAuthority(authority) {
20
- return encode({ schemaVersion: authority.schemaVersion, source: authority.source, invoice: authority.invoice, method: authority.method });
26
+ return encode({
27
+ schemaVersion: authority.schemaVersion,
28
+ source: authority.source,
29
+ invoice: authority.invoice,
30
+ method: authority.method,
31
+ });
21
32
  }
22
33
  function canonicalBillingTaxQuote(authority) {
23
- return encode({ schemaVersion: authority.schemaVersion, source: authority.source, quote: authority.quote });
34
+ return encode({
35
+ schemaVersion: authority.schemaVersion,
36
+ source: authority.source,
37
+ quote: authority.quote,
38
+ });
24
39
  }
@@ -3,4 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BILLING_SUBSCRIPTION_STATUSES = void 0;
4
4
  /** Recurring billing transport. Store/plan references belong to the authenticated app;
5
5
  * they do not identify an Oxy payer or convey entitlements. */
6
- exports.BILLING_SUBSCRIPTION_STATUSES = ['incomplete', 'incomplete_expired', 'trialing', 'active', 'past_due', 'canceled', 'unpaid', 'paused'];
6
+ exports.BILLING_SUBSCRIPTION_STATUSES = [
7
+ 'incomplete',
8
+ 'incomplete_expired',
9
+ 'trialing',
10
+ 'active',
11
+ 'past_due',
12
+ 'canceled',
13
+ 'unpaid',
14
+ 'paused',
15
+ ];
@@ -7,14 +7,29 @@ function encode(value) {
7
7
  return JSON.stringify(value);
8
8
  if (Array.isArray(value))
9
9
  return `[${value.map(encode).join(',')}]`;
10
- if (typeof value !== 'object' || value === null || Object.getPrototypeOf(value) !== Object.prototype)
10
+ if (typeof value !== 'object' ||
11
+ value === null ||
12
+ Object.getPrototypeOf(value) !== Object.prototype)
11
13
  throw new Error('Invalid authority JSON');
12
14
  const object = value;
13
- return `{${Object.keys(object).sort().filter((key) => object[key] !== undefined).map((key) => `${JSON.stringify(key)}:${encode(object[key])}`).join(',')}}`;
15
+ return `{${Object.keys(object)
16
+ .sort()
17
+ .filter((key) => object[key] !== undefined)
18
+ .map((key) => `${JSON.stringify(key)}:${encode(object[key])}`)
19
+ .join(',')}}`;
14
20
  }
15
21
  export function canonicalBillingAuthority(authority) {
16
- return encode({ schemaVersion: authority.schemaVersion, source: authority.source, invoice: authority.invoice, method: authority.method });
22
+ return encode({
23
+ schemaVersion: authority.schemaVersion,
24
+ source: authority.source,
25
+ invoice: authority.invoice,
26
+ method: authority.method,
27
+ });
17
28
  }
18
29
  export function canonicalBillingTaxQuote(authority) {
19
- return encode({ schemaVersion: authority.schemaVersion, source: authority.source, quote: authority.quote });
30
+ return encode({
31
+ schemaVersion: authority.schemaVersion,
32
+ source: authority.source,
33
+ quote: authority.quote,
34
+ });
20
35
  }
@@ -1,3 +1,12 @@
1
1
  /** Recurring billing transport. Store/plan references belong to the authenticated app;
2
2
  * they do not identify an Oxy payer or convey entitlements. */
3
- export const BILLING_SUBSCRIPTION_STATUSES = ['incomplete', 'incomplete_expired', 'trialing', 'active', 'past_due', 'canceled', 'unpaid', 'paused'];
3
+ export const BILLING_SUBSCRIPTION_STATUSES = [
4
+ 'incomplete',
5
+ 'incomplete_expired',
6
+ 'trialing',
7
+ 'active',
8
+ 'past_due',
9
+ 'canceled',
10
+ 'unpaid',
11
+ 'paused',
12
+ ];
@@ -10,6 +10,9 @@ export interface EnsureBillingCustomerParams {
10
10
  storeName: string;
11
11
  }
12
12
  export interface CreateBillingCheckoutParams {
13
+ /** Opt-in fiscal checkout. The full signed quote is immutable and single-use.
14
+ * Requires a trusted Peable adapter capable of applying these exact amounts. */
15
+ taxQuote?: BillingTaxQuote;
13
16
  providerCustomerId: string;
14
17
  providerPriceId: string;
15
18
  trialDays: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peable.to/shared-types",
3
- "version": "0.3.2-oxy-one.0",
3
+ "version": "0.3.3-oxy-one.0",
4
4
  "description": "Shared TypeScript types for the Peable Gateway — the wire contract shared by the backend, SDK, and frontend.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -54,7 +54,6 @@
54
54
  "build:types": "tsc -p tsconfig.types.json",
55
55
  "clean": "rm -rf dist",
56
56
  "dev": "tsc --watch",
57
- "lint": "tsc --noEmit",
58
57
  "typecheck": "tsc --noEmit",
59
58
  "test": "bun test",
60
59
  "prepublishOnly": "bun run clean && bun run build"