@fuzdev/fuz_app 0.153.0 → 0.154.0
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/env/env_schemas.d.ts +41 -0
- package/dist/env/env_schemas.d.ts.map +1 -0
- package/dist/env/env_schemas.js +55 -0
- package/dist/env/load.d.ts +23 -15
- package/dist/env/load.d.ts.map +1 -1
- package/dist/env/load.js +38 -22
- package/dist/http/surface.d.ts +13 -9
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +22 -18
- package/dist/schema_meta.d.ts +4 -2
- package/dist/schema_meta.d.ts.map +1 -1
- package/dist/schema_meta.js +4 -2
- package/dist/sensitivity.d.ts +34 -1
- package/dist/sensitivity.d.ts.map +1 -1
- package/dist/sensitivity.js +32 -2
- package/dist/server/app_server.d.ts +6 -5
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +0 -1
- package/dist/server/env.d.ts +52 -30
- package/dist/server/env.d.ts.map +1 -1
- package/dist/server/env.js +38 -43
- package/dist/testing/CLAUDE.md +1 -1
- package/dist/testing/app_server.js +2 -2
- package/dist/testing/stubs.d.ts +2 -2
- package/dist/testing/stubs.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@fuzdev/fuz_schema` schemas for env var values, matching the Rust spine's
|
|
3
|
+
* readers of the same vars.
|
|
4
|
+
*
|
|
5
|
+
* An env value is a string, so these take a string and output the value it
|
|
6
|
+
* spells: `env_integer` for whole numbers, `EnvStringbool` for booleans.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { string, type PipeSchema } from '@fuzdev/fuz_schema/schema.ts';
|
|
11
|
+
import '../sensitivity.js';
|
|
12
|
+
/** Options of `env_integer`. */
|
|
13
|
+
export interface EnvIntegerOptions {
|
|
14
|
+
/** The least value accepted, default `0`. */
|
|
15
|
+
min?: number;
|
|
16
|
+
/** The greatest value accepted, default `Number.MAX_SAFE_INTEGER`. */
|
|
17
|
+
max?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A whole number spelled in decimal digits, read the way the Rust spine reads
|
|
21
|
+
* one (`value.trim().parse::<u64>()`): trimmed of Unicode `White_Space` (the
|
|
22
|
+
* set Rust's `trim` strips, not `String.prototype.trim`'s), then decimal
|
|
23
|
+
* digits after at most one leading `+`, so a blank value, a `-`, a fraction,
|
|
24
|
+
* an exponent (`5e3`), and hex (`0x1F90`) are refused, and `+80` and leading
|
|
25
|
+
* zeros (`00080`) are not. The number must be a safe integer within `min` and
|
|
26
|
+
* `max`.
|
|
27
|
+
*
|
|
28
|
+
* @param options - the bounds, default `0` to `Number.MAX_SAFE_INTEGER`
|
|
29
|
+
*/
|
|
30
|
+
export declare const env_integer: (options?: EnvIntegerOptions) => PipeSchema<number, typeof string>;
|
|
31
|
+
/**
|
|
32
|
+
* A boolean spelled as a word, matched case-insensitively and not trimmed:
|
|
33
|
+
* `true`, `1`, `yes`, `on`, `y`, or `enabled` for `true`, and `false`, `0`,
|
|
34
|
+
* `no`, `off`, `n`, or `disabled` for `false`. Anything else is refused,
|
|
35
|
+
* `''` and `' true'` included, so a typo doesn't silently flip a feature.
|
|
36
|
+
*
|
|
37
|
+
* The set and the case rule of Zod's `z.stringbool()` defaults, and the twin
|
|
38
|
+
* of the Rust spine's `parse_stringbool`.
|
|
39
|
+
*/
|
|
40
|
+
export declare const EnvStringbool: PipeSchema<boolean, typeof string>;
|
|
41
|
+
//# sourceMappingURL=env_schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env_schemas.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/env/env_schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAON,MAAM,EAEN,KAAK,UAAU,EACf,MAAM,8BAA8B,CAAC;AAGtC,OAAO,mBAAmB,CAAC;AAE3B,gCAAgC;AAChC,MAAM,WAAW,iBAAiB;IACjC,6CAA6C;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAeD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,iBAAiB,KAAG,UAAU,CAAC,MAAM,EAAE,OAAO,MAAM,CAMxF,CAAC;AAmBH;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,MAAM,CAO5D,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@fuzdev/fuz_schema` schemas for env var values, matching the Rust spine's
|
|
3
|
+
* readers of the same vars.
|
|
4
|
+
*
|
|
5
|
+
* An env value is a string, so these take a string and output the value it
|
|
6
|
+
* spells: `env_integer` for whole numbers, `EnvStringbool` for booleans.
|
|
7
|
+
*
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { check, max_value, min_value, pipe, regex, safe_integer, string, transform } from '@fuzdev/fuz_schema/schema.ts';
|
|
11
|
+
// declares `sensitivity` on fuz_schema's `SchemaMeta`, for consumers marking env fields
|
|
12
|
+
import '../sensitivity.js';
|
|
13
|
+
// Unicode `White_Space`, the set Rust's `str::trim` strips (`char::is_whitespace`);
|
|
14
|
+
// `String.prototype.trim` differs, stripping U+FEFF and keeping U+0085
|
|
15
|
+
const WHITE_SPACE_EDGES = /^[\t\n\v\f\r \u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]+|[\t\n\v\f\r \u0085\u00A0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]+$/g;
|
|
16
|
+
// the trimmed value as a number, when it is decimal digits after at most one `+`
|
|
17
|
+
const EnvDigits = pipe(string, transform((v) => v.replace(WHITE_SPACE_EDGES, '')), regex(/^\+?\d+$/, 'decimal digits'), transform(Number));
|
|
18
|
+
/**
|
|
19
|
+
* A whole number spelled in decimal digits, read the way the Rust spine reads
|
|
20
|
+
* one (`value.trim().parse::<u64>()`): trimmed of Unicode `White_Space` (the
|
|
21
|
+
* set Rust's `trim` strips, not `String.prototype.trim`'s), then decimal
|
|
22
|
+
* digits after at most one leading `+`, so a blank value, a `-`, a fraction,
|
|
23
|
+
* an exponent (`5e3`), and hex (`0x1F90`) are refused, and `+80` and leading
|
|
24
|
+
* zeros (`00080`) are not. The number must be a safe integer within `min` and
|
|
25
|
+
* `max`.
|
|
26
|
+
*
|
|
27
|
+
* @param options - the bounds, default `0` to `Number.MAX_SAFE_INTEGER`
|
|
28
|
+
*/
|
|
29
|
+
export const env_integer = (options) => pipe(EnvDigits, safe_integer, min_value(options?.min ?? 0), max_value(options?.max ?? Number.MAX_SAFE_INTEGER));
|
|
30
|
+
// the recognized spellings, lowercase, as Zod's `z.stringbool()` defaults and
|
|
31
|
+
// the Rust spine's `parse_stringbool` have them
|
|
32
|
+
const STRINGBOOL_VALUES = new Map([
|
|
33
|
+
['true', true],
|
|
34
|
+
['1', true],
|
|
35
|
+
['yes', true],
|
|
36
|
+
['on', true],
|
|
37
|
+
['y', true],
|
|
38
|
+
['enabled', true],
|
|
39
|
+
['false', false],
|
|
40
|
+
['0', false],
|
|
41
|
+
['no', false],
|
|
42
|
+
['off', false],
|
|
43
|
+
['n', false],
|
|
44
|
+
['disabled', false]
|
|
45
|
+
]);
|
|
46
|
+
/**
|
|
47
|
+
* A boolean spelled as a word, matched case-insensitively and not trimmed:
|
|
48
|
+
* `true`, `1`, `yes`, `on`, `y`, or `enabled` for `true`, and `false`, `0`,
|
|
49
|
+
* `no`, `off`, `n`, or `disabled` for `false`. Anything else is refused,
|
|
50
|
+
* `''` and `' true'` included, so a typo doesn't silently flip a feature.
|
|
51
|
+
*
|
|
52
|
+
* The set and the case rule of Zod's `z.stringbool()` defaults, and the twin
|
|
53
|
+
* of the Rust spine's `parse_stringbool`.
|
|
54
|
+
*/
|
|
55
|
+
export const EnvStringbool = pipe(string, check((v) => STRINGBOOL_VALUES.has(v.toLowerCase()), 'true|1|yes|on|y|enabled or false|0|no|off|n|disabled'), transform((v) => STRINGBOOL_VALUES.get(v.toLowerCase())));
|
package/dist/env/load.d.ts
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generic environment loading from
|
|
2
|
+
* Generic environment loading from `@fuzdev/fuz_schema` object schemas.
|
|
3
3
|
*
|
|
4
|
-
* Provides `load_env
|
|
5
|
-
* Apps handle error messages themselves
|
|
4
|
+
* Provides `load_env`, which reads each key of an object schema with a
|
|
5
|
+
* getter and validates the values. Apps handle error messages themselves
|
|
6
|
+
* (they're always app-specific).
|
|
6
7
|
*
|
|
7
8
|
* @module
|
|
8
9
|
*/
|
|
9
|
-
import {
|
|
10
|
+
import { type Infer, type Schema, type SchemaIssue } from '@fuzdev/fuz_schema/schema.ts';
|
|
10
11
|
/**
|
|
11
12
|
* Error thrown when environment validation fails.
|
|
12
13
|
*
|
|
13
14
|
* Contains structured information for apps to format their own error messages.
|
|
14
15
|
*/
|
|
15
16
|
export declare class EnvValidationError extends Error {
|
|
16
|
-
/** The raw env values that were read
|
|
17
|
+
/** The raw env values that were read, every key of the schema, unset ones as `undefined`. */
|
|
17
18
|
readonly raw: Record<string, string | undefined>;
|
|
18
|
-
/** The
|
|
19
|
-
readonly
|
|
19
|
+
/** The validation issues, which hold no env value, only the keys in their paths. */
|
|
20
|
+
readonly issues: Array<SchemaIssue>;
|
|
20
21
|
/** True if every env var was undefined (nothing loaded). */
|
|
21
22
|
readonly all_undefined: boolean;
|
|
22
|
-
constructor(raw: Record<string, string | undefined>,
|
|
23
|
+
constructor(raw: Record<string, string | undefined>, issues: Array<SchemaIssue>);
|
|
23
24
|
/**
|
|
24
|
-
* Format
|
|
25
|
+
* Format the validation issues as human-readable strings.
|
|
25
26
|
*
|
|
26
|
-
* @returns array of formatted issue strings like `"PORT:
|
|
27
|
+
* @returns array of formatted issue strings like `"PORT: expected decimal digits, received string"`
|
|
27
28
|
*/
|
|
28
29
|
format_issues(): Array<string>;
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
32
|
* Log formatted env validation issues to stderr.
|
|
32
33
|
*
|
|
33
|
-
* Handles the common case: labels each
|
|
34
|
+
* Handles the common case: labels each issue with an optional prefix.
|
|
34
35
|
* Callers who want app-specific "getting started" instructions should check
|
|
35
36
|
* `error.all_undefined` before calling this.
|
|
36
37
|
*
|
|
@@ -39,12 +40,19 @@ export declare class EnvValidationError extends Error {
|
|
|
39
40
|
*/
|
|
40
41
|
export declare const log_env_validation_error: (error: EnvValidationError, label?: string) => void;
|
|
41
42
|
/**
|
|
42
|
-
* Load and validate env vars against a
|
|
43
|
+
* Load and validate env vars against a `@fuzdev/fuz_schema` object schema.
|
|
43
44
|
*
|
|
44
|
-
*
|
|
45
|
+
* Reads every key of the schema's entries with `get_env`. An unset var is
|
|
46
|
+
* left out of the object parsed, not given as `undefined`, so it reads as a
|
|
47
|
+
* missing key: a `pipe` that starts with an `optional` runs none of its
|
|
48
|
+
* steps for it, as it would for an absent key of any object. `raw` still
|
|
49
|
+
* lists it, as `undefined`.
|
|
50
|
+
*
|
|
51
|
+
* @param schema - an object schema (`object`, `strip_object`, ..., under any wrappers) of the expected env vars
|
|
45
52
|
* @param get_env - function to read an env var by key
|
|
46
53
|
* @returns validated env object
|
|
47
|
-
* @throws
|
|
54
|
+
* @throws TypeError if `schema` is not an object schema
|
|
55
|
+
* @throws EnvValidationError if validation fails
|
|
48
56
|
*/
|
|
49
|
-
export declare const load_env: <T extends
|
|
57
|
+
export declare const load_env: <T extends Schema<Record<string, unknown>, any>>(schema: T, get_env: (key: string) => string | undefined) => Infer<T>;
|
|
50
58
|
//# sourceMappingURL=load.d.ts.map
|
package/dist/env/load.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/env/load.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/env/load.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAGN,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,MAAM,8BAA8B,CAAC;AAEtC;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC5C,6FAA6F;IAC7F,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACjD,oFAAoF;IACpF,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IACpC,4DAA4D;IAC5D,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;gBAEpB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC;IAO/E;;;;OAIG;IACH,aAAa,IAAI,KAAK,CAAC,MAAM,CAAC;CAG9B;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,GAAI,OAAO,kBAAkB,EAAE,QAAQ,MAAM,KAAG,IAUpF,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,EACtE,QAAQ,CAAC,EACT,SAAS,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,KAC1C,KAAK,CAAC,CAAC,CAkBT,CAAC"}
|
package/dist/env/load.js
CHANGED
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generic environment loading from
|
|
2
|
+
* Generic environment loading from `@fuzdev/fuz_schema` object schemas.
|
|
3
3
|
*
|
|
4
|
-
* Provides `load_env
|
|
5
|
-
* Apps handle error messages themselves
|
|
4
|
+
* Provides `load_env`, which reads each key of an object schema with a
|
|
5
|
+
* getter and validates the values. Apps handle error messages themselves
|
|
6
|
+
* (they're always app-specific).
|
|
6
7
|
*
|
|
7
8
|
* @module
|
|
8
9
|
*/
|
|
9
|
-
import {
|
|
10
|
+
import { get_schema_entries } from '@fuzdev/fuz_schema/introspect.ts';
|
|
11
|
+
import { format_issue, parse } from '@fuzdev/fuz_schema/schema.ts';
|
|
10
12
|
/**
|
|
11
13
|
* Error thrown when environment validation fails.
|
|
12
14
|
*
|
|
13
15
|
* Contains structured information for apps to format their own error messages.
|
|
14
16
|
*/
|
|
15
17
|
export class EnvValidationError extends Error {
|
|
16
|
-
/** The raw env values that were read
|
|
18
|
+
/** The raw env values that were read, every key of the schema, unset ones as `undefined`. */
|
|
17
19
|
raw;
|
|
18
|
-
/** The
|
|
19
|
-
|
|
20
|
+
/** The validation issues, which hold no env value, only the keys in their paths. */
|
|
21
|
+
issues;
|
|
20
22
|
/** True if every env var was undefined (nothing loaded). */
|
|
21
23
|
all_undefined;
|
|
22
|
-
constructor(raw,
|
|
24
|
+
constructor(raw, issues) {
|
|
23
25
|
super('Environment validation failed');
|
|
24
26
|
this.raw = raw;
|
|
25
|
-
this.
|
|
27
|
+
this.issues = issues;
|
|
26
28
|
this.all_undefined = Object.values(raw).every((v) => v === undefined);
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
|
-
* Format
|
|
31
|
+
* Format the validation issues as human-readable strings.
|
|
30
32
|
*
|
|
31
|
-
* @returns array of formatted issue strings like `"PORT:
|
|
33
|
+
* @returns array of formatted issue strings like `"PORT: expected decimal digits, received string"`
|
|
32
34
|
*/
|
|
33
35
|
format_issues() {
|
|
34
|
-
return this.
|
|
36
|
+
return this.issues.map(format_issue);
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
/**
|
|
38
40
|
* Log formatted env validation issues to stderr.
|
|
39
41
|
*
|
|
40
|
-
* Handles the common case: labels each
|
|
42
|
+
* Handles the common case: labels each issue with an optional prefix.
|
|
41
43
|
* Callers who want app-specific "getting started" instructions should check
|
|
42
44
|
* `error.all_undefined` before calling this.
|
|
43
45
|
*
|
|
@@ -57,21 +59,35 @@ export const log_env_validation_error = (error, label) => {
|
|
|
57
59
|
}
|
|
58
60
|
};
|
|
59
61
|
/**
|
|
60
|
-
* Load and validate env vars against a
|
|
62
|
+
* Load and validate env vars against a `@fuzdev/fuz_schema` object schema.
|
|
61
63
|
*
|
|
62
|
-
*
|
|
64
|
+
* Reads every key of the schema's entries with `get_env`. An unset var is
|
|
65
|
+
* left out of the object parsed, not given as `undefined`, so it reads as a
|
|
66
|
+
* missing key: a `pipe` that starts with an `optional` runs none of its
|
|
67
|
+
* steps for it, as it would for an absent key of any object. `raw` still
|
|
68
|
+
* lists it, as `undefined`.
|
|
69
|
+
*
|
|
70
|
+
* @param schema - an object schema (`object`, `strip_object`, ..., under any wrappers) of the expected env vars
|
|
63
71
|
* @param get_env - function to read an env var by key
|
|
64
72
|
* @returns validated env object
|
|
65
|
-
* @throws
|
|
73
|
+
* @throws TypeError if `schema` is not an object schema
|
|
74
|
+
* @throws EnvValidationError if validation fails
|
|
66
75
|
*/
|
|
67
76
|
export const load_env = (schema, get_env) => {
|
|
77
|
+
const entries = get_schema_entries(schema);
|
|
78
|
+
if (!entries)
|
|
79
|
+
throw new TypeError(`load_env requires an object schema, got '${schema.kind}'`);
|
|
68
80
|
const raw = {};
|
|
69
|
-
|
|
70
|
-
|
|
81
|
+
const present = {};
|
|
82
|
+
for (const key in entries) {
|
|
83
|
+
const value = get_env(key);
|
|
84
|
+
raw[key] = value;
|
|
85
|
+
if (value !== undefined)
|
|
86
|
+
present[key] = value;
|
|
71
87
|
}
|
|
72
|
-
const result = schema
|
|
73
|
-
if (!result.
|
|
74
|
-
throw new EnvValidationError(raw, result.
|
|
88
|
+
const result = parse(schema, present);
|
|
89
|
+
if (!result.ok) {
|
|
90
|
+
throw new EnvValidationError(raw, result.issues);
|
|
75
91
|
}
|
|
76
|
-
return result.
|
|
92
|
+
return result.value;
|
|
77
93
|
};
|
package/dist/http/surface.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
9
|
+
import { type AnySchema } from '@fuzdev/fuz_schema/schema.ts';
|
|
10
10
|
import type { EventSpec } from '../realtime/sse.js';
|
|
11
11
|
import type { MiddlewareSpec } from './middleware_spec.js';
|
|
12
12
|
import type { RouteSpec } from './route_spec.js';
|
|
@@ -15,7 +15,7 @@ import type { RateLimitKey, RouteErrorSchemas } from './error_schemas.js';
|
|
|
15
15
|
import type { RpcAction } from '../actions/action_types.js';
|
|
16
16
|
import type { ActionKind } from '../actions/action_spec.js';
|
|
17
17
|
import type { ResolvedWsEndpointSpec } from '../actions/ws_endpoint_spec.js';
|
|
18
|
-
import type
|
|
18
|
+
import { type Sensitivity } from '../sensitivity.js';
|
|
19
19
|
/** A route in the generated attack surface (JSON-serializable). */
|
|
20
20
|
export interface AppSurfaceRoute {
|
|
21
21
|
method: string;
|
|
@@ -62,7 +62,7 @@ export interface AppSurfaceMiddleware {
|
|
|
62
62
|
export interface AppSurfaceEnv {
|
|
63
63
|
name: string;
|
|
64
64
|
description: string;
|
|
65
|
-
/** Sensitivity level from
|
|
65
|
+
/** Sensitivity level from `meta(schema, {sensitivity})`. `null` when not sensitive. */
|
|
66
66
|
sensitivity: Sensitivity | null;
|
|
67
67
|
has_default: boolean;
|
|
68
68
|
optional: boolean;
|
|
@@ -178,7 +178,8 @@ export interface RpcEndpointSpec {
|
|
|
178
178
|
export interface GenerateAppSurfaceOptions {
|
|
179
179
|
route_specs: Array<RouteSpec>;
|
|
180
180
|
middleware_specs: Array<MiddlewareSpec>;
|
|
181
|
-
|
|
181
|
+
/** A `@fuzdev/fuz_schema` object schema of the app's env vars, such as `BaseServerEnv`. */
|
|
182
|
+
env_schema?: AnySchema;
|
|
182
183
|
event_specs?: Array<EventSpec>;
|
|
183
184
|
rpc_endpoints?: Array<RpcEndpointSpec>;
|
|
184
185
|
/**
|
|
@@ -198,13 +199,16 @@ export interface GenerateAppSurfaceOptions {
|
|
|
198
199
|
*/
|
|
199
200
|
export declare const collect_middleware_errors: (middleware: Array<MiddlewareSpec>, route_path: string) => RouteErrorSchemas | null;
|
|
200
201
|
/**
|
|
201
|
-
* Convert env schema to surface entries
|
|
202
|
-
*
|
|
203
|
-
* the
|
|
202
|
+
* Convert a `@fuzdev/fuz_schema` env schema to surface entries, one per
|
|
203
|
+
* entry in order, reading each field's `meta`: the description from its
|
|
204
|
+
* layers (`get_schema_fields`), and the fail-safe `find_schema_sensitivity`
|
|
205
|
+
* for secrets. `optional` and `has_default` are what a parse of `undefined`
|
|
206
|
+
* does: accepted, and accepted with a value other than `undefined`.
|
|
204
207
|
*
|
|
205
|
-
* @param schema -
|
|
208
|
+
* @param schema - an object schema (under any wrappers) with `meta` on its fields
|
|
209
|
+
* @throws TypeError if `schema` is not an object schema
|
|
206
210
|
*/
|
|
207
|
-
export declare const env_schema_to_surface: (schema:
|
|
211
|
+
export declare const env_schema_to_surface: (schema: AnySchema) => Array<AppSurfaceEnv>;
|
|
208
212
|
/**
|
|
209
213
|
* Convert SSE event specs to surface entries.
|
|
210
214
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/surface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"surface.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/http/surface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,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AAK,CAAC,sBAAsB,CAAC,CAAC;CAC5C;AAED,yDAAyD;AACzD,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;CAC1B;AAED,0CAA0C;AAC1C,MAAM,WAAW,yBAAyB;IACzC,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC9B,gBAAgB,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IACxC,2FAA2F;IAC3F,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC/B,aAAa,CAAC,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;IACvC;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,aAAa,CAAC,sBAAsB,CAAC,CAAC;CACrD;AAID;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GACrC,YAAY,KAAK,CAAC,cAAc,CAAC,EACjC,YAAY,MAAM,KAChB,iBAAiB,GAAG,IAQtB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,GAAI,QAAQ,SAAS,KAAG,KAAK,CAAC,aAAa,CAc5E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,aAAa,KAAK,CAAC,SAAS,CAAC,KAAG,KAAK,CAAC,eAAe,CAOtF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,yBAAyB,KAAG,UA4HzE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,SAAS,yBAAyB,KAAG,cAS5E,CAAC"}
|
package/dist/http/surface.js
CHANGED
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
|
+
import { get_schema_entries, get_schema_fields } from '@fuzdev/fuz_schema/introspect.ts';
|
|
10
|
+
import { parse } from '@fuzdev/fuz_schema/schema.ts';
|
|
9
11
|
import { z } from 'zod';
|
|
10
12
|
import { schema_to_surface, middleware_spec_applies, merge_error_schemas, is_null_schema, is_strict_object_schema } from './schema_helpers.js';
|
|
11
|
-
import {
|
|
13
|
+
import { find_schema_sensitivity } from '../sensitivity.js';
|
|
12
14
|
// --- Surface generation ---
|
|
13
15
|
/**
|
|
14
16
|
* Collect error schemas from all middleware that applies to a route path.
|
|
@@ -25,27 +27,29 @@ export const collect_middleware_errors = (middleware, route_path) => {
|
|
|
25
27
|
return Object.keys(errors).length > 0 ? errors : null;
|
|
26
28
|
};
|
|
27
29
|
/**
|
|
28
|
-
* Convert env schema to surface entries
|
|
29
|
-
*
|
|
30
|
-
* the
|
|
30
|
+
* Convert a `@fuzdev/fuz_schema` env schema to surface entries, one per
|
|
31
|
+
* entry in order, reading each field's `meta`: the description from its
|
|
32
|
+
* layers (`get_schema_fields`), and the fail-safe `find_schema_sensitivity`
|
|
33
|
+
* for secrets. `optional` and `has_default` are what a parse of `undefined`
|
|
34
|
+
* does: accepted, and accepted with a value other than `undefined`.
|
|
31
35
|
*
|
|
32
|
-
* @param schema -
|
|
36
|
+
* @param schema - an object schema (under any wrappers) with `meta` on its fields
|
|
37
|
+
* @throws TypeError if `schema` is not an object schema
|
|
33
38
|
*/
|
|
34
39
|
export const env_schema_to_surface = (schema) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const field = field_schema;
|
|
38
|
-
const undef_result = field.safeParse(undefined);
|
|
39
|
-
entries.push({
|
|
40
|
-
name,
|
|
41
|
-
// read through wrappers — a `.meta()` under `.optional()` is not on the outer schema
|
|
42
|
-
description: schema_meta_value(field, 'description') ?? '',
|
|
43
|
-
sensitivity: schema_sensitivity(field) ?? null,
|
|
44
|
-
has_default: undef_result.success && undef_result.data !== undefined,
|
|
45
|
-
optional: undef_result.success
|
|
46
|
-
});
|
|
40
|
+
if (!get_schema_entries(schema)) {
|
|
41
|
+
throw new TypeError(`env_schema must be an object schema, got '${schema.kind}'`);
|
|
47
42
|
}
|
|
48
|
-
return
|
|
43
|
+
return get_schema_fields(schema).map((field) => {
|
|
44
|
+
const undef_result = parse(field.schema, undefined);
|
|
45
|
+
return {
|
|
46
|
+
name: field.name,
|
|
47
|
+
description: field.description ?? '',
|
|
48
|
+
sensitivity: find_schema_sensitivity(field.schema) ?? null,
|
|
49
|
+
has_default: undef_result.ok && undef_result.value !== undefined,
|
|
50
|
+
optional: undef_result.ok
|
|
51
|
+
};
|
|
52
|
+
});
|
|
49
53
|
};
|
|
50
54
|
/**
|
|
51
55
|
* Convert SSE event specs to surface entries.
|
package/dist/schema_meta.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared Zod `.meta()` conventions for fuz_app schemas.
|
|
3
3
|
*
|
|
4
|
-
* Cross-cutting metadata shape used by
|
|
5
|
-
* surface generation, and test helpers.
|
|
4
|
+
* Cross-cutting metadata shape used by auth and action input schemas,
|
|
5
|
+
* surface generation, and test helpers. The env schemas are
|
|
6
|
+
* `@fuzdev/fuz_schema` and carry the same keys in its `meta`
|
|
7
|
+
* (`sensitivity.ts`, `find_schema_sensitivity`).
|
|
6
8
|
*
|
|
7
9
|
* @module
|
|
8
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema_meta.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/schema_meta.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"schema_meta.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/schema_meta.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,mEAAmE;AACnE,MAAM,WAAW,eAAe;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,WAAW,C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ape used by
|
|
5
|
-
* surface generation, and test helpers.
|
|
4
|
+
* Cross-cutting metadata shape used by auth and action input schemas,
|
|
5
|
+
* surface generation, and test helpers. The env schemas are
|
|
6
|
+
* `@fuzdev/fuz_schema` and carry the same keys in its `meta`
|
|
7
|
+
* (`sensitivity.ts`, `find_schema_sensitivity`).
|
|
6
8
|
*
|
|
7
9
|
* @module
|
|
8
10
|
*/
|
package/dist/sensitivity.d.ts
CHANGED
|
@@ -3,10 +3,19 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Used by env schemas and action input schemas to control masking/redaction
|
|
5
5
|
* in startup logs, surface explorers, and test output, and to keep values
|
|
6
|
-
* out of URLs.
|
|
6
|
+
* out of URLs. A Zod schema declares it with `.meta({sensitivity})`
|
|
7
|
+
* (`SchemaFieldMeta`, read by `schema_sensitivity`); a `@fuzdev/fuz_schema`
|
|
8
|
+
* schema with `meta(schema, {sensitivity})`, the key this module adds to
|
|
9
|
+
* fuz_schema's `SchemaMeta` by declaration merging, read by
|
|
10
|
+
* `find_schema_sensitivity`. `server/env.ts` and `env/env_schemas.ts` import
|
|
11
|
+
* this module for the declaration, so a consumer of either has the key; a
|
|
12
|
+
* module that imports neither and marks a fuz_schema field adds
|
|
13
|
+
* `import type {} from '@fuzdev/fuz_app/sensitivity.ts';`, which brings the
|
|
14
|
+
* declaration in without an unused binding.
|
|
7
15
|
*
|
|
8
16
|
* @module
|
|
9
17
|
*/
|
|
18
|
+
import type { AnySchema } from '@fuzdev/fuz_schema/schema.ts';
|
|
10
19
|
/**
|
|
11
20
|
* Sensitivity level for a schema field.
|
|
12
21
|
*
|
|
@@ -18,4 +27,28 @@
|
|
|
18
27
|
* logs or UI
|
|
19
28
|
*/
|
|
20
29
|
export type Sensitivity = 'secret' | 'personal';
|
|
30
|
+
declare module '@fuzdev/fuz_schema/meta.ts' {
|
|
31
|
+
interface SchemaMeta {
|
|
32
|
+
/**
|
|
33
|
+
* Sensitivity level (`Sensitivity`): `'secret'` masks the value,
|
|
34
|
+
* `'personal'` only keeps it out of URLs. Read fail-safe from every
|
|
35
|
+
* schema the field reaches (`find_schema_sensitivity`).
|
|
36
|
+
*/
|
|
37
|
+
sensitivity?: Sensitivity;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The strongest `sensitivity` declared on any schema a `@fuzdev/fuz_schema`
|
|
42
|
+
* field reaches — `'secret'` over `'personal'` — the fuz_schema twin of
|
|
43
|
+
* `schema_sensitivity`. Fail-safe: `find_schema_meta` reads every wrapper,
|
|
44
|
+
* every schema and action of a `pipe` (not only its first), every option of a
|
|
45
|
+
* union, and a `lazy`'s schema, so a secret stays masked however the field is
|
|
46
|
+
* wrapped, `message` included, which carries the metadata of the schema it
|
|
47
|
+
* was given over. It stops at structural schemas — an object's entries and an
|
|
48
|
+
* array's items carry their own.
|
|
49
|
+
*
|
|
50
|
+
* @param schema - a field schema, possibly wrapped
|
|
51
|
+
* @returns the strongest level any reachable schema declares, else `undefined`
|
|
52
|
+
*/
|
|
53
|
+
export declare const find_schema_sensitivity: (schema: AnySchema) => Sensitivity | undefined;
|
|
21
54
|
//# sourceMappingURL=sensitivity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sensitivity.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/sensitivity.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sensitivity.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/sensitivity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAI9D;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEhD,OAAO,QAAQ,4BAA4B,CAAC;IAC3C,UAAU,UAAU;QACnB;;;;WAIG;QACH,WAAW,CAAC,EAAE,WAAW,CAAC;KAC1B;CACD;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB,GAAI,QAAQ,SAAS,KAAG,WAAW,GAAG,SAOzE,CAAC"}
|
package/dist/sensitivity.js
CHANGED
|
@@ -3,8 +3,38 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Used by env schemas and action input schemas to control masking/redaction
|
|
5
5
|
* in startup logs, surface explorers, and test output, and to keep values
|
|
6
|
-
* out of URLs.
|
|
6
|
+
* out of URLs. A Zod schema declares it with `.meta({sensitivity})`
|
|
7
|
+
* (`SchemaFieldMeta`, read by `schema_sensitivity`); a `@fuzdev/fuz_schema`
|
|
8
|
+
* schema with `meta(schema, {sensitivity})`, the key this module adds to
|
|
9
|
+
* fuz_schema's `SchemaMeta` by declaration merging, read by
|
|
10
|
+
* `find_schema_sensitivity`. `server/env.ts` and `env/env_schemas.ts` import
|
|
11
|
+
* this module for the declaration, so a consumer of either has the key; a
|
|
12
|
+
* module that imports neither and marks a fuz_schema field adds
|
|
13
|
+
* `import type {} from '@fuzdev/fuz_app/sensitivity.ts';`, which brings the
|
|
14
|
+
* declaration in without an unused binding.
|
|
7
15
|
*
|
|
8
16
|
* @module
|
|
9
17
|
*/
|
|
10
|
-
|
|
18
|
+
import { find_schema_meta } from '@fuzdev/fuz_schema/introspect.ts';
|
|
19
|
+
/**
|
|
20
|
+
* The strongest `sensitivity` declared on any schema a `@fuzdev/fuz_schema`
|
|
21
|
+
* field reaches — `'secret'` over `'personal'` — the fuz_schema twin of
|
|
22
|
+
* `schema_sensitivity`. Fail-safe: `find_schema_meta` reads every wrapper,
|
|
23
|
+
* every schema and action of a `pipe` (not only its first), every option of a
|
|
24
|
+
* union, and a `lazy`'s schema, so a secret stays masked however the field is
|
|
25
|
+
* wrapped, `message` included, which carries the metadata of the schema it
|
|
26
|
+
* was given over. It stops at structural schemas — an object's entries and an
|
|
27
|
+
* array's items carry their own.
|
|
28
|
+
*
|
|
29
|
+
* @param schema - a field schema, possibly wrapped
|
|
30
|
+
* @returns the strongest level any reachable schema declares, else `undefined`
|
|
31
|
+
*/
|
|
32
|
+
export const find_schema_sensitivity = (schema) => {
|
|
33
|
+
let found;
|
|
34
|
+
for (const sensitivity of find_schema_meta(schema, 'sensitivity')) {
|
|
35
|
+
if (sensitivity === 'secret')
|
|
36
|
+
return 'secret';
|
|
37
|
+
found = sensitivity;
|
|
38
|
+
}
|
|
39
|
+
return found;
|
|
40
|
+
};
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { Hono, type Context } from 'hono';
|
|
11
11
|
import type { UpgradeWebSocket } from 'hono/ws';
|
|
12
|
-
import {
|
|
12
|
+
import type { AnySchema } from '@fuzdev/fuz_schema/schema.ts';
|
|
13
13
|
import { type SessionOptions, type SessionCookieOptions } from '../auth/session_cookie.js';
|
|
14
14
|
import type { BootstrapAccountSuccess } from '../auth/bootstrap_account.js';
|
|
15
15
|
import type { EventSpec } from '../realtime/sse.js';
|
|
@@ -383,11 +383,12 @@ export interface AppServerOptions {
|
|
|
383
383
|
*/
|
|
384
384
|
ws_endpoints?: ReadonlyArray<WsEndpointSpec> | ((context: AppServerContext) => ReadonlyArray<WsEndpointSpec>);
|
|
385
385
|
/**
|
|
386
|
-
* Env schema for surface generation
|
|
387
|
-
* pass an extended schema
|
|
388
|
-
* when the consumer
|
|
386
|
+
* Env schema for surface generation, a `@fuzdev/fuz_schema` object
|
|
387
|
+
* schema. Defaults to `BaseServerEnv` — pass an extended schema
|
|
388
|
+
* (typically `object({...BaseServerEnv.def, ...})`) when the consumer
|
|
389
|
+
* adds app-specific env vars.
|
|
389
390
|
*/
|
|
390
|
-
env_schema?:
|
|
391
|
+
env_schema?: AnySchema;
|
|
391
392
|
/** Middleware applied after routes, before static serving. Included in surface. */
|
|
392
393
|
post_route_middleware?: Array<MiddlewareSpec>;
|
|
393
394
|
/** Static file serving. Omit if not serving static files. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app_server.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/app_server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,KAAK,OAAO,EAA0B,MAAM,MAAM,CAAC;AAElE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"app_server.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/app_server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,KAAK,OAAO,EAA0B,MAAM,MAAM,CAAC;AAElE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAG9D,OAAO,EAEN,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAIN,KAAK,WAAW,EAChB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACN,WAAW,EAMX,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAA4B,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGhF,OAAO,EAEN,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,MA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B;IACpC,2DAA2D;IAC3D,IAAI,EAAE,eAAe,CAAC;IACtB,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC,uBAAuB,EAAE,WAAW,GAAG,IAAI,CAAC,CAAC;IAC9D;;;OAGG;IACH,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;CAC1B;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,GACjC,SAAS,IAAI,CAAC,gBAAgB,EAAE,uBAAuB,GAAG,eAAe,CAAC,KACxE,oBAkBF,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACtC,6EAA6E;IAC7E,cAAc,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,SAAS,CAAC;IAC1D,2CAA2C;IAC3C,iBAAiB,EAAE,eAAe,CAAC;IACnC,2DAA2D;IAC3D,aAAa,EAAE,MAAM,CAAC,uBAAuB,EAAE,WAAW,GAAG,IAAI,CAAC,CAAC;IACnE,uFAAuF;IACvF,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACzC;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,GACtC,OAAO,sBAAsB,KAC3B,KAAK,CAAC,oBAAoB,CA0D5B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,iBAAiB,GAAU,SAAS,gBAAgB,KAAG,OAAO,CAAC,SAAS,CAQpF,CAAC"}
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { Hono } from 'hono';
|
|
11
11
|
import { logger } from 'hono/logger';
|
|
12
|
-
import { z } from 'zod';
|
|
13
12
|
import { session_cookie_options } from '../auth/session_cookie.js';
|
|
14
13
|
import { create_audit_log_sse, create_sse_connection_closer, audit_log_event_specs } from '../realtime/audit_log_sse.js';
|
|
15
14
|
import { BaseServerEnv } from './env.js';
|
package/dist/server/env.d.ts
CHANGED
|
@@ -1,47 +1,69 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Base server environment schema and validation.
|
|
3
3
|
*
|
|
4
|
-
* Provides `BaseServerEnv` — a shared
|
|
5
|
-
* that apps can use directly or extend with
|
|
4
|
+
* Provides `BaseServerEnv` — a shared `@fuzdev/fuz_schema` object schema for
|
|
5
|
+
* common server env vars that apps can use directly or extend with
|
|
6
|
+
* app-specific fields.
|
|
6
7
|
*
|
|
7
|
-
* Generic env loading lives in `env/load.ts
|
|
8
|
+
* Generic env loading lives in `env/load.ts`, and the value schemas
|
|
9
|
+
* (`env_integer`, `EnvStringbool`) in `env/env_schemas.ts`.
|
|
8
10
|
*
|
|
9
11
|
* @module
|
|
10
12
|
*/
|
|
11
|
-
import {
|
|
13
|
+
import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
|
|
12
14
|
import type { Result } from '@fuzdev/fuz_util/result.ts';
|
|
13
15
|
import { type Keyring } from '../auth/keyring.js';
|
|
16
|
+
import '../sensitivity.js';
|
|
14
17
|
/**
|
|
15
|
-
* Base
|
|
18
|
+
* Base schema for server environment variables, a strict `object`.
|
|
16
19
|
*
|
|
17
20
|
* Declares only what the spine reads — server config, database and its pool
|
|
18
21
|
* checkout bounds, cookie keys, allowed origins and the wildcard opt-in, and
|
|
19
22
|
* the bootstrap token path — matching the Rust spine's `BaseServerEnv`. The
|
|
20
|
-
* numeric vars
|
|
21
|
-
*
|
|
22
|
-
* both. Anything else (fact storage,
|
|
23
|
-
*
|
|
24
|
-
*
|
|
23
|
+
* numeric vars read as the Rust twin reads them (`env_integer`: trimmed,
|
|
24
|
+
* then decimal digits after at most one `+`, so `5e3` and a blank value are
|
|
25
|
+
* refused on both, as is one out of range). Anything else (fact storage, X-Accel delivery, public
|
|
26
|
+
* URLs) is the app's own var: extend by spreading `def` into a new `object`,
|
|
27
|
+
* `object({...BaseServerEnv.def, MY_VAR: ...})`.
|
|
28
|
+
*
|
|
29
|
+
* Each field's description and `sensitivity` are `meta`, read by
|
|
30
|
+
* `env_schema_to_surface`.
|
|
25
31
|
*/
|
|
26
|
-
export declare const BaseServerEnv:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
32
|
+
export declare const BaseServerEnv: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
33
|
+
SECRET_FUZ_COOKIE_KEYS: string;
|
|
34
|
+
FUZ_ALLOWED_ORIGINS: string;
|
|
35
|
+
NODE_ENV: "development" | "production";
|
|
36
|
+
PORT: number;
|
|
37
|
+
HOST: string;
|
|
38
|
+
DATABASE_URL: string;
|
|
39
|
+
FUZ_ALLOW_ORIGIN_WILDCARDS?: "true" | "false" | undefined;
|
|
40
|
+
FUZ_BOOTSTRAP_TOKEN_PATH?: string | undefined;
|
|
41
|
+
FUZ_DB_CHECKOUT_TIMEOUT_MS?: number | undefined;
|
|
42
|
+
FUZ_DB_AUDIT_CHECKOUT_TIMEOUT_MS?: number | undefined;
|
|
43
|
+
}, {
|
|
44
|
+
SECRET_FUZ_COOKIE_KEYS: string;
|
|
45
|
+
FUZ_ALLOWED_ORIGINS: string;
|
|
46
|
+
NODE_ENV: "development" | "production";
|
|
47
|
+
DATABASE_URL: string;
|
|
48
|
+
FUZ_ALLOW_ORIGIN_WILDCARDS?: "true" | "false" | undefined;
|
|
49
|
+
PORT?: string | undefined;
|
|
50
|
+
HOST?: string | undefined;
|
|
51
|
+
FUZ_BOOTSTRAP_TOKEN_PATH?: string | undefined;
|
|
52
|
+
FUZ_DB_CHECKOUT_TIMEOUT_MS?: string | undefined;
|
|
53
|
+
FUZ_DB_AUDIT_CHECKOUT_TIMEOUT_MS?: string | undefined;
|
|
54
|
+
}, "object", {
|
|
55
|
+
NODE_ENV: import("@fuzdev/fuz_schema/schema.ts").Schema<"development" | "production", "development" | "production", "one_of", readonly ["development", "production"]>;
|
|
56
|
+
PORT: import("@fuzdev/fuz_schema/schema.ts").Schema<number, string | undefined, "with_default", import("@fuzdev/fuz_schema/schema.ts").SchemaDefaultDef<import("@fuzdev/fuz_schema/schema.ts").PipeSchema<number, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>>;
|
|
57
|
+
HOST: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string | undefined, "with_default", import("@fuzdev/fuz_schema/schema.ts").SchemaDefaultDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
58
|
+
DATABASE_URL: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
59
|
+
SECRET_FUZ_COOKIE_KEYS: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
60
|
+
FUZ_ALLOWED_ORIGINS: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
61
|
+
FUZ_ALLOW_ORIGIN_WILDCARDS: import("@fuzdev/fuz_schema/schema.ts").Schema<"true" | "false" | undefined, "true" | "false" | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<"true" | "false", "true" | "false", "one_of", readonly ["true", "false"]>>>;
|
|
62
|
+
FUZ_BOOTSTRAP_TOKEN_PATH: import("@fuzdev/fuz_schema/schema.ts").Schema<string | undefined, string | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
63
|
+
FUZ_DB_CHECKOUT_TIMEOUT_MS: import("@fuzdev/fuz_schema/schema.ts").Schema<number | undefined, string | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").PipeSchema<number, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>>;
|
|
64
|
+
FUZ_DB_AUDIT_CHECKOUT_TIMEOUT_MS: import("@fuzdev/fuz_schema/schema.ts").Schema<number | undefined, string | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").PipeSchema<number, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>>;
|
|
65
|
+
}>;
|
|
66
|
+
export type BaseServerEnv = Infer<typeof BaseServerEnv>;
|
|
45
67
|
/**
|
|
46
68
|
* Validated server env config — the artifacts `create_app_server()` needs.
|
|
47
69
|
*/
|
|
@@ -72,7 +94,7 @@ export interface ServerEnvValidationError {
|
|
|
72
94
|
* bootstrap token path extraction.
|
|
73
95
|
* Returns a Result so callers handle errors their own way (exit, logging, etc).
|
|
74
96
|
*
|
|
75
|
-
* @param env - a loaded and
|
|
97
|
+
* @param env - a loaded and validated `BaseServerEnv`
|
|
76
98
|
* @returns `{ok: true, keyring, allowed_origins, allow_origin_wildcards, bootstrap_token_path}`
|
|
77
99
|
* or `{ok: false, field, errors}`
|
|
78
100
|
*/
|
package/dist/server/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/env.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/server/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EASN,KAAK,KAAK,EACV,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAkB,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAMlE,OAAO,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CxB,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B;;;OAGG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAChC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,KAAK,EAAE,wBAAwB,GAAG,qBAAqB,CAAC;IACxD,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACtB;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,GAC/B,KAAK,aAAa,KAChB,MAAM,CAAC,kBAAkB,EAAE,wBAAwB,CA2BrD,CAAC"}
|
package/dist/server/env.js
CHANGED
|
@@ -1,74 +1,69 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Base server environment schema and validation.
|
|
3
3
|
*
|
|
4
|
-
* Provides `BaseServerEnv` — a shared
|
|
5
|
-
* that apps can use directly or extend with
|
|
4
|
+
* Provides `BaseServerEnv` — a shared `@fuzdev/fuz_schema` object schema for
|
|
5
|
+
* common server env vars that apps can use directly or extend with
|
|
6
|
+
* app-specific fields.
|
|
6
7
|
*
|
|
7
|
-
* Generic env loading lives in `env/load.ts
|
|
8
|
+
* Generic env loading lives in `env/load.ts`, and the value schemas
|
|
9
|
+
* (`env_integer`, `EnvStringbool`) in `env/env_schemas.ts`.
|
|
8
10
|
*
|
|
9
11
|
* @module
|
|
10
12
|
*/
|
|
11
|
-
import {
|
|
13
|
+
import { meta } from '@fuzdev/fuz_schema/meta.ts';
|
|
14
|
+
import { message, min_length, object, one_of, optional, pipe, string, with_default } from '@fuzdev/fuz_schema/schema.ts';
|
|
12
15
|
import { create_keyring } from '../auth/keyring.js';
|
|
13
16
|
import { format_allowed_origins_error, parse_allowed_origins } from '../http/origin.js';
|
|
14
17
|
import { admit_origin_wildcards } from '../http/origin_wildcard.js';
|
|
15
18
|
import { DB_CHECKOUT_TIMEOUT_MAX_MS } from '../db/db_pg.js';
|
|
19
|
+
import { env_integer } from '../env/env_schemas.js';
|
|
20
|
+
// declares `sensitivity` on fuz_schema's `SchemaMeta`, for the fields here and consumers'
|
|
21
|
+
import '../sensitivity.js';
|
|
16
22
|
/**
|
|
17
|
-
* Base
|
|
23
|
+
* Base schema for server environment variables, a strict `object`.
|
|
18
24
|
*
|
|
19
25
|
* Declares only what the spine reads — server config, database and its pool
|
|
20
26
|
* checkout bounds, cookie keys, allowed origins and the wildcard opt-in, and
|
|
21
27
|
* the bootstrap token path — matching the Rust spine's `BaseServerEnv`. The
|
|
22
|
-
* numeric vars
|
|
23
|
-
*
|
|
24
|
-
* both. Anything else (fact storage,
|
|
25
|
-
*
|
|
26
|
-
*
|
|
28
|
+
* numeric vars read as the Rust twin reads them (`env_integer`: trimmed,
|
|
29
|
+
* then decimal digits after at most one `+`, so `5e3` and a blank value are
|
|
30
|
+
* refused on both, as is one out of range). Anything else (fact storage, X-Accel delivery, public
|
|
31
|
+
* URLs) is the app's own var: extend by spreading `def` into a new `object`,
|
|
32
|
+
* `object({...BaseServerEnv.def, MY_VAR: ...})`.
|
|
33
|
+
*
|
|
34
|
+
* Each field's description and `sensitivity` are `meta`, read by
|
|
35
|
+
* `env_schema_to_surface`.
|
|
27
36
|
*/
|
|
28
|
-
export const BaseServerEnv =
|
|
29
|
-
NODE_ENV:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
HOST: z.string().default('localhost').meta({ description: 'HTTP server bind address' }),
|
|
38
|
-
DATABASE_URL: z.string().min(1).meta({
|
|
37
|
+
export const BaseServerEnv = object({
|
|
38
|
+
NODE_ENV: meta(one_of(['development', 'production']), {
|
|
39
|
+
description: 'Runtime environment mode'
|
|
40
|
+
}),
|
|
41
|
+
PORT: meta(with_default(env_integer({ min: 1, max: 65535 }), 4040), {
|
|
42
|
+
description: 'HTTP server port'
|
|
43
|
+
}),
|
|
44
|
+
HOST: meta(with_default(string, 'localhost'), { description: 'HTTP server bind address' }),
|
|
45
|
+
DATABASE_URL: meta(pipe(string, min_length(1)), {
|
|
39
46
|
description: 'Database URL (postgres://, file://, or memory://)',
|
|
40
47
|
sensitivity: 'secret'
|
|
41
48
|
}),
|
|
42
|
-
SECRET_FUZ_COOKIE_KEYS:
|
|
49
|
+
SECRET_FUZ_COOKIE_KEYS: meta(pipe(string, min_length(32)), {
|
|
43
50
|
description: 'Cookie signing keys, separated by __ for rotation',
|
|
44
51
|
sensitivity: 'secret'
|
|
45
52
|
}),
|
|
46
|
-
FUZ_ALLOWED_ORIGINS:
|
|
53
|
+
FUZ_ALLOWED_ORIGINS: meta(pipe(string, message(min_length(1), 'FUZ_ALLOWED_ORIGINS is required')), {
|
|
47
54
|
description: 'Comma-separated origin patterns for API verification'
|
|
48
55
|
}),
|
|
49
|
-
FUZ_ALLOW_ORIGIN_WILDCARDS:
|
|
56
|
+
FUZ_ALLOW_ORIGIN_WILDCARDS: meta(optional(one_of(['true', 'false'])), {
|
|
50
57
|
description: 'Exactly `true` lets a wildcard FUZ_ALLOWED_ORIGINS entry (`:*`, a `*` label) boot, warned of on every boot; unset or `false` refuses one'
|
|
51
58
|
}),
|
|
52
|
-
FUZ_BOOTSTRAP_TOKEN_PATH:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
FUZ_DB_CHECKOUT_TIMEOUT_MS:
|
|
57
|
-
.number()
|
|
58
|
-
.int()
|
|
59
|
-
.min(1)
|
|
60
|
-
.max(DB_CHECKOUT_TIMEOUT_MAX_MS)
|
|
61
|
-
.optional()
|
|
62
|
-
.meta({
|
|
59
|
+
FUZ_BOOTSTRAP_TOKEN_PATH: meta(optional(string), {
|
|
60
|
+
description: 'Path to one-shot admin bootstrap token',
|
|
61
|
+
sensitivity: 'secret'
|
|
62
|
+
}),
|
|
63
|
+
FUZ_DB_CHECKOUT_TIMEOUT_MS: meta(optional(env_integer({ min: 1, max: DB_CHECKOUT_TIMEOUT_MAX_MS })), {
|
|
63
64
|
description: 'Bound on the pool checkouts a request makes, in ms (default 5000); a failed checkout answers 503. Audit writes use FUZ_DB_AUDIT_CHECKOUT_TIMEOUT_MS instead, including the failed-login row a request waits on. Postgres only — PGlite and pglet have no pool'
|
|
64
65
|
}),
|
|
65
|
-
FUZ_DB_AUDIT_CHECKOUT_TIMEOUT_MS:
|
|
66
|
-
.number()
|
|
67
|
-
.int()
|
|
68
|
-
.min(1)
|
|
69
|
-
.max(DB_CHECKOUT_TIMEOUT_MAX_MS)
|
|
70
|
-
.optional()
|
|
71
|
-
.meta({
|
|
66
|
+
FUZ_DB_AUDIT_CHECKOUT_TIMEOUT_MS: meta(optional(env_integer({ min: 1, max: DB_CHECKOUT_TIMEOUT_MAX_MS })), {
|
|
72
67
|
description: 'Bound on the checkout behind each audit pool write, in ms (default 30000); a failed login waits on its row, so up to this bound. Postgres only'
|
|
73
68
|
})
|
|
74
69
|
});
|
|
@@ -82,7 +77,7 @@ export const BaseServerEnv = z.strictObject({
|
|
|
82
77
|
* bootstrap token path extraction.
|
|
83
78
|
* Returns a Result so callers handle errors their own way (exit, logging, etc).
|
|
84
79
|
*
|
|
85
|
-
* @param env - a loaded and
|
|
80
|
+
* @param env - a loaded and validated `BaseServerEnv`
|
|
86
81
|
* @returns `{ok: true, keyring, allowed_origins, allow_origin_wildcards, bootstrap_token_path}`
|
|
87
82
|
* or `{ok: false, field, errors}`
|
|
88
83
|
*/
|
package/dist/testing/CLAUDE.md
CHANGED
|
@@ -196,7 +196,7 @@ Types:
|
|
|
196
196
|
`create_test_app` hard-codes the test-friendly `AppServerOptions`:
|
|
197
197
|
`allowed_origins` exactly `TEST_ORIGIN` (built by
|
|
198
198
|
`parse_allowed_origins`, as `create_app_server` requires), stub proxy pinned to `127.0.0.1`,
|
|
199
|
-
`env_schema:
|
|
199
|
+
`env_schema: object({})` (fuz_schema), `rate_limiters: 'disabled_for_testing'` (every
|
|
200
200
|
rate limiter `null` — a limiter passed through `app_options` wins over the
|
|
201
201
|
mode, so a rate-limit test enables just the one it pins; the mode's stderr
|
|
202
202
|
banner prints once per module instance — once per test file in an isolated
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './assert_dev_env.js';
|
|
2
|
-
import {
|
|
2
|
+
import { object } from '@fuzdev/fuz_schema/schema.ts';
|
|
3
3
|
import { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
4
4
|
import { DEFAULT_TEST_PASSWORD } from './test_credentials.js';
|
|
5
5
|
import { ROLE_KEEPER } from '../auth/role_schema.js';
|
|
@@ -280,7 +280,7 @@ export const create_loopback_app_server_options = () => {
|
|
|
280
280
|
return {
|
|
281
281
|
allowed_origins: parsed.origins,
|
|
282
282
|
proxy: { trusted_proxies: ['127.0.0.1'], get_connection_ip: () => '127.0.0.1' },
|
|
283
|
-
env_schema:
|
|
283
|
+
env_schema: object({})
|
|
284
284
|
};
|
|
285
285
|
};
|
|
286
286
|
/**
|
package/dist/testing/stubs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './assert_dev_env.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AnySchema } from '@fuzdev/fuz_schema/schema.ts';
|
|
3
3
|
import type { SessionOptions } from '../auth/session_cookie.js';
|
|
4
4
|
import type { MiddlewareCarveOut, MiddlewareSpec } from '../http/middleware_spec.js';
|
|
5
5
|
import type { AppDeps } from '../auth/deps.js';
|
|
@@ -131,7 +131,7 @@ export interface CreateTestAppSurfaceSpecOptions {
|
|
|
131
131
|
/** Consumer's route factory — receives the same `AppServerContext` as production. */
|
|
132
132
|
create_route_specs: (ctx: AppServerContext) => Array<RouteSpec>;
|
|
133
133
|
/** Env schema for surface generation (default: `BaseServerEnv`). */
|
|
134
|
-
env_schema?:
|
|
134
|
+
env_schema?: AnySchema;
|
|
135
135
|
/** SSE event specs for surface generation. */
|
|
136
136
|
event_specs?: Array<EventSpec>;
|
|
137
137
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stubs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/stubs.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAa7B,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"stubs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/stubs.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAa7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAErF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAI3E,OAAO,EAEN,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM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a,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB;AAmBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,4BAA4B,GACxC,SAAS,+BAA+B,KACtC,cAwGF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuzdev/fuz_app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.154.0",
|
|
4
4
|
"description": "fullstack app library",
|
|
5
5
|
"glyph": "🗝",
|
|
6
6
|
"logo": "logo.svg",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@electric-sql/pglite": ">=0.4",
|
|
38
38
|
"@fuzdev/blake3-wasm": ">=0.2.0",
|
|
39
39
|
"@fuzdev/fuz_css": ">=0.72.0",
|
|
40
|
-
"@fuzdev/fuz_schema": "^0.5.
|
|
40
|
+
"@fuzdev/fuz_schema": "^0.5.1",
|
|
41
41
|
"@fuzdev/fuz_util": ">=0.79.0",
|
|
42
42
|
"@fuzdev/pglet-wasm": ">=0.1.2",
|
|
43
43
|
"@hono/bun": ">=1",
|
|
@@ -96,10 +96,10 @@
|
|
|
96
96
|
"@fuzdev/blake3-wasm": "^0.2.0",
|
|
97
97
|
"@fuzdev/fuz_code": "^0.56.0",
|
|
98
98
|
"@fuzdev/fuz_css": "^0.72.0",
|
|
99
|
-
"@fuzdev/fuz_schema": "^0.5.
|
|
99
|
+
"@fuzdev/fuz_schema": "^0.5.1",
|
|
100
100
|
"@fuzdev/fuz_ui": "^0.221.0",
|
|
101
101
|
"@fuzdev/fuz_util": "^0.79.0",
|
|
102
|
-
"@fuzdev/gro": "^0.
|
|
102
|
+
"@fuzdev/gro": "^0.224.0",
|
|
103
103
|
"@fuzdev/mdz": "^0.7.0",
|
|
104
104
|
"@fuzdev/pglet-wasm": "^0.1.2",
|
|
105
105
|
"@hono/bun": "^1.0.1",
|