@owlmeans/api-config 0.1.18-rc.20 → 0.1.18-rc.22
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 +17 -11
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/api-config/SKILL.md +8 -6
- package/build/entrypoints.d.ts +0 -1
- package/build/entrypoints.d.ts.map +1 -1
- package/build/entrypoints.js +0 -1
- package/build/entrypoints.js.map +1 -1
- package/package.json +5 -5
- package/src/entrypoints.ts +0 -2
- package/tests/plugins.spec.ts +0 -6
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @owlmeans/api-config
|
|
2
2
|
|
|
3
|
-
Shared
|
|
3
|
+
Shared protocol for advertising safe config values from server to client via a REST endpoint.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
- Exposes
|
|
7
|
+
- Exposes the `advertise` protocol for `GET /assets/config.json`, returning package-allowlisted config fields
|
|
8
8
|
- `ApiConfig` — the advertised config type (subset of `CommonConfig`)
|
|
9
9
|
- `API_CONFIG` — entrypoint alias for the config endpoint
|
|
10
10
|
- `apiConfigPlugin` / `every` — import-time allowlist helpers for package-owned client config
|
|
@@ -12,16 +12,20 @@ Shared entrypoint for advertising safe config values from server to client via a
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
bun add @owlmeans/api-config@^0.1.18-rc.
|
|
15
|
+
bun add @owlmeans/api-config@^0.1.18-rc.21
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Usage
|
|
19
19
|
|
|
20
|
-
Use with server and client counterparts — this package provides the shared types and
|
|
20
|
+
Use with server and client counterparts — this package provides the shared protocol, types, and
|
|
21
|
+
private adapter alias:
|
|
21
22
|
|
|
22
23
|
```typescript
|
|
23
|
-
import {
|
|
24
|
+
import { advertise } from '@owlmeans/api-config'
|
|
24
25
|
import type { ApiConfig } from '@owlmeans/api-config'
|
|
26
|
+
|
|
27
|
+
// Bind this exact declaration in the server and browser packages.
|
|
28
|
+
context.entrypoint(advertise)
|
|
25
29
|
```
|
|
26
30
|
|
|
27
31
|
## API
|
|
@@ -33,7 +37,13 @@ server values — including databases, queues and secrets — are never returned
|
|
|
33
37
|
|
|
34
38
|
### `API_CONFIG`
|
|
35
39
|
|
|
36
|
-
|
|
40
|
+
Internal adapter alias `'api-config:advertise'`. Application code imports `advertise` instead of
|
|
41
|
+
looking the protocol up by this string.
|
|
42
|
+
|
|
43
|
+
### `advertise`
|
|
44
|
+
|
|
45
|
+
The immutable, sticky protocol for `GET /assets/config.json`. It is the only shared declaration;
|
|
46
|
+
`@owlmeans/api-config-server` and `@owlmeans/api-config-client` each export local bindings for it.
|
|
37
47
|
|
|
38
48
|
### `apiConfigPlugin`
|
|
39
49
|
|
|
@@ -51,10 +61,6 @@ apiConfigPlugin({
|
|
|
51
61
|
The `deny` selector removes nested values after the allowlist selection. Prefer a precise nested
|
|
52
62
|
allowlist to `true`; `true` is appropriate only for data that is public at every depth.
|
|
53
63
|
|
|
54
|
-
### `entrypoints`
|
|
55
|
-
|
|
56
|
-
Array of route definitions for the config advertisement endpoint.
|
|
57
|
-
|
|
58
64
|
## Related Packages
|
|
59
65
|
|
|
60
66
|
- [`@owlmeans/api-config-server`](../api-config-server) — server-side entrypoint that serves the config
|
|
@@ -68,7 +74,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
68
74
|
your project's skill store (`.agents/skills/`):
|
|
69
75
|
|
|
70
76
|
```sh
|
|
71
|
-
npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
77
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.22
|
|
72
78
|
```
|
|
73
79
|
|
|
74
80
|
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/api-config",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-09-
|
|
4
|
+
"version": "0.1.18-rc.22",
|
|
5
|
+
"generatedAt": "2026-09-15T12:38:15.233Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/api-config
|
|
9
9
|
|
|
10
10
|
**Layer:** Core
|
|
11
|
-
**Install:** `"@owlmeans/api-config": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/api-config": "^0.1.18-rc.22"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
The contract package of a three-package flow: this one declares the endpoint and what may cross it,
|
|
14
14
|
`@owlmeans/api-config-server` answers it, `@owlmeans/api-config-client` fetches it and merges the
|
|
@@ -18,8 +18,8 @@ answer into the client config. Nothing here runs — it is the shared declaratio
|
|
|
18
18
|
|
|
19
19
|
| Export | Description |
|
|
20
20
|
|--------|-------------|
|
|
21
|
-
| `
|
|
22
|
-
| `
|
|
21
|
+
| `advertise` | The single immutable declaration — route `/assets/config.json`, `sticky: true` so a router attaches it unconditionally |
|
|
22
|
+
| `API_CONFIG` | Internal adapter alias for `advertise`; do not use it for ordinary application lookup |
|
|
23
23
|
| `apiConfigPlugin(plugin)` | Registers one package's public config selection as its module loads |
|
|
24
24
|
| `every(selection, where?)` | Applies a selection to every list item or object-map value, optionally filtering items |
|
|
25
25
|
| `ApiConfigPlugin` | `{ allow, deny? }` — nested allowlist with an optional nested redaction selector |
|
|
@@ -29,11 +29,13 @@ answer into the client config. Nothing here runs — it is the shared declaratio
|
|
|
29
29
|
## Usage
|
|
30
30
|
|
|
31
31
|
The declaration is bound on both sides, so neither imports the other's package — they only share
|
|
32
|
-
this one.
|
|
32
|
+
this one. A server or browser package binds `advertise`; it does not import a flattened shared list:
|
|
33
33
|
|
|
34
34
|
```typescript
|
|
35
|
-
import {
|
|
36
|
-
|
|
35
|
+
import { advertise } from '@owlmeans/api-config'
|
|
36
|
+
import { bind } from '@owlmeans/server-entrypoint'
|
|
37
|
+
|
|
38
|
+
export const serverBindings = [bind(advertise, handler)]
|
|
37
39
|
```
|
|
38
40
|
|
|
39
41
|
Most apps never do this directly: a backend built on `@owlmeans/server-app` already carries the
|
package/build/entrypoints.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
/** The public runtime-config endpoint protocol. */
|
|
2
2
|
export declare const advertise: import("@owlmeans/entrypoint").EntrypointProtocol<import("@owlmeans/entrypoint").OpenRequest, import("@owlmeans/entrypoint").OpenValue>;
|
|
3
|
-
export declare const protocols: import("@owlmeans/entrypoint").EntrypointProtocol<import("@owlmeans/entrypoint").OpenRequest, import("@owlmeans/entrypoint").OpenValue>[];
|
|
4
3
|
//# sourceMappingURL=entrypoints.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAIA,mDAAmD;AACnD,eAAO,MAAM,SAAS,yIAA2E,CAAA
|
|
1
|
+
{"version":3,"file":"entrypoints.d.ts","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAIA,mDAAmD;AACnD,eAAO,MAAM,SAAS,yIAA2E,CAAA"}
|
package/build/entrypoints.js
CHANGED
|
@@ -3,5 +3,4 @@ import { route } from '@owlmeans/route';
|
|
|
3
3
|
import { API_CONFIG } from './consts.js';
|
|
4
4
|
/** The public runtime-config endpoint protocol. */
|
|
5
5
|
export const advertise = openProtocol(route(API_CONFIG, '/assets/config.json'), { sticky: true });
|
|
6
|
-
export const protocols = [advertise];
|
|
7
6
|
//# sourceMappingURL=entrypoints.js.map
|
package/build/entrypoints.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entrypoints.js","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,mDAAmD;AACnD,MAAM,CAAC,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,UAAU,EAAE,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA
|
|
1
|
+
{"version":3,"file":"entrypoints.js","sourceRoot":"","sources":["../src/entrypoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,mDAAmD;AACnD,MAAM,CAAC,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,UAAU,EAAE,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/api-config",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.22",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@owlmeans/config": "^0.1.18-rc.
|
|
26
|
-
"@owlmeans/context": "^0.1.18-rc.
|
|
27
|
-
"@owlmeans/entrypoint": "^0.1.18-rc.
|
|
28
|
-
"@owlmeans/route": "^0.1.18-rc.
|
|
25
|
+
"@owlmeans/config": "^0.1.18-rc.22",
|
|
26
|
+
"@owlmeans/context": "^0.1.18-rc.18",
|
|
27
|
+
"@owlmeans/entrypoint": "^0.1.18-rc.21",
|
|
28
|
+
"@owlmeans/route": "^0.1.18-rc.19"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@owlmeans/dep-config": "workspace:*",
|
package/src/entrypoints.ts
CHANGED
package/tests/plugins.spec.ts
CHANGED
|
@@ -58,12 +58,6 @@ describe('@owlmeans/api-config plugins', () => {
|
|
|
58
58
|
api: { service: 'api', type: AppType.Backend, host: 'api.example.test', port: 443, base: 'api' },
|
|
59
59
|
},
|
|
60
60
|
plugins: [{ id: 'web', type: AppType.Frontend, value: 'safe' }],
|
|
61
|
-
oidc: {
|
|
62
|
-
clientCookie: { interaction: { name: 'oidc', ttl: 60 } },
|
|
63
|
-
providers: [{ clientId: 'public', service: 'iam' }],
|
|
64
|
-
},
|
|
65
|
-
flowConfig: { defaultFlow: 'signin', services: { auth: 'web' } },
|
|
66
|
-
i18n: { defaultLng: 'en', supportedLngs: ['en', 'pl'] },
|
|
67
61
|
[CONFIG_RECORD]: [{ id: 'plan:starter', recordType: 'plan', price: 10 }],
|
|
68
62
|
})
|
|
69
63
|
})
|