@owlmeans/route 0.1.18-rc.26 → 0.1.18-rc.27
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 +18 -43
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/route/SKILL.md +10 -14
- package/build/consts.d.ts +2 -3
- package/build/consts.d.ts.map +1 -1
- package/build/consts.js +1 -2
- package/build/consts.js.map +1 -1
- package/build/helper.d.ts +0 -6
- package/build/helper.d.ts.map +1 -1
- package/build/helper.js +0 -10
- package/build/helper.js.map +1 -1
- package/build/types.d.ts +6 -12
- package/build/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/consts.ts +2 -3
- package/src/helper.ts +0 -13
- package/src/types.ts +7 -12
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The route declaration vocabulary for OwlMeans entrypoints. An app imports it in its shared contract
|
|
4
4
|
package, next to `@owlmeans/entrypoint`, to state for each entrypoint the URL segment, parent,
|
|
5
|
-
HTTP method, app type (backend or frontend) and transport
|
|
5
|
+
HTTP method, app type (backend or frontend) and transport identifier. It is not a
|
|
6
6
|
router and serves nothing: server binding is `@owlmeans/server-route` / `@owlmeans/server-app`,
|
|
7
7
|
client binding is `@owlmeans/client-route` / `@owlmeans/client-entrypoint`, UI routing is
|
|
8
8
|
`@owlmeans/router`. Application code usually reads addresses through the entrypoint accessors
|
|
@@ -16,23 +16,23 @@ context that asks, so the same declaration serves a server and a browser alike.
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
bun add @owlmeans/route@^0.1.18-rc.
|
|
19
|
+
bun add @owlmeans/route@^0.1.18-rc.27
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## Concepts
|
|
23
23
|
|
|
24
24
|
- **Declaration** — the `RouteDeclaration` a `route()` call produces: `alias`, `path` (the segment
|
|
25
|
-
under `parent`), `type`, `method`, `protocol`,
|
|
25
|
+
under `parent`), `type`, `method`, `protocol`, opaque `protocolOptions`, and service coordinates.
|
|
26
26
|
- **Model** — `RouteModel` is `{ route: RouteDeclaration }` and nothing more. `protocol()` and
|
|
27
27
|
`openProtocol()` from `@owlmeans/entrypoint` take it as their first argument.
|
|
28
|
-
- **Marker** — `backend()`, `frontend()
|
|
29
|
-
|
|
28
|
+
- **Marker** — `backend()`, `frontend()` and `socket()` return `Partial<RouteOptions>` that set the
|
|
29
|
+
app type and built-in protocol; a transport package may provide another marker.
|
|
30
30
|
- **Parent** — a route nests under another entrypoint. Pass the parent protocol object
|
|
31
31
|
(`parent: storyProtocols.base`); the declaration stores only its alias.
|
|
32
32
|
- **Service** — `service` names the configured service (`cfg.services`) that answers the route.
|
|
33
33
|
Without it the route belongs to the asking context's own service or the default one of its type.
|
|
34
|
-
- **Protocol** — `RouteProtocols`
|
|
35
|
-
|
|
34
|
+
- **Protocol** — `RouteProtocols` contains the built-in HTTP and WebSocket identifiers. A backend
|
|
35
|
+
transport package may supply another string identifier and owns its opaque option data.
|
|
36
36
|
|
|
37
37
|
## Usage
|
|
38
38
|
|
|
@@ -111,29 +111,24 @@ export const projectProtocols = {
|
|
|
111
111
|
} as const
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
### Sockets,
|
|
114
|
+
### Sockets, custom protocols and other services
|
|
115
115
|
|
|
116
|
-
`socket()`
|
|
117
|
-
service
|
|
116
|
+
`socket()` is `backend()` with a different protocol. A route pointed at another service carries
|
|
117
|
+
`service`. Adapter packages may add their own protocol and opaque `protocolOptions`; route does not
|
|
118
|
+
define their semantics.
|
|
118
119
|
|
|
119
120
|
```ts
|
|
120
121
|
import { contract, openProtocol, protocol, typed } from '@owlmeans/entrypoint'
|
|
121
|
-
import {
|
|
122
|
-
import {
|
|
123
|
-
import type { ProjectParams, StoryUpdate, Story } from './types.js'
|
|
122
|
+
import { route, socket } from '@owlmeans/route'
|
|
123
|
+
import type { ProjectParams, StoryUpdate } from './types.js'
|
|
124
124
|
import { ProjectParamsSchema } from './schemas.js'
|
|
125
125
|
|
|
126
|
-
const WORKER = 'my-app-worker'
|
|
127
126
|
const aliases = {
|
|
128
127
|
updates: 'my-app:api:update:base',
|
|
129
128
|
story: 'my-app:api:update:story',
|
|
130
|
-
jobs: 'my-app:worker:story:base',
|
|
131
|
-
develop: 'my-app:worker:story:develop',
|
|
132
|
-
cleanup: 'my-app:worker:story:cleanup',
|
|
133
129
|
} as const
|
|
134
130
|
|
|
135
131
|
const updates = openProtocol(route(aliases.updates, '/update'))
|
|
136
|
-
const jobs = openProtocol(route(aliases.jobs, '/story', { service: WORKER }), { guards: GUARD_ED25519 })
|
|
137
132
|
|
|
138
133
|
export const storyProtocols = {
|
|
139
134
|
updates,
|
|
@@ -142,27 +137,9 @@ export const storyProtocols = {
|
|
|
142
137
|
route(aliases.story, '/story/:id', socket({ parent: updates })),
|
|
143
138
|
contract.request({ params: typed<ProjectParams>(ProjectParamsSchema) }, typed<StoryUpdate>()),
|
|
144
139
|
),
|
|
145
|
-
jobs,
|
|
146
|
-
// Queued job: the caller waits up to timeout ms for the job's result
|
|
147
|
-
develop: protocol(
|
|
148
|
-
route(aliases.develop, '/:id/develop', job({
|
|
149
|
-
parent: jobs, method: RouteMethod.POST, service: WORKER, queue: 'story-work', timeout: 600_000,
|
|
150
|
-
})),
|
|
151
|
-
contract.request({ params: typed<ProjectParams>(ProjectParamsSchema) }, typed<Story>()),
|
|
152
|
-
),
|
|
153
|
-
// reply: false resolves once the broker accepts the job; the outcome is Accepted
|
|
154
|
-
cleanup: protocol(
|
|
155
|
-
route(aliases.cleanup, '/:id/cleanup', job({
|
|
156
|
-
parent: jobs, method: RouteMethod.POST, service: WORKER, queue: 'story-ops', reply: false, timeout: 30_000,
|
|
157
|
-
})),
|
|
158
|
-
contract.request({ params: typed<ProjectParams>(ProjectParamsSchema) }, typed<unknown>()),
|
|
159
|
-
),
|
|
160
140
|
} as const
|
|
161
141
|
```
|
|
162
142
|
|
|
163
|
-
Which queues a process consumes is configuration of that process (`listenQueues()`), never part of
|
|
164
|
-
the declaration.
|
|
165
|
-
|
|
166
143
|
### Reading where a route answers
|
|
167
144
|
|
|
168
145
|
Once protocols are registered on a context, the entrypoint accessors answer address questions. The
|
|
@@ -202,16 +179,15 @@ resolveAddress(context, declaration)
|
|
|
202
179
|
| `backend(opts?, method?)` | function | Mark `AppType.Backend`; `opts` is options, a parent alias or `null`; `method` is a `RouteMethod` or more options |
|
|
203
180
|
| `frontend(opts?, default?)` | function | Mark `AppType.Frontend`; `default` is a boolean flag or more options |
|
|
204
181
|
| `socket(opts?, secondary?)` | function | `backend()` with `protocol: RouteProtocols.SOCKET` |
|
|
205
|
-
| `job(opts?, secondary?)` | function | `backend()` with `protocol: RouteProtocols.QUEUE` |
|
|
206
182
|
| `service(alias, opts?)` | function | Set `service` on `opts` (mutated and returned) |
|
|
207
183
|
| `rtype(type, opts?)` | function | Set an arbitrary `AppType`; the primitive behind `backend()` / `frontend()` |
|
|
208
184
|
| `normalizePath(path)` | function | Trim whitespace and one leading and trailing `/` |
|
|
209
185
|
| `RouteMethod` | enum | `GET = 'get'`, `POST = 'post'`, `PATCH = 'patch'`, `PUT = 'put'`, `DELETE = 'delete'` |
|
|
210
|
-
| `RouteProtocols` | enum | `WEB = 'http'`, `SOCKET = 'ws'
|
|
186
|
+
| `RouteProtocols` | enum | Generic built-ins: `WEB = 'http'`, `SOCKET = 'ws'` |
|
|
211
187
|
| `SEP` | const | Path separator `'/'` |
|
|
212
188
|
| `PARAM` | const | Path param prefix `':'` |
|
|
213
189
|
| `BasicRoute` | interface | `type`, `service?`, `host?`, `port?`, `base?`, `internalHost?`, `internalPort?` |
|
|
214
|
-
| `RouteDeclaration` | interface | `BasicRoute` + `alias`, `path`, `parent?`, `default?`, `method?`, `protocol?`,
|
|
190
|
+
| `RouteDeclaration` | interface | `BasicRoute` + `alias`, `path`, `parent?`, `default?`, `method?`, `protocol?`, transport-owned `protocolOptions?`, `secure?`, `timeout?` |
|
|
215
191
|
| `RouteOptions` | interface | `Partial<RouteDeclaration>` whose `parent` is a `RouteParent` |
|
|
216
192
|
| `RouteParent` | type | `string \| EntrypointReference` |
|
|
217
193
|
| `RouteModel` | interface | `{ route: RouteDeclaration }` |
|
|
@@ -246,8 +222,8 @@ The first six take `(context, declaration)`; the other four are pure and take no
|
|
|
246
222
|
overwrites the child's alias. Pass protocols as `{ parent }`.
|
|
247
223
|
- `path` is only this route's segment. Do not repeat the parent's path in it; `resolvePath()` joins
|
|
248
224
|
the chain.
|
|
249
|
-
-
|
|
250
|
-
|
|
225
|
+
- Custom transport options are opaque here. Validate them through the package that owns the
|
|
226
|
+
protocol.
|
|
251
227
|
- Do not pass a context to the pure `./utils` helpers: `overrideParams(ctx, decl)` writes route
|
|
252
228
|
fields into the context object instead of resolving anything.
|
|
253
229
|
- A mis-wired tree (no `cfg.services`, a service without a host, a parentship cycle) throws
|
|
@@ -264,7 +240,6 @@ The first six take `(context, declaration)`; the other four are pure and take no
|
|
|
264
240
|
- [`@owlmeans/server-route`](../server-route) — server-side route model; re-exported by
|
|
265
241
|
[`@owlmeans/server-app`](../server-app) as `broute`
|
|
266
242
|
- [`@owlmeans/client-route`](../client-route) — marks a route as client-side and extracts its params
|
|
267
|
-
- [`@owlmeans/queue`](../queue) — the QUEUE transport a `job()` route is carried by
|
|
268
243
|
- [`@owlmeans/socket`](../socket) — the SOCKET transport contracts
|
|
269
244
|
|
|
270
245
|
<!-- owlmeans:agent-guidance:start -->
|
|
@@ -275,7 +250,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
275
250
|
your project's skill store (`.agents/skills/`):
|
|
276
251
|
|
|
277
252
|
```sh
|
|
278
|
-
npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
253
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.30
|
|
279
254
|
```
|
|
280
255
|
|
|
281
256
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/route",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-09-
|
|
4
|
+
"version": "0.1.18-rc.27",
|
|
5
|
+
"generatedAt": "2026-09-19T13:42:56.268Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: route
|
|
3
|
-
description: How to use @owlmeans/route — route
|
|
3
|
+
description: How to use @owlmeans/route — transport-neutral route declarations, frontend/backend/socket markers, HTTP methods, extensible protocol identifiers, and address helpers. Auto-invoked when importing route helpers or defining an entrypoint's URL path.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
---
|
|
6
6
|
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
@@ -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.
|
|
11
|
+
**Install:** `"@owlmeans/route": "^0.1.18-rc.27"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
## Key Exports
|
|
14
14
|
|
|
@@ -18,10 +18,10 @@ user-invocable: false
|
|
|
18
18
|
| `frontend(options?, default?)` | Mark a route as a React page (web only) |
|
|
19
19
|
| `backend(options?, method?)` | Mark a route as a backend endpoint |
|
|
20
20
|
| `socket(options?, secondary?)` | A backend route answering over `RouteProtocols.SOCKET` |
|
|
21
|
-
| `job(options?, secondary?)` | A backend route carried by the queue (`RouteProtocols.QUEUE`); its declaration names `service`, `queue`, `reply` and `timeout` |
|
|
22
21
|
| `service(alias, options?)` | Point a route at a named service |
|
|
23
22
|
| `RouteMethod` | enum of GET, POST, PUT, PATCH, DELETE |
|
|
24
|
-
| `RouteProtocols` |
|
|
23
|
+
| `RouteProtocols` | built-in WEB (`http`) and SOCKET (`ws`) identifiers |
|
|
24
|
+
| `RouteProtocol` | a built-in or package-owned transport identifier |
|
|
25
25
|
| `rtype(type, options?)` | The primitive `frontend()` / `backend()` are built from |
|
|
26
26
|
| `createRoute(alias, path, opts?)` / `makeRouteModel(decl)` | The declaration and its wrapper, when you need them apart |
|
|
27
27
|
| `BasicRoute` | `{ type, service?, host?, port?, base?, internalHost?, internalPort? }` |
|
|
@@ -40,19 +40,15 @@ route contributes under its parent and is never rewritten, and the model carries
|
|
|
40
40
|
Where the route answers is worked out on demand, against the context that asks — which is what lets
|
|
41
41
|
the same declaration serve a client and a server at once.
|
|
42
42
|
|
|
43
|
-
## Protocol
|
|
43
|
+
## Protocol ownership
|
|
44
44
|
|
|
45
45
|
A route names the protocol it answers on, and an application binds one by registering a transport
|
|
46
46
|
service under `transportAlias(protocol)`. So the protocol is what decides whether a call travels as
|
|
47
|
-
an HTTP request, a socket frame or a
|
|
48
|
-
and
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
protocol: `queue` (which queue carries it), `reply` and `timeout`. `reply: false` resolves once the
|
|
53
|
-
broker has taken the job — the value is the job's identity and the outcome is `Accepted`, not the
|
|
54
|
-
job's result; the default is to wait for the result. Use the parent protocol object in a route
|
|
55
|
-
option (`job({ parent: storyProtocols.base, service, queue, timeout })`), never an exported alias string.
|
|
47
|
+
an HTTP request, a socket frame or a package-owned transport — the call site never says. Both
|
|
48
|
+
`transportAlias` and `EntrypointTransport` are exported by `@owlmeans/entrypoint`; this package only
|
|
49
|
+
stores an opaque protocol identifier and `protocolOptions`. The package defining a custom protocol
|
|
50
|
+
owns its marker, option type, validation and transport; the generic route package does not describe
|
|
51
|
+
that transport's implementation semantics.
|
|
56
52
|
|
|
57
53
|
## Subpath Exports
|
|
58
54
|
|
package/build/consts.d.ts
CHANGED
|
@@ -10,11 +10,10 @@ export declare const PARAM = ":";
|
|
|
10
10
|
/**
|
|
11
11
|
* How a route is carried. The protocol picks the transport that answers it — an application binds
|
|
12
12
|
* one by registering a service under `transportAlias(protocol)` — so a caller writes `call()` and
|
|
13
|
-
* never learns
|
|
13
|
+
* never learns which transport carried the work.
|
|
14
14
|
*/
|
|
15
15
|
export declare enum RouteProtocols {
|
|
16
16
|
WEB = "http",
|
|
17
|
-
SOCKET = "ws"
|
|
18
|
-
QUEUE = "queue"
|
|
17
|
+
SOCKET = "ws"
|
|
19
18
|
}
|
|
20
19
|
//# sourceMappingURL=consts.d.ts.map
|
package/build/consts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AACA,oBAAY,WAAW;IACrB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,GAAG,MAAM,CAAA;AAEtB,eAAO,MAAM,KAAK,MAAM,CAAA;AAExB;;;;GAIG;AACH,oBAAY,cAAc;IACxB,GAAG,SAAS;IACZ,MAAM,OAAO;
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AACA,oBAAY,WAAW;IACrB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,GAAG,MAAM,CAAA;AAEtB,eAAO,MAAM,KAAK,MAAM,CAAA;AAExB;;;;GAIG;AACH,oBAAY,cAAc;IACxB,GAAG,SAAS;IACZ,MAAM,OAAO;CACd"}
|
package/build/consts.js
CHANGED
|
@@ -11,12 +11,11 @@ export const PARAM = ':';
|
|
|
11
11
|
/**
|
|
12
12
|
* How a route is carried. The protocol picks the transport that answers it — an application binds
|
|
13
13
|
* one by registering a service under `transportAlias(protocol)` — so a caller writes `call()` and
|
|
14
|
-
* never learns
|
|
14
|
+
* never learns which transport carried the work.
|
|
15
15
|
*/
|
|
16
16
|
export var RouteProtocols;
|
|
17
17
|
(function (RouteProtocols) {
|
|
18
18
|
RouteProtocols["WEB"] = "http";
|
|
19
19
|
RouteProtocols["SOCKET"] = "ws";
|
|
20
|
-
RouteProtocols["QUEUE"] = "queue";
|
|
21
20
|
})(RouteProtocols || (RouteProtocols = {}));
|
|
22
21
|
//# sourceMappingURL=consts.js.map
|
package/build/consts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AACA,MAAM,CAAN,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,0BAAW,CAAA;IACX,4BAAa,CAAA;IACb,8BAAe,CAAA;IACf,0BAAW,CAAA;IACX,gCAAiB,CAAA;AACnB,CAAC,EANW,WAAW,KAAX,WAAW,QAMtB;AAED,MAAM,CAAC,MAAM,GAAG,GAAG,GAAG,CAAA;AAEtB,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;AAExB;;;;GAIG;AACH,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AACA,MAAM,CAAN,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,0BAAW,CAAA;IACX,4BAAa,CAAA;IACb,8BAAe,CAAA;IACf,0BAAW,CAAA;IACX,gCAAiB,CAAA;AACnB,CAAC,EANW,WAAW,KAAX,WAAW,QAMtB;AAED,MAAM,CAAC,MAAM,GAAG,GAAG,GAAG,CAAA;AAEtB,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;AAExB;;;;GAIG;AACH,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,8BAAY,CAAA;IACZ,+BAAa,CAAA;AACf,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB"}
|
package/build/helper.d.ts
CHANGED
|
@@ -8,11 +8,5 @@ export declare const rtype: (type: AppType, opts?: RouteOptions | string) => Par
|
|
|
8
8
|
export declare const backend: (opts?: RouteOptions | string | null, method?: RouteOptions | RouteMethod) => Partial<RouteOptions>;
|
|
9
9
|
export declare const service: (service: string, opts?: Partial<RouteOptions>) => Partial<RouteOptions>;
|
|
10
10
|
export declare const socket: (opts?: RouteOptions | string | null, secondary?: RouteOptions) => Partial<RouteOptions>;
|
|
11
|
-
/**
|
|
12
|
-
* A backend route carried by the queue rather than by HTTP. Everything else about it is a normal
|
|
13
|
-
* backend route — it has a path, a parent, guards and a filter — so the same declaration is served
|
|
14
|
-
* with `bind(...)` and called with `call()`; only the transport underneath differs.
|
|
15
|
-
*/
|
|
16
|
-
export declare const job: (opts?: RouteOptions | string | null, secondary?: RouteOptions) => Partial<RouteOptions>;
|
|
17
11
|
export declare const frontend: (opts?: RouteOptions | string | null, def?: RouteOptions | boolean) => Partial<RouteOptions>;
|
|
18
12
|
//# sourceMappingURL=helper.d.ts.map
|
package/build/helper.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAuB,MAAM,aAAa,CAAA;AAE9D,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAE5D,eAAO,MAAM,KAAK,EAAE,oBAAoB,CAAC,UAAU,CACH,CAAA;AAEhD,eAAO,MAAM,aAAa,SAAU,MAAM,KAAG,MAM5C,CAAA;AAED,eAAO,MAAM,KAAK,SAAU,OAAO,SAAS,YAAY,GAAG,MAAM,KAAG,OAAO,CAAC,YAAY,CAEvF,CAAA;AAED,eAAO,MAAM,OAAO,UAAW,YAAY,GAAG,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AG,OAAO,CAAC,YAAY,CAQhH,CAAA"}
|
package/build/helper.js
CHANGED
|
@@ -28,16 +28,6 @@ export const socket = (opts, secondary) => {
|
|
|
28
28
|
route.protocol = RouteProtocols.SOCKET;
|
|
29
29
|
return route;
|
|
30
30
|
};
|
|
31
|
-
/**
|
|
32
|
-
* A backend route carried by the queue rather than by HTTP. Everything else about it is a normal
|
|
33
|
-
* backend route — it has a path, a parent, guards and a filter — so the same declaration is served
|
|
34
|
-
* with `bind(...)` and called with `call()`; only the transport underneath differs.
|
|
35
|
-
*/
|
|
36
|
-
export const job = (opts, secondary) => {
|
|
37
|
-
const route = backend(opts, secondary);
|
|
38
|
-
route.protocol = RouteProtocols.QUEUE;
|
|
39
|
-
return route;
|
|
40
|
-
};
|
|
41
31
|
export const frontend = (opts, def) => {
|
|
42
32
|
if (typeof def === 'boolean') {
|
|
43
33
|
opts = typeof opts === 'string' ? { parent: opts, default: def } : { default: def, ...(opts ?? {}) };
|
package/build/helper.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAe,cAAc,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAIxD,MAAM,CAAC,MAAM,KAAK,GAAqC,CAAC,KAAK,EAAE,IAAI,EAAE,IAAK,EAAE,EAAE,CAC5E,cAAc,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAY,EAAU,EAAE;IACpD,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;IAClB,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC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AAC,QAAQ,GAAG,cAAc,CAAC,MAAM,CAAA;IAEtC,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAmC,EAAE,GAA4B,EAAyB,EAAE;IACnH,IAAI,OAAO,GAAG,KAAK,SAAS,EAAE,CAAC;QAC7B,IAAI,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,CAAA;IACtG,CAAC;SAAM,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACnC,IAAI,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,EAAE,CAAA;IAClF,CAAC;IAED,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAoB,CAAC,CAAA;AACtD,CAAC,CAAA"}
|
package/build/types.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { AppType, EntrypointReference } from '@owlmeans/context';
|
|
2
2
|
import type { RouteProtocols, RouteMethod } from './consts';
|
|
3
|
+
/** A built-in or package-owned transport identifier. */
|
|
4
|
+
export type RouteProtocol = RouteProtocols | (string & {});
|
|
3
5
|
export interface BasicRoute {
|
|
4
6
|
type: AppType;
|
|
5
7
|
service?: string;
|
|
@@ -20,18 +22,10 @@ export interface RouteDeclaration extends BasicRoute {
|
|
|
20
22
|
parent?: string;
|
|
21
23
|
default?: boolean;
|
|
22
24
|
method?: RouteMethod;
|
|
23
|
-
protocol?:
|
|
25
|
+
protocol?: RouteProtocol;
|
|
24
26
|
secure?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
* process — which queues a given process consumes is configuration, never a declaration.
|
|
28
|
-
*/
|
|
29
|
-
queue?: string;
|
|
30
|
-
/**
|
|
31
|
-
* QUEUE routes only: whether the caller waits for the job's return value. `false` resolves as
|
|
32
|
-
* soon as the job is accepted, which is what a long pipeline wants; the default is to wait.
|
|
33
|
-
*/
|
|
34
|
-
reply?: boolean;
|
|
27
|
+
/** Transport-owned declaration data. The package defining `protocol` owns and validates it. */
|
|
28
|
+
protocolOptions?: unknown;
|
|
35
29
|
/** How long a caller waits for an answer, in milliseconds, when the transport supports it. */
|
|
36
30
|
timeout?: number;
|
|
37
31
|
}
|
|
@@ -49,7 +43,7 @@ export interface RouteAddress {
|
|
|
49
43
|
port?: number;
|
|
50
44
|
base?: string;
|
|
51
45
|
secure: boolean;
|
|
52
|
-
protocol:
|
|
46
|
+
protocol: RouteProtocol;
|
|
53
47
|
}
|
|
54
48
|
/**
|
|
55
49
|
* The model wrapping a declaration. It carries no resolution state of its own — every address
|
package/build/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAE3D,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,KAAK,EAAE,MAA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O,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,oBAAqB,SAAQ,kBAAkB;IAC9D,IAAI,EAAE,MAAM,CAAA;CACb;AAED,wEAAwE;AACxE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,aAAa,CAAA;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,gBAAgB,CAAA;CACxB;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,mBAAmB,CAAA;AAEtD,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,QAAQ,CAAC;IAC7E,gGAAgG;IAChG,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/route",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.27",
|
|
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.
|
|
31
|
+
"@owlmeans/context": "^0.1.18-rc.26"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@owlmeans/dep-config": "workspace:*",
|
package/src/consts.ts
CHANGED
|
@@ -14,10 +14,9 @@ export const PARAM = ':'
|
|
|
14
14
|
/**
|
|
15
15
|
* How a route is carried. The protocol picks the transport that answers it — an application binds
|
|
16
16
|
* one by registering a service under `transportAlias(protocol)` — so a caller writes `call()` and
|
|
17
|
-
* never learns
|
|
17
|
+
* never learns which transport carried the work.
|
|
18
18
|
*/
|
|
19
19
|
export enum RouteProtocols {
|
|
20
20
|
WEB = 'http',
|
|
21
|
-
SOCKET = 'ws'
|
|
22
|
-
QUEUE = 'queue'
|
|
21
|
+
SOCKET = 'ws'
|
|
23
22
|
}
|
package/src/helper.ts
CHANGED
|
@@ -43,19 +43,6 @@ export const socket = (opts?: RouteOptions | string | null, secondary?: RouteOpt
|
|
|
43
43
|
return route
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
/**
|
|
47
|
-
* A backend route carried by the queue rather than by HTTP. Everything else about it is a normal
|
|
48
|
-
* backend route — it has a path, a parent, guards and a filter — so the same declaration is served
|
|
49
|
-
* with `bind(...)` and called with `call()`; only the transport underneath differs.
|
|
50
|
-
*/
|
|
51
|
-
export const job = (opts?: RouteOptions | string | null, secondary?: RouteOptions): Partial<RouteOptions> => {
|
|
52
|
-
const route = backend(opts, secondary)
|
|
53
|
-
|
|
54
|
-
route.protocol = RouteProtocols.QUEUE
|
|
55
|
-
|
|
56
|
-
return route
|
|
57
|
-
}
|
|
58
|
-
|
|
59
46
|
export const frontend = (opts?: RouteOptions | string | null, def?: RouteOptions | boolean): Partial<RouteOptions> => {
|
|
60
47
|
if (typeof def === 'boolean') {
|
|
61
48
|
opts = typeof opts === 'string' ? { parent: opts, default: def } : { default: def, ...(opts ?? {}) }
|
package/src/types.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { AppType, EntrypointReference } from '@owlmeans/context'
|
|
2
2
|
import type { RouteProtocols, RouteMethod } from './consts'
|
|
3
3
|
|
|
4
|
+
/** A built-in or package-owned transport identifier. */
|
|
5
|
+
export type RouteProtocol = RouteProtocols | (string & {})
|
|
6
|
+
|
|
4
7
|
export interface BasicRoute {
|
|
5
8
|
type: AppType
|
|
6
9
|
service?: string
|
|
@@ -22,18 +25,10 @@ export interface RouteDeclaration extends BasicRoute {
|
|
|
22
25
|
parent?: string
|
|
23
26
|
default?: boolean
|
|
24
27
|
method?: RouteMethod
|
|
25
|
-
protocol?:
|
|
28
|
+
protocol?: RouteProtocol
|
|
26
29
|
secure?: boolean
|
|
27
|
-
/**
|
|
28
|
-
|
|
29
|
-
* process — which queues a given process consumes is configuration, never a declaration.
|
|
30
|
-
*/
|
|
31
|
-
queue?: string
|
|
32
|
-
/**
|
|
33
|
-
* QUEUE routes only: whether the caller waits for the job's return value. `false` resolves as
|
|
34
|
-
* soon as the job is accepted, which is what a long pipeline wants; the default is to wait.
|
|
35
|
-
*/
|
|
36
|
-
reply?: boolean
|
|
30
|
+
/** Transport-owned declaration data. The package defining `protocol` owns and validates it. */
|
|
31
|
+
protocolOptions?: unknown
|
|
37
32
|
/** How long a caller waits for an answer, in milliseconds, when the transport supports it. */
|
|
38
33
|
timeout?: number
|
|
39
34
|
}
|
|
@@ -54,7 +49,7 @@ export interface RouteAddress {
|
|
|
54
49
|
port?: number
|
|
55
50
|
base?: string
|
|
56
51
|
secure: boolean
|
|
57
|
-
protocol:
|
|
52
|
+
protocol: RouteProtocol
|
|
58
53
|
}
|
|
59
54
|
|
|
60
55
|
/**
|