@owlmeans/payment 0.1.18-rc.40 → 0.1.18-rc.41

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
@@ -8,7 +8,7 @@ server integration (`@owlmeans/server-payment`) implements against these contrac
8
8
  ## Installation
9
9
 
10
10
  ```bash
11
- bun add @owlmeans/payment@^0.1.18-rc.40
11
+ bun add @owlmeans/payment@^0.1.18-rc.41
12
12
  ```
13
13
 
14
14
  ## Concepts
@@ -129,7 +129,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
129
129
  your project's skill store (`.agents/skills/`):
130
130
 
131
131
  ```sh
132
- npx @owlmeans/agent-skills@^0.1.18-rc.40
132
+ npx @owlmeans/agent-skills@^0.1.18-rc.41
133
133
  ```
134
134
 
135
135
  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/payment",
4
- "version": "0.1.18-rc.40",
5
- "generatedAt": "2026-09-25T21:19:37.975Z",
4
+ "version": "0.1.18-rc.41",
5
+ "generatedAt": "2026-09-28T02:06:37.886Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -8,7 +8,7 @@ user-invocable: false
8
8
  # @owlmeans/payment
9
9
 
10
10
  **Layer:** Core
11
- **Install:** `"@owlmeans/payment": "^0.1.18-rc.40"` in `dependencies`
11
+ **Install:** `"@owlmeans/payment": "^0.1.18-rc.41"` in `dependencies`
12
12
 
13
13
  The contracts half of payments: the catalogue (products, plans, localizations), amount- and
14
14
  quantity-priced checkout, the entitlement model — plan capabilities, counted limits, promos,
@@ -0,0 +1,9 @@
1
+ import type { JSONSchemaType } from 'ajv';
2
+ import type { PlanSubscription, SubscriptionPropagateBody } from '../types.js';
3
+ export declare const PlanSubscriptionSchema: JSONSchemaType<PlanSubscription>;
4
+ export declare const SubscriptionPropagateBodySchema: JSONSchemaType<SubscriptionPropagateBody>;
5
+ /**
6
+ * @deprecated Use SubscriptionPropogateBodySchema instead
7
+ */
8
+ export declare const SubscriptionPropogateBodySchema: JSONSchemaType<SubscriptionPropagateBody>;
9
+ //# sourceMappingURL=subscription.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription.d.ts","sourceRoot":"","sources":["../../src/model/subscription.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAK9E,eAAO,MAAM,sBAAsB,EAAE,cAAc,CAAC,gBAAgB,CA+BnE,CAAA;AAED,eAAO,MAAM,+BAA+B,EAAE,cAAc,CAAC,yBAAyB,CASrF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,+BAA+B,EAAE,cAAc,CAAC,yBAAyB,CASrF,CAAA"}
@@ -0,0 +1,59 @@
1
+ import { ResourceValueSchema, PermissionSetSchema, DateSchema, EntityValueSchema, IdValueSchema } from '@owlmeans/auth';
2
+ import { SubscriptionStatusSchema } from '../consts.js';
3
+ import { CapabilityUsageSchema, LimitConfigSchema } from './utils.js';
4
+ export const PlanSubscriptionSchema = {
5
+ type: 'object',
6
+ properties: {
7
+ sku: ResourceValueSchema,
8
+ entityId: EntityValueSchema,
9
+ paymentMethod: { ...IdValueSchema, nullable: true },
10
+ externalId: { ...IdValueSchema, nullable: true },
11
+ createdAt: DateSchema,
12
+ lastPaymentAt: { ...DateSchema, nullable: true },
13
+ trialUntil: { ...DateSchema, nullable: true },
14
+ startsdAt: DateSchema,
15
+ expirationAt: { ...DateSchema, nullable: true },
16
+ endsAt: { ...DateSchema, nullable: true },
17
+ archiveAt: { ...DateSchema, nullable: true },
18
+ suspendedAt: { ...DateSchema, nullable: true },
19
+ canceledAt: { ...DateSchema, nullable: true },
20
+ blockedAt: { ...DateSchema, nullable: true },
21
+ suspendedUntil: { ...DateSchema, nullable: true },
22
+ status: SubscriptionStatusSchema,
23
+ capabilities: { type: 'array', items: PermissionSetSchema, nullable: true },
24
+ limits: {
25
+ type: 'object', required: [], nullable: true,
26
+ additionalProperties: LimitConfigSchema
27
+ },
28
+ consumptions: {
29
+ type: 'object', required: [], nullable: true,
30
+ additionalProperties: CapabilityUsageSchema
31
+ }
32
+ },
33
+ required: ['sku', 'entityId', 'createdAt', 'startsdAt', 'status'],
34
+ additionalProperties: false,
35
+ };
36
+ export const SubscriptionPropagateBodySchema = {
37
+ type: 'object',
38
+ properties: {
39
+ ...PlanSubscriptionSchema.properties,
40
+ service: { ...ResourceValueSchema, minLength: 2 },
41
+ externalId: IdValueSchema,
42
+ }, // @TODO Figure out why it doesn't work (probably different version of ajv)
43
+ required: ['externalId', 'service', ...PlanSubscriptionSchema.required],
44
+ additionalProperties: false,
45
+ };
46
+ /**
47
+ * @deprecated Use SubscriptionPropogateBodySchema instead
48
+ */
49
+ export const SubscriptionPropogateBodySchema = {
50
+ type: 'object',
51
+ properties: {
52
+ ...PlanSubscriptionSchema.properties,
53
+ service: { ...ResourceValueSchema, minLength: 2 },
54
+ externalId: IdValueSchema,
55
+ }, // @TODO Figure out why it doesn't work (probably different version of ajv)
56
+ required: ['externalId', 'service', ...PlanSubscriptionSchema.required],
57
+ additionalProperties: false,
58
+ };
59
+ //# sourceMappingURL=subscription.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription.js","sourceRoot":"","sources":["../../src/model/subscription.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,UAAU,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACvH,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAErE,MAAM,CAAC,MAAM,sBAAsB,GAAqC;IACtE,IAAI,EAAE,QAAQ;IAC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AE,qBAAqB;SAC5C;KACF;IACD,QAAQ,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,CAAC;IACjE,oBAAoB,EAAE,KAAK;CAC5B,CAAA;AAED,MAAM,CAAC,MAAM,+BAA+B,GAA8C;IACxF,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,GAAG,sBAAsB,CAAC,UAAU;QACpC,OAAO,EAAE,EAAE,GAAG,mBAAmB,EAAE,SAAS,EAAE,CAAC,EAAE;QACjD,UAAU,EAAE,aAAa;KACnB,EAAE,2EAA2E;IACrF,QAAQ,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,GAAG,sBAAsB,CAAC,QAAQ,CAAC;IACvE,oBAAoB,EAAE,KAAK;CAC5B,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAA8C;IACxF,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,GAAG,sBAAsB,CAAC,UAAU;QACpC,OAAO,EAAE,EAAE,GAAG,mBAAmB,EAAE,SAAS,EAAE,CAAC,EAAE;QACjD,UAAU,EAAE,aAAa;KACnB,EAAE,2EAA2E;IACrF,QAAQ,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,GAAG,sBAAsB,CAAC,QAAQ,CAAC;IACvE,oBAAoB,EAAE,KAAK;CAC5B,CAAA"}
@@ -0,0 +1,5 @@
1
+ import type { JSONSchemaType } from 'ajv';
2
+ import type { LimitConfig, CapabilityUsage } from '../types.js';
3
+ export declare const LimitConfigSchema: JSONSchemaType<LimitConfig>;
4
+ export declare const CapabilityUsageSchema: JSONSchemaType<CapabilityUsage>;
5
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/model/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAI/D,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,WAAW,CASzD,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,cAAc,CAAC,eAAe,CAcjE,CAAA"}
@@ -0,0 +1,28 @@
1
+ import { PlanDurationSchema } from '../consts.js';
2
+ import { DateSchema } from '@owlmeans/auth';
3
+ export const LimitConfigSchema = {
4
+ type: 'object',
5
+ properties: {
6
+ interval: PlanDurationSchema,
7
+ measurment: { type: 'string', nullable: true, maxLength: 16 },
8
+ limit: { type: 'number' }
9
+ },
10
+ required: ['interval', 'limit'],
11
+ additionalProperties: false,
12
+ };
13
+ export const CapabilityUsageSchema = {
14
+ type: 'object',
15
+ properties: {
16
+ interval: PlanDurationSchema,
17
+ measurment: { type: 'string', nullable: true, maxLength: 16 },
18
+ startedAt: DateSchema,
19
+ limit: { type: 'number' },
20
+ refreshedAt: { ...DateSchema, nullable: true },
21
+ refreshAt: { ...DateSchema, nullable: true },
22
+ lastConsumedAt: { ...DateSchema, nullable: true },
23
+ consumption: { type: 'number' }
24
+ },
25
+ required: ['interval', 'limit', 'startedAt', 'consumption'],
26
+ additionalProperties: false,
27
+ };
28
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/model/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,MAAM,CAAC,MAAM,iBAAiB,GAAgC;IAC5D,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,QAAQ,EAAE,kBAAkB;QAC5B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE;QAC7D,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC1B;IACD,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC;IAC/B,oBAAoB,EAAE,KAAK;CAC5B,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAoC;IACpE,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,QAAQ,EAAE,kBAAkB;QAC5B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE;QAC7D,SAAS,EAAE,UAAU;QACrB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACzB,WAAW,EAAE,EAAE,GAAG,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC9C,SAAS,EAAE,EAAE,GAAG,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC5C,cAAc,EAAE,EAAE,GAAG,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;QACjD,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAChC;IACD,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,CAAC;IAC3D,oBAAoB,EAAE,KAAK;CAC5B,CAAA"}
@@ -0,0 +1,3 @@
1
+ export declare const modules: import("@owlmeans/entrypoint").CommonEntrypoint[];
2
+ export declare const serviceModules: import("@owlmeans/entrypoint").CommonEntrypoint[];
3
+ //# sourceMappingURL=modules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,OAAO,mDAgBnB,CAAA;AAED,eAAO,MAAM,cAAc,mDAkB1B,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { body, filter, entrypoint } from '@owlmeans/entrypoint';
2
+ import { route, backend, RouteMethod } from '@owlmeans/route';
3
+ import { paymentApi } from './consts.js';
4
+ import { SubscriptionPropagateBodySchema } from './model/subscription.js';
5
+ import { CreateCheckoutBodySchema } from './model/checkout.js';
6
+ export const modules = [
7
+ entrypoint(route(paymentApi.subscription.base, '/subscription', backend())),
8
+ entrypoint(route(paymentApi.subscription.propogate, '/propogate', backend(paymentApi.subscription.base, RouteMethod.POST)), filter(body(SubscriptionPropagateBodySchema))),
9
+ entrypoint(route(paymentApi.subscription.propagate, '/propagate', backend(paymentApi.subscription.base, RouteMethod.POST)), filter(body(SubscriptionPropagateBodySchema)))
10
+ ];
11
+ export const serviceModules = [
12
+ entrypoint(route(paymentApi.service.base, '/payment-service', backend())),
13
+ entrypoint(route(paymentApi.service.checkout.base, '/checkout', backend(paymentApi.service.base))),
14
+ entrypoint(route(paymentApi.service.checkout.session.base, '/session', backend(paymentApi.service.checkout.base))),
15
+ entrypoint(route(paymentApi.service.checkout.session.external.base, '/external', backend(paymentApi.service.checkout.session.base))),
16
+ entrypoint(route(paymentApi.service.checkout.session.external.create, '/create', backend(paymentApi.service.checkout.session.external.base, RouteMethod.POST)), filter(body(CreateCheckoutBodySchema)))
17
+ ];
18
+ //# sourceMappingURL=modules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules.js","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAC/D,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAA;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAE9D,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3E,UAAU,CACR,KAAK,CAAC,UAAU,CAA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AO,CAAC,QAAQ,CAAC,IAAI,EACjD,WAAW,CAAC,IAAI,CACjB,CAAC,EACF,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CACvC;CACF,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/payment",
3
- "version": "0.1.18-rc.40",
3
+ "version": "0.1.18-rc.41",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -34,7 +34,7 @@
34
34
  "dependencies": {
35
35
  "@owlmeans/api-config": "^0.1.18-rc.37",
36
36
  "@owlmeans/auth": "^0.1.18-rc.36",
37
- "@owlmeans/basic-envelope": "^0.1.18-rc.38",
37
+ "@owlmeans/basic-envelope": "^0.1.18-rc.39",
38
38
  "@owlmeans/config": "^0.1.18-rc.38",
39
39
  "@owlmeans/context": "^0.1.18-rc.32",
40
40
  "@owlmeans/error": "^0.1.18-rc.36",