@owlmeans/client-config 0.1.18-rc.2 → 0.1.18-rc.20

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
@@ -11,7 +11,7 @@ Client-side configuration helper for registering web service endpoints.
11
11
  ## Installation
12
12
 
13
13
  ```bash
14
- bun add @owlmeans/client-config
14
+ bun add @owlmeans/client-config@^0.1.18-rc.11
15
15
  ```
16
16
 
17
17
  ## Usage
@@ -48,7 +48,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
48
48
  your project's skill store (`.agents/skills/`):
49
49
 
50
50
  ```sh
51
- npx @owlmeans/agent-skills
51
+ npx @owlmeans/agent-skills@^0.1.18-rc.20
52
52
  ```
53
53
 
54
54
  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/client-config",
4
- "version": "0.1.18-rc.0",
5
- "generatedAt": "2026-08-16T22:20:50.517Z",
4
+ "version": "0.1.18-rc.20",
5
+ "generatedAt": "2026-09-12T14:21:25.470Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: client-config
3
- description: How to use @owlmeans/client-config — client-side config types and helpers (extends core Config). Auto-invoked when importing client config primitives.
3
+ description: How to use @owlmeans/client-config — the BasicClientConfig shape every client config extends (webService, primaryHost, primaryPort, shortAlias) and addWebService() for naming which API client carries a call. Auto-invoked when typing a client config, wiring an app to its API service, or resolving which web service an entrypoint calls through.
4
4
  user-invocable: false
5
5
  ---
6
6
  <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
@@ -8,22 +8,73 @@ user-invocable: false
8
8
  # @owlmeans/client-config
9
9
 
10
10
  **Layer:** Client
11
- **Install:** `"@owlmeans/client-config": "^0.1.18-rc.0"` in `dependencies`
11
+ **Install:** `"@owlmeans/client-config": "^0.1.18-rc.20"` in `dependencies`
12
+
13
+ The bottom of the client config stack: the few fields a client adds to `CommonConfig`, and the
14
+ helper that fills the one field a client cannot work without. Nothing here knows about React or the
15
+ browser.
12
16
 
13
17
  ## Key Exports
14
18
 
15
19
  | Export | Description |
16
20
  |--------|-------------|
17
- | `ClientConfig` types | Client-side config interface (extends core) |
18
- | Constants | Default config aliases |
19
- | Helpers | Resolve client config |
21
+ | `BasicClientConfig` | `CommonConfig` + `webService`, `primaryHost`, `primaryPort`, `shortAlias` |
22
+ | `addWebService(service, alias?, cfg?)` | Point calls at an API client — globally, or per target service |
23
+ | `DEFAULT_KEY` (`default`) | The key `webService` uses for the fallback API client |
24
+
25
+ `ClientConfig` — the config a context is actually built from — is **not** here: it lives in
26
+ `@owlmeans/client-context`, which adds `services` and `i18n` on top of `BasicClientConfig`.
27
+
28
+ ## The fields
29
+
30
+ | Field | Meaning |
31
+ |---|---|
32
+ | `webService` | Which API client carries an outgoing call. A string names one for everything; a record maps the *target service* alias to an API client alias, with `DEFAULT_KEY` as the fallback |
33
+ | `primaryHost` / `primaryPort` | The host the app is being served from. `@owlmeans/web-client` fills these from `window.location` while building the context — do not set them by hand |
34
+ | `shortAlias` | An abbreviation of `service`, so a flow or a redirect can name this app in a query parameter without spelling the full alias |
20
35
 
21
- ## Usage
36
+ ## Naming the API client
22
37
 
23
38
  ```typescript
24
- import type { ClientConfig } from '@owlmeans/client-config'
39
+ import { addWebService } from '@owlmeans/client-config'
40
+
41
+ addWebService(API_CLIENT, cfg) // one client for every call
42
+ addWebService(BILLING_CLIENT, BILLING, cfg) // ...and this one for calls to the billing service
25
43
  ```
26
44
 
45
+ The **three-argument** form never drops what is already there, and what it writes depends on the
46
+ state it finds:
47
+
48
+ | `webService` before | After `addWebService(S, ALIAS, cfg)` |
49
+ |---|---|
50
+ | unset | `{ default: S, ALIAS: S }` — the first per-service call **also** becomes the global default |
51
+ | the string `X` | `{ default: X, ALIAS: S }` — the general answer is demoted, not lost |
52
+ | a record | that record with `ALIAS: S` added |
53
+
54
+ So a first call meant as service-specific is not specific: name the general client first, or accept
55
+ that this one answers for everything else too.
56
+
57
+ The **two-argument** form sets the general answer: an unset or string `webService` becomes the plain
58
+ string, and on a record it writes only `DEFAULT_KEY`. Called with no `cfg` at all it builds and returns a fresh partial config
59
+ to spread. `@owlmeans/web-panel`, `@owlmeans/mui-panel` and `@owlmeans/server-app` re-export it, so
60
+ an app configures through the package it already imports.
61
+
62
+ A client entrypoint resolves its carrier from this field on every call, and refuses before anything
63
+ else when the field is absent: `SyntaxError('No webService provided')` is "this config never named
64
+ an API client", and it is thrown even for a call a registered transport would have carried. When
65
+ the field is a record with neither the target service's alias nor `DEFAULT_KEY`, the failure is
66
+ ``SyntaxError("Can't cast web service alias for <alias> entrypoint")`` instead.
67
+
68
+ `webService` has no `apiConfigPlugin()` allowlist registration, so
69
+ `@owlmeans/api-config-server` never includes it in the `ApiConfig` it advertises.
70
+ `@owlmeans/api-config-client` merges only what came back, so every client names its API client
71
+ locally.
72
+
27
73
  ## Depends On
28
74
 
29
- - `@owlmeans/config`, `@owlmeans/auth`
75
+ - `@owlmeans/config` — `CommonConfig`, which `BasicClientConfig` extends
76
+
77
+ ## Related
78
+
79
+ - [[client-context]] — `ClientConfig` and the context factory built on this shape
80
+ - [[client-entrypoint]] — the caller that reads `webService` to pick a carrier
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/client-config",
3
- "version": "0.1.18-rc.2",
3
+ "version": "0.1.18-rc.20",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -21,7 +21,7 @@
21
21
  }
22
22
  },
23
23
  "dependencies": {
24
- "@owlmeans/config": "^0.1.18-rc.2"
24
+ "@owlmeans/config": "^0.1.18-rc.20"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@owlmeans/dep-config": "workspace:*",
package/build/.gitkeep DELETED
File without changes