@owlmeans/route 0.1.18-rc.10 → 0.1.18-rc.12

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
@@ -4,7 +4,7 @@ Route model factory and type definitions for OwlMeans entrypoints.
4
4
 
5
5
  ## Overview
6
6
 
7
- - `route()` creates a `RouteModel` used as the first argument to `entrypoint()`
7
+ - `route()` creates a `RouteModel` used as the first argument to `protocol()` or `openProtocol()`
8
8
  - `frontend()` / `backend()` / `socket()` helpers set the route's `AppType` and parent
9
9
  - `RouteMethod` enum covers HTTP verbs; `RouteProtocols` covers `http`/`ws`
10
10
  - This package is a dependency of `@owlmeans/entrypoint` — you rarely use it directly unless defining entrypoint-level routes
@@ -22,25 +22,27 @@ bun add @owlmeans/route@^0.1.18-rc.8
22
22
 
23
23
  ## Usage
24
24
 
25
- Define routes for entrypoints (typically via `@owlmeans/server-app` re-exports):
25
+ Define routes for protocols:
26
26
 
27
27
  ```typescript
28
28
  import { route, frontend, backend, socket, RouteMethod } from '@owlmeans/route'
29
- import { entrypoint } from '@owlmeans/entrypoint'
29
+ import { contract, openProtocol, protocol, typed } from '@owlmeans/entrypoint'
30
30
 
31
31
  // Backend REST route
32
- const createEntrypoint = entrypoint(
33
- route('story-create', '/stories', backend('api', RouteMethod.POST))
32
+ const createProtocol = protocol(
33
+ route('story-create', '/stories', backend('api', RouteMethod.POST)),
34
+ contract(typed<CreateStory>()),
34
35
  )
35
36
 
36
37
  // Frontend client route nested under parent
37
- const storyEntrypoint = entrypoint(
38
+ const storyProtocol = openProtocol(
38
39
  route('story-view', '/stories/:id', frontend('app'))
39
40
  )
40
41
 
41
42
  // WebSocket route
42
- const wsEntrypoint = entrypoint(
43
- route('story-ws', '/stories/stream', socket('api'))
43
+ const wsProtocol = protocol(
44
+ route('story-ws', '/stories/stream', socket('api')),
45
+ contract(typed<StoryEvent>()),
44
46
  )
45
47
  ```
46
48
 
@@ -95,7 +97,7 @@ The pure functions the entrypoint accessors are built on. Each takes a context a
95
97
 
96
98
  ## Related Packages
97
99
 
98
- - [`@owlmeans/entrypoint`](../entrypoint) — `entrypoint()` takes a `RouteModel` as first argument
100
+ - [`@owlmeans/entrypoint`](../entrypoint) — `protocol()` and `openProtocol()` consume a `RouteModel`
99
101
  - [`@owlmeans/server-app`](../server-app) — re-exports `route` as `broute` (backend) alongside `route`
100
102
 
101
103
  <!-- owlmeans:agent-guidance:start -->
@@ -106,7 +108,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
106
108
  your project's skill store (`.agents/skills/`):
107
109
 
108
110
  ```sh
109
- npx @owlmeans/agent-skills@^0.1.18-rc.13
111
+ npx @owlmeans/agent-skills@^0.1.18-rc.15
110
112
  ```
111
113
 
112
114
  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/route",
4
- "version": "0.1.18-rc.10",
5
- "generatedAt": "2026-09-10T18:54:42.502Z",
4
+ "version": "0.1.18-rc.12",
5
+ "generatedAt": "2026-09-12T08:39:52.732Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -8,7 +8,7 @@ user-invocable: false
8
8
  # @owlmeans/route
9
9
 
10
10
  **Layer:** Core
11
- **Install:** `"@owlmeans/route": "^0.1.18-rc.10"` in `dependencies`
11
+ **Install:** `"@owlmeans/route": "^0.1.18-rc.12"` in `dependencies`
12
12
 
13
13
  ## Key Exports
14
14
 
@@ -81,18 +81,19 @@ Application code rarely calls these directly — `@owlmeans/entrypoint` exposes
81
81
 
82
82
  ```typescript
83
83
  import { route, frontend, RouteMethod } from '@owlmeans/route'
84
- import { entrypoint } from '@owlmeans/entrypoint'
84
+ import { contract, openProtocol, protocol, typed } from '@owlmeans/entrypoint'
85
85
 
86
86
  // Server route
87
- entrypoint(
87
+ protocol(
88
88
  route(manager.back.project.create, '/create', {
89
89
  parent: manager.back.project.base,
90
90
  method: RouteMethod.POST,
91
- })
91
+ }),
92
+ contract(typed<Project>()),
92
93
  )
93
94
 
94
95
  // Web route — frontend() marks it as a React page
95
- entrypoint(
96
+ openProtocol(
96
97
  route(HOME, '/', frontend({ default: true, parent: BASE }))
97
98
  )
98
99
  ```
package/build/helper.d.ts CHANGED
@@ -11,7 +11,7 @@ export declare const socket: (opts?: RouteOptions | string | null, secondary?: R
11
11
  /**
12
12
  * A backend route carried by the queue rather than by HTTP. Everything else about it is a normal
13
13
  * backend route — it has a path, a parent, guards and a filter — so the same declaration is served
14
- * with `elevate(...)` and called with `call()`; only the transport underneath differs.
14
+ * with `bind(...)` and called with `call()`; only the transport underneath differs.
15
15
  */
16
16
  export declare const job: (opts?: RouteOptions | string | null, secondary?: RouteOptions) => Partial<RouteOptions>;
17
17
  export declare const frontend: (opts?: RouteOptions | string | null, def?: RouteOptions | boolean) => Partial<RouteOptions>;
package/build/helper.js CHANGED
@@ -31,7 +31,7 @@ export const socket = (opts, secondary) => {
31
31
  /**
32
32
  * A backend route carried by the queue rather than by HTTP. Everything else about it is a normal
33
33
  * backend route — it has a path, a parent, guards and a filter — so the same declaration is served
34
- * with `elevate(...)` and called with `call()`; only the transport underneath differs.
34
+ * with `bind(...)` and called with `call()`; only the transport underneath differs.
35
35
  */
36
36
  export const job = (opts, secondary) => {
37
37
  const route = backend(opts, secondary);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/route",
3
- "version": "0.1.18-rc.10",
3
+ "version": "0.1.18-rc.12",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -28,7 +28,7 @@
28
28
  }
29
29
  },
30
30
  "dependencies": {
31
- "@owlmeans/context": "^0.1.18-rc.9"
31
+ "@owlmeans/context": "^0.1.18-rc.11"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@owlmeans/dep-config": "workspace:*",
package/src/helper.ts CHANGED
@@ -46,7 +46,7 @@ export const socket = (opts?: RouteOptions | string | null, secondary?: RouteOpt
46
46
  /**
47
47
  * A backend route carried by the queue rather than by HTTP. Everything else about it is a normal
48
48
  * backend route — it has a path, a parent, guards and a filter — so the same declaration is served
49
- * with `elevate(...)` and called with `call()`; only the transport underneath differs.
49
+ * with `bind(...)` and called with `call()`; only the transport underneath differs.
50
50
  */
51
51
  export const job = (opts?: RouteOptions | string | null, secondary?: RouteOptions): Partial<RouteOptions> => {
52
52
  const route = backend(opts, secondary)