@fuzdev/fuz_app 0.67.1 → 0.69.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/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +10 -3
- package/dist/auth/CLAUDE.md +99 -5
- package/dist/auth/account_queries.d.ts +87 -4
- package/dist/auth/account_queries.d.ts.map +1 -1
- package/dist/auth/account_queries.js +107 -17
- package/dist/auth/account_schema.d.ts +19 -0
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +8 -0
- package/dist/auth/admin_action_specs.d.ts +170 -3
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +148 -4
- package/dist/auth/admin_actions.d.ts +4 -14
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +246 -40
- package/dist/auth/audit_log_ddl.d.ts +10 -1
- package/dist/auth/audit_log_ddl.d.ts.map +1 -1
- package/dist/auth/audit_log_ddl.js +13 -4
- package/dist/auth/audit_log_schema.d.ts +34 -1
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +73 -0
- package/dist/auth/auth_ddl.d.ts +2 -2
- package/dist/auth/auth_ddl.d.ts.map +1 -1
- package/dist/auth/auth_ddl.js +10 -2
- package/dist/auth/cell_action_specs.d.ts +1295 -0
- package/dist/auth/cell_action_specs.d.ts.map +1 -0
- package/dist/auth/cell_action_specs.js +397 -0
- package/dist/auth/cell_actions.d.ts +63 -0
- package/dist/auth/cell_actions.d.ts.map +1 -0
- package/dist/auth/cell_actions.js +546 -0
- package/dist/auth/cell_audit_action_specs.d.ts +131 -0
- package/dist/auth/cell_audit_action_specs.d.ts.map +1 -0
- package/dist/auth/cell_audit_action_specs.js +70 -0
- package/dist/auth/cell_audit_actions.d.ts +18 -0
- package/dist/auth/cell_audit_actions.d.ts.map +1 -0
- package/dist/auth/cell_audit_actions.js +59 -0
- package/dist/auth/cell_audit_events.d.ts +28 -0
- package/dist/auth/cell_audit_events.d.ts.map +1 -0
- package/dist/auth/cell_audit_events.js +42 -0
- package/dist/auth/cell_audit_metadata.d.ts +48 -0
- package/dist/auth/cell_audit_metadata.d.ts.map +1 -0
- package/dist/auth/cell_audit_metadata.js +46 -0
- package/dist/auth/cell_authorize.d.ts +88 -0
- package/dist/auth/cell_authorize.d.ts.map +1 -0
- package/dist/auth/cell_authorize.js +172 -0
- package/dist/auth/cell_data_schema.d.ts +44 -0
- package/dist/auth/cell_data_schema.d.ts.map +1 -0
- package/dist/auth/cell_data_schema.js +42 -0
- package/dist/auth/cell_field_action_specs.d.ts +244 -0
- package/dist/auth/cell_field_action_specs.d.ts.map +1 -0
- package/dist/auth/cell_field_action_specs.js +136 -0
- package/dist/auth/cell_field_actions.d.ts +34 -0
- package/dist/auth/cell_field_actions.d.ts.map +1 -0
- package/dist/auth/cell_field_actions.js +153 -0
- package/dist/auth/cell_field_audit_metadata.d.ts +30 -0
- package/dist/auth/cell_field_audit_metadata.d.ts.map +1 -0
- package/dist/auth/cell_field_audit_metadata.js +28 -0
- package/dist/auth/cell_grant_action_specs.d.ts +333 -0
- package/dist/auth/cell_grant_action_specs.d.ts.map +1 -0
- package/dist/auth/cell_grant_action_specs.js +148 -0
- package/dist/auth/cell_grant_actions.d.ts +50 -0
- package/dist/auth/cell_grant_actions.d.ts.map +1 -0
- package/dist/auth/cell_grant_actions.js +208 -0
- package/dist/auth/cell_grant_audit_metadata.d.ts +75 -0
- package/dist/auth/cell_grant_audit_metadata.d.ts.map +1 -0
- package/dist/auth/cell_grant_audit_metadata.js +54 -0
- package/dist/auth/cell_item_action_specs.d.ts +331 -0
- package/dist/auth/cell_item_action_specs.d.ts.map +1 -0
- package/dist/auth/cell_item_action_specs.js +182 -0
- package/dist/auth/cell_item_actions.d.ts +37 -0
- package/dist/auth/cell_item_actions.d.ts.map +1 -0
- package/dist/auth/cell_item_actions.js +204 -0
- package/dist/auth/cell_item_audit_metadata.d.ts +35 -0
- package/dist/auth/cell_item_audit_metadata.d.ts.map +1 -0
- package/dist/auth/cell_item_audit_metadata.js +32 -0
- package/dist/auth/cell_relation_visibility.d.ts +32 -0
- package/dist/auth/cell_relation_visibility.d.ts.map +1 -0
- package/dist/auth/cell_relation_visibility.js +57 -0
- package/dist/auth/deps.d.ts +9 -0
- package/dist/auth/deps.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.d.ts +30 -0
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.js +54 -0
- package/dist/auth/signup_routes.d.ts +0 -3
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +9 -3
- package/dist/auth/standard_rpc_actions.d.ts +5 -5
- package/dist/auth/standard_rpc_actions.js +4 -4
- package/dist/db/CLAUDE.md +118 -0
- package/dist/db/cell_audit_queries.d.ts +26 -0
- package/dist/db/cell_audit_queries.d.ts.map +1 -0
- package/dist/db/cell_audit_queries.js +53 -0
- package/dist/db/cell_ddl.d.ts +151 -0
- package/dist/db/cell_ddl.d.ts.map +1 -0
- package/dist/db/cell_ddl.js +247 -0
- package/dist/db/cell_field_queries.d.ts +105 -0
- package/dist/db/cell_field_queries.d.ts.map +1 -0
- package/dist/db/cell_field_queries.js +113 -0
- package/dist/db/cell_grant_queries.d.ts +132 -0
- package/dist/db/cell_grant_queries.d.ts.map +1 -0
- package/dist/db/cell_grant_queries.js +145 -0
- package/dist/db/cell_history_ddl.d.ts +38 -0
- package/dist/db/cell_history_ddl.d.ts.map +1 -0
- package/dist/db/cell_history_ddl.js +61 -0
- package/dist/db/cell_item_queries.d.ts +107 -0
- package/dist/db/cell_item_queries.d.ts.map +1 -0
- package/dist/db/cell_item_queries.js +119 -0
- package/dist/db/cell_queries.d.ts +327 -0
- package/dist/db/cell_queries.d.ts.map +1 -0
- package/dist/db/cell_queries.js +431 -0
- package/dist/db/fact_ddl.d.ts +38 -0
- package/dist/db/fact_ddl.d.ts.map +1 -0
- package/dist/db/fact_ddl.js +71 -0
- package/dist/db/fact_queries.d.ts +140 -0
- package/dist/db/fact_queries.d.ts.map +1 -0
- package/dist/db/fact_queries.js +161 -0
- package/dist/db/fact_store.d.ts +112 -0
- package/dist/db/fact_store.d.ts.map +1 -0
- package/dist/db/fact_store.js +225 -0
- package/dist/server/app_server.d.ts +1 -7
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +1 -5
- package/dist/server/env.d.ts +2 -0
- package/dist/server/env.d.ts.map +1 -1
- package/dist/server/env.js +6 -0
- package/dist/server/fact_write.d.ts +32 -0
- package/dist/server/fact_write.d.ts.map +1 -0
- package/dist/server/fact_write.js +56 -0
- package/dist/server/file_fact_fetcher.d.ts +42 -0
- package/dist/server/file_fact_fetcher.d.ts.map +1 -0
- package/dist/server/file_fact_fetcher.js +60 -0
- package/dist/server/file_fact_url.d.ts +53 -0
- package/dist/server/file_fact_url.d.ts.map +1 -0
- package/dist/server/file_fact_url.js +52 -0
- package/dist/server/serve_fact_route.d.ts +78 -0
- package/dist/server/serve_fact_route.d.ts.map +1 -0
- package/dist/server/serve_fact_route.js +205 -0
- package/dist/testing/CLAUDE.md +142 -6
- package/dist/testing/app_server.d.ts +46 -0
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +67 -8
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +67 -1
- package/dist/testing/cross_backend/account_lifecycle.d.ts +10 -0
- package/dist/testing/cross_backend/account_lifecycle.d.ts.map +1 -0
- package/dist/testing/cross_backend/account_lifecycle.js +144 -0
- package/dist/testing/cross_backend/actor_lookup.d.ts +10 -0
- package/dist/testing/cross_backend/actor_lookup.d.ts.map +1 -0
- package/dist/testing/cross_backend/actor_lookup.js +83 -0
- package/dist/testing/cross_backend/actor_search.d.ts +6 -0
- package/dist/testing/cross_backend/actor_search.d.ts.map +1 -0
- package/dist/testing/cross_backend/actor_search.js +92 -0
- package/dist/testing/cross_backend/app_settings.d.ts +6 -0
- package/dist/testing/cross_backend/app_settings.d.ts.map +1 -0
- package/dist/testing/cross_backend/app_settings.js +95 -0
- package/dist/testing/cross_backend/backend_config.d.ts +1 -1
- package/dist/testing/cross_backend/capabilities.d.ts +29 -7
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/capabilities.js +3 -1
- package/dist/testing/cross_backend/cell_cross_helpers.d.ts +39 -0
- package/dist/testing/cross_backend/cell_cross_helpers.d.ts.map +1 -0
- package/dist/testing/cross_backend/cell_cross_helpers.js +45 -0
- package/dist/testing/cross_backend/cell_crud.d.ts +4 -0
- package/dist/testing/cross_backend/cell_crud.d.ts.map +1 -0
- package/dist/testing/cross_backend/cell_crud.js +168 -0
- package/dist/testing/cross_backend/cell_grant_role.d.ts +8 -0
- package/dist/testing/cross_backend/cell_grant_role.d.ts.map +1 -0
- package/dist/testing/cross_backend/cell_grant_role.js +102 -0
- package/dist/testing/cross_backend/cell_relations.d.ts +4 -0
- package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -0
- package/dist/testing/cross_backend/cell_relations.js +229 -0
- package/dist/testing/cross_backend/conformance_case.d.ts +144 -0
- package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -0
- package/dist/testing/cross_backend/conformance_case.js +132 -0
- package/dist/testing/cross_backend/conformance_table.d.ts +46 -0
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -0
- package/dist/testing/cross_backend/conformance_table.js +199 -0
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +6 -2
- package/dist/testing/cross_backend/default_spine_surface.d.ts +17 -9
- package/dist/testing/cross_backend/default_spine_surface.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_spine_surface.js +20 -12
- package/dist/testing/cross_backend/origin.d.ts +10 -0
- package/dist/testing/cross_backend/origin.d.ts.map +1 -0
- package/dist/testing/cross_backend/origin.js +73 -0
- package/dist/testing/cross_backend/setup.d.ts +22 -40
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +39 -5
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +90 -2
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +91 -3
- package/dist/testing/cross_backend/xfail.d.ts +15 -0
- package/dist/testing/cross_backend/xfail.d.ts.map +1 -0
- package/dist/testing/cross_backend/xfail.js +37 -0
- package/dist/testing/entities.d.ts.map +1 -1
- package/dist/testing/entities.js +4 -0
- package/dist/testing/integration.d.ts +2 -3
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +20 -85
- package/dist/testing/rate_limiting.d.ts +1 -1
- package/dist/testing/rpc_helpers.d.ts +3 -3
- package/dist/testing/sse_round_trip.d.ts +1 -1
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +0 -1
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +4 -0
- package/dist/ui/AdminAccounts.svelte +84 -35
- package/dist/ui/AdminAccounts.svelte.d.ts.map +1 -1
- package/dist/ui/AdminSessions.svelte +21 -23
- package/dist/ui/AdminSessions.svelte.d.ts.map +1 -1
- package/dist/ui/CLAUDE.md +17 -26
- package/dist/ui/OpenSignupToggle.svelte +2 -5
- package/dist/ui/OpenSignupToggle.svelte.d.ts.map +1 -1
- package/dist/ui/account_sessions_state.svelte.d.ts +9 -10
- package/dist/ui/account_sessions_state.svelte.d.ts.map +1 -1
- package/dist/ui/account_sessions_state.svelte.js +7 -17
- package/dist/ui/admin_accounts_state.svelte.d.ts +41 -20
- package/dist/ui/admin_accounts_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_accounts_state.svelte.js +52 -22
- package/dist/ui/admin_invites_state.svelte.d.ts +8 -11
- package/dist/ui/admin_invites_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_invites_state.svelte.js +7 -16
- package/dist/ui/admin_rpc_adapters.d.ts +6 -2
- package/dist/ui/admin_rpc_adapters.d.ts.map +1 -1
- package/dist/ui/admin_rpc_adapters.js +5 -1
- package/dist/ui/admin_sessions_state.svelte.d.ts +6 -10
- package/dist/ui/admin_sessions_state.svelte.d.ts.map +1 -1
- package/dist/ui/admin_sessions_state.svelte.js +4 -14
- package/dist/ui/app_settings_state.svelte.d.ts +8 -12
- package/dist/ui/app_settings_state.svelte.d.ts.map +1 -1
- package/dist/ui/app_settings_state.svelte.js +6 -16
- package/dist/ui/audit_log_state.svelte.d.ts +9 -8
- package/dist/ui/audit_log_state.svelte.d.ts.map +1 -1
- package/dist/ui/audit_log_state.svelte.js +8 -20
- package/package.json +2 -2
|
@@ -28,6 +28,7 @@ export declare const AdminAccountListInput: z.ZodDefault<z.ZodObject<{
|
|
|
28
28
|
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
29
29
|
limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
30
30
|
offset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
31
|
+
include_deleted: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
31
32
|
}, z.core.$strict>>;
|
|
32
33
|
export type AdminAccountListInput = z.infer<typeof AdminAccountListInput>;
|
|
33
34
|
/** Output for `admin_account_list`. */
|
|
@@ -41,6 +42,7 @@ export declare const AdminAccountListOutput: z.ZodObject<{
|
|
|
41
42
|
created_at: z.ZodString;
|
|
42
43
|
updated_at: z.ZodString;
|
|
43
44
|
updated_by: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
45
|
+
deleted_at: z.ZodNullable<z.ZodString>;
|
|
44
46
|
}, z.core.$strict>;
|
|
45
47
|
actor: z.ZodNullable<z.ZodObject<{
|
|
46
48
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
@@ -264,6 +266,81 @@ export declare const AppSettingsUpdateOutput: z.ZodObject<{
|
|
|
264
266
|
}, z.core.$strict>;
|
|
265
267
|
}, z.core.$strict>;
|
|
266
268
|
export type AppSettingsUpdateOutput = z.infer<typeof AppSettingsUpdateOutput>;
|
|
269
|
+
/**
|
|
270
|
+
* `data.reason` on `account_purge` when `confirm: true` is absent.
|
|
271
|
+
* Fail-loud: the irreversible purge refuses to run without explicit
|
|
272
|
+
* confirmation. Mirrors the Rust `ERROR_PURGE_NOT_CONFIRMED`.
|
|
273
|
+
*/
|
|
274
|
+
export declare const ERROR_PURGE_NOT_CONFIRMED: "purge_not_confirmed";
|
|
275
|
+
/**
|
|
276
|
+
* `data.reason` (403) on `account_delete` / `account_purge` when the
|
|
277
|
+
* target account holds an active keeper role_grant. The keeper account
|
|
278
|
+
* is never deletable or purgeable through the API: auth resolution and
|
|
279
|
+
* daemon-token resolution both pivot on the keeper account, so tombstoning
|
|
280
|
+
* or cascading it away would brick keeper/daemon auth with no recovery
|
|
281
|
+
* path (the keeper role is not web-revocable, and `account_purge` itself
|
|
282
|
+
* requires keeper auth). Keeper-account removal stays out-of-band
|
|
283
|
+
* (bootstrap / DB surgery). Mirrors the Rust `ERROR_CANNOT_DELETE_KEEPER`.
|
|
284
|
+
*/
|
|
285
|
+
export declare const ERROR_CANNOT_DELETE_KEEPER: "cannot_delete_keeper";
|
|
286
|
+
/**
|
|
287
|
+
* `data.reason` (403) on `account_delete` / `account_purge` when the target
|
|
288
|
+
* is the **sole remaining active admin** — removing it would leave the
|
|
289
|
+
* system with no account that can authenticate into the admin surface (and
|
|
290
|
+
* `account_undelete` is itself admin-gated). Unlike the keeper guard this is
|
|
291
|
+
* keeper-recoverable (a keeper can re-grant admin), but the guard avoids the
|
|
292
|
+
* foot-gun of an admin tombstoning the last admin in one call. Soft-deleted
|
|
293
|
+
* admins don't count toward the tally (they can't log in). Mirrors the Rust
|
|
294
|
+
* `ERROR_CANNOT_DELETE_LAST_ADMIN`.
|
|
295
|
+
*/
|
|
296
|
+
export declare const ERROR_CANNOT_DELETE_LAST_ADMIN: "cannot_delete_last_admin";
|
|
297
|
+
/**
|
|
298
|
+
* Input for `account_delete` (soft delete). `account_id` is optional —
|
|
299
|
+
* omitted (or equal to the caller's own account) is a self-delete; a
|
|
300
|
+
* different account requires the admin role (handler-enforced
|
|
301
|
+
* elevation, like `role_grant_offer_list`).
|
|
302
|
+
*/
|
|
303
|
+
export declare const AccountDeleteInput: z.ZodDefault<z.ZodObject<{
|
|
304
|
+
account_id: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>>;
|
|
305
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
306
|
+
}, z.core.$strict>>;
|
|
307
|
+
export type AccountDeleteInput = z.infer<typeof AccountDeleteInput>;
|
|
308
|
+
/** Output for `account_delete`. */
|
|
309
|
+
export declare const AccountDeleteOutput: z.ZodObject<{
|
|
310
|
+
ok: z.ZodLiteral<true>;
|
|
311
|
+
deleted: z.ZodBoolean;
|
|
312
|
+
}, z.core.$strict>;
|
|
313
|
+
export type AccountDeleteOutput = z.infer<typeof AccountDeleteOutput>;
|
|
314
|
+
/** Input for `account_purge` (hard, irreversible delete). Keeper-only. */
|
|
315
|
+
export declare const AccountPurgeInput: z.ZodObject<{
|
|
316
|
+
account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
317
|
+
confirm: z.ZodOptional<z.ZodBoolean>;
|
|
318
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
319
|
+
}, z.core.$strict>;
|
|
320
|
+
export type AccountPurgeInput = z.infer<typeof AccountPurgeInput>;
|
|
321
|
+
/** Output for `account_purge`. */
|
|
322
|
+
export declare const AccountPurgeOutput: z.ZodObject<{
|
|
323
|
+
ok: z.ZodLiteral<true>;
|
|
324
|
+
purged: z.ZodBoolean;
|
|
325
|
+
}, z.core.$strict>;
|
|
326
|
+
export type AccountPurgeOutput = z.infer<typeof AccountPurgeOutput>;
|
|
327
|
+
/**
|
|
328
|
+
* Input for `account_undelete` (reactivation). `account_id` is required —
|
|
329
|
+
* unlike `account_delete` there is no self path: a soft-deleted account
|
|
330
|
+
* can't authenticate (auth resolution excludes it, sessions are revoked),
|
|
331
|
+
* so reactivation is always an admin acting on another account.
|
|
332
|
+
*/
|
|
333
|
+
export declare const AccountUndeleteInput: z.ZodObject<{
|
|
334
|
+
account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
335
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
336
|
+
}, z.core.$strict>;
|
|
337
|
+
export type AccountUndeleteInput = z.infer<typeof AccountUndeleteInput>;
|
|
338
|
+
/** Output for `account_undelete`. */
|
|
339
|
+
export declare const AccountUndeleteOutput: z.ZodObject<{
|
|
340
|
+
ok: z.ZodLiteral<true>;
|
|
341
|
+
undeleted: z.ZodBoolean;
|
|
342
|
+
}, z.core.$strict>;
|
|
343
|
+
export type AccountUndeleteOutput = z.infer<typeof AccountUndeleteOutput>;
|
|
267
344
|
/**
|
|
268
345
|
* `rate_limit: 'account'` bounds admin-side scraping of the account table
|
|
269
346
|
* via `(limit, offset)` walking — admin trust is not a substitute for a
|
|
@@ -284,6 +361,7 @@ export declare const admin_account_list_action_spec: {
|
|
|
284
361
|
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
285
362
|
limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
286
363
|
offset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
364
|
+
include_deleted: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
287
365
|
}, z.core.$strict>>;
|
|
288
366
|
output: z.ZodObject<{
|
|
289
367
|
accounts: z.ZodArray<z.ZodObject<{
|
|
@@ -295,6 +373,7 @@ export declare const admin_account_list_action_spec: {
|
|
|
295
373
|
created_at: z.ZodString;
|
|
296
374
|
updated_at: z.ZodString;
|
|
297
375
|
updated_by: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
376
|
+
deleted_at: z.ZodNullable<z.ZodString>;
|
|
298
377
|
}, z.core.$strict>;
|
|
299
378
|
actor: z.ZodNullable<z.ZodObject<{
|
|
300
379
|
id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
@@ -588,6 +667,95 @@ export declare const invite_delete_action_spec: {
|
|
|
588
667
|
description: string;
|
|
589
668
|
rate_limit: "account";
|
|
590
669
|
};
|
|
670
|
+
/**
|
|
671
|
+
* Soft-delete an account (reversible tombstone). Self-or-admin: the
|
|
672
|
+
* caller may delete their own account; deleting another requires the
|
|
673
|
+
* admin role (handler-enforced elevation). No `admin_` prefix — the
|
|
674
|
+
* privilege lives in the auth check, not the name, so self-service
|
|
675
|
+
* deletion stays open (`delete` = soft, `purge` = hard).
|
|
676
|
+
*/
|
|
677
|
+
export declare const account_delete_action_spec: {
|
|
678
|
+
method: string;
|
|
679
|
+
kind: "request_response";
|
|
680
|
+
initiator: "frontend";
|
|
681
|
+
auth: {
|
|
682
|
+
account: "required";
|
|
683
|
+
actor: "required";
|
|
684
|
+
};
|
|
685
|
+
side_effects: true;
|
|
686
|
+
input: z.ZodDefault<z.ZodObject<{
|
|
687
|
+
account_id: z.ZodOptional<z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>>;
|
|
688
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
689
|
+
}, z.core.$strict>>;
|
|
690
|
+
output: z.ZodObject<{
|
|
691
|
+
ok: z.ZodLiteral<true>;
|
|
692
|
+
deleted: z.ZodBoolean;
|
|
693
|
+
}, z.core.$strict>;
|
|
694
|
+
async: true;
|
|
695
|
+
description: string;
|
|
696
|
+
rate_limit: "account";
|
|
697
|
+
};
|
|
698
|
+
/**
|
|
699
|
+
* Hard-purge an account (keeper-gated, irreversible). Keeper credential
|
|
700
|
+
* (`daemon_token`) + keeper role + explicit `confirm: true`. Not
|
|
701
|
+
* admin-reachable and not self-service — the most dangerous operation is
|
|
702
|
+
* the most restricted. `purge` = hard; the word + gating + WARN flag the
|
|
703
|
+
* danger (fail-loud).
|
|
704
|
+
*/
|
|
705
|
+
export declare const account_purge_action_spec: {
|
|
706
|
+
method: string;
|
|
707
|
+
kind: "request_response";
|
|
708
|
+
initiator: "frontend";
|
|
709
|
+
auth: {
|
|
710
|
+
account: "required";
|
|
711
|
+
actor: "required";
|
|
712
|
+
roles: string[];
|
|
713
|
+
credential_types: string[];
|
|
714
|
+
};
|
|
715
|
+
side_effects: true;
|
|
716
|
+
input: z.ZodObject<{
|
|
717
|
+
account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
718
|
+
confirm: z.ZodOptional<z.ZodBoolean>;
|
|
719
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
720
|
+
}, z.core.$strict>;
|
|
721
|
+
output: z.ZodObject<{
|
|
722
|
+
ok: z.ZodLiteral<true>;
|
|
723
|
+
purged: z.ZodBoolean;
|
|
724
|
+
}, z.core.$strict>;
|
|
725
|
+
async: true;
|
|
726
|
+
description: string;
|
|
727
|
+
rate_limit: "account";
|
|
728
|
+
};
|
|
729
|
+
/**
|
|
730
|
+
* Reactivate a soft-deleted account (clears the tombstone). Admin-only —
|
|
731
|
+
* there is no self path because a soft-deleted account can't authenticate
|
|
732
|
+
* (auth resolution excludes it and its sessions are revoked), so
|
|
733
|
+
* reactivation is always an admin acting on another account. The inverse
|
|
734
|
+
* of `account_delete`; does not restore revoked sessions/tokens
|
|
735
|
+
* (delete = soft, purge = hard).
|
|
736
|
+
*/
|
|
737
|
+
export declare const account_undelete_action_spec: {
|
|
738
|
+
method: string;
|
|
739
|
+
kind: "request_response";
|
|
740
|
+
initiator: "frontend";
|
|
741
|
+
auth: {
|
|
742
|
+
account: "required";
|
|
743
|
+
actor: "required";
|
|
744
|
+
roles: string[];
|
|
745
|
+
};
|
|
746
|
+
side_effects: true;
|
|
747
|
+
input: z.ZodObject<{
|
|
748
|
+
account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
|
|
749
|
+
acting: z.ZodOptional<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
|
|
750
|
+
}, z.core.$strict>;
|
|
751
|
+
output: z.ZodObject<{
|
|
752
|
+
ok: z.ZodLiteral<true>;
|
|
753
|
+
undeleted: z.ZodBoolean;
|
|
754
|
+
}, z.core.$strict>;
|
|
755
|
+
async: true;
|
|
756
|
+
description: string;
|
|
757
|
+
rate_limit: "account";
|
|
758
|
+
};
|
|
591
759
|
export declare const app_settings_get_action_spec: {
|
|
592
760
|
method: string;
|
|
593
761
|
kind: "request_response";
|
|
@@ -642,9 +810,8 @@ export declare const app_settings_update_action_spec: {
|
|
|
642
810
|
/**
|
|
643
811
|
* All admin action specs — a codegen-ready registry. Consumers spread this
|
|
644
812
|
* into their own action-spec array to include admin methods in a typed
|
|
645
|
-
* client surface.
|
|
646
|
-
* factory
|
|
647
|
-
* is provided.
|
|
813
|
+
* client surface. Includes the two app-settings specs, whose handlers the
|
|
814
|
+
* runtime factory always wires.
|
|
648
815
|
*/
|
|
649
816
|
export declare const all_admin_action_specs: Array<RequestResponseActionSpec>;
|
|
650
817
|
//# sourceMappingURL=admin_action_specs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/admin_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"admin_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["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;;;CAWV,CAAC;AAEtC;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWF,CAAC;AAEtC;;;;GAIG;AACH,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWhB,CAAC;AAEtC,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWD,CAAC;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWC,CAAC;AAEtC,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;CAWD,CAAC;AAEtC;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;CAYF,CAAC;AAEtC;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;CAiBD,CAAC;AAEtC;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;CAYJ,CAAC;AAEtC,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;CAUJ,CAAC;AAEtC,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;CAWP,CAAC;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,yBAAyB,CAenE,CAAC"}
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { z } from 'zod';
|
|
19
19
|
import { Uuid } from '@fuzdev/fuz_util/id.js';
|
|
20
|
-
import { ROLE_ADMIN, RoleName } from './role_schema.js';
|
|
20
|
+
import { ROLE_ADMIN, ROLE_KEEPER, RoleName } from './role_schema.js';
|
|
21
|
+
import { CREDENTIAL_TYPE_DAEMON_TOKEN } from './credential_type_schema.js';
|
|
21
22
|
import { AdminAccountEntryJson } from './account_schema.js';
|
|
22
23
|
import { Email, Username } from '../primitive_schemas.js';
|
|
23
24
|
import { ActingActor } from '../http/auth_shape.js';
|
|
@@ -45,6 +46,9 @@ export const AdminAccountListInput = z
|
|
|
45
46
|
description: `Max accounts to return (default ${ADMIN_ACCOUNT_LIST_DEFAULT_LIMIT}, max ${ADMIN_ACCOUNT_LIST_LIMIT_MAX}).`,
|
|
46
47
|
}),
|
|
47
48
|
offset: z.number().int().min(0).nullish().meta({ description: 'Pagination offset.' }),
|
|
49
|
+
include_deleted: z.boolean().nullish().meta({
|
|
50
|
+
description: 'Include soft-deleted (tombstoned) accounts in the listing. Default false (active only). Used by the admin UI to surface accounts for reactivation via `account_undelete`.',
|
|
51
|
+
}),
|
|
48
52
|
})
|
|
49
53
|
.default({});
|
|
50
54
|
/** Output for `admin_account_list`. */
|
|
@@ -192,6 +196,81 @@ export const AppSettingsUpdateOutput = z.strictObject({
|
|
|
192
196
|
ok: z.literal(true),
|
|
193
197
|
settings: AppSettingsWithUsernameJson,
|
|
194
198
|
});
|
|
199
|
+
/**
|
|
200
|
+
* `data.reason` on `account_purge` when `confirm: true` is absent.
|
|
201
|
+
* Fail-loud: the irreversible purge refuses to run without explicit
|
|
202
|
+
* confirmation. Mirrors the Rust `ERROR_PURGE_NOT_CONFIRMED`.
|
|
203
|
+
*/
|
|
204
|
+
export const ERROR_PURGE_NOT_CONFIRMED = 'purge_not_confirmed';
|
|
205
|
+
/**
|
|
206
|
+
* `data.reason` (403) on `account_delete` / `account_purge` when the
|
|
207
|
+
* target account holds an active keeper role_grant. The keeper account
|
|
208
|
+
* is never deletable or purgeable through the API: auth resolution and
|
|
209
|
+
* daemon-token resolution both pivot on the keeper account, so tombstoning
|
|
210
|
+
* or cascading it away would brick keeper/daemon auth with no recovery
|
|
211
|
+
* path (the keeper role is not web-revocable, and `account_purge` itself
|
|
212
|
+
* requires keeper auth). Keeper-account removal stays out-of-band
|
|
213
|
+
* (bootstrap / DB surgery). Mirrors the Rust `ERROR_CANNOT_DELETE_KEEPER`.
|
|
214
|
+
*/
|
|
215
|
+
export const ERROR_CANNOT_DELETE_KEEPER = 'cannot_delete_keeper';
|
|
216
|
+
/**
|
|
217
|
+
* `data.reason` (403) on `account_delete` / `account_purge` when the target
|
|
218
|
+
* is the **sole remaining active admin** — removing it would leave the
|
|
219
|
+
* system with no account that can authenticate into the admin surface (and
|
|
220
|
+
* `account_undelete` is itself admin-gated). Unlike the keeper guard this is
|
|
221
|
+
* keeper-recoverable (a keeper can re-grant admin), but the guard avoids the
|
|
222
|
+
* foot-gun of an admin tombstoning the last admin in one call. Soft-deleted
|
|
223
|
+
* admins don't count toward the tally (they can't log in). Mirrors the Rust
|
|
224
|
+
* `ERROR_CANNOT_DELETE_LAST_ADMIN`.
|
|
225
|
+
*/
|
|
226
|
+
export const ERROR_CANNOT_DELETE_LAST_ADMIN = 'cannot_delete_last_admin';
|
|
227
|
+
/**
|
|
228
|
+
* Input for `account_delete` (soft delete). `account_id` is optional —
|
|
229
|
+
* omitted (or equal to the caller's own account) is a self-delete; a
|
|
230
|
+
* different account requires the admin role (handler-enforced
|
|
231
|
+
* elevation, like `role_grant_offer_list`).
|
|
232
|
+
*/
|
|
233
|
+
export const AccountDeleteInput = z
|
|
234
|
+
.strictObject({
|
|
235
|
+
account_id: Uuid.nullish().meta({
|
|
236
|
+
description: 'Account to soft-delete. Omit for self-delete; another account requires admin.',
|
|
237
|
+
}),
|
|
238
|
+
acting: ActingActor,
|
|
239
|
+
})
|
|
240
|
+
.default({});
|
|
241
|
+
/** Output for `account_delete`. */
|
|
242
|
+
export const AccountDeleteOutput = z.strictObject({
|
|
243
|
+
ok: z.literal(true),
|
|
244
|
+
deleted: z.boolean(),
|
|
245
|
+
});
|
|
246
|
+
/** Input for `account_purge` (hard, irreversible delete). Keeper-only. */
|
|
247
|
+
export const AccountPurgeInput = z.strictObject({
|
|
248
|
+
account_id: Uuid.meta({ description: 'Account to hard-purge.' }),
|
|
249
|
+
confirm: z.boolean().optional().meta({
|
|
250
|
+
description: 'Must be `true` — fail-loud guard against an accidental irreversible purge.',
|
|
251
|
+
}),
|
|
252
|
+
acting: ActingActor,
|
|
253
|
+
});
|
|
254
|
+
/** Output for `account_purge`. */
|
|
255
|
+
export const AccountPurgeOutput = z.strictObject({
|
|
256
|
+
ok: z.literal(true),
|
|
257
|
+
purged: z.boolean(),
|
|
258
|
+
});
|
|
259
|
+
/**
|
|
260
|
+
* Input for `account_undelete` (reactivation). `account_id` is required —
|
|
261
|
+
* unlike `account_delete` there is no self path: a soft-deleted account
|
|
262
|
+
* can't authenticate (auth resolution excludes it, sessions are revoked),
|
|
263
|
+
* so reactivation is always an admin acting on another account.
|
|
264
|
+
*/
|
|
265
|
+
export const AccountUndeleteInput = z.strictObject({
|
|
266
|
+
account_id: Uuid.meta({ description: 'Soft-deleted account to reactivate.' }),
|
|
267
|
+
acting: ActingActor,
|
|
268
|
+
});
|
|
269
|
+
/** Output for `account_undelete`. */
|
|
270
|
+
export const AccountUndeleteOutput = z.strictObject({
|
|
271
|
+
ok: z.literal(true),
|
|
272
|
+
undeleted: z.boolean(),
|
|
273
|
+
});
|
|
195
274
|
// -- Action specs -----------------------------------------------------------
|
|
196
275
|
/**
|
|
197
276
|
* `rate_limit: 'account'` bounds admin-side scraping of the account table
|
|
@@ -331,6 +410,69 @@ export const invite_delete_action_spec = {
|
|
|
331
410
|
description: 'Delete an unclaimed invite. Admin-only.',
|
|
332
411
|
rate_limit: 'account',
|
|
333
412
|
};
|
|
413
|
+
/**
|
|
414
|
+
* Soft-delete an account (reversible tombstone). Self-or-admin: the
|
|
415
|
+
* caller may delete their own account; deleting another requires the
|
|
416
|
+
* admin role (handler-enforced elevation). No `admin_` prefix — the
|
|
417
|
+
* privilege lives in the auth check, not the name, so self-service
|
|
418
|
+
* deletion stays open (`delete` = soft, `purge` = hard).
|
|
419
|
+
*/
|
|
420
|
+
export const account_delete_action_spec = {
|
|
421
|
+
method: 'account_delete',
|
|
422
|
+
kind: 'request_response',
|
|
423
|
+
initiator: 'frontend',
|
|
424
|
+
auth: { account: 'required', actor: 'required' },
|
|
425
|
+
side_effects: true,
|
|
426
|
+
input: AccountDeleteInput,
|
|
427
|
+
output: AccountDeleteOutput,
|
|
428
|
+
async: true,
|
|
429
|
+
description: 'Soft-delete an account (reversible tombstone): blocks auth, revokes sessions/tokens, soft-deletes its actor(s). Self-service for own account; admin required to delete another.',
|
|
430
|
+
rate_limit: 'account',
|
|
431
|
+
};
|
|
432
|
+
/**
|
|
433
|
+
* Hard-purge an account (keeper-gated, irreversible). Keeper credential
|
|
434
|
+
* (`daemon_token`) + keeper role + explicit `confirm: true`. Not
|
|
435
|
+
* admin-reachable and not self-service — the most dangerous operation is
|
|
436
|
+
* the most restricted. `purge` = hard; the word + gating + WARN flag the
|
|
437
|
+
* danger (fail-loud).
|
|
438
|
+
*/
|
|
439
|
+
export const account_purge_action_spec = {
|
|
440
|
+
method: 'account_purge',
|
|
441
|
+
kind: 'request_response',
|
|
442
|
+
initiator: 'frontend',
|
|
443
|
+
auth: {
|
|
444
|
+
account: 'required',
|
|
445
|
+
actor: 'required',
|
|
446
|
+
roles: [ROLE_KEEPER],
|
|
447
|
+
credential_types: [CREDENTIAL_TYPE_DAEMON_TOKEN],
|
|
448
|
+
},
|
|
449
|
+
side_effects: true,
|
|
450
|
+
input: AccountPurgeInput,
|
|
451
|
+
output: AccountPurgeOutput,
|
|
452
|
+
async: true,
|
|
453
|
+
description: 'Hard-purge an account (irreversible cascading delete). Keeper-only + explicit confirm. Audit ids survive; identity snapshotted in metadata.',
|
|
454
|
+
rate_limit: 'account',
|
|
455
|
+
};
|
|
456
|
+
/**
|
|
457
|
+
* Reactivate a soft-deleted account (clears the tombstone). Admin-only —
|
|
458
|
+
* there is no self path because a soft-deleted account can't authenticate
|
|
459
|
+
* (auth resolution excludes it and its sessions are revoked), so
|
|
460
|
+
* reactivation is always an admin acting on another account. The inverse
|
|
461
|
+
* of `account_delete`; does not restore revoked sessions/tokens
|
|
462
|
+
* (delete = soft, purge = hard).
|
|
463
|
+
*/
|
|
464
|
+
export const account_undelete_action_spec = {
|
|
465
|
+
method: 'account_undelete',
|
|
466
|
+
kind: 'request_response',
|
|
467
|
+
initiator: 'frontend',
|
|
468
|
+
auth: { account: 'required', actor: 'required', roles: [ROLE_ADMIN] },
|
|
469
|
+
side_effects: true,
|
|
470
|
+
input: AccountUndeleteInput,
|
|
471
|
+
output: AccountUndeleteOutput,
|
|
472
|
+
async: true,
|
|
473
|
+
description: 'Reactivate a soft-deleted account (clears the deleted_at tombstone on the account + its actors). Admin-only. Does not restore revoked sessions/tokens — principals re-auth fresh.',
|
|
474
|
+
rate_limit: 'account',
|
|
475
|
+
};
|
|
334
476
|
export const app_settings_get_action_spec = {
|
|
335
477
|
method: 'app_settings_get',
|
|
336
478
|
kind: 'request_response',
|
|
@@ -357,9 +499,8 @@ export const app_settings_update_action_spec = {
|
|
|
357
499
|
/**
|
|
358
500
|
* All admin action specs — a codegen-ready registry. Consumers spread this
|
|
359
501
|
* into their own action-spec array to include admin methods in a typed
|
|
360
|
-
* client surface.
|
|
361
|
-
* factory
|
|
362
|
-
* is provided.
|
|
502
|
+
* client surface. Includes the two app-settings specs, whose handlers the
|
|
503
|
+
* runtime factory always wires.
|
|
363
504
|
*/
|
|
364
505
|
export const all_admin_action_specs = [
|
|
365
506
|
admin_account_list_action_spec,
|
|
@@ -371,6 +512,9 @@ export const all_admin_action_specs = [
|
|
|
371
512
|
invite_create_action_spec,
|
|
372
513
|
invite_list_action_spec,
|
|
373
514
|
invite_delete_action_spec,
|
|
515
|
+
account_delete_action_spec,
|
|
516
|
+
account_purge_action_spec,
|
|
517
|
+
account_undelete_action_spec,
|
|
374
518
|
app_settings_get_action_spec,
|
|
375
519
|
app_settings_update_action_spec,
|
|
376
520
|
];
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
* `admin_session_revoke_all`, `admin_token_revoke_all`.
|
|
8
8
|
* - Audit log reads: `audit_log_list`, `audit_log_role_grant_history`.
|
|
9
9
|
* - Invite CRUD: `invite_create`, `invite_list`, `invite_delete`.
|
|
10
|
-
* - App settings: `app_settings_get`, `app_settings_update
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* - App settings: `app_settings_get`, `app_settings_update`. The update
|
|
11
|
+
* handler writes the `app_settings` row in the database; signup reads the
|
|
12
|
+
* `open_signup` toggle fresh from that row on every request, so no
|
|
13
|
+
* in-memory state is shared between this surface and signup.
|
|
13
14
|
*
|
|
14
15
|
* The action specs themselves live in `auth/admin_action_specs.ts`. Mutations
|
|
15
16
|
* emit matching audit events via `deps.audit.emit`.
|
|
@@ -30,7 +31,6 @@
|
|
|
30
31
|
import { type RpcAction } from '../actions/action_rpc.js';
|
|
31
32
|
import type { ConnectionCloser } from '../actions/connection_closer.js';
|
|
32
33
|
import { type RoleSchemaResult } from './role_schema.js';
|
|
33
|
-
import { type AppSettings } from './app_settings_schema.js';
|
|
34
34
|
import type { RouteFactoryDeps } from './deps.js';
|
|
35
35
|
/** Options for `create_admin_actions`. */
|
|
36
36
|
export interface AdminActionOptions {
|
|
@@ -41,15 +41,6 @@ export interface AdminActionOptions {
|
|
|
41
41
|
* `admin_account_list`.
|
|
42
42
|
*/
|
|
43
43
|
roles?: RoleSchemaResult;
|
|
44
|
-
/**
|
|
45
|
-
* Mutable in-memory app settings ref — typically `ctx.app_settings` from
|
|
46
|
-
* `AppServerContext`. When provided, the factory wires the
|
|
47
|
-
* `app_settings_get` and `app_settings_update` handlers; the update
|
|
48
|
-
* handler mutates this ref so signup middleware reads the new value
|
|
49
|
-
* without a DB round trip. When omitted, those two methods have no
|
|
50
|
-
* handler and RPC dispatch returns `method_not_found`.
|
|
51
|
-
*/
|
|
52
|
-
app_settings?: AppSettings;
|
|
53
44
|
/**
|
|
54
45
|
* Live-connection closer — when set, `admin_session_revoke_all` and
|
|
55
46
|
* `admin_token_revoke_all` handlers eagerly close affected WebSocket
|
|
@@ -70,7 +61,6 @@ export interface AdminActionOptions {
|
|
|
70
61
|
* optional `AuditLogConfig`.
|
|
71
62
|
* @param options - role schema for `grantable_roles` derivation
|
|
72
63
|
* @returns the `RpcAction` array to spread into a `create_rpc_endpoint` call
|
|
73
|
-
* @mutates `options.app_settings` ref - `app_settings_update` writes `open_signup`, `updated_at`, and `updated_by` so signup middleware reads without a DB round trip
|
|
74
64
|
*/
|
|
75
65
|
export declare const create_admin_actions: (deps: Pick<RouteFactoryDeps, "log" | "audit">, options?: AdminActionOptions) => Array<RpcAction>;
|
|
76
66
|
//# sourceMappingURL=admin_actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/admin_actions.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"admin_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/admin_actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAsC,KAAK,SAAS,EAAC,MAAM,0BAA0B,CAAC;AAC7F,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAKN,KAAK,gBAAgB,EACrB,MAAM,kBAAkB,CAAC;AAyC1B,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,WAAW,CAAC;AA0DhD,0CAA0C;AAC1C,MAAM,WAAW,kBAAkB;IAClC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC5C;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,GAChC,MAAM,IAAI,CAAC,gBAAgB,EAAE,KAAK,GAAG,OAAO,CAAC,EAC7C,UAAS,kBAAuB,KAC9B,KAAK,CAAC,SAAS,CAqfjB,CAAC"}
|