@owlmeans/auth-token 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
@@ -6,7 +6,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
6
6
  your project's skill store (`.agents/skills/`):
7
7
 
8
8
  ```sh
9
- npx @owlmeans/agent-skills@^0.1.18-rc.14
9
+ npx @owlmeans/agent-skills@^0.1.18-rc.16
10
10
  ```
11
11
 
12
12
  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/auth-token",
4
- "version": "0.1.18-rc.2",
5
- "generatedAt": "2026-09-10T23:12:07.513Z",
4
+ "version": "0.1.18-rc.4",
5
+ "generatedAt": "2026-09-12T12:32:46.376Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -8,7 +8,7 @@ user-invocable: false
8
8
  # @owlmeans/auth-token
9
9
 
10
10
  **Layer:** Auth shared
11
- **Install:** `"@owlmeans/auth-token": "^0.1.18-rc.2"` in `dependencies`
11
+ **Install:** `"@owlmeans/auth-token": "^0.1.18-rc.4"` in `dependencies`
12
12
 
13
13
  The contract half of long-lived access tokens: the record shape, the route declarations, the
14
14
  format helpers, and one client-side guard that presents a token it was handed. The server half —
@@ -1,5 +1,4 @@
1
- import type { CommonEntrypoint } from '@owlmeans/entrypoint';
2
- import type { AuthTokenEntrypointOptions } from './types.js';
1
+ import type { AuthTokenEntrypoints, AuthTokenEntrypointOptions } from './types.js';
3
2
  /**
4
3
  * The three routes a token surface needs, ready to be spread into an application's entrypoints.
5
4
  *
@@ -11,5 +10,5 @@ import type { AuthTokenEntrypointOptions } from './types.js';
11
10
  * issuance, because a token that can be widened later is a token whose grant nobody can reason
12
11
  * about from the moment it was created.
13
12
  */
14
- export declare const makeAuthTokenEntrypoints: (opts?: AuthTokenEntrypointOptions) => CommonEntrypoint[];
13
+ export declare const makeAuthTokenEntrypoints: (opts?: AuthTokenEntrypointOptions) => AuthTokenEntrypoints;
15
14
  //# sourceMappingURL=entrypoints.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAI5D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAA;AAE5D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,wBAAwB,UAC7B,0BAA0B,KAC/B,gBAAgB,EAoBlB,CAAA"}
1
+ {"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAsC,oBAAoB,EAAE,0BAA0B,EAAwC,MAAM,YAAY,CAAA;AAE5J;;;;;;;;;;GAUG;AACH,eAAO,MAAM,wBAAwB,UAC7B,0BAA0B,KAC/B,oBAoBF,CAAA"}
@@ -1,4 +1,4 @@
1
- import { body, entrypoint, filter, guard, params } from '@owlmeans/entrypoint';
1
+ import { contract, openProtocol, protocol, typed } from '@owlmeans/entrypoint';
2
2
  import { route, RouteMethod } from '@owlmeans/route';
3
3
  import { authToken } from './consts.js';
4
4
  import { AccessTokenParamsSchema, CreateAccessTokenSchema } from './schemas.js';
@@ -16,15 +16,15 @@ import { AccessTokenParamsSchema, CreateAccessTokenSchema } from './schemas.js';
16
16
  export const makeAuthTokenEntrypoints = (opts = {}) => {
17
17
  const path = opts.path ?? '/tokens';
18
18
  const base = opts.parent != null
19
- ? entrypoint(route(authToken.base, path, { parent: opts.parent }))
20
- : entrypoint(route(authToken.base, path), opts.guard != null ? guard(opts.guard) : undefined);
21
- return [
19
+ ? openProtocol(route(authToken.base, path, { parent: opts.parent }))
20
+ : openProtocol(route(authToken.base, path), opts.guard == null ? undefined : { guards: opts.guard });
21
+ return {
22
22
  base,
23
- entrypoint(route(authToken.list, '/', {
23
+ list: protocol(route(authToken.list, '/', {
24
24
  parent: authToken.base, method: RouteMethod.GET
25
- })),
26
- entrypoint(route(authToken.create, '/', { parent: authToken.base, method: RouteMethod.POST }), filter(body(CreateAccessTokenSchema))),
27
- entrypoint(route(authToken.revoke, '/:id', { parent: authToken.base, method: RouteMethod.DELETE }), filter(params(AccessTokenParamsSchema))),
28
- ];
25
+ }), contract(typed())),
26
+ create: protocol(route(authToken.create, '/', { parent: authToken.base, method: RouteMethod.POST }), contract.request({ body: typed(CreateAccessTokenSchema) }, typed())),
27
+ revoke: protocol(route(authToken.revoke, '/:id', { parent: authToken.base, method: RouteMethod.DELETE }), contract.request({ params: typed(AccessTokenParamsSchema) }, typed())),
28
+ };
29
29
  };
30
30
  //# sourceMappingURL=entrypoints.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"entrypoints.js","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAE9E,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAG/E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,IAAI,GAA+B,EAAE,EACjB,EAAE;IACtB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,SAAS,CAAA;IACnC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI;QAC9B,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,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,CAAC,EAAE,EAAE,KAAK,EAAkB,CAAC,CACzG;KACF,CAAA;AACH,CAAC,CAAA"}
package/build/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { AuthRole } from '@owlmeans/auth';
2
2
  import type { ResourceRecord } from '@owlmeans/resource';
3
+ import type { EntrypointProtocol, OpenRequest, OpenValue } from '@owlmeans/entrypoint';
3
4
  /**
4
5
  * One long-lived access token, as stored.
5
6
  *
@@ -69,4 +70,17 @@ export interface AuthTokenEntrypointOptions {
69
70
  /** The guard the base carries when it has no parent to inherit one from. */
70
71
  guard?: string;
71
72
  }
73
+ /** The immutable declarations for a token-management surface. */
74
+ export interface AuthTokenEntrypoints {
75
+ base: EntrypointProtocol<OpenRequest, OpenValue>;
76
+ list: EntrypointProtocol<OpenRequest, AccessTokenList>;
77
+ create: EntrypointProtocol<{
78
+ body: CreateAccessToken;
79
+ }, IssuedAccessToken>;
80
+ revoke: EntrypointProtocol<{
81
+ params: AccessTokenParams;
82
+ }, {
83
+ id: string;
84
+ }>;
85
+ }
72
86
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAExD;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,6FAA6F;IAC7F,IAAI,EAAE,MAAM,CAAA;IACZ,4FAA4F;IAC5F,OAAO,EAAE,MAAM,CAAA;IACf,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,EAAE,CAAA;IACh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GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,GAAG,CAAC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;IAChD,MAAM,CAAC,EAAE,YAAY,GAAG,QAAQ,CAAA;CACjC;AAED,MAAM,WAAW,0BAA0B;IACzC,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,iEAAiE;AACjE,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,kBAAkB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;IAChD,IAAI,EAAE,kBAAkB,CAAC,WAAW,EAAE,eAAe,CAAC,CAAA;IACtD,MAAM,EAAE,kBAAkB,CAAC;QAAE,IAAI,EAAE,iBAAiB,CAAA;KAAE,EAAE,iBAAiB,CAAC,CAAA;IAC1E,MAAM,EAAE,kBAAkB,CAAC;QAAE,MAAM,EAAE,iBAAiB,CAAA;KAAE,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC1E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/auth-token",
3
- "version": "0.1.18-rc.2",
3
+ "version": "0.1.18-rc.4",
4
4
  "license": "MIT",
5
5
  "description": "Long-lived access tokens (API keys) on the OwlMeans auth rails — the record shape, the token format, the management entrypoints and the client-side carrier guard.",
6
6
  "type": "module",
@@ -23,11 +23,11 @@
23
23
  }
24
24
  },
25
25
  "dependencies": {
26
- "@owlmeans/auth": "^0.1.18-rc.11",
27
- "@owlmeans/context": "^0.1.18-rc.10",
28
- "@owlmeans/entrypoint": "^0.1.18-rc.13",
29
- "@owlmeans/resource": "^0.1.18-rc.11",
30
- "@owlmeans/route": "^0.1.18-rc.11"
26
+ "@owlmeans/auth": "^0.1.18-rc.13",
27
+ "@owlmeans/context": "^0.1.18-rc.12",
28
+ "@owlmeans/entrypoint": "^0.1.18-rc.15",
29
+ "@owlmeans/resource": "^0.1.18-rc.13",
30
+ "@owlmeans/route": "^0.1.18-rc.13"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@owlmeans/dep-config": "workspace:*",
@@ -1,9 +1,8 @@
1
- import { body, entrypoint, filter, guard, params } from '@owlmeans/entrypoint'
2
- import type { CommonEntrypoint } from '@owlmeans/entrypoint'
1
+ import { contract, openProtocol, protocol, typed } from '@owlmeans/entrypoint'
3
2
  import { route, RouteMethod } from '@owlmeans/route'
4
3
  import { authToken } from './consts.js'
5
4
  import { AccessTokenParamsSchema, CreateAccessTokenSchema } from './schemas.js'
6
- import type { AuthTokenEntrypointOptions } from './types.js'
5
+ import type { AccessTokenList, AccessTokenParams, AuthTokenEntrypoints, AuthTokenEntrypointOptions, CreateAccessToken, IssuedAccessToken } from './types.js'
7
6
 
8
7
  /**
9
8
  * The three routes a token surface needs, ready to be spread into an application's entrypoints.
@@ -18,24 +17,24 @@ import type { AuthTokenEntrypointOptions } from './types.js'
18
17
  */
19
18
  export const makeAuthTokenEntrypoints = (
20
19
  opts: AuthTokenEntrypointOptions = {}
21
- ): CommonEntrypoint[] => {
20
+ ): AuthTokenEntrypoints => {
22
21
  const path = opts.path ?? '/tokens'
23
22
  const base = opts.parent != null
24
- ? entrypoint(route(authToken.base, path, { parent: opts.parent }))
25
- : entrypoint(route(authToken.base, path), opts.guard != null ? guard(opts.guard) : undefined)
23
+ ? openProtocol(route(authToken.base, path, { parent: opts.parent }))
24
+ : openProtocol(route(authToken.base, path), opts.guard == null ? undefined : { guards: opts.guard })
26
25
 
27
- return [
26
+ return {
28
27
  base,
29
- entrypoint(route(authToken.list, '/', {
28
+ list: protocol(route(authToken.list, '/', {
30
29
  parent: authToken.base, method: RouteMethod.GET
31
- })),
32
- entrypoint(
30
+ }), contract(typed<AccessTokenList>())),
31
+ create: protocol(
33
32
  route(authToken.create, '/', { parent: authToken.base, method: RouteMethod.POST }),
34
- filter(body(CreateAccessTokenSchema))
33
+ contract.request({ body: typed<CreateAccessToken>(CreateAccessTokenSchema) }, typed<IssuedAccessToken>())
35
34
  ),
36
- entrypoint(
35
+ revoke: protocol(
37
36
  route(authToken.revoke, '/:id', { parent: authToken.base, method: RouteMethod.DELETE }),
38
- filter(params(AccessTokenParamsSchema))
37
+ contract.request({ params: typed<AccessTokenParams>(AccessTokenParamsSchema) }, typed<{ id: string }>())
39
38
  ),
40
- ]
39
+ }
41
40
  }
package/src/types.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { AuthRole } from '@owlmeans/auth'
2
2
  import type { ResourceRecord } from '@owlmeans/resource'
3
+ import type { EntrypointProtocol, OpenRequest, OpenValue } from '@owlmeans/entrypoint'
3
4
 
4
5
  /**
5
6
  * One long-lived access token, as stored.
@@ -77,3 +78,11 @@ export interface AuthTokenEntrypointOptions {
77
78
  /** The guard the base carries when it has no parent to inherit one from. */
78
79
  guard?: string
79
80
  }
81
+
82
+ /** The immutable declarations for a token-management surface. */
83
+ export interface AuthTokenEntrypoints {
84
+ base: EntrypointProtocol<OpenRequest, OpenValue>
85
+ list: EntrypointProtocol<OpenRequest, AccessTokenList>
86
+ create: EntrypointProtocol<{ body: CreateAccessToken }, IssuedAccessToken>
87
+ revoke: EntrypointProtocol<{ params: AccessTokenParams }, { id: string }>
88
+ }