@tai42/api-client 16.0.0 → 17.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/dist/agents.d.ts.map +1 -1
- package/dist/agents.js +1 -1
- package/dist/agents.js.map +1 -1
- package/dist/client/agents-client.d.ts +26 -0
- package/dist/client/agents-client.d.ts.map +1 -0
- package/dist/client/agents-client.js +19 -0
- package/dist/client/agents-client.js.map +1 -0
- package/dist/client/auth-client.d.ts +247 -0
- package/dist/client/auth-client.d.ts.map +1 -0
- package/dist/client/auth-client.js +73 -0
- package/dist/client/auth-client.js.map +1 -0
- package/dist/client/backend-client.d.ts +39 -0
- package/dist/client/backend-client.d.ts.map +1 -0
- package/dist/client/backend-client.js +22 -0
- package/dist/client/backend-client.js.map +1 -0
- package/dist/client/backup-client.d.ts +56 -0
- package/dist/client/backup-client.d.ts.map +1 -0
- package/dist/client/backup-client.js +12 -0
- package/dist/client/backup-client.js.map +1 -0
- package/dist/client/capabilities-client.d.ts +40 -0
- package/dist/client/capabilities-client.d.ts.map +1 -0
- package/dist/client/capabilities-client.js +19 -0
- package/dist/client/capabilities-client.js.map +1 -0
- package/dist/client/channels-client.d.ts +7 -0
- package/dist/client/channels-client.d.ts.map +1 -0
- package/dist/client/channels-client.js +10 -0
- package/dist/client/channels-client.js.map +1 -0
- package/dist/client/config-client.d.ts +59 -0
- package/dist/client/config-client.d.ts.map +1 -0
- package/dist/client/config-client.js +18 -0
- package/dist/client/config-client.js.map +1 -0
- package/dist/client/connectors-client.d.ts +225 -0
- package/dist/client/connectors-client.d.ts.map +1 -0
- package/dist/client/connectors-client.js +31 -0
- package/dist/client/connectors-client.js.map +1 -0
- package/dist/client/conversations-client.d.ts +398 -0
- package/dist/client/conversations-client.d.ts.map +1 -0
- package/dist/client/conversations-client.js +120 -0
- package/dist/client/conversations-client.js.map +1 -0
- package/dist/client/hooks-client.d.ts +112 -0
- package/dist/client/hooks-client.d.ts.map +1 -0
- package/dist/client/hooks-client.js +25 -0
- package/dist/client/hooks-client.js.map +1 -0
- package/dist/{client.d.ts → client/index.d.ts} +2336 -2708
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +79 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/interactions-client.d.ts +52 -0
- package/dist/client/interactions-client.d.ts.map +1 -0
- package/dist/client/interactions-client.js +84 -0
- package/dist/client/interactions-client.js.map +1 -0
- package/dist/client/login-client.d.ts +69 -0
- package/dist/client/login-client.d.ts.map +1 -0
- package/dist/client/login-client.js +137 -0
- package/dist/client/login-client.js.map +1 -0
- package/dist/client/manifest-client.d.ts +354 -0
- package/dist/client/manifest-client.d.ts.map +1 -0
- package/dist/client/manifest-client.js +76 -0
- package/dist/client/manifest-client.js.map +1 -0
- package/dist/client/marketplace-client.d.ts +274 -0
- package/dist/client/marketplace-client.d.ts.map +1 -0
- package/dist/client/marketplace-client.js +46 -0
- package/dist/client/marketplace-client.js.map +1 -0
- package/dist/client/mcp-config-schema-client.d.ts +5 -0
- package/dist/client/mcp-config-schema-client.d.ts.map +1 -0
- package/dist/client/mcp-config-schema-client.js +9 -0
- package/dist/client/mcp-config-schema-client.js.map +1 -0
- package/dist/client/notifications-client.d.ts +27 -0
- package/dist/client/notifications-client.d.ts.map +1 -0
- package/dist/client/notifications-client.js +11 -0
- package/dist/client/notifications-client.js.map +1 -0
- package/dist/client/observability-client.d.ts +103 -0
- package/dist/client/observability-client.d.ts.map +1 -0
- package/dist/client/observability-client.js +43 -0
- package/dist/client/observability-client.js.map +1 -0
- package/dist/client/plugins-client.d.ts +17 -0
- package/dist/client/plugins-client.d.ts.map +1 -0
- package/dist/client/plugins-client.js +9 -0
- package/dist/client/plugins-client.js.map +1 -0
- package/dist/client/policy-client.d.ts +37 -0
- package/dist/client/policy-client.d.ts.map +1 -0
- package/dist/client/policy-client.js +26 -0
- package/dist/client/policy-client.js.map +1 -0
- package/dist/client/presets-client.d.ts +334 -0
- package/dist/client/presets-client.d.ts.map +1 -0
- package/dist/client/presets-client.js +38 -0
- package/dist/client/presets-client.js.map +1 -0
- package/dist/client/profiles-client.d.ts +101 -0
- package/dist/client/profiles-client.d.ts.map +1 -0
- package/dist/client/profiles-client.js +37 -0
- package/dist/client/profiles-client.js.map +1 -0
- package/dist/client/schedules-client.d.ts +27 -0
- package/dist/client/schedules-client.d.ts.map +1 -0
- package/dist/client/schedules-client.js +13 -0
- package/dist/client/schedules-client.js.map +1 -0
- package/dist/client/settings-schema-client.d.ts +23 -0
- package/dist/client/settings-schema-client.d.ts.map +1 -0
- package/dist/client/settings-schema-client.js +9 -0
- package/dist/client/settings-schema-client.js.map +1 -0
- package/dist/client/states-client.d.ts +470 -0
- package/dist/client/states-client.d.ts.map +1 -0
- package/dist/client/states-client.js +144 -0
- package/dist/client/states-client.js.map +1 -0
- package/dist/client/storage-client.d.ts +40 -0
- package/dist/client/storage-client.d.ts.map +1 -0
- package/dist/client/storage-client.js +43 -0
- package/dist/client/storage-client.js.map +1 -0
- package/dist/client/sub-mcp-client.d.ts +17 -0
- package/dist/client/sub-mcp-client.d.ts.map +1 -0
- package/dist/client/sub-mcp-client.js +14 -0
- package/dist/client/sub-mcp-client.js.map +1 -0
- package/dist/client/system-client.d.ts +11 -0
- package/dist/client/system-client.d.ts.map +1 -0
- package/dist/client/system-client.js +13 -0
- package/dist/client/system-client.js.map +1 -0
- package/dist/client/templates-client.d.ts +29 -0
- package/dist/client/templates-client.d.ts.map +1 -0
- package/dist/client/templates-client.js +21 -0
- package/dist/client/templates-client.js.map +1 -0
- package/dist/client/tool-extensions-client.d.ts +53 -0
- package/dist/client/tool-extensions-client.d.ts.map +1 -0
- package/dist/client/tool-extensions-client.js +21 -0
- package/dist/client/tool-extensions-client.js.map +1 -0
- package/dist/client/tool-meta-client.d.ts +69 -0
- package/dist/client/tool-meta-client.d.ts.map +1 -0
- package/dist/client/tool-meta-client.js +38 -0
- package/dist/client/tool-meta-client.js.map +1 -0
- package/dist/client/tools-client.d.ts +83 -0
- package/dist/client/tools-client.d.ts.map +1 -0
- package/dist/client/tools-client.js +38 -0
- package/dist/client/tools-client.js.map +1 -0
- package/dist/client/transport.d.ts +13 -0
- package/dist/client/transport.d.ts.map +1 -0
- package/dist/client/transport.js +10 -0
- package/dist/client/transport.js.map +1 -0
- package/dist/client/trigger-links-client.d.ts +44 -0
- package/dist/client/trigger-links-client.d.ts.map +1 -0
- package/dist/client/trigger-links-client.js +30 -0
- package/dist/client/trigger-links-client.js.map +1 -0
- package/dist/client/web-entry-gate-client.d.ts +34 -0
- package/dist/client/web-entry-gate-client.d.ts.map +1 -0
- package/dist/client/web-entry-gate-client.js +25 -0
- package/dist/client/web-entry-gate-client.js.map +1 -0
- package/dist/errors.d.ts +11 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +15 -0
- package/dist/errors.js.map +1 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +33 -17
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +12 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -13
- package/dist/index.js.map +1 -1
- package/dist/schemas/api-keys.d.ts +43 -0
- package/dist/schemas/api-keys.d.ts.map +1 -0
- package/dist/schemas/api-keys.js +29 -0
- package/dist/schemas/api-keys.js.map +1 -0
- package/dist/schemas/auth-routes.d.ts +78 -0
- package/dist/schemas/auth-routes.d.ts.map +1 -0
- package/dist/schemas/auth-routes.js +42 -0
- package/dist/schemas/auth-routes.js.map +1 -0
- package/dist/schemas/backup.d.ts +78 -0
- package/dist/schemas/backup.d.ts.map +1 -0
- package/dist/schemas/backup.js +33 -0
- package/dist/schemas/backup.js.map +1 -0
- package/dist/schemas/capabilities.d.ts +109 -0
- package/dist/schemas/capabilities.d.ts.map +1 -0
- package/dist/schemas/capabilities.js +78 -0
- package/dist/schemas/capabilities.js.map +1 -0
- package/dist/schemas/channels.d.ts +7 -0
- package/dist/schemas/channels.d.ts.map +1 -0
- package/dist/schemas/channels.js +9 -0
- package/dist/schemas/channels.js.map +1 -0
- package/dist/schemas/config.d.ts +17 -0
- package/dist/schemas/config.d.ts.map +1 -0
- package/dist/schemas/config.js +17 -0
- package/dist/schemas/config.js.map +1 -0
- package/dist/schemas/connectors.d.ts +383 -0
- package/dist/schemas/connectors.d.ts.map +1 -0
- package/dist/schemas/connectors.js +122 -0
- package/dist/schemas/connectors.js.map +1 -0
- package/dist/schemas/conversations.d.ts +600 -0
- package/dist/schemas/conversations.d.ts.map +1 -0
- package/dist/schemas/conversations.js +208 -0
- package/dist/schemas/conversations.js.map +1 -0
- package/dist/schemas/extensions.d.ts +44 -0
- package/dist/schemas/extensions.d.ts.map +1 -0
- package/dist/schemas/extensions.js +29 -0
- package/dist/schemas/extensions.js.map +1 -0
- package/dist/schemas/fleet.d.ts +271 -0
- package/dist/schemas/fleet.d.ts.map +1 -0
- package/dist/schemas/fleet.js +132 -0
- package/dist/schemas/fleet.js.map +1 -0
- package/dist/schemas/hooks.d.ts +120 -0
- package/dist/schemas/hooks.d.ts.map +1 -0
- package/dist/schemas/hooks.js +44 -0
- package/dist/schemas/hooks.js.map +1 -0
- package/dist/schemas/index.d.ts +40 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +40 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/interactions.d.ts +156 -0
- package/dist/schemas/interactions.d.ts.map +1 -0
- package/dist/schemas/interactions.js +124 -0
- package/dist/schemas/interactions.js.map +1 -0
- package/dist/schemas/login.d.ts +93 -0
- package/dist/schemas/login.d.ts.map +1 -0
- package/dist/schemas/login.js +61 -0
- package/dist/schemas/login.js.map +1 -0
- package/dist/schemas/manifest-mcp.d.ts +125 -0
- package/dist/schemas/manifest-mcp.d.ts.map +1 -0
- package/dist/schemas/manifest-mcp.js +61 -0
- package/dist/schemas/manifest-mcp.js.map +1 -0
- package/dist/schemas/marketplace.d.ts +708 -0
- package/dist/schemas/marketplace.d.ts.map +1 -0
- package/dist/schemas/marketplace.js +387 -0
- package/dist/schemas/marketplace.js.map +1 -0
- package/dist/schemas/notifications.d.ts +61 -0
- package/dist/schemas/notifications.d.ts.map +1 -0
- package/dist/schemas/notifications.js +38 -0
- package/dist/schemas/notifications.js.map +1 -0
- package/dist/schemas/observability.d.ts +114 -0
- package/dist/schemas/observability.d.ts.map +1 -0
- package/dist/schemas/observability.js +74 -0
- package/dist/schemas/observability.js.map +1 -0
- package/dist/schemas/policy.d.ts +58 -0
- package/dist/schemas/policy.d.ts.map +1 -0
- package/dist/schemas/policy.js +32 -0
- package/dist/schemas/policy.js.map +1 -0
- package/dist/schemas/presets.d.ts +258 -0
- package/dist/schemas/presets.d.ts.map +1 -0
- package/dist/schemas/presets.js +95 -0
- package/dist/schemas/presets.js.map +1 -0
- package/dist/schemas/principals.d.ts +54 -0
- package/dist/schemas/principals.d.ts.map +1 -0
- package/dist/schemas/principals.js +34 -0
- package/dist/schemas/principals.js.map +1 -0
- package/dist/schemas/profiles.d.ts +180 -0
- package/dist/schemas/profiles.d.ts.map +1 -0
- package/dist/schemas/profiles.js +100 -0
- package/dist/schemas/profiles.js.map +1 -0
- package/dist/schemas/roles.d.ts +125 -0
- package/dist/schemas/roles.d.ts.map +1 -0
- package/dist/schemas/roles.js +46 -0
- package/dist/schemas/roles.js.map +1 -0
- package/dist/schemas/schedules.d.ts +25 -0
- package/dist/schemas/schedules.d.ts.map +1 -0
- package/dist/schemas/schedules.js +24 -0
- package/dist/schemas/schedules.js.map +1 -0
- package/dist/schemas/served.d.ts +626 -0
- package/dist/schemas/served.d.ts.map +1 -0
- package/dist/schemas/served.js +28 -0
- package/dist/schemas/served.js.map +1 -0
- package/dist/schemas/settings-schema.d.ts +23 -0
- package/dist/schemas/settings-schema.d.ts.map +1 -0
- package/dist/schemas/settings-schema.js +25 -0
- package/dist/schemas/settings-schema.js.map +1 -0
- package/dist/schemas/setup.d.ts +43 -0
- package/dist/schemas/setup.d.ts.map +1 -0
- package/dist/schemas/setup.js +19 -0
- package/dist/schemas/setup.js.map +1 -0
- package/dist/schemas/shared.d.ts +20 -0
- package/dist/schemas/shared.d.ts.map +1 -0
- package/dist/schemas/shared.js +20 -0
- package/dist/schemas/shared.js.map +1 -0
- package/dist/schemas/states.d.ts +499 -0
- package/dist/schemas/states.d.ts.map +1 -0
- package/dist/schemas/states.js +220 -0
- package/dist/schemas/states.js.map +1 -0
- package/dist/schemas/storage.d.ts +37 -0
- package/dist/schemas/storage.d.ts.map +1 -0
- package/dist/schemas/storage.js +24 -0
- package/dist/schemas/storage.js.map +1 -0
- package/dist/schemas/studio-plugins.d.ts +30 -0
- package/dist/schemas/studio-plugins.d.ts.map +1 -0
- package/dist/schemas/studio-plugins.js +20 -0
- package/dist/schemas/studio-plugins.js.map +1 -0
- package/dist/schemas/sub-mcp.d.ts +29 -0
- package/dist/schemas/sub-mcp.d.ts.map +1 -0
- package/dist/schemas/sub-mcp.js +22 -0
- package/dist/schemas/sub-mcp.js.map +1 -0
- package/dist/schemas/system-kinds.d.ts +122 -0
- package/dist/schemas/system-kinds.d.ts.map +1 -0
- package/dist/schemas/system-kinds.js +40 -0
- package/dist/schemas/system-kinds.js.map +1 -0
- package/dist/schemas/templates.d.ts +26 -0
- package/dist/schemas/templates.d.ts.map +1 -0
- package/dist/schemas/templates.js +11 -0
- package/dist/schemas/templates.js.map +1 -0
- package/dist/schemas/tool-meta.d.ts +64 -0
- package/dist/schemas/tool-meta.d.ts.map +1 -0
- package/dist/schemas/tool-meta.js +44 -0
- package/dist/schemas/tool-meta.js.map +1 -0
- package/dist/schemas/tools.d.ts +62 -0
- package/dist/schemas/tools.d.ts.map +1 -0
- package/dist/schemas/tools.js +53 -0
- package/dist/schemas/tools.js.map +1 -0
- package/dist/schemas/trigger-links.d.ts +71 -0
- package/dist/schemas/trigger-links.d.ts.map +1 -0
- package/dist/schemas/trigger-links.js +46 -0
- package/dist/schemas/trigger-links.js.map +1 -0
- package/dist/schemas/web-entry.d.ts +45 -0
- package/dist/schemas/web-entry.d.ts.map +1 -0
- package/dist/schemas/web-entry.js +36 -0
- package/dist/schemas/web-entry.js.map +1 -0
- package/dist/tool-runs.d.ts.map +1 -1
- package/dist/tool-runs.js.map +1 -1
- package/package.json +1 -1
- package/src/agents.ts +2 -2
- package/src/client/agents-client.ts +23 -0
- package/src/client/auth-client.ts +170 -0
- package/src/client/backend-client.ts +25 -0
- package/src/client/backup-client.ts +16 -0
- package/src/client/capabilities-client.ts +22 -0
- package/src/client/channels-client.ts +11 -0
- package/src/client/config-client.ts +21 -0
- package/src/client/connectors-client.ts +52 -0
- package/src/client/conversations-client.ts +240 -0
- package/src/client/hooks-client.ts +44 -0
- package/src/client/index.ts +122 -0
- package/src/client/interactions-client.ts +89 -0
- package/src/client/login-client.ts +150 -0
- package/src/client/manifest-client.ts +118 -0
- package/src/client/marketplace-client.ts +122 -0
- package/src/client/mcp-config-schema-client.ts +11 -0
- package/src/client/notifications-client.ts +13 -0
- package/src/client/observability-client.ts +82 -0
- package/src/client/plugins-client.ts +11 -0
- package/src/client/policy-client.ts +41 -0
- package/src/client/presets-client.ts +124 -0
- package/src/client/profiles-client.ts +51 -0
- package/src/client/schedules-client.ts +22 -0
- package/src/client/settings-schema-client.ts +11 -0
- package/src/client/states-client.ts +292 -0
- package/src/client/storage-client.ts +63 -0
- package/src/client/sub-mcp-client.ts +17 -0
- package/src/client/system-client.ts +16 -0
- package/src/client/templates-client.ts +28 -0
- package/src/client/tool-extensions-client.ts +24 -0
- package/src/client/tool-meta-client.ts +65 -0
- package/src/client/tools-client.ts +66 -0
- package/src/client/transport.ts +18 -0
- package/src/client/trigger-links-client.ts +51 -0
- package/src/client/web-entry-gate-client.ts +45 -0
- package/src/errors.ts +16 -0
- package/src/http.ts +48 -24
- package/src/index.ts +231 -226
- package/src/schemas/api-keys.ts +34 -0
- package/src/schemas/auth-routes.ts +48 -0
- package/src/schemas/backup.ts +43 -0
- package/src/schemas/capabilities.ts +92 -0
- package/src/schemas/channels.ts +11 -0
- package/src/schemas/config.ts +17 -0
- package/src/schemas/connectors.ts +139 -0
- package/src/schemas/conversations.ts +257 -0
- package/src/schemas/extensions.ts +34 -0
- package/src/schemas/fleet.ts +154 -0
- package/src/schemas/hooks.ts +57 -0
- package/src/schemas/index.ts +39 -0
- package/src/schemas/interactions.ts +147 -0
- package/src/schemas/login.ts +69 -0
- package/src/schemas/manifest-mcp.ts +70 -0
- package/src/schemas/marketplace.ts +447 -0
- package/src/schemas/notifications.ts +43 -0
- package/src/schemas/observability.ts +87 -0
- package/src/schemas/policy.ts +38 -0
- package/src/schemas/presets.ts +114 -0
- package/src/schemas/principals.ts +41 -0
- package/src/schemas/profiles.ts +120 -0
- package/src/schemas/roles.ts +58 -0
- package/src/schemas/schedules.ts +28 -0
- package/src/schemas/served.ts +50 -0
- package/src/schemas/settings-schema.ts +32 -0
- package/src/schemas/setup.ts +39 -0
- package/src/schemas/shared.ts +21 -0
- package/src/schemas/states.ts +273 -0
- package/src/schemas/storage.ts +31 -0
- package/src/schemas/studio-plugins.ts +21 -0
- package/src/schemas/sub-mcp.ts +24 -0
- package/src/schemas/system-kinds.ts +47 -0
- package/src/schemas/templates.ts +12 -0
- package/src/schemas/tool-meta.ts +51 -0
- package/src/schemas/tools.ts +62 -0
- package/src/schemas/trigger-links.ts +55 -0
- package/src/schemas/web-entry.ts +46 -0
- package/src/tool-runs.ts +1 -1
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -920
- package/dist/client.js.map +0 -1
- package/dist/schemas.d.ts +0 -5172
- package/dist/schemas.d.ts.map +0 -1
- package/dist/schemas.js +0 -2268
- package/dist/schemas.js.map +0 -1
- package/src/client.ts +0 -1771
- package/src/schemas.ts +0 -2760
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** Run metrics, listing, span and trace response schemas. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { jsonValue } from './shared';
|
|
4
|
+
export const dashboardMetrics = z.object({
|
|
5
|
+
summary: z.object({
|
|
6
|
+
totalRuns: z.number(),
|
|
7
|
+
totalCost: z.number(),
|
|
8
|
+
totalTokens: z.number(),
|
|
9
|
+
averageLatencyMs: z.number(),
|
|
10
|
+
avgCostPerRun: z.number(),
|
|
11
|
+
avgTokensPerRun: z.number(),
|
|
12
|
+
timeToFirstTokenMs: z.number().nullable(),
|
|
13
|
+
}),
|
|
14
|
+
timeSeries: z.array(z.object({
|
|
15
|
+
bucket: z.string().nullable(),
|
|
16
|
+
runs: z.number(),
|
|
17
|
+
cost: z.number(),
|
|
18
|
+
avgLatencyMs: z.number(),
|
|
19
|
+
totalTokens: z.number(),
|
|
20
|
+
})),
|
|
21
|
+
byModel: z.array(z.object({
|
|
22
|
+
model: z.string(),
|
|
23
|
+
calls: z.number(),
|
|
24
|
+
cost: z.number(),
|
|
25
|
+
totalTokens: z.number(),
|
|
26
|
+
avgLatencyMs: z.number(),
|
|
27
|
+
})),
|
|
28
|
+
granularity: z.enum(['hour', 'day', 'week']),
|
|
29
|
+
});
|
|
30
|
+
export const run = z.object({
|
|
31
|
+
id: z.string(),
|
|
32
|
+
traceId: z.string(),
|
|
33
|
+
createdAt: z.string().nullable(),
|
|
34
|
+
tags: z.array(z.string()),
|
|
35
|
+
status: z.enum(['error', 'success']),
|
|
36
|
+
cost: z.number().nullable(),
|
|
37
|
+
latencyMs: z.number().nullable(),
|
|
38
|
+
totalTokens: z.number().nullable(),
|
|
39
|
+
inputPreview: jsonValue,
|
|
40
|
+
outputPreview: jsonValue,
|
|
41
|
+
});
|
|
42
|
+
export const runsPage = z.object({
|
|
43
|
+
items: z.array(run),
|
|
44
|
+
page: z.number(),
|
|
45
|
+
nextPage: z.number().nullable(),
|
|
46
|
+
});
|
|
47
|
+
export const runSpan = z.object({
|
|
48
|
+
id: z.string(),
|
|
49
|
+
parentId: z.string().nullable(),
|
|
50
|
+
traceId: z.string().nullable(),
|
|
51
|
+
name: z.string().nullable(),
|
|
52
|
+
type: z.string().nullable(),
|
|
53
|
+
level: z.string().nullable(),
|
|
54
|
+
statusMessage: z.string().nullable(),
|
|
55
|
+
start: z.string().nullable(),
|
|
56
|
+
end: z.string().nullable(),
|
|
57
|
+
model: z.string().nullable(),
|
|
58
|
+
usage: jsonValue.nullable(),
|
|
59
|
+
metadata: jsonValue.nullable(),
|
|
60
|
+
input: jsonValue,
|
|
61
|
+
output: jsonValue,
|
|
62
|
+
nodeId: z.string().nullable(),
|
|
63
|
+
});
|
|
64
|
+
export const runTrace = z.object({
|
|
65
|
+
traceId: z.string(),
|
|
66
|
+
timestamp: z.string().nullable(),
|
|
67
|
+
tags: z.array(z.string()),
|
|
68
|
+
totalCost: z.number().nullable(),
|
|
69
|
+
input: jsonValue,
|
|
70
|
+
output: jsonValue,
|
|
71
|
+
metadata: jsonValue.nullable(),
|
|
72
|
+
spans: z.array(runSpan),
|
|
73
|
+
});
|
|
74
|
+
//# sourceMappingURL=observability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observability.js","sourceRoot":"","sources":["../../src/schemas/observability.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;QAChB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;QACrB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;QACvB,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;QAC5B,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;QACzB,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;QAC3B,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC1C,CAAC;IACF,UAAU,EAAE,CAAC,CAAC,KAAK,CACjB,CAAC,CAA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,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACzB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,SAAS,CAAC,QAAQ,EAAE;IAC9B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;CACxB,CAAC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** Access-policy validation, version and rollback response schemas. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* `POST /api/auth/validate-condition` — the fail-closed jq guard. `ok` is the
|
|
5
|
+
* compile/render result; `result` is the boolean of a sample evaluation, or
|
|
6
|
+
* `null` when no `sample_context` was supplied (compile-only). A broken condition
|
|
7
|
+
* is a `400 {error}` surfaced by the transport, NEVER a false `ok` — so a
|
|
8
|
+
* syntactically-broken condition can be caught before it locks a key out. A drift
|
|
9
|
+
* throws `ApiSchemaError`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const validateConditionResult: z.ZodObject<{
|
|
12
|
+
ok: z.ZodBoolean;
|
|
13
|
+
result: z.ZodNullable<z.ZodBoolean>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export type ValidateConditionResult = z.infer<typeof validateConditionResult>;
|
|
16
|
+
/**
|
|
17
|
+
* One immutable policy version row
|
|
18
|
+
* (`GET /api/auth/api-keys/{user_id}/policy/versions`). `is_current` flags the
|
|
19
|
+
* active pointer; `tags` is the generic per-version label list (kind-agnostic),
|
|
20
|
+
* mirroring the preset version shape.
|
|
21
|
+
*/
|
|
22
|
+
export declare const policyVersion: z.ZodObject<{
|
|
23
|
+
version: z.ZodNumber;
|
|
24
|
+
body: z.ZodObject<{
|
|
25
|
+
condition: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
26
|
+
content: z.ZodOptional<z.ZodString>;
|
|
27
|
+
id: z.ZodOptional<z.ZodString>;
|
|
28
|
+
kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
29
|
+
}, z.core.$strict>, z.ZodNull]>>;
|
|
30
|
+
policy_data: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
31
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
tags: z.ZodArray<z.ZodString>;
|
|
34
|
+
created_at: z.ZodString;
|
|
35
|
+
is_current: z.ZodBoolean;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export type PolicyVersion = z.infer<typeof policyVersion>;
|
|
38
|
+
export declare const policyVersionList: z.ZodArray<z.ZodObject<{
|
|
39
|
+
version: z.ZodNumber;
|
|
40
|
+
body: z.ZodObject<{
|
|
41
|
+
condition: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
42
|
+
content: z.ZodOptional<z.ZodString>;
|
|
43
|
+
id: z.ZodOptional<z.ZodString>;
|
|
44
|
+
kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
45
|
+
}, z.core.$strict>, z.ZodNull]>>;
|
|
46
|
+
policy_data: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
47
|
+
scopes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
tags: z.ZodArray<z.ZodString>;
|
|
50
|
+
created_at: z.ZodString;
|
|
51
|
+
is_current: z.ZodBoolean;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
/** `POST /api/auth/api-keys/{user_id}/policy/rollback` — the re-pointed version. */
|
|
54
|
+
export declare const policyRollback: z.ZodObject<{
|
|
55
|
+
user_id: z.ZodString;
|
|
56
|
+
active_version: z.ZodNumber;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
//# sourceMappingURL=policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/schemas/policy.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB;;;iBAGlC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E;;;;;GAKG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;iBAMxB,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;kBAAyB,CAAC;AAExD,oFAAoF;AACpF,eAAO,MAAM,cAAc;;;iBAAgE,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** Access-policy validation, version and rollback response schemas. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { policyBody } from './served';
|
|
4
|
+
/**
|
|
5
|
+
* `POST /api/auth/validate-condition` — the fail-closed jq guard. `ok` is the
|
|
6
|
+
* compile/render result; `result` is the boolean of a sample evaluation, or
|
|
7
|
+
* `null` when no `sample_context` was supplied (compile-only). A broken condition
|
|
8
|
+
* is a `400 {error}` surfaced by the transport, NEVER a false `ok` — so a
|
|
9
|
+
* syntactically-broken condition can be caught before it locks a key out. A drift
|
|
10
|
+
* throws `ApiSchemaError`.
|
|
11
|
+
*/
|
|
12
|
+
export const validateConditionResult = z.object({
|
|
13
|
+
ok: z.boolean(),
|
|
14
|
+
result: z.boolean().nullable(),
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* One immutable policy version row
|
|
18
|
+
* (`GET /api/auth/api-keys/{user_id}/policy/versions`). `is_current` flags the
|
|
19
|
+
* active pointer; `tags` is the generic per-version label list (kind-agnostic),
|
|
20
|
+
* mirroring the preset version shape.
|
|
21
|
+
*/
|
|
22
|
+
export const policyVersion = z.object({
|
|
23
|
+
version: z.number(),
|
|
24
|
+
body: policyBody,
|
|
25
|
+
tags: z.array(z.string()),
|
|
26
|
+
created_at: z.string(),
|
|
27
|
+
is_current: z.boolean(),
|
|
28
|
+
});
|
|
29
|
+
export const policyVersionList = z.array(policyVersion);
|
|
30
|
+
/** `POST /api/auth/api-keys/{user_id}/policy/rollback` — the re-pointed version. */
|
|
31
|
+
export const policyRollback = z.object({ user_id: z.string(), active_version: z.number() });
|
|
32
|
+
//# sourceMappingURL=policy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../../src/schemas/policy.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE;IACf,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAGH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACzB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE;CACxB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;AAExD,oFAAoF;AACpF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/** Preset record, version and validation response schemas. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/** A list of extension COMBOS — each combo an ordered list of elements. */
|
|
4
|
+
export declare const presetExtensions: z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
7
|
+
}, z.core.$strip>]>>>;
|
|
8
|
+
/**
|
|
9
|
+
* One preset as `GET /api/presets` returns it. Every preset is versioned, so
|
|
10
|
+
* `active_version` is always an int; `conflicted` marks a QUARANTINED row (its
|
|
11
|
+
* name collided with a foreign tool at boot — delete-only). `extensions` are the
|
|
12
|
+
* ACTIVE version's extension combos, `output_schema` the optional author-set
|
|
13
|
+
* output JSON Schema, and `input_schema` the optional author-set input JSON
|
|
14
|
+
* Schema. Categorization tags live in the tool_meta overlay
|
|
15
|
+
* (`GET /api/tool-meta`), never on the record. A drift throws `ApiSchemaError`;
|
|
16
|
+
* nothing is coerced.
|
|
17
|
+
*/
|
|
18
|
+
export declare const presetRecord: z.ZodObject<{
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
base_tool: z.ZodString;
|
|
21
|
+
description: z.ZodString;
|
|
22
|
+
active_version: z.ZodNumber;
|
|
23
|
+
extensions: z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
26
|
+
}, z.core.$strip>]>>>;
|
|
27
|
+
output_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
28
|
+
input_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
29
|
+
conflicted: z.ZodBoolean;
|
|
30
|
+
conflicted_reason: z.ZodNullable<z.ZodString>;
|
|
31
|
+
uses: z.ZodArray<z.ZodString>;
|
|
32
|
+
used_by: z.ZodArray<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export type PresetRecord = z.infer<typeof presetRecord>;
|
|
35
|
+
export declare const presetList: z.ZodArray<z.ZodObject<{
|
|
36
|
+
name: z.ZodString;
|
|
37
|
+
base_tool: z.ZodString;
|
|
38
|
+
description: z.ZodString;
|
|
39
|
+
active_version: z.ZodNumber;
|
|
40
|
+
extensions: z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
41
|
+
name: z.ZodString;
|
|
42
|
+
config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
43
|
+
}, z.core.$strip>]>>>;
|
|
44
|
+
output_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
45
|
+
input_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
46
|
+
conflicted: z.ZodBoolean;
|
|
47
|
+
conflicted_reason: z.ZodNullable<z.ZodString>;
|
|
48
|
+
uses: z.ZodArray<z.ZodString>;
|
|
49
|
+
used_by: z.ZodArray<z.ZodString>;
|
|
50
|
+
}, z.core.$strip>>;
|
|
51
|
+
/** `GET /api/presets/{name}` — the record plus the active version's baked kwargs. */
|
|
52
|
+
export declare const presetDetail: z.ZodObject<{
|
|
53
|
+
name: z.ZodString;
|
|
54
|
+
base_tool: z.ZodString;
|
|
55
|
+
description: z.ZodString;
|
|
56
|
+
active_version: z.ZodNumber;
|
|
57
|
+
extensions: z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
58
|
+
name: z.ZodString;
|
|
59
|
+
config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
60
|
+
}, z.core.$strip>]>>>;
|
|
61
|
+
output_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
62
|
+
input_schema: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
63
|
+
conflicted: z.ZodBoolean;
|
|
64
|
+
conflicted_reason: z.ZodNullable<z.ZodString>;
|
|
65
|
+
uses: z.ZodArray<z.ZodString>;
|
|
66
|
+
used_by: z.ZodArray<z.ZodString>;
|
|
67
|
+
fixed_kwargs: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
export type PresetDetail = z.infer<typeof presetDetail>;
|
|
70
|
+
/**
|
|
71
|
+
* One immutable version row (`GET /api/presets/{name}/versions[/{version}]`).
|
|
72
|
+
* `is_current` flags the active version; `tags` here is the GENERIC per-version
|
|
73
|
+
* label list (kind-agnostic) — the only preset tags that remain, distinct from the
|
|
74
|
+
* removed record-level categorization and from the tool_meta overlay.
|
|
75
|
+
*/
|
|
76
|
+
export declare const presetVersion: z.ZodObject<{
|
|
77
|
+
version: z.ZodNumber;
|
|
78
|
+
body: z.ZodObject<{
|
|
79
|
+
base_tool: z.ZodString;
|
|
80
|
+
description: z.ZodDefault<z.ZodString>;
|
|
81
|
+
extensions: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>>>;
|
|
82
|
+
fixed_kwargs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
83
|
+
input_schema: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
84
|
+
content: z.ZodOptional<z.ZodString>;
|
|
85
|
+
id: z.ZodOptional<z.ZodString>;
|
|
86
|
+
kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
87
|
+
}, z.core.$strict>, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
|
|
88
|
+
output_schema: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
89
|
+
content: z.ZodOptional<z.ZodString>;
|
|
90
|
+
id: z.ZodOptional<z.ZodString>;
|
|
91
|
+
kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
92
|
+
}, z.core.$strict>, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
|
|
93
|
+
state_binding: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
94
|
+
states: z.ZodArray<z.ZodObject<{
|
|
95
|
+
input_injections: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
96
|
+
into: z.ZodString;
|
|
97
|
+
jq: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
98
|
+
content: z.ZodOptional<z.ZodString>;
|
|
99
|
+
id: z.ZodOptional<z.ZodString>;
|
|
100
|
+
kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
101
|
+
}, z.core.$strict>, z.ZodNull]>>;
|
|
102
|
+
template_jq: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
103
|
+
}, z.core.$strict>>>;
|
|
104
|
+
scope_expr: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
105
|
+
content: z.ZodOptional<z.ZodString>;
|
|
106
|
+
id: z.ZodOptional<z.ZodString>;
|
|
107
|
+
kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
108
|
+
}, z.core.$strict>, z.ZodNull]>>;
|
|
109
|
+
state: z.ZodString;
|
|
110
|
+
subject_expr: z.ZodObject<{
|
|
111
|
+
content: z.ZodOptional<z.ZodString>;
|
|
112
|
+
id: z.ZodOptional<z.ZodString>;
|
|
113
|
+
kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
114
|
+
}, z.core.$strict>;
|
|
115
|
+
templates: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
116
|
+
updates: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
117
|
+
adapter: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
118
|
+
content: z.ZodOptional<z.ZodString>;
|
|
119
|
+
id: z.ZodOptional<z.ZodString>;
|
|
120
|
+
kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
121
|
+
}, z.core.$strict>, z.ZodNull]>>;
|
|
122
|
+
jq: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
123
|
+
content: z.ZodOptional<z.ZodString>;
|
|
124
|
+
id: z.ZodOptional<z.ZodString>;
|
|
125
|
+
kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
126
|
+
}, z.core.$strict>, z.ZodNull]>>;
|
|
127
|
+
op_id: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
128
|
+
content: z.ZodOptional<z.ZodString>;
|
|
129
|
+
id: z.ZodOptional<z.ZodString>;
|
|
130
|
+
kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
131
|
+
}, z.core.$strict>, z.ZodNull]>>;
|
|
132
|
+
template_jq: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
133
|
+
}, z.core.$strict>>>;
|
|
134
|
+
}, z.core.$strict>>;
|
|
135
|
+
}, z.core.$strict>, z.ZodNull]>>;
|
|
136
|
+
}, z.core.$strip>;
|
|
137
|
+
tags: z.ZodArray<z.ZodString>;
|
|
138
|
+
created_at: z.ZodString;
|
|
139
|
+
is_current: z.ZodBoolean;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
export type PresetVersion = z.infer<typeof presetVersion>;
|
|
142
|
+
export declare const presetVersionList: z.ZodArray<z.ZodObject<{
|
|
143
|
+
version: z.ZodNumber;
|
|
144
|
+
body: z.ZodObject<{
|
|
145
|
+
base_tool: z.ZodString;
|
|
146
|
+
description: z.ZodDefault<z.ZodString>;
|
|
147
|
+
extensions: z.ZodDefault<z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>>>;
|
|
148
|
+
fixed_kwargs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
149
|
+
input_schema: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
150
|
+
content: z.ZodOptional<z.ZodString>;
|
|
151
|
+
id: z.ZodOptional<z.ZodString>;
|
|
152
|
+
kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
153
|
+
}, z.core.$strict>, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
|
|
154
|
+
output_schema: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
155
|
+
content: z.ZodOptional<z.ZodString>;
|
|
156
|
+
id: z.ZodOptional<z.ZodString>;
|
|
157
|
+
kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
158
|
+
}, z.core.$strict>, z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
|
|
159
|
+
state_binding: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
160
|
+
states: z.ZodArray<z.ZodObject<{
|
|
161
|
+
input_injections: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
162
|
+
into: z.ZodString;
|
|
163
|
+
jq: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
164
|
+
content: z.ZodOptional<z.ZodString>;
|
|
165
|
+
id: z.ZodOptional<z.ZodString>;
|
|
166
|
+
kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
167
|
+
}, z.core.$strict>, z.ZodNull]>>;
|
|
168
|
+
template_jq: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
169
|
+
}, z.core.$strict>>>;
|
|
170
|
+
scope_expr: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
171
|
+
content: z.ZodOptional<z.ZodString>;
|
|
172
|
+
id: z.ZodOptional<z.ZodString>;
|
|
173
|
+
kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
174
|
+
}, z.core.$strict>, z.ZodNull]>>;
|
|
175
|
+
state: z.ZodString;
|
|
176
|
+
subject_expr: z.ZodObject<{
|
|
177
|
+
content: z.ZodOptional<z.ZodString>;
|
|
178
|
+
id: z.ZodOptional<z.ZodString>;
|
|
179
|
+
kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
180
|
+
}, z.core.$strict>;
|
|
181
|
+
templates: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
182
|
+
updates: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
183
|
+
adapter: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
184
|
+
content: z.ZodOptional<z.ZodString>;
|
|
185
|
+
id: z.ZodOptional<z.ZodString>;
|
|
186
|
+
kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
187
|
+
}, z.core.$strict>, z.ZodNull]>>;
|
|
188
|
+
jq: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
189
|
+
content: z.ZodOptional<z.ZodString>;
|
|
190
|
+
id: z.ZodOptional<z.ZodString>;
|
|
191
|
+
kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
192
|
+
}, z.core.$strict>, z.ZodNull]>>;
|
|
193
|
+
op_id: z.ZodDefault<z.ZodUnion<readonly [z.ZodObject<{
|
|
194
|
+
content: z.ZodOptional<z.ZodString>;
|
|
195
|
+
id: z.ZodOptional<z.ZodString>;
|
|
196
|
+
kwargs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
197
|
+
}, z.core.$strict>, z.ZodNull]>>;
|
|
198
|
+
template_jq: z.ZodDefault<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
199
|
+
}, z.core.$strict>>>;
|
|
200
|
+
}, z.core.$strict>>;
|
|
201
|
+
}, z.core.$strict>, z.ZodNull]>>;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
tags: z.ZodArray<z.ZodString>;
|
|
204
|
+
created_at: z.ZodString;
|
|
205
|
+
is_current: z.ZodBoolean;
|
|
206
|
+
}, z.core.$strip>>;
|
|
207
|
+
/** `POST /api/presets/{name}/rollback` — the re-pointed active version. */
|
|
208
|
+
export declare const presetRollback: z.ZodObject<{
|
|
209
|
+
name: z.ZodString;
|
|
210
|
+
active_version: z.ZodNumber;
|
|
211
|
+
}, z.core.$strip>;
|
|
212
|
+
/** `DELETE /api/presets/{name}` — the removed preset. */
|
|
213
|
+
export declare const presetDeleted: z.ZodObject<{
|
|
214
|
+
name: z.ZodString;
|
|
215
|
+
deleted: z.ZodLiteral<true>;
|
|
216
|
+
}, z.core.$strip>;
|
|
217
|
+
/** `POST /api/presets/{name}/rename` — the re-keyed record identity. */
|
|
218
|
+
export declare const presetRenamed: z.ZodObject<{
|
|
219
|
+
name: z.ZodString;
|
|
220
|
+
renamed_from: z.ZodString;
|
|
221
|
+
active_version: z.ZodNumber;
|
|
222
|
+
}, z.core.$strip>;
|
|
223
|
+
export type PresetRenamed = z.infer<typeof presetRenamed>;
|
|
224
|
+
/**
|
|
225
|
+
* `GET /api/presets/{name}/referees` — every OTHER preset whose active authored
|
|
226
|
+
* composition names this one as a tool (the referees a rename would strand). An
|
|
227
|
+
* empty list is the clean case; a non-empty list means a rename is blocked until
|
|
228
|
+
* those presets are updated. A drift throws `ApiSchemaError`.
|
|
229
|
+
*/
|
|
230
|
+
export declare const presetReferees: z.ZodObject<{
|
|
231
|
+
name: z.ZodString;
|
|
232
|
+
referees: z.ZodArray<z.ZodString>;
|
|
233
|
+
}, z.core.$strip>;
|
|
234
|
+
export type PresetReferees = z.infer<typeof presetReferees>;
|
|
235
|
+
/**
|
|
236
|
+
* `POST /api/presets/validate` — the dry-run verdict for a preset draft. `valid`
|
|
237
|
+
* is the absence of an `error`; an invalid draft is a SUCCESSFUL validation (HTTP
|
|
238
|
+
* 200), so `error` carries the server's verbatim message. A drift throws
|
|
239
|
+
* `ApiSchemaError`.
|
|
240
|
+
*/
|
|
241
|
+
export declare const presetValidation: z.ZodObject<{
|
|
242
|
+
valid: z.ZodBoolean;
|
|
243
|
+
error: z.ZodNullable<z.ZodString>;
|
|
244
|
+
}, z.core.$strip>;
|
|
245
|
+
export type PresetValidation = z.infer<typeof presetValidation>;
|
|
246
|
+
/**
|
|
247
|
+
* `PUT /api/presets/{name}/versions/{version}/tags` — the re-annotated version.
|
|
248
|
+
* Version tags are labels on an immutable body, so this rebinds nothing; the
|
|
249
|
+
* response echoes the identity plus the new tag list. A drift throws
|
|
250
|
+
* `ApiSchemaError`.
|
|
251
|
+
*/
|
|
252
|
+
export declare const presetVersionTags: z.ZodObject<{
|
|
253
|
+
name: z.ZodString;
|
|
254
|
+
version: z.ZodNumber;
|
|
255
|
+
tags: z.ZodArray<z.ZodString>;
|
|
256
|
+
}, z.core.$strip>;
|
|
257
|
+
export type PresetVersionTags = z.infer<typeof presetVersionTags>;
|
|
258
|
+
//# sourceMappingURL=presets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../src/schemas/presets.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,2EAA2E;AAC3E,eAAO,MAAM,gBAAgB;;;qBAA2C,CAAC;AAEzE;;;;;;;;;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B;;;;iBAI5B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/** Preset record, version and validation response schemas. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { presetExtensionElement } from './extensions';
|
|
4
|
+
import { presetBody } from './served';
|
|
5
|
+
/** A list of extension COMBOS — each combo an ordered list of elements. */
|
|
6
|
+
export const presetExtensions = z.array(z.array(presetExtensionElement));
|
|
7
|
+
/**
|
|
8
|
+
* One preset as `GET /api/presets` returns it. Every preset is versioned, so
|
|
9
|
+
* `active_version` is always an int; `conflicted` marks a QUARANTINED row (its
|
|
10
|
+
* name collided with a foreign tool at boot — delete-only). `extensions` are the
|
|
11
|
+
* ACTIVE version's extension combos, `output_schema` the optional author-set
|
|
12
|
+
* output JSON Schema, and `input_schema` the optional author-set input JSON
|
|
13
|
+
* Schema. Categorization tags live in the tool_meta overlay
|
|
14
|
+
* (`GET /api/tool-meta`), never on the record. A drift throws `ApiSchemaError`;
|
|
15
|
+
* nothing is coerced.
|
|
16
|
+
*/
|
|
17
|
+
export const presetRecord = z.object({
|
|
18
|
+
name: z.string(),
|
|
19
|
+
base_tool: z.string(),
|
|
20
|
+
description: z.string(),
|
|
21
|
+
active_version: z.number(),
|
|
22
|
+
extensions: presetExtensions,
|
|
23
|
+
output_schema: z.record(z.string(), z.unknown()).nullable(),
|
|
24
|
+
input_schema: z.record(z.string(), z.unknown()).nullable(),
|
|
25
|
+
conflicted: z.boolean(),
|
|
26
|
+
// The human-readable cause a row is quarantined (its name collided with a
|
|
27
|
+
// foreign tool at boot), or `null` when the row is not conflicted. Rendered
|
|
28
|
+
// verbatim; nothing is coerced.
|
|
29
|
+
conflicted_reason: z.string().nullable(),
|
|
30
|
+
// Sorted preset-name cross-references: `uses` names the presets this one
|
|
31
|
+
// composes as tools; `used_by` names the presets that compose this one.
|
|
32
|
+
uses: z.array(z.string()),
|
|
33
|
+
used_by: z.array(z.string()),
|
|
34
|
+
});
|
|
35
|
+
export const presetList = z.array(presetRecord);
|
|
36
|
+
/** `GET /api/presets/{name}` — the record plus the active version's baked kwargs. */
|
|
37
|
+
export const presetDetail = presetRecord.extend({
|
|
38
|
+
fixed_kwargs: z.record(z.string(), z.unknown()),
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* One immutable version row (`GET /api/presets/{name}/versions[/{version}]`).
|
|
42
|
+
* `is_current` flags the active version; `tags` here is the GENERIC per-version
|
|
43
|
+
* label list (kind-agnostic) — the only preset tags that remain, distinct from the
|
|
44
|
+
* removed record-level categorization and from the tool_meta overlay.
|
|
45
|
+
*/
|
|
46
|
+
export const presetVersion = z.object({
|
|
47
|
+
version: z.number(),
|
|
48
|
+
body: presetBody,
|
|
49
|
+
tags: z.array(z.string()),
|
|
50
|
+
created_at: z.string(),
|
|
51
|
+
is_current: z.boolean(),
|
|
52
|
+
});
|
|
53
|
+
export const presetVersionList = z.array(presetVersion);
|
|
54
|
+
/** `POST /api/presets/{name}/rollback` — the re-pointed active version. */
|
|
55
|
+
export const presetRollback = z.object({ name: z.string(), active_version: z.number() });
|
|
56
|
+
/** `DELETE /api/presets/{name}` — the removed preset. */
|
|
57
|
+
export const presetDeleted = z.object({ name: z.string(), deleted: z.literal(true) });
|
|
58
|
+
/** `POST /api/presets/{name}/rename` — the re-keyed record identity. */
|
|
59
|
+
export const presetRenamed = z.object({
|
|
60
|
+
name: z.string(),
|
|
61
|
+
renamed_from: z.string(),
|
|
62
|
+
active_version: z.number(),
|
|
63
|
+
});
|
|
64
|
+
/**
|
|
65
|
+
* `GET /api/presets/{name}/referees` — every OTHER preset whose active authored
|
|
66
|
+
* composition names this one as a tool (the referees a rename would strand). An
|
|
67
|
+
* empty list is the clean case; a non-empty list means a rename is blocked until
|
|
68
|
+
* those presets are updated. A drift throws `ApiSchemaError`.
|
|
69
|
+
*/
|
|
70
|
+
export const presetReferees = z.object({
|
|
71
|
+
name: z.string(),
|
|
72
|
+
referees: z.array(z.string()),
|
|
73
|
+
});
|
|
74
|
+
/**
|
|
75
|
+
* `POST /api/presets/validate` — the dry-run verdict for a preset draft. `valid`
|
|
76
|
+
* is the absence of an `error`; an invalid draft is a SUCCESSFUL validation (HTTP
|
|
77
|
+
* 200), so `error` carries the server's verbatim message. A drift throws
|
|
78
|
+
* `ApiSchemaError`.
|
|
79
|
+
*/
|
|
80
|
+
export const presetValidation = z.object({
|
|
81
|
+
valid: z.boolean(),
|
|
82
|
+
error: z.string().nullable(),
|
|
83
|
+
});
|
|
84
|
+
/**
|
|
85
|
+
* `PUT /api/presets/{name}/versions/{version}/tags` — the re-annotated version.
|
|
86
|
+
* Version tags are labels on an immutable body, so this rebinds nothing; the
|
|
87
|
+
* response echoes the identity plus the new tag list. A drift throws
|
|
88
|
+
* `ApiSchemaError`.
|
|
89
|
+
*/
|
|
90
|
+
export const presetVersionTags = z.object({
|
|
91
|
+
name: z.string(),
|
|
92
|
+
version: z.number(),
|
|
93
|
+
tags: z.array(z.string()),
|
|
94
|
+
});
|
|
95
|
+
//# sourceMappingURL=presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../../src/schemas/presets.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC;AAEzE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE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iB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC1B,CAAC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** Principal (identity) reference, row, listing and delete-result schemas. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* A compact reference to a principal — the owner of a key, or the human behind a
|
|
5
|
+
* session — carried inline on payloads that name one.
|
|
6
|
+
*/
|
|
7
|
+
export declare const principalRef: z.ZodObject<{
|
|
8
|
+
user_id: z.ZodString;
|
|
9
|
+
kind: z.ZodEnum<{
|
|
10
|
+
human: "human";
|
|
11
|
+
service: "service";
|
|
12
|
+
}>;
|
|
13
|
+
display_name: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export type PrincipalRef = z.infer<typeof principalRef>;
|
|
16
|
+
/**
|
|
17
|
+
* A principal row (`/api/auth/principals`). `kind` is `human` (logs in
|
|
18
|
+
* interactively) or `service` (holds keys only, never logs in). `created_by` is
|
|
19
|
+
* the principal that created this one, or `null` for the owner the setup door
|
|
20
|
+
* mints. `disabled` turns off every credential the principal owns. `created_at`
|
|
21
|
+
* is an ISO-8601 instant.
|
|
22
|
+
*/
|
|
23
|
+
export declare const principal: z.ZodObject<{
|
|
24
|
+
user_id: z.ZodString;
|
|
25
|
+
kind: z.ZodEnum<{
|
|
26
|
+
human: "human";
|
|
27
|
+
service: "service";
|
|
28
|
+
}>;
|
|
29
|
+
display_name: z.ZodString;
|
|
30
|
+
created_by: z.ZodNullable<z.ZodString>;
|
|
31
|
+
disabled: z.ZodBoolean;
|
|
32
|
+
created_at: z.ZodString;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export type Principal = z.infer<typeof principal>;
|
|
35
|
+
/** The principals listing (`GET /api/auth/principals`). */
|
|
36
|
+
export declare const principalList: z.ZodArray<z.ZodObject<{
|
|
37
|
+
user_id: z.ZodString;
|
|
38
|
+
kind: z.ZodEnum<{
|
|
39
|
+
human: "human";
|
|
40
|
+
service: "service";
|
|
41
|
+
}>;
|
|
42
|
+
display_name: z.ZodString;
|
|
43
|
+
created_by: z.ZodNullable<z.ZodString>;
|
|
44
|
+
disabled: z.ZodBoolean;
|
|
45
|
+
created_at: z.ZodString;
|
|
46
|
+
}, z.core.$strip>>;
|
|
47
|
+
export type PrincipalList = z.infer<typeof principalList>;
|
|
48
|
+
/** The delete result (`DELETE /api/auth/principals/{user_id}`). */
|
|
49
|
+
export declare const principalDeleted: z.ZodObject<{
|
|
50
|
+
user_id: z.ZodString;
|
|
51
|
+
deleted: z.ZodBoolean;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
export type PrincipalDeleted = z.infer<typeof principalDeleted>;
|
|
54
|
+
//# sourceMappingURL=principals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"principals.d.ts","sourceRoot":"","sources":["../../src/schemas/principals.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;iBAIvB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD;;;;;;GAMG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;iBAOpB,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAElD,2DAA2D;AAC3D,eAAO,MAAM,aAAa;;;;;;;;;;kBAAqB,CAAC;AAChD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,mEAAmE;AACnE,eAAO,MAAM,gBAAgB;;;iBAG3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Principal (identity) reference, row, listing and delete-result schemas. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* A compact reference to a principal — the owner of a key, or the human behind a
|
|
5
|
+
* session — carried inline on payloads that name one.
|
|
6
|
+
*/
|
|
7
|
+
export const principalRef = z.object({
|
|
8
|
+
user_id: z.string(),
|
|
9
|
+
kind: z.enum(['human', 'service']),
|
|
10
|
+
display_name: z.string(),
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* A principal row (`/api/auth/principals`). `kind` is `human` (logs in
|
|
14
|
+
* interactively) or `service` (holds keys only, never logs in). `created_by` is
|
|
15
|
+
* the principal that created this one, or `null` for the owner the setup door
|
|
16
|
+
* mints. `disabled` turns off every credential the principal owns. `created_at`
|
|
17
|
+
* is an ISO-8601 instant.
|
|
18
|
+
*/
|
|
19
|
+
export const principal = z.object({
|
|
20
|
+
user_id: z.string(),
|
|
21
|
+
kind: z.enum(['human', 'service']),
|
|
22
|
+
display_name: z.string(),
|
|
23
|
+
created_by: z.string().nullable(),
|
|
24
|
+
disabled: z.boolean(),
|
|
25
|
+
created_at: z.string(),
|
|
26
|
+
});
|
|
27
|
+
/** The principals listing (`GET /api/auth/principals`). */
|
|
28
|
+
export const principalList = z.array(principal);
|
|
29
|
+
/** The delete result (`DELETE /api/auth/principals/{user_id}`). */
|
|
30
|
+
export const principalDeleted = z.object({
|
|
31
|
+
user_id: z.string(),
|
|
32
|
+
deleted: z.boolean(),
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=principals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"principals.js","sourceRoot":"","sources":["../../src/schemas/principals.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAClC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;CACzB,CAAC,CAAC;AAGH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAClC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAGH,2DAA2D;AAC3D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AAGhD,mEAAmE;AACnE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;CACrB,CAAC,CAAC"}
|