@fuzdev/fuz_app 0.160.0 → 0.162.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/auth/CLAUDE.md +31 -21
- package/dist/auth/account_action_specs.d.ts +173 -35
- package/dist/auth/account_action_specs.d.ts.map +1 -1
- package/dist/auth/account_action_specs.js +10 -7
- package/dist/auth/account_route_schema.d.ts +293 -46
- package/dist/auth/account_route_schema.d.ts.map +1 -1
- package/dist/auth/account_route_schema.js +5 -4
- package/dist/auth/account_schema.d.ts +489 -103
- package/dist/auth/account_schema.d.ts.map +1 -1
- package/dist/auth/account_schema.js +67 -47
- 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 +2748 -505
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.js +175 -187
- 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_emitter.d.ts +8 -3
- package/dist/auth/audit_emitter.d.ts.map +1 -1
- package/dist/auth/audit_emitter.js +32 -9
- package/dist/auth/audit_log_queries.d.ts.map +1 -1
- package/dist/auth/audit_log_queries.js +4 -3
- package/dist/auth/audit_log_route_schema.d.ts +1 -1
- package/dist/auth/audit_log_schema.d.ts +791 -253
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +198 -198
- package/dist/auth/audit_log_schema_fuz.d.ts +53 -0
- package/dist/auth/audit_log_schema_fuz.d.ts.map +1 -0
- package/dist/auth/audit_log_schema_fuz.js +50 -0
- package/dist/auth/credential_type_schema.d.ts +5 -8
- 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/invite_schema.d.ts +98 -26
- package/dist/auth/invite_schema.d.ts.map +1 -1
- package/dist/auth/invite_schema.js +21 -14
- package/dist/auth/migrations.d.ts.map +1 -1
- package/dist/auth/migrations.js +27 -0
- 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 +192 -192
- package/dist/auth/role_grant_offer_action_specs.js +2 -2
- package/dist/auth/role_grant_offer_notifications.d.ts +126 -126
- package/dist/auth/role_grant_offer_schema.d.ts +12 -12
- package/dist/auth/role_grant_offer_schema.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_schema.js +8 -8
- 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 -26
- package/dist/auth/scope_kind_schema.d.ts.map +1 -1
- package/dist/auth/scope_kind_schema.js +15 -31
- package/dist/auth/scope_kind_schema_fuz.d.ts +4 -3
- package/dist/auth/scope_kind_schema_fuz.d.ts.map +1 -1
- package/dist/auth/scope_kind_schema_fuz.js +7 -5
- 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/dev/setup.d.ts +14 -7
- package/dist/dev/setup.d.ts.map +1 -1
- package/dist/dev/setup.js +11 -6
- package/dist/primitive_schemas.d.ts +47 -4
- package/dist/primitive_schemas.d.ts.map +1 -1
- package/dist/primitive_schemas.js +40 -19
- package/dist/primitive_schemas_fuz.d.ts +70 -8
- package/dist/primitive_schemas_fuz.d.ts.map +1 -1
- package/dist/primitive_schemas_fuz.js +62 -7
- package/dist/testing/CLAUDE.md +11 -6
- package/dist/testing/app_server.d.ts +3 -1
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +6 -2
- package/dist/testing/audit_drift_guard.d.ts.map +1 -1
- package/dist/testing/audit_drift_guard.js +12 -13
- package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/identity_parity.js +24 -13
- 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/session_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/session_cap.js +4 -3
- package/dist/testing/db_entities.d.ts +3 -1
- package/dist/testing/db_entities.d.ts.map +1 -1
- package/dist/testing/db_entities.js +4 -2
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +3 -2
- package/dist/zod.d.ts +2 -1
- package/dist/zod.d.ts.map +1 -1
- package/dist/zod.js +6 -2
- 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;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAeN,KAAK,KAAK,EACV,MAAM,8BAA8B,CAAC;AAGtC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAsB3E,+BAA+B;AAC/B,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,8CAA8C;AAC9C,eAAO,MAAM,gCAAgC,KAAK,CAAC;AACnD,0CAA0C;AAC1C,eAAO,MA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,27 @@
|
|
|
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 and output is a `@fuzdev/fuz_schema` schema.
|
|
6
7
|
*
|
|
7
8
|
* Authorization is declared at the spec level (`auth: {role: ROLE_ADMIN}`)
|
|
8
9
|
* so the RPC dispatcher enforces admin before the handler runs and the
|
|
9
10
|
* generated surface accurately reports the requirement.
|
|
10
11
|
*
|
|
11
|
-
* The registry
|
|
12
|
-
*
|
|
13
|
-
* `AdminActionOptions.app_settings` is provided; dispatch falls back to
|
|
14
|
-
* `method_not_found` when absent.
|
|
12
|
+
* The registry includes `app_settings_get` / `app_settings_update`, and
|
|
13
|
+
* `create_admin_actions` always wires their handlers.
|
|
15
14
|
*
|
|
16
15
|
* @module
|
|
17
16
|
*/
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
17
|
+
import { meta } from '@fuzdev/fuz_schema/meta.ts';
|
|
18
|
+
import { array, boolean, check_at, integer, literal, max_value, message, min_value, nullable, number, object, optional, pipe, with_default_fn } from '@fuzdev/fuz_schema/schema.ts';
|
|
19
|
+
import { ActingActor, Email, Username, Uuid } from '../primitive_schemas_fuz.js';
|
|
20
|
+
import { ROLE_ADMIN, ROLE_KEEPER } from './role_schema.js';
|
|
21
|
+
import { RoleName } from './role_schema_fuz.js';
|
|
21
22
|
import { CREDENTIAL_TYPE_DAEMON_TOKEN } from './credential_type_schema.js';
|
|
23
|
+
import { NAME_LENGTH_MAX } from './name_schema.js';
|
|
22
24
|
import { AdminAccountEntryJson } from './account_schema.js';
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
+
import { AdminSessionJson, AUDIT_LOG_DEFAULT_LIMIT, AuditLogEventWithUsernamesJson, RoleGrantHistoryEventJson } from './audit_log_schema.js';
|
|
26
|
+
import { AuditEventTypeName, AuditOutcome } from './audit_log_schema_fuz.js';
|
|
25
27
|
import { InviteJson, InviteWithUsernamesJson } from './invite_schema.js';
|
|
26
28
|
import { AppSettingsWithUsernameJson } from './app_settings_schema.js';
|
|
27
29
|
import { ERROR_LIMIT_INVALID, ERROR_OFFSET_INVALID, ERROR_OUTCOME_INVALID, ERROR_SINCE_SEQ_INVALID } from '../http/error_schemas.js';
|
|
@@ -31,191 +33,174 @@ export const AUDIT_LOG_LIST_LIMIT_MAX = 200;
|
|
|
31
33
|
export const ADMIN_ACCOUNT_LIST_DEFAULT_LIMIT = 50;
|
|
32
34
|
/** Max `admin_account_list` page size. */
|
|
33
35
|
export const ADMIN_ACCOUNT_LIST_LIMIT_MAX = 200;
|
|
36
|
+
/** The message `invite_create` fails with when it is given neither `email` nor `username`. */
|
|
37
|
+
export const INVITE_TARGET_REQUIRED_MESSAGE = 'at least one of email or username is required';
|
|
34
38
|
// -- Input/output schemas ---------------------------------------------------
|
|
35
|
-
/**
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
/**
|
|
40
|
+
* A page's `limit`, an integer in `[1, max]`, or absent, with the reason
|
|
41
|
+
* every refusal of it carries.
|
|
42
|
+
*/
|
|
43
|
+
const page_limit = (max, description) => meta(optional(nullable(pipe(number, integer, min_value(1), max_value(max)))), {
|
|
44
|
+
description,
|
|
45
|
+
invalid_reason: ERROR_LIMIT_INVALID
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* An integer at least zero, bounded by `Number.MAX_SAFE_INTEGER`, the
|
|
49
|
+
* integers every number holds exactly, or absent: a page's `offset` and the
|
|
50
|
+
* audit list's `since_seq`.
|
|
51
|
+
*/
|
|
52
|
+
const SafeCount = optional(nullable(pipe(number, integer, min_value(0), max_value(Number.MAX_SAFE_INTEGER))));
|
|
53
|
+
/** A page's `offset`, with the reason every refusal of it carries. */
|
|
54
|
+
const PageOffset = meta(SafeCount, {
|
|
55
|
+
description: 'Pagination offset.',
|
|
56
|
+
invalid_reason: ERROR_OFFSET_INVALID
|
|
57
|
+
});
|
|
58
|
+
/**
|
|
59
|
+
* Input for `admin_account_list`, a `@fuzdev/fuz_schema` schema. An omitted
|
|
60
|
+
* input reads as a fresh `{}`.
|
|
61
|
+
*/
|
|
62
|
+
export const AdminAccountListInput = with_default_fn(object({
|
|
38
63
|
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({
|
|
64
|
+
limit: page_limit(ADMIN_ACCOUNT_LIST_LIMIT_MAX, `Max accounts to return (default ${ADMIN_ACCOUNT_LIST_DEFAULT_LIMIT}, max ${ADMIN_ACCOUNT_LIST_LIMIT_MAX}).`),
|
|
65
|
+
offset: PageOffset,
|
|
66
|
+
include_deleted: meta(optional(nullable(boolean)), {
|
|
56
67
|
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
68
|
})
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
grantable_roles: z.array(RoleName)
|
|
69
|
+
}), () => ({}));
|
|
70
|
+
/** Output for `admin_account_list`, a `@fuzdev/fuz_schema` schema. */
|
|
71
|
+
export const AdminAccountListOutput = object({
|
|
72
|
+
accounts: array(AdminAccountEntryJson),
|
|
73
|
+
grantable_roles: array(RoleName)
|
|
64
74
|
});
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Input for `admin_session_list`, a `@fuzdev/fuz_schema` schema. An omitted
|
|
77
|
+
* input reads as a fresh `{}`.
|
|
78
|
+
*/
|
|
79
|
+
export const AdminSessionListInput = with_default_fn(object({ acting: ActingActor }), () => ({}));
|
|
80
|
+
/**
|
|
81
|
+
* Output for `admin_session_list`, a `@fuzdev/fuz_schema` schema.
|
|
82
|
+
* Cross-account listing; fan-out already scoped by role auth.
|
|
83
|
+
*/
|
|
84
|
+
export const AdminSessionListOutput = object({
|
|
85
|
+
sessions: array(AdminSessionJson)
|
|
74
86
|
});
|
|
75
|
-
/** Input for `admin_session_revoke_all
|
|
76
|
-
export const AdminSessionRevokeAllInput =
|
|
77
|
-
account_id:
|
|
87
|
+
/** Input for `admin_session_revoke_all`, a `@fuzdev/fuz_schema` schema. */
|
|
88
|
+
export const AdminSessionRevokeAllInput = object({
|
|
89
|
+
account_id: meta(Uuid, { description: 'Account whose sessions to revoke.' }),
|
|
78
90
|
acting: ActingActor
|
|
79
91
|
});
|
|
80
|
-
/** Output for `admin_session_revoke_all
|
|
81
|
-
export const AdminSessionRevokeAllOutput =
|
|
82
|
-
ok:
|
|
83
|
-
count:
|
|
92
|
+
/** Output for `admin_session_revoke_all`, a `@fuzdev/fuz_schema` schema. */
|
|
93
|
+
export const AdminSessionRevokeAllOutput = object({
|
|
94
|
+
ok: literal(true),
|
|
95
|
+
count: pipe(number, integer, min_value(0))
|
|
84
96
|
});
|
|
85
|
-
/** Input for `admin_token_revoke_all
|
|
86
|
-
export const AdminTokenRevokeAllInput =
|
|
87
|
-
account_id:
|
|
97
|
+
/** Input for `admin_token_revoke_all`, a `@fuzdev/fuz_schema` schema. */
|
|
98
|
+
export const AdminTokenRevokeAllInput = object({
|
|
99
|
+
account_id: meta(Uuid, { description: 'Account whose API tokens to revoke.' }),
|
|
88
100
|
acting: ActingActor
|
|
89
101
|
});
|
|
90
|
-
/** Output for `admin_token_revoke_all
|
|
91
|
-
export const AdminTokenRevokeAllOutput =
|
|
92
|
-
ok:
|
|
93
|
-
count:
|
|
102
|
+
/** Output for `admin_token_revoke_all`, a `@fuzdev/fuz_schema` schema. */
|
|
103
|
+
export const AdminTokenRevokeAllOutput = object({
|
|
104
|
+
ok: literal(true),
|
|
105
|
+
count: pipe(number, integer, min_value(0))
|
|
94
106
|
});
|
|
95
107
|
/**
|
|
96
|
-
* Input for `audit_log_list
|
|
97
|
-
* default newest-first page
|
|
98
|
-
*
|
|
99
|
-
*
|
|
108
|
+
* Input for `audit_log_list`, a `@fuzdev/fuz_schema` schema. All filter
|
|
109
|
+
* fields are optional — omit for the default newest-first page, and an
|
|
110
|
+
* omitted input reads as a fresh `{}`. `since_seq` exists for SSE
|
|
111
|
+
* reconnection gap fill (caller supplies the highest seq seen; server returns
|
|
112
|
+
* everything after).
|
|
100
113
|
*/
|
|
101
|
-
export const AuditLogListInput =
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
description: 'Filter by event type. Accepts builtin or consumer-registered names (regex-validated).'
|
|
114
|
+
export const AuditLogListInput = with_default_fn(object({
|
|
115
|
+
event_type: meta(optional(nullable(AuditEventTypeName)), {
|
|
116
|
+
description: `Filter by event type. Accepts builtin or consumer-registered names (regex-validated, at most ${NAME_LENGTH_MAX} characters).`
|
|
105
117
|
}),
|
|
106
|
-
outcome: AuditOutcome
|
|
118
|
+
outcome: meta(optional(nullable(AuditOutcome)), {
|
|
107
119
|
description: 'Filter by outcome (`success` or `failure`).',
|
|
108
120
|
invalid_reason: ERROR_OUTCOME_INVALID
|
|
109
121
|
}),
|
|
110
|
-
account_id: Uuid
|
|
122
|
+
account_id: meta(optional(nullable(Uuid)), {
|
|
111
123
|
description: 'Filter by account id — matches the actor or the target account.'
|
|
112
124
|
}),
|
|
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({
|
|
125
|
+
limit: page_limit(AUDIT_LOG_LIST_LIMIT_MAX, `Max rows to return (default ${AUDIT_LOG_DEFAULT_LIMIT}, max ${AUDIT_LOG_LIST_LIMIT_MAX}).`),
|
|
126
|
+
offset: PageOffset,
|
|
127
|
+
since_seq: meta(SafeCount, {
|
|
130
128
|
description: 'Gap-fill from this seq forward. Used for SSE reconnection.',
|
|
131
129
|
invalid_reason: ERROR_SINCE_SEQ_INVALID
|
|
132
130
|
}),
|
|
133
131
|
acting: ActingActor
|
|
134
|
-
})
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
events: z.array(AuditLogEventWithUsernamesJson)
|
|
132
|
+
}), () => ({}));
|
|
133
|
+
/** Output for `audit_log_list`, a `@fuzdev/fuz_schema` schema. */
|
|
134
|
+
export const AuditLogListOutput = object({
|
|
135
|
+
events: array(AuditLogEventWithUsernamesJson)
|
|
139
136
|
});
|
|
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 }),
|
|
137
|
+
/**
|
|
138
|
+
* Input for `audit_log_role_grant_history`, a `@fuzdev/fuz_schema` schema.
|
|
139
|
+
* An omitted input reads as a fresh `{}`.
|
|
140
|
+
*/
|
|
141
|
+
export const AuditLogRoleGrantHistoryInput = with_default_fn(object({
|
|
142
|
+
limit: page_limit(AUDIT_LOG_LIST_LIMIT_MAX, `Max rows to return (default ${AUDIT_LOG_DEFAULT_LIMIT}, max ${AUDIT_LOG_LIST_LIMIT_MAX}).`),
|
|
143
|
+
offset: PageOffset,
|
|
159
144
|
acting: ActingActor
|
|
160
|
-
})
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
events: z.array(RoleGrantHistoryEventJson)
|
|
145
|
+
}), () => ({}));
|
|
146
|
+
/** Output for `audit_log_role_grant_history`, a `@fuzdev/fuz_schema` schema. */
|
|
147
|
+
export const AuditLogRoleGrantHistoryOutput = object({
|
|
148
|
+
events: array(RoleGrantHistoryEventJson)
|
|
165
149
|
});
|
|
166
|
-
/**
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
150
|
+
/**
|
|
151
|
+
* Input for `invite_create`, a `@fuzdev/fuz_schema` schema. At least one of
|
|
152
|
+
* `email` / `username` must be provided: an input with neither fails with
|
|
153
|
+
* `INVITE_TARGET_REQUIRED_MESSAGE`, a `check` issue at `email`. The check runs
|
|
154
|
+
* only on an input whose fields all passed.
|
|
155
|
+
*/
|
|
156
|
+
export const InviteCreateInput = pipe(object({
|
|
157
|
+
email: meta(optional(nullable(Email)), { description: 'Invitee email.' }),
|
|
158
|
+
username: meta(optional(nullable(Username)), { description: 'Invitee username.' }),
|
|
171
159
|
acting: ActingActor
|
|
172
|
-
})
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
});
|
|
177
|
-
/** Output for `invite_create`. */
|
|
178
|
-
export const InviteCreateOutput = z.strictObject({
|
|
179
|
-
ok: z.literal(true),
|
|
160
|
+
}), message(check_at('email', (v) => v.email != null || v.username != null), INVITE_TARGET_REQUIRED_MESSAGE));
|
|
161
|
+
/** Output for `invite_create`, a `@fuzdev/fuz_schema` schema. */
|
|
162
|
+
export const InviteCreateOutput = object({
|
|
163
|
+
ok: literal(true),
|
|
180
164
|
invite: InviteJson
|
|
181
165
|
});
|
|
182
|
-
/**
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
})
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
166
|
+
/**
|
|
167
|
+
* Input for `invite_list`, a `@fuzdev/fuz_schema` schema. An omitted input
|
|
168
|
+
* reads as a fresh `{}`.
|
|
169
|
+
*/
|
|
170
|
+
export const InviteListInput = with_default_fn(object({ acting: ActingActor }), () => ({}));
|
|
171
|
+
/**
|
|
172
|
+
* Output for `invite_list`, a `@fuzdev/fuz_schema` schema. Uses the enriched
|
|
173
|
+
* row including creator/claimer usernames.
|
|
174
|
+
*/
|
|
175
|
+
export const InviteListOutput = object({
|
|
176
|
+
invites: array(InviteWithUsernamesJson)
|
|
191
177
|
});
|
|
192
|
-
/** Input for `invite_delete
|
|
193
|
-
export const InviteDeleteInput =
|
|
194
|
-
invite_id:
|
|
178
|
+
/** Input for `invite_delete`, a `@fuzdev/fuz_schema` schema. */
|
|
179
|
+
export const InviteDeleteInput = object({
|
|
180
|
+
invite_id: meta(Uuid, { description: 'Invite to delete. Must be unclaimed.' }),
|
|
195
181
|
acting: ActingActor
|
|
196
182
|
});
|
|
197
|
-
/** Output for `invite_delete
|
|
198
|
-
export const InviteDeleteOutput =
|
|
199
|
-
ok:
|
|
183
|
+
/** Output for `invite_delete`, a `@fuzdev/fuz_schema` schema. */
|
|
184
|
+
export const InviteDeleteOutput = object({
|
|
185
|
+
ok: literal(true)
|
|
200
186
|
});
|
|
201
|
-
/**
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
})
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
export const AppSettingsGetOutput = z.strictObject({
|
|
187
|
+
/**
|
|
188
|
+
* Input for `app_settings_get`, a `@fuzdev/fuz_schema` schema. An omitted
|
|
189
|
+
* input reads as a fresh `{}`.
|
|
190
|
+
*/
|
|
191
|
+
export const AppSettingsGetInput = with_default_fn(object({ acting: ActingActor }), () => ({}));
|
|
192
|
+
/** Output for `app_settings_get`, a `@fuzdev/fuz_schema` schema. */
|
|
193
|
+
export const AppSettingsGetOutput = object({
|
|
209
194
|
settings: AppSettingsWithUsernameJson
|
|
210
195
|
});
|
|
211
|
-
/** Input for `app_settings_update
|
|
212
|
-
export const AppSettingsUpdateInput =
|
|
213
|
-
open_signup:
|
|
196
|
+
/** Input for `app_settings_update`, a `@fuzdev/fuz_schema` schema. */
|
|
197
|
+
export const AppSettingsUpdateInput = object({
|
|
198
|
+
open_signup: meta(boolean, { description: 'New value for the open signup toggle.' }),
|
|
214
199
|
acting: ActingActor
|
|
215
200
|
});
|
|
216
|
-
/** Output for `app_settings_update
|
|
217
|
-
export const AppSettingsUpdateOutput =
|
|
218
|
-
ok:
|
|
201
|
+
/** Output for `app_settings_update`, a `@fuzdev/fuz_schema` schema. */
|
|
202
|
+
export const AppSettingsUpdateOutput = object({
|
|
203
|
+
ok: literal(true),
|
|
219
204
|
settings: AppSettingsWithUsernameJson
|
|
220
205
|
});
|
|
221
206
|
/**
|
|
@@ -247,51 +232,54 @@ export const ERROR_CANNOT_DELETE_KEEPER = 'cannot_delete_keeper';
|
|
|
247
232
|
*/
|
|
248
233
|
export const ERROR_CANNOT_DELETE_LAST_ADMIN = 'cannot_delete_last_admin';
|
|
249
234
|
/**
|
|
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`).
|
|
235
|
+
* Input for `account_delete` (soft delete), a `@fuzdev/fuz_schema` schema.
|
|
236
|
+
* `account_id` is optional — omitted (or equal to the caller's own account)
|
|
237
|
+
* is a self-delete; a different account requires the admin role
|
|
238
|
+
* (handler-enforced elevation, like `role_grant_offer_list`). An omitted
|
|
239
|
+
* input reads as a fresh `{}`.
|
|
254
240
|
*/
|
|
255
|
-
export const AccountDeleteInput =
|
|
256
|
-
|
|
257
|
-
account_id: Uuid.nullish().meta({
|
|
241
|
+
export const AccountDeleteInput = with_default_fn(object({
|
|
242
|
+
account_id: meta(optional(nullable(Uuid)), {
|
|
258
243
|
description: 'Account to soft-delete. Omit for self-delete; another account requires admin.'
|
|
259
244
|
}),
|
|
260
245
|
acting: ActingActor
|
|
261
|
-
})
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
deleted: z.boolean()
|
|
246
|
+
}), () => ({}));
|
|
247
|
+
/** Output for `account_delete`, a `@fuzdev/fuz_schema` schema. */
|
|
248
|
+
export const AccountDeleteOutput = object({
|
|
249
|
+
ok: literal(true),
|
|
250
|
+
deleted: boolean
|
|
267
251
|
});
|
|
268
|
-
/**
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
252
|
+
/**
|
|
253
|
+
* Input for `account_purge` (hard, irreversible delete), a
|
|
254
|
+
* `@fuzdev/fuz_schema` schema. Keeper-only.
|
|
255
|
+
*/
|
|
256
|
+
export const AccountPurgeInput = object({
|
|
257
|
+
account_id: meta(Uuid, { description: 'Account to hard-purge.' }),
|
|
258
|
+
confirm: meta(optional(boolean), {
|
|
272
259
|
description: 'Must be `true` — fail-loud guard against an accidental irreversible purge.'
|
|
273
260
|
}),
|
|
274
261
|
acting: ActingActor
|
|
275
262
|
});
|
|
276
|
-
/** Output for `account_purge
|
|
277
|
-
export const AccountPurgeOutput =
|
|
278
|
-
ok:
|
|
279
|
-
purged:
|
|
263
|
+
/** Output for `account_purge`, a `@fuzdev/fuz_schema` schema. */
|
|
264
|
+
export const AccountPurgeOutput = object({
|
|
265
|
+
ok: literal(true),
|
|
266
|
+
purged: boolean
|
|
280
267
|
});
|
|
281
268
|
/**
|
|
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
|
|
269
|
+
* Input for `account_undelete` (reactivation), a `@fuzdev/fuz_schema`
|
|
270
|
+
* schema. `account_id` is required — unlike `account_delete` there is no
|
|
271
|
+
* self path: a soft-deleted account can't authenticate (auth resolution
|
|
272
|
+
* excludes it, sessions are revoked), so reactivation is always an admin
|
|
273
|
+
* acting on another account.
|
|
286
274
|
*/
|
|
287
|
-
export const AccountUndeleteInput =
|
|
288
|
-
account_id:
|
|
275
|
+
export const AccountUndeleteInput = object({
|
|
276
|
+
account_id: meta(Uuid, { description: 'Soft-deleted account to reactivate.' }),
|
|
289
277
|
acting: ActingActor
|
|
290
278
|
});
|
|
291
|
-
/** Output for `account_undelete
|
|
292
|
-
export const AccountUndeleteOutput =
|
|
293
|
-
ok:
|
|
294
|
-
undeleted:
|
|
279
|
+
/** Output for `account_undelete`, a `@fuzdev/fuz_schema` schema. */
|
|
280
|
+
export const AccountUndeleteOutput = object({
|
|
281
|
+
ok: literal(true),
|
|
282
|
+
undeleted: boolean
|
|
295
283
|
});
|
|
296
284
|
// -- Action specs -----------------------------------------------------------
|
|
297
285
|
/**
|
|
@@ -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
|
});
|