@fuzdev/fuz_app 0.159.0 → 0.161.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 +7 -2
- package/dist/actions/protocol.d.ts +7 -0
- package/dist/actions/protocol.d.ts.map +1 -1
- package/dist/actions/protocol.js +19 -4
- package/dist/auth/CLAUDE.md +47 -24
- package/dist/auth/account_schema.d.ts +2 -2
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +1 -1
- package/dist/auth/actor_lookup_action_specs.d.ts +7 -7
- package/dist/auth/actor_search_action_specs.d.ts +6 -6
- package/dist/auth/admin_action_specs.d.ts +1051 -321
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +150 -166
- package/dist/auth/app_settings_schema.d.ts +46 -23
- package/dist/auth/app_settings_schema.d.ts.map +1 -1
- package/dist/auth/app_settings_schema.js +12 -15
- package/dist/auth/audit_log_route_schema.d.ts +1 -1
- package/dist/auth/audit_log_schema.d.ts +14 -3
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +20 -7
- package/dist/auth/audit_log_schema_fuz.d.ts +39 -0
- package/dist/auth/audit_log_schema_fuz.d.ts.map +1 -0
- package/dist/auth/audit_log_schema_fuz.js +37 -0
- package/dist/auth/credential_type_schema.d.ts +4 -7
- package/dist/auth/credential_type_schema.d.ts.map +1 -1
- package/dist/auth/credential_type_schema.js +6 -10
- package/dist/auth/grant_path_schema.d.ts +4 -7
- package/dist/auth/grant_path_schema.d.ts.map +1 -1
- package/dist/auth/grant_path_schema.js +6 -10
- package/dist/auth/name_schema.d.ts +63 -0
- package/dist/auth/name_schema.d.ts.map +1 -0
- package/dist/auth/name_schema.js +65 -0
- package/dist/auth/request_context.d.ts.map +1 -1
- package/dist/auth/request_context.js +2 -1
- package/dist/auth/role_grant_offer_action_specs.d.ts +2257 -400
- package/dist/auth/role_grant_offer_action_specs.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_action_specs.js +104 -100
- package/dist/auth/role_grant_offer_actions.d.ts +6 -3
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +15 -6
- package/dist/auth/role_grant_offer_notifications.d.ts +1364 -255
- package/dist/auth/role_grant_offer_notifications.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_notifications.js +100 -47
- package/dist/auth/role_grant_offer_schema.d.ts +90 -22
- package/dist/auth/role_grant_offer_schema.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_schema.js +40 -39
- package/dist/auth/role_schema.d.ts +14 -25
- package/dist/auth/role_schema.d.ts.map +1 -1
- package/dist/auth/role_schema.js +15 -29
- package/dist/auth/role_schema_fuz.d.ts +4 -3
- package/dist/auth/role_schema_fuz.d.ts.map +1 -1
- package/dist/auth/role_schema_fuz.js +7 -5
- package/dist/auth/scope_kind_schema.d.ts +13 -21
- package/dist/auth/scope_kind_schema.d.ts.map +1 -1
- package/dist/auth/scope_kind_schema.js +15 -26
- package/dist/auth/scope_kind_schema_fuz.d.ts +31 -0
- package/dist/auth/scope_kind_schema_fuz.d.ts.map +1 -0
- package/dist/auth/scope_kind_schema_fuz.js +31 -0
- package/dist/auth/self_service_role_action_specs.d.ts +2 -2
- package/dist/auth/token_scope.d.ts +7 -13
- package/dist/auth/token_scope.d.ts.map +1 -1
- package/dist/auth/token_scope.js +9 -14
- package/dist/primitive_schemas.d.ts +46 -0
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas.js +39 -14
- package/dist/primitive_schemas_fuz.d.ts +35 -7
- package/dist/primitive_schemas_fuz.d.ts.map +1 -1
- package/dist/primitive_schemas_fuz.js +30 -6
- package/dist/testing/CLAUDE.md +19 -11
- package/dist/testing/cross_backend/default_spine_surface.d.ts +1 -1
- package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/identity_parity.js +20 -11
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts +15 -3
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_notification_ws.js +60 -17
- package/dist/testing/cross_backend/role_grant_role_grammar.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_role_grammar.js +8 -15
- package/dist/testing/cross_backend/spine_suites.d.ts +4 -3
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +2 -1
- package/dist/ui/CLAUDE.md +4 -4
- package/dist/ui/admin_accounts_state.svelte.d.ts +8 -8
- package/dist/ui/role_grant_offers_state.svelte.d.ts +9 -9
- package/dist/ui/role_grant_offers_state.svelte.js +4 -4
- package/package.json +1 -1
|
@@ -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
|
|
1
|
+
{"version":3,"file":"admin_action_specs.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/admin_action_specs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAcN,KAAK,KAAK,EACV,MAAM,8BAA8B,CAAC;AAGtC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAqB3E,+BAA+B;AAC/B,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,8CAA8C;AAC9C,eAAO,MAAM,gCAAgC,KAAK,CAAC;AACnD,0CAA0C;AAC1C,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD,8FAA8F;AAC9F,eAAO,MAAM,8BAA8B,kDAAkD,CAAC;AA6B9F;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgBjC,CA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M,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWhB,CAAC;AAEtC,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWD,CAAC;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWC,CAAC;AAEtC,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWD,CAAC;AAEtC;;;;;;;;;;;GAWG;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"}
|
|
@@ -3,25 +3,29 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Import this module for the specs, Input/Output schemas, and the
|
|
5
5
|
* `all_admin_action_specs` registry. Handlers live in `auth/admin_actions.ts`.
|
|
6
|
+
* Every input is a `@fuzdev/fuz_schema` schema, and so is every output that
|
|
7
|
+
* holds no row schema; the outputs of the listings and of `invite_create`
|
|
8
|
+
* are Zod.
|
|
6
9
|
*
|
|
7
10
|
* Authorization is declared at the spec level (`auth: {role: ROLE_ADMIN}`)
|
|
8
11
|
* so the RPC dispatcher enforces admin before the handler runs and the
|
|
9
12
|
* generated surface accurately reports the requirement.
|
|
10
13
|
*
|
|
11
|
-
* The registry
|
|
12
|
-
*
|
|
13
|
-
* `AdminActionOptions.app_settings` is provided; dispatch falls back to
|
|
14
|
-
* `method_not_found` when absent.
|
|
14
|
+
* The registry includes `app_settings_get` / `app_settings_update`, and
|
|
15
|
+
* `create_admin_actions` always wires their handlers.
|
|
15
16
|
*
|
|
16
17
|
* @module
|
|
17
18
|
*/
|
|
18
19
|
import { z } from 'zod';
|
|
19
|
-
import {
|
|
20
|
+
import { meta } from '@fuzdev/fuz_schema/meta.ts';
|
|
21
|
+
import { boolean, check_at, integer, literal, max_value, message, min_value, nullable, number, object, optional, pipe, with_default_fn } from '@fuzdev/fuz_schema/schema.ts';
|
|
22
|
+
import { ActingActor, Email, Username, Uuid } from '../primitive_schemas_fuz.js';
|
|
20
23
|
import { ROLE_ADMIN, ROLE_KEEPER, RoleName } from './role_schema.js';
|
|
21
24
|
import { CREDENTIAL_TYPE_DAEMON_TOKEN } from './credential_type_schema.js';
|
|
25
|
+
import { NAME_LENGTH_MAX } from './name_schema.js';
|
|
22
26
|
import { AdminAccountEntryJson } from './account_schema.js';
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
27
|
+
import { AdminSessionJson, AUDIT_LOG_DEFAULT_LIMIT, AuditLogEventWithUsernamesJson, RoleGrantHistoryEventJson } from './audit_log_schema.js';
|
|
28
|
+
import { AuditEventTypeName, AuditOutcome } from './audit_log_schema_fuz.js';
|
|
25
29
|
import { InviteJson, InviteWithUsernamesJson } from './invite_schema.js';
|
|
26
30
|
import { AppSettingsWithUsernameJson } from './app_settings_schema.js';
|
|
27
31
|
import { ERROR_LIMIT_INVALID, ERROR_OFFSET_INVALID, ERROR_OUTCOME_INVALID, ERROR_SINCE_SEQ_INVALID } from '../http/error_schemas.js';
|
|
@@ -31,191 +35,168 @@ export const AUDIT_LOG_LIST_LIMIT_MAX = 200;
|
|
|
31
35
|
export const ADMIN_ACCOUNT_LIST_DEFAULT_LIMIT = 50;
|
|
32
36
|
/** Max `admin_account_list` page size. */
|
|
33
37
|
export const ADMIN_ACCOUNT_LIST_LIMIT_MAX = 200;
|
|
38
|
+
/** The message `invite_create` fails with when it is given neither `email` nor `username`. */
|
|
39
|
+
export const INVITE_TARGET_REQUIRED_MESSAGE = 'at least one of email or username is required';
|
|
34
40
|
// -- Input/output schemas ---------------------------------------------------
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
/**
|
|
42
|
+
* A page's `limit`, an integer in `[1, max]`, or absent, with the reason
|
|
43
|
+
* every refusal of it carries.
|
|
44
|
+
*/
|
|
45
|
+
const page_limit = (max, description) => meta(optional(nullable(pipe(number, integer, min_value(1), max_value(max)))), {
|
|
46
|
+
description,
|
|
47
|
+
invalid_reason: ERROR_LIMIT_INVALID
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* An integer at least zero, bounded by `Number.MAX_SAFE_INTEGER`, the
|
|
51
|
+
* integers every number holds exactly, or absent: a page's `offset` and the
|
|
52
|
+
* audit list's `since_seq`.
|
|
53
|
+
*/
|
|
54
|
+
const SafeCount = optional(nullable(pipe(number, integer, min_value(0), max_value(Number.MAX_SAFE_INTEGER))));
|
|
55
|
+
/** A page's `offset`, with the reason every refusal of it carries. */
|
|
56
|
+
const PageOffset = meta(SafeCount, {
|
|
57
|
+
description: 'Pagination offset.',
|
|
58
|
+
invalid_reason: ERROR_OFFSET_INVALID
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* Input for `admin_account_list`, a `@fuzdev/fuz_schema` schema. An omitted
|
|
62
|
+
* input reads as a fresh `{}`.
|
|
63
|
+
*/
|
|
64
|
+
export const AdminAccountListInput = with_default_fn(object({
|
|
38
65
|
acting: ActingActor,
|
|
39
|
-
limit:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
.min(1)
|
|
43
|
-
.max(ADMIN_ACCOUNT_LIST_LIMIT_MAX)
|
|
44
|
-
.nullish()
|
|
45
|
-
.meta({
|
|
46
|
-
description: `Max accounts to return (default ${ADMIN_ACCOUNT_LIST_DEFAULT_LIMIT}, max ${ADMIN_ACCOUNT_LIST_LIMIT_MAX}).`,
|
|
47
|
-
invalid_reason: ERROR_LIMIT_INVALID
|
|
48
|
-
}),
|
|
49
|
-
offset: z
|
|
50
|
-
.number()
|
|
51
|
-
.int()
|
|
52
|
-
.min(0)
|
|
53
|
-
.nullish()
|
|
54
|
-
.meta({ description: 'Pagination offset.', invalid_reason: ERROR_OFFSET_INVALID }),
|
|
55
|
-
include_deleted: z.boolean().nullish().meta({
|
|
66
|
+
limit: page_limit(ADMIN_ACCOUNT_LIST_LIMIT_MAX, `Max accounts to return (default ${ADMIN_ACCOUNT_LIST_DEFAULT_LIMIT}, max ${ADMIN_ACCOUNT_LIST_LIMIT_MAX}).`),
|
|
67
|
+
offset: PageOffset,
|
|
68
|
+
include_deleted: meta(optional(nullable(boolean)), {
|
|
56
69
|
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`.'
|
|
57
70
|
})
|
|
58
|
-
})
|
|
59
|
-
.default({});
|
|
71
|
+
}), () => ({}));
|
|
60
72
|
/** Output for `admin_account_list`. */
|
|
61
73
|
export const AdminAccountListOutput = z.strictObject({
|
|
62
74
|
accounts: z.array(AdminAccountEntryJson),
|
|
63
75
|
grantable_roles: z.array(RoleName)
|
|
64
76
|
});
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
})
|
|
70
|
-
.default({});
|
|
77
|
+
/**
|
|
78
|
+
* Input for `admin_session_list`, a `@fuzdev/fuz_schema` schema. An omitted
|
|
79
|
+
* input reads as a fresh `{}`.
|
|
80
|
+
*/
|
|
81
|
+
export const AdminSessionListInput = with_default_fn(object({ acting: ActingActor }), () => ({}));
|
|
71
82
|
/** Output for `admin_session_list`. Cross-account listing; fan-out already scoped by role auth. */
|
|
72
83
|
export const AdminSessionListOutput = z.strictObject({
|
|
73
84
|
sessions: z.array(AdminSessionJson)
|
|
74
85
|
});
|
|
75
|
-
/** Input for `admin_session_revoke_all
|
|
76
|
-
export const AdminSessionRevokeAllInput =
|
|
77
|
-
account_id:
|
|
86
|
+
/** Input for `admin_session_revoke_all`, a `@fuzdev/fuz_schema` schema. */
|
|
87
|
+
export const AdminSessionRevokeAllInput = object({
|
|
88
|
+
account_id: meta(Uuid, { description: 'Account whose sessions to revoke.' }),
|
|
78
89
|
acting: ActingActor
|
|
79
90
|
});
|
|
80
|
-
/** Output for `admin_session_revoke_all
|
|
81
|
-
export const AdminSessionRevokeAllOutput =
|
|
82
|
-
ok:
|
|
83
|
-
count:
|
|
91
|
+
/** Output for `admin_session_revoke_all`, a `@fuzdev/fuz_schema` schema. */
|
|
92
|
+
export const AdminSessionRevokeAllOutput = object({
|
|
93
|
+
ok: literal(true),
|
|
94
|
+
count: pipe(number, integer, min_value(0))
|
|
84
95
|
});
|
|
85
|
-
/** Input for `admin_token_revoke_all
|
|
86
|
-
export const AdminTokenRevokeAllInput =
|
|
87
|
-
account_id:
|
|
96
|
+
/** Input for `admin_token_revoke_all`, a `@fuzdev/fuz_schema` schema. */
|
|
97
|
+
export const AdminTokenRevokeAllInput = object({
|
|
98
|
+
account_id: meta(Uuid, { description: 'Account whose API tokens to revoke.' }),
|
|
88
99
|
acting: ActingActor
|
|
89
100
|
});
|
|
90
|
-
/** Output for `admin_token_revoke_all
|
|
91
|
-
export const AdminTokenRevokeAllOutput =
|
|
92
|
-
ok:
|
|
93
|
-
count:
|
|
101
|
+
/** Output for `admin_token_revoke_all`, a `@fuzdev/fuz_schema` schema. */
|
|
102
|
+
export const AdminTokenRevokeAllOutput = object({
|
|
103
|
+
ok: literal(true),
|
|
104
|
+
count: pipe(number, integer, min_value(0))
|
|
94
105
|
});
|
|
95
106
|
/**
|
|
96
|
-
* Input for `audit_log_list
|
|
97
|
-
* default newest-first page
|
|
98
|
-
*
|
|
99
|
-
*
|
|
107
|
+
* Input for `audit_log_list`, a `@fuzdev/fuz_schema` schema. All filter
|
|
108
|
+
* fields are optional — omit for the default newest-first page, and an
|
|
109
|
+
* omitted input reads as a fresh `{}`. `since_seq` exists for SSE
|
|
110
|
+
* reconnection gap fill (caller supplies the highest seq seen; server returns
|
|
111
|
+
* everything after).
|
|
100
112
|
*/
|
|
101
|
-
export const AuditLogListInput =
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
description: 'Filter by event type. Accepts builtin or consumer-registered names (regex-validated).'
|
|
113
|
+
export const AuditLogListInput = with_default_fn(object({
|
|
114
|
+
event_type: meta(optional(nullable(AuditEventTypeName)), {
|
|
115
|
+
description: `Filter by event type. Accepts builtin or consumer-registered names (regex-validated, at most ${NAME_LENGTH_MAX} characters).`
|
|
105
116
|
}),
|
|
106
|
-
outcome: AuditOutcome
|
|
117
|
+
outcome: meta(optional(nullable(AuditOutcome)), {
|
|
107
118
|
description: 'Filter by outcome (`success` or `failure`).',
|
|
108
119
|
invalid_reason: ERROR_OUTCOME_INVALID
|
|
109
120
|
}),
|
|
110
|
-
account_id: Uuid
|
|
121
|
+
account_id: meta(optional(nullable(Uuid)), {
|
|
111
122
|
description: 'Filter by account id — matches the actor or the target account.'
|
|
112
123
|
}),
|
|
113
|
-
limit:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
.min(1)
|
|
117
|
-
.max(AUDIT_LOG_LIST_LIMIT_MAX)
|
|
118
|
-
.nullish()
|
|
119
|
-
.meta({
|
|
120
|
-
description: `Max rows to return (default ${AUDIT_LOG_DEFAULT_LIMIT}, max ${AUDIT_LOG_LIST_LIMIT_MAX}).`,
|
|
121
|
-
invalid_reason: ERROR_LIMIT_INVALID
|
|
122
|
-
}),
|
|
123
|
-
offset: z
|
|
124
|
-
.number()
|
|
125
|
-
.int()
|
|
126
|
-
.min(0)
|
|
127
|
-
.nullish()
|
|
128
|
-
.meta({ description: 'Pagination offset.', invalid_reason: ERROR_OFFSET_INVALID }),
|
|
129
|
-
since_seq: z.number().int().min(0).nullish().meta({
|
|
124
|
+
limit: page_limit(AUDIT_LOG_LIST_LIMIT_MAX, `Max rows to return (default ${AUDIT_LOG_DEFAULT_LIMIT}, max ${AUDIT_LOG_LIST_LIMIT_MAX}).`),
|
|
125
|
+
offset: PageOffset,
|
|
126
|
+
since_seq: meta(SafeCount, {
|
|
130
127
|
description: 'Gap-fill from this seq forward. Used for SSE reconnection.',
|
|
131
128
|
invalid_reason: ERROR_SINCE_SEQ_INVALID
|
|
132
129
|
}),
|
|
133
130
|
acting: ActingActor
|
|
134
|
-
})
|
|
135
|
-
.default({});
|
|
131
|
+
}), () => ({}));
|
|
136
132
|
/** Output for `audit_log_list`. */
|
|
137
133
|
export const AuditLogListOutput = z.strictObject({
|
|
138
134
|
events: z.array(AuditLogEventWithUsernamesJson)
|
|
139
135
|
});
|
|
140
|
-
/**
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
.max(AUDIT_LOG_LIST_LIMIT_MAX)
|
|
148
|
-
.nullish()
|
|
149
|
-
.meta({
|
|
150
|
-
description: `Max rows to return (default ${AUDIT_LOG_DEFAULT_LIMIT}, max ${AUDIT_LOG_LIST_LIMIT_MAX}).`,
|
|
151
|
-
invalid_reason: ERROR_LIMIT_INVALID
|
|
152
|
-
}),
|
|
153
|
-
offset: z
|
|
154
|
-
.number()
|
|
155
|
-
.int()
|
|
156
|
-
.min(0)
|
|
157
|
-
.nullish()
|
|
158
|
-
.meta({ description: 'Pagination offset.', invalid_reason: ERROR_OFFSET_INVALID }),
|
|
136
|
+
/**
|
|
137
|
+
* Input for `audit_log_role_grant_history`, a `@fuzdev/fuz_schema` schema.
|
|
138
|
+
* An omitted input reads as a fresh `{}`.
|
|
139
|
+
*/
|
|
140
|
+
export const AuditLogRoleGrantHistoryInput = with_default_fn(object({
|
|
141
|
+
limit: page_limit(AUDIT_LOG_LIST_LIMIT_MAX, `Max rows to return (default ${AUDIT_LOG_DEFAULT_LIMIT}, max ${AUDIT_LOG_LIST_LIMIT_MAX}).`),
|
|
142
|
+
offset: PageOffset,
|
|
159
143
|
acting: ActingActor
|
|
160
|
-
})
|
|
161
|
-
.default({});
|
|
144
|
+
}), () => ({}));
|
|
162
145
|
/** Output for `audit_log_role_grant_history`. */
|
|
163
146
|
export const AuditLogRoleGrantHistoryOutput = z.strictObject({
|
|
164
147
|
events: z.array(RoleGrantHistoryEventJson)
|
|
165
148
|
});
|
|
166
|
-
/**
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
149
|
+
/**
|
|
150
|
+
* Input for `invite_create`, a `@fuzdev/fuz_schema` schema. At least one of
|
|
151
|
+
* `email` / `username` must be provided: an input with neither fails with
|
|
152
|
+
* `INVITE_TARGET_REQUIRED_MESSAGE`, a `check` issue at `email`. The check runs
|
|
153
|
+
* only on an input whose fields all passed.
|
|
154
|
+
*/
|
|
155
|
+
export const InviteCreateInput = pipe(object({
|
|
156
|
+
email: meta(optional(nullable(Email)), { description: 'Invitee email.' }),
|
|
157
|
+
username: meta(optional(nullable(Username)), { description: 'Invitee username.' }),
|
|
171
158
|
acting: ActingActor
|
|
172
|
-
})
|
|
173
|
-
.refine((v) => v.email != null || v.username != null, {
|
|
174
|
-
message: 'at least one of email or username is required',
|
|
175
|
-
path: ['email']
|
|
176
|
-
});
|
|
159
|
+
}), message(check_at('email', (v) => v.email != null || v.username != null), INVITE_TARGET_REQUIRED_MESSAGE));
|
|
177
160
|
/** Output for `invite_create`. */
|
|
178
161
|
export const InviteCreateOutput = z.strictObject({
|
|
179
162
|
ok: z.literal(true),
|
|
180
163
|
invite: InviteJson
|
|
181
164
|
});
|
|
182
|
-
/**
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
})
|
|
187
|
-
.default({});
|
|
165
|
+
/**
|
|
166
|
+
* Input for `invite_list`, a `@fuzdev/fuz_schema` schema. An omitted input
|
|
167
|
+
* reads as a fresh `{}`.
|
|
168
|
+
*/
|
|
169
|
+
export const InviteListInput = with_default_fn(object({ acting: ActingActor }), () => ({}));
|
|
188
170
|
/** Output for `invite_list`. Uses the enriched row including creator/claimer usernames. */
|
|
189
171
|
export const InviteListOutput = z.strictObject({
|
|
190
172
|
invites: z.array(InviteWithUsernamesJson)
|
|
191
173
|
});
|
|
192
|
-
/** Input for `invite_delete
|
|
193
|
-
export const InviteDeleteInput =
|
|
194
|
-
invite_id:
|
|
174
|
+
/** Input for `invite_delete`, a `@fuzdev/fuz_schema` schema. */
|
|
175
|
+
export const InviteDeleteInput = object({
|
|
176
|
+
invite_id: meta(Uuid, { description: 'Invite to delete. Must be unclaimed.' }),
|
|
195
177
|
acting: ActingActor
|
|
196
178
|
});
|
|
197
|
-
/** Output for `invite_delete
|
|
198
|
-
export const InviteDeleteOutput =
|
|
199
|
-
ok:
|
|
179
|
+
/** Output for `invite_delete`, a `@fuzdev/fuz_schema` schema. */
|
|
180
|
+
export const InviteDeleteOutput = object({
|
|
181
|
+
ok: literal(true)
|
|
200
182
|
});
|
|
201
|
-
/**
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
})
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
export const AppSettingsGetOutput = z.strictObject({
|
|
183
|
+
/**
|
|
184
|
+
* Input for `app_settings_get`, a `@fuzdev/fuz_schema` schema. An omitted
|
|
185
|
+
* input reads as a fresh `{}`.
|
|
186
|
+
*/
|
|
187
|
+
export const AppSettingsGetInput = with_default_fn(object({ acting: ActingActor }), () => ({}));
|
|
188
|
+
/** Output for `app_settings_get`, a `@fuzdev/fuz_schema` schema. */
|
|
189
|
+
export const AppSettingsGetOutput = object({
|
|
209
190
|
settings: AppSettingsWithUsernameJson
|
|
210
191
|
});
|
|
211
|
-
/** Input for `app_settings_update
|
|
212
|
-
export const AppSettingsUpdateInput =
|
|
213
|
-
open_signup:
|
|
192
|
+
/** Input for `app_settings_update`, a `@fuzdev/fuz_schema` schema. */
|
|
193
|
+
export const AppSettingsUpdateInput = object({
|
|
194
|
+
open_signup: meta(boolean, { description: 'New value for the open signup toggle.' }),
|
|
214
195
|
acting: ActingActor
|
|
215
196
|
});
|
|
216
|
-
/** Output for `app_settings_update
|
|
217
|
-
export const AppSettingsUpdateOutput =
|
|
218
|
-
ok:
|
|
197
|
+
/** Output for `app_settings_update`, a `@fuzdev/fuz_schema` schema. */
|
|
198
|
+
export const AppSettingsUpdateOutput = object({
|
|
199
|
+
ok: literal(true),
|
|
219
200
|
settings: AppSettingsWithUsernameJson
|
|
220
201
|
});
|
|
221
202
|
/**
|
|
@@ -247,51 +228,54 @@ export const ERROR_CANNOT_DELETE_KEEPER = 'cannot_delete_keeper';
|
|
|
247
228
|
*/
|
|
248
229
|
export const ERROR_CANNOT_DELETE_LAST_ADMIN = 'cannot_delete_last_admin';
|
|
249
230
|
/**
|
|
250
|
-
* Input for `account_delete` (soft delete)
|
|
251
|
-
* omitted (or equal to the caller's own account)
|
|
252
|
-
* different account requires the admin role
|
|
253
|
-
* elevation, like `role_grant_offer_list`).
|
|
231
|
+
* Input for `account_delete` (soft delete), a `@fuzdev/fuz_schema` schema.
|
|
232
|
+
* `account_id` is optional — omitted (or equal to the caller's own account)
|
|
233
|
+
* is a self-delete; a different account requires the admin role
|
|
234
|
+
* (handler-enforced elevation, like `role_grant_offer_list`). An omitted
|
|
235
|
+
* input reads as a fresh `{}`.
|
|
254
236
|
*/
|
|
255
|
-
export const AccountDeleteInput =
|
|
256
|
-
|
|
257
|
-
account_id: Uuid.nullish().meta({
|
|
237
|
+
export const AccountDeleteInput = with_default_fn(object({
|
|
238
|
+
account_id: meta(optional(nullable(Uuid)), {
|
|
258
239
|
description: 'Account to soft-delete. Omit for self-delete; another account requires admin.'
|
|
259
240
|
}),
|
|
260
241
|
acting: ActingActor
|
|
261
|
-
})
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
deleted: z.boolean()
|
|
242
|
+
}), () => ({}));
|
|
243
|
+
/** Output for `account_delete`, a `@fuzdev/fuz_schema` schema. */
|
|
244
|
+
export const AccountDeleteOutput = object({
|
|
245
|
+
ok: literal(true),
|
|
246
|
+
deleted: boolean
|
|
267
247
|
});
|
|
268
|
-
/**
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
248
|
+
/**
|
|
249
|
+
* Input for `account_purge` (hard, irreversible delete), a
|
|
250
|
+
* `@fuzdev/fuz_schema` schema. Keeper-only.
|
|
251
|
+
*/
|
|
252
|
+
export const AccountPurgeInput = object({
|
|
253
|
+
account_id: meta(Uuid, { description: 'Account to hard-purge.' }),
|
|
254
|
+
confirm: meta(optional(boolean), {
|
|
272
255
|
description: 'Must be `true` — fail-loud guard against an accidental irreversible purge.'
|
|
273
256
|
}),
|
|
274
257
|
acting: ActingActor
|
|
275
258
|
});
|
|
276
|
-
/** Output for `account_purge
|
|
277
|
-
export const AccountPurgeOutput =
|
|
278
|
-
ok:
|
|
279
|
-
purged:
|
|
259
|
+
/** Output for `account_purge`, a `@fuzdev/fuz_schema` schema. */
|
|
260
|
+
export const AccountPurgeOutput = object({
|
|
261
|
+
ok: literal(true),
|
|
262
|
+
purged: boolean
|
|
280
263
|
});
|
|
281
264
|
/**
|
|
282
|
-
* Input for `account_undelete` (reactivation)
|
|
283
|
-
* unlike `account_delete` there is no
|
|
284
|
-
* can't authenticate (auth resolution
|
|
285
|
-
* so reactivation is always an admin
|
|
265
|
+
* Input for `account_undelete` (reactivation), a `@fuzdev/fuz_schema`
|
|
266
|
+
* schema. `account_id` is required — unlike `account_delete` there is no
|
|
267
|
+
* self path: a soft-deleted account can't authenticate (auth resolution
|
|
268
|
+
* excludes it, sessions are revoked), so reactivation is always an admin
|
|
269
|
+
* acting on another account.
|
|
286
270
|
*/
|
|
287
|
-
export const AccountUndeleteInput =
|
|
288
|
-
account_id:
|
|
271
|
+
export const AccountUndeleteInput = object({
|
|
272
|
+
account_id: meta(Uuid, { description: 'Soft-deleted account to reactivate.' }),
|
|
289
273
|
acting: ActingActor
|
|
290
274
|
});
|
|
291
|
-
/** Output for `account_undelete
|
|
292
|
-
export const AccountUndeleteOutput =
|
|
293
|
-
ok:
|
|
294
|
-
undeleted:
|
|
275
|
+
/** Output for `account_undelete`, a `@fuzdev/fuz_schema` schema. */
|
|
276
|
+
export const AccountUndeleteOutput = object({
|
|
277
|
+
ok: literal(true),
|
|
278
|
+
undeleted: boolean
|
|
295
279
|
});
|
|
296
280
|
// -- Action specs -----------------------------------------------------------
|
|
297
281
|
/**
|
|
@@ -1,36 +1,59 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* App settings types and client-safe schemas.
|
|
2
|
+
* App settings types and client-safe schemas, `@fuzdev/fuz_schema` schemas.
|
|
3
3
|
*
|
|
4
4
|
* Single-row table for global app configuration (e.g. open signup toggle).
|
|
5
5
|
*
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
import { Uuid } from '../
|
|
8
|
+
import { type Infer } from '@fuzdev/fuz_schema/schema.ts';
|
|
9
|
+
import { Uuid } from '../primitive_schemas_fuz.js';
|
|
10
10
|
/** App settings row from the database. */
|
|
11
11
|
export interface AppSettings {
|
|
12
12
|
open_signup: boolean;
|
|
13
13
|
updated_at: string | null;
|
|
14
14
|
updated_by: Uuid | null;
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
17
|
-
export declare const AppSettingsJson:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
export type
|
|
16
|
+
/** Client-safe app settings data. */
|
|
17
|
+
export declare const AppSettingsJson: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
18
|
+
updated_at: string | null;
|
|
19
|
+
updated_by: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
20
|
+
open_signup: boolean;
|
|
21
|
+
}, {
|
|
22
|
+
updated_at: string | null;
|
|
23
|
+
updated_by: string | null;
|
|
24
|
+
open_signup: boolean;
|
|
25
|
+
}, "object", {
|
|
26
|
+
open_signup: import("@fuzdev/fuz_schema/schema.ts").Schema<boolean, boolean, "boolean", undefined>;
|
|
27
|
+
updated_at: import("@fuzdev/fuz_schema/schema.ts").Schema<string | null, string | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
28
|
+
updated_by: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null, string | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
|
|
29
|
+
readonly '~types'?: {
|
|
30
|
+
readonly input: string;
|
|
31
|
+
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
32
|
+
} | undefined;
|
|
33
|
+
}>>;
|
|
34
|
+
}>;
|
|
35
|
+
export type AppSettingsJson = Infer<typeof AppSettingsJson>;
|
|
36
|
+
/** Admin app settings with the updater's username resolved. */
|
|
37
|
+
export declare const AppSettingsWithUsernameJson: import("@fuzdev/fuz_schema/schema.ts").Schema<{
|
|
38
|
+
updated_at: string | null;
|
|
39
|
+
updated_by: import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null;
|
|
40
|
+
open_signup: boolean;
|
|
41
|
+
updated_by_username: string | null;
|
|
42
|
+
}, {
|
|
43
|
+
updated_at: string | null;
|
|
44
|
+
updated_by: string | null;
|
|
45
|
+
open_signup: boolean;
|
|
46
|
+
updated_by_username: string | null;
|
|
47
|
+
}, "object", {
|
|
48
|
+
updated_by_username: import("@fuzdev/fuz_schema/schema.ts").Schema<string | null, string | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
49
|
+
open_signup: import("@fuzdev/fuz_schema/schema.ts").Schema<boolean, boolean, "boolean", undefined>;
|
|
50
|
+
updated_at: import("@fuzdev/fuz_schema/schema.ts").Schema<string | null, string | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>>>;
|
|
51
|
+
updated_by: import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid"> | null, string | null, "nullable", import("@fuzdev/fuz_schema/schema.ts").SchemaWrapperDef<import("@fuzdev/fuz_schema/schema.ts").Schema<import("@fuzdev/fuz_schema/schema.ts").Branded<string, "Uuid">, string, "pipe", readonly (import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"string"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"number"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"bigint"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"boolean"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"check"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"uuid"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"unknown"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"record"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"array"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"union"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"literal"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"nullable"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"optional"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"transform"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"pipe"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"lazy"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"regex"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
|
|
52
|
+
readonly '~types'?: {
|
|
53
|
+
readonly input: string;
|
|
54
|
+
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|
|
55
|
+
} | undefined;
|
|
56
|
+
}>>;
|
|
57
|
+
}>;
|
|
58
|
+
export type AppSettingsWithUsernameJson = Infer<typeof AppSettingsWithUsernameJson>;
|
|
36
59
|
//# sourceMappingURL=app_settings_schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app_settings_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/app_settings_schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"app_settings_schema.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/auth/app_settings_schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAqC,KAAK,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAE7F,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAEnD,0CAA0C;AAC1C,MAAM,WAAW,WAAW;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;CACxB;AAED,qCAAqC;AACrC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;EAI1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE5D,+DAA+D;AAC/D,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;EAGtC,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* App settings types and client-safe schemas.
|
|
2
|
+
* App settings types and client-safe schemas, `@fuzdev/fuz_schema` schemas.
|
|
3
3
|
*
|
|
4
4
|
* Single-row table for global app configuration (e.g. open signup toggle).
|
|
5
5
|
*
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
import { Uuid } from '../
|
|
10
|
-
/**
|
|
11
|
-
export const AppSettingsJson =
|
|
12
|
-
open_signup:
|
|
13
|
-
updated_at:
|
|
14
|
-
updated_by:
|
|
8
|
+
import { boolean, nullable, object, string } from '@fuzdev/fuz_schema/schema.ts';
|
|
9
|
+
import { Uuid } from '../primitive_schemas_fuz.js';
|
|
10
|
+
/** Client-safe app settings data. */
|
|
11
|
+
export const AppSettingsJson = object({
|
|
12
|
+
open_signup: boolean,
|
|
13
|
+
updated_at: nullable(string),
|
|
14
|
+
updated_by: nullable(Uuid)
|
|
15
15
|
});
|
|
16
|
-
/**
|
|
17
|
-
export const AppSettingsWithUsernameJson =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/** Zod schema for updating app settings. */
|
|
21
|
-
export const UpdateAppSettingsInput = z.strictObject({
|
|
22
|
-
open_signup: z.boolean()
|
|
16
|
+
/** Admin app settings with the updater's username resolved. */
|
|
17
|
+
export const AppSettingsWithUsernameJson = object({
|
|
18
|
+
...AppSettingsJson.def,
|
|
19
|
+
updated_by_username: nullable(string)
|
|
23
20
|
});
|
|
@@ -21,7 +21,7 @@ export declare const AuditStreamQuery: import("@fuzdev/fuz_schema/schema.ts").Sc
|
|
|
21
21
|
}, {
|
|
22
22
|
acting?: string | undefined;
|
|
23
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<"
|
|
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<"one_of"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"with_default_fn"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"loose_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"strip_object"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"object_with_rest"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"variant"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_length"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"min_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"max_value"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"safe_integer"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"iso_datetime"> | import("@fuzdev/fuz_schema/schema.ts").SchemaOfKind<"to_lower_case">)[]> & {
|
|
25
25
|
readonly '~types'?: {
|
|
26
26
|
readonly input: string;
|
|
27
27
|
readonly first: import("@fuzdev/fuz_schema/schema.ts").Schema<string, string, "string", undefined>;
|