@owlmeans/server-payment 0.1.18-rc.2 → 0.1.18-rc.4

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.
package/README.md CHANGED
@@ -46,7 +46,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
46
46
  your project's skill store (`.agents/skills/`):
47
47
 
48
48
  ```sh
49
- npx @owlmeans/agent-skills@^0.1.18-rc.17
49
+ npx @owlmeans/agent-skills@^0.1.18-rc.19
50
50
  ```
51
51
 
52
52
  The embedded files are version-matched to this package release. Do not edit them
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/server-payment",
4
- "version": "0.1.18-rc.2",
5
- "generatedAt": "2026-09-12T12:59:24.916Z",
4
+ "version": "0.1.18-rc.4",
5
+ "generatedAt": "2026-09-12T13:51:53.537Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -7,6 +7,8 @@ user-invocable: false
7
7
 
8
8
  # @owlmeans/server-payment
9
9
 
10
+ **Install:** `bun add @owlmeans/server-payment@^0.1.18-rc.3`
11
+
10
12
  Public MIT package in the common monorepo. It embeds Stripe into an application backend; the
11
13
  consumer owns products, credit conversion and entitlement side effects. It persists customers,
12
14
  subscriptions/fulfilled sessions and sync fingerprints in Mongo.
@@ -66,7 +68,8 @@ must be safe to repeat.
66
68
  ## Protocols and security
67
69
 
68
70
  `paymentGate` is an immutable protocol tree. `paymentGateEntrypoints` binds its base, webhook, and
69
- resync declarations directly with `bind(protocol, handler)`; the webhook is public because Stripe
71
+ resync declarations directly with `bind(protocol, handler)`; do not publish a flattened
72
+ `paymentGateProtocols` compatibility list. The webhook is public because Stripe
70
73
  signature verification requires the untouched raw body, while resync carries the ED25519 guard.
71
74
  Never put an application auth guard on the Stripe webhook.
72
75
 
package/build/consts.d.ts CHANGED
@@ -22,5 +22,4 @@ export declare const paymentGate: {
22
22
  }, undefined>;
23
23
  readonly resync: import("@owlmeans/entrypoint").EntrypointProtocol<{}, ResyncResult>;
24
24
  };
25
- export declare const paymentGateProtocols: import("@owlmeans/entrypoint").EntrypointProtocolDeclaration[];
26
25
  //# sourceMappingURL=consts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB,WAAW,CAAA;AAC5C,eAAO,MAAM,oBAAoB,qBAAqB,CAAA;AACtD,eAAO,MAAM,gBAAgB,qBAAqB,CAAA;AAClD,eAAO,MAAM,eAAe,oBAAoB,CAAA;AAChD,eAAO,MAAM,gBAAgB,qBAAqB,CAAA;AAClD,eAAO,MAAM,oBAAoB,6BAA6B,CAAA;AAC9D,eAAO,MAAM,wBAAwB,yBAAyB,CAAA;AAC9D,eAAO,MAAM,uBAAuB,wBAAwB,CAAA;AAC5D,eAAO,MAAM,iBAAiB,WAAW,CAAA;AACzC,eAAO,MAAM,uBAAuB,iBAAiB,CAAA;AAErD,MAAM,WAAW,aAAa;IAAG,OAAO,EAAE,MAAM,CAAA;CAAE;AAClD,MAAM,WAAW,YAAY;IAAG,EAAE,EAAE,OAAO,CAAA;CAAE;AAe7C,qFAAqF;AACrF,eAAO,MAAM,WAAW;;;;;;CAWd,CAAA;AAEV,eAAO,MAAM,oBAAoB,gEAAyB,CAAA"}
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB,WAAW,CAAA;AAC5C,eAAO,MAAM,oBAAoB,qBAAqB,CAAA;AACtD,eAAO,MAAM,gBAAgB,qBAAqB,CAAA;AAClD,eAAO,MAAM,eAAe,oBAAoB,CAAA;AAChD,eAAO,MAAM,gBAAgB,qBAAqB,CAAA;AAClD,eAAO,MAAM,oBAAoB,6BAA6B,CAAA;AAC9D,eAAO,MAAM,wBAAwB,yBAAyB,CAAA;AAC9D,eAAO,MAAM,uBAAuB,wBAAwB,CAAA;AAC5D,eAAO,MAAM,iBAAiB,WAAW,CAAA;AACzC,eAAO,MAAM,uBAAuB,iBAAiB,CAAA;AAErD,MAAM,WAAW,aAAa;IAAG,OAAO,EAAE,MAAM,CAAA;CAAE;AAClD,MAAM,WAAW,YAAY;IAAG,EAAE,EAAE,OAAO,CAAA;CAAE;AAe7C,qFAAqF;AACrF,eAAO,MAAM,WAAW;;;;;;CAWd,CAAA"}
package/build/consts.js CHANGED
@@ -1,4 +1,4 @@
1
- import { contract, protocol, protocols, schema, typed } from '@owlmeans/entrypoint';
1
+ import { contract, protocol, schema, typed } from '@owlmeans/entrypoint';
2
2
  import { backend, route, RouteMethod } from '@owlmeans/route';
3
3
  import { GUARD_ED25519 } from '@owlmeans/server-app';
4
4
  export const STRIPE_PAYGATE_ALIAS = 'stripe';
@@ -29,5 +29,4 @@ export const paymentGate = {
29
29
  webhook: protocol(route(aliases.webhook, '/webhook/:paygate', backend({ parent: base, method: RouteMethod.POST })), contract.request({ params: PaygateParamsSchema }, typed())),
30
30
  resync: protocol(route(aliases.resync, '/resync', backend({ parent: base, method: RouteMethod.POST })), contract(ResyncResultSchema), { guards: GUARD_ED25519 }),
31
31
  };
32
- export const paymentGateProtocols = protocols(paymentGate);
33
32
  //# sourceMappingURL=consts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACnF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAGpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,QAAQ,CAAA;AAC5C,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAA;AACt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AAM,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,EACrF,QAAQ,CAAC,kBAAkB,CAAC,EAC5B,EAAE,MAAM,EAAE,aAAa,EAAE,CAC1B;CACO,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/server-payment",
3
- "version": "0.1.18-rc.2",
3
+ "version": "0.1.18-rc.4",
4
4
  "license": "MIT",
5
5
  "description": "Protocol-bound payment resources, entitlement gates, and Stripe checkout for OwlMeans servers.",
6
6
  "type": "module",
@@ -26,18 +26,18 @@
26
26
  "ajv": "*"
27
27
  },
28
28
  "dependencies": {
29
- "@owlmeans/auth": "^0.1.18-rc.14",
30
- "@owlmeans/config": "^0.1.18-rc.17",
31
- "@owlmeans/context": "^0.1.18-rc.13",
32
- "@owlmeans/entrypoint": "^0.1.18-rc.16",
33
- "@owlmeans/mongo-resource": "^0.1.18-rc.17",
34
- "@owlmeans/payment": "^0.1.18-rc.18",
35
- "@owlmeans/resource": "^0.1.18-rc.14",
36
- "@owlmeans/route": "^0.1.18-rc.14",
37
- "@owlmeans/server-api": "^0.1.18-rc.22",
38
- "@owlmeans/server-app": "^0.1.18-rc.24",
39
- "@owlmeans/server-context": "^0.1.18-rc.17",
40
- "@owlmeans/server-entrypoint": "^0.1.18-rc.16",
29
+ "@owlmeans/auth": "^0.1.18-rc.16",
30
+ "@owlmeans/config": "^0.1.18-rc.19",
31
+ "@owlmeans/context": "^0.1.18-rc.15",
32
+ "@owlmeans/entrypoint": "^0.1.18-rc.18",
33
+ "@owlmeans/mongo-resource": "^0.1.18-rc.19",
34
+ "@owlmeans/payment": "^0.1.18-rc.20",
35
+ "@owlmeans/resource": "^0.1.18-rc.16",
36
+ "@owlmeans/route": "^0.1.18-rc.16",
37
+ "@owlmeans/server-api": "^0.1.18-rc.24",
38
+ "@owlmeans/server-app": "^0.1.18-rc.26",
39
+ "@owlmeans/server-context": "^0.1.18-rc.19",
40
+ "@owlmeans/server-entrypoint": "^0.1.18-rc.18",
41
41
  "async-mutex": "^0.5.0",
42
42
  "stripe": "^17.7.0"
43
43
  },
package/src/consts.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { contract, protocol, protocols, schema, typed } from '@owlmeans/entrypoint'
1
+ import { contract, protocol, schema, typed } from '@owlmeans/entrypoint'
2
2
  import { backend, route, RouteMethod } from '@owlmeans/route'
3
3
  import { GUARD_ED25519 } from '@owlmeans/server-app'
4
4
  import type { JSONSchemaType } from 'ajv'
@@ -43,5 +43,3 @@ export const paymentGate = {
43
43
  { guards: GUARD_ED25519 },
44
44
  ),
45
45
  } as const
46
-
47
- export const paymentGateProtocols = protocols(paymentGate)
@@ -1,6 +1,8 @@
1
1
  import { describe, expect, test } from 'bun:test'
2
+ import { protocols } from '@owlmeans/entrypoint'
2
3
  import type { ParamsOf, ResponseOf } from '@owlmeans/entrypoint'
3
- import { paymentGate, paymentGateProtocols } from '../src/index.js'
4
+ import * as payment from '../src/index.js'
5
+ import { paymentGate } from '../src/index.js'
4
6
 
5
7
  describe('server payment protocols', () => {
6
8
  test('bind webhook params and resync response to their declarations', () => {
@@ -12,9 +14,10 @@ describe('server payment protocols', () => {
12
14
  expect(paymentGate.webhook.route.route.parent).toBe(paymentGate.base.alias)
13
15
  })
14
16
 
15
- test('exports a flattened list of immutable protocol objects', () => {
16
- expect(paymentGateProtocols).toContain(paymentGate.webhook)
17
- expect(paymentGateProtocols.every(item => item.kind === 'entrypoint-protocol')).toBe(true)
17
+ test('exports an immutable protocol tree without a flattened compatibility list', () => {
18
+ expect(protocols(paymentGate)).toContain(paymentGate.webhook)
19
+ expect(protocols(paymentGate).every(item => item.kind === 'entrypoint-protocol')).toBe(true)
20
+ expect(payment).not.toHaveProperty('paymentGateProtocols')
18
21
  expect(Object.isFrozen(paymentGate.resync)).toBe(true)
19
22
  })
20
23
  })