@owlmeans/server-wl 0.1.18-rc.4 → 0.1.18-rc.41

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
@@ -1,10 +1,10 @@
1
1
  # @owlmeans/server-wl
2
2
 
3
- Server-side whitelabeling — provides entity-specific branding and configuration via backend modules.
3
+ Server-side whitelabeling — provides entity-specific branding and configuration via a bound backend protocol.
4
4
 
5
5
  ## Overview
6
6
 
7
- - Exports `modules` array: pre-built server modules that serve WL (whitelabel) configuration to clients
7
+ - Exports `entrypoints`: local server bindings that serve the shared WL protocol to clients
8
8
  - Provides `provide` action — the handler for the WL configuration endpoint
9
9
  - Integrates with `@owlmeans/wled` for whitelabel data definitions
10
10
  - Apps add WL DNS service from `@owlmeans/server-wl-dns` for domain-based entity resolution
@@ -12,35 +12,36 @@ Server-side whitelabeling — provides entity-specific branding and configuratio
12
12
  ## Installation
13
13
 
14
14
  ```bash
15
- bun add @owlmeans/server-wl
15
+ bun add @owlmeans/server-wl@^0.1.18-rc.41
16
16
  ```
17
17
 
18
18
  ## Usage
19
19
 
20
- Register WL modules in a backend service:
20
+ Register WL entrypoints in a backend service:
21
21
 
22
22
  ```typescript
23
- import { modules as wlModules } from '@owlmeans/server-wl'
24
- import { main, modules } from '@owlmeans/server-app'
23
+ import { entrypoints as wlEntrypoints } from '@owlmeans/server-wl'
24
+ import { main, entrypoints } from '@owlmeans/server-app'
25
25
 
26
- await main(context, [...modules, ...wlModules, ...appModules])
26
+ await main(context, [...entrypoints, ...wlEntrypoints, ...serverBindings])
27
27
  ```
28
28
 
29
29
  With DNS-based entity resolution (from viable):
30
30
 
31
31
  ```typescript
32
32
  import { appendWlDnsService } from '@owlmeans/server-wl-dns'
33
- import { wlDnsModules } from '@owlmeans/server-wl-dns'
33
+ import { wlDnsEntrypoints } from '@owlmeans/server-wl-dns'
34
34
 
35
35
  appendWlDnsService(context)
36
- await main(context, [...modules, ...wlDnsModules, ...appModules])
36
+ await main(context, [...entrypoints, ...wlDnsEntrypoints, ...serverBindings])
37
37
  ```
38
38
 
39
39
  ## API
40
40
 
41
- ### `modules`
41
+ ### `entrypoints`
42
42
 
43
- Array of `ServerModule` instances providing the WL configuration API endpoint.
43
+ Local bound server entrypoints providing the WL configuration API endpoint. The shared immutable
44
+ declaration is `wledEntrypoints.provide` from `@owlmeans/wled`; this package supplies its handler.
44
45
 
45
46
  ### `WlConfig` / `WlRecord` (types)
46
47
 
@@ -49,7 +50,7 @@ Whitelabel configuration types defining branding, theme, and entity-specific set
49
50
  ## Related Packages
50
51
 
51
52
  - [`@owlmeans/client-wl`](../client-wl) — client-side WL service that fetches from this server
52
- - [`@owlmeans/server-app`](../server-app) — server bootstrap that includes these modules
53
+ - [`@owlmeans/server-app`](../server-app) — server bootstrap that includes these entrypoints
53
54
 
54
55
  <!-- owlmeans:agent-guidance:start -->
55
56
  ## Agent guidance
@@ -59,7 +60,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
59
60
  your project's skill store (`.agents/skills/`):
60
61
 
61
62
  ```sh
62
- npx @owlmeans/agent-skills
63
+ npx @owlmeans/agent-skills@^0.1.18-rc.40
63
64
  ```
64
65
 
65
66
  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/server-wl",
4
- "version": "0.1.18-rc.0",
5
- "generatedAt": "2026-08-16T22:20:50.512Z",
4
+ "version": "0.1.18-rc.41",
5
+ "generatedAt": "2026-09-25T21:19:37.987Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: server-wl
3
- description: How to use @owlmeans/server-wl — server-side whitelist/allowlist (white-label) module declarations to add to your appModules. Auto-invoked when importing server-wl modules.
3
+ description: How to use @owlmeans/server-wl — the server half of the white-label contract — the bound WL_PROVIDE entrypoint, the WlProvider and WlEntityIdentifier service seams, and the cfg.wlProviders wiring that decides what a provide call returns. Auto-invoked when serving white-label data or writing a white-label provider service.
4
4
  user-invocable: false
5
5
  ---
6
6
  <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
@@ -8,24 +8,84 @@ user-invocable: false
8
8
  # @owlmeans/server-wl
9
9
 
10
10
  **Layer:** Server
11
- **Install:** `"@owlmeans/server-wl": "^0.1.18-rc.0"` in `dependencies`
11
+ **Install:** `"@owlmeans/server-wl": "^0.1.18-rc.41"` in `dependencies`
12
+
13
+ Answers the one `WL_PROVIDE` entrypoint `@owlmeans/wled` declares. It stores nothing itself: it fans
14
+ the request out to the provider services the configuration names and returns their answers in one
15
+ object.
12
16
 
13
17
  ## Key Exports
14
18
 
15
19
  | Export | Description |
16
20
  |--------|-------------|
17
- | `wlModules` | Server module declarations for whitelist endpoints |
18
- | `Wl` server types | Server-side white-label types |
21
+ | `entrypoints` | The `WL_PROVIDE` protocol already bound to the provide handler. Spread it into the app's entrypoint list |
22
+ | `WlProvider` | Service seam a white-label section implements: `provide(entityId) => Promise<ProvidedWL>` |
23
+ | `WlEntityIdentifier` | Optional seam that maps a public identifier (a custom domain, say) to an entity id: `identifyEntity(identifier) => Promise<string \| null>` |
24
+ | `WlProviderAppend` | The config this package reads: `{ wlProviders: string[], wlIdentifierService?: string }` |
25
+ | `Config`, `Context` | `ServerConfig`/`ServerContext` narrowed to carry `WlProviderAppend` |
26
+
27
+ ## Wiring
19
28
 
20
- ## Usage
29
+ ```typescript
30
+ import { entrypoints as wlEntrypoints } from '@owlmeans/server-wl'
31
+
32
+ export const serverBindings = [...ownBindings, ...wlEntrypoints]
33
+ ```
21
34
 
22
35
  ```typescript
23
- import { wlModules } from '@owlmeans/server-wl'
24
- export const appModules = [...modules, ...wlModules, ...managerModules]
36
+ // config — the aliases of services registered on this context that implement WlProvider
37
+ cfg.wlProviders = ['wl-info', 'wl-styles', 'wl-logo']
38
+ // optional: resolves a public identifier to an entity id before the providers are called
39
+ cfg.wlIdentifierService = 'wl-dns'
25
40
  ```
26
41
 
27
- White-label DNS/routing service is typically wired separately as `@owlmeans/server-wl-dns` (downstream package).
42
+ `wlProviders` is required, not optional: the handler maps over it unconditionally, so a context that
43
+ serves this entrypoint with the key unset fails the request rather than returning an empty set.
44
+
45
+ The declaration `@owlmeans/wled` ships carries **no guard**, and this package binds it with a
46
+ handler only — so the endpoint answers anonymously and any caller who can name an organization reads
47
+ every section the deployment registered. Keep white-label records public by design, or bind the
48
+ alias with a guard of your own in the application's entrypoint bindings.
49
+
50
+ ## The response is keyed by service alias
51
+
52
+ The handler builds `{ [providerAlias]: await service.provide(entityId) }`, so the key a browser reads
53
+ a section under is the **alias the provider service was registered as** — not the `type` on the
54
+ record and not a white-label constant. Registering the same provider under a different alias renames
55
+ the section for every reader.
56
+
57
+ The `:entity` path param is whatever the caller addressed the organization by. When
58
+ `wlIdentifierService` is configured, its `identifyEntity` runs first and its answer replaces the
59
+ param; a `null` answer leaves the param in place, so a bare entity slug keeps working with a
60
+ resolver installed.
61
+
62
+ ## Writing a provider
63
+
64
+ ```typescript
65
+ import type { WlProvider } from '@owlmeans/server-wl'
66
+ import { WL_TYPE_COMPANY_INFO } from '@owlmeans/wled'
67
+ import { createService } from '@owlmeans/context'
68
+
69
+ export const makeInfoService = (alias = 'wl-info'): WlProvider =>
70
+ createService<WlProvider>(alias, {
71
+ provide: async entityId => {
72
+ const record = await load(entityId)
73
+
74
+ return record != null
75
+ ? { ...record, type: WL_TYPE_COMPANY_INFO, exists: true }
76
+ : { type: WL_TYPE_COMPANY_INFO, exists: false }
77
+ }
78
+ })
79
+ ```
80
+
81
+ A provider is called for every request to the entrypoint, in parallel with its siblings, and one
82
+ rejection fails the whole response — so a provider that cannot answer returns `exists: false` rather
83
+ than throwing.
28
84
 
29
85
  ## Depends On
30
86
 
31
- - `@owlmeans/wled`, `@owlmeans/server-entrypoint`, `@owlmeans/server-route`
87
+ - `@owlmeans/wled`, `@owlmeans/server-api`, `@owlmeans/server-entrypoint`, `@owlmeans/server-context`,
88
+ `@owlmeans/context`
89
+
90
+ The browser counterpart is `@owlmeans/web-wl`. Concrete providers — company info, styles, logo
91
+ storage, DNS — are separate downstream packages that implement `WlProvider`.
@@ -1,3 +1,5 @@
1
- import type { RefedEntrypointHandler } from '@owlmeans/server-entrypoint';
2
- export declare const provide: RefedEntrypointHandler;
1
+ import type { ProvideParams } from '@owlmeans/wled';
2
+ export declare const provide: import("@owlmeans/server-entrypoint").BoundEntrypointHandler<import("@owlmeans/entrypoint").EntrypointProtocol<{
3
+ params: ProvideParams;
4
+ }, undefined>>;
3
5
  //# sourceMappingURL=provide.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provide.d.ts","sourceRoot":"","sources":["../../src/actions/provide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAMzE,eAAO,MAAM,OAAO,EAAE,sBAqBrB,CAAA"}
1
+ {"version":3,"file":"provide.d.ts","sourceRoot":"","sources":["../../src/actions/provide.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAGnD,eAAO,MAAM,OAAO;;cAqBnB,CAAA"}
@@ -1,7 +1,6 @@
1
- import { handleParams } from '@owlmeans/server-api';
2
- import { assertContext } from '@owlmeans/context';
3
- export const provide = handleParams(async (params, ctx) => {
4
- const context = assertContext(ctx, 'provide');
1
+ import { handlers } from '@owlmeans/server-api';
2
+ import { wledEntrypoints } from '@owlmeans/wled';
3
+ export const provide = handlers().params(wledEntrypoints.provide, async (params, context) => {
5
4
  const dns = context.cfg.wlIdentifierService == null ? undefined
6
5
  : context.service(context.cfg.wlIdentifierService);
7
6
  const entityId = dns != null
@@ -1 +1 @@
1
- {"version":3,"file":"provide.js","sourceRoot":"","sources":["../../src/actions/provide.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AA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,EACvB,KAAK,EAAE,MAAqB,EAAE,OAAO,EAAE,EAAE;IAEvC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,IAAI,CAAC,CAAC,CAAC,SAAS;QAC7D,CAAC,CAAC,OAAO,CAAC,OAAO,CAAqB,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;IAExE,MAAM,QAAQ,GAAG,GAAG,IAAI,IAAI;QAC1B,CAAC,CAAC,MAAM,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM;QAC1D,CAAC,CAAC,MAAM,CAAC,MAAM,CAAA;IAEjB,MAAM,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,OAAO,CAAC,GAAG,CAC7C,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,EAAC,QAAQ,EAAC,EAAE;QAC3C,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAa,QAAQ,CAAC,CAAA;QAEjD,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAA;IAChD,CAAC,CAAC,CACH,CAAC,CAAA;IAEF,OAAO,EAAE,CAAA;AACX,CAAC,CACF,CAAA"}
@@ -0,0 +1,4 @@
1
+ export declare const entrypoints: import("@owlmeans/server-entrypoint").ServerProtocolEntrypoint<import("@owlmeans/entrypoint").EntrypointProtocol<{
2
+ params: import("@owlmeans/wled").ProvideParams;
3
+ }, undefined>>[];
4
+ //# sourceMappingURL=entrypoints.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW;;gBAAmD,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { bind } from '@owlmeans/server-entrypoint';
2
+ import { wledEntrypoints } from '@owlmeans/wled';
3
+ import * as actions from './actions/index.js';
4
+ export const entrypoints = [bind(wledEntrypoints.provide, actions.provide)];
5
+ //# sourceMappingURL=entrypoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entrypoints.js","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAE7C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA"}
package/build/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export type * from './types.js';
2
- export * from './modules.js';
2
+ export * from './entrypoints.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,mBAAmB,YAAY,CAAA;AAC/B,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,mBAAmB,YAAY,CAAA;AAC/B,cAAc,kBAAkB,CAAA"}
package/build/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export * from './modules.js';
1
+ export * from './entrypoints.js';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,kBAAkB,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@owlmeans/server-wl",
3
3
  "type": "module",
4
- "version": "0.1.18-rc.4",
4
+ "version": "0.1.18-rc.41",
5
5
  "license": "MIT",
6
6
  "scripts": {
7
7
  "build": "tsc -b",
@@ -21,11 +21,11 @@
21
21
  }
22
22
  },
23
23
  "dependencies": {
24
- "@owlmeans/context": "^0.1.18-rc.4",
25
- "@owlmeans/server-api": "^0.1.18-rc.4",
26
- "@owlmeans/server-context": "^0.1.18-rc.4",
27
- "@owlmeans/server-entrypoint": "^0.1.18-rc.4",
28
- "@owlmeans/wled": "^0.1.18-rc.4"
24
+ "@owlmeans/context": "^0.1.18-rc.32",
25
+ "@owlmeans/server-api": "^0.1.18-rc.43",
26
+ "@owlmeans/server-context": "^0.1.18-rc.37",
27
+ "@owlmeans/server-entrypoint": "^0.1.18-rc.36",
28
+ "@owlmeans/wled": "^0.1.18-rc.34"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@owlmeans/dep-config": "workspace:*",
@@ -1,12 +1,11 @@
1
- import type { RefedEntrypointHandler } from '@owlmeans/server-entrypoint'
2
- import { handleParams } from '@owlmeans/server-api'
1
+ import { handlers } from '@owlmeans/server-api'
3
2
  import type { Context, WlEntityIdentifier, WlProvider } from '../types.js'
4
- import { assertContext } from '@owlmeans/context'
5
3
  import type { ProvideParams } from '@owlmeans/wled'
4
+ import { wledEntrypoints } from '@owlmeans/wled'
6
5
 
7
- export const provide: RefedEntrypointHandler = handleParams<ProvideParams>(
8
- async (params, ctx) => {
9
- const context = assertContext(ctx, 'provide') as Context
6
+ export const provide = handlers<Context>().params(
7
+ wledEntrypoints.provide,
8
+ async (params: ProvideParams, context) => {
10
9
 
11
10
  const dns = context.cfg.wlIdentifierService == null ? undefined
12
11
  : context.service<WlEntityIdentifier>(context.cfg.wlIdentifierService)
@@ -0,0 +1,6 @@
1
+
2
+ import { bind } from '@owlmeans/server-entrypoint'
3
+ import { wledEntrypoints } from '@owlmeans/wled'
4
+ import * as actions from './actions/index.js'
5
+
6
+ export const entrypoints = [bind(wledEntrypoints.provide, actions.provide)]
package/src/index.ts CHANGED
@@ -1,3 +1,3 @@
1
1
 
2
2
  export type * from './types.js'
3
- export * from './modules.js'
3
+ export * from './entrypoints.js'
@@ -1,3 +0,0 @@
1
- import type { ServerEntrypoint } from '@owlmeans/server-entrypoint';
2
- export declare const modules: ServerEntrypoint<unknown>[];
3
- //# sourceMappingURL=modules.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAMnE,eAAO,MAAM,OAAO,EAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAA"}
package/build/modules.js DELETED
@@ -1,6 +0,0 @@
1
- import { elevate } from '@owlmeans/server-entrypoint';
2
- import { WL_PROVIDE, modules as wlModules } from '@owlmeans/wled';
3
- import * as actions from './actions/index.js';
4
- elevate(wlModules, WL_PROVIDE, actions.provide);
5
- export const modules = wlModules;
6
- //# sourceMappingURL=modules.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"modules.js","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AAErD,OAAO,EAAE,UAAU,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAE7C,OAAO,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;AAE/C,MAAM,CAAC,MAAM,OAAO,GAAG,SAAwC,CAAA"}
package/src/modules.ts DELETED
@@ -1,9 +0,0 @@
1
-
2
- import { elevate } from '@owlmeans/server-entrypoint'
3
- import type { ServerEntrypoint } from '@owlmeans/server-entrypoint'
4
- import { WL_PROVIDE, modules as wlModules } from '@owlmeans/wled'
5
- import * as actions from './actions/index.js'
6
-
7
- elevate(wlModules, WL_PROVIDE, actions.provide)
8
-
9
- export const modules = wlModules as ServerEntrypoint<unknown>[]