@owlmeans/server-wl 0.1.18-rc.16 → 0.1.18-rc.18
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
|
@@ -12,7 +12,7 @@ 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.16
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Usage
|
|
@@ -59,7 +59,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
59
59
|
your project's skill store (`.agents/skills/`):
|
|
60
60
|
|
|
61
61
|
```sh
|
|
62
|
-
npx @owlmeans/agent-skills
|
|
62
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.13
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
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/server-wl",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-09-
|
|
4
|
+
"version": "0.1.18-rc.18",
|
|
5
|
+
"generatedAt": "2026-09-10T18:54:42.503Z",
|
|
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
|
|
3
|
+
description: How to use @owlmeans/server-wl — the server half of the white-label contract — the elevated 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.
|
|
11
|
+
**Install:** `"@owlmeans/server-wl": "^0.1.18-rc.18"` 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
|
-
| `
|
|
18
|
-
| `
|
|
21
|
+
| `entrypoints` | The `WL_PROVIDE` declaration, already elevated with 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
|
-
|
|
29
|
+
```typescript
|
|
30
|
+
import { entrypoints as wlEntrypoints } from '@owlmeans/server-wl'
|
|
31
|
+
|
|
32
|
+
export const appEntrypoints = [...ownEntrypoints, ...wlEntrypoints]
|
|
33
|
+
```
|
|
21
34
|
|
|
22
35
|
```typescript
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
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 elevates 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 elevate the
|
|
48
|
+
alias with a guard of your own in the application's entrypoint list.
|
|
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-
|
|
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`.
|
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
|
+
"version": "0.1.18-rc.18",
|
|
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.
|
|
25
|
-
"@owlmeans/server-api": "^0.1.18-rc.
|
|
26
|
-
"@owlmeans/server-context": "^0.1.18-rc.
|
|
27
|
-
"@owlmeans/server-entrypoint": "^0.1.18-rc.
|
|
28
|
-
"@owlmeans/wled": "^0.1.18-rc.
|
|
24
|
+
"@owlmeans/context": "^0.1.18-rc.9",
|
|
25
|
+
"@owlmeans/server-api": "^0.1.18-rc.18",
|
|
26
|
+
"@owlmeans/server-context": "^0.1.18-rc.13",
|
|
27
|
+
"@owlmeans/server-entrypoint": "^0.1.18-rc.12",
|
|
28
|
+
"@owlmeans/wled": "^0.1.18-rc.12"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@owlmeans/dep-config": "workspace:*",
|