@fuzdev/fuz_app 0.168.1 → 0.169.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/actions/CLAUDE.md +1 -1
- package/dist/actions/action_codegen.d.ts +9 -7
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +20 -15
- package/dist/actions/action_event_data.d.ts +16 -16
- package/dist/auth/account_action_specs.d.ts +11 -11
- package/dist/auth/account_action_specs.js +1 -1
- package/dist/auth/account_route_schema.d.ts +18 -18
- package/dist/auth/account_route_schema.js +1 -1
- package/dist/auth/account_routes.js +1 -1
- package/dist/auth/account_schema.d.ts +38 -40
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +7 -8
- package/dist/auth/actor_lookup_action_specs.d.ts +7 -7
- package/dist/auth/actor_lookup_action_specs.js +1 -1
- package/dist/auth/actor_search_action_specs.d.ts +6 -6
- package/dist/auth/actor_search_action_specs.js +1 -1
- package/dist/auth/admin_action_specs.d.ts +166 -166
- package/dist/auth/admin_action_specs.js +1 -1
- package/dist/auth/app_settings_schema.d.ts +3 -3
- package/dist/auth/app_settings_schema.d.ts.map +1 -1
- package/dist/auth/app_settings_schema.js +1 -1
- package/dist/auth/audit_log_route_schema.d.ts +1 -1
- package/dist/auth/audit_log_route_schema.js +1 -1
- package/dist/auth/audit_log_schema.d.ts +61 -61
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +1 -1
- package/dist/auth/bootstrap_route_schema.d.ts +4 -4
- package/dist/auth/bootstrap_route_schema.js +1 -1
- package/dist/auth/cell_action_specs.d.ts +424 -424
- package/dist/auth/cell_action_specs.js +1 -1
- package/dist/auth/cell_audit_action_specs.d.ts +14 -14
- package/dist/auth/cell_audit_action_specs.js +1 -1
- package/dist/auth/cell_audit_metadata.d.ts +8 -8
- package/dist/auth/cell_audit_metadata.js +1 -1
- package/dist/auth/cell_field_action_specs.d.ts +55 -55
- package/dist/auth/cell_field_action_specs.js +1 -1
- package/dist/auth/cell_field_audit_metadata.d.ts +4 -4
- package/dist/auth/cell_field_audit_metadata.js +1 -1
- package/dist/auth/cell_grant_action_specs.d.ts +61 -61
- package/dist/auth/cell_grant_action_specs.js +1 -1
- package/dist/auth/cell_grant_audit_metadata.d.ts +10 -10
- package/dist/auth/cell_grant_audit_metadata.js +1 -1
- package/dist/auth/cell_item_action_specs.d.ts +76 -76
- package/dist/auth/cell_item_action_specs.js +1 -1
- package/dist/auth/cell_item_audit_metadata.d.ts +5 -5
- package/dist/auth/cell_item_audit_metadata.js +1 -1
- package/dist/auth/invite_schema.d.ts +11 -11
- package/dist/auth/invite_schema.d.ts.map +1 -1
- package/dist/auth/invite_schema.js +1 -1
- package/dist/auth/name_schema.js +1 -1
- package/dist/auth/password.js +1 -1
- package/dist/auth/role_grant_offer_action_specs.d.ts +182 -182
- package/dist/auth/role_grant_offer_action_specs.js +1 -1
- package/dist/auth/role_grant_offer_notifications.d.ts +107 -107
- package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_notifications.js +1 -1
- package/dist/auth/role_grant_offer_schema.d.ts +9 -9
- package/dist/auth/role_grant_offer_schema.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_schema.js +1 -1
- package/dist/auth/self_service_role_action_specs.d.ts +2 -2
- package/dist/auth/self_service_role_action_specs.js +1 -1
- package/dist/auth/signup_route_schema.d.ts +2 -2
- package/dist/auth/signup_route_schema.js +1 -1
- package/dist/auth/token_scope.d.ts +8 -8
- package/dist/db/file_fact_url.d.ts +1 -1
- package/dist/http/CLAUDE.md +7 -7
- package/dist/http/auth_shape.d.ts +15 -32
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/auth_shape.js +31 -38
- package/dist/http/db_routes.d.ts +1 -1
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +1 -1
- package/dist/http/error_schemas.d.ts +18 -18
- package/dist/http/jsonrpc.d.ts +11 -11
- package/dist/http/schema_helpers.d.ts +2 -2
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +8 -7
- package/dist/primitive_schemas.d.ts +173 -115
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas.js +134 -158
- package/dist/schema_issues.d.ts +10 -7
- package/dist/schema_issues.d.ts.map +1 -1
- package/dist/schema_issues.js +38 -8
- package/dist/server/serve_fact_route.js +1 -1
- package/dist/server/surface_route.js +1 -1
- package/dist/testing/CLAUDE.md +3 -3
- package/dist/testing/cross_backend/conformance_case.d.ts +96 -114
- package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_case.js +0 -256
- package/dist/testing/cross_backend/fact_serving.js +1 -1
- package/dist/testing/cross_backend/setup.d.ts +1 -1
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +3 -4
- package/dist/testing/cross_backend/testing_origin_check.d.ts +8 -8
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +608 -201
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +46 -55
- package/dist/testing/cross_backend/ws_outbound_overflow.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_outbound_overflow.js +35 -0
- package/dist/testing/rpc_helpers.d.ts +1 -1
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +0 -1
- package/dist/testing/schema_generators.js +1 -13
- package/dist/testing/schema_introspect.d.ts +438 -78
- package/dist/testing/schema_introspect.d.ts.map +1 -1
- package/dist/testing/schema_introspect.js +26 -26
- package/dist/testing/transports/bootstrap.d.ts +1 -1
- package/dist/testing/transports/bootstrap.d.ts.map +1 -1
- package/dist/testing/transports/bootstrap.js +1 -1
- package/dist/ui/BootstrapForm.svelte +1 -2
- package/dist/ui/BootstrapForm.svelte.d.ts.map +1 -1
- package/dist/ui/SignupForm.svelte +1 -2
- package/dist/ui/SignupForm.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.d.ts +5 -5
- package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_invites_state.svelte.d.ts +1 -1
- package/dist/ui/admin_invites_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_sessions_state.svelte.d.ts +2 -2
- package/dist/ui/admin_sessions_state.svelte.d.ts.map +1 -1
- package/dist/ui/role_grant_offers_state.svelte.d.ts +1 -1
- package/dist/zod.d.ts +18 -3
- package/dist/zod.d.ts.map +1 -1
- package/dist/zod.js +26 -3
- package/dist/zod_schemas.d.ts +100 -0
- package/dist/zod_schemas.d.ts.map +1 -0
- package/dist/zod_schemas.js +157 -0
- package/package.json +3 -3
- package/dist/primitive_schemas_fuz.d.ts +0 -178
- package/dist/primitive_schemas_fuz.d.ts.map +0 -1
- package/dist/primitive_schemas_fuz.js +0 -149
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuzdev/fuz_app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.169.0",
|
|
4
4
|
"description": "fullstack app library",
|
|
5
5
|
"glyph": "🗝",
|
|
6
6
|
"logo": "logo.svg",
|
|
@@ -97,9 +97,9 @@
|
|
|
97
97
|
"@fuzdev/fuz_code": "^0.56.0",
|
|
98
98
|
"@fuzdev/fuz_css": "^0.73.0",
|
|
99
99
|
"@fuzdev/fuz_schema": "^0.5.5",
|
|
100
|
-
"@fuzdev/fuz_ui": "^0.222.
|
|
100
|
+
"@fuzdev/fuz_ui": "^0.222.1",
|
|
101
101
|
"@fuzdev/fuz_util": "^0.79.1",
|
|
102
|
-
"@fuzdev/gro": "^0.
|
|
102
|
+
"@fuzdev/gro": "^0.225.0",
|
|
103
103
|
"@fuzdev/mdz": "^0.7.0",
|
|
104
104
|
"@fuzdev/pglet-wasm": "^0.1.2",
|
|
105
105
|
"@hono/bun": "^1.0.1",
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `@fuzdev/fuz_schema` twins of the Zod `bounded_string`, `Username`,
|
|
3
|
-
* `Email`, `Uuid`, `UuidWithDefault`, `FactHashSchema` (`primitive_schemas.ts`), and
|
|
4
|
-
* `ActingActor` (`http/auth_shape.ts`), under the same names, for schemas
|
|
5
|
-
* written in fuz_schema; `UsernameCanonical`, the username an output carries;
|
|
6
|
-
* `UsernameProvided`, the username login and lookup take; `Timestamp`, a
|
|
7
|
-
* timestamp on the wire; and `Blake3Hash`, a BLAKE3 hex hash. The last four
|
|
8
|
-
* have no Zod twin.
|
|
9
|
-
*
|
|
10
|
-
* The output type is shared: the Zod `Uuid` outputs fuz_schema's
|
|
11
|
-
* `Branded<string, 'Uuid'>` too, and both `FactHashSchema`s output fuz_util's
|
|
12
|
-
* `FactHash`, so a value parsed by either twin goes where the other's is taken.
|
|
13
|
-
*
|
|
14
|
-
* Both twins have one grammar, RFC 9562's read case-insensitively as its §4
|
|
15
|
-
* says, the max UUID included, and the Rust spine's: every input gets the same
|
|
16
|
-
* verdict and output from both, and their JSON Schema is the same.
|
|
17
|
-
*
|
|
18
|
-
* The twins are `@nodocs` while the Zod schemas of the same names stay, as
|
|
19
|
-
* the docs build refuses two exports of one name.
|
|
20
|
-
*
|
|
21
|
-
* @module
|
|
22
|
-
*/
|
|
23
|
-
import { string, type Infer, type PipeSchema } from '@fuzdev/fuz_schema/schema.ts';
|
|
24
|
-
import { type BoundedStringOptions } from './primitive_schemas.js';
|
|
25
|
-
/**
|
|
26
|
-
* A string schema whose length is bounded in UTF-16 code units, the twin of
|
|
27
|
-
* the Zod `bounded_string`: fuz_schema's `min_length` / `max_length` read
|
|
28
|
-
* `String.length`, the unit the Rust spine counts too, so no check beside them
|
|
29
|
-
* is needed. Its JSON Schema carries `minLength` / `maxLength` as the Zod
|
|
30
|
-
* one's does; `max_message` replaces fuz_schema's message on the over-`max`
|
|
31
|
-
* issue.
|
|
32
|
-
*
|
|
33
|
-
* @param options - the bounds, in UTF-16 code units, and the max message
|
|
34
|
-
* @returns the bounded string schema
|
|
35
|
-
* @nodocs
|
|
36
|
-
*/
|
|
37
|
-
export declare const bounded_string: (options: BoundedStringOptions) => PipeSchema<string, typeof string>;
|
|
38
|
-
/**
|
|
39
|
-
* Username for account creation, the twin of the Zod `Username`: the same
|
|
40
|
-
* bounds and grammar, output in lowercase. Every input gets the same verdict
|
|
41
|
-
* and output from both; a string outside the bounds and off the grammar gets
|
|
42
|
-
* the length issue alone, where Zod adds the grammar issue after it.
|
|
43
|
-
*
|
|
44
|
-
* @nodocs
|
|
45
|
-
*/
|
|
46
|
-
export declare const Username: PipeSchema<string, PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
47
|
-
/** @nodocs */
|
|
48
|
-
export type Username = Infer<typeof Username>;
|
|
49
|
-
/**
|
|
50
|
-
* A username's canonical grammar, `USERNAME_REGEX` in lowercase: a lowercase
|
|
51
|
-
* letter, then lowercase letters, digits, `_` or `-`, ending in a lowercase
|
|
52
|
-
* letter or digit. What `Username` outputs, and what an `account` row holds
|
|
53
|
-
* (its `account_username_lowercase` CHECK).
|
|
54
|
-
*/
|
|
55
|
-
export declare const USERNAME_CANONICAL_REGEX: RegExp;
|
|
56
|
-
/**
|
|
57
|
-
* A username as an account row holds it, the `username` of an output: the
|
|
58
|
-
* bounds of `Username` and `USERNAME_CANONICAL_REGEX`, no transform. A
|
|
59
|
-
* username in any other case fails, where the Zod `Username` lowercased it.
|
|
60
|
-
*/
|
|
61
|
-
export declare const UsernameCanonical: PipeSchema<string, PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
62
|
-
export type UsernameCanonical = Infer<typeof UsernameCanonical>;
|
|
63
|
-
/**
|
|
64
|
-
* Username submitted for login or lookup — minimal validation, for
|
|
65
|
-
* forward-compatibility if the creation grammar changes: at least one and at
|
|
66
|
-
* most `USERNAME_PROVIDED_LENGTH_MAX` UTF-16 code units, measured before
|
|
67
|
-
* trimming, holding a character that isn't whitespace.
|
|
68
|
-
*
|
|
69
|
-
* Canonicalized to `.trim().toLowerCase()` at parse time, so login's
|
|
70
|
-
* per-account rate-limit key and its lookup see one value whatever the casing
|
|
71
|
-
* or surrounding whitespace, as `Username` canonicalizes what is stored.
|
|
72
|
-
*
|
|
73
|
-
* A whitespace-only identifier is refused, not canonicalized to `""` and left
|
|
74
|
-
* to fall through to a lookup-miss 401: an empty identifier is malformed
|
|
75
|
-
* input, not a wrong credential, and the Rust spine's `account_login` refuses
|
|
76
|
-
* it too. JS `\s` is exactly the set `trim` removes (ECMA-262's WhiteSpace and
|
|
77
|
-
* LineTerminator), so the `regex` ahead of the transform refuses what would
|
|
78
|
-
* trim to nothing.
|
|
79
|
-
*/
|
|
80
|
-
export declare const UsernameProvided: PipeSchema<string, PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
81
|
-
export type UsernameProvided = Infer<typeof UsernameProvided>;
|
|
82
|
-
/**
|
|
83
|
-
* Email validation, the twin of the Zod `Email`: `EMAIL_REGEX` and at most
|
|
84
|
-
* `EMAIL_LENGTH_MAX` UTF-8 bytes, no transform. The `max_length` ahead of the
|
|
85
|
-
* grammar refuses a string past the bound in UTF-16 code units, which is past
|
|
86
|
-
* it in bytes too, before the regex reads it, and the `check` after it the
|
|
87
|
-
* multibyte address within the units but past the bytes, both with
|
|
88
|
-
* `EMAIL_LENGTH_MESSAGE`. Every input gets the same verdict and output from
|
|
89
|
-
* both; a string past the bound in code units gets the length issue as a
|
|
90
|
-
* `max_length`, where Zod gives a `check`, and one within the bound in code
|
|
91
|
-
* units but past it in bytes and off the grammar gets the grammar issue, where
|
|
92
|
-
* Zod gives the length one.
|
|
93
|
-
*
|
|
94
|
-
* @nodocs
|
|
95
|
-
*/
|
|
96
|
-
export declare const Email: PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
97
|
-
/** @nodocs */
|
|
98
|
-
export type Email = Infer<typeof Email>;
|
|
99
|
-
/**
|
|
100
|
-
* Branded UUID schema: a UUID of RFC 9562 in either case, output in
|
|
101
|
-
* lowercase, the form Postgres renders a `uuid` in and every id the server
|
|
102
|
-
* mints. The brand goes outside the `to_lower_case`, which outputs a new
|
|
103
|
-
* string.
|
|
104
|
-
*
|
|
105
|
-
* @nodocs
|
|
106
|
-
*/
|
|
107
|
-
export declare const Uuid: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
|
|
108
|
-
readonly '~types'?: {
|
|
109
|
-
readonly input: string;
|
|
110
|
-
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
111
|
-
} | undefined;
|
|
112
|
-
};
|
|
113
|
-
/** @nodocs */
|
|
114
|
-
export type Uuid = Infer<typeof Uuid>;
|
|
115
|
-
/**
|
|
116
|
-
* `Uuid` that defaults to a fresh `create_uuid()` when the input is `undefined`.
|
|
117
|
-
*
|
|
118
|
-
* @nodocs
|
|
119
|
-
*/
|
|
120
|
-
export declare const UuidWithDefault: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string | undefined, "with_default_fn", import("@fuzdev/fuz_schema/schema.ts").SchemaDefaultFnDef<import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
|
|
121
|
-
readonly '~types'?: {
|
|
122
|
-
readonly input: string;
|
|
123
|
-
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
124
|
-
} | undefined;
|
|
125
|
-
}>>;
|
|
126
|
-
/** @nodocs */
|
|
127
|
-
export type UuidWithDefault = Infer<typeof UuidWithDefault>;
|
|
128
|
-
/**
|
|
129
|
-
* A timestamp on the wire: a date and time of RFC 3339 in UTC, fuz_schema's
|
|
130
|
-
* `iso_datetime`, which both spines' `YYYY-MM-DDTHH:MM:SSZ`
|
|
131
|
-
* (`iso8601_timestamp_column`) and a `toISOString()` stamp satisfy. Not
|
|
132
|
-
* branded, unlike the Zod `Datetime`.
|
|
133
|
-
*/
|
|
134
|
-
export declare const Timestamp: PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
135
|
-
export type Timestamp = Infer<typeof Timestamp>;
|
|
136
|
-
/**
|
|
137
|
-
* A `blake3:`-prefixed fact hash on the wire, the twin of the Zod
|
|
138
|
-
* `FactHashSchema`: `FACT_HASH_EXACT`, its output fuz_util's `FactHash`, which
|
|
139
|
-
* `fact_hash_bytes`, `fact_hash_stream`, and `FactStore` take. The twins agree
|
|
140
|
-
* on every input, and their JSON Schema is the same `pattern`.
|
|
141
|
-
*
|
|
142
|
-
* @nodocs
|
|
143
|
-
*/
|
|
144
|
-
export declare const FactHashSchema: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "FactHash">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
|
|
145
|
-
readonly '~types'?: {
|
|
146
|
-
readonly input: string;
|
|
147
|
-
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
148
|
-
} | undefined;
|
|
149
|
-
};
|
|
150
|
-
/** A BLAKE3 hex hash's grammar: 64 lowercase hex characters (256-bit output). */
|
|
151
|
-
export declare const BLAKE3_HASH_REGEX: RegExp;
|
|
152
|
-
/** The message of a string off `BLAKE3_HASH_REGEX`. */
|
|
153
|
-
export declare const BLAKE3_HASH_MESSAGE = "Expected a 64-character lowercase hex blake3 hash";
|
|
154
|
-
/**
|
|
155
|
-
* A BLAKE3 hex hash: `BLAKE3_HASH_REGEX`, whose issue carries
|
|
156
|
-
* `BLAKE3_HASH_MESSAGE`. A value that is no string gets fuz_schema's message.
|
|
157
|
-
*/
|
|
158
|
-
export declare const Blake3Hash: PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
159
|
-
export type Blake3Hash = Infer<typeof Blake3Hash>;
|
|
160
|
-
/** The `description` both `ActingActor` twins carry. */
|
|
161
|
-
export declare const ACTING_ACTOR_DESCRIPTION = "Actor on the authenticated account that this request acts as. Omit on single-actor accounts; required on multi-actor.";
|
|
162
|
-
/**
|
|
163
|
-
* The `acting` field of an input that needs the caller's acting actor, the
|
|
164
|
-
* twin of `ActingActor` in `http/auth_shape.ts`, whose doc has the resolution
|
|
165
|
-
* rules. The dispatcher finds either twin by reference, so an input declares
|
|
166
|
-
* this export, not a copy of it.
|
|
167
|
-
*
|
|
168
|
-
* @nodocs
|
|
169
|
-
*/
|
|
170
|
-
export declare const ActingActor: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | undefined, string | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
|
|
171
|
-
readonly '~types'?: {
|
|
172
|
-
readonly input: string;
|
|
173
|
-
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
174
|
-
} | undefined;
|
|
175
|
-
}>>;
|
|
176
|
-
/** @nodocs */
|
|
177
|
-
export type ActingActor = Infer<typeof ActingActor>;
|
|
178
|
-
//# sourceMappingURL=primitive_schemas_fuz.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"primitive_schemas_fuz.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/primitive_schemas_fuz.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAUN,MAAM,EAKN,KAAK,KAAK,EACV,KAAK,UAAU,EACf,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAUN,KAAK,oBAAoB,EACzB,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,GAC1B,SAAS,oBAAoB,KAC3B,UAAU,CAAC,MAAM,EAAE,OAAO,MAAM,CAKlC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,4HAIpB,CAAC;AACF,cAAc;AACd,MAAM,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,QAAQ,CAAC,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,QAA+B,CAAC;AAErE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,4HAG7B,CAAC;AACF,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEhE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,4HAI5B,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE9D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,KAAK,wGAKjB,CAAC;AACF,cAAc;AACd,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC;AAExC;;;;;;;GAOG;AACH,eAAO,MAAM,IAAI;;;;;CAAmD,CAAC;AACrE,cAAc;AACd,MAAM,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;GAAqC,CAAC;AAClE,cAAc;AACd,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE5D;;;;;GAKG;AACH,eAAO,MAAM,SAAS,wGAA6B,CAAC;AACpD,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAEhD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc;;;;;CAA0D,CAAC;AAEtF,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,QAAmB,CAAC;AAElD,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,sDAAsD,CAAC;AAEvF;;;GAGG;AACH,eAAO,MAAM,UAAU,wGAAuE,CAAC;AAC/F,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAElD,wDAAwD;AACxD,eAAO,MAAM,wBAAwB,0HACmF,CAAC;AAEzH;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW;;;;;GAAkE,CAAC;AAC3F,cAAc;AACd,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `@fuzdev/fuz_schema` twins of the Zod `bounded_string`, `Username`,
|
|
3
|
-
* `Email`, `Uuid`, `UuidWithDefault`, `FactHashSchema` (`primitive_schemas.ts`), and
|
|
4
|
-
* `ActingActor` (`http/auth_shape.ts`), under the same names, for schemas
|
|
5
|
-
* written in fuz_schema; `UsernameCanonical`, the username an output carries;
|
|
6
|
-
* `UsernameProvided`, the username login and lookup take; `Timestamp`, a
|
|
7
|
-
* timestamp on the wire; and `Blake3Hash`, a BLAKE3 hex hash. The last four
|
|
8
|
-
* have no Zod twin.
|
|
9
|
-
*
|
|
10
|
-
* The output type is shared: the Zod `Uuid` outputs fuz_schema's
|
|
11
|
-
* `Branded<string, 'Uuid'>` too, and both `FactHashSchema`s output fuz_util's
|
|
12
|
-
* `FactHash`, so a value parsed by either twin goes where the other's is taken.
|
|
13
|
-
*
|
|
14
|
-
* Both twins have one grammar, RFC 9562's read case-insensitively as its §4
|
|
15
|
-
* says, the max UUID included, and the Rust spine's: every input gets the same
|
|
16
|
-
* verdict and output from both, and their JSON Schema is the same.
|
|
17
|
-
*
|
|
18
|
-
* The twins are `@nodocs` while the Zod schemas of the same names stay, as
|
|
19
|
-
* the docs build refuses two exports of one name.
|
|
20
|
-
*
|
|
21
|
-
* @module
|
|
22
|
-
*/
|
|
23
|
-
import { meta } from '@fuzdev/fuz_schema/meta.ts';
|
|
24
|
-
import { brand, check, iso_datetime, max_length, message, min_length, optional, pipe, regex, string, to_lower_case, transform, uuid, with_default_fn } from '@fuzdev/fuz_schema/schema.ts';
|
|
25
|
-
import { FACT_HASH_EXACT } from '@fuzdev/fuz_util/hash_schemas.ts';
|
|
26
|
-
import { create_uuid, EMAIL_LENGTH_MAX, EMAIL_LENGTH_MESSAGE, EMAIL_REGEX, is_email_within_length_max, USERNAME_LENGTH_MAX, USERNAME_LENGTH_MIN, USERNAME_PROVIDED_LENGTH_MAX, USERNAME_REGEX } from './primitive_schemas.js';
|
|
27
|
-
/**
|
|
28
|
-
* A string schema whose length is bounded in UTF-16 code units, the twin of
|
|
29
|
-
* the Zod `bounded_string`: fuz_schema's `min_length` / `max_length` read
|
|
30
|
-
* `String.length`, the unit the Rust spine counts too, so no check beside them
|
|
31
|
-
* is needed. Its JSON Schema carries `minLength` / `maxLength` as the Zod
|
|
32
|
-
* one's does; `max_message` replaces fuz_schema's message on the over-`max`
|
|
33
|
-
* issue.
|
|
34
|
-
*
|
|
35
|
-
* @param options - the bounds, in UTF-16 code units, and the max message
|
|
36
|
-
* @returns the bounded string schema
|
|
37
|
-
* @nodocs
|
|
38
|
-
*/
|
|
39
|
-
export const bounded_string = (options) => {
|
|
40
|
-
const { min, max, max_message } = options;
|
|
41
|
-
const max_step = max_message === undefined ? max_length(max) : message(max_length(max), max_message);
|
|
42
|
-
return min === undefined ? pipe(string, max_step) : pipe(string, min_length(min), max_step);
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Username for account creation, the twin of the Zod `Username`: the same
|
|
46
|
-
* bounds and grammar, output in lowercase. Every input gets the same verdict
|
|
47
|
-
* and output from both; a string outside the bounds and off the grammar gets
|
|
48
|
-
* the length issue alone, where Zod adds the grammar issue after it.
|
|
49
|
-
*
|
|
50
|
-
* @nodocs
|
|
51
|
-
*/
|
|
52
|
-
export const Username = pipe(bounded_string({ min: USERNAME_LENGTH_MIN, max: USERNAME_LENGTH_MAX }), regex(USERNAME_REGEX), to_lower_case);
|
|
53
|
-
/**
|
|
54
|
-
* A username's canonical grammar, `USERNAME_REGEX` in lowercase: a lowercase
|
|
55
|
-
* letter, then lowercase letters, digits, `_` or `-`, ending in a lowercase
|
|
56
|
-
* letter or digit. What `Username` outputs, and what an `account` row holds
|
|
57
|
-
* (its `account_username_lowercase` CHECK).
|
|
58
|
-
*/
|
|
59
|
-
export const USERNAME_CANONICAL_REGEX = /^[a-z][0-9a-z_-]*[0-9a-z]$/;
|
|
60
|
-
/**
|
|
61
|
-
* A username as an account row holds it, the `username` of an output: the
|
|
62
|
-
* bounds of `Username` and `USERNAME_CANONICAL_REGEX`, no transform. A
|
|
63
|
-
* username in any other case fails, where the Zod `Username` lowercased it.
|
|
64
|
-
*/
|
|
65
|
-
export const UsernameCanonical = pipe(bounded_string({ min: USERNAME_LENGTH_MIN, max: USERNAME_LENGTH_MAX }), regex(USERNAME_CANONICAL_REGEX));
|
|
66
|
-
/**
|
|
67
|
-
* Username submitted for login or lookup — minimal validation, for
|
|
68
|
-
* forward-compatibility if the creation grammar changes: at least one and at
|
|
69
|
-
* most `USERNAME_PROVIDED_LENGTH_MAX` UTF-16 code units, measured before
|
|
70
|
-
* trimming, holding a character that isn't whitespace.
|
|
71
|
-
*
|
|
72
|
-
* Canonicalized to `.trim().toLowerCase()` at parse time, so login's
|
|
73
|
-
* per-account rate-limit key and its lookup see one value whatever the casing
|
|
74
|
-
* or surrounding whitespace, as `Username` canonicalizes what is stored.
|
|
75
|
-
*
|
|
76
|
-
* A whitespace-only identifier is refused, not canonicalized to `""` and left
|
|
77
|
-
* to fall through to a lookup-miss 401: an empty identifier is malformed
|
|
78
|
-
* input, not a wrong credential, and the Rust spine's `account_login` refuses
|
|
79
|
-
* it too. JS `\s` is exactly the set `trim` removes (ECMA-262's WhiteSpace and
|
|
80
|
-
* LineTerminator), so the `regex` ahead of the transform refuses what would
|
|
81
|
-
* trim to nothing.
|
|
82
|
-
*/
|
|
83
|
-
export const UsernameProvided = pipe(bounded_string({ min: 1, max: USERNAME_PROVIDED_LENGTH_MAX }), message(regex(/\S/), 'Username must not be empty after trimming whitespace'), transform((s) => s.trim().toLowerCase()));
|
|
84
|
-
/**
|
|
85
|
-
* Email validation, the twin of the Zod `Email`: `EMAIL_REGEX` and at most
|
|
86
|
-
* `EMAIL_LENGTH_MAX` UTF-8 bytes, no transform. The `max_length` ahead of the
|
|
87
|
-
* grammar refuses a string past the bound in UTF-16 code units, which is past
|
|
88
|
-
* it in bytes too, before the regex reads it, and the `check` after it the
|
|
89
|
-
* multibyte address within the units but past the bytes, both with
|
|
90
|
-
* `EMAIL_LENGTH_MESSAGE`. Every input gets the same verdict and output from
|
|
91
|
-
* both; a string past the bound in code units gets the length issue as a
|
|
92
|
-
* `max_length`, where Zod gives a `check`, and one within the bound in code
|
|
93
|
-
* units but past it in bytes and off the grammar gets the grammar issue, where
|
|
94
|
-
* Zod gives the length one.
|
|
95
|
-
*
|
|
96
|
-
* @nodocs
|
|
97
|
-
*/
|
|
98
|
-
export const Email = pipe(string, message(max_length(EMAIL_LENGTH_MAX), EMAIL_LENGTH_MESSAGE), regex(EMAIL_REGEX), message(check(is_email_within_length_max), EMAIL_LENGTH_MESSAGE));
|
|
99
|
-
/**
|
|
100
|
-
* Branded UUID schema: a UUID of RFC 9562 in either case, output in
|
|
101
|
-
* lowercase, the form Postgres renders a `uuid` in and every id the server
|
|
102
|
-
* mints. The brand goes outside the `to_lower_case`, which outputs a new
|
|
103
|
-
* string.
|
|
104
|
-
*
|
|
105
|
-
* @nodocs
|
|
106
|
-
*/
|
|
107
|
-
export const Uuid = brand(pipe(string, uuid, to_lower_case), 'Uuid');
|
|
108
|
-
/**
|
|
109
|
-
* `Uuid` that defaults to a fresh `create_uuid()` when the input is `undefined`.
|
|
110
|
-
*
|
|
111
|
-
* @nodocs
|
|
112
|
-
*/
|
|
113
|
-
export const UuidWithDefault = with_default_fn(Uuid, create_uuid);
|
|
114
|
-
/**
|
|
115
|
-
* A timestamp on the wire: a date and time of RFC 3339 in UTC, fuz_schema's
|
|
116
|
-
* `iso_datetime`, which both spines' `YYYY-MM-DDTHH:MM:SSZ`
|
|
117
|
-
* (`iso8601_timestamp_column`) and a `toISOString()` stamp satisfy. Not
|
|
118
|
-
* branded, unlike the Zod `Datetime`.
|
|
119
|
-
*/
|
|
120
|
-
export const Timestamp = pipe(string, iso_datetime);
|
|
121
|
-
/**
|
|
122
|
-
* A `blake3:`-prefixed fact hash on the wire, the twin of the Zod
|
|
123
|
-
* `FactHashSchema`: `FACT_HASH_EXACT`, its output fuz_util's `FactHash`, which
|
|
124
|
-
* `fact_hash_bytes`, `fact_hash_stream`, and `FactStore` take. The twins agree
|
|
125
|
-
* on every input, and their JSON Schema is the same `pattern`.
|
|
126
|
-
*
|
|
127
|
-
* @nodocs
|
|
128
|
-
*/
|
|
129
|
-
export const FactHashSchema = brand(pipe(string, regex(FACT_HASH_EXACT)), 'FactHash');
|
|
130
|
-
/** A BLAKE3 hex hash's grammar: 64 lowercase hex characters (256-bit output). */
|
|
131
|
-
export const BLAKE3_HASH_REGEX = /^[0-9a-f]{64}$/;
|
|
132
|
-
/** The message of a string off `BLAKE3_HASH_REGEX`. */
|
|
133
|
-
export const BLAKE3_HASH_MESSAGE = 'Expected a 64-character lowercase hex blake3 hash';
|
|
134
|
-
/**
|
|
135
|
-
* A BLAKE3 hex hash: `BLAKE3_HASH_REGEX`, whose issue carries
|
|
136
|
-
* `BLAKE3_HASH_MESSAGE`. A value that is no string gets fuz_schema's message.
|
|
137
|
-
*/
|
|
138
|
-
export const Blake3Hash = pipe(string, message(regex(BLAKE3_HASH_REGEX), BLAKE3_HASH_MESSAGE));
|
|
139
|
-
/** The `description` both `ActingActor` twins carry. */
|
|
140
|
-
export const ACTING_ACTOR_DESCRIPTION = 'Actor on the authenticated account that this request acts as. Omit on single-actor accounts; required on multi-actor.';
|
|
141
|
-
/**
|
|
142
|
-
* The `acting` field of an input that needs the caller's acting actor, the
|
|
143
|
-
* twin of `ActingActor` in `http/auth_shape.ts`, whose doc has the resolution
|
|
144
|
-
* rules. The dispatcher finds either twin by reference, so an input declares
|
|
145
|
-
* this export, not a copy of it.
|
|
146
|
-
*
|
|
147
|
-
* @nodocs
|
|
148
|
-
*/
|
|
149
|
-
export const ActingActor = meta(optional(Uuid), { description: ACTING_ACTOR_DESCRIPTION });
|