@agentuity/server 1.0.1 → 1.0.3
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/AGENTS.md +38 -34
- package/dist/api/api.d.ts +32 -2
- package/dist/api/api.d.ts.map +1 -1
- package/dist/api/api.js +14 -2
- package/dist/api/api.js.map +1 -1
- package/dist/api/apikey/create.d.ts +12 -2
- package/dist/api/apikey/create.d.ts.map +1 -1
- package/dist/api/apikey/create.js +2 -2
- package/dist/api/apikey/create.js.map +1 -1
- package/dist/api/apikey/delete.d.ts +9 -0
- package/dist/api/apikey/delete.d.ts.map +1 -1
- package/dist/api/apikey/delete.js +1 -1
- package/dist/api/apikey/delete.js.map +1 -1
- package/dist/api/apikey/get.d.ts +21 -2
- package/dist/api/apikey/get.d.ts.map +1 -1
- package/dist/api/apikey/get.js +2 -2
- package/dist/api/apikey/get.js.map +1 -1
- package/dist/api/apikey/index.d.ts +1 -0
- package/dist/api/apikey/index.d.ts.map +1 -1
- package/dist/api/apikey/index.js +1 -0
- package/dist/api/apikey/index.js.map +1 -1
- package/dist/api/apikey/list.d.ts +1 -2
- package/dist/api/apikey/list.d.ts.map +1 -1
- package/dist/api/apikey/list.js +1 -1
- package/dist/api/apikey/list.js.map +1 -1
- package/dist/api/db/index.d.ts +4 -4
- package/dist/api/db/index.d.ts.map +1 -1
- package/dist/api/db/index.js +4 -4
- package/dist/api/db/index.js.map +1 -1
- package/dist/api/db/logs.d.ts +34 -3
- package/dist/api/db/logs.d.ts.map +1 -1
- package/dist/api/db/logs.js +4 -4
- package/dist/api/db/logs.js.map +1 -1
- package/dist/api/db/query.d.ts +14 -1
- package/dist/api/db/query.d.ts.map +1 -1
- package/dist/api/db/query.js +2 -2
- package/dist/api/db/query.js.map +1 -1
- package/dist/api/db/tables.d.ts +21 -2
- package/dist/api/db/tables.d.ts.map +1 -1
- package/dist/api/db/tables.js +2 -2
- package/dist/api/db/tables.js.map +1 -1
- package/dist/api/eval/get.d.ts +21 -3
- package/dist/api/eval/get.d.ts.map +1 -1
- package/dist/api/eval/get.js +2 -2
- package/dist/api/eval/get.js.map +1 -1
- package/dist/api/eval/index.d.ts +4 -4
- package/dist/api/eval/index.d.ts.map +1 -1
- package/dist/api/eval/index.js +4 -4
- package/dist/api/eval/index.js.map +1 -1
- package/dist/api/eval/list.d.ts +31 -3
- package/dist/api/eval/list.d.ts.map +1 -1
- package/dist/api/eval/list.js +3 -3
- package/dist/api/eval/list.js.map +1 -1
- package/dist/api/eval/run-get.d.ts +27 -3
- package/dist/api/eval/run-get.d.ts.map +1 -1
- package/dist/api/eval/run-get.js +2 -2
- package/dist/api/eval/run-get.js.map +1 -1
- package/dist/api/eval/run-list.d.ts +43 -3
- package/dist/api/eval/run-list.d.ts.map +1 -1
- package/dist/api/eval/run-list.js +3 -3
- package/dist/api/eval/run-list.js.map +1 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +1 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/machine/machine.d.ts +134 -3
- package/dist/api/machine/machine.d.ts.map +1 -1
- package/dist/api/machine/machine.js +11 -11
- package/dist/api/machine/machine.js.map +1 -1
- package/dist/api/org/env-delete.d.ts +10 -3
- package/dist/api/org/env-delete.d.ts.map +1 -1
- package/dist/api/org/env-delete.js +2 -2
- package/dist/api/org/env-delete.js.map +1 -1
- package/dist/api/org/env-get.d.ts +14 -1
- package/dist/api/org/env-get.d.ts.map +1 -1
- package/dist/api/org/env-get.js +2 -2
- package/dist/api/org/env-get.js.map +1 -1
- package/dist/api/org/env-update.d.ts +10 -3
- package/dist/api/org/env-update.d.ts.map +1 -1
- package/dist/api/org/env-update.js +2 -2
- package/dist/api/org/env-update.js.map +1 -1
- package/dist/api/org/list.d.ts +2 -3
- package/dist/api/org/list.d.ts.map +1 -1
- package/dist/api/org/list.js +2 -2
- package/dist/api/org/list.js.map +1 -1
- package/dist/api/org/resources.d.ts +4 -5
- package/dist/api/org/resources.d.ts.map +1 -1
- package/dist/api/org/resources.js +4 -4
- package/dist/api/org/resources.js.map +1 -1
- package/dist/api/project/agent.d.ts +55 -2
- package/dist/api/project/agent.d.ts.map +1 -1
- package/dist/api/project/agent.js +3 -3
- package/dist/api/project/agent.js.map +1 -1
- package/dist/api/project/create.d.ts +5 -6
- package/dist/api/project/create.d.ts.map +1 -1
- package/dist/api/project/create.js +3 -3
- package/dist/api/project/create.js.map +1 -1
- package/dist/api/project/delete.d.ts +13 -1
- package/dist/api/project/delete.d.ts.map +1 -1
- package/dist/api/project/delete.js +2 -2
- package/dist/api/project/delete.js.map +1 -1
- package/dist/api/project/deploy.d.ts +233 -9
- package/dist/api/project/deploy.d.ts.map +1 -1
- package/dist/api/project/deploy.js +23 -23
- package/dist/api/project/deploy.js.map +1 -1
- package/dist/api/project/deployment.d.ts +163 -3
- package/dist/api/project/deployment.d.ts.map +1 -1
- package/dist/api/project/deployment.js +8 -8
- package/dist/api/project/deployment.js.map +1 -1
- package/dist/api/project/env-delete.d.ts +10 -3
- package/dist/api/project/env-delete.d.ts.map +1 -1
- package/dist/api/project/env-delete.js +6 -2
- package/dist/api/project/env-delete.js.map +1 -1
- package/dist/api/project/env-update.d.ts +17 -3
- package/dist/api/project/env-update.d.ts.map +1 -1
- package/dist/api/project/env-update.js +2 -2
- package/dist/api/project/env-update.js.map +1 -1
- package/dist/api/project/exists.d.ts +4 -5
- package/dist/api/project/exists.d.ts.map +1 -1
- package/dist/api/project/exists.js +3 -3
- package/dist/api/project/exists.js.map +1 -1
- package/dist/api/project/get.d.ts +22 -4
- package/dist/api/project/get.d.ts.map +1 -1
- package/dist/api/project/get.js +3 -3
- package/dist/api/project/get.js.map +1 -1
- package/dist/api/project/list.d.ts +13 -5
- package/dist/api/project/list.d.ts.map +1 -1
- package/dist/api/project/list.js +4 -3
- package/dist/api/project/list.js.map +1 -1
- package/dist/api/project/malware.d.ts +41 -7
- package/dist/api/project/malware.d.ts.map +1 -1
- package/dist/api/project/malware.js +9 -9
- package/dist/api/project/malware.js.map +1 -1
- package/dist/api/project/update-region.d.ts +15 -1
- package/dist/api/project/update-region.d.ts.map +1 -1
- package/dist/api/project/update-region.js +2 -2
- package/dist/api/project/update-region.js.map +1 -1
- package/dist/api/queue/analytics.d.ts +144 -2
- package/dist/api/queue/analytics.d.ts.map +1 -1
- package/dist/api/queue/analytics.js +5 -5
- package/dist/api/queue/analytics.js.map +1 -1
- package/dist/api/queue/destinations.d.ts +96 -2
- package/dist/api/queue/destinations.d.ts.map +1 -1
- package/dist/api/queue/destinations.js +7 -7
- package/dist/api/queue/destinations.js.map +1 -1
- package/dist/api/queue/dlq.d.ts +70 -2
- package/dist/api/queue/dlq.d.ts.map +1 -1
- package/dist/api/queue/dlq.js +5 -5
- package/dist/api/queue/dlq.js.map +1 -1
- package/dist/api/queue/index.d.ts +9 -9
- package/dist/api/queue/index.d.ts.map +1 -1
- package/dist/api/queue/index.js +11 -11
- package/dist/api/queue/index.js.map +1 -1
- package/dist/api/queue/messages.d.ts +173 -2
- package/dist/api/queue/messages.d.ts.map +1 -1
- package/dist/api/queue/messages.js +10 -10
- package/dist/api/queue/messages.js.map +1 -1
- package/dist/api/queue/queues.d.ts +75 -2
- package/dist/api/queue/queues.d.ts.map +1 -1
- package/dist/api/queue/queues.js +6 -6
- package/dist/api/queue/queues.js.map +1 -1
- package/dist/api/queue/sources.d.ts +72 -2
- package/dist/api/queue/sources.d.ts.map +1 -1
- package/dist/api/queue/sources.js +6 -6
- package/dist/api/queue/sources.js.map +1 -1
- package/dist/api/region/create.d.ts +18 -4
- package/dist/api/region/create.d.ts.map +1 -1
- package/dist/api/region/create.js +5 -5
- package/dist/api/region/create.js.map +1 -1
- package/dist/api/region/delete.d.ts +17 -4
- package/dist/api/region/delete.d.ts.map +1 -1
- package/dist/api/region/delete.js +5 -5
- package/dist/api/region/delete.js.map +1 -1
- package/dist/api/region/list.d.ts +2 -3
- package/dist/api/region/list.d.ts.map +1 -1
- package/dist/api/region/list.js +2 -2
- package/dist/api/region/list.js.map +1 -1
- package/dist/api/region/resources.d.ts +2 -3
- package/dist/api/region/resources.d.ts.map +1 -1
- package/dist/api/region/resources.js +2 -2
- package/dist/api/region/resources.js.map +1 -1
- package/dist/api/sandbox/cli-list.d.ts +98 -0
- package/dist/api/sandbox/cli-list.d.ts.map +1 -0
- package/dist/api/sandbox/cli-list.js +63 -0
- package/dist/api/sandbox/cli-list.js.map +1 -0
- package/dist/api/sandbox/create.d.ts +82 -1
- package/dist/api/sandbox/create.d.ts.map +1 -1
- package/dist/api/sandbox/create.js +14 -10
- package/dist/api/sandbox/create.js.map +1 -1
- package/dist/api/sandbox/destroy.d.ts +9 -1
- package/dist/api/sandbox/destroy.d.ts.map +1 -1
- package/dist/api/sandbox/destroy.js +2 -2
- package/dist/api/sandbox/destroy.js.map +1 -1
- package/dist/api/sandbox/execute.d.ts +49 -1
- package/dist/api/sandbox/execute.d.ts.map +1 -1
- package/dist/api/sandbox/execute.js +4 -4
- package/dist/api/sandbox/execute.js.map +1 -1
- package/dist/api/sandbox/execution.d.ts +104 -1
- package/dist/api/sandbox/execution.d.ts.map +1 -1
- package/dist/api/sandbox/execution.js +5 -5
- package/dist/api/sandbox/execution.js.map +1 -1
- package/dist/api/sandbox/files.d.ts +100 -0
- package/dist/api/sandbox/files.d.ts.map +1 -1
- package/dist/api/sandbox/files.js +16 -16
- package/dist/api/sandbox/files.js.map +1 -1
- package/dist/api/sandbox/get.d.ts +233 -1
- package/dist/api/sandbox/get.d.ts.map +1 -1
- package/dist/api/sandbox/get.js +12 -12
- package/dist/api/sandbox/get.js.map +1 -1
- package/dist/api/sandbox/index.d.ts +25 -21
- package/dist/api/sandbox/index.d.ts.map +1 -1
- package/dist/api/sandbox/index.js +13 -11
- package/dist/api/sandbox/index.js.map +1 -1
- package/dist/api/sandbox/list.d.ts +230 -1
- package/dist/api/sandbox/list.d.ts.map +1 -1
- package/dist/api/sandbox/list.js +9 -9
- package/dist/api/sandbox/list.js.map +1 -1
- package/dist/api/sandbox/resolve.d.ts +82 -0
- package/dist/api/sandbox/resolve.d.ts.map +1 -0
- package/dist/api/sandbox/resolve.js +71 -0
- package/dist/api/sandbox/resolve.js.map +1 -0
- package/dist/api/sandbox/run.d.ts.map +1 -1
- package/dist/api/sandbox/run.js +6 -0
- package/dist/api/sandbox/run.js.map +1 -1
- package/dist/api/sandbox/runtime.d.ts +69 -1
- package/dist/api/sandbox/runtime.d.ts.map +1 -1
- package/dist/api/sandbox/runtime.js +5 -5
- package/dist/api/sandbox/runtime.js.map +1 -1
- package/dist/api/sandbox/snapshot.d.ts +202 -9
- package/dist/api/sandbox/snapshot.d.ts.map +1 -1
- package/dist/api/sandbox/snapshot.js +17 -17
- package/dist/api/sandbox/snapshot.js.map +1 -1
- package/dist/api/session/get.d.ts +123 -8
- package/dist/api/session/get.d.ts.map +1 -1
- package/dist/api/session/get.js +8 -8
- package/dist/api/session/get.js.map +1 -1
- package/dist/api/session/index.d.ts +3 -6
- package/dist/api/session/index.d.ts.map +1 -1
- package/dist/api/session/index.js +3 -3
- package/dist/api/session/index.js.map +1 -1
- package/dist/api/session/list.d.ts +2 -2
- package/dist/api/session/list.d.ts.map +1 -1
- package/dist/api/session/list.js +2 -2
- package/dist/api/session/list.js.map +1 -1
- package/dist/api/session/logs.d.ts +19 -2
- package/dist/api/session/logs.d.ts.map +1 -1
- package/dist/api/session/logs.js +4 -4
- package/dist/api/session/logs.js.map +1 -1
- package/dist/api/stream/get.d.ts +58 -0
- package/dist/api/stream/get.d.ts.map +1 -0
- package/dist/api/stream/get.js +40 -0
- package/dist/api/stream/get.js.map +1 -0
- package/dist/api/stream/index.d.ts +4 -0
- package/dist/api/stream/index.d.ts.map +1 -0
- package/dist/api/stream/index.js +4 -0
- package/dist/api/stream/index.js.map +1 -0
- package/dist/api/stream/list.d.ts +107 -0
- package/dist/api/stream/list.d.ts.map +1 -0
- package/dist/api/stream/list.js +71 -0
- package/dist/api/stream/list.js.map +1 -0
- package/dist/api/stream/util.d.ts +23 -0
- package/dist/api/stream/util.d.ts.map +1 -0
- package/dist/api/stream/util.js +3 -0
- package/dist/api/stream/util.js.map +1 -0
- package/dist/api/thread/delete.d.ts +10 -3
- package/dist/api/thread/delete.d.ts.map +1 -1
- package/dist/api/thread/delete.js +2 -2
- package/dist/api/thread/delete.js.map +1 -1
- package/dist/api/thread/get.d.ts +23 -5
- package/dist/api/thread/get.d.ts.map +1 -1
- package/dist/api/thread/get.js +2 -2
- package/dist/api/thread/get.js.map +1 -1
- package/dist/api/thread/index.d.ts +4 -4
- package/dist/api/thread/index.d.ts.map +1 -1
- package/dist/api/thread/index.js +4 -4
- package/dist/api/thread/index.js.map +1 -1
- package/dist/api/thread/list.d.ts +4 -5
- package/dist/api/thread/list.d.ts.map +1 -1
- package/dist/api/thread/list.js +3 -4
- package/dist/api/thread/list.js.map +1 -1
- package/dist/api/user/whoami.d.ts +6 -3
- package/dist/api/user/whoami.d.ts.map +1 -1
- package/dist/api/user/whoami.js +3 -3
- package/dist/api/user/whoami.js.map +1 -1
- package/package.json +4 -4
- package/src/api/api.ts +23 -2
- package/src/api/apikey/create.ts +2 -2
- package/src/api/apikey/delete.ts +1 -1
- package/src/api/apikey/get.ts +2 -2
- package/src/api/apikey/index.ts +1 -0
- package/src/api/apikey/list.ts +1 -1
- package/src/api/db/index.ts +21 -4
- package/src/api/db/logs.ts +7 -7
- package/src/api/db/query.ts +2 -2
- package/src/api/db/tables.ts +3 -3
- package/src/api/eval/get.ts +3 -3
- package/src/api/eval/index.ts +28 -4
- package/src/api/eval/list.ts +4 -4
- package/src/api/eval/run-get.ts +3 -3
- package/src/api/eval/run-list.ts +4 -4
- package/src/api/index.ts +1 -0
- package/src/api/machine/machine.ts +15 -11
- package/src/api/org/env-delete.ts +4 -4
- package/src/api/org/env-get.ts +3 -3
- package/src/api/org/env-update.ts +4 -4
- package/src/api/org/list.ts +2 -2
- package/src/api/org/resources.ts +4 -4
- package/src/api/project/agent.ts +3 -3
- package/src/api/project/create.ts +5 -5
- package/src/api/project/delete.ts +3 -3
- package/src/api/project/deploy.ts +34 -32
- package/src/api/project/deployment.ts +8 -8
- package/src/api/project/env-delete.ts +12 -8
- package/src/api/project/env-update.ts +4 -4
- package/src/api/project/exists.ts +4 -4
- package/src/api/project/get.ts +5 -5
- package/src/api/project/list.ts +14 -14
- package/src/api/project/malware.ts +12 -12
- package/src/api/project/update-region.ts +3 -3
- package/src/api/queue/analytics.ts +15 -11
- package/src/api/queue/destinations.ts +14 -12
- package/src/api/queue/dlq.ts +10 -10
- package/src/api/queue/index.ts +136 -108
- package/src/api/queue/messages.ts +22 -22
- package/src/api/queue/queues.ts +14 -14
- package/src/api/queue/sources.ts +11 -11
- package/src/api/region/create.ts +5 -5
- package/src/api/region/delete.ts +5 -5
- package/src/api/region/list.ts +2 -2
- package/src/api/region/resources.ts +2 -2
- package/src/api/sandbox/cli-list.ts +99 -0
- package/src/api/sandbox/create.ts +18 -14
- package/src/api/sandbox/destroy.ts +4 -4
- package/src/api/sandbox/execute.ts +6 -6
- package/src/api/sandbox/execution.ts +7 -7
- package/src/api/sandbox/files.ts +16 -16
- package/src/api/sandbox/get.ts +15 -15
- package/src/api/sandbox/index.ts +160 -77
- package/src/api/sandbox/list.ts +12 -12
- package/src/api/sandbox/resolve.ts +98 -0
- package/src/api/sandbox/run.ts +6 -1
- package/src/api/sandbox/runtime.ts +7 -7
- package/src/api/sandbox/snapshot.ts +20 -18
- package/src/api/session/get.ts +13 -13
- package/src/api/session/index.ts +3 -6
- package/src/api/session/list.ts +2 -2
- package/src/api/session/logs.ts +4 -4
- package/src/api/stream/get.ts +51 -0
- package/src/api/stream/index.ts +3 -0
- package/src/api/stream/list.ts +111 -0
- package/src/api/stream/util.ts +3 -0
- package/src/api/thread/delete.ts +4 -4
- package/src/api/thread/get.ts +5 -7
- package/src/api/thread/index.ts +4 -4
- package/src/api/thread/list.ts +4 -6
- package/src/api/user/whoami.ts +3 -3
|
@@ -30,7 +30,7 @@ const BaseFileFields = {
|
|
|
30
30
|
version: z.string().describe('the SHA256 content of the file'),
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
const
|
|
33
|
+
export const BuildEvalSchema = z.object({
|
|
34
34
|
...BaseFileFields,
|
|
35
35
|
id: z.string().describe('the unique calculated id for the eval'),
|
|
36
36
|
identifier: z.string().describe('the unique id for eval for the project across deployments'),
|
|
@@ -47,7 +47,7 @@ const BaseAgentFields = {
|
|
|
47
47
|
projectId: z.string().describe('the project id'),
|
|
48
48
|
name: z.string().describe('the name of the agent'),
|
|
49
49
|
description: z.string().optional().describe('the agent description'),
|
|
50
|
-
evals: z.array(
|
|
50
|
+
evals: z.array(BuildEvalSchema).optional().describe('the evals for the agent'),
|
|
51
51
|
schema: z
|
|
52
52
|
.object({
|
|
53
53
|
input: z.string().optional().describe('JSON schema for input (stringified JSON)'),
|
|
@@ -57,7 +57,7 @@ const BaseAgentFields = {
|
|
|
57
57
|
.describe('input and output JSON schemas for the agent'),
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
const
|
|
60
|
+
export const BuildAgentSchema = z.object({
|
|
61
61
|
...BaseAgentFields,
|
|
62
62
|
});
|
|
63
63
|
|
|
@@ -87,7 +87,7 @@ export const BuildMetadataSchema = z.object({
|
|
|
87
87
|
.describe('input and output JSON schemas for the route'),
|
|
88
88
|
})
|
|
89
89
|
),
|
|
90
|
-
agents: z.array(
|
|
90
|
+
agents: z.array(BuildAgentSchema),
|
|
91
91
|
assets: z.array(
|
|
92
92
|
z.object({
|
|
93
93
|
filename: z.string().describe('the relative path for the file'),
|
|
@@ -168,7 +168,7 @@ export const BuildMetadataSchema = z.object({
|
|
|
168
168
|
|
|
169
169
|
export type BuildMetadata = z.infer<typeof BuildMetadataSchema>;
|
|
170
170
|
|
|
171
|
-
const
|
|
171
|
+
export const CreateProjectDeploymentSchema = z.object({
|
|
172
172
|
id: z.string().describe('the unique id for the deployment'),
|
|
173
173
|
orgId: z.string().describe('the organization id'),
|
|
174
174
|
publicKey: z.string().describe('the public key to use for encrypting the deployment'),
|
|
@@ -178,11 +178,13 @@ const CreateProjectDeployment = z.object({
|
|
|
178
178
|
.describe('the URL for streaming build logs (PUT to write, GET to read)'),
|
|
179
179
|
});
|
|
180
180
|
|
|
181
|
-
const
|
|
181
|
+
export const CreateProjectDeploymentResponseSchema = APIResponseSchema(
|
|
182
|
+
CreateProjectDeploymentSchema
|
|
183
|
+
);
|
|
182
184
|
|
|
183
|
-
type CreateProjectDeploymentPayload = z.infer<typeof
|
|
185
|
+
type CreateProjectDeploymentPayload = z.infer<typeof CreateProjectDeploymentResponseSchema>;
|
|
184
186
|
|
|
185
|
-
export type Deployment = z.infer<typeof
|
|
187
|
+
export type Deployment = z.infer<typeof CreateProjectDeploymentSchema>;
|
|
186
188
|
|
|
187
189
|
/**
|
|
188
190
|
* Create a new project deployment
|
|
@@ -199,7 +201,7 @@ export async function projectDeploymentCreate(
|
|
|
199
201
|
const resp = await client.request<CreateProjectDeploymentPayload>(
|
|
200
202
|
'POST',
|
|
201
203
|
`/cli/deploy/1/start/${projectId}`,
|
|
202
|
-
|
|
204
|
+
CreateProjectDeploymentResponseSchema,
|
|
203
205
|
deploymentConfig ?? {}
|
|
204
206
|
);
|
|
205
207
|
if (resp.success) {
|
|
@@ -208,7 +210,7 @@ export async function projectDeploymentCreate(
|
|
|
208
210
|
throw new ProjectResponseError({ message: resp.message });
|
|
209
211
|
}
|
|
210
212
|
|
|
211
|
-
const
|
|
213
|
+
export const DeploymentInstructionsSchema = z.object({
|
|
212
214
|
deployment: z.string().describe('the url for uploading the encrypted deployment archive'),
|
|
213
215
|
assets: z
|
|
214
216
|
.record(
|
|
@@ -218,10 +220,10 @@ const DeploymentInstructionsObject = z.object({
|
|
|
218
220
|
.describe('the upload metadata for public assets'),
|
|
219
221
|
});
|
|
220
222
|
|
|
221
|
-
const
|
|
223
|
+
export const DeploymentInstructionsResponseSchema = APIResponseSchema(DeploymentInstructionsSchema);
|
|
222
224
|
|
|
223
|
-
type DeploymentInstructionsResponse = z.infer<typeof
|
|
224
|
-
export type DeploymentInstructions = z.infer<typeof
|
|
225
|
+
type DeploymentInstructionsResponse = z.infer<typeof DeploymentInstructionsResponseSchema>;
|
|
226
|
+
export type DeploymentInstructions = z.infer<typeof DeploymentInstructionsSchema>;
|
|
225
227
|
|
|
226
228
|
/**
|
|
227
229
|
* Update the deployment with the build metadata
|
|
@@ -238,7 +240,7 @@ export async function projectDeploymentUpdate(
|
|
|
238
240
|
const resp = await client.request<DeploymentInstructionsResponse, BuildMetadata>(
|
|
239
241
|
'PUT',
|
|
240
242
|
`/cli/deploy/1/start/${deploymentId}`,
|
|
241
|
-
|
|
243
|
+
DeploymentInstructionsResponseSchema,
|
|
242
244
|
deployment,
|
|
243
245
|
BuildMetadataSchema
|
|
244
246
|
);
|
|
@@ -248,7 +250,7 @@ export async function projectDeploymentUpdate(
|
|
|
248
250
|
throw new ProjectResponseError({ message: resp.message });
|
|
249
251
|
}
|
|
250
252
|
|
|
251
|
-
const
|
|
253
|
+
export const DeploymentCompleteSchema = z.object({
|
|
252
254
|
streamId: z.string().optional().describe('the stream id for warmup logs'),
|
|
253
255
|
publicUrls: z
|
|
254
256
|
.object({
|
|
@@ -259,10 +261,10 @@ const DeploymentCompleteObject = z.object({
|
|
|
259
261
|
.describe('the map of public urls'),
|
|
260
262
|
});
|
|
261
263
|
|
|
262
|
-
const
|
|
264
|
+
export const DeploymentCompleteResponseSchema = APIResponseSchema(DeploymentCompleteSchema);
|
|
263
265
|
|
|
264
|
-
type DeploymentCompleteResponse = z.infer<typeof
|
|
265
|
-
export type DeploymentComplete = z.infer<typeof
|
|
266
|
+
type DeploymentCompleteResponse = z.infer<typeof DeploymentCompleteResponseSchema>;
|
|
267
|
+
export type DeploymentComplete = z.infer<typeof DeploymentCompleteSchema>;
|
|
266
268
|
|
|
267
269
|
export const DeploymentStateValue = z.enum([
|
|
268
270
|
'pending',
|
|
@@ -274,14 +276,14 @@ export const DeploymentStateValue = z.enum([
|
|
|
274
276
|
|
|
275
277
|
export type DeploymentState = z.infer<typeof DeploymentStateValue>;
|
|
276
278
|
|
|
277
|
-
const
|
|
279
|
+
export const DeploymentStatusSchema = z.object({
|
|
278
280
|
state: DeploymentStateValue.describe('the current deployment state'),
|
|
279
281
|
});
|
|
280
282
|
|
|
281
|
-
const
|
|
283
|
+
export const DeploymentStatusResponseSchema = APIResponseSchema(DeploymentStatusSchema);
|
|
282
284
|
|
|
283
|
-
type DeploymentStatusResponse = z.infer<typeof
|
|
284
|
-
export type DeploymentStatusResult = z.infer<typeof
|
|
285
|
+
type DeploymentStatusResponse = z.infer<typeof DeploymentStatusResponseSchema>;
|
|
286
|
+
export type DeploymentStatusResult = z.infer<typeof DeploymentStatusSchema>;
|
|
285
287
|
|
|
286
288
|
/**
|
|
287
289
|
* Complete the deployment once build is uploaded
|
|
@@ -297,7 +299,7 @@ export async function projectDeploymentComplete(
|
|
|
297
299
|
const resp = await client.request<DeploymentCompleteResponse>(
|
|
298
300
|
'POST',
|
|
299
301
|
`/cli/deploy/1/complete/${deploymentId}`,
|
|
300
|
-
|
|
302
|
+
DeploymentCompleteResponseSchema
|
|
301
303
|
);
|
|
302
304
|
if (resp.success) {
|
|
303
305
|
return resp.data;
|
|
@@ -321,7 +323,7 @@ export async function projectDeploymentStatus(
|
|
|
321
323
|
const resp = await client.request<DeploymentStatusResponse>(
|
|
322
324
|
'GET',
|
|
323
325
|
`/cli/deploy/1/status/${deploymentId}`,
|
|
324
|
-
|
|
326
|
+
DeploymentStatusResponseSchema
|
|
325
327
|
);
|
|
326
328
|
if (resp.success) {
|
|
327
329
|
return resp.data;
|
|
@@ -359,7 +361,7 @@ export interface DeploymentFailPayload {
|
|
|
359
361
|
diagnostics?: ClientDiagnostics;
|
|
360
362
|
}
|
|
361
363
|
|
|
362
|
-
const ClientDiagnosticsErrorSchema = z.object({
|
|
364
|
+
export const ClientDiagnosticsErrorSchema = z.object({
|
|
363
365
|
type: z.enum(['file', 'general']),
|
|
364
366
|
scope: z.enum(['typescript', 'ast', 'build', 'bundler', 'validation', 'deploy']),
|
|
365
367
|
path: z.string().optional(),
|
|
@@ -369,14 +371,14 @@ const ClientDiagnosticsErrorSchema = z.object({
|
|
|
369
371
|
code: z.string().optional(),
|
|
370
372
|
});
|
|
371
373
|
|
|
372
|
-
const ClientDiagnosticsTimingSchema = z.object({
|
|
374
|
+
export const ClientDiagnosticsTimingSchema = z.object({
|
|
373
375
|
name: z.string(),
|
|
374
376
|
startedAt: z.string(),
|
|
375
377
|
completedAt: z.string(),
|
|
376
378
|
durationMs: z.number(),
|
|
377
379
|
});
|
|
378
380
|
|
|
379
|
-
const ClientDiagnosticsSchema = z.object({
|
|
381
|
+
export const ClientDiagnosticsSchema = z.object({
|
|
380
382
|
success: z.boolean(),
|
|
381
383
|
errors: z.array(ClientDiagnosticsErrorSchema),
|
|
382
384
|
warnings: z.array(ClientDiagnosticsErrorSchema),
|
|
@@ -384,17 +386,17 @@ const ClientDiagnosticsSchema = z.object({
|
|
|
384
386
|
error: z.string().optional(),
|
|
385
387
|
});
|
|
386
388
|
|
|
387
|
-
const DeploymentFailPayloadSchema = z.object({
|
|
389
|
+
export const DeploymentFailPayloadSchema = z.object({
|
|
388
390
|
error: z.string().optional(),
|
|
389
391
|
diagnostics: ClientDiagnosticsSchema.optional(),
|
|
390
392
|
});
|
|
391
393
|
|
|
392
|
-
const
|
|
394
|
+
export const DeploymentFailResponseSchema = z.object({
|
|
393
395
|
state: z.literal('failed'),
|
|
394
396
|
});
|
|
395
397
|
|
|
396
|
-
const
|
|
397
|
-
type DeploymentFailResponse = z.infer<typeof
|
|
398
|
+
export const DeploymentFailAPIResponseSchema = APIResponseSchema(DeploymentFailResponseSchema);
|
|
399
|
+
type DeploymentFailResponse = z.infer<typeof DeploymentFailAPIResponseSchema>;
|
|
398
400
|
|
|
399
401
|
/**
|
|
400
402
|
* Report a deployment failure from the client
|
|
@@ -412,7 +414,7 @@ export async function projectDeploymentFail(
|
|
|
412
414
|
const resp = await client.request<DeploymentFailResponse, DeploymentFailPayload>(
|
|
413
415
|
'POST',
|
|
414
416
|
`/cli/deploy/1/fail/${deploymentId}`,
|
|
415
|
-
|
|
417
|
+
DeploymentFailAPIResponseSchema,
|
|
416
418
|
payload,
|
|
417
419
|
DeploymentFailPayloadSchema
|
|
418
420
|
);
|
|
@@ -3,7 +3,7 @@ import { type APIClient, APIResponseSchema, APIResponseSchemaOptionalData } from
|
|
|
3
3
|
import { ProjectResponseError } from './util';
|
|
4
4
|
|
|
5
5
|
// Simplified metadata schema for the client
|
|
6
|
-
const DeploymentMetadataSchema = z.object({
|
|
6
|
+
export const DeploymentMetadataSchema = z.object({
|
|
7
7
|
git: z
|
|
8
8
|
.object({
|
|
9
9
|
repo: z.string().optional(),
|
|
@@ -35,7 +35,7 @@ const DeploymentMetadataSchema = z.object({
|
|
|
35
35
|
.optional(),
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
const DeploymentSchema = z.object({
|
|
38
|
+
export const DeploymentSchema = z.object({
|
|
39
39
|
id: z.string(),
|
|
40
40
|
state: z.string().optional(),
|
|
41
41
|
message: z.string().nullable().optional(),
|
|
@@ -53,9 +53,9 @@ const DeploymentSchema = z.object({
|
|
|
53
53
|
dnsRecords: z.array(z.string()).optional(),
|
|
54
54
|
});
|
|
55
55
|
|
|
56
|
-
const DeploymentListResponseSchema = APIResponseSchema(z.array(DeploymentSchema));
|
|
57
|
-
const DeploymentGetResponseSchema = APIResponseSchema(DeploymentSchema);
|
|
58
|
-
const DeploymentActionResponseSchema = APIResponseSchemaOptionalData(
|
|
56
|
+
export const DeploymentListResponseSchema = APIResponseSchema(z.array(DeploymentSchema));
|
|
57
|
+
export const DeploymentGetResponseSchema = APIResponseSchema(DeploymentSchema);
|
|
58
|
+
export const DeploymentActionResponseSchema = APIResponseSchemaOptionalData(
|
|
59
59
|
z.object({ activeDeploymentId: z.string().optional() })
|
|
60
60
|
);
|
|
61
61
|
|
|
@@ -91,7 +91,7 @@ export async function projectDeploymentGet(
|
|
|
91
91
|
throw new ProjectResponseError({ message: resp.message });
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
const DeploymentLookupSchema = z.object({
|
|
94
|
+
export const DeploymentLookupSchema = z.object({
|
|
95
95
|
id: z.string(),
|
|
96
96
|
projectId: z.string(),
|
|
97
97
|
orgId: z.string(),
|
|
@@ -100,7 +100,7 @@ const DeploymentLookupSchema = z.object({
|
|
|
100
100
|
active: z.boolean(),
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
-
const DeploymentLookupResponseSchema = APIResponseSchema(DeploymentLookupSchema);
|
|
103
|
+
export const DeploymentLookupResponseSchema = APIResponseSchema(DeploymentLookupSchema);
|
|
104
104
|
|
|
105
105
|
export type DeploymentLookup = z.infer<typeof DeploymentLookupSchema>;
|
|
106
106
|
|
|
@@ -171,7 +171,7 @@ export const DeploymentLogSchema = z.object({
|
|
|
171
171
|
serviceName: z.string(),
|
|
172
172
|
});
|
|
173
173
|
|
|
174
|
-
const DeploymentLogsResponseSchema = APIResponseSchema(z.array(DeploymentLogSchema));
|
|
174
|
+
export const DeploymentLogsResponseSchema = APIResponseSchema(z.array(DeploymentLogSchema));
|
|
175
175
|
|
|
176
176
|
export type DeploymentLog = z.infer<typeof DeploymentLogSchema>;
|
|
177
177
|
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { APIClient, APIResponseSchemaNoData } from '../api';
|
|
2
|
+
import { type APIClient, APIResponseSchemaNoData } from '../api';
|
|
3
3
|
import { ProjectResponseError } from './util';
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
export const ProjectEnvDeleteRequestSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
id: z.string().describe('the project id'),
|
|
8
|
+
env: z.array(z.string()).optional().describe('environment variable keys to delete'),
|
|
9
|
+
secrets: z.array(z.string()).optional().describe('secret keys to delete'),
|
|
10
|
+
})
|
|
11
|
+
.refine((data) => (data.env?.length ?? 0) > 0 || (data.secrets?.length ?? 0) > 0, {
|
|
12
|
+
message: 'must provide at least one of env or secrets',
|
|
13
|
+
});
|
|
10
14
|
|
|
11
|
-
const ProjectEnvDeleteResponseSchema = APIResponseSchemaNoData();
|
|
15
|
+
export const ProjectEnvDeleteResponseSchema = APIResponseSchemaNoData();
|
|
12
16
|
|
|
13
|
-
type ProjectEnvDeleteRequest = z.infer<typeof
|
|
17
|
+
type ProjectEnvDeleteRequest = z.infer<typeof ProjectEnvDeleteRequestSchema>;
|
|
14
18
|
type ProjectEnvDeleteResponse = z.infer<typeof ProjectEnvDeleteResponseSchema>;
|
|
15
19
|
|
|
16
20
|
/**
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { APIClient, APIResponseSchema } from '../api';
|
|
2
|
+
import { type APIClient, APIResponseSchema } from '../api';
|
|
3
3
|
import type { Project } from './get';
|
|
4
4
|
import { projectGet } from './get';
|
|
5
5
|
import { ProjectResponseError } from './util';
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
export const ProjectEnvUpdateRequestSchema = z.object({
|
|
8
8
|
id: z.string().describe('the project id'),
|
|
9
9
|
env: z.record(z.string(), z.string()).optional().describe('environment variables to set/update'),
|
|
10
10
|
secrets: z.record(z.string(), z.string()).optional().describe('secrets to set/update'),
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
const ProjectEnvUpdateResponseSchema = APIResponseSchema(
|
|
13
|
+
export const ProjectEnvUpdateResponseSchema = APIResponseSchema(
|
|
14
14
|
z
|
|
15
15
|
.object({
|
|
16
16
|
id: z.string().describe('the project id'),
|
|
@@ -22,7 +22,7 @@ const ProjectEnvUpdateResponseSchema = APIResponseSchema(
|
|
|
22
22
|
.optional()
|
|
23
23
|
);
|
|
24
24
|
|
|
25
|
-
type ProjectEnvUpdateRequest = z.infer<typeof
|
|
25
|
+
type ProjectEnvUpdateRequest = z.infer<typeof ProjectEnvUpdateRequestSchema>;
|
|
26
26
|
type ProjectEnvUpdateResponse = z.infer<typeof ProjectEnvUpdateResponseSchema>;
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { APIClient,
|
|
2
|
+
import { type APIClient, APIError, APIResponseSchema } from '../api';
|
|
3
3
|
import { ProjectResponseError } from './util';
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
export const ProjectExistsRequestSchema = z.object({
|
|
6
6
|
name: z.string().max(255).min(1).describe('the name of the new project'),
|
|
7
7
|
organization_id: z
|
|
8
8
|
.string()
|
|
@@ -11,9 +11,9 @@ const _ProjectExistsRequestSchema = z.object({
|
|
|
11
11
|
.describe('the organization id to create the project in'),
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
const ProjectExistsResponseSchema = APIResponseSchema(z.boolean());
|
|
14
|
+
export const ProjectExistsResponseSchema = APIResponseSchema(z.boolean());
|
|
15
15
|
|
|
16
|
-
export type ProjectExistsRequest = z.infer<typeof
|
|
16
|
+
export type ProjectExistsRequest = z.infer<typeof ProjectExistsRequestSchema>;
|
|
17
17
|
export type ProjectExistsResponse = z.infer<typeof ProjectExistsResponseSchema>;
|
|
18
18
|
|
|
19
19
|
/**
|
package/src/api/project/get.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { APIClient, APIResponseSchema } from '../api';
|
|
2
|
+
import { type APIClient, APIResponseSchema } from '../api';
|
|
3
3
|
import { ProjectResponseError } from './util';
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
export const ProjectGetRequestSchema = z.object({
|
|
6
6
|
id: z.string().describe('the project id'),
|
|
7
7
|
mask: z.boolean().default(true).optional().describe('if the secrets should be returned masked'),
|
|
8
8
|
keys: z.boolean().default(true).optional().describe('if the project keys should be returned'),
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
const ProjectSchema = z.object({
|
|
11
|
+
export const ProjectSchema = z.object({
|
|
12
12
|
id: z.string().describe('the project id'),
|
|
13
13
|
name: z.string().describe('the project name'),
|
|
14
14
|
description: z.string().nullable().optional().describe('the project description'),
|
|
@@ -20,9 +20,9 @@ const ProjectSchema = z.object({
|
|
|
20
20
|
secrets: z.record(z.string(), z.string()).optional().describe('the secrets key/values'),
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
const ProjectGetResponseSchema = APIResponseSchema(ProjectSchema);
|
|
23
|
+
export const ProjectGetResponseSchema = APIResponseSchema(ProjectSchema);
|
|
24
24
|
|
|
25
|
-
type ProjectGetRequest = z.infer<typeof
|
|
25
|
+
type ProjectGetRequest = z.infer<typeof ProjectGetRequestSchema>;
|
|
26
26
|
type ProjectGetResponse = z.infer<typeof ProjectGetResponseSchema>;
|
|
27
27
|
|
|
28
28
|
export type Project = z.infer<typeof ProjectSchema>;
|
package/src/api/project/list.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { APIClient, APIResponseSchema } from '../api';
|
|
2
|
+
import { type APIClient, APIResponseSchema } from '../api';
|
|
3
3
|
import { ProjectResponseError } from './util';
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
z.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
})
|
|
15
|
-
);
|
|
5
|
+
export const ProjectListItemSchema = z.object({
|
|
6
|
+
id: z.string().describe('the project id'),
|
|
7
|
+
name: z.string().describe('the project name'),
|
|
8
|
+
description: z.string().optional().describe('the project description'),
|
|
9
|
+
orgId: z.string().describe('the organization id that this project is registered with'),
|
|
10
|
+
orgName: z.string().describe('the organization name'),
|
|
11
|
+
cloudRegion: z.string().nullable().optional().describe('the cloud region'),
|
|
12
|
+
latestDeploymentId: z.string().nullable().describe('the latest deployment id'),
|
|
13
|
+
});
|
|
16
14
|
|
|
17
|
-
const
|
|
15
|
+
export const ProjectListSchema = z.array(ProjectListItemSchema);
|
|
16
|
+
|
|
17
|
+
export const ProjectListResponseSchema = APIResponseSchema(ProjectListSchema);
|
|
18
18
|
|
|
19
19
|
export type ProjectListResponse = z.infer<typeof ProjectListResponseSchema>;
|
|
20
|
-
export type ProjectList = z.infer<typeof
|
|
20
|
+
export type ProjectList = z.infer<typeof ProjectListSchema>;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* List all projects
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { type APIClient, APIResponseSchema } from '../api';
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
export const PackageRefSchema = z.object({
|
|
5
5
|
name: z.string(),
|
|
6
6
|
version: z.string(),
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
export type PackageRef = z.infer<typeof
|
|
9
|
+
export type PackageRef = z.infer<typeof PackageRefSchema>;
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
export const MalwareFindingSchema = z.object({
|
|
12
12
|
name: z.string(),
|
|
13
13
|
version: z.string(),
|
|
14
14
|
reason: z.string(),
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
export type MalwareFinding = z.infer<typeof
|
|
17
|
+
export type MalwareFinding = z.infer<typeof MalwareFindingSchema>;
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
export const MalwareCheckSummarySchema = z.object({
|
|
20
20
|
scanned: z.number(),
|
|
21
21
|
flagged: z.number(),
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
const
|
|
24
|
+
export const MalwareCheckListMetadataSchema = z.object({
|
|
25
25
|
fetchedAt: z.string(),
|
|
26
26
|
count: z.number(),
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
const
|
|
29
|
+
export const MalwareCheckResultSchema = z.object({
|
|
30
30
|
action: z.enum(['allow', 'block']),
|
|
31
|
-
summary:
|
|
32
|
-
findings: z.array(
|
|
33
|
-
list:
|
|
31
|
+
summary: MalwareCheckSummarySchema,
|
|
32
|
+
findings: z.array(MalwareFindingSchema),
|
|
33
|
+
list: MalwareCheckListMetadataSchema.optional(),
|
|
34
34
|
error: z.string().optional(),
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
const MalwareCheckResponseSchema = APIResponseSchema(
|
|
37
|
+
export const MalwareCheckResponseSchema = APIResponseSchema(MalwareCheckResultSchema);
|
|
38
38
|
|
|
39
|
-
export type MalwareCheckResult = z.infer<typeof
|
|
39
|
+
export type MalwareCheckResult = z.infer<typeof MalwareCheckResultSchema>;
|
|
40
40
|
|
|
41
41
|
export async function projectDeploymentMalwareCheck(
|
|
42
42
|
client: APIClient,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { APIClient, APIResponseSchema } from '../api';
|
|
2
|
+
import { type APIClient, APIResponseSchema } from '../api';
|
|
3
3
|
import { ProjectResponseError } from './util';
|
|
4
4
|
|
|
5
|
-
const UpdateRegionRequestSchema = z.object({
|
|
5
|
+
export const UpdateRegionRequestSchema = z.object({
|
|
6
6
|
cloudRegion: z.string().describe('the cloud region to update the project to'),
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
const UpdateRegionResponseSchema = APIResponseSchema(
|
|
9
|
+
export const UpdateRegionResponseSchema = APIResponseSchema(
|
|
10
10
|
z.object({
|
|
11
11
|
id: z.string().describe('the project id'),
|
|
12
12
|
})
|
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { APIClient, APIResponseSchema } from '../api';
|
|
2
|
+
import { type APIClient, APIResponseSchema } from '../api';
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
QueueAnalyticsSchema,
|
|
6
|
-
TimeSeriesDataSchema,
|
|
7
|
-
SSEStatsEventSchema,
|
|
4
|
+
type AnalyticsOptions,
|
|
8
5
|
type OrgAnalytics,
|
|
6
|
+
OrgAnalyticsSchema,
|
|
9
7
|
type QueueAnalytics,
|
|
10
|
-
|
|
8
|
+
QueueAnalyticsSchema,
|
|
11
9
|
type SSEStatsEvent,
|
|
12
|
-
|
|
10
|
+
SSEStatsEventSchema,
|
|
13
11
|
type StreamAnalyticsOptions,
|
|
12
|
+
type TimeSeriesData,
|
|
13
|
+
TimeSeriesDataSchema,
|
|
14
14
|
} from './types';
|
|
15
|
-
import { QueueError, QueueNotFoundError, queueApiPathWithQuery
|
|
15
|
+
import { buildQueueHeaders, QueueError, QueueNotFoundError, queueApiPathWithQuery } from './util';
|
|
16
16
|
import { validateQueueName } from './validation';
|
|
17
17
|
|
|
18
|
-
const OrgAnalyticsResponseSchema = APIResponseSchema(
|
|
19
|
-
|
|
18
|
+
export const OrgAnalyticsResponseSchema = APIResponseSchema(
|
|
19
|
+
z.object({ analytics: OrgAnalyticsSchema })
|
|
20
|
+
);
|
|
21
|
+
export const QueueAnalyticsResponseSchema = APIResponseSchema(
|
|
20
22
|
z.object({ analytics: QueueAnalyticsSchema })
|
|
21
23
|
);
|
|
22
|
-
const TimeSeriesResponseSchema = APIResponseSchema(
|
|
24
|
+
export const TimeSeriesResponseSchema = APIResponseSchema(
|
|
25
|
+
z.object({ timeseries: TimeSeriesDataSchema })
|
|
26
|
+
);
|
|
23
27
|
|
|
24
28
|
/**
|
|
25
29
|
* Build query string from analytics options.
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { APIClient, APIResponseSchema, APIResponseSchemaNoData
|
|
2
|
+
import { type APIClient, APIError, APIResponseSchema, APIResponseSchemaNoData } from '../api';
|
|
3
3
|
import {
|
|
4
|
-
DestinationSchema,
|
|
5
|
-
type Destination,
|
|
6
4
|
type CreateDestinationRequest,
|
|
7
|
-
type UpdateDestinationRequest,
|
|
8
|
-
type QueueApiOptions,
|
|
9
5
|
CreateDestinationRequestSchema,
|
|
6
|
+
type Destination,
|
|
7
|
+
DestinationSchema,
|
|
8
|
+
type QueueApiOptions,
|
|
9
|
+
type UpdateDestinationRequest,
|
|
10
10
|
UpdateDestinationRequestSchema,
|
|
11
11
|
} from './types';
|
|
12
12
|
import {
|
|
13
|
+
buildQueueHeaders,
|
|
14
|
+
DestinationAlreadyExistsError,
|
|
15
|
+
DestinationNotFoundError,
|
|
13
16
|
QueueError,
|
|
14
17
|
QueueNotFoundError,
|
|
15
|
-
DestinationNotFoundError,
|
|
16
|
-
DestinationAlreadyExistsError,
|
|
17
18
|
queueApiPath,
|
|
18
|
-
buildQueueHeaders,
|
|
19
19
|
} from './util';
|
|
20
|
-
import {
|
|
20
|
+
import { validateDestinationConfig, validateDestinationId, validateQueueName } from './validation';
|
|
21
21
|
|
|
22
|
-
const DestinationResponseSchema = APIResponseSchema(
|
|
23
|
-
|
|
22
|
+
export const DestinationResponseSchema = APIResponseSchema(
|
|
23
|
+
z.object({ destination: DestinationSchema })
|
|
24
|
+
);
|
|
25
|
+
export const DestinationsListResponseSchema = APIResponseSchema(
|
|
24
26
|
z.object({
|
|
25
27
|
destinations: z.array(DestinationSchema),
|
|
26
28
|
})
|
|
27
29
|
);
|
|
28
|
-
const DeleteDestinationResponseSchema = APIResponseSchemaNoData();
|
|
30
|
+
export const DeleteDestinationResponseSchema = APIResponseSchemaNoData();
|
|
29
31
|
|
|
30
32
|
/**
|
|
31
33
|
* Create a destination for a queue.
|
package/src/api/queue/dlq.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { APIClient, APIResponseSchema, APIResponseSchemaNoData } from '../api';
|
|
2
|
+
import { type APIClient, APIResponseSchema, APIResponseSchemaNoData } from '../api';
|
|
3
3
|
import {
|
|
4
|
-
DeadLetterMessageSchema,
|
|
5
|
-
MessageSchema,
|
|
6
4
|
type DeadLetterMessage,
|
|
7
|
-
|
|
5
|
+
DeadLetterMessageSchema,
|
|
8
6
|
type ListDlqRequest,
|
|
7
|
+
type Message,
|
|
8
|
+
MessageSchema,
|
|
9
9
|
type QueueApiOptions,
|
|
10
10
|
} from './types';
|
|
11
11
|
import {
|
|
12
|
+
buildQueueHeaders,
|
|
13
|
+
MessageNotFoundError,
|
|
12
14
|
QueueError,
|
|
13
15
|
QueueNotFoundError,
|
|
14
|
-
MessageNotFoundError,
|
|
15
16
|
queueApiPath,
|
|
16
17
|
queueApiPathWithQuery,
|
|
17
|
-
buildQueueHeaders,
|
|
18
18
|
} from './util';
|
|
19
|
-
import {
|
|
19
|
+
import { validateLimit, validateMessageId, validateOffset, validateQueueName } from './validation';
|
|
20
20
|
|
|
21
|
-
const DlqListResponseSchema = APIResponseSchema(
|
|
21
|
+
export const DlqListResponseSchema = APIResponseSchema(
|
|
22
22
|
z.object({
|
|
23
23
|
messages: z.array(DeadLetterMessageSchema),
|
|
24
24
|
total: z.number().optional(),
|
|
25
25
|
})
|
|
26
26
|
);
|
|
27
|
-
const ReplayDlqResponseSchema = APIResponseSchema(z.object({ message: MessageSchema }));
|
|
28
|
-
const DeleteDlqResponseSchema = APIResponseSchemaNoData();
|
|
27
|
+
export const ReplayDlqResponseSchema = APIResponseSchema(z.object({ message: MessageSchema }));
|
|
28
|
+
export const DeleteDlqResponseSchema = APIResponseSchemaNoData();
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* List messages in the dead letter queue.
|