@fuzdev/fuz_app 0.93.0 → 0.94.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/README.md +2 -2
- package/dist/actions/action_codegen.d.ts +18 -18
- package/dist/actions/action_codegen.js +30 -30
- package/dist/actions/action_event.js +1 -1
- package/dist/actions/action_event_helpers.d.ts +1 -1
- package/dist/actions/action_event_types.d.ts +1 -1
- package/dist/actions/action_rpc.d.ts +2 -2
- package/dist/actions/broadcast_api.d.ts +1 -1
- package/dist/actions/broadcast_api.js +1 -1
- package/dist/actions/perform_action.d.ts +2 -2
- package/dist/actions/register_action_ws.d.ts +2 -2
- package/dist/actions/register_action_ws.js +2 -2
- package/dist/actions/register_ws_endpoint.js +1 -1
- package/dist/actions/request_tracker.svelte.d.ts +1 -1
- package/dist/actions/request_tracker.svelte.js +1 -1
- package/dist/actions/rpc_client.d.ts +1 -1
- package/dist/actions/socket.svelte.d.ts +2 -2
- package/dist/actions/transports_ws.js +1 -1
- package/dist/actions/transports_ws_auth_guard.d.ts +1 -1
- package/dist/actions/transports_ws_backend.d.ts +1 -1
- package/dist/actions/transports_ws_backend.js +2 -2
- package/dist/auth/account_action_specs.js +1 -1
- package/dist/auth/account_schema.d.ts +1 -1
- package/dist/auth/account_schema.js +1 -1
- package/dist/auth/actor_lookup_action_specs.js +1 -1
- package/dist/auth/actor_lookup_queries.d.ts +1 -1
- package/dist/auth/actor_search_action_specs.js +1 -1
- package/dist/auth/actor_search_queries.d.ts +1 -1
- package/dist/auth/admin_action_specs.js +1 -1
- package/dist/auth/api_token.js +1 -1
- package/dist/auth/api_token_queries.d.ts +1 -1
- package/dist/auth/app_settings_schema.d.ts +1 -1
- package/dist/auth/app_settings_schema.js +1 -1
- package/dist/auth/audit_emitter.d.ts +2 -2
- package/dist/auth/audit_log_routes.d.ts +1 -1
- package/dist/auth/audit_log_schema.d.ts +1 -1
- package/dist/auth/audit_log_schema.js +2 -2
- package/dist/auth/bearer_auth.d.ts +1 -1
- package/dist/auth/bootstrap_account.d.ts +1 -1
- package/dist/auth/bootstrap_route_schema.js +1 -1
- package/dist/auth/bootstrap_routes.d.ts +1 -1
- package/dist/auth/bootstrap_routes.js +1 -1
- package/dist/auth/cell_action_specs.js +2 -2
- package/dist/auth/cell_audit_action_specs.js +1 -1
- package/dist/auth/cell_audit_metadata.js +1 -1
- package/dist/auth/cell_field_action_specs.js +1 -1
- package/dist/auth/cell_field_audit_metadata.js +1 -1
- package/dist/auth/cell_grant_action_specs.js +1 -1
- package/dist/auth/cell_grant_audit_metadata.js +1 -1
- package/dist/auth/cell_item_action_specs.d.ts +1 -1
- package/dist/auth/cell_item_action_specs.js +3 -3
- package/dist/auth/cell_item_audit_metadata.js +1 -1
- package/dist/auth/cell_relation_visibility.d.ts +1 -1
- package/dist/auth/cleanup.d.ts +1 -1
- package/dist/auth/daemon_token_middleware.d.ts +1 -1
- package/dist/auth/deps.d.ts +2 -2
- package/dist/auth/invite_schema.d.ts +1 -1
- package/dist/auth/invite_schema.js +1 -1
- package/dist/auth/request_context.d.ts +1 -1
- package/dist/auth/role_grant_offer_action_specs.js +1 -1
- package/dist/auth/role_grant_offer_notifications.d.ts +1 -1
- package/dist/auth/role_grant_offer_notifications.js +1 -1
- package/dist/auth/role_grant_offer_queries.d.ts +1 -1
- package/dist/auth/role_grant_offer_schema.d.ts +1 -1
- package/dist/auth/role_grant_offer_schema.js +1 -1
- package/dist/auth/role_grant_queries.d.ts +1 -1
- package/dist/auth/session_queries.d.ts +1 -1
- package/dist/auth/session_queries.js +1 -1
- package/dist/auth/signup_route_schema.js +1 -1
- package/dist/cli/args.d.ts +1 -1
- package/dist/cli/args.js +2 -2
- package/dist/cli/help.d.ts +1 -1
- package/dist/cli/help.js +1 -1
- package/dist/cli/logger.d.ts +1 -1
- package/dist/cli/logger.js +1 -1
- package/dist/db/CLAUDE.md +1 -1
- package/dist/db/cell_audit_queries.d.ts +1 -1
- package/dist/db/cell_field_queries.d.ts +1 -1
- package/dist/db/cell_grant_queries.d.ts +1 -1
- package/dist/db/cell_item_queries.d.ts +1 -1
- package/dist/db/cell_queries.d.ts +3 -3
- package/dist/db/cell_queries.js +1 -1
- package/dist/db/fact_disk_storage.d.ts +2 -2
- package/dist/db/fact_disk_storage.js +4 -4
- package/dist/db/fact_queries.d.ts +1 -1
- package/dist/db/fact_store.d.ts +3 -3
- package/dist/db/fact_store.js +2 -2
- package/dist/db/file_fact_url.d.ts +1 -1
- package/dist/db/file_fact_url.js +1 -1
- package/dist/db/migrate.js +1 -1
- package/dist/db/status.js +1 -1
- package/dist/http/auth_shape.js +2 -2
- package/dist/http/common_routes.d.ts +1 -1
- package/dist/http/db_routes.d.ts +1 -1
- package/dist/http/origin.js +1 -1
- package/dist/http/pending_effects.d.ts +1 -1
- package/dist/http/proxy.d.ts +1 -1
- package/dist/http/route_spec.d.ts +1 -1
- package/dist/rate_limiter.js +1 -1
- package/dist/realtime/sse.d.ts +1 -1
- package/dist/realtime/sse_auth_guard.d.ts +1 -1
- package/dist/runtime/deno.js +1 -1
- package/dist/server/app_backend.d.ts +1 -1
- package/dist/server/app_backend.js +1 -1
- package/dist/server/env.js +1 -1
- package/dist/server/fact_write.d.ts +2 -2
- package/dist/server/fact_write.js +1 -1
- package/dist/server/serve_fact_route.d.ts +1 -1
- package/dist/server/serve_fact_route.js +2 -2
- package/dist/server/startup.d.ts +1 -1
- package/dist/testing/CLAUDE.md +23 -5
- package/dist/testing/adversarial_input.js +1 -1
- package/dist/testing/app_server.d.ts +1 -1
- package/dist/testing/app_server.js +1 -1
- package/dist/testing/auth_apps.js +1 -1
- package/dist/testing/cross_backend/bench/bench_report.d.ts +1 -1
- package/dist/testing/cross_backend/bench/bench_report.js +2 -2
- package/dist/testing/cross_backend/bench/run_cross_impl_bench.d.ts +1 -1
- package/dist/testing/cross_backend/bench/run_cross_impl_bench.js +1 -1
- package/dist/testing/cross_backend/bootstrap_backend.d.ts +1 -1
- package/dist/testing/cross_backend/cell_relations.js +1 -1
- package/dist/testing/cross_backend/conformance_case.d.ts +4 -0
- package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_case.js +26 -0
- package/dist/testing/cross_backend/conformance_table.d.ts +21 -0
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +109 -7
- package/dist/testing/cross_backend/create_cross_backend_global_setup.d.ts +1 -1
- package/dist/testing/cross_backend/create_dual_spawn_global_setup.d.ts +1 -1
- package/dist/testing/cross_backend/default_spine_surface.d.ts +1 -1
- 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.js +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +2 -2
- package/dist/testing/cross_backend/testing_server_core.d.ts +1 -1
- package/dist/testing/cross_backend/testing_server_core.js +1 -1
- package/dist/testing/cross_backend/ws_round_trip.js +1 -1
- package/dist/testing/db.js +4 -4
- package/dist/testing/middleware.js +1 -1
- package/dist/testing/role_grant_helpers.d.ts +1 -1
- package/dist/testing/rpc_helpers.d.ts +18 -1
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.js +24 -2
- package/dist/testing/schema_generators.d.ts +1 -1
- package/dist/testing/schema_generators.js +1 -1
- package/dist/testing/stubs.js +1 -1
- package/dist/testing/testing_rate_limiter.d.ts +1 -1
- package/dist/testing/testing_rate_limiter.js +1 -1
- package/dist/testing/transports/bootstrap.d.ts +1 -1
- package/dist/testing/transports/bootstrap.js +1 -1
- package/dist/testing/ws_round_trip.d.ts +2 -2
- package/dist/testing/ws_round_trip.js +2 -2
- package/dist/ui/AdminSurface.svelte +1 -1
- package/dist/ui/AppShell.svelte +1 -1
- package/dist/ui/BootstrapForm.svelte +1 -1
- package/dist/ui/CLAUDE.md +1 -1
- package/dist/ui/ConfirmButton.svelte +2 -2
- package/dist/ui/ConfirmButton.svelte.d.ts +1 -1
- package/dist/ui/LoginForm.svelte +1 -1
- package/dist/ui/MenuLink.svelte +1 -1
- package/dist/ui/MenuLink.svelte.d.ts +1 -1
- package/dist/ui/PopoverButton.svelte +1 -1
- package/dist/ui/PopoverButton.svelte.d.ts +1 -1
- package/dist/ui/SignupForm.svelte +1 -1
- package/dist/ui/account_sessions_state.svelte.js +1 -1
- package/dist/ui/admin_accounts_state.svelte.d.ts +1 -1
- package/dist/ui/admin_accounts_state.svelte.js +1 -1
- package/dist/ui/admin_invites_state.svelte.d.ts +1 -1
- package/dist/ui/admin_invites_state.svelte.js +1 -1
- package/dist/ui/admin_sessions_state.svelte.d.ts +1 -1
- package/dist/ui/app_settings_state.svelte.js +1 -1
- package/dist/ui/async_slot.svelte.d.ts +2 -2
- package/dist/ui/async_slot.svelte.js +2 -2
- package/dist/ui/audit_log_state.svelte.js +1 -1
- package/dist/ui/auth_state.svelte.d.ts +1 -1
- package/dist/ui/auth_state.svelte.js +3 -3
- package/dist/ui/format_scope.js +1 -1
- package/dist/ui/popover.svelte.d.ts +1 -1
- package/dist/ui/popover.svelte.js +2 -2
- package/dist/ui/position_helpers.js +1 -1
- package/dist/ui/role_grant_offers_state.svelte.js +1 -1
- package/dist/ui/sidebar_state.svelte.js +1 -1
- package/dist/ui/table_state.svelte.d.ts +1 -1
- package/dist/ui/table_state.svelte.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -33,8 +33,8 @@ Some projects using fuz_app are in progress and will be open source soon.
|
|
|
33
33
|
Usage currently looks something like this:
|
|
34
34
|
|
|
35
35
|
```ts
|
|
36
|
-
import {create_app_backend} from '@fuzdev/fuz_app/server/app_backend.
|
|
37
|
-
import {create_app_server} from '@fuzdev/fuz_app/server/app_server.
|
|
36
|
+
import {create_app_backend} from '@fuzdev/fuz_app/server/app_backend.ts';
|
|
37
|
+
import {create_app_server} from '@fuzdev/fuz_app/server/app_server.ts';
|
|
38
38
|
|
|
39
39
|
const backend = await create_app_backend({...});
|
|
40
40
|
|
|
@@ -38,10 +38,10 @@ interface ImportItem {
|
|
|
38
38
|
* @example
|
|
39
39
|
* ```typescript
|
|
40
40
|
* const imports = new ImportBuilder();
|
|
41
|
-
* imports.add_types('./types.
|
|
42
|
-
* imports.add('./utils.
|
|
43
|
-
* imports.add_type('./utils.
|
|
44
|
-
* imports.add('./action_specs.
|
|
41
|
+
* imports.add_types('./types.ts', 'Foo', 'Bar');
|
|
42
|
+
* imports.add('./utils.ts', 'helper');
|
|
43
|
+
* imports.add_type('./utils.ts', 'HelperOptions');
|
|
44
|
+
* imports.add('./action_specs.ts', '* as specs');
|
|
45
45
|
*
|
|
46
46
|
* // Generates:
|
|
47
47
|
* // import type {Foo, Bar} from './types.js';
|
|
@@ -89,12 +89,12 @@ export declare class ImportBuilder {
|
|
|
89
89
|
}
|
|
90
90
|
/** Phases an executor can handle for the given spec — kind + initiator → set of phases. */
|
|
91
91
|
export declare const get_executor_phases: (spec: ActionSpecUnion, executor: "frontend" | "backend") => Array<ActionEventPhase>;
|
|
92
|
-
/** Default `collections_path` — every consumer's gen producers point at the sibling `action_collections.
|
|
93
|
-
export declare const DEFAULT_COLLECTIONS_PATH = "./action_collections.
|
|
94
|
-
/** Default `specs_module` — sibling `action_specs.
|
|
95
|
-
export declare const DEFAULT_SPECS_MODULE = "./action_specs.
|
|
96
|
-
/** Default `metatypes_path` — sibling `action_metatypes.
|
|
97
|
-
export declare const DEFAULT_METATYPES_PATH = "./action_metatypes.
|
|
92
|
+
/** Default `collections_path` — every consumer's gen producers point at the sibling `action_collections.ts`. */
|
|
93
|
+
export declare const DEFAULT_COLLECTIONS_PATH = "./action_collections.ts";
|
|
94
|
+
/** Default `specs_module` — sibling `action_specs.ts` namespace bundled by the consumer. */
|
|
95
|
+
export declare const DEFAULT_SPECS_MODULE = "./action_specs.ts";
|
|
96
|
+
/** Default `metatypes_path` — sibling `action_metatypes.ts` carrying the generated `ActionMethod`. */
|
|
97
|
+
export declare const DEFAULT_METATYPES_PATH = "./action_metatypes.ts";
|
|
98
98
|
/**
|
|
99
99
|
* Gets the handler return type for a specific phase and spec. Adds an
|
|
100
100
|
* `ActionOutputs` import (from `collections_path`) when the phase carries an
|
|
@@ -117,7 +117,7 @@ export declare const get_handler_return_type: (spec: ActionSpecUnion, phase: Act
|
|
|
117
117
|
* @param options.action_event_type - custom type name to use instead of `ActionEvent`
|
|
118
118
|
* (consumers can define a narrowed type that carries typed input/output via their codegen maps)
|
|
119
119
|
* @param options.collections_path - Import path the side-effect `ActionOutputs` import
|
|
120
|
-
* resolves to. Defaults to `'./action_collections.
|
|
120
|
+
* resolves to. Defaults to `'./action_collections.ts'`.
|
|
121
121
|
*/
|
|
122
122
|
export declare const generate_phase_handlers: (spec: ActionSpecUnion, executor: "frontend" | "backend", imports: ImportBuilder, options?: {
|
|
123
123
|
action_event_type?: string;
|
|
@@ -172,7 +172,7 @@ ActingActor})` and other all-optional-fields strict objects. The second
|
|
|
172
172
|
* `Result<{value, error}>` like async methods. Set to `false` if your
|
|
173
173
|
* `FrontendActionsApi` treats every method uniformly.
|
|
174
174
|
* @param options.collections_path - Import path that `ActionInputs` /
|
|
175
|
-
* `ActionOutputs` resolve to. Defaults to `'./action_collections.
|
|
175
|
+
* `ActionOutputs` resolve to. Defaults to `'./action_collections.ts'`.
|
|
176
176
|
* @returns one line like `foo: (input: ActionInputs['foo'], options?: RpcClientCallOptions) => Promise<Result<...>>;`
|
|
177
177
|
*/
|
|
178
178
|
export declare const generate_actions_api_method_signature: (spec: ActionSpecUnion, imports: ImportBuilder, options?: {
|
|
@@ -189,7 +189,7 @@ export declare const action_method_enum_kinds_all: ReadonlySet<ActionMethodEnumK
|
|
|
189
189
|
* and registers no imports — the caller owns its namespace setup (the
|
|
190
190
|
* multi-source case where specs come from several modules). Otherwise,
|
|
191
191
|
* registers `* as specs from specs_module` (defaulting to
|
|
192
|
-
* `'./action_specs.
|
|
192
|
+
* `'./action_specs.ts'`) on `imports` and returns
|
|
193
193
|
* `(spec) => 'specs.' + to_action_spec_identifier(spec.method)`.
|
|
194
194
|
*
|
|
195
195
|
* Used internally by every multi-source-aware helper in this module
|
|
@@ -318,7 +318,7 @@ export declare const generate_action_inputs_outputs: (specs: ReadonlyArray<Actio
|
|
|
318
318
|
* `false`, adds `ActionInputs` / `ActionOutputs` type imports from
|
|
319
319
|
* `collections_path`.
|
|
320
320
|
* @param options.collections_path - import path used when `same_file: false`.
|
|
321
|
-
* Defaults to `'./action_collections.
|
|
321
|
+
* Defaults to `'./action_collections.ts'`. Ignored when `same_file: true`
|
|
322
322
|
* — `same_file` is the file-layout switch; `collections_path` is just the
|
|
323
323
|
* path the import resolves to.
|
|
324
324
|
*/
|
|
@@ -416,8 +416,8 @@ export declare const generate_backend_actions_api: (specs: ReadonlyArray<ActionS
|
|
|
416
416
|
* Pair with `generate_action_method_enums` emitting the `'backend_handled'` kind.
|
|
417
417
|
* @param options.context_type - default `'BackendHandlerContext'`. Caller's
|
|
418
418
|
* handler context type — must be in scope at the emit site.
|
|
419
|
-
* @param options.collections_path - default `'./action_collections.
|
|
420
|
-
* @param options.metatypes_path - default `'./action_metatypes.
|
|
419
|
+
* @param options.collections_path - default `'./action_collections.ts'`.
|
|
420
|
+
* @param options.metatypes_path - default `'./action_metatypes.ts'`.
|
|
421
421
|
*/
|
|
422
422
|
export declare const generate_backend_action_handlers_map: (imports: ImportBuilder, options?: {
|
|
423
423
|
type_name?: string;
|
|
@@ -457,8 +457,8 @@ export interface SpecSource {
|
|
|
457
457
|
* @example
|
|
458
458
|
* ```ts
|
|
459
459
|
* const sources = [
|
|
460
|
-
* {ns: 'tx_specs', module: './action_specs.
|
|
461
|
-
* {ns: 'admin_specs', module: '@fuzdev/fuz_app/auth/admin_action_specs.
|
|
460
|
+
* {ns: 'tx_specs', module: './action_specs.ts', specs: all_zap_action_specs},
|
|
461
|
+
* {ns: 'admin_specs', module: '@fuzdev/fuz_app/auth/admin_action_specs.ts', specs: all_admin_action_specs},
|
|
462
462
|
* ];
|
|
463
463
|
*
|
|
464
464
|
* export const gen: Gen = ({origin_path}) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UnreachableError } from '@fuzdev/fuz_util/error.
|
|
2
|
-
import { zod_get_base_type } from '@fuzdev/fuz_util/zod.
|
|
1
|
+
import { UnreachableError } from '@fuzdev/fuz_util/error.ts';
|
|
2
|
+
import { zod_get_base_type } from '@fuzdev/fuz_util/zod.ts';
|
|
3
3
|
import { ActionRegistry } from './action_registry.js';
|
|
4
4
|
/**
|
|
5
5
|
* Method names of fuz_app's protocol actions — `heartbeat` (auth-aware client
|
|
@@ -35,10 +35,10 @@ export const is_protocol_action_method = (method) => PROTOCOL_METHOD_SET.has(met
|
|
|
35
35
|
* @example
|
|
36
36
|
* ```typescript
|
|
37
37
|
* const imports = new ImportBuilder();
|
|
38
|
-
* imports.add_types('./types.
|
|
39
|
-
* imports.add('./utils.
|
|
40
|
-
* imports.add_type('./utils.
|
|
41
|
-
* imports.add('./action_specs.
|
|
38
|
+
* imports.add_types('./types.ts', 'Foo', 'Bar');
|
|
39
|
+
* imports.add('./utils.ts', 'helper');
|
|
40
|
+
* imports.add_type('./utils.ts', 'HelperOptions');
|
|
41
|
+
* imports.add('./action_specs.ts', '* as specs');
|
|
42
42
|
*
|
|
43
43
|
* // Generates:
|
|
44
44
|
* // import type {Foo, Bar} from './types.js';
|
|
@@ -229,12 +229,12 @@ export const get_executor_phases = (spec, executor) => {
|
|
|
229
229
|
}
|
|
230
230
|
return phases;
|
|
231
231
|
};
|
|
232
|
-
/** Default `collections_path` — every consumer's gen producers point at the sibling `action_collections.
|
|
233
|
-
export const DEFAULT_COLLECTIONS_PATH = './action_collections.
|
|
234
|
-
/** Default `specs_module` — sibling `action_specs.
|
|
235
|
-
export const DEFAULT_SPECS_MODULE = './action_specs.
|
|
236
|
-
/** Default `metatypes_path` — sibling `action_metatypes.
|
|
237
|
-
export const DEFAULT_METATYPES_PATH = './action_metatypes.
|
|
232
|
+
/** Default `collections_path` — every consumer's gen producers point at the sibling `action_collections.ts`. */
|
|
233
|
+
export const DEFAULT_COLLECTIONS_PATH = './action_collections.ts';
|
|
234
|
+
/** Default `specs_module` — sibling `action_specs.ts` namespace bundled by the consumer. */
|
|
235
|
+
export const DEFAULT_SPECS_MODULE = './action_specs.ts';
|
|
236
|
+
/** Default `metatypes_path` — sibling `action_metatypes.ts` carrying the generated `ActionMethod`. */
|
|
237
|
+
export const DEFAULT_METATYPES_PATH = './action_metatypes.ts';
|
|
238
238
|
/**
|
|
239
239
|
* Gets the handler return type for a specific phase and spec. Adds an
|
|
240
240
|
* `ActionOutputs` import (from `collections_path`) when the phase carries an
|
|
@@ -273,7 +273,7 @@ export const get_handler_return_type = (spec, phase, imports, collections_path =
|
|
|
273
273
|
* @param options.action_event_type - custom type name to use instead of `ActionEvent`
|
|
274
274
|
* (consumers can define a narrowed type that carries typed input/output via their codegen maps)
|
|
275
275
|
* @param options.collections_path - Import path the side-effect `ActionOutputs` import
|
|
276
|
-
* resolves to. Defaults to `'./action_collections.
|
|
276
|
+
* resolves to. Defaults to `'./action_collections.ts'`.
|
|
277
277
|
*/
|
|
278
278
|
export const generate_phase_handlers = (spec, executor, imports, options) => {
|
|
279
279
|
const { method } = spec;
|
|
@@ -285,7 +285,7 @@ export const generate_phase_handlers = (spec, executor, imports, options) => {
|
|
|
285
285
|
const collections_path = options?.collections_path ?? DEFAULT_COLLECTIONS_PATH;
|
|
286
286
|
// Only add the default ActionEvent import if using the default type name
|
|
287
287
|
if (action_event_type === 'ActionEvent') {
|
|
288
|
-
imports.add_type('@fuzdev/fuz_app/actions/action_event.
|
|
288
|
+
imports.add_type('@fuzdev/fuz_app/actions/action_event.ts', 'ActionEvent');
|
|
289
289
|
}
|
|
290
290
|
const phase_handlers = phases
|
|
291
291
|
.map((phase) => {
|
|
@@ -348,7 +348,7 @@ ActingActor})` and other all-optional-fields strict objects. The second
|
|
|
348
348
|
* `Result<{value, error}>` like async methods. Set to `false` if your
|
|
349
349
|
* `FrontendActionsApi` treats every method uniformly.
|
|
350
350
|
* @param options.collections_path - Import path that `ActionInputs` /
|
|
351
|
-
* `ActionOutputs` resolve to. Defaults to `'./action_collections.
|
|
351
|
+
* `ActionOutputs` resolve to. Defaults to `'./action_collections.ts'`.
|
|
352
352
|
* @returns one line like `foo: (input: ActionInputs['foo'], options?: RpcClientCallOptions) => Promise<Result<...>>;`
|
|
353
353
|
*/
|
|
354
354
|
export const generate_actions_api_method_signature = (spec, imports, options) => {
|
|
@@ -366,7 +366,7 @@ export const generate_actions_api_method_signature = (spec, imports, options) =>
|
|
|
366
366
|
const is_async = spec.kind === 'request_response' || spec.kind === 'remote_notification' || spec.async;
|
|
367
367
|
const options_param = is_async ? ', options?: RpcClientCallOptions' : '';
|
|
368
368
|
if (is_async) {
|
|
369
|
-
imports.add_type('@fuzdev/fuz_app/actions/rpc_client.
|
|
369
|
+
imports.add_type('@fuzdev/fuz_app/actions/rpc_client.ts', 'RpcClientCallOptions');
|
|
370
370
|
}
|
|
371
371
|
const result_return = `Result<{value: ActionOutputs['${spec.method}']}, {error: JsonrpcErrorObject}>`;
|
|
372
372
|
const return_type = is_async
|
|
@@ -376,8 +376,8 @@ export const generate_actions_api_method_signature = (spec, imports, options) =>
|
|
|
376
376
|
: result_return;
|
|
377
377
|
const wraps_in_result = is_async || !sync_returns_value;
|
|
378
378
|
if (wraps_in_result) {
|
|
379
|
-
imports.add_type('@fuzdev/fuz_util/result.
|
|
380
|
-
imports.add_type('@fuzdev/fuz_app/http/jsonrpc.
|
|
379
|
+
imports.add_type('@fuzdev/fuz_util/result.ts', 'Result');
|
|
380
|
+
imports.add_type('@fuzdev/fuz_app/http/jsonrpc.ts', 'JsonrpcErrorObject');
|
|
381
381
|
}
|
|
382
382
|
return `${spec.method}: (${input_param}${options_param}) => ${return_type};`;
|
|
383
383
|
};
|
|
@@ -442,7 +442,7 @@ const filter_protocol_actions = (specs, include_protocol_actions) => include_pro
|
|
|
442
442
|
* and registers no imports — the caller owns its namespace setup (the
|
|
443
443
|
* multi-source case where specs come from several modules). Otherwise,
|
|
444
444
|
* registers `* as specs from specs_module` (defaulting to
|
|
445
|
-
* `'./action_specs.
|
|
445
|
+
* `'./action_specs.ts'`) on `imports` and returns
|
|
446
446
|
* `(spec) => 'specs.' + to_action_spec_identifier(spec.method)`.
|
|
447
447
|
*
|
|
448
448
|
* Used internally by every multi-source-aware helper in this module
|
|
@@ -552,9 +552,9 @@ export const generate_action_method_enum_block = (specs, imports, options) => {
|
|
|
552
552
|
export const generate_typed_action_event_alias = (imports, options) => {
|
|
553
553
|
const collections_path = options?.collections_path ?? DEFAULT_COLLECTIONS_PATH;
|
|
554
554
|
const metatypes_path = options?.metatypes_path ?? DEFAULT_METATYPES_PATH;
|
|
555
|
-
imports.add_type('@fuzdev/fuz_app/actions/action_event.
|
|
556
|
-
imports.add_type('@fuzdev/fuz_app/actions/action_spec.
|
|
557
|
-
imports.add_type('@fuzdev/fuz_app/actions/action_event_types.
|
|
555
|
+
imports.add_type('@fuzdev/fuz_app/actions/action_event.ts', 'ActionEvent');
|
|
556
|
+
imports.add_type('@fuzdev/fuz_app/actions/action_spec.ts', 'ActionEventPhase');
|
|
557
|
+
imports.add_type('@fuzdev/fuz_app/actions/action_event_types.ts', 'ActionEventStep');
|
|
558
558
|
imports.add_type(collections_path, 'ActionEventDatas');
|
|
559
559
|
imports.add_type(metatypes_path, 'ActionMethod');
|
|
560
560
|
return `/** ActionEvent narrowed with the generated ActionEventDatas for typed input/output. */
|
|
@@ -578,7 +578,7 @@ type TypedActionEvent<
|
|
|
578
578
|
*/
|
|
579
579
|
export const generate_action_specs_record = (specs, imports, options) => {
|
|
580
580
|
const filtered = filter_protocol_actions(specs, options?.include_protocol_actions);
|
|
581
|
-
imports.add_type('@fuzdev/fuz_app/actions/action_spec.
|
|
581
|
+
imports.add_type('@fuzdev/fuz_app/actions/action_spec.ts', 'ActionSpecUnion');
|
|
582
582
|
if (filtered.length === 0) {
|
|
583
583
|
// Empty spec list — emit minimal valid output and skip the `* as specs`
|
|
584
584
|
// import that would have nothing to reference.
|
|
@@ -691,7 +691,7 @@ ${outputs_type}
|
|
|
691
691
|
* `false`, adds `ActionInputs` / `ActionOutputs` type imports from
|
|
692
692
|
* `collections_path`.
|
|
693
693
|
* @param options.collections_path - import path used when `same_file: false`.
|
|
694
|
-
* Defaults to `'./action_collections.
|
|
694
|
+
* Defaults to `'./action_collections.ts'`. Ignored when `same_file: true`
|
|
695
695
|
* — `same_file` is the file-layout switch; `collections_path` is just the
|
|
696
696
|
* path the import resolves to.
|
|
697
697
|
*/
|
|
@@ -718,7 +718,7 @@ export interface ActionEventDatas {}`;
|
|
|
718
718
|
: spec.kind === 'remote_notification'
|
|
719
719
|
? 'ActionEventRemoteNotificationData'
|
|
720
720
|
: 'ActionEventLocalCallData';
|
|
721
|
-
imports.add_type('@fuzdev/fuz_app/actions/action_event_data.
|
|
721
|
+
imports.add_type('@fuzdev/fuz_app/actions/action_event_data.ts', data_type);
|
|
722
722
|
const type_args = spec.kind === 'remote_notification'
|
|
723
723
|
? `<'${spec.method}', ActionInputs['${spec.method}']>`
|
|
724
724
|
: `<'${spec.method}', ActionInputs['${spec.method}'], ActionOutputs['${spec.method}']>`;
|
|
@@ -851,7 +851,7 @@ export const generate_backend_actions_api = (specs, imports, options) => {
|
|
|
851
851
|
const protocol_filtered = filter_protocol_actions(specs, options?.include_protocol_actions);
|
|
852
852
|
const registry = new ActionRegistry([...protocol_filtered]);
|
|
853
853
|
const broadcast = registry.broadcast_specs;
|
|
854
|
-
imports.add_type('@fuzdev/fuz_app/actions/action_spec.
|
|
854
|
+
imports.add_type('@fuzdev/fuz_app/actions/action_spec.ts', 'ActionSpecUnion');
|
|
855
855
|
const interface_doc = `/**
|
|
856
856
|
* Typed dispatch surface for backend-initiated calls. Symmetric counterpart
|
|
857
857
|
* of \`FrontendActionsApi\`. Today exposes broadcast-style \`remote_notification\`
|
|
@@ -900,8 +900,8 @@ export const broadcast_action_specs: ReadonlyArray<ActionSpecUnion> = [${array_b
|
|
|
900
900
|
* Pair with `generate_action_method_enums` emitting the `'backend_handled'` kind.
|
|
901
901
|
* @param options.context_type - default `'BackendHandlerContext'`. Caller's
|
|
902
902
|
* handler context type — must be in scope at the emit site.
|
|
903
|
-
* @param options.collections_path - default `'./action_collections.
|
|
904
|
-
* @param options.metatypes_path - default `'./action_metatypes.
|
|
903
|
+
* @param options.collections_path - default `'./action_collections.ts'`.
|
|
904
|
+
* @param options.metatypes_path - default `'./action_metatypes.ts'`.
|
|
905
905
|
*/
|
|
906
906
|
export const generate_backend_action_handlers_map = (imports, options) => {
|
|
907
907
|
const type_name = options?.type_name ?? 'BackendActionHandlers';
|
|
@@ -943,8 +943,8 @@ export type ${type_name} = {
|
|
|
943
943
|
* @example
|
|
944
944
|
* ```ts
|
|
945
945
|
* const sources = [
|
|
946
|
-
* {ns: 'tx_specs', module: './action_specs.
|
|
947
|
-
* {ns: 'admin_specs', module: '@fuzdev/fuz_app/auth/admin_action_specs.
|
|
946
|
+
* {ns: 'tx_specs', module: './action_specs.ts', specs: all_zap_action_specs},
|
|
947
|
+
* {ns: 'admin_specs', module: '@fuzdev/fuz_app/auth/admin_action_specs.ts', specs: all_admin_action_specs},
|
|
948
948
|
* ];
|
|
949
949
|
*
|
|
950
950
|
* export const gen: Gen = ({origin_path}) => {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
9
|
import { z } from 'zod';
|
|
10
|
-
import { create_uuid } from '@fuzdev/fuz_util/id.
|
|
10
|
+
import { create_uuid } from '@fuzdev/fuz_util/id.ts';
|
|
11
11
|
import { create_jsonrpc_request, create_jsonrpc_response, create_jsonrpc_error_response, create_jsonrpc_notification, to_jsonrpc_params, to_jsonrpc_result, is_jsonrpc_error_response, } from '../http/jsonrpc_helpers.js';
|
|
12
12
|
import { jsonrpc_error_messages, ThrownJsonrpcError } from '../http/jsonrpc_errors.js';
|
|
13
13
|
import { ActionEventData } from './action_event_data.js';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import type { Result } from '@fuzdev/fuz_util/result.
|
|
6
|
+
import type { Result } from '@fuzdev/fuz_util/result.ts';
|
|
7
7
|
import { type ActionEventStep, type ActionExecutor } from './action_event_types.js';
|
|
8
8
|
import type { ActionEventData, ActionEventRequestResponseData, ActionEventRemoteNotificationData, ActionEventLocalCallData } from './action_event_data.js';
|
|
9
9
|
import type { ActionEventPhase, ActionInitiator, ActionKind } from './action_spec.js';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
import { z } from 'zod';
|
|
7
|
-
import type { Logger } from '@fuzdev/fuz_util/log.
|
|
7
|
+
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
8
8
|
import type { ActionEventPhase, ActionKind, ActionSpecUnion } from './action_spec.js';
|
|
9
9
|
export declare const ActionExecutor: z.ZodEnum<{
|
|
10
10
|
frontend: "frontend";
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* @module
|
|
13
13
|
*/
|
|
14
14
|
import { z } from 'zod';
|
|
15
|
-
import type { Logger } from '@fuzdev/fuz_util/log.
|
|
16
|
-
import type { Uuid } from '@fuzdev/fuz_util/id.
|
|
15
|
+
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
16
|
+
import type { Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
17
17
|
import type { RequestResponseActionSpec } from './action_spec.js';
|
|
18
18
|
import { type RouteSpec } from '../http/route_spec.js';
|
|
19
19
|
import { type RequestActorContext, type RequestContext } from '../auth/request_context.js';
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*
|
|
18
18
|
* @module
|
|
19
19
|
*/
|
|
20
|
-
import { type Logger as LoggerType } from '@fuzdev/fuz_util/log.
|
|
20
|
+
import { type Logger as LoggerType } from '@fuzdev/fuz_util/log.ts';
|
|
21
21
|
import type { ActionPeer } from './action_peer.js';
|
|
22
22
|
import type { ActionSpecUnion } from './action_spec.js';
|
|
23
23
|
import { type ConnectionIdentity } from './transports_ws_backend.js';
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*
|
|
18
18
|
* @module
|
|
19
19
|
*/
|
|
20
|
-
import { Logger } from '@fuzdev/fuz_util/log.
|
|
20
|
+
import { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
21
21
|
import { create_jsonrpc_notification, to_jsonrpc_params } from '../http/jsonrpc_helpers.js';
|
|
22
22
|
import { is_filterable_broadcast_transport, } from './transports_ws_backend.js';
|
|
23
23
|
/**
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
*
|
|
38
38
|
* @module
|
|
39
39
|
*/
|
|
40
|
-
import type { Logger } from '@fuzdev/fuz_util/log.
|
|
41
|
-
import type { Uuid } from '@fuzdev/fuz_util/id.
|
|
40
|
+
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
41
|
+
import type { Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
42
42
|
import { type RequestContext } from '../auth/request_context.js';
|
|
43
43
|
import { type CredentialType } from '../hono_context.js';
|
|
44
44
|
import type { Db } from '../db/db.js';
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
*/
|
|
29
29
|
import type { Hono } from 'hono';
|
|
30
30
|
import type { UpgradeWebSocket, WSContext } from 'hono/ws';
|
|
31
|
-
import { type Logger as LoggerType } from '@fuzdev/fuz_util/log.
|
|
32
|
-
import type { Uuid } from '@fuzdev/fuz_util/id.
|
|
31
|
+
import { type Logger as LoggerType } from '@fuzdev/fuz_util/log.ts';
|
|
32
|
+
import type { Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
33
33
|
import type { RateLimiter } from '../rate_limiter.js';
|
|
34
34
|
import type { Db } from '../db/db.js';
|
|
35
35
|
import { type Action } from './action_types.js';
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
*
|
|
27
27
|
* @module
|
|
28
28
|
*/
|
|
29
|
-
import { wait } from '@fuzdev/fuz_util/async.
|
|
30
|
-
import { Logger } from '@fuzdev/fuz_util/log.
|
|
29
|
+
import { wait } from '@fuzdev/fuz_util/async.ts';
|
|
30
|
+
import { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
31
31
|
import { get_request_context, require_request_context, } from '../auth/request_context.js';
|
|
32
32
|
import { hash_session_token } from '../auth/session_queries.js';
|
|
33
33
|
import { get_client_ip } from '../http/client_ip.js';
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*
|
|
21
21
|
* @module
|
|
22
22
|
*/
|
|
23
|
-
import { Logger } from '@fuzdev/fuz_util/log.
|
|
23
|
+
import { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
24
24
|
import { apply_authorization_phase, REQUEST_CONTEXT_KEY, require_auth, require_role, } from '../auth/request_context.js';
|
|
25
25
|
import { verify_request_source } from '../http/origin.js';
|
|
26
26
|
import { ACCOUNT_ID_KEY, TEST_CONTEXT_PRESET_KEY } from '../hono_context.js';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
import { type Deferred, type AsyncStatus } from '@fuzdev/fuz_util/async.
|
|
8
|
+
import { type Deferred, type AsyncStatus } from '@fuzdev/fuz_util/async.ts';
|
|
9
9
|
import { SvelteMap } from 'svelte/reactivity';
|
|
10
10
|
import { type JsonrpcErrorResponse, type JsonrpcRequestId, type JsonrpcResponseOrError } from '../http/jsonrpc.js';
|
|
11
11
|
/** ISO datetime string for request creation timestamps. */
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
import { create_deferred } from '@fuzdev/fuz_util/async.
|
|
8
|
+
import { create_deferred } from '@fuzdev/fuz_util/async.ts';
|
|
9
9
|
import { SvelteMap } from 'svelte/reactivity';
|
|
10
10
|
import { JSONRPC_INTERNAL_ERROR, } from '../http/jsonrpc.js';
|
|
11
11
|
import { ThrownJsonrpcError, JSONRPC_ERROR_CODES } from '../http/jsonrpc_errors.js';
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @module
|
|
12
12
|
*/
|
|
13
|
-
import type { Result } from '@fuzdev/fuz_util/result.
|
|
13
|
+
import type { Result } from '@fuzdev/fuz_util/result.ts';
|
|
14
14
|
import type { ActionEventEnvironment } from './action_event_types.js';
|
|
15
15
|
import { type ActionEvent } from './action_event.js';
|
|
16
16
|
import type { ActionPeer, ActionPeerSendOptions } from './action_peer.js';
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
*
|
|
24
24
|
* @module
|
|
25
25
|
*/
|
|
26
|
-
import type { Logger } from '@fuzdev/fuz_util/log.
|
|
27
|
-
import type { AsyncStatus } from '@fuzdev/fuz_util/async.
|
|
26
|
+
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
27
|
+
import type { AsyncStatus } from '@fuzdev/fuz_util/async.ts';
|
|
28
28
|
import { type JsonrpcRequestId } from '../http/jsonrpc.js';
|
|
29
29
|
import type { WebsocketConnection } from './transports_ws.js';
|
|
30
30
|
/** Default WebSocket close code (normal closure). */
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @module
|
|
13
13
|
*/
|
|
14
|
-
import { to_error_message } from '@fuzdev/fuz_util/error.
|
|
14
|
+
import { to_error_message } from '@fuzdev/fuz_util/error.ts';
|
|
15
15
|
import { ThrownJsonrpcError, jsonrpc_error_messages } from '../http/jsonrpc_errors.js';
|
|
16
16
|
import { is_jsonrpc_notification, is_jsonrpc_request, to_jsonrpc_message_id, to_jsonrpc_result, create_jsonrpc_response, create_jsonrpc_error_response, } from '../http/jsonrpc_helpers.js';
|
|
17
17
|
/**
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
*
|
|
25
25
|
* @module
|
|
26
26
|
*/
|
|
27
|
-
import type { Logger } from '@fuzdev/fuz_util/log.
|
|
27
|
+
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
28
28
|
import type { AuditLogEvent } from '../auth/audit_log_schema.js';
|
|
29
29
|
import type { BackendWebsocketTransport } from './transports_ws_backend.js';
|
|
30
30
|
/**
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
7
|
import type { WSContext } from 'hono/ws';
|
|
8
|
-
import { type Uuid } from '@fuzdev/fuz_util/id.
|
|
8
|
+
import { type Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
9
9
|
import type { JsonrpcMessageFromServerToClient, JsonrpcNotification, JsonrpcRequest, JsonrpcResponseOrError, JsonrpcErrorResponse } from '../http/jsonrpc.js';
|
|
10
10
|
import { type Transport, type TransportSendOptions } from './transports.js';
|
|
11
11
|
/**
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
-
import { to_error_message } from '@fuzdev/fuz_util/error.
|
|
8
|
-
import { create_uuid } from '@fuzdev/fuz_util/id.
|
|
7
|
+
import { to_error_message } from '@fuzdev/fuz_util/error.ts';
|
|
8
|
+
import { create_uuid } from '@fuzdev/fuz_util/id.ts';
|
|
9
9
|
import { jsonrpc_error_messages } from '../http/jsonrpc_errors.js';
|
|
10
10
|
import { create_jsonrpc_error_response, to_jsonrpc_message_id, is_jsonrpc_request, } from '../http/jsonrpc_helpers.js';
|
|
11
11
|
import { WS_CLOSE_SESSION_REVOKED } from './transports.js';
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
10
|
import { z } from 'zod';
|
|
11
|
-
import { Blake3Hash } from '@fuzdev/fuz_util/hash_blake3.
|
|
11
|
+
import { Blake3Hash } from '@fuzdev/fuz_util/hash_blake3.ts';
|
|
12
12
|
import { AuthSessionJson, ClientApiTokenJson, SessionAccountJson } from './account_schema.js';
|
|
13
13
|
import { ApiTokenId } from './api_token.js';
|
|
14
14
|
// -- Input/output schemas ---------------------------------------------------
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* @module
|
|
18
18
|
*/
|
|
19
19
|
import { z } from 'zod';
|
|
20
|
-
import { Uuid } from '@fuzdev/fuz_util/id.
|
|
20
|
+
import { Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
21
21
|
import { Username, Email } from '../primitive_schemas.js';
|
|
22
22
|
/** Account — authentication identity. You log in as an account. */
|
|
23
23
|
export interface Account {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* @module
|
|
18
18
|
*/
|
|
19
19
|
import { z } from 'zod';
|
|
20
|
-
import { Uuid } from '@fuzdev/fuz_util/id.
|
|
20
|
+
import { Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
21
21
|
import { Username, Email } from '../primitive_schemas.js';
|
|
22
22
|
/**
|
|
23
23
|
* Maximum length of the optional free-form `revoked_reason` attached to a
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
* @module
|
|
49
49
|
*/
|
|
50
50
|
import { z } from 'zod';
|
|
51
|
-
import { Uuid } from '@fuzdev/fuz_util/id.
|
|
51
|
+
import { Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
52
52
|
/**
|
|
53
53
|
* Hard cap on the number of ids resolvable in one call. Bounds the
|
|
54
54
|
* batched username-enumeration surface.
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
*
|
|
28
28
|
* @module
|
|
29
29
|
*/
|
|
30
|
-
import type { Uuid } from '@fuzdev/fuz_util/id.
|
|
30
|
+
import type { Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
31
31
|
import type { QueryDeps } from '../db/query_deps.js';
|
|
32
32
|
/** Row shape returned to handlers — wire mapping happens at the action layer. */
|
|
33
33
|
export interface ActorLookupRow {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
* @module
|
|
73
73
|
*/
|
|
74
74
|
import { z } from 'zod';
|
|
75
|
-
import { Uuid } from '@fuzdev/fuz_util/id.
|
|
75
|
+
import { Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
76
76
|
import { ActorLookupEntryJson } from './actor_lookup_action_specs.js';
|
|
77
77
|
/**
|
|
78
78
|
* Hard cap on the number of rows returned per call. Bounds the search-result
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
*
|
|
52
52
|
* @module
|
|
53
53
|
*/
|
|
54
|
-
import type { Uuid } from '@fuzdev/fuz_util/id.
|
|
54
|
+
import type { Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
55
55
|
import type { QueryDeps } from '../db/query_deps.js';
|
|
56
56
|
import type { ActorLookupRow } from './actor_lookup_queries.js';
|
|
57
57
|
/** Inputs for `query_actor_search`. */
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* @module
|
|
17
17
|
*/
|
|
18
18
|
import { z } from 'zod';
|
|
19
|
-
import { Uuid } from '@fuzdev/fuz_util/id.
|
|
19
|
+
import { Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
20
20
|
import { ROLE_ADMIN, ROLE_KEEPER, RoleName } from './role_schema.js';
|
|
21
21
|
import { CREDENTIAL_TYPE_DAEMON_TOKEN } from './credential_type_schema.js';
|
|
22
22
|
import { AdminAccountEntryJson } from './account_schema.js';
|
package/dist/auth/api_token.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
11
|
import { z } from 'zod';
|
|
12
|
-
import { hash_blake3 } from '@fuzdev/fuz_util/hash_blake3.
|
|
12
|
+
import { hash_blake3 } from '@fuzdev/fuz_util/hash_blake3.ts';
|
|
13
13
|
import { generate_random_base64url } from '../crypto.js';
|
|
14
14
|
/** Prefix for all fuz API tokens (enables secret scanning). */
|
|
15
15
|
export const API_TOKEN_PREFIX = 'secret_fuz_token_';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import type { Logger } from '@fuzdev/fuz_util/log.
|
|
6
|
+
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
7
7
|
import type { QueryDeps } from '../db/query_deps.js';
|
|
8
8
|
import type { ApiToken } from './account_schema.js';
|
|
9
9
|
/** Extended deps for `query_validate_api_token` which needs a logger. */
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
8
|
import { z } from 'zod';
|
|
9
|
-
import { Uuid } from '@fuzdev/fuz_util/id.
|
|
9
|
+
import { Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
10
10
|
/** Zod schema for client-safe app settings data. */
|
|
11
11
|
export const AppSettingsJson = z.strictObject({
|
|
12
12
|
open_signup: z.boolean(),
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
*
|
|
40
40
|
* @module
|
|
41
41
|
*/
|
|
42
|
-
import type { Logger } from '@fuzdev/fuz_util/log.
|
|
43
|
-
import type { Uuid } from '@fuzdev/fuz_util/id.
|
|
42
|
+
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
43
|
+
import type { Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
44
44
|
import type { Db } from '../db/db.js';
|
|
45
45
|
import type { RequestActorContext } from './request_context.js';
|
|
46
46
|
import { type AuditLogConfig, type AuditLogEvent, type AuditLogInput } from './audit_log_schema.js';
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @module
|
|
13
13
|
*/
|
|
14
|
-
import type { Logger } from '@fuzdev/fuz_util/log.
|
|
14
|
+
import type { Logger } from '@fuzdev/fuz_util/log.ts';
|
|
15
15
|
import type { RouteSpec } from '../http/route_spec.js';
|
|
16
16
|
import { type SseStream, type SseNotification } from '../realtime/sse.js';
|
|
17
17
|
import type { SubscribeOptions } from '../realtime/subscriber_registry.js';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
11
|
import { z } from 'zod';
|
|
12
|
-
import { Uuid } from '@fuzdev/fuz_util/id.
|
|
12
|
+
import { Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
13
13
|
/**
|
|
14
14
|
* All tracked auth event types. Frozen to convert accidental in-process
|
|
15
15
|
* mutation (test cross-contamination, cast escapes) into loud TypeErrors.
|