@vxil/feature-configs 0.6.0 → 0.7.1
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/dist/apiState.d.ts +2 -2
- package/dist/apiState.js +2 -2
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +1 -1
- package/dist/index.d.ts +36 -15
- package/dist/index.js +265 -175
- package/dist/readmodels.d.ts +1 -1
- package/dist/readmodels.js +1 -1
- package/package.json +1 -1
- package/src/apiState.ts +5 -7
- package/src/hooks.ts +2 -2
- package/src/index.ts +284 -188
- package/src/readmodels.ts +1 -1
package/dist/readmodels.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare const READ_MODEL_LIMITS: {
|
|
|
9
9
|
/**
|
|
10
10
|
* Structural validation of a declared read-model `spec` — shared by the
|
|
11
11
|
* config-write gate here and re-exported for anyone needing the pure check.
|
|
12
|
-
* `kind` selects the
|
|
12
|
+
* `kind` selects the aggregate or the rank grammar (guide ch. 4).
|
|
13
13
|
*/
|
|
14
14
|
export declare function validateReadModelSpecShape(where: string, kind: 'aggregate' | 'rank', spec: unknown): string[];
|
|
15
15
|
/** Shape of one declared read-model (mirrors the CmsConfigSchema Record). */
|
package/dist/readmodels.js
CHANGED
|
@@ -103,7 +103,7 @@ function filterErrors(where, raw) {
|
|
|
103
103
|
/**
|
|
104
104
|
* Structural validation of a declared read-model `spec` — shared by the
|
|
105
105
|
* config-write gate here and re-exported for anyone needing the pure check.
|
|
106
|
-
* `kind` selects the
|
|
106
|
+
* `kind` selects the aggregate or the rank grammar (guide ch. 4).
|
|
107
107
|
*/
|
|
108
108
|
export function validateReadModelSpecShape(where, kind, spec) {
|
|
109
109
|
if (!isObj(spec))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vxil/feature-configs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "The per-feature configuration schemas and validators behind vxil.config.ts (published for @vxil/cli and @vxil/config).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://vxil.com",
|
package/src/apiState.ts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
// DECLARED API STATE — the pure declared-vs-live planner (
|
|
2
|
-
// 2026-09-23).
|
|
1
|
+
// DECLARED API STATE — the pure declared-vs-live planner (2026-09-23).
|
|
3
2
|
//
|
|
4
3
|
// Three datums used to be API state OUTSIDE vxil.config — rows their own /v1
|
|
5
4
|
// route created, that `vxil push` never converged and a rollback never
|
|
6
5
|
// restored — so every tenant that wanted a reproducible second environment
|
|
7
|
-
// wrote an `ensure-*.ts` script and a nightly assert
|
|
8
|
-
//
|
|
9
|
-
// by `vxil push` and `POST /v1/apply`:
|
|
6
|
+
// wrote an `ensure-*.ts` script and a nightly assert. They are now DECLARED in
|
|
7
|
+
// the feature's config block and CONVERGED by `vxil push` and `POST /v1/apply`:
|
|
10
8
|
//
|
|
11
9
|
// rate-limits.policies[] — keyed by `name` (POST/PUT/DELETE /v1/rate-limits/policies)
|
|
12
10
|
// webhooks.subscriptions[] — keyed by `target_url` (POST/PATCH/DELETE /v1/webhooks/subscriptions)
|
|
@@ -307,12 +305,12 @@ export interface ApiStateResponseField extends ApiStateSummary {
|
|
|
307
305
|
|
|
308
306
|
/** The note every executor reports for a DISABLED feature whose block still
|
|
309
307
|
* declares rows: the declaration is kept in the manifest and nothing is
|
|
310
|
-
* converged (a parked feature is not a propagation window
|
|
308
|
+
* converged (a parked feature is not a propagation window). */
|
|
311
309
|
export const API_STATE_DISABLED_NOTE = 'feature disabled — declaration kept, not converged';
|
|
312
310
|
|
|
313
311
|
/** `GET /v1/rate-limits/policies` is a 100-row HARD cap with no cursor. A list
|
|
314
312
|
* AT the cap is not a complete live set, so planning creates against it would
|
|
315
|
-
* re-POST every declared name the cap hid
|
|
313
|
+
* re-POST every declared name the cap hid. The server's
|
|
316
314
|
* converge and the CLI's read-only plan refuse with this message instead. */
|
|
317
315
|
export function rlPolicyListCapError(liveCount: number): string | null {
|
|
318
316
|
if (liveCount < RL_POLICY_LIST_CAP) return null;
|
package/src/hooks.ts
CHANGED
|
@@ -330,7 +330,7 @@ export function validateAst(root: Node): string[] {
|
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
// ── evaluator (bounded, deterministic interpreter) ──────────────────────────
|
|
333
|
-
/** The VERIFIED caller/session context for read hooks (
|
|
333
|
+
/** The VERIFIED caller/session context for read hooks (guide ch. 7). Read-only;
|
|
334
334
|
* present only on the read path in end-user mode. In server mode / write path
|
|
335
335
|
* the whole object is null. */
|
|
336
336
|
export interface HookCaller {
|
|
@@ -663,7 +663,7 @@ export function runReadHooks(
|
|
|
663
663
|
collection: string,
|
|
664
664
|
rows: ReadonlyArray<Record<string, unknown>>,
|
|
665
665
|
now: string,
|
|
666
|
-
/** verified caller/session context (
|
|
666
|
+
/** verified caller/session context (guide ch. 7) — read-only, exposed to
|
|
667
667
|
* expressions as `caller.endUserId` / `caller.principal`. Omitted ⇒ null
|
|
668
668
|
* (server-caller mode). */
|
|
669
669
|
caller?: HookCaller | null,
|