@owlmeans/web-client 0.1.18-rc.20 → 0.1.18-rc.21

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.
Files changed (39) hide show
  1. package/README.md +16 -13
  2. package/agent-meta/manifest.json +2 -2
  3. package/agent-meta/skills/web-client/SKILL.md +29 -5
  4. package/build/components/dispatcher/parametrise.d.ts.map +1 -1
  5. package/build/components/dispatcher/types.d.ts +2 -2
  6. package/build/components/dispatcher/types.d.ts.map +1 -1
  7. package/build/context.d.ts.map +1 -1
  8. package/build/context.js +0 -1
  9. package/build/context.js.map +1 -1
  10. package/build/entrypoints.d.ts +2 -0
  11. package/build/entrypoints.d.ts.map +1 -0
  12. package/build/{modules.js → entrypoints.js} +4 -4
  13. package/build/entrypoints.js.map +1 -0
  14. package/build/errors.d.ts.map +1 -1
  15. package/build/errors.js.map +1 -1
  16. package/build/helper.d.ts.map +1 -1
  17. package/build/index.d.ts +1 -1
  18. package/build/index.d.ts.map +1 -1
  19. package/build/index.js +1 -1
  20. package/build/index.js.map +1 -1
  21. package/build/login/pump.d.ts.map +1 -1
  22. package/build/login/service.d.ts.map +1 -1
  23. package/build/main.d.ts.map +1 -1
  24. package/build/middleware.d.ts.map +1 -1
  25. package/build/middleware.js +7 -6
  26. package/build/middleware.js.map +1 -1
  27. package/build/service.d.ts.map +1 -1
  28. package/build/service.js +1 -1
  29. package/build/service.js.map +1 -1
  30. package/package.json +17 -17
  31. package/src/components/dispatcher/types.ts +2 -2
  32. package/src/context.ts +0 -2
  33. package/src/{modules.ts → entrypoints.ts} +3 -3
  34. package/src/index.ts +1 -1
  35. package/src/middleware.ts +7 -6
  36. package/src/service.ts +1 -1
  37. package/build/modules.d.ts +0 -2
  38. package/build/modules.d.ts.map +0 -1
  39. package/build/modules.js.map +0 -1
package/README.md CHANGED
@@ -1,14 +1,16 @@
1
1
  # @owlmeans/web-client
2
2
 
3
- React web application bootstrap — context factory, module/routing utilities, and app renderer for OwlMeans web apps.
3
+ React web application bootstrap — context factory, entrypoint/routing utilities, and app renderer for OwlMeans web apps.
4
4
 
5
5
  ## Overview
6
6
 
7
7
  - `makeContext(cfg)` — creates the web application context (includes auth, router, and DB services)
8
8
  - `renderApp(context)` — mounts the React app to the DOM
9
- - Re-exports module/routing helpers: `module`, `route`, `frontend`, `handler`, `elevate`
9
+ - Re-exports entrypoint/routing helpers: `entrypoint`, `route`, `frontend`, `handler`, `elevate`
10
10
  - Re-exports route constants: `BASE`, `HOME`, `ROOT`, `GUEST`
11
- - `Module<T>` — typed client module interface for `.call()` API requests
11
+ - `entrypoints` — the base client entrypoints (dispatcher, login surrogate) every web app spreads
12
+ - `ClientEntrypoint<T>` (also exported as `Module<T>`) — the typed entrypoint interface behind
13
+ `call()` / `invoke()` / `url()`
12
14
 
13
15
  ## Installation
14
16
 
@@ -24,27 +26,28 @@ Bootstrap the app:
24
26
  import { makeContext, renderApp } from '@owlmeans/web-client'
25
27
 
26
28
  const context = makeContext(config)
27
- context.registerModules(appModules)
29
+ context.registerEntrypoints(appEntrypoints)
28
30
  context.serviceRoute(MANAGER, true)
29
31
  renderApp<Config, Context>(context)
30
32
  ```
31
33
 
32
- Define modules:
34
+ Define entrypoints:
33
35
 
34
36
  ```typescript
35
- import { BASE, HOME, elevate, frontend, handler, module, route } from '@owlmeans/web-client'
37
+ import { BASE, HOME, elevate, entrypoint, frontend, handler, route } from '@owlmeans/web-client'
36
38
 
37
- modules.push(module(route(BASE, '/', frontend()), handler(PublicLayout)))
38
- modules.push(module(route(HOME, '/', frontend({ default: true, parent: BASE })), handler(HomeScreen)))
39
- elevate(modules, manager.back.account.base)
39
+ appEntrypoints.push(entrypoint(route(BASE, '/', frontend()), handler(PublicLayout)))
40
+ appEntrypoints.push(entrypoint(route(HOME, '/', frontend({ default: true, parent: BASE })), handler(HomeScreen)))
41
+ elevate(appEntrypoints, manager.back.account.base)
40
42
  ```
41
43
 
42
- Call an API module from a component:
44
+ A screen entrypoint carries a renderer, so it is addressed by `url()` and never called over the
45
+ wire. Call an API entrypoint from a component:
43
46
 
44
47
  ```typescript
45
- import type { Module } from '@owlmeans/web-client'
48
+ import type { ClientEntrypoint } from '@owlmeans/web-client'
46
49
 
47
- const [result] = await context.module<Module<MyType>>(moduleAlias)
50
+ const result = await context.entrypoint<ClientEntrypoint<MyType>>(alias)
48
51
  .call({ params: { id }, body: data })
49
52
  ```
50
53
 
@@ -75,7 +78,7 @@ Component that handles authentication routing (redirect to login, etc.).
75
78
  - [`@owlmeans/client-context`](../client-context) — `ClientContext` base extended by `makeContext`
76
79
  - [`@owlmeans/web-router`](../web-router) — default OwlMeans browser routing plugin registered by `makeContext`
77
80
  - [`@owlmeans/web-db`](../web-db) — IndexedDB service registered by `makeContext`
78
- - [`@owlmeans/client-module`](../client-module) — `ClientModule<T>` / `Module<T>` implementation
81
+ - [`@owlmeans/client-entrypoint`](../client-entrypoint) — the `ClientEntrypoint<T>` implementation
79
82
 
80
83
  <!-- owlmeans:agent-guidance:start -->
81
84
  ## Agent guidance
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/web-client",
4
- "version": "0.1.18-rc.20",
5
- "generatedAt": "2026-09-01T12:30:48.602Z",
4
+ "version": "0.1.18-rc.21",
5
+ "generatedAt": "2026-09-01T16:28:56.990Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -8,14 +8,15 @@ user-invocable: false
8
8
  # @owlmeans/web-client
9
9
 
10
10
  **Layer:** Web (React)
11
- **Install:** `"@owlmeans/web-client": "^0.1.18-rc.20"` in `dependencies`
11
+ **Install:** `"@owlmeans/web-client": "^0.1.18-rc.21"` in `dependencies`
12
12
 
13
13
  ## Key Exports
14
14
 
15
15
  | Export | Description |
16
16
  |--------|-------------|
17
17
  | `renderApp<C, T>(context)` | Mount the React app (routing via the active router plugin — OwlMeans by default) |
18
- | `elevate(entrypoints, alias, handler)` | Attach a React component (or `handler(Component)`) to an entrypoint |
18
+ | `elevate(entrypoints, alias, handler?)` | Attach a React component (`handler(Component)`) to an entrypoint, or opt a backend alias into client-side calling |
19
+ | `entrypoint(route, handler?)` | Build a client entrypoint from a route declaration |
19
20
  | `handler(Component)` | Wrap a React component as an entrypoint handler |
20
21
  | `context.registerEntrypoints(entrypoints)` | Register the full entrypoint list on the context |
21
22
  | `context.serviceRoute(alias, isDefault?)` | Mark a service's routing root |
@@ -54,9 +55,25 @@ entrypoints.push(
54
55
  )
55
56
  ```
56
57
 
58
+ `elevate` is idempotent — it replaces the declaration in the list, so re-elevating an alias (a
59
+ screen swapped for a variant build, a guard added to an already-elevated one) is allowed, and
60
+ guards named at elevation are unioned with the declared ones rather than replacing them. A backend
61
+ alias takes no handler at all: giving one is a wiring error and throws.
62
+
57
63
  A **backend** alias the client calls needs a bare `elevate(entrypoints, alias)` — no handler. That
58
- makes `context.entrypoint<ClientEntrypoint<T>>(alias).call({ params, body, query })` work; the auth
59
- header is attached automatically for guarded entrypoints.
64
+ opts the alias into client-side callability, so:
65
+
66
+ ```typescript
67
+ const project = await context.entrypoint<ClientEntrypoint<Project>>(alias)
68
+ .call({ params, body, query }) // the value; the reply's error is thrown
69
+ const { value, outcome } = await context.entrypoint<ClientEntrypoint<Project>>(alias)
70
+ .invoke({ params }) // when the outcome decides what happens next
71
+ const href = await context.entrypoint<ClientEntrypoint<Project>>(alias)
72
+ .url({ params }, { absolute: true }) // the address, not the round trip
73
+ ```
74
+
75
+ The auth header is attached automatically for guarded entrypoints. An entrypoint that renders a
76
+ screen answers `url()` and throws from `call()`/`invoke()` — a screen is navigated to, not called.
60
77
 
61
78
  ### Login comes with the context
62
79
 
@@ -86,9 +103,16 @@ const nav = useNavigate()
86
103
  await nav.go(alias, { params }) // programmatic; nav.back() to go back
87
104
  ```
88
105
 
106
+ The navigator resolves its target through the entrypoint's own `url(request)`, so a screen names an
107
+ alias and never assembles a path. Render a plain `<a href>` the same way — `await
108
+ context.entrypoint(alias).url({ params })`, or the `Link` component from `@owlmeans/web-panel`,
109
+ which does it for you.
110
+
89
111
  ## Depends On
90
112
 
91
113
  - `@owlmeans/client`, `@owlmeans/web-router` (default OwlMeans browser routing), `@owlmeans/web-panel` (typically), `@owlmeans/client-i18n`
92
114
  - `@owlmeans/client-auth` — `AUTH_RESOURCE` and the `./login` host the browser plugins register on
93
115
  - `@owlmeans/entrypoint`, `@owlmeans/route`
94
- - `react`, `react-dom` (peer). No longer depends on `react-router` — opt into it with `@owlmeans/web-router-react-router` (`appendReactRouter`). The former `provide` export is a deprecated `undefined`.
116
+ - `react`, `react-dom` (peer). It does not depend on `react-router` — opt into it with
117
+ `@owlmeans/web-router-react-router` (`appendReactRouter`). Routing needs no explicit provider:
118
+ `PanelApp`/`App` compile through `context.router()`, so nothing passes a `provide` prop.
@@ -1 +1 @@
1
- {"version":3,"file":"parametrise.d.ts","sourceRoot":"","sources":["../../../src/components/dispatcher/parametrise.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAI5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C,eAAO,MAAM,qBAAqB,QAAS,OAAO,CAAC,iBAAiB,CAAC,QAAQ,eAAe,CAAC,eAAe,CAAC,aAE5F,iBAAiB,gCAiBjC,CAAA"}
1
+ {"version":3,"file":"parametrise.d.ts","sourceRoot":"","sources":["../../../src/components/dispatcher/parametrise.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAI5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAE9C,eAAO,MAAM,qBAAqB,GAAI,KAAK,OAAO,CAAC,iBAAiB,CAAC,EAAE,MAAM,eAAe,CAAC,eAAe,CAAC,MAEnG,OAAO,iBAAiB,gCAiBjC,CAAA"}
@@ -1,6 +1,6 @@
1
- import type { ModuleContextParams } from "@owlmeans/client";
1
+ import type { EntrypointContextParams } from "@owlmeans/client";
2
2
  import type { DispatcherProps } from "@owlmeans/client-auth";
3
3
  import type { PropsWithChildren } from "react";
4
- export interface ParametrisedProps extends PropsWithChildren<ModuleContextParams & DispatcherProps> {
4
+ export interface ParametrisedProps extends PropsWithChildren<EntrypointContextParams & DispatcherProps> {
5
5
  }
6
6
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/dispatcher/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAE9C,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB,CAAC,mBAAmB,GAAG,eAAe,CAAC;CAClG"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/dispatcher/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAE9C,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB,CAAC,uBAAuB,GAAG,eAAe,CAAC;CACtG"}
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAUlD,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,OAC7F,CAAC,KACL,CAaF,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,SAAS,GAAG,SAAS,EAAC,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,QACnF,CAAA"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAUlD,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,EAClG,KAAK,CAAC,KACL,CAWF,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,SAAS,GAAG,SAAS,EAAC,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,QACnF,CAAA"}
package/build/context.js CHANGED
@@ -15,7 +15,6 @@ export const makeContext = (cfg) => {
15
15
  appendClientResource(context, AUTH_RESOURCE);
16
16
  appendWebRouter(context);
17
17
  appendWebLogin(context);
18
- context.makeContext = makeContext;
19
18
  return context;
20
19
  };
21
20
  export const useContext = () => useCtx();
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACv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,MAAM,oBAAoB,CAAA;AAEnD,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,GAAM,EACH,EAAE;IACL,MAAM,OAAO,GAAG,iBAAiB,CAAC,GAAG,CAAM,CAAA;IAC3C,kBAAkB,CAAO,OAAO,CAAC,CAAA;IAEjC,oBAAoB,CAAO,OAAO,CAAC,CAAA;IACnC,kBAAkB,CAAO,OAAO,CAAC,CAAA;IACjC,oBAAoB,CAAO,OAAO,EAAE,aAAa,CAAC,CAAA;IAClD,eAAe,CAAO,OAAO,CAAC,CAAA;IAC9B,cAAc,CAAO,OAAO,CAAC,CAAA;IAE7B,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,GAA4E,EAAE,CACtG,MAAM,EAAO,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const entrypoints: import("@owlmeans/client-entrypoint").ClientEntrypoint<{}, import("@owlmeans/client-entrypoint").ClientRequest<{}>>[];
2
+ //# sourceMappingURL=entrypoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,WAAW,uHAAO,CAAA"}
@@ -1,10 +1,10 @@
1
1
  import { DISPATCHER, DISPATCHER_SURROGATE } from '@owlmeans/auth';
2
- import { modules as list } from '@owlmeans/client-auth';
2
+ import { entrypoints as list } from '@owlmeans/client-auth';
3
3
  import { elevate } from '@owlmeans/client-entrypoint';
4
4
  import { handler } from '@owlmeans/client';
5
5
  import { Dispatcher } from './components/dispatcher/component.js';
6
6
  import { SurrogateScreen } from './login/screen.js';
7
- elevate(list, DISPATCHER, handler(Dispatcher), { force: true });
7
+ elevate(list, DISPATCHER, handler(Dispatcher));
8
8
  /**
9
9
  * Elevated here rather than in a relying-party package on purpose.
10
10
  *
@@ -14,5 +14,5 @@ elevate(list, DISPATCHER, handler(Dispatcher), { force: true });
14
14
  * edit of their own, which is the only way an application that is already deployed can get it.
15
15
  */
16
16
  elevate(list, DISPATCHER_SURROGATE, handler(SurrogateScreen));
17
- export const modules = list;
18
- //# sourceMappingURL=modules.js.map
17
+ export const entrypoints = list;
18
+ //# sourceMappingURL=entrypoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entrypoints.js","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,EAAE,WAAW,IAAI,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAA;AAE9C;;;;;;;GAOG;AACH,OAAO,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC,CAAA;AAE7D,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAE/C,qBAAa,aAAc,SAAQ,cAAc;IAC/C,OAAuB,QAAQ,EAAE,MAAM,CAAuC;IAE9E,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF;AAED,qBAAa,kBAAmB,SAAQ,aAAa;IACnD,OAAuB,QAAQ,EAAE,MAAM,CAA2C;IAE3E,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAA;IAElC,YAAY,OAAO,GAAE,MAAgB,EAGpC;CACF"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAE/C,qBAAa,aAAc,SAAQ,cAAc;IAC/C,OAAuB,QAAQ,EAAE,MAAM,CAAuC;gBAElE,OAAO,GAAE,MAAgB;CAItC;AAED,qBAAa,kBAAmB,SAAQ,aAAa;IACnD,OAAuB,QAAQ,EAAE,MAAM,CAA2C;IAE3E,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAA;gBAEtB,OAAO,GAAE,MAAgB;CAItC"}
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAE/C,MAAM,OAAO,aAAc,SAAQ,cAAc;IACxC,MAAM,CAAU,QAAQ,GAAW,GAAG,cAAc,CAAC,QAAQ,UAAU,CAAA;IAE9E,YAAY,OAAO,GAAW,OAAO;QACnC,KAAK,CAAC,YAAY,OAAO,EAAE,CAAC,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC,QAAQ,CAAA;IACpC,CAAC;CACF;AAED,MAAM,OAAO,kBAAmB,SAAQ,aAAa;IAC5C,MAAM,CAAU,QAAQ,GAAW,GAAG,aAAa,CAAC,QAAQ,eAAe,CAAA;IAE3E,QAAQ,CAAmB;IAElC,YAAY,OAAO,GAAW,OAAO;QACnC,KAAK,CAAC,kBAAkB,OAAO,EAAE,CAAC,CAAA;QAClC,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC,QAAQ,CAAA;IACzC,CAAC;CACF;AAED,cAAc,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAA;AAChD,cAAc,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAA"}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAE/C,MAAM,OAAO,aAAc,SAAQ,cAAc;IACxC,MAAM,CAAU,QAAQ,GAAW,GAAG,cAAc,CAAC,QAAQ,UAAU,CAAA;IAE9E,YAAY,UAAkB,OAAO;QACnC,KAAK,CAAC,YAAY,OAAO,EAAE,CAAC,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC,QAAQ,CAAA;IACpC,CAAC;;AAGH,MAAM,OAAO,kBAAmB,SAAQ,aAAa;IAC5C,MAAM,CAAU,QAAQ,GAAW,GAAG,aAAa,CAAC,QAAQ,eAAe,CAAA;IAE3E,QAAQ,CAAmB;IAElC,YAAY,UAAkB,OAAO;QACnC,KAAK,CAAC,kBAAkB,OAAO,EAAE,CAAC,CAAA;QAClC,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC,QAAQ,CAAA;IACzC,CAAC;;AAGH,cAAc,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAA;AAChD,cAAc,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvD,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,SAKtH,CAAA"}
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvD,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,SAKtH,CAAA"}
package/build/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export * from './types.js';
3
3
  export * from './main.js';
4
4
  export * from './router.js';
5
5
  export * from './components/index.js';
6
- export * from './modules.js';
6
+ export * from './entrypoints.js';
7
7
  export * from './exports.js';
8
8
  export * from './context.js';
9
9
  export * from './helper.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA"}
package/build/index.js CHANGED
@@ -3,7 +3,7 @@ export * from './types.js';
3
3
  export * from './main.js';
4
4
  export * from './router.js';
5
5
  export * from './components/index.js';
6
- export * from './modules.js';
6
+ export * from './entrypoints.js';
7
7
  export * from './exports.js';
8
8
  export * from './context.js';
9
9
  export * from './helper.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"pump.d.ts","sourceRoot":"","sources":["../../src/login/pump.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAEhF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,cACd,MAAM,eACJ,MAAM,aACR,CAAC,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,OAAO,CAAA;CAAE,KAAK,OAAO,CAAC,YAAY,CAAC,KAC1F,OAAO,CAAC,YAAY,CAiCrB,CAAA"}
1
+ {"version":3,"file":"pump.d.ts","sourceRoot":"","sources":["../../src/login/pump.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAEhF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,GACzB,WAAW,MAAM,EACjB,aAAa,MAAM,EACnB,WAAW,CAAC,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,OAAO,CAAA;CAAE,KAAK,OAAO,CAAC,YAAY,CAAC,KAC1F,OAAO,CAAC,YAAY,CAiCrB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/login/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAIlE;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,WAAW,EAAE,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,KAAG,CAMzF,CAAA"}
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/login/service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAIlE;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,WAAW,EAAE,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAG,CAMzF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAGtE,eAAO,MAAM,MAAM,SAAU,SAAS,SAAS,aAAa,SAkB3D,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,WAC3D,CAAC,SAAS,aAAa,aAAa,SAAS,SACQ,CAAA"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAGtE,eAAO,MAAM,MAAM,GAAI,MAAM,SAAS,EAAE,OAAO,aAAa,SAkB3D,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,SAAS,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,EACpE,SAAS,CAAC,EAAE,OAAO,aAAa,EAAE,WAAW,SAAS,SACQ,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAQnD,eAAO,MAAM,gBAAgB,EAAE,UAsC9B,CAAA"}
1
+ {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAQnD,eAAO,MAAM,gBAAgB,EAAE,UAuC9B,CAAA"}
@@ -7,18 +7,19 @@ export const logoutMiddleware = {
7
7
  stage: MiddlewareStage.Loading,
8
8
  apply: async (context) => {
9
9
  context.entrypoints().forEach(module => {
10
- if (module.route.route.type === AppType.Backend && module.call != null) {
10
+ if (module.route.route.type === AppType.Backend && module.invoke != null) {
11
11
  const guards = module.getGuards();
12
12
  if (guards.length > 0) {
13
13
  if (module._auth_web_middleware_applied === true) {
14
14
  return;
15
15
  }
16
16
  module._auth_web_middleware_applied = true;
17
- // const auth = context.service<GuardService>(service)
18
- const call = module.call;
19
- module.call = async (req, res) => {
17
+ // Wrapping `invoke` covers `call` too: `call` reads `invoke` off the entrypoint at the
18
+ // moment it runs, so a rejected session is caught whichever verb the caller used.
19
+ const invoke = module.invoke;
20
+ module.invoke = (async (req) => {
20
21
  try {
21
- return await call(req, res);
22
+ return await invoke(req);
22
23
  }
23
24
  catch (e) {
24
25
  if (e instanceof Error) {
@@ -35,7 +36,7 @@ export const logoutMiddleware = {
35
36
  }
36
37
  throw e;
37
38
  }
38
- };
39
+ });
39
40
  }
40
41
  }
41
42
  });
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.js","sourceRoot":"","sources":["../src/middleware.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAGrD,MAAM,CAAC,MAAM,gBAAgB,GAAe;IAC1C,IAAI,EAAE,cAAc,CAAC,OAAO;IAC5B,KAAK,EAAE,eAAe,CAAC,OAAO;IAC9B,KAAK,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE;QACrB,OAAO,CAAC,WAAW,EAAU,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC7C,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,EAAE,CAAC;gBACvE,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAA;gBACjC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACtB,IAAI,MAAM,CAAC,4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AA;4CACxD,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;4CAC5B,MAAM,GAAG,CAAA;wCACX,CAAC;oCACH,CAAC;gCACH,CAAC;4BACH,CAAC;4BACD,MAAM,CAAC,CAAA;wBACT,CAAC;oBACH,CAAC,CAAyB,CAAA;gBAE5B,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAI3E,eAAO,MAAM,kBAAkB,WAAW,MAAM,KAAmB,WAclE,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,OAChF,CAAC,UAAS,MAAM,KACpB,CAAC,GAAG,iBAaN,CAAA"}
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAI3E,eAAO,MAAM,kBAAkB,GAAI,QAAO,MAAsB,KAAG,WAclE,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,EACrF,KAAK,CAAC,EAAE,QAAO,MAAsB,KACpC,CAAC,GAAG,iBAaN,CAAA"}
package/build/service.js CHANGED
@@ -9,7 +9,7 @@ export const makeAuthWebService = (alias = DEFAULT_ALIAS) => {
9
9
  await update(token);
10
10
  if (token == null) {
11
11
  const module = service.assertCtx().entrypoint(DISPATCHER);
12
- const [url] = await module.call();
12
+ const url = await module.url();
13
13
  document.location.href = url;
14
14
  }
15
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAGtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAElD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAK,GAAW,aAAa,EAAe,EAAE;IAC/E,MAAM,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,CAAA;IAEtC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;IAC7B,OAAO,CAAC,MAAM,GAAG,KAAK,EAAC,KAAK,EAAC,EAAE;QAC7B,MAAM,MAAM,CAAC,KAAK,CAAC,CAAA;QACnB,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAClB,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,UAAU,CAA2B,UAAU,CAAC,CAAA;YACnF,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAA;YACjC,QAAQ,CAAC,QAAQ,CAAC,IAAI,GAAG,GAAG,CAAA;QAC9B,CAAC;IACH,CAAC,CAAA;IAED,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,GAAM,EAAE,KAAK,GAAW,aAAa,EACd,EAAE;IACzB,MAAM,OAAO,GAAG,kBAAkB,CAAC,KAAK,CAAC,CA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,CAAC,MAAM,oBAAoB,GAAG,CAClC,GAAM,EAAE,QAAgB,aAAa,EACd,EAAE;IACzB,MAAM,OAAO,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAA;IAEzC,MAAM,OAAO,GAAG,GAA4B,CAAA;IAE5C,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAA;IAEhC,OAAO,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAA;IAC1C,OAAO,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IAE5C,OAAO,CAAC,IAAI,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAE/C,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/web-client",
3
- "version": "0.1.18-rc.20",
3
+ "version": "0.1.18-rc.21",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -21,22 +21,22 @@
21
21
  }
22
22
  },
23
23
  "dependencies": {
24
- "@owlmeans/auth": "^0.1.18-rc.7",
25
- "@owlmeans/auth-common": "^0.1.18-rc.9",
26
- "@owlmeans/client": "^0.1.18-rc.11",
27
- "@owlmeans/client-auth": "^0.1.18-rc.13",
28
- "@owlmeans/client-context": "^0.1.18-rc.9",
29
- "@owlmeans/client-i18n": "^0.1.18-rc.10",
30
- "@owlmeans/client-entrypoint": "^0.1.18-rc.9",
31
- "@owlmeans/client-resource": "^0.1.18-rc.9",
32
- "@owlmeans/client-route": "^0.1.18-rc.9",
33
- "@owlmeans/config": "^0.1.18-rc.8",
34
- "@owlmeans/context": "^0.1.18-rc.6",
35
- "@owlmeans/error": "^0.1.18-rc.6",
36
- "@owlmeans/i18n": "^0.1.18-rc.6",
37
- "@owlmeans/route": "^0.1.18-rc.6",
38
- "@owlmeans/web-db": "^0.1.18-rc.10",
39
- "@owlmeans/web-router": "^0.1.18-rc.11",
24
+ "@owlmeans/auth": "^0.1.18-rc.8",
25
+ "@owlmeans/auth-common": "^0.1.18-rc.11",
26
+ "@owlmeans/client": "^0.1.18-rc.13",
27
+ "@owlmeans/client-auth": "^0.1.18-rc.17",
28
+ "@owlmeans/client-context": "^0.1.18-rc.11",
29
+ "@owlmeans/client-i18n": "^0.1.18-rc.12",
30
+ "@owlmeans/client-entrypoint": "^0.1.18-rc.11",
31
+ "@owlmeans/client-resource": "^0.1.18-rc.11",
32
+ "@owlmeans/client-route": "^0.1.18-rc.11",
33
+ "@owlmeans/config": "^0.1.18-rc.10",
34
+ "@owlmeans/context": "^0.1.18-rc.7",
35
+ "@owlmeans/error": "^0.1.18-rc.7",
36
+ "@owlmeans/i18n": "^0.1.18-rc.7",
37
+ "@owlmeans/route": "^0.1.18-rc.7",
38
+ "@owlmeans/web-db": "^0.1.18-rc.12",
39
+ "@owlmeans/web-router": "^0.1.18-rc.12",
40
40
  "react-dropzone": "^14.3.5"
41
41
  },
42
42
  "peerDependencies": {
@@ -1,6 +1,6 @@
1
- import type { ModuleContextParams } from "@owlmeans/client"
1
+ import type { EntrypointContextParams } from "@owlmeans/client"
2
2
  import type { DispatcherProps } from "@owlmeans/client-auth"
3
3
  import type { PropsWithChildren } from "react"
4
4
 
5
- export interface ParametrisedProps extends PropsWithChildren<ModuleContextParams & DispatcherProps> {
5
+ export interface ParametrisedProps extends PropsWithChildren<EntrypointContextParams & DispatcherProps> {
6
6
  }
package/src/context.ts CHANGED
@@ -22,8 +22,6 @@ export const makeContext = <C extends AppConfig = AppConfig, T extends AppContex
22
22
  appendWebRouter<C, T>(context)
23
23
  appendWebLogin<C, T>(context)
24
24
 
25
- context.makeContext = makeContext as typeof context.makeContext
26
-
27
25
  return context
28
26
  }
29
27
 
@@ -1,11 +1,11 @@
1
1
  import { DISPATCHER, DISPATCHER_SURROGATE } from '@owlmeans/auth'
2
- import { modules as list } from '@owlmeans/client-auth'
2
+ import { entrypoints as list } from '@owlmeans/client-auth'
3
3
  import { elevate } from '@owlmeans/client-entrypoint'
4
4
  import { handler } from '@owlmeans/client'
5
5
  import { Dispatcher } from './components/dispatcher/component.js'
6
6
  import { SurrogateScreen } from './login/screen.js'
7
7
 
8
- elevate(list, DISPATCHER, handler(Dispatcher), { force: true })
8
+ elevate(list, DISPATCHER, handler(Dispatcher))
9
9
 
10
10
  /**
11
11
  * Elevated here rather than in a relying-party package on purpose.
@@ -17,4 +17,4 @@ elevate(list, DISPATCHER, handler(Dispatcher), { force: true })
17
17
  */
18
18
  elevate(list, DISPATCHER_SURROGATE, handler(SurrogateScreen))
19
19
 
20
- export const modules = list
20
+ export const entrypoints = list
package/src/index.ts CHANGED
@@ -4,7 +4,7 @@ export * from './types.js'
4
4
  export * from './main.js'
5
5
  export * from './router.js'
6
6
  export * from './components/index.js'
7
- export * from './modules.js'
7
+ export * from './entrypoints.js'
8
8
  export * from './exports.js'
9
9
  export * from './context.js'
10
10
  export * from './helper.js'
package/src/middleware.ts CHANGED
@@ -11,18 +11,19 @@ export const logoutMiddleware: Middleware = {
11
11
  stage: MiddlewareStage.Loading,
12
12
  apply: async context => {
13
13
  context.entrypoints<Perked>().forEach(module => {
14
- if (module.route.route.type === AppType.Backend && module.call != null) {
14
+ if (module.route.route.type === AppType.Backend && module.invoke != null) {
15
15
  const guards = module.getGuards()
16
16
  if (guards.length > 0) {
17
17
  if (module._auth_web_middleware_applied === true) {
18
18
  return
19
19
  }
20
20
  module._auth_web_middleware_applied = true
21
- // const auth = context.service<GuardService>(service)
22
- const call = module.call
23
- module.call = async (req, res) => {
21
+ // Wrapping `invoke` covers `call` too: `call` reads `invoke` off the entrypoint at the
22
+ // moment it runs, so a rejected session is caught whichever verb the caller used.
23
+ const invoke = module.invoke
24
+ module.invoke = (async req => {
24
25
  try {
25
- return await call(req, res)
26
+ return await invoke(req)
26
27
  } catch (e) {
27
28
  if (e instanceof Error) {
28
29
  const err = ResilientError.ensure(e)
@@ -38,7 +39,7 @@ export const logoutMiddleware: Middleware = {
38
39
  }
39
40
  throw e
40
41
  }
41
- }
42
+ }) as typeof module.invoke
42
43
 
43
44
  }
44
45
  }
package/src/service.ts CHANGED
@@ -16,7 +16,7 @@ export const makeAuthWebService = (alias: string = DEFAULT_ALIAS): AuthService =
16
16
  await update(token)
17
17
  if (token == null) {
18
18
  const module = service.assertCtx().entrypoint<ClientEntrypoint<string>>(DISPATCHER)
19
- const [url] = await module.call()
19
+ const url = await module.url()
20
20
  document.location.href = url
21
21
  }
22
22
  }
@@ -1,2 +0,0 @@
1
- export declare const modules: import("@owlmeans/client-entrypoint").ClientEntrypoint<{}, import("@owlmeans/client-entrypoint").ClientRequest<{}>>[];
2
- //# sourceMappingURL=modules.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,OAAO,uHAAO,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"modules.js","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;AAE/D;;;;;;;GAOG;AACH,OAAO,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC,CAAA;AAE7D,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,CAAA"}