@tai42/api-client 20.0.0 → 22.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/dist/agents.d.ts.map +1 -1
- package/dist/agents.js +6 -4
- package/dist/agents.js.map +1 -1
- package/dist/client/agents-client.d.ts.map +1 -1
- package/dist/client/agents-client.js +3 -2
- package/dist/client/agents-client.js.map +1 -1
- package/dist/client/auth-client.d.ts +129 -127
- package/dist/client/auth-client.d.ts.map +1 -1
- package/dist/client/auth-client.js +68 -28
- package/dist/client/auth-client.js.map +1 -1
- package/dist/client/backend-client.d.ts +14 -13
- package/dist/client/backend-client.d.ts.map +1 -1
- package/dist/client/backend-client.js +7 -3
- package/dist/client/backend-client.js.map +1 -1
- package/dist/client/backup-client.d.ts +45 -19
- package/dist/client/backup-client.d.ts.map +1 -1
- package/dist/client/backup-client.js +8 -3
- package/dist/client/backup-client.js.map +1 -1
- package/dist/client/capabilities-client.d.ts +20 -16
- package/dist/client/capabilities-client.d.ts.map +1 -1
- package/dist/client/capabilities-client.js +3 -2
- package/dist/client/capabilities-client.js.map +1 -1
- package/dist/client/channels-client.d.ts.map +1 -1
- package/dist/client/channels-client.js +2 -1
- package/dist/client/channels-client.js.map +1 -1
- package/dist/client/config-client.d.ts +44 -17
- package/dist/client/config-client.d.ts.map +1 -1
- package/dist/client/config-client.js +10 -4
- package/dist/client/config-client.js.map +1 -1
- package/dist/client/connectors-client.d.ts +270 -81
- package/dist/client/connectors-client.d.ts.map +1 -1
- package/dist/client/connectors-client.js +38 -10
- package/dist/client/connectors-client.js.map +1 -1
- package/dist/client/conversations-client.d.ts +440 -86
- package/dist/client/conversations-client.d.ts.map +1 -1
- package/dist/client/conversations-client.js +46 -17
- package/dist/client/conversations-client.js.map +1 -1
- package/dist/client/hooks-client.d.ts +3 -3
- package/dist/client/hooks-client.d.ts.map +1 -1
- package/dist/client/hooks-client.js +12 -7
- package/dist/client/hooks-client.js.map +1 -1
- package/dist/client/index.d.ts +2272 -914
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +10 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/interactions-client.d.ts +19 -14
- package/dist/client/interactions-client.d.ts.map +1 -1
- package/dist/client/interactions-client.js +21 -9
- package/dist/client/interactions-client.js.map +1 -1
- package/dist/client/login-client.d.ts +18 -17
- package/dist/client/login-client.d.ts.map +1 -1
- package/dist/client/login-client.js +8 -4
- package/dist/client/login-client.js.map +1 -1
- package/dist/client/manifest-client.d.ts +276 -105
- package/dist/client/manifest-client.d.ts.map +1 -1
- package/dist/client/manifest-client.js +22 -16
- package/dist/client/manifest-client.js.map +1 -1
- package/dist/client/marketplace-client.d.ts +181 -51
- package/dist/client/marketplace-client.d.ts.map +1 -1
- package/dist/client/marketplace-client.js +23 -12
- package/dist/client/marketplace-client.js.map +1 -1
- package/dist/client/mcp-config-schema-client.d.ts.map +1 -1
- package/dist/client/mcp-config-schema-client.js +2 -1
- package/dist/client/mcp-config-schema-client.js.map +1 -1
- package/dist/client/notifications-client.d.ts +43 -6
- package/dist/client/notifications-client.d.ts.map +1 -1
- package/dist/client/notifications-client.js +2 -1
- package/dist/client/notifications-client.js.map +1 -1
- package/dist/client/observability-client.d.ts +78 -38
- package/dist/client/observability-client.d.ts.map +1 -1
- package/dist/client/observability-client.js +29 -6
- package/dist/client/observability-client.js.map +1 -1
- package/dist/client/plugins-client.d.ts +8 -6
- package/dist/client/plugins-client.d.ts.map +1 -1
- package/dist/client/plugins-client.js +2 -1
- package/dist/client/plugins-client.js.map +1 -1
- package/dist/client/policy-client.d.ts +4 -4
- package/dist/client/policy-client.d.ts.map +1 -1
- package/dist/client/policy-client.js +11 -4
- package/dist/client/policy-client.js.map +1 -1
- package/dist/client/presets-client.d.ts +84 -39
- package/dist/client/presets-client.d.ts.map +1 -1
- package/dist/client/presets-client.js +25 -13
- package/dist/client/presets-client.js.map +1 -1
- package/dist/client/profiles-client.d.ts +40 -33
- package/dist/client/profiles-client.d.ts.map +1 -1
- package/dist/client/profiles-client.js +15 -10
- package/dist/client/profiles-client.js.map +1 -1
- package/dist/client/schedules-client.d.ts +21 -17
- package/dist/client/schedules-client.d.ts.map +1 -1
- package/dist/client/schedules-client.js +8 -5
- package/dist/client/schedules-client.js.map +1 -1
- package/dist/client/settings-schema-client.d.ts +1 -1
- package/dist/client/settings-schema-client.d.ts.map +1 -1
- package/dist/client/settings-schema-client.js +2 -1
- package/dist/client/settings-schema-client.js.map +1 -1
- package/dist/client/states-client.d.ts +215 -87
- package/dist/client/states-client.d.ts.map +1 -1
- package/dist/client/states-client.js +98 -37
- package/dist/client/states-client.js.map +1 -1
- package/dist/client/storage-client.d.ts +5 -5
- package/dist/client/storage-client.d.ts.map +1 -1
- package/dist/client/storage-client.js +24 -12
- package/dist/client/storage-client.js.map +1 -1
- package/dist/client/sub-mcp-client.d.ts +3 -1
- package/dist/client/sub-mcp-client.d.ts.map +1 -1
- package/dist/client/sub-mcp-client.js +9 -4
- package/dist/client/sub-mcp-client.js.map +1 -1
- package/dist/client/system-client.d.ts +2 -2
- package/dist/client/system-client.d.ts.map +1 -1
- package/dist/client/system-client.js +2 -1
- package/dist/client/system-client.js.map +1 -1
- package/dist/client/templates-client.d.ts +65 -6
- package/dist/client/templates-client.d.ts.map +1 -1
- package/dist/client/templates-client.js +25 -7
- package/dist/client/templates-client.js.map +1 -1
- package/dist/client/tool-extensions-client.d.ts +41 -16
- package/dist/client/tool-extensions-client.d.ts.map +1 -1
- package/dist/client/tool-extensions-client.js +6 -4
- package/dist/client/tool-extensions-client.js.map +1 -1
- package/dist/client/tool-meta-client.d.ts +8 -8
- package/dist/client/tool-meta-client.d.ts.map +1 -1
- package/dist/client/tool-meta-client.js +12 -8
- package/dist/client/tool-meta-client.js.map +1 -1
- package/dist/client/tools-client.d.ts +150 -23
- package/dist/client/tools-client.d.ts.map +1 -1
- package/dist/client/tools-client.js +8 -8
- package/dist/client/tools-client.js.map +1 -1
- package/dist/client/trigger-links-client.d.ts +11 -9
- package/dist/client/trigger-links-client.d.ts.map +1 -1
- package/dist/client/trigger-links-client.js +4 -4
- package/dist/client/trigger-links-client.js.map +1 -1
- package/dist/fleet-report.d.ts +21 -5
- package/dist/fleet-report.d.ts.map +1 -1
- package/dist/fleet-report.js +31 -6
- package/dist/fleet-report.js.map +1 -1
- package/dist/generated/api-routes.d.ts +1014 -0
- package/dist/generated/api-routes.d.ts.map +1 -0
- package/dist/generated/api-routes.js +322 -0
- package/dist/generated/api-routes.js.map +1 -0
- package/dist/generated/openapi-schemas.d.ts +12425 -0
- package/dist/generated/openapi-schemas.d.ts.map +1 -0
- package/dist/generated/openapi-schemas.js +671 -0
- package/dist/generated/openapi-schemas.js.map +1 -0
- package/dist/generated/served-schemas.d.ts +6698 -349
- package/dist/generated/served-schemas.d.ts.map +1 -1
- package/dist/generated/served-schemas.js +7062 -21
- package/dist/generated/served-schemas.js.map +1 -1
- package/dist/headers.d.ts +4 -0
- package/dist/headers.d.ts.map +1 -0
- package/dist/headers.js +4 -0
- package/dist/headers.js.map +1 -0
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +4 -3
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/schemas/api-keys.d.ts +14 -12
- package/dist/schemas/api-keys.d.ts.map +1 -1
- package/dist/schemas/api-keys.js +9 -23
- package/dist/schemas/api-keys.js.map +1 -1
- package/dist/schemas/auth-routes.d.ts +34 -29
- package/dist/schemas/auth-routes.d.ts.map +1 -1
- package/dist/schemas/auth-routes.js +22 -27
- package/dist/schemas/auth-routes.js.map +1 -1
- package/dist/schemas/backup.d.ts +157 -36
- package/dist/schemas/backup.d.ts.map +1 -1
- package/dist/schemas/backup.js +27 -26
- package/dist/schemas/backup.js.map +1 -1
- package/dist/schemas/capabilities.d.ts +32 -22
- package/dist/schemas/capabilities.d.ts.map +1 -1
- package/dist/schemas/capabilities.js +15 -40
- package/dist/schemas/capabilities.js.map +1 -1
- package/dist/schemas/channels.d.ts +1 -1
- package/dist/schemas/channels.d.ts.map +1 -1
- package/dist/schemas/channels.js +2 -5
- package/dist/schemas/channels.js.map +1 -1
- package/dist/schemas/config.d.ts.map +1 -1
- package/dist/schemas/config.js +4 -6
- package/dist/schemas/config.js.map +1 -1
- package/dist/schemas/connectors.d.ts +381 -185
- package/dist/schemas/connectors.d.ts.map +1 -1
- package/dist/schemas/connectors.js +54 -101
- package/dist/schemas/connectors.js.map +1 -1
- package/dist/schemas/conversations.d.ts +977 -248
- package/dist/schemas/conversations.d.ts.map +1 -1
- package/dist/schemas/conversations.js +40 -134
- package/dist/schemas/conversations.js.map +1 -1
- package/dist/schemas/extensions.d.ts +9 -6
- package/dist/schemas/extensions.d.ts.map +1 -1
- package/dist/schemas/extensions.js +6 -4
- package/dist/schemas/extensions.js.map +1 -1
- package/dist/schemas/fleet.d.ts +153 -99
- package/dist/schemas/fleet.d.ts.map +1 -1
- package/dist/schemas/fleet.js +41 -51
- package/dist/schemas/fleet.js.map +1 -1
- package/dist/schemas/hooks.d.ts +34 -34
- package/dist/schemas/hooks.d.ts.map +1 -1
- package/dist/schemas/hooks.js +15 -34
- package/dist/schemas/hooks.js.map +1 -1
- package/dist/schemas/index.d.ts +0 -1
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +0 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/interactions.d.ts +400 -128
- package/dist/schemas/interactions.d.ts.map +1 -1
- package/dist/schemas/interactions.js +202 -131
- package/dist/schemas/interactions.js.map +1 -1
- package/dist/schemas/login.d.ts +36 -37
- package/dist/schemas/login.d.ts.map +1 -1
- package/dist/schemas/login.js +8 -42
- package/dist/schemas/login.js.map +1 -1
- package/dist/schemas/manifest-mcp.d.ts +61 -35
- package/dist/schemas/manifest-mcp.d.ts.map +1 -1
- package/dist/schemas/manifest-mcp.js +13 -19
- package/dist/schemas/manifest-mcp.js.map +1 -1
- package/dist/schemas/marketplace.d.ts +219 -133
- package/dist/schemas/marketplace.d.ts.map +1 -1
- package/dist/schemas/marketplace.js +35 -120
- package/dist/schemas/marketplace.js.map +1 -1
- package/dist/schemas/members.d.ts +59 -52
- package/dist/schemas/members.d.ts.map +1 -1
- package/dist/schemas/members.js +20 -52
- package/dist/schemas/members.js.map +1 -1
- package/dist/schemas/notifications.d.ts +115 -17
- package/dist/schemas/notifications.d.ts.map +1 -1
- package/dist/schemas/notifications.js +9 -35
- package/dist/schemas/notifications.js.map +1 -1
- package/dist/schemas/observability.d.ts +174 -72
- package/dist/schemas/observability.d.ts.map +1 -1
- package/dist/schemas/observability.js +23 -76
- package/dist/schemas/observability.js.map +1 -1
- package/dist/schemas/policy.d.ts +11 -11
- package/dist/schemas/policy.d.ts.map +1 -1
- package/dist/schemas/policy.js +5 -12
- package/dist/schemas/policy.js.map +1 -1
- package/dist/schemas/presets.d.ts +109 -64
- package/dist/schemas/presets.d.ts.map +1 -1
- package/dist/schemas/presets.js +12 -48
- package/dist/schemas/presets.js.map +1 -1
- package/dist/schemas/principals.d.ts +28 -21
- package/dist/schemas/principals.d.ts.map +1 -1
- package/dist/schemas/principals.js +13 -25
- package/dist/schemas/principals.js.map +1 -1
- package/dist/schemas/profiles.d.ts +75 -63
- package/dist/schemas/profiles.d.ts.map +1 -1
- package/dist/schemas/profiles.js +24 -54
- package/dist/schemas/profiles.js.map +1 -1
- package/dist/schemas/roles.d.ts +22 -22
- package/dist/schemas/roles.d.ts.map +1 -1
- package/dist/schemas/roles.js +10 -17
- package/dist/schemas/roles.js.map +1 -1
- package/dist/schemas/schedules.d.ts +21 -15
- package/dist/schemas/schedules.d.ts.map +1 -1
- package/dist/schemas/schedules.js +4 -13
- package/dist/schemas/schedules.js.map +1 -1
- package/dist/schemas/served.d.ts +6373 -181
- package/dist/schemas/served.d.ts.map +1 -1
- package/dist/schemas/served.js +21 -0
- package/dist/schemas/served.js.map +1 -1
- package/dist/schemas/settings-schema.d.ts +1 -1
- package/dist/schemas/settings-schema.d.ts.map +1 -1
- package/dist/schemas/settings-schema.js +17 -19
- package/dist/schemas/settings-schema.js.map +1 -1
- package/dist/schemas/setup.d.ts +6 -6
- package/dist/schemas/setup.d.ts.map +1 -1
- package/dist/schemas/setup.js +2 -11
- package/dist/schemas/setup.js.map +1 -1
- package/dist/schemas/states.d.ts +450 -135
- package/dist/schemas/states.d.ts.map +1 -1
- package/dist/schemas/states.js +76 -140
- package/dist/schemas/states.js.map +1 -1
- package/dist/schemas/storage.d.ts +7 -8
- package/dist/schemas/storage.d.ts.map +1 -1
- package/dist/schemas/storage.js +8 -17
- package/dist/schemas/storage.js.map +1 -1
- package/dist/schemas/studio-plugins.d.ts +24 -18
- package/dist/schemas/studio-plugins.d.ts.map +1 -1
- package/dist/schemas/studio-plugins.js +5 -19
- package/dist/schemas/studio-plugins.js.map +1 -1
- package/dist/schemas/sub-mcp.d.ts +11 -8
- package/dist/schemas/sub-mcp.d.ts.map +1 -1
- package/dist/schemas/sub-mcp.js +10 -19
- package/dist/schemas/sub-mcp.js.map +1 -1
- package/dist/schemas/system-kinds.d.ts +76 -46
- package/dist/schemas/system-kinds.d.ts.map +1 -1
- package/dist/schemas/system-kinds.js +11 -28
- package/dist/schemas/system-kinds.js.map +1 -1
- package/dist/schemas/templates.d.ts +83 -25
- package/dist/schemas/templates.d.ts.map +1 -1
- package/dist/schemas/templates.js +8 -9
- package/dist/schemas/templates.js.map +1 -1
- package/dist/schemas/tool-meta.d.ts +15 -15
- package/dist/schemas/tool-meta.d.ts.map +1 -1
- package/dist/schemas/tool-meta.js +6 -21
- package/dist/schemas/tool-meta.js.map +1 -1
- package/dist/schemas/tools.d.ts +177 -56
- package/dist/schemas/tools.d.ts.map +1 -1
- package/dist/schemas/tools.js +20 -41
- package/dist/schemas/tools.js.map +1 -1
- package/dist/schemas/trigger-links.d.ts +22 -17
- package/dist/schemas/trigger-links.d.ts.map +1 -1
- package/dist/schemas/trigger-links.js +7 -27
- package/dist/schemas/trigger-links.js.map +1 -1
- package/dist/tool-runs.d.ts +175 -54
- package/dist/tool-runs.d.ts.map +1 -1
- package/dist/tool-runs.js +33 -34
- package/dist/tool-runs.js.map +1 -1
- package/package.json +4 -3
- package/src/agents.ts +16 -4
- package/src/client/agents-client.ts +3 -2
- package/src/client/auth-client.ts +102 -37
- package/src/client/backend-client.ts +8 -3
- package/src/client/backup-client.ts +8 -3
- package/src/client/capabilities-client.ts +4 -2
- package/src/client/channels-client.ts +3 -1
- package/src/client/config-client.ts +13 -5
- package/src/client/connectors-client.ts +91 -16
- package/src/client/conversations-client.ts +79 -30
- package/src/client/hooks-client.ts +25 -12
- package/src/client/index.ts +16 -4
- package/src/client/interactions-client.ts +40 -16
- package/src/client/login-client.ts +8 -4
- package/src/client/manifest-client.ts +48 -24
- package/src/client/marketplace-client.ts +23 -12
- package/src/client/mcp-config-schema-client.ts +2 -1
- package/src/client/notifications-client.ts +2 -1
- package/src/client/observability-client.ts +60 -8
- package/src/client/plugins-client.ts +2 -1
- package/src/client/policy-client.ts +24 -9
- package/src/client/presets-client.ts +26 -13
- package/src/client/profiles-client.ts +53 -24
- package/src/client/schedules-client.ts +14 -20
- package/src/client/settings-schema-client.ts +2 -1
- package/src/client/states-client.ts +151 -49
- package/src/client/storage-client.ts +43 -14
- package/src/client/sub-mcp-client.ts +10 -4
- package/src/client/system-client.ts +2 -1
- package/src/client/templates-client.ts +26 -7
- package/src/client/tool-extensions-client.ts +14 -7
- package/src/client/tool-meta-client.ts +46 -21
- package/src/client/tools-client.ts +13 -8
- package/src/client/trigger-links-client.ts +10 -6
- package/src/fleet-report.ts +48 -7
- package/src/generated/api-routes.ts +327 -0
- package/src/generated/openapi-schemas.ts +1508 -0
- package/src/generated/served-schemas.ts +7120 -40
- package/src/headers.ts +4 -0
- package/src/http.ts +4 -3
- package/src/index.ts +54 -10
- package/src/schemas/api-keys.ts +9 -25
- package/src/schemas/auth-routes.ts +27 -28
- package/src/schemas/backup.ts +33 -31
- package/src/schemas/capabilities.ts +16 -39
- package/src/schemas/channels.ts +4 -4
- package/src/schemas/config.ts +6 -6
- package/src/schemas/connectors.ts +61 -102
- package/src/schemas/conversations.ts +43 -133
- package/src/schemas/extensions.ts +7 -4
- package/src/schemas/fleet.ts +51 -51
- package/src/schemas/hooks.ts +18 -37
- package/src/schemas/index.ts +0 -1
- package/src/schemas/interactions.ts +227 -131
- package/src/schemas/login.ts +10 -41
- package/src/schemas/manifest-mcp.ts +13 -19
- package/src/schemas/marketplace.ts +37 -120
- package/src/schemas/members.ts +21 -51
- package/src/schemas/notifications.ts +10 -34
- package/src/schemas/observability.ts +34 -79
- package/src/schemas/policy.ts +5 -12
- package/src/schemas/presets.ts +13 -48
- package/src/schemas/principals.ts +17 -24
- package/src/schemas/profiles.ts +25 -55
- package/src/schemas/roles.ts +11 -17
- package/src/schemas/schedules.ts +4 -15
- package/src/schemas/served.ts +33 -0
- package/src/schemas/settings-schema.ts +18 -23
- package/src/schemas/setup.ts +4 -10
- package/src/schemas/states.ts +88 -139
- package/src/schemas/storage.ts +10 -16
- package/src/schemas/studio-plugins.ts +8 -19
- package/src/schemas/sub-mcp.ts +12 -18
- package/src/schemas/system-kinds.ts +12 -29
- package/src/schemas/templates.ts +8 -10
- package/src/schemas/tool-meta.ts +8 -20
- package/src/schemas/tools.ts +22 -45
- package/src/schemas/trigger-links.ts +8 -26
- package/src/tool-runs.ts +47 -38
- package/dist/client/web-entry-gate-client.d.ts +0 -34
- package/dist/client/web-entry-gate-client.d.ts.map +0 -1
- package/dist/client/web-entry-gate-client.js +0 -25
- package/dist/client/web-entry-gate-client.js.map +0 -1
- package/dist/schemas/web-entry.d.ts +0 -45
- package/dist/schemas/web-entry.d.ts.map +0 -1
- package/dist/schemas/web-entry.js +0 -36
- package/dist/schemas/web-entry.js.map +0 -1
- package/src/client/web-entry-gate-client.ts +0 -45
- package/src/schemas/web-entry.ts +0 -46
package/src/schemas/presets.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
/** Preset record, version and validation response schemas. */
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
4
5
|
import { presetExtensionElement } from './extensions';
|
|
5
6
|
import { presetBody } from './served';
|
|
6
7
|
|
|
8
|
+
// The extension combos and the version body are hand-typed: the spec publishes a
|
|
9
|
+
// config-bearing element and a version body as open objects.
|
|
10
|
+
|
|
7
11
|
/** A list of extension COMBOS — each combo an ordered list of elements. */
|
|
8
12
|
export const presetExtensions = z.array(z.array(presetExtensionElement));
|
|
9
13
|
|
|
@@ -17,32 +21,13 @@ export const presetExtensions = z.array(z.array(presetExtensionElement));
|
|
|
17
21
|
* (`GET /api/tool-meta`), never on the record. A drift throws `ApiSchemaError`;
|
|
18
22
|
* nothing is coerced.
|
|
19
23
|
*/
|
|
20
|
-
export const presetRecord =
|
|
21
|
-
name: z.string(),
|
|
22
|
-
base_tool: z.string(),
|
|
23
|
-
description: z.string(),
|
|
24
|
-
active_version: z.number(),
|
|
25
|
-
extensions: presetExtensions,
|
|
26
|
-
output_schema: z.record(z.string(), z.unknown()).nullable(),
|
|
27
|
-
input_schema: z.record(z.string(), z.unknown()).nullable(),
|
|
28
|
-
conflicted: z.boolean(),
|
|
29
|
-
// The human-readable cause a row is quarantined (its name collided with a
|
|
30
|
-
// foreign tool at boot), or `null` when the row is not conflicted. Rendered
|
|
31
|
-
// verbatim; nothing is coerced.
|
|
32
|
-
conflicted_reason: z.string().nullable(),
|
|
33
|
-
// Sorted preset-name cross-references: `uses` names the presets this one
|
|
34
|
-
// composes as tools; `used_by` names the presets that compose this one.
|
|
35
|
-
uses: z.array(z.string()),
|
|
36
|
-
used_by: z.array(z.string()),
|
|
37
|
-
});
|
|
24
|
+
export const presetRecord = openapi.presetRecordView.extend({ extensions: presetExtensions });
|
|
38
25
|
export type PresetRecord = z.infer<typeof presetRecord>;
|
|
39
26
|
|
|
40
27
|
export const presetList = z.array(presetRecord);
|
|
41
28
|
|
|
42
29
|
/** `GET /api/presets/{name}` — the record plus the active version's baked kwargs. */
|
|
43
|
-
export const presetDetail =
|
|
44
|
-
fixed_kwargs: z.record(z.string(), z.unknown()),
|
|
45
|
-
});
|
|
30
|
+
export const presetDetail = openapi.presetDetailView.extend({ extensions: presetExtensions });
|
|
46
31
|
export type PresetDetail = z.infer<typeof presetDetail>;
|
|
47
32
|
|
|
48
33
|
/**
|
|
@@ -51,29 +36,19 @@ export type PresetDetail = z.infer<typeof presetDetail>;
|
|
|
51
36
|
* label list (kind-agnostic) — the only preset tags that remain, distinct from the
|
|
52
37
|
* removed record-level categorization and from the tool_meta overlay.
|
|
53
38
|
*/
|
|
54
|
-
export const presetVersion =
|
|
55
|
-
version: z.number(),
|
|
56
|
-
body: presetBody,
|
|
57
|
-
tags: z.array(z.string()),
|
|
58
|
-
created_at: z.string(),
|
|
59
|
-
is_current: z.boolean(),
|
|
60
|
-
});
|
|
39
|
+
export const presetVersion = openapi.documentVersion.extend({ body: presetBody });
|
|
61
40
|
export type PresetVersion = z.infer<typeof presetVersion>;
|
|
62
41
|
|
|
63
42
|
export const presetVersionList = z.array(presetVersion);
|
|
64
43
|
|
|
65
44
|
/** `POST /api/presets/{name}/rollback` — the re-pointed active version. */
|
|
66
|
-
export const presetRollback =
|
|
45
|
+
export const presetRollback = openapi.presetRollbackResult;
|
|
67
46
|
|
|
68
47
|
/** `DELETE /api/presets/{name}` — the removed preset. */
|
|
69
|
-
export const presetDeleted =
|
|
48
|
+
export const presetDeleted = openapi.presetDeleteResult;
|
|
70
49
|
|
|
71
50
|
/** `POST /api/presets/{name}/rename` — the re-keyed record identity. */
|
|
72
|
-
export const presetRenamed =
|
|
73
|
-
name: z.string(),
|
|
74
|
-
renamed_from: z.string(),
|
|
75
|
-
active_version: z.number(),
|
|
76
|
-
});
|
|
51
|
+
export const presetRenamed = openapi.presetRenameResult;
|
|
77
52
|
export type PresetRenamed = z.infer<typeof presetRenamed>;
|
|
78
53
|
|
|
79
54
|
/**
|
|
@@ -82,10 +57,7 @@ export type PresetRenamed = z.infer<typeof presetRenamed>;
|
|
|
82
57
|
* empty list is the clean case; a non-empty list means a rename is blocked until
|
|
83
58
|
* those presets are updated. A drift throws `ApiSchemaError`.
|
|
84
59
|
*/
|
|
85
|
-
export const presetReferees =
|
|
86
|
-
name: z.string(),
|
|
87
|
-
referees: z.array(z.string()),
|
|
88
|
-
});
|
|
60
|
+
export const presetReferees = openapi.presetRefereesResult;
|
|
89
61
|
export type PresetReferees = z.infer<typeof presetReferees>;
|
|
90
62
|
|
|
91
63
|
/**
|
|
@@ -94,10 +66,7 @@ export type PresetReferees = z.infer<typeof presetReferees>;
|
|
|
94
66
|
* 200), so `error` carries the server's verbatim message. A drift throws
|
|
95
67
|
* `ApiSchemaError`.
|
|
96
68
|
*/
|
|
97
|
-
export const presetValidation =
|
|
98
|
-
valid: z.boolean(),
|
|
99
|
-
error: z.string().nullable(),
|
|
100
|
-
});
|
|
69
|
+
export const presetValidation = openapi.presetValidateVerdict;
|
|
101
70
|
export type PresetValidation = z.infer<typeof presetValidation>;
|
|
102
71
|
|
|
103
72
|
/**
|
|
@@ -106,9 +75,5 @@ export type PresetValidation = z.infer<typeof presetValidation>;
|
|
|
106
75
|
* response echoes the identity plus the new tag list. A drift throws
|
|
107
76
|
* `ApiSchemaError`.
|
|
108
77
|
*/
|
|
109
|
-
export const presetVersionTags =
|
|
110
|
-
name: z.string(),
|
|
111
|
-
version: z.number(),
|
|
112
|
-
tags: z.array(z.string()),
|
|
113
|
-
});
|
|
78
|
+
export const presetVersionTags = openapi.presetVersionTagsResult;
|
|
114
79
|
export type PresetVersionTags = z.infer<typeof presetVersionTags>;
|
|
@@ -1,41 +1,34 @@
|
|
|
1
1
|
/** Principal (identity) reference, row, listing and delete-result schemas. */
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* A compact reference to a principal — the owner of a key, or the human behind a
|
|
6
8
|
* session — carried inline on payloads that name one.
|
|
7
9
|
*/
|
|
8
|
-
export const principalRef =
|
|
9
|
-
user_id: z.string(),
|
|
10
|
-
kind: z.enum(['human', 'service']),
|
|
11
|
-
display_name: z.string(),
|
|
12
|
-
});
|
|
10
|
+
export const principalRef = openapi.principalRef;
|
|
13
11
|
export type PrincipalRef = z.infer<typeof principalRef>;
|
|
14
12
|
|
|
15
13
|
/**
|
|
16
|
-
* A principal
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
* A principal's kind: `human` (logs in interactively) or `service` (holds keys only,
|
|
15
|
+
* never logs in).
|
|
16
|
+
*/
|
|
17
|
+
export const principalKind = openapi.principal.shape.kind;
|
|
18
|
+
export type PrincipalKind = z.infer<typeof principalKind>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A principal row (`/api/auth/principals`). `created_by` is the principal that created
|
|
22
|
+
* this one, or `null` for the owner the setup door mints. `disabled` turns off every
|
|
23
|
+
* credential the principal owns. `created_at` is an ISO-8601 instant.
|
|
21
24
|
*/
|
|
22
|
-
export const principal =
|
|
23
|
-
user_id: z.string(),
|
|
24
|
-
kind: z.enum(['human', 'service']),
|
|
25
|
-
display_name: z.string(),
|
|
26
|
-
created_by: z.string().nullable(),
|
|
27
|
-
disabled: z.boolean(),
|
|
28
|
-
created_at: z.string(),
|
|
29
|
-
});
|
|
25
|
+
export const principal = openapi.principal;
|
|
30
26
|
export type Principal = z.infer<typeof principal>;
|
|
31
27
|
|
|
32
28
|
/** The principals listing (`GET /api/auth/principals`). */
|
|
33
|
-
export const principalList =
|
|
29
|
+
export const principalList = openapi.principalListing;
|
|
34
30
|
export type PrincipalList = z.infer<typeof principalList>;
|
|
35
31
|
|
|
36
32
|
/** The delete result (`DELETE /api/auth/principals/{user_id}`). */
|
|
37
|
-
export const principalDeleted =
|
|
38
|
-
user_id: z.string(),
|
|
39
|
-
deleted: z.boolean(),
|
|
40
|
-
});
|
|
33
|
+
export const principalDeleted = openapi.principalDeleted;
|
|
41
34
|
export type PrincipalDeleted = z.infer<typeof principalDeleted>;
|
package/src/schemas/profiles.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** Settings-profile record, version, diff and apply response schemas. */
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
3
|
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
4
5
|
import { fleetReportFanout } from './fleet';
|
|
5
6
|
|
|
6
7
|
// The admin-only `/api/config/profiles/*` surface. Secrets ride the wire in the
|
|
@@ -13,40 +14,30 @@ import { fleetReportFanout } from './fleet';
|
|
|
13
14
|
* (No `last_modified`: the list carries identity, not history — version metadata
|
|
14
15
|
* is the `/versions` surface — so the list renders no last-modified column.)
|
|
15
16
|
*/
|
|
16
|
-
export const settingsProfileSummary =
|
|
17
|
-
name: z.string(),
|
|
18
|
-
description: z.string(),
|
|
19
|
-
});
|
|
17
|
+
export const settingsProfileSummary = openapi.profileSummary;
|
|
20
18
|
export type SettingsProfileSummary = z.infer<typeof settingsProfileSummary>;
|
|
21
|
-
export const settingsProfileList =
|
|
19
|
+
export const settingsProfileList = openapi.profileListResponse;
|
|
22
20
|
|
|
23
21
|
/**
|
|
24
22
|
* `GET /api/config/profiles/{name}` and each version body — the stored profile
|
|
25
23
|
* document (action=secret). `env` carries REAL values; `secret_keys` is the
|
|
26
24
|
* per-profile secret-marks band folded into the secret-mask union for masking.
|
|
27
25
|
*/
|
|
28
|
-
export const settingsProfileBody =
|
|
29
|
-
description: z.string(),
|
|
30
|
-
env: z.record(z.string(), z.string()),
|
|
31
|
-
secret_keys: z.array(z.string()),
|
|
32
|
-
});
|
|
26
|
+
export const settingsProfileBody = openapi.settingsProfileBody;
|
|
33
27
|
export type SettingsProfileBody = z.infer<typeof settingsProfileBody>;
|
|
34
28
|
|
|
35
29
|
/** `PUT /api/config/profiles/{name}` — a minimal save ack; `version` is the new store version. */
|
|
36
|
-
export const settingsProfileSaved =
|
|
37
|
-
ok: z.literal(true),
|
|
38
|
-
version: z.number().optional(),
|
|
39
|
-
});
|
|
30
|
+
export const settingsProfileSaved = openapi.profileWriteResult;
|
|
40
31
|
export type SettingsProfileSaved = z.infer<typeof settingsProfileSaved>;
|
|
41
32
|
|
|
42
33
|
/** `DELETE /api/config/profiles/{name}` — a minimal removal ack. */
|
|
43
|
-
export const settingsProfileDeleted =
|
|
34
|
+
export const settingsProfileDeleted = openapi.okResult;
|
|
44
35
|
|
|
45
|
-
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
36
|
+
/**
|
|
37
|
+
* `POST /api/config/profiles/{name}/rollback` — the restore ack; `version` is the resulting
|
|
38
|
+
* active version.
|
|
39
|
+
*/
|
|
40
|
+
export const settingsProfileRollback = openapi.profileWriteResult;
|
|
50
41
|
export type SettingsProfileRollback = z.infer<typeof settingsProfileRollback>;
|
|
51
42
|
|
|
52
43
|
/**
|
|
@@ -55,13 +46,7 @@ export type SettingsProfileRollback = z.infer<typeof settingsProfileRollback>;
|
|
|
55
46
|
* JsonDiff); `recycle_keys`/`refused_keys` are the diff's recycle-class and
|
|
56
47
|
* boundary-refused key names, called out in the UI before apply.
|
|
57
48
|
*/
|
|
58
|
-
export const settingsProfileDiff =
|
|
59
|
-
added: z.array(z.string()),
|
|
60
|
-
removed: z.array(z.string()),
|
|
61
|
-
changed: z.array(z.object({ key: z.string(), old: z.string(), new: z.string() })),
|
|
62
|
-
recycle_keys: z.array(z.string()),
|
|
63
|
-
refused_keys: z.array(z.string()),
|
|
64
|
-
});
|
|
49
|
+
export const settingsProfileDiff = openapi.profileDiff;
|
|
65
50
|
export type SettingsProfileDiff = z.infer<typeof settingsProfileDiff>;
|
|
66
51
|
|
|
67
52
|
/**
|
|
@@ -73,24 +58,16 @@ export type SettingsProfileDiff = z.infer<typeof settingsProfileDiff>;
|
|
|
73
58
|
* the `self-deferred` status literal when the diff has serve-affecting recycle keys;
|
|
74
59
|
* `fresh` is the per-kind list of NEW ready lives observed since the pre-apply snapshot
|
|
75
60
|
* (each `{name, kind, generation}`), evidence of fresh capacity and never claimed as any
|
|
76
|
-
* target's successor; `refused` is `[]` on success by construction (
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
61
|
+
* target's successor; `refused` is `[]` on success by construction (the refused key
|
|
62
|
+
* names only on a refusal), the populated refusal surfaces being the diff preview and
|
|
63
|
+
* the refusal error report; `recycle_stopped` names the target a stopped recycle roll
|
|
64
|
+
* halted at, or is `null` when the roll ran to its end; `awaiting_respawn` names the
|
|
65
|
+
* workers (name + keys) still awaiting a respawn after the apply (empty when the roll
|
|
66
|
+
* converged). `fanout` is the mode-wrapped fleet broadcast, parsed EXPLICITLY so a failed
|
|
67
|
+
* propagation reaches the shared fleet-report handler. A drift throws `ApiSchemaError`.
|
|
81
68
|
*/
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
recycle: z.array(
|
|
85
|
-
z.object({
|
|
86
|
-
name: z.string(),
|
|
87
|
-
kind: z.string(),
|
|
88
|
-
status: z.string(),
|
|
89
|
-
generation_before: z.number(),
|
|
90
|
-
}),
|
|
91
|
-
),
|
|
92
|
-
fresh: z.array(z.object({ name: z.string(), kind: z.string(), generation: z.number() })),
|
|
93
|
-
refused: z.array(z.object({ key: z.string(), reason: z.string() })),
|
|
69
|
+
// The fan-out is hand-typed: the spec publishes it as one object with optional fields.
|
|
70
|
+
export const profileApplyResponse = openapi.profileApplyResponse.extend({
|
|
94
71
|
fanout: fleetReportFanout,
|
|
95
72
|
});
|
|
96
73
|
export type ProfileApplyResponse = z.infer<typeof profileApplyResponse>;
|
|
@@ -100,21 +77,14 @@ export type ProfileApplyResponse = z.infer<typeof profileApplyResponse>;
|
|
|
100
77
|
* no bodies), the generic versioned-store row minus `body`. `is_current` flags the
|
|
101
78
|
* active pointer.
|
|
102
79
|
*/
|
|
103
|
-
export const settingsProfileVersionMeta =
|
|
104
|
-
version: z.number(),
|
|
105
|
-
tags: z.array(z.string()),
|
|
106
|
-
created_at: z.string(),
|
|
107
|
-
is_current: z.boolean(),
|
|
108
|
-
});
|
|
80
|
+
export const settingsProfileVersionMeta = openapi.profileVersionSummary;
|
|
109
81
|
export type SettingsProfileVersionMeta = z.infer<typeof settingsProfileVersionMeta>;
|
|
110
|
-
export const settingsProfileVersionList =
|
|
82
|
+
export const settingsProfileVersionList = openapi.profileVersionListResponse;
|
|
111
83
|
|
|
112
84
|
/**
|
|
113
85
|
* `GET /api/config/profiles/{name}/versions/{version}` — one immutable version WITH
|
|
114
86
|
* its `body` (action=secret; body rendered masked per the secret-mask union). The generic
|
|
115
87
|
* versioned-store row shape.
|
|
116
88
|
*/
|
|
117
|
-
export const settingsProfileVersion =
|
|
118
|
-
body: settingsProfileBody,
|
|
119
|
-
});
|
|
89
|
+
export const settingsProfileVersion = openapi.profileVersionView;
|
|
120
90
|
export type SettingsProfileVersion = z.infer<typeof settingsProfileVersion>;
|
package/src/schemas/roles.ts
CHANGED
|
@@ -1,34 +1,32 @@
|
|
|
1
1
|
/** Role grant, version and audit response schemas. */
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
4
5
|
import { roleBody } from './served';
|
|
5
6
|
import { jsonValue } from './shared';
|
|
6
7
|
|
|
7
8
|
/** A role's per-tag ACCESS LEVEL: `none` (no access), `read`, or `write`. */
|
|
8
|
-
export const grantLevel =
|
|
9
|
+
export const grantLevel = roleBody.shape.grants.valueType;
|
|
9
10
|
export type GrantLevel = z.infer<typeof grantLevel>;
|
|
10
11
|
|
|
11
12
|
/** A role's editable grant map: feature-group TAG name → the role's access level. */
|
|
12
|
-
export const roleGrants =
|
|
13
|
+
export const roleGrants = roleBody.shape.grants;
|
|
13
14
|
export type RoleGrants = z.infer<typeof roleGrants>;
|
|
14
15
|
|
|
15
|
-
export const roleList =
|
|
16
|
+
export const roleList = openapi.roleDefinitionList;
|
|
16
17
|
|
|
17
18
|
/** `DELETE /api/auth/roles/{name}` — the deleted role's name. */
|
|
18
|
-
export const roleDeleted =
|
|
19
|
+
export const roleDeleted = openapi.roleDeleted;
|
|
20
|
+
|
|
21
|
+
// The version and audit bodies are hand-typed: the spec publishes a version body as an open
|
|
22
|
+
// object.
|
|
19
23
|
|
|
20
24
|
/**
|
|
21
25
|
* One immutable role-version row (`GET /api/auth/roles/{name}/versions` →
|
|
22
26
|
* `versions`). `body` is the role body at that version; `is_current` flags the
|
|
23
27
|
* active pointer. Mirrors the generic versioned-store row shape.
|
|
24
28
|
*/
|
|
25
|
-
export const roleVersion =
|
|
26
|
-
version: z.number(),
|
|
27
|
-
body: roleBody,
|
|
28
|
-
tags: z.array(z.string()),
|
|
29
|
-
created_at: z.string(),
|
|
30
|
-
is_current: z.boolean(),
|
|
31
|
-
});
|
|
29
|
+
export const roleVersion = openapi.documentVersion.extend({ body: roleBody });
|
|
32
30
|
export type RoleVersion = z.infer<typeof roleVersion>;
|
|
33
31
|
|
|
34
32
|
/**
|
|
@@ -36,22 +34,18 @@ export type RoleVersion = z.infer<typeof roleVersion>;
|
|
|
36
34
|
* `audit`). Its `body` carries the mutation kind, the actor, and the before/after
|
|
37
35
|
* role bodies (both `null` for a create's `before` / a delete's `after`).
|
|
38
36
|
*/
|
|
39
|
-
export const roleAuditEvent =
|
|
40
|
-
version: z.number(),
|
|
37
|
+
export const roleAuditEvent = openapi.documentVersion.extend({
|
|
41
38
|
body: z.object({
|
|
42
39
|
action: z.string(),
|
|
43
40
|
actor: z.string().nullable(),
|
|
44
41
|
before: jsonValue.nullable(),
|
|
45
42
|
after: jsonValue.nullable(),
|
|
46
43
|
}),
|
|
47
|
-
tags: z.array(z.string()),
|
|
48
|
-
created_at: z.string(),
|
|
49
|
-
is_current: z.boolean(),
|
|
50
44
|
});
|
|
51
45
|
export type RoleAuditEvent = z.infer<typeof roleAuditEvent>;
|
|
52
46
|
|
|
53
47
|
/** `GET /api/auth/roles/{name}/versions` — the append-only history + audit trail. */
|
|
54
|
-
export const roleVersions =
|
|
48
|
+
export const roleVersions = openapi.roleVersionsView.extend({
|
|
55
49
|
versions: z.array(roleVersion),
|
|
56
50
|
audit: z.array(roleAuditEvent),
|
|
57
51
|
});
|
package/src/schemas/schedules.ts
CHANGED
|
@@ -1,23 +1,12 @@
|
|
|
1
1
|
/** Schedule listing and server-clock response schemas. */
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
4
5
|
import { jsonValue } from './shared';
|
|
5
6
|
|
|
6
|
-
// The
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
export const scheduleItem = z
|
|
10
|
-
.object({
|
|
11
|
-
name: z.string(),
|
|
12
|
-
enabled: z.boolean().optional(),
|
|
13
|
-
schedule: jsonValue.optional(),
|
|
14
|
-
target: jsonValue.optional(),
|
|
15
|
-
args: z.array(jsonValue).optional(),
|
|
16
|
-
kwargs: z.record(z.string(), jsonValue).optional(),
|
|
17
|
-
})
|
|
18
|
-
.loose();
|
|
19
|
-
export const scheduleList = z.array(scheduleItem);
|
|
20
|
-
export type ScheduleItem = z.infer<typeof scheduleItem>;
|
|
7
|
+
// The listing is the generated `ScheduleListRow` array the server publishes (name, tool,
|
|
8
|
+
// typed cadence, enabled, next run, an optional backend error — never tool arguments).
|
|
9
|
+
export const scheduleList = openapi.scheduleListResponse;
|
|
21
10
|
|
|
22
11
|
export const serverDateTime = z
|
|
23
12
|
.object({
|
package/src/schemas/served.ts
CHANGED
|
@@ -22,6 +22,10 @@ export const presetBody = generated.presetBody;
|
|
|
22
22
|
export type PresetBody = z.input<typeof presetBody>;
|
|
23
23
|
export const conversationRoute = generated.conversationRoute;
|
|
24
24
|
export type ConversationRoute = z.infer<typeof conversationRoute>;
|
|
25
|
+
export const apiConversationRouteCreate = generated.apiConversationRouteCreate;
|
|
26
|
+
export type ApiConversationRouteCreate = z.input<typeof apiConversationRouteCreate>;
|
|
27
|
+
export const channelConversationRouteCreate = generated.channelConversationRouteCreate;
|
|
28
|
+
export type ChannelConversationRouteCreate = z.input<typeof channelConversationRouteCreate>;
|
|
25
29
|
export const conversationRouteCreate = generated.conversationRouteCreate;
|
|
26
30
|
export type ConversationRouteCreate = z.input<typeof conversationRouteCreate>;
|
|
27
31
|
export const targetConversationConfig = generated.targetConversationConfig;
|
|
@@ -44,7 +48,36 @@ export const templateReconcile = generated.stateTemplateReconcile;
|
|
|
44
48
|
export type TemplateReconcile = z.infer<typeof templateReconcile>;
|
|
45
49
|
export const templateDeclarations = generated.stateTemplateDeclarations;
|
|
46
50
|
export type TemplateDeclarations = z.infer<typeof templateDeclarations>;
|
|
51
|
+
export const stateTemplateParameter = generated.stateTemplateParameter;
|
|
52
|
+
export type StateTemplateParameter = z.infer<typeof stateTemplateParameter>;
|
|
53
|
+
export const stateRegimeRule = generated.stateRegimeRule;
|
|
54
|
+
export type StateRegimeRule = z.infer<typeof stateRegimeRule>;
|
|
55
|
+
export const stateTemplateTrace = generated.stateTemplateTrace;
|
|
56
|
+
export type StateTemplateTrace = z.infer<typeof stateTemplateTrace>;
|
|
47
57
|
export const policyBody = generated.accessPolicy;
|
|
48
58
|
export type PolicyBody = z.infer<typeof policyBody>;
|
|
49
59
|
export const roleBody = generated.roleDefinition;
|
|
50
60
|
export type RoleBody = z.infer<typeof roleBody>;
|
|
61
|
+
export const settingsProfileName = generated.settingsProfileName;
|
|
62
|
+
export type SettingsProfileName = z.infer<typeof settingsProfileName>;
|
|
63
|
+
export const previousProfileName = generated.previousProfileName;
|
|
64
|
+
export type PreviousProfileName = z.infer<typeof previousProfileName>;
|
|
65
|
+
export const scheduleCreate = generated.scheduleCreate;
|
|
66
|
+
export type ScheduleCreate = z.input<typeof scheduleCreate>;
|
|
67
|
+
export const scheduleListRow = generated.scheduleListRow;
|
|
68
|
+
export type ScheduleListRow = z.infer<typeof scheduleListRow>;
|
|
69
|
+
export const scheduleRecord = generated.scheduleRecord;
|
|
70
|
+
export type ScheduleRecord = z.infer<typeof scheduleRecord>;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The platform constants the contract serves, read instead of re-spelled: the reserved
|
|
74
|
+
* person subject kind (`PERSON_KIND`), the same-origin served-media route prefix
|
|
75
|
+
* (`MEDIA_ROUTE_PREFIX`) and the stored-media id grammar (`MEDIA_ID_PATTERN`, a regular
|
|
76
|
+
* expression matched against a whole id).
|
|
77
|
+
*/
|
|
78
|
+
export const servedConstants = generated.servedConstants;
|
|
79
|
+
export type ServedConstants = typeof servedConstants;
|
|
80
|
+
/** The conformance vectors of the platform rules a browser mirrors. */
|
|
81
|
+
export const servedVectors = generated.servedVectors;
|
|
82
|
+
/** Each served document as JSON Schema, with the `$defs` it references. */
|
|
83
|
+
export const servedDocumentsJson = generated.servedDocumentsJson;
|
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
/** Declarative settings-form schema response. */
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
4
5
|
import { jsonValue } from './shared';
|
|
5
6
|
|
|
6
7
|
// The settings form is auto-rendered from a declarative group/field description
|
|
7
|
-
// the skeleton emits from its typed settings models.
|
|
8
|
+
// the skeleton emits from its typed settings models. Each field is hand-typed: the spec
|
|
9
|
+
// publishes a field as an open object.
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
nested_group: z.string().nullable(),
|
|
25
|
-
default_namespace_var: z.string().nullable(),
|
|
26
|
-
value: jsonValue.nullable(),
|
|
27
|
-
}),
|
|
28
|
-
),
|
|
29
|
-
}),
|
|
30
|
-
),
|
|
11
|
+
const settingsField = z.object({
|
|
12
|
+
name: z.string(),
|
|
13
|
+
env_var: z.string(),
|
|
14
|
+
type: z.string(),
|
|
15
|
+
default: jsonValue.nullable(),
|
|
16
|
+
required: z.boolean(),
|
|
17
|
+
secret: z.boolean(),
|
|
18
|
+
description: z.string().nullable(),
|
|
19
|
+
nested_group: z.string().nullable(),
|
|
20
|
+
default_namespace_var: z.string().nullable(),
|
|
21
|
+
value: jsonValue.nullable(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const settingsSchema = openapi.settingsSchemaView.extend({
|
|
25
|
+
groups: z.array(openapi.settingsGroupView.extend({ fields: z.array(settingsField) })),
|
|
31
26
|
});
|
|
32
27
|
export type SettingsSchema = z.infer<typeof settingsSchema>;
|
package/src/schemas/setup.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** Setup-door (`POST /api/setup`) request-body and result schemas. */
|
|
2
|
-
import { z } from 'zod';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
import * as openapi from '../generated/openapi-schemas';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* The result of a successful `POST /api/setup`, returned exactly ONCE. `api_key`
|
|
@@ -8,15 +10,7 @@ import { z } from 'zod';
|
|
|
8
10
|
* `invite_token` and `login_path` are set only when the attachment was an invite
|
|
9
11
|
* the operator completes later.
|
|
10
12
|
*/
|
|
11
|
-
export const setupResult =
|
|
12
|
-
owner_user_id: z.string(),
|
|
13
|
-
key_user_id: z.string(),
|
|
14
|
-
api_key: z.string().min(1),
|
|
15
|
-
key_fingerprint: z.string(),
|
|
16
|
-
login_attached: z.boolean(),
|
|
17
|
-
invite_token: z.string().nullable().optional(),
|
|
18
|
-
login_path: z.string().nullable().optional(),
|
|
19
|
-
});
|
|
13
|
+
export const setupResult = openapi.setupResult;
|
|
20
14
|
export type SetupResult = z.infer<typeof setupResult>;
|
|
21
15
|
|
|
22
16
|
/**
|