@owlmeans/auth 0.2.3 → 0.2.4-rc.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.
package/README.md CHANGED
@@ -14,7 +14,7 @@ shared auth protocols and organization-entity resolution (`makeEntityScope(req)`
14
14
  ## Installation
15
15
 
16
16
  ```bash
17
- bun add @owlmeans/auth@^0.2.3
17
+ bun add @owlmeans/auth@^0.2.4-rc.0
18
18
  ```
19
19
 
20
20
  `ajv` is a **peer** dependency — install it alongside, or `authHelper.verifyAuth` /
@@ -331,7 +331,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
331
331
  your project's skill store (`.agents/skills/`):
332
332
 
333
333
  ```sh
334
- npx @owlmeans/agent-skills@^0.2.3
334
+ npx @owlmeans/agent-skills@^0.2.4-rc.1
335
335
  ```
336
336
 
337
337
  The embedded files are version-matched to this package release. Do not edit them
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 3,
3
3
  "package": "@owlmeans/auth",
4
- "version": "0.2.3",
5
- "generatedAt": "2026-11-23T12:48:29.699Z",
4
+ "version": "0.2.4-rc.0",
5
+ "generatedAt": "2026-11-25T14:32:53.659Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -8,7 +8,7 @@ user-invocable: false
8
8
  # @owlmeans/auth
9
9
 
10
10
  **Layer:** Core
11
- **Install:** `"@owlmeans/auth": "^0.2.3"` in `dependencies`
11
+ **Install:** `"@owlmeans/auth": "^0.2.4-rc.0"` in `dependencies`
12
12
 
13
13
  Types, enums, errors and schemas only — no services, no wiring. Every other auth package builds on
14
14
  this vocabulary, so a symbol belongs here exactly when both a server and a browser need to agree on
@@ -0,0 +1,7 @@
1
+ import type { JSONSchemaType } from 'ajv';
2
+ import type { AllowanceRequest, Auth, AuthCredentials, AuthPayload } from '../types.js';
3
+ export declare const PartialAuthPayloadSchema: JSONSchemaType<Omit<Partial<AuthPayload>, "type">>;
4
+ export declare const AllowanceRequestSchema: JSONSchemaType<AllowanceRequest>;
5
+ export declare const AuthCredentialsSchema: JSONSchemaType<AuthCredentials>;
6
+ export declare const AuthSchema: JSONSchemaType<Auth>;
7
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/allowance/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AACzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAQvF,eAAO,MAAM,wBAAwB,EAAE,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAkBvF,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,cAAc,CAAC,gBAAgB,CAQnE,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,cAAc,CAAC,eAAe,CAajE,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,IAAI,CAa3C,CAAA"}
@@ -0,0 +1,60 @@
1
+ import { AuthRoleSchema, EntitySlugValueSchema, GroupValueSchema, IdValueSchema, DateSchema, ScopeValueSchema, TypeNameSchema } from '../consts.js';
2
+ import { AuthPayloadSchema } from '../auth/model.js';
3
+ import { AttributeSetSchema, PermissionSetSchema } from '../permission/model.js';
4
+ export const PartialAuthPayloadSchema = {
5
+ type: 'object',
6
+ properties: {
7
+ role: { ...AuthRoleSchema, nullable: true },
8
+ source: { type: 'string', minLength: 1, maxLength: 1024, nullable: true },
9
+ userId: { ...IdValueSchema, nullable: true },
10
+ profileId: { ...IdValueSchema, nullable: true },
11
+ expiresAt: { ...DateSchema, nullable: true },
12
+ groups: { type: 'array', items: GroupValueSchema, nullable: true },
13
+ entitySlug: { ...EntitySlugValueSchema, nullable: true },
14
+ scopes: { type: 'array', items: ScopeValueSchema, nullable: true },
15
+ permissions: { type: 'array', nullable: true, items: PermissionSetSchema },
16
+ attributes: { type: 'array', nullable: true, items: AttributeSetSchema },
17
+ permissioned: { type: 'boolean', nullable: true },
18
+ denormalized: { type: 'boolean', nullable: true }
19
+ },
20
+ required: [],
21
+ additionalProperties: false,
22
+ };
23
+ export const AllowanceRequestSchema = {
24
+ type: 'object',
25
+ properties: {
26
+ type: TypeNameSchema,
27
+ ...PartialAuthPayloadSchema.properties,
28
+ },
29
+ required: ['type'],
30
+ additionalProperties: false,
31
+ };
32
+ export const AuthCredentialsSchema = {
33
+ type: 'object',
34
+ properties: {
35
+ challenge: { type: 'string', minLength: 32, maxLength: 1024 },
36
+ // Not every plugin's credential is a long token/signature — email-OTP submits a short
37
+ // numeric code (see @owlmeans/auth-otp OTP_CODE_LENGTH). Security here comes from the
38
+ // signed challenge envelope plus each plugin's own credential check, not this length floor.
39
+ credential: { type: 'string', minLength: 1, maxLength: 4096 },
40
+ publicKey: { type: 'string', minLength: 16, maxLength: 1024, nullable: true },
41
+ ...AuthPayloadSchema.properties
42
+ },
43
+ required: ['challenge', 'credential', ...AuthPayloadSchema.required],
44
+ additionalProperties: false,
45
+ };
46
+ export const AuthSchema = {
47
+ type: 'object',
48
+ properties: {
49
+ token: { type: 'string', minLength: 32, maxLength: 1024 },
50
+ isUser: { type: 'boolean' },
51
+ createdAt: DateSchema,
52
+ expiresAt: { ...DateSchema, nullable: true },
53
+ ...AuthPayloadSchema.properties,
54
+ },
55
+ required: [
56
+ 'token', 'isUser', 'createdAt', 'type', 'role', 'userId'
57
+ ],
58
+ additionalProperties: false,
59
+ };
60
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/allowance/model.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,aAAa,EAAE,UAAU,EAClF,gBAAgB,EAAE,cAAc,EACjC,MAAM,cAAc,CAAA;AACrB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D,QAAQ,EAAE;QACR,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ;KACzD;IACD,oBAAoB,EAAE,KAAK;CAC5B,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { JSONSchemaType } from 'ajv';
2
+ import type { AuthPayload, AuthToken, Authorization, ProfilePayload } from '../types.js';
3
+ export declare const AuthorizationSchema: JSONSchemaType<Authorization>;
4
+ export declare const ProfilePayloadSchema: JSONSchemaType<ProfilePayload>;
5
+ export declare const AuthPayloadSchema: JSONSchemaType<AuthPayload>;
6
+ export declare const AuthTokenSchema: JSONSchemaType<AuthToken>;
7
+ export declare const OptionalAuthTokenSchema: JSONSchemaType<Partial<AuthToken>>;
8
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/auth/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAOxF,eAAO,MAAM,mBAAmB,EAAE,cAAc,CAAC,aAAa,CAY7D,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,cAAc,CAQ/D,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,WAAW,CAazD,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,SAAS,CAOrD,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,CAOtE,CAAA"}
@@ -0,0 +1,55 @@
1
+ import { EntitySlugValueSchema, EnumValueSchema, GroupValueSchema, IdValueSchema, DateSchema, ScopeValueSchema, TypeNameSchema } from '../consts.js';
2
+ import { AttributeSetSchema, PermissionSetSchema } from '../permission/model.js';
3
+ export const AuthorizationSchema = {
4
+ type: 'object',
5
+ properties: {
6
+ entitySlug: { ...EntitySlugValueSchema, nullable: true },
7
+ scopes: { type: 'array', items: ScopeValueSchema },
8
+ permissions: { type: 'array', nullable: true, items: PermissionSetSchema },
9
+ attributes: { type: 'array', nullable: true, items: AttributeSetSchema },
10
+ permissioned: { type: 'boolean', nullable: true },
11
+ denormalized: { type: 'boolean', nullable: true }
12
+ },
13
+ required: ['scopes'],
14
+ additionalProperties: false,
15
+ };
16
+ export const ProfilePayloadSchema = {
17
+ type: 'object',
18
+ properties: {
19
+ ...AuthorizationSchema.properties,
20
+ groups: { type: 'array', nullable: true, items: GroupValueSchema },
21
+ },
22
+ required: ['scopes'],
23
+ additionalProperties: false,
24
+ };
25
+ export const AuthPayloadSchema = {
26
+ type: 'object',
27
+ properties: {
28
+ ...ProfilePayloadSchema.properties,
29
+ type: TypeNameSchema,
30
+ role: EnumValueSchema,
31
+ source: { type: 'string', minLength: 1, maxLength: 1024, nullable: true },
32
+ userId: { ...IdValueSchema, nullable: true },
33
+ profileId: { ...IdValueSchema, nullable: true },
34
+ expiresAt: { ...DateSchema, nullable: true },
35
+ },
36
+ required: ['scopes', 'role', 'type'],
37
+ additionalProperties: false,
38
+ };
39
+ export const AuthTokenSchema = {
40
+ type: 'object',
41
+ properties: {
42
+ token: { type: 'string', minLength: 32, maxLength: 1024 },
43
+ },
44
+ required: ['token'],
45
+ additionalProperties: false,
46
+ };
47
+ export const OptionalAuthTokenSchema = {
48
+ type: 'object',
49
+ properties: {
50
+ token: { type: 'string', minLength: 32, maxLength: 1024, nullable: true },
51
+ },
52
+ required: [],
53
+ additionalProperties: false,
54
+ };
55
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/auth/model.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,qBAAqB,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,UAAU,EAAE,gBAAgB,EACrG,cAAc,EACf,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AE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;QACzE,MAAM,EAAE,EAAE,GAAG,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC5C,SAAS,EAAE,EAAE,GAAG,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC/C,SAAS,EAAE,EAAE,GAAG,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;KACtC;IACR,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;IACpC,oBAAoB,EAAE,KAAK;CAC5B,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAA8B;IACxD,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;KAC1D;IACD,QAAQ,EAAE,CAAC,OAAO,CAAC;IACnB,oBAAoB,EAAE,KAAK;CAC5B,CAAA;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAuC;IACzE,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;KAC1E;IACD,QAAQ,EAAE,EAAE;IACZ,oBAAoB,EAAE,KAAK;CAC5B,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { JSONSchemaType } from 'ajv';
2
+ import type { Profile } from '../types.js';
3
+ export declare const ProfileSchema: JSONSchemaType<Profile>;
4
+ //# sourceMappingURL=profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/entity/profile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAI1C,eAAO,MAAM,aAAa,EAAE,cAAc,CAAC,OAAO,CAiBjD,CAAA"}
@@ -0,0 +1,21 @@
1
+ import { EntitySlugValueSchema, IdValueSchema } from '../consts.js';
2
+ import { PermissionSetSchema, AttributeSetSchema } from '../permission/model.js';
3
+ export const ProfileSchema = {
4
+ type: 'object',
5
+ properties: {
6
+ id: IdValueSchema,
7
+ name: { type: 'string', minLength: 0, maxLength: 128 },
8
+ credential: { type: 'string', nullable: true },
9
+ secret: { type: 'string', nullable: true },
10
+ groups: { type: 'array', items: { type: 'string' }, nullable: true },
11
+ entitySlug: { ...EntitySlugValueSchema, nullable: true },
12
+ scopes: { type: 'array', items: { type: 'string' } },
13
+ permissions: { type: 'array', items: PermissionSetSchema, nullable: true },
14
+ attributes: { type: 'array', items: AttributeSetSchema, nullable: true },
15
+ permissioned: { type: 'boolean', nullable: true },
16
+ denormalized: { type: 'boolean', nullable: true }
17
+ },
18
+ required: ['id', 'name', 'scopes'],
19
+ additionalProperties: false,
20
+ };
21
+ //# sourceMappingURL=profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/entity/profile.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAEhF,MAAM,CAAC,MAAM,aAAa,GAA4B;IACpD,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,EAAE,EAAE,aAAa;QACjB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE;QACtD,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC9C,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC1C,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;QACpE,UAAU,EAAE,EAAC,GAAG,qBAAqB,EAAE,QAAQ,EAAE,IAAI,EAAC;QACtD,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;QACpD,WAAW,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC1E,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,IAAI,EAAE;QACxE,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE;QACjD,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE;KAClD;IACD,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC;IAClC,oBAAoB,EAAE,KAAK;CAC5B,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { JSONSchemaType } from 'ajv';
2
+ import { AttributeSet, Capabilties, PermissionSet } from '../types.js';
3
+ export declare const CapabiltiesSchema: JSONSchemaType<Capabilties>;
4
+ export declare const PermissionSetSchema: JSONSchemaType<PermissionSet>;
5
+ export declare const AttributeSetSchema: JSONSchemaType<AttributeSet>;
6
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/permission/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AACpC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAGtE,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,WAAW,CAIzD,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,cAAc,CAAC,aAAa,CAU7D,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,YAAY,CAQ3D,CAAA"}
@@ -0,0 +1,27 @@
1
+ import { AttributeValueSchema, ResourceValueSchema, ScopeValueSchema } from '../consts.js';
2
+ export const CapabiltiesSchema = {
3
+ type: 'object',
4
+ additionalProperties: { type: ['boolean', 'number'], nullable: true },
5
+ required: []
6
+ };
7
+ export const PermissionSetSchema = {
8
+ type: 'object',
9
+ properties: {
10
+ title: { type: 'string', nullable: true, minLength: 1, maxLength: 128 },
11
+ scope: ScopeValueSchema,
12
+ permissions: CapabiltiesSchema,
13
+ resources: { type: 'array', items: ResourceValueSchema, nullable: true }
14
+ },
15
+ required: ['scope', 'permissions'],
16
+ additionalProperties: false,
17
+ };
18
+ export const AttributeSetSchema = {
19
+ type: 'object',
20
+ properties: {
21
+ scope: ScopeValueSchema,
22
+ attributes: { type: 'array', items: AttributeValueSchema }
23
+ },
24
+ required: ['scope', 'attributes'],
25
+ additionalProperties: false,
26
+ };
27
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/permission/model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAE1F,MAAM,CAAC,MAAM,iBAAiB,GAAgC;IAC5D,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,EAAE,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;IACrE,QAAQ,EAAE,EAAE;CACb,CAAA;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAkC;IAChE,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE;QACvE,KAAK,EAAE,gBAAgB;QACvB,WAAW,EAAE,iBAAiB;QAC9B,SAAS,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,IAAI,EAAE;KACzE;IACD,QAAQ,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC;IAClC,oBAAoB,EAAE,KAAK;CAC5B,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAiC;IAC9D,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,KAAK,EAAE,gBAAgB;QACvB,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAE;KAC3D;IACD,QAAQ,EAAE,CAAC,OAAO,EAAE,YAAY,CAAC;IACjC,oBAAoB,EAAE,KAAK;CAC5B,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { JSONSchemaType } from 'ajv';
2
+ import type { RelyToken } from './types.js';
3
+ export declare const RelyChallengeSchema: JSONSchemaType<RelyToken>;
4
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/rely/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C,eAAO,MAAM,mBAAmB,EAAE,cAAc,CAAC,SAAS,CAUzD,CAAA"}
@@ -0,0 +1,12 @@
1
+ export const RelyChallengeSchema = {
2
+ type: 'object',
3
+ properties: {
4
+ pin: { type: 'string', nullable: true, minLength: 4, maxLength: 12 },
5
+ token: { type: 'string', nullable: true, minLength: 8, maxLength: 16 },
6
+ check: { type: 'string', nullable: true, minLength: 2, maxLength: 8 },
7
+ nonce: { type: 'string', minLength: 8, maxLength: 32 }
8
+ },
9
+ required: ['nonce'],
10
+ additionalProperties: false,
11
+ };
12
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/rely/model.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,mBAAmB,GAA8B;IAC5D,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;QACpE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;QACtE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE;QACrE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE;KACvD;IACD,QAAQ,EAAE,CAAC,OAAO,CAAC;IACnB,oBAAoB,EAAE,KAAK;CAC5B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/auth",
3
- "version": "0.2.3",
3
+ "version": "0.2.4-rc.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://owlmeans.com/docs/",
6
6
  "repository": {
@@ -32,14 +32,14 @@
32
32
  }
33
33
  },
34
34
  "dependencies": {
35
- "@owlmeans/error": "^0.2.3",
35
+ "@owlmeans/error": "^0.2.4-rc.0",
36
36
  "ajv-formats": "^3.0.1"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "ajv": "*"
40
40
  },
41
41
  "devDependencies": {
42
- "@owlmeans/dep-config": "^0.2.3",
42
+ "@owlmeans/dep-config": "^0.2.4-rc.0",
43
43
  "@types/bun": "^1.4.4",
44
44
  "nodemon": "^3.1.14",
45
45
  "typescript": "^7.0.2"