@owlmeans/client-entrypoint 0.1.18-rc.13 → 0.1.18-rc.14
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 +1 -1
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/client-entrypoint/SKILL.md +25 -4
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/protocol.d.ts +9 -0
- package/build/protocol.d.ts.map +1 -0
- package/build/protocol.js +15 -0
- package/build/protocol.js.map +1 -0
- package/build/types.d.ts +10 -2
- package/build/types.d.ts.map +1 -1
- package/build/utils/handler.d.ts.map +1 -1
- package/build/utils/handler.js +6 -2
- package/build/utils/handler.js.map +1 -1
- package/package.json +10 -10
- package/src/index.ts +1 -0
- package/src/protocol.ts +38 -0
- package/src/types.ts +17 -2
- package/src/utils/handler.ts +6 -2
package/README.md
CHANGED
|
@@ -110,7 +110,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
110
110
|
your project's skill store (`.agents/skills/`):
|
|
111
111
|
|
|
112
112
|
```sh
|
|
113
|
-
npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
113
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.13
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
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/client-entrypoint",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-09-
|
|
4
|
+
"version": "0.1.18-rc.14",
|
|
5
|
+
"generatedAt": "2026-09-10T18:54:42.491Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: client-entrypoint
|
|
3
|
-
description: How to use @owlmeans/client-entrypoint —
|
|
3
|
+
description: How to use @owlmeans/client-entrypoint — binding immutable protocols to client call/invoke/url modules, React screen binding, and legacy elevation. Auto-invoked when importing client entrypoint helpers.
|
|
4
4
|
user-invocable: false
|
|
5
5
|
---
|
|
6
6
|
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
@@ -8,12 +8,16 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/client-entrypoint
|
|
9
9
|
|
|
10
10
|
**Layer:** Client
|
|
11
|
-
**Install:** `"@owlmeans/client-entrypoint": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/client-entrypoint": "^0.1.18-rc.14"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
## Key Exports
|
|
14
14
|
|
|
15
15
|
| Export | Description |
|
|
16
16
|
|--------|-------------|
|
|
17
|
+
| `bind(protocol, opts?)` | Materialize one shared protocol as a typed client entrypoint |
|
|
18
|
+
| `bindAll(tree)` | Flatten and bind a protocol tree |
|
|
19
|
+
| `bindScreen(protocol, handler, opts?)` | Bind a frontend protocol to its renderer |
|
|
20
|
+
| `ClientProtocolEntrypoint<P>` | The client module whose request/reply types come from `P` |
|
|
17
21
|
| `ClientEntrypoint<T, R>` | Client entrypoint interface — `call`, `invoke`, `url`, `validate`, `request` |
|
|
18
22
|
| `entrypoint(arg, handler?, opts?)` | Build a client entrypoint from a route model or an existing declaration |
|
|
19
23
|
| `elevate(entrypoints, alias, handler?, opts?)` | Make a declared entrypoint client-callable, optionally attaching a screen |
|
|
@@ -34,14 +38,31 @@ user-invocable: false
|
|
|
34
38
|
|
|
35
39
|
## Usage
|
|
36
40
|
|
|
37
|
-
|
|
41
|
+
New protocol-based applications bind their shared declarations and let lookup infer the contract:
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
import { bindAll, bindScreen, handler } from '@owlmeans/client-entrypoint'
|
|
45
|
+
import { item, web } from 'project-common'
|
|
46
|
+
|
|
47
|
+
const entrypoints = bindAll(item)
|
|
48
|
+
entrypoints.push(bindScreen(web.items, handler(ItemsScreen)))
|
|
49
|
+
|
|
50
|
+
const result = await context.entrypoint(item.get).call({ params: { id } })
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`bind`/`bindAll` make backend protocols callable; `bindScreen` is only for frontend protocols.
|
|
54
|
+
The protocol stays immutable and the local module receives its own context and handler state.
|
|
55
|
+
|
|
56
|
+
Most legacy app code uses `elevate()` from `@owlmeans/web-client` (which builds on this). Use the
|
|
57
|
+
legacy generic only while working on a surface that has not migrated:
|
|
38
58
|
|
|
39
59
|
```typescript
|
|
40
60
|
import type { ClientEntrypoint } from '@owlmeans/client-entrypoint'
|
|
41
61
|
```
|
|
42
62
|
|
|
43
63
|
Client-side callability is an **explicit opt-in**: a declaration only becomes callable from a client
|
|
44
|
-
once a bare client `elevate` (or `celevate` on the server side) has been
|
|
64
|
+
once `bind`/`bindAll`, or a bare legacy client `elevate` (or `celevate` on the server side), has been
|
|
65
|
+
applied to it. Elevating is
|
|
45
66
|
idempotent, and guards passed at elevation are added to the ones the declaration already carries;
|
|
46
67
|
`filter`, `gate` and `gateParams` passed at elevation replace what was declared. An alias no
|
|
47
68
|
entrypoint in the list carries throws `SyntaxError`.
|
package/build/index.d.ts
CHANGED
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,mBAAmB,YAAY,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,mBAAmB,YAAY,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA"}
|
package/build/index.js
CHANGED
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAE3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAE3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { EntrypointProtocolDeclaration, EntrypointTree } from '@owlmeans/entrypoint';
|
|
2
|
+
import type { ClientEntrypointOptions, ClientProtocolEntrypoint, RefedEntrypointHandler } from './types.js';
|
|
3
|
+
/** Bind a shared protocol to the client context without changing the declaration itself. */
|
|
4
|
+
export declare const bind: <Protocol extends EntrypointProtocolDeclaration>(protocol: Protocol, options?: ClientEntrypointOptions) => ClientProtocolEntrypoint<Protocol>;
|
|
5
|
+
/** Materialize every protocol in an exported declaration tree for a browser context. */
|
|
6
|
+
export declare const bindAll: (tree: EntrypointTree) => ClientProtocolEntrypoint<EntrypointProtocolDeclaration>[];
|
|
7
|
+
/** Bind a frontend protocol to the component that renders it. */
|
|
8
|
+
export declare const bindScreen: <Protocol extends EntrypointProtocolDeclaration>(protocol: Protocol, handler: RefedEntrypointHandler, options?: ClientEntrypointOptions) => ClientProtocolEntrypoint<Protocol>;
|
|
9
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAEzF,OAAO,KAAK,EACV,uBAAuB,EAAE,wBAAwB,EAAE,sBAAsB,EAC1E,MAAM,YAAY,CAAA;AAEnB,4FAA4F;AAC5F,eAAO,MAAM,IAAI,GAAI,QAAQ,SAAS,6BAA6B,YACvD,QAAQ,YACR,uBAAuB,KAChC,wBAAwB,CAAC,QAAQ,CAOnC,CAAA;AAED,wFAAwF;AACxF,eAAO,MAAM,OAAO,SAAU,cAAc,KAAG,wBAAwB,CAAC,6BAA6B,CAAC,EACrD,CAAA;AAEjD,iEAAiE;AACjE,eAAO,MAAM,UAAU,GAAI,QAAQ,SAAS,6BAA6B,YAC7D,QAAQ,WACT,sBAAsB,YACrB,uBAAuB,KAChC,wBAAwB,CAAC,QAAQ,CAQnC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { materializeEntrypoint, protocols } from '@owlmeans/entrypoint';
|
|
2
|
+
import { entrypoint } from './entrypoint.js';
|
|
3
|
+
/** Bind a shared protocol to the client context without changing the declaration itself. */
|
|
4
|
+
export const bind = (protocol, options) => {
|
|
5
|
+
const bound = Object.assign(entrypoint(materializeEntrypoint(protocol), options), { protocol });
|
|
6
|
+
return bound;
|
|
7
|
+
};
|
|
8
|
+
/** Materialize every protocol in an exported declaration tree for a browser context. */
|
|
9
|
+
export const bindAll = (tree) => protocols(tree).map(protocol => bind(protocol));
|
|
10
|
+
/** Bind a frontend protocol to the component that renders it. */
|
|
11
|
+
export const bindScreen = (protocol, handler, options) => {
|
|
12
|
+
const bound = Object.assign(entrypoint(materializeEntrypoint(protocol), handler, options), { protocol });
|
|
13
|
+
return bound;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAEvE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAK5C,4FAA4F;AAC5F,MAAM,CAAC,MAAM,IAAI,GAAG,CAClB,QAAkB,EAClB,OAAiC,EACG,EAAE;IACtC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CACpC,qBAAqB,CAAC,QAAQ,CAAC,EAC/B,OAAO,CACR,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAA;IAEhB,OAAO,KAA2C,CAAA;AACpD,CAAC,CAAA;AAED,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAoB,EAA6D,EAAE,CACzG,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEjD,iEAAiE;AACjE,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,QAAkB,EAClB,OAA+B,EAC/B,OAAiC,EACG,EAAE;IACtC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CACpC,qBAAqB,CAAC,QAAQ,CAAC,EAC/B,OAAO,EACP,OAAO,CACR,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAA;IAEhB,OAAO,KAA2C,CAAA;AACpD,CAAC,CAAA"}
|
package/build/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ClientRouteModel, ClientRouteOptions } from '@owlmeans/client-route';
|
|
2
|
-
import type { AbstractRequest, CommonEntrypoint, CommonEntrypointOptions, EntrypointHandler, EntrypointOutcome } from '@owlmeans/entrypoint';
|
|
2
|
+
import type { AbstractRequest, CommonEntrypoint, CommonEntrypointOptions, EntrypointHandler, EntrypointOutcome, EntrypointProtocolDeclaration, RegisteredEntrypoint, RequestOf } from '@owlmeans/entrypoint';
|
|
3
3
|
export interface ClientEntrypoint<T = {}, R extends ClientRequest = ClientRequest> extends CommonEntrypoint {
|
|
4
4
|
route: ClientRouteModel;
|
|
5
5
|
/**
|
|
@@ -20,6 +20,14 @@ export interface ClientEntrypoint<T = {}, R extends ClientRequest = ClientReques
|
|
|
20
20
|
validate: EntrypointFilter<R>;
|
|
21
21
|
request: (request?: Partial<R>) => R;
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* The context-bound client view of a protocol. Unlike the legacy `ClientEntrypoint` generic,
|
|
25
|
+
* its request and reply types are read directly from the declaration and cannot be replaced at a
|
|
26
|
+
* call site.
|
|
27
|
+
*/
|
|
28
|
+
export type ClientProtocolEntrypoint<Protocol extends EntrypointProtocolDeclaration> = Omit<ClientEntrypoint, 'call' | 'invoke' | 'url' | 'validate' | 'request'> & RegisteredEntrypoint<RequestOf<Protocol>, import('@owlmeans/entrypoint').ResponseOf<Protocol>> & {
|
|
29
|
+
readonly protocol: Protocol;
|
|
30
|
+
};
|
|
23
31
|
export interface EntrypointCall<T, Req extends ClientRequest = ClientRequest> {
|
|
24
32
|
<Type extends T, R extends Req = Req>(req?: Partial<R>): Promise<Type>;
|
|
25
33
|
}
|
|
@@ -49,7 +57,7 @@ export interface ClientEntrypointOptions extends CommonEntrypointOptions {
|
|
|
49
57
|
export interface EntrypointRef<T, R extends AbstractRequest = AbstractRequest> {
|
|
50
58
|
ref?: ClientEntrypoint<T, R>;
|
|
51
59
|
}
|
|
52
|
-
export interface RefedEntrypointHandler<T, R extends AbstractRequest = AbstractRequest> {
|
|
60
|
+
export interface RefedEntrypointHandler<T = {}, R extends AbstractRequest = AbstractRequest> {
|
|
53
61
|
(ref: EntrypointRef<T, R>): EntrypointHandler;
|
|
54
62
|
}
|
|
55
63
|
//# sourceMappingURL=types.d.ts.map
|
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,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAClF,OAAO,KAAK,
|
|
1
|
+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AS,eAAe,GAAG,eAAe;IAC3E,GAAG,CAAC,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;CAC7B;AAED,MAAM,WAAW,sBAAsB,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,eAAe,GAAG,eAAe;IACzF,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,iBAAiB,CAAA;CAC9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/utils/handler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAuB,MAAM,sBAAsB,CAAA;AAEnG,OAAO,KAAK,EAAoB,gBAAgB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAWlJ,eAAO,MAAM,UAAU,EAAE,CACvB,CAAC,EAAE,CAAC,SAAS,eAAe,GAAG,eAAe,EAC9C,GAAG,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,iBAqC9B,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,CACtB,CAAC,EAAE,CAAC,SAAS,eAAe,GAAG,eAAe,EAC9C,GAAG,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,uBAAuB,KAAK,gBAAgB,CAAC,CAAC,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/utils/handler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAuB,MAAM,sBAAsB,CAAA;AAEnG,OAAO,KAAK,EAAoB,gBAAgB,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAWlJ,eAAO,MAAM,UAAU,EAAE,CACvB,CAAC,EAAE,CAAC,SAAS,eAAe,GAAG,eAAe,EAC9C,GAAG,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,iBAqC9B,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,CACtB,CAAC,EAAE,CAAC,SAAS,eAAe,GAAG,eAAe,EAC9C,GAAG,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,uBAAuB,KAAK,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAwDvD,CAAA;AAE7B,eAAO,MAAM,aAAa,EAAE,CAC1B,CAAC,EAAE,CAAC,SAAS,aAAa,GAAG,aAAa,EAC1C,GAAG,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,oBAAoB,KAAK,OAAO,CAAC,MAAM,CAmC3F,CAAA"}
|
package/build/utils/handler.js
CHANGED
|
@@ -2,7 +2,7 @@ import { DEFAULT_KEY } from '@owlmeans/client-config';
|
|
|
2
2
|
import { EntrypointOutcome, provideResponse, transportAlias } from '@owlmeans/entrypoint';
|
|
3
3
|
import { validate } from './entrypoint.js';
|
|
4
4
|
import { extractParams } from '@owlmeans/client-route';
|
|
5
|
-
import { PARAM, RouteProtocols } from '@owlmeans/route';
|
|
5
|
+
import { PARAM, RouteMethod, RouteProtocols } from '@owlmeans/route';
|
|
6
6
|
import { stringify } from 'qs';
|
|
7
7
|
import { assertContext } from '@owlmeans/context';
|
|
8
8
|
import { makeSecurityHelper } from '@owlmeans/config';
|
|
@@ -49,7 +49,11 @@ export const apiInvoke = (ref, opts) => (async (req) => {
|
|
|
49
49
|
const request = {
|
|
50
50
|
alias: ep.alias,
|
|
51
51
|
params: req?.params ?? {},
|
|
52
|
-
body
|
|
52
|
+
// JSON transports must send a body for mutation methods even when the contract has no
|
|
53
|
+
// payload. Keeping that rule here makes every typed caller use `call({ params })`, never
|
|
54
|
+
// an SDK-specific `{ body: {} }` workaround.
|
|
55
|
+
body: req?.body ?? ([RouteMethod.POST, RouteMethod.PUT, RouteMethod.PATCH]
|
|
56
|
+
.includes(ep.route.route.method ?? RouteMethod.GET) ? {} : undefined),
|
|
53
57
|
headers: req?.headers ?? {},
|
|
54
58
|
query: req?.query ?? {},
|
|
55
59
|
host: req?.host,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/utils/handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAGrD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAEzF,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/utils/handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAGrD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAEzF,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAKrD,MAAM,CAAC,MAAM,UAAU,GAE4B,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,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,+FAA+F;IAC/F,kGAAkG;IAClG,sDAAsD;IACtD,IAAI,MAAM,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,IAAI,EAAE,QAAQ,KAAK,IAAI,EAAE,CAAC;QACvD,MAAM,MAAM,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAA;QACtC,IAAI,GAAG,MAAM,CAAC,OAAO,CACnB,EAAE,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,QAAQ,EAAE,CACvF,CAAA;IACH,CAAC;IAED,OAAO,IAAI,CAAA;AACb,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/client-entrypoint",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.14",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@owlmeans/api": "^0.1.18-rc.
|
|
32
|
-
"@owlmeans/client-config": "^0.1.18-rc.
|
|
33
|
-
"@owlmeans/client-context": "^0.1.18-rc.
|
|
34
|
-
"@owlmeans/client-route": "^0.1.18-rc.
|
|
35
|
-
"@owlmeans/config": "^0.1.18-rc.
|
|
36
|
-
"@owlmeans/context": "^0.1.18-rc.
|
|
37
|
-
"@owlmeans/entrypoint": "^0.1.18-rc.
|
|
38
|
-
"@owlmeans/error": "^0.1.18-rc.
|
|
39
|
-
"@owlmeans/route": "^0.1.18-rc.
|
|
31
|
+
"@owlmeans/api": "^0.1.18-rc.14",
|
|
32
|
+
"@owlmeans/client-config": "^0.1.18-rc.13",
|
|
33
|
+
"@owlmeans/client-context": "^0.1.18-rc.14",
|
|
34
|
+
"@owlmeans/client-route": "^0.1.18-rc.14",
|
|
35
|
+
"@owlmeans/config": "^0.1.18-rc.13",
|
|
36
|
+
"@owlmeans/context": "^0.1.18-rc.9",
|
|
37
|
+
"@owlmeans/entrypoint": "^0.1.18-rc.12",
|
|
38
|
+
"@owlmeans/error": "^0.1.18-rc.9",
|
|
39
|
+
"@owlmeans/route": "^0.1.18-rc.10",
|
|
40
40
|
"ajv-formats": "^3.0.1",
|
|
41
41
|
"qs": "^6.13.0"
|
|
42
42
|
},
|
package/src/index.ts
CHANGED
package/src/protocol.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { materializeEntrypoint, protocols } from '@owlmeans/entrypoint'
|
|
2
|
+
import type { EntrypointProtocolDeclaration, EntrypointTree } from '@owlmeans/entrypoint'
|
|
3
|
+
import { entrypoint } from './entrypoint.js'
|
|
4
|
+
import type {
|
|
5
|
+
ClientEntrypointOptions, ClientProtocolEntrypoint, RefedEntrypointHandler,
|
|
6
|
+
} from './types.js'
|
|
7
|
+
|
|
8
|
+
/** Bind a shared protocol to the client context without changing the declaration itself. */
|
|
9
|
+
export const bind = <Protocol extends EntrypointProtocolDeclaration>(
|
|
10
|
+
protocol: Protocol,
|
|
11
|
+
options?: ClientEntrypointOptions,
|
|
12
|
+
): ClientProtocolEntrypoint<Protocol> => {
|
|
13
|
+
const bound = Object.assign(entrypoint(
|
|
14
|
+
materializeEntrypoint(protocol),
|
|
15
|
+
options,
|
|
16
|
+
), { protocol })
|
|
17
|
+
|
|
18
|
+
return bound as ClientProtocolEntrypoint<Protocol>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Materialize every protocol in an exported declaration tree for a browser context. */
|
|
22
|
+
export const bindAll = (tree: EntrypointTree): ClientProtocolEntrypoint<EntrypointProtocolDeclaration>[] =>
|
|
23
|
+
protocols(tree).map(protocol => bind(protocol))
|
|
24
|
+
|
|
25
|
+
/** Bind a frontend protocol to the component that renders it. */
|
|
26
|
+
export const bindScreen = <Protocol extends EntrypointProtocolDeclaration>(
|
|
27
|
+
protocol: Protocol,
|
|
28
|
+
handler: RefedEntrypointHandler,
|
|
29
|
+
options?: ClientEntrypointOptions,
|
|
30
|
+
): ClientProtocolEntrypoint<Protocol> => {
|
|
31
|
+
const bound = Object.assign(entrypoint(
|
|
32
|
+
materializeEntrypoint(protocol),
|
|
33
|
+
handler,
|
|
34
|
+
options,
|
|
35
|
+
), { protocol })
|
|
36
|
+
|
|
37
|
+
return bound as ClientProtocolEntrypoint<Protocol>
|
|
38
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { ClientRouteModel, ClientRouteOptions } from '@owlmeans/client-route'
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
AbstractRequest, CommonEntrypoint, CommonEntrypointOptions, EntrypointHandler,
|
|
4
|
+
EntrypointOutcome, EntrypointProtocolDeclaration, RegisteredEntrypoint, RequestOf,
|
|
5
|
+
} from '@owlmeans/entrypoint'
|
|
3
6
|
|
|
4
7
|
export interface ClientEntrypoint<T = {}, R extends ClientRequest = ClientRequest> extends CommonEntrypoint {
|
|
5
8
|
route: ClientRouteModel
|
|
@@ -22,6 +25,18 @@ export interface ClientEntrypoint<T = {}, R extends ClientRequest = ClientReques
|
|
|
22
25
|
request: (request?: Partial<R>) => R
|
|
23
26
|
}
|
|
24
27
|
|
|
28
|
+
/**
|
|
29
|
+
* The context-bound client view of a protocol. Unlike the legacy `ClientEntrypoint` generic,
|
|
30
|
+
* its request and reply types are read directly from the declaration and cannot be replaced at a
|
|
31
|
+
* call site.
|
|
32
|
+
*/
|
|
33
|
+
export type ClientProtocolEntrypoint<Protocol extends EntrypointProtocolDeclaration> =
|
|
34
|
+
Omit<ClientEntrypoint, 'call' | 'invoke' | 'url' | 'validate' | 'request'>
|
|
35
|
+
& RegisteredEntrypoint<RequestOf<Protocol>, import('@owlmeans/entrypoint').ResponseOf<Protocol>>
|
|
36
|
+
& {
|
|
37
|
+
readonly protocol: Protocol
|
|
38
|
+
}
|
|
39
|
+
|
|
25
40
|
export interface EntrypointCall<T, Req extends ClientRequest = ClientRequest> {
|
|
26
41
|
<Type extends T, R extends Req = Req>(req?: Partial<R>): Promise<Type>
|
|
27
42
|
}
|
|
@@ -60,6 +75,6 @@ export interface EntrypointRef<T, R extends AbstractRequest = AbstractRequest> {
|
|
|
60
75
|
ref?: ClientEntrypoint<T, R>
|
|
61
76
|
}
|
|
62
77
|
|
|
63
|
-
export interface RefedEntrypointHandler<T, R extends AbstractRequest = AbstractRequest> {
|
|
78
|
+
export interface RefedEntrypointHandler<T = {}, R extends AbstractRequest = AbstractRequest> {
|
|
64
79
|
(ref: EntrypointRef<T, R>): EntrypointHandler
|
|
65
80
|
}
|
package/src/utils/handler.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { EntrypointOutcome, provideResponse, transportAlias } from '@owlmeans/en
|
|
|
6
6
|
import type { ClientEntrypoint, EntrypointInvoke, EntrypointUrlOptions, ClientEntrypointOptions, EntrypointRef, ClientRequest } from '../types.js'
|
|
7
7
|
import { validate } from './entrypoint.js'
|
|
8
8
|
import { extractParams } from '@owlmeans/client-route'
|
|
9
|
-
import { PARAM, RouteProtocols } from '@owlmeans/route'
|
|
9
|
+
import { PARAM, RouteMethod, RouteProtocols } from '@owlmeans/route'
|
|
10
10
|
import { stringify } from 'qs'
|
|
11
11
|
import { assertContext } from '@owlmeans/context'
|
|
12
12
|
import { makeSecurityHelper } from '@owlmeans/config'
|
|
@@ -75,7 +75,11 @@ export const apiInvoke: <
|
|
|
75
75
|
const request: AbstractRequest = {
|
|
76
76
|
alias: ep.alias,
|
|
77
77
|
params: req?.params ?? {},
|
|
78
|
-
body
|
|
78
|
+
// JSON transports must send a body for mutation methods even when the contract has no
|
|
79
|
+
// payload. Keeping that rule here makes every typed caller use `call({ params })`, never
|
|
80
|
+
// an SDK-specific `{ body: {} }` workaround.
|
|
81
|
+
body: req?.body ?? ([RouteMethod.POST, RouteMethod.PUT, RouteMethod.PATCH]
|
|
82
|
+
.includes(ep.route.route.method ?? RouteMethod.GET) ? {} : undefined),
|
|
79
83
|
headers: req?.headers ?? {},
|
|
80
84
|
query: req?.query ?? {},
|
|
81
85
|
host: req?.host,
|