@fuzdev/fuz_app 0.157.0 → 0.159.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 -0
- package/dist/actions/compile_action_registry.d.ts +5 -1
- package/dist/actions/compile_action_registry.d.ts.map +1 -1
- package/dist/actions/compile_action_registry.js +8 -1
- package/dist/auth/CLAUDE.md +11 -6
- package/dist/auth/actor_lookup_action_specs.d.ts +184 -40
- package/dist/auth/actor_lookup_action_specs.d.ts.map +1 -1
- package/dist/auth/actor_lookup_action_specs.js +16 -14
- package/dist/auth/actor_search_action_specs.d.ts +180 -40
- package/dist/auth/actor_search_action_specs.d.ts.map +1 -1
- package/dist/auth/actor_search_action_specs.js +12 -15
- package/dist/auth/audit_log_route_schema.d.ts +18 -6
- package/dist/auth/audit_log_route_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_route_schema.js +7 -3
- package/dist/auth/credential_type_schema.d.ts +4 -4
- package/dist/auth/credential_type_schema.d.ts.map +1 -1
- package/dist/auth/credential_type_schema.js +6 -6
- package/dist/auth/grant_path_schema.d.ts +4 -4
- package/dist/auth/grant_path_schema.d.ts.map +1 -1
- package/dist/auth/grant_path_schema.js +6 -6
- package/dist/auth/request_context.js +1 -1
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_action_specs.js +9 -6
- package/dist/auth/role_grant_offer_ddl.d.ts +5 -4
- package/dist/auth/role_grant_offer_ddl.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_ddl.js +5 -4
- package/dist/auth/role_schema.d.ts +15 -2
- package/dist/auth/role_schema.d.ts.map +1 -1
- package/dist/auth/role_schema.js +17 -4
- package/dist/auth/role_schema_fuz.d.ts +29 -0
- package/dist/auth/role_schema_fuz.d.ts.map +1 -0
- package/dist/auth/role_schema_fuz.js +28 -0
- package/dist/auth/scope_kind_schema.d.ts +22 -15
- package/dist/auth/scope_kind_schema.d.ts.map +1 -1
- package/dist/auth/scope_kind_schema.js +24 -17
- package/dist/auth/self_service_role_action_specs.d.ts +70 -27
- package/dist/auth/self_service_role_action_specs.d.ts.map +1 -1
- package/dist/auth/self_service_role_action_specs.js +16 -14
- package/dist/auth/token_scope.d.ts +3 -2
- package/dist/auth/token_scope.d.ts.map +1 -1
- package/dist/auth/token_scope.js +4 -3
- package/dist/http/CLAUDE.md +19 -6
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +8 -3
- package/dist/http/error_schemas.d.ts +5 -2
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/route_spec.d.ts +7 -4
- package/dist/http/route_spec.d.ts.map +1 -1
- package/dist/http/route_spec.js +26 -5
- package/dist/http/schema_helpers.d.ts +21 -3
- package/dist/http/schema_helpers.d.ts.map +1 -1
- package/dist/http/schema_helpers.js +34 -4
- package/dist/http/surface.d.ts +2 -0
- package/dist/http/surface.d.ts.map +1 -1
- package/dist/http/surface.js +6 -2
- package/dist/primitive_schemas.d.ts +1 -1
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas_fuz.d.ts +19 -4
- package/dist/primitive_schemas_fuz.d.ts.map +1 -1
- package/dist/primitive_schemas_fuz.js +22 -4
- package/dist/schema_issues.d.ts +11 -0
- package/dist/schema_issues.d.ts.map +1 -1
- package/dist/schema_issues.js +15 -0
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +3 -2
- package/dist/server/surface_route.d.ts.map +1 -1
- package/dist/server/surface_route.js +3 -2
- package/dist/testing/CLAUDE.md +12 -8
- package/dist/testing/cross_backend/role_grant_role_grammar.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_role_grammar.js +94 -6
- package/package.json +1 -1
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
*
|
|
72
72
|
* @module
|
|
73
73
|
*/
|
|
74
|
-
import {
|
|
74
|
+
import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
|
|
75
75
|
/**
|
|
76
76
|
* Hard cap on the number of rows returned per call. Bounds the search-result
|
|
77
77
|
* enumeration surface. Default limit (`ACTOR_SEARCH_LIMIT_DEFAULT`) is
|
|
@@ -89,23 +89,71 @@ export declare const ACTOR_SEARCH_QUERY_LENGTH_MAX = 50;
|
|
|
89
89
|
/**
|
|
90
90
|
* Reason: `scope_ids` was empty and the caller is not admin. Distinct from
|
|
91
91
|
* standard `invalid_params` issues so the visiones picker can surface a
|
|
92
|
-
* specific "pick a scope first" message rather than echoing
|
|
92
|
+
* specific "pick a scope first" message rather than echoing validation issues.
|
|
93
93
|
*/
|
|
94
94
|
export declare const ERROR_ACTOR_SEARCH_SCOPE_REQUIRED: "actor_search_scope_required";
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
limit
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
95
|
+
/** Input for `actor_search`, a `@fuzdev/fuz_schema` schema. */
|
|
96
|
+
export declare const ActorSearchInput: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
97
|
+
query: string;
|
|
98
|
+
limit?: number | undefined;
|
|
99
|
+
scope_ids?: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">[] | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
query: string;
|
|
102
|
+
limit?: number | undefined;
|
|
103
|
+
scope_ids?: string[] | undefined;
|
|
104
|
+
}, "object", {
|
|
105
|
+
query: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
106
|
+
scope_ids: 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[], "array", 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<"to_lower_case"> | 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">)[]> & {
|
|
107
|
+
readonly '~types'?: {
|
|
108
|
+
readonly input: string;
|
|
109
|
+
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
110
|
+
} | undefined;
|
|
111
|
+
}>>>;
|
|
112
|
+
limit: import("@fuzdev/fuz_schema/schema.ts").Schema<number | undefined, number | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").PipeSchema<number, import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>>>>;
|
|
113
|
+
}>;
|
|
114
|
+
export type ActorSearchInput = Infer<typeof ActorSearchInput>;
|
|
115
|
+
/** Output for `actor_search`, a `@fuzdev/fuz_schema` schema. */
|
|
116
|
+
export declare const ActorSearchOutput: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
117
|
+
actors: {
|
|
118
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
119
|
+
username: string;
|
|
120
|
+
display_name?: string | undefined;
|
|
121
|
+
}[];
|
|
122
|
+
}, {
|
|
123
|
+
actors: {
|
|
124
|
+
id: string;
|
|
125
|
+
username: string;
|
|
126
|
+
display_name?: string | undefined;
|
|
127
|
+
}[];
|
|
128
|
+
}, "object", {
|
|
129
|
+
actors: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
130
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
131
|
+
username: string;
|
|
132
|
+
display_name?: string | undefined;
|
|
133
|
+
}[], {
|
|
134
|
+
id: string;
|
|
135
|
+
username: string;
|
|
136
|
+
display_name?: string | undefined;
|
|
137
|
+
}[], "array", import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
138
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
139
|
+
username: string;
|
|
140
|
+
display_name?: string | undefined;
|
|
141
|
+
}, {
|
|
142
|
+
id: string;
|
|
143
|
+
username: string;
|
|
144
|
+
display_name?: string | undefined;
|
|
145
|
+
}, "object", {
|
|
146
|
+
id: 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<"to_lower_case"> | 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">)[]> & {
|
|
147
|
+
readonly '~types'?: {
|
|
148
|
+
readonly input: string;
|
|
149
|
+
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
150
|
+
} | undefined;
|
|
151
|
+
};
|
|
152
|
+
username: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
153
|
+
display_name: 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>>>;
|
|
154
|
+
}>>;
|
|
155
|
+
}>;
|
|
156
|
+
export type ActorSearchOutput = Infer<typeof ActorSearchOutput>;
|
|
109
157
|
export declare const actor_search_action_spec: {
|
|
110
158
|
method: string;
|
|
111
159
|
kind: "request_response";
|
|
@@ -115,18 +163,64 @@ export declare const actor_search_action_spec: {
|
|
|
115
163
|
actor: "none";
|
|
116
164
|
};
|
|
117
165
|
side_effects: false;
|
|
118
|
-
input:
|
|
119
|
-
query:
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
166
|
+
input: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
167
|
+
query: string;
|
|
168
|
+
limit?: number | undefined;
|
|
169
|
+
scope_ids?: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">[] | undefined;
|
|
170
|
+
}, {
|
|
171
|
+
query: string;
|
|
172
|
+
limit?: number | undefined;
|
|
173
|
+
scope_ids?: string[] | undefined;
|
|
174
|
+
}, "object", {
|
|
175
|
+
query: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
176
|
+
scope_ids: 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[], "array", 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<"to_lower_case"> | 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">)[]> & {
|
|
177
|
+
readonly '~types'?: {
|
|
178
|
+
readonly input: string;
|
|
179
|
+
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
180
|
+
} | undefined;
|
|
181
|
+
}>>>;
|
|
182
|
+
limit: import("@fuzdev/fuz_schema/schema.ts").Schema<number | undefined, number | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").PipeSchema<number, import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>>>>;
|
|
183
|
+
}>;
|
|
184
|
+
output: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
185
|
+
actors: {
|
|
186
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
187
|
+
username: string;
|
|
188
|
+
display_name?: string | undefined;
|
|
189
|
+
}[];
|
|
190
|
+
}, {
|
|
191
|
+
actors: {
|
|
192
|
+
id: string;
|
|
193
|
+
username: string;
|
|
194
|
+
display_name?: string | undefined;
|
|
195
|
+
}[];
|
|
196
|
+
}, "object", {
|
|
197
|
+
actors: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
198
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
199
|
+
username: string;
|
|
200
|
+
display_name?: string | undefined;
|
|
201
|
+
}[], {
|
|
202
|
+
id: string;
|
|
203
|
+
username: string;
|
|
204
|
+
display_name?: string | undefined;
|
|
205
|
+
}[], "array", import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
206
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
207
|
+
username: string;
|
|
208
|
+
display_name?: string | undefined;
|
|
209
|
+
}, {
|
|
210
|
+
id: string;
|
|
211
|
+
username: string;
|
|
212
|
+
display_name?: string | undefined;
|
|
213
|
+
}, "object", {
|
|
214
|
+
id: 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<"to_lower_case"> | 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">)[]> & {
|
|
215
|
+
readonly '~types'?: {
|
|
216
|
+
readonly input: string;
|
|
217
|
+
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
218
|
+
} | undefined;
|
|
219
|
+
};
|
|
220
|
+
username: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
221
|
+
display_name: 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>>>;
|
|
222
|
+
}>>;
|
|
223
|
+
}>;
|
|
130
224
|
async: true;
|
|
131
225
|
rate_limit: "account";
|
|
132
226
|
error_reasons: "actor_search_scope_required"[];
|
|
@@ -146,18 +240,64 @@ export declare const all_actor_search_action_specs: readonly [{
|
|
|
146
240
|
actor: "none";
|
|
147
241
|
};
|
|
148
242
|
side_effects: false;
|
|
149
|
-
input:
|
|
150
|
-
query:
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
},
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
243
|
+
input: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
244
|
+
query: string;
|
|
245
|
+
limit?: number | undefined;
|
|
246
|
+
scope_ids?: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">[] | undefined;
|
|
247
|
+
}, {
|
|
248
|
+
query: string;
|
|
249
|
+
limit?: number | undefined;
|
|
250
|
+
scope_ids?: string[] | undefined;
|
|
251
|
+
}, "object", {
|
|
252
|
+
query: import("@fuzdev/fuz_schema/schema.ts").PipeSchema<string, import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>;
|
|
253
|
+
scope_ids: 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[], "array", 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<"to_lower_case"> | 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">)[]> & {
|
|
254
|
+
readonly '~types'?: {
|
|
255
|
+
readonly input: string;
|
|
256
|
+
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
257
|
+
} | undefined;
|
|
258
|
+
}>>>;
|
|
259
|
+
limit: import("@fuzdev/fuz_schema/schema.ts").Schema<number | undefined, number | undefined, "optional", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").PipeSchema<number, import("@fuzdev/fuz_schema/schema.ts").Schema<number, number, "number", undefined>>>>;
|
|
260
|
+
}>;
|
|
261
|
+
output: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
262
|
+
actors: {
|
|
263
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
264
|
+
username: string;
|
|
265
|
+
display_name?: string | undefined;
|
|
266
|
+
}[];
|
|
267
|
+
}, {
|
|
268
|
+
actors: {
|
|
269
|
+
id: string;
|
|
270
|
+
username: string;
|
|
271
|
+
display_name?: string | undefined;
|
|
272
|
+
}[];
|
|
273
|
+
}, "object", {
|
|
274
|
+
actors: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
275
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
276
|
+
username: string;
|
|
277
|
+
display_name?: string | undefined;
|
|
278
|
+
}[], {
|
|
279
|
+
id: string;
|
|
280
|
+
username: string;
|
|
281
|
+
display_name?: string | undefined;
|
|
282
|
+
}[], "array", import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
283
|
+
id: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">;
|
|
284
|
+
username: string;
|
|
285
|
+
display_name?: string | undefined;
|
|
286
|
+
}, {
|
|
287
|
+
id: string;
|
|
288
|
+
username: string;
|
|
289
|
+
display_name?: string | undefined;
|
|
290
|
+
}, "object", {
|
|
291
|
+
id: 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<"to_lower_case"> | 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">)[]> & {
|
|
292
|
+
readonly '~types'?: {
|
|
293
|
+
readonly input: string;
|
|
294
|
+
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
295
|
+
} | undefined;
|
|
296
|
+
};
|
|
297
|
+
username: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
298
|
+
display_name: 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>>>;
|
|
299
|
+
}>>;
|
|
300
|
+
}>;
|
|
161
301
|
async: true;
|
|
162
302
|
rate_limit: "account";
|
|
163
303
|
error_reasons: "actor_search_scope_required"[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actor_search_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/actor_search_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;
|
|
1
|
+
{"version":3,"file":"actor_search_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/actor_search_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AAGH,OAAO,EASN,KAAK,KAAK,EACV,MAAM,8BAA8B,CAAC;AAOtC;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,gDAAgD;AAChD,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,EAAG,6BAAsC,CAAC;AAExF,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;EAgB3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE9D,gEAAgE;AAChE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEhE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcA,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAsC,CAAC"}
|
|
@@ -71,8 +71,9 @@
|
|
|
71
71
|
*
|
|
72
72
|
* @module
|
|
73
73
|
*/
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
74
|
+
import { meta } from '@fuzdev/fuz_schema/meta.ts';
|
|
75
|
+
import { array, integer, max_value, min_value, number, object, optional, pipe } from '@fuzdev/fuz_schema/schema.ts';
|
|
76
|
+
import { Uuid, bounded_string } from '../primitive_schemas_fuz.js';
|
|
76
77
|
import { ActorLookupEntryJson } from './actor_lookup_action_specs.js';
|
|
77
78
|
/**
|
|
78
79
|
* Hard cap on the number of rows returned per call. Bounds the search-result
|
|
@@ -91,29 +92,25 @@ export const ACTOR_SEARCH_QUERY_LENGTH_MAX = 50;
|
|
|
91
92
|
/**
|
|
92
93
|
* Reason: `scope_ids` was empty and the caller is not admin. Distinct from
|
|
93
94
|
* standard `invalid_params` issues so the visiones picker can surface a
|
|
94
|
-
* specific "pick a scope first" message rather than echoing
|
|
95
|
+
* specific "pick a scope first" message rather than echoing validation issues.
|
|
95
96
|
*/
|
|
96
97
|
export const ERROR_ACTOR_SEARCH_SCOPE_REQUIRED = 'actor_search_scope_required';
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
/** Input for `actor_search`, a `@fuzdev/fuz_schema` schema. */
|
|
99
|
+
export const ActorSearchInput = object({
|
|
100
|
+
query: meta(bounded_string({ min: 1, max: ACTOR_SEARCH_QUERY_LENGTH_MAX }), {
|
|
99
101
|
description: `Case-insensitive prefix match against \`actor.name\`. Length 1–${ACTOR_SEARCH_QUERY_LENGTH_MAX}.`,
|
|
100
102
|
sensitivity: 'personal'
|
|
101
103
|
}),
|
|
102
|
-
scope_ids:
|
|
104
|
+
scope_ids: meta(optional(array(Uuid)), {
|
|
103
105
|
description: 'Restrict results to actors holding a role_grant on any of these scopes. Required (non-empty) for non-admin callers; admin callers may omit or pass empty for unbounded search. Caller is responsible for pre-filtering against their own authority — the SQL filter does not enforce it.'
|
|
104
106
|
}),
|
|
105
|
-
limit:
|
|
106
|
-
.number()
|
|
107
|
-
.int()
|
|
108
|
-
.min(1)
|
|
109
|
-
.max(ACTOR_SEARCH_LIMIT_MAX)
|
|
110
|
-
.optional()
|
|
111
|
-
.meta({
|
|
107
|
+
limit: meta(optional(pipe(number, integer, min_value(1), max_value(ACTOR_SEARCH_LIMIT_MAX))), {
|
|
112
108
|
description: `Maximum rows to return. Defaults to ${ACTOR_SEARCH_LIMIT_DEFAULT}, hard cap ${ACTOR_SEARCH_LIMIT_MAX}.`
|
|
113
109
|
})
|
|
114
110
|
});
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
/** Output for `actor_search`, a `@fuzdev/fuz_schema` schema. */
|
|
112
|
+
export const ActorSearchOutput = object({
|
|
113
|
+
actors: array(ActorLookupEntryJson)
|
|
117
114
|
});
|
|
118
115
|
export const actor_search_action_spec = {
|
|
119
116
|
method: 'actor_search',
|
|
@@ -10,13 +10,25 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @module
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
13
|
+
import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
|
|
14
14
|
import type { RouteSpec } from '../http/route_spec.js';
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export
|
|
15
|
+
/**
|
|
16
|
+
* Query schema for the audit-log SSE route, a `@fuzdev/fuz_schema` `object`
|
|
17
|
+
* that refuses unknown keys — multi-actor admins pass `?acting=<uuid>`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const AuditStreamQuery: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
20
|
+
acting?: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
acting?: string | undefined;
|
|
23
|
+
}, "object", {
|
|
24
|
+
acting: 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<"to_lower_case"> | 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">)[]> & {
|
|
25
|
+
readonly '~types'?: {
|
|
26
|
+
readonly input: string;
|
|
27
|
+
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
28
|
+
} | undefined;
|
|
29
|
+
}>>;
|
|
30
|
+
}>;
|
|
31
|
+
export type AuditStreamQuery = Infer<typeof AuditStreamQuery>;
|
|
20
32
|
/** Default role required to access the audit-log SSE route. */
|
|
21
33
|
export declare const DEFAULT_AUDIT_STREAM_ROLE = "admin";
|
|
22
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit_log_route_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_log_route_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"audit_log_route_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/audit_log_route_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAU,KAAK,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAElE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;EAAkC,CAAC;AAChE,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE9D,+DAA+D;AAC/D,eAAO,MAAM,yBAAyB,UAAU,CAAC;AAEjD;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,GACxC,gBAAe,MAAkC,KAC/C,IAAI,CAAC,SAAS,EAAE,SAAS,CA8B1B,CAAC"}
|
|
@@ -11,9 +11,13 @@
|
|
|
11
11
|
* @module
|
|
12
12
|
*/
|
|
13
13
|
import { z } from 'zod';
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
import { object } from '@fuzdev/fuz_schema/schema.ts';
|
|
15
|
+
import { ActingActor } from '../primitive_schemas_fuz.js';
|
|
16
|
+
/**
|
|
17
|
+
* Query schema for the audit-log SSE route, a `@fuzdev/fuz_schema` `object`
|
|
18
|
+
* that refuses unknown keys — multi-actor admins pass `?acting=<uuid>`.
|
|
19
|
+
*/
|
|
20
|
+
export const AuditStreamQuery = object({ acting: ActingActor });
|
|
17
21
|
/** Default role required to access the audit-log SSE route. */
|
|
18
22
|
export const DEFAULT_AUDIT_STREAM_ROLE = 'admin';
|
|
19
23
|
/**
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import { z } from 'zod';
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
25
|
+
* Runs of lowercase letters (a-z) joined by single underscores, the grammar
|
|
26
|
+
* of `RoleName`, `ScopeKindName` and `GrantPathName` too. Rejects empty
|
|
27
|
+
* strings, leading, trailing or consecutive underscores, uppercase, and
|
|
28
|
+
* digits.
|
|
29
29
|
*/
|
|
30
30
|
export declare const CREDENTIAL_TYPE_NAME_REGEX: RegExp;
|
|
31
31
|
/** Zod schema for valid credential-type name strings. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential_type_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/credential_type_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"credential_type_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/credential_type_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,QAAyB,CAAC;AAEjE,yDAAyD;AACzD,eAAO,MAAM,kBAAkB,aAK7B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAIpE,uCAAuC;AACvC,eAAO,MAAM,uBAAuB,YAAY,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,cAAc,CAAC;AAErD,yEAAyE;AACzE,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAE3D,0DAA0D;AAC1D,eAAO,MAAM,wBAAwB,mDAI3B,CAAC;AAEX,kDAAkD;AAClD,eAAO,MAAM,qBAAqB;;;;EAAmC,CAAC;AACtE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,EAAE,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAa/E,CAAC;AAEH,qFAAqF;AACrF,MAAM,WAAW,0BAA0B;IAC1C;;;;;;OAMG;IACH,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAClC;;;OAGG;IACH,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;CAC1D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,6BAA6B,GACzC,iBAAgB,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAM,KACrD,0BA2BF,CAAC"}
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import { z } from 'zod';
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
25
|
+
* Runs of lowercase letters (a-z) joined by single underscores, the grammar
|
|
26
|
+
* of `RoleName`, `ScopeKindName` and `GrantPathName` too. Rejects empty
|
|
27
|
+
* strings, leading, trailing or consecutive underscores, uppercase, and
|
|
28
|
+
* digits.
|
|
29
29
|
*/
|
|
30
|
-
export const CREDENTIAL_TYPE_NAME_REGEX = /^[a-z][a-
|
|
30
|
+
export const CREDENTIAL_TYPE_NAME_REGEX = /^[a-z]+(?:_[a-z]+)*$/;
|
|
31
31
|
/** Zod schema for valid credential-type name strings. */
|
|
32
32
|
export const CredentialTypeName = z
|
|
33
33
|
.string()
|
|
34
|
-
.regex(CREDENTIAL_TYPE_NAME_REGEX, 'Credential-type names must be lowercase letters and underscores (a-z_), no leading
|
|
34
|
+
.regex(CREDENTIAL_TYPE_NAME_REGEX, 'Credential-type names must be lowercase letters and underscores (a-z_), no leading, trailing or consecutive underscores');
|
|
35
35
|
// Builtin credential types — provided by fuz_app, always available.
|
|
36
36
|
/** Cookie-based session credential. */
|
|
37
37
|
export const CREDENTIAL_TYPE_SESSION = 'session';
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
*/
|
|
27
27
|
import { z } from 'zod';
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
29
|
+
* Runs of lowercase letters (a-z) joined by single underscores, the grammar
|
|
30
|
+
* of `RoleName`, `ScopeKindName` and `CredentialTypeName` too. Rejects empty
|
|
31
|
+
* strings, leading, trailing or consecutive underscores, uppercase, and
|
|
32
|
+
* digits.
|
|
33
33
|
*/
|
|
34
34
|
export declare const GRANT_PATH_NAME_REGEX: RegExp;
|
|
35
35
|
/** Zod schema for valid grant-path name strings. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grant_path_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/grant_path_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"grant_path_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/grant_path_schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,QAAyB,CAAC;AA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a-z) joined by single underscores, the grammar
|
|
30
|
+
* of `RoleName`, `ScopeKindName` and `CredentialTypeName` too. Rejects empty
|
|
31
|
+
* strings, leading, trailing or consecutive underscores, uppercase, and
|
|
32
|
+
* digits.
|
|
33
33
|
*/
|
|
34
|
-
export const GRANT_PATH_NAME_REGEX = /^[a-z][a-
|
|
34
|
+
export const GRANT_PATH_NAME_REGEX = /^[a-z]+(?:_[a-z]+)*$/;
|
|
35
35
|
/** Zod schema for valid grant-path name strings. */
|
|
36
36
|
export const GrantPathName = z
|
|
37
37
|
.string()
|
|
38
|
-
.regex(GRANT_PATH_NAME_REGEX, 'Grant-path names must be lowercase letters and underscores (a-z_), no leading
|
|
38
|
+
.regex(GRANT_PATH_NAME_REGEX, 'Grant-path names must be lowercase letters and underscores (a-z_), no leading, trailing or consecutive underscores');
|
|
39
39
|
// Builtin grant paths — provided by fuz_app, always available.
|
|
40
40
|
/** Admin-mediated grant — `role_grant_offer_create` plus admin-direct flows. */
|
|
41
41
|
export const GRANT_PATH_ADMIN = 'admin';
|
|
@@ -331,7 +331,7 @@ export const get_public_account_id = (c) => {
|
|
|
331
331
|
*/
|
|
332
332
|
export const require_token_scope = (capability) => {
|
|
333
333
|
if (!is_route_scope_capability(capability)) {
|
|
334
|
-
throw new Error(`auth.required_scope "${capability}" is not a valid token-scope capability for a route \u2014 expected 'surface:<name>', where a surface name is lowercase letters
|
|
334
|
+
throw new Error(`auth.required_scope "${capability}" is not a valid token-scope capability for a route \u2014 expected 'surface:<name>', where a surface name is runs of lowercase letters joined by single underscores ('rpc:<method>' is the action dispatcher's per-method gate, which a route never reaches)`);
|
|
335
335
|
}
|
|
336
336
|
return async (c, next) => {
|
|
337
337
|
const denied = token_scope_surface_denial(c, capability);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role_grant_offer_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/role_grant_offer_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAiB3E,oEAAoE;AACpE,eAAO,MAAM,kCAAkC,EAAG,8BAAuC,CAAC;AAC1F,kEAAkE;AAClE,eAAO,MAAM,+BAA+B,EAAG,2BAAoC,CAAC;AACpF,sDAAsD;AACtD,eAAO,MAAM,8BAA8B,EAAG,0BAAmC,CAAC;AAClF,wGAAwG;AACxG,eAAO,MAAM,gCAAgC,EAAG,4BAAqC,CAAC;AACtF,uIAAuI;AACvI,eAAO,MAAM,yCAAyC,EACrD,qCAA8C,CAAC;AAChD,gKAAgK;AAChK,eAAO,MAAM,qCAAqC,EAAG,iCAA0C,CAAC;AAChG,6FAA6F;AAC7F,eAAO,MAAM,qCAAqC,EAAG,iCAA0C,CAAC;AAChG,wHAAwH;AACxH,eAAO,MAAM,6CAA6C,EACzD,yCAAkD,CAAC;AACpD;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,EAAG,2BAAoC,CAAC;AACpF;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC,EAAG,4BAAqC,CAAC;AACtF;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,EAAG,0BAAmC,CAAC;AAElF;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO;IAC5C,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,KAAG,OAAkE,CAAC;AAEvE,+GAA+G;AAC/G,eAAO,MAAM,0BAA0B,2GACkE,CAAC;
|
|
1
|
+
{"version":3,"file":"role_grant_offer_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/role_grant_offer_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAA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;;;;CAqBX,CAAC;AAEtC,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWZ,CAAC;AAEtC,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWZ,CAAC;AAEtC,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWT,CAAC;AAEtC,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWZ,CAAC;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;CAkBL,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBL,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,EAAE,KAAK,CAAC,yBAAyB,CAS9E,CAAC"}
|
|
@@ -24,7 +24,7 @@ import { z } from 'zod';
|
|
|
24
24
|
import { Uuid, bounded_string } from '../primitive_schemas.js';
|
|
25
25
|
import { ERROR_INSUFFICIENT_PERMISSIONS, ERROR_LIMIT_INVALID, ERROR_OFFSET_INVALID, ERROR_ROLE_GRANT_NOT_FOUND, ERROR_ROLE_NOT_WEB_GRANTABLE } from '../http/error_schemas.js';
|
|
26
26
|
import { RoleName } from './role_schema.js';
|
|
27
|
-
import { SCOPE_KIND_LENGTH_MAX } from './scope_kind_schema.js';
|
|
27
|
+
import { SCOPE_KIND_LENGTH_MAX, ScopeKindName } from './scope_kind_schema.js';
|
|
28
28
|
import { ROLE_GRANT_OFFER_MESSAGE_LENGTH_MAX, RoleGrantOfferJson } from './role_grant_offer_schema.js';
|
|
29
29
|
import { ROLE_GRANT_REVOKED_REASON_LENGTH_MAX } from './account_schema.js';
|
|
30
30
|
import { ActingActor } from '../http/auth_shape.js';
|
|
@@ -79,11 +79,14 @@ export const ERROR_CANNOT_REVOKE_LAST_ADMIN = 'cannot_revoke_last_admin';
|
|
|
79
79
|
export const is_grant_scope_paired = (input) => (input.scope_kind == null) === (input.scope_id == null);
|
|
80
80
|
/** The message a half-scoped grant input fails with — the grant inputs' refine, and the UI's pre-RPC guard. */
|
|
81
81
|
export const GRANT_SCOPE_PAIRED_MESSAGE = "'scope_kind' and 'scope_id' must be given together (both for a scoped grant, neither for a global one)";
|
|
82
|
-
/**
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
/**
|
|
83
|
+
* The `scope_kind` field both grant inputs share, paired with `scope_id`. A
|
|
84
|
+
* `ScopeKindName`, so off the grammar is refused at validation: the
|
|
85
|
+
* index-side `'GLOBAL'` token among it, which with the all-zeros uuid would
|
|
86
|
+
* otherwise equal a global grant's key in the partial unique indexes.
|
|
87
|
+
*/
|
|
88
|
+
const GrantScopeKind = ScopeKindName.nullish().meta({
|
|
89
|
+
description: `Machine-readable kind tag for \`scope_id\` — paired-null with \`scope_id\` (both null for global, both non-null for scoped). Required iff \`scope_id\` is set. A scope-kind name: runs of lowercase letters (a-z) joined by single underscores, at most ${SCOPE_KIND_LENGTH_MAX} characters.`
|
|
87
90
|
});
|
|
88
91
|
// -- Input/output schemas ---------------------------------------------------
|
|
89
92
|
/**
|
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
/** Sentinel UUID used inside the partial unique indexes to collapse `scope_id IS NULL` into a comparable value. */
|
|
18
18
|
export declare const ROLE_GRANT_OFFER_SCOPE_SENTINEL_UUID = "00000000-0000-0000-0000-000000000000";
|
|
19
19
|
/**
|
|
20
|
-
* Index-side token for the global case in the partial unique index.
|
|
21
|
-
* so it
|
|
22
|
-
*
|
|
23
|
-
* `scope_kind = NULL` and `scope_id = NULL` together encode the
|
|
20
|
+
* Index-side token for the global case in the partial unique index.
|
|
21
|
+
* Uppercase, so it is off the `ScopeKindName` grammar: no registry declares
|
|
22
|
+
* it, and the grant inputs refuse it, so no row they write holds it.
|
|
23
|
+
* Column-level `scope_kind = NULL` and `scope_id = NULL` together encode the
|
|
24
|
+
* global case.
|
|
24
25
|
*/
|
|
25
26
|
export declare const ROLE_GRANT_OFFER_SCOPE_KIND_GLOBAL_TOKEN = "GLOBAL";
|
|
26
27
|
/**
|