@agentuity/server 1.0.0 → 1.0.2
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 +16 -4
- 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 +3 -3
- package/dist/api/db/index.d.ts.map +1 -1
- package/dist/api/db/index.js +3 -3
- package/dist/api/db/index.js.map +1 -1
- package/dist/api/db/logs.d.ts +14 -2
- 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 +1 -1
- package/dist/api/db/tables.d.ts.map +1 -1
- package/dist/api/db/tables.js +1 -1
- package/dist/api/db/tables.js.map +1 -1
- package/dist/api/eval/get.d.ts +1 -2
- package/dist/api/eval/get.d.ts.map +1 -1
- package/dist/api/eval/get.js +1 -1
- 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 +12 -2
- package/dist/api/eval/list.d.ts.map +1 -1
- package/dist/api/eval/list.js +2 -2
- package/dist/api/eval/list.js.map +1 -1
- package/dist/api/eval/run-get.d.ts +1 -2
- package/dist/api/eval/run-get.d.ts.map +1 -1
- package/dist/api/eval/run-get.js +1 -1
- package/dist/api/eval/run-get.js.map +1 -1
- package/dist/api/eval/run-list.d.ts +18 -2
- package/dist/api/eval/run-list.d.ts.map +1 -1
- package/dist/api/eval/run-list.js +2 -2
- 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 +1 -2
- package/dist/api/project/agent.d.ts.map +1 -1
- package/dist/api/project/agent.js +1 -1
- package/dist/api/project/agent.js.map +1 -1
- package/dist/api/project/create.d.ts +3 -3
- 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 +4 -0
- package/dist/api/project/delete.d.ts.map +1 -1
- package/dist/api/project/delete.js +1 -1
- package/dist/api/project/delete.js.map +1 -1
- package/dist/api/project/deploy.d.ts +168 -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 +27 -3
- package/dist/api/project/deployment.d.ts.map +1 -1
- package/dist/api/project/deployment.js +3 -3
- package/dist/api/project/deployment.js.map +1 -1
- package/dist/api/project/env-delete.d.ts +2 -2
- package/dist/api/project/env-delete.d.ts.map +1 -1
- package/dist/api/project/env-delete.js +5 -1
- package/dist/api/project/env-delete.js.map +1 -1
- package/dist/api/project/env-update.d.ts +2 -2
- package/dist/api/project/env-update.d.ts.map +1 -1
- package/dist/api/project/env-update.js +1 -1
- package/dist/api/project/env-update.js.map +1 -1
- package/dist/api/project/exists.d.ts +2 -2
- package/dist/api/project/exists.d.ts.map +1 -1
- package/dist/api/project/exists.js +1 -1
- package/dist/api/project/exists.js.map +1 -1
- package/dist/api/project/get.d.ts +3 -3
- package/dist/api/project/get.d.ts.map +1 -1
- package/dist/api/project/get.js +2 -2
- package/dist/api/project/get.js.map +1 -1
- package/dist/api/project/list.d.ts +11 -2
- 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 +14 -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 +4 -0
- package/dist/api/project/update-region.d.ts.map +1 -1
- package/dist/api/project/update-region.js +1 -1
- package/dist/api/project/update-region.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 +99 -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/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/index.d.ts +5 -1
- package/dist/api/sandbox/index.d.ts.map +1 -1
- package/dist/api/sandbox/index.js +3 -1
- package/dist/api/sandbox/index.js.map +1 -1
- package/dist/api/sandbox/resolve.d.ts +52 -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/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 +59 -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 +108 -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 +25 -4
- 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 +17 -2
- package/src/api/db/logs.ts +6 -6
- package/src/api/db/query.ts +2 -2
- package/src/api/db/tables.ts +1 -1
- package/src/api/eval/get.ts +1 -1
- package/src/api/eval/index.ts +16 -4
- package/src/api/eval/list.ts +2 -2
- package/src/api/eval/run-get.ts +1 -1
- package/src/api/eval/run-list.ts +2 -2
- 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 +1 -1
- package/src/api/project/create.ts +4 -4
- package/src/api/project/delete.ts +1 -1
- package/src/api/project/deploy.ts +32 -32
- package/src/api/project/deployment.ts +3 -3
- package/src/api/project/env-delete.ts +10 -6
- package/src/api/project/env-update.ts +2 -2
- package/src/api/project/exists.ts +2 -2
- package/src/api/project/get.ts +3 -3
- package/src/api/project/list.ts +13 -13
- package/src/api/project/malware.ts +12 -12
- package/src/api/project/update-region.ts +1 -1
- 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/files.ts +16 -16
- package/src/api/sandbox/index.ts +21 -0
- package/src/api/sandbox/resolve.ts +98 -0
- package/src/api/sandbox/run.ts +6 -1
- 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
|
@@ -5,7 +5,7 @@ import { MachineResponseError } from './util';
|
|
|
5
5
|
// TODO: The old /cli/auth/machine/* endpoints should be aliased to redirect
|
|
6
6
|
// to /cli/auth/org/* in the backend (app repo). Remove aliases in follow-up PR.
|
|
7
7
|
|
|
8
|
-
const MachineSchema = z.object({
|
|
8
|
+
export const MachineSchema = z.object({
|
|
9
9
|
id: z.string(),
|
|
10
10
|
instanceId: z.string().nullable().optional(),
|
|
11
11
|
privateIPv4: z.string().nullable().optional(),
|
|
@@ -28,9 +28,9 @@ const MachineSchema = z.object({
|
|
|
28
28
|
metadata: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
const MachineListResponseSchema = APIResponseSchema(z.array(MachineSchema));
|
|
32
|
-
const MachineGetResponseSchema = APIResponseSchema(MachineSchema);
|
|
33
|
-
const MachineDeleteResponseSchema = APIResponseSchemaNoData();
|
|
31
|
+
export const MachineListResponseSchema = APIResponseSchema(z.array(MachineSchema));
|
|
32
|
+
export const MachineGetResponseSchema = APIResponseSchema(MachineSchema);
|
|
33
|
+
export const MachineDeleteResponseSchema = APIResponseSchemaNoData();
|
|
34
34
|
|
|
35
35
|
export type Machine = z.infer<typeof MachineSchema>;
|
|
36
36
|
|
|
@@ -57,20 +57,24 @@ export async function machineDelete(client: APIClient, machineId: string): Promi
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
const MachineDeploymentProjectSchema = z.object({
|
|
60
|
+
export const MachineDeploymentProjectSchema = z.object({
|
|
61
61
|
id: z.string(),
|
|
62
62
|
name: z.string(),
|
|
63
63
|
identifier: z.string(),
|
|
64
64
|
domains: z.array(z.string()),
|
|
65
65
|
});
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
export type MachineDeploymentProject = z.infer<typeof MachineDeploymentProjectSchema>;
|
|
68
|
+
|
|
69
|
+
export const MachineDeploymentResourcesSchema = z.object({
|
|
68
70
|
cpuUnits: z.number(),
|
|
69
71
|
memoryUnits: z.number(),
|
|
70
72
|
diskUnits: z.number(),
|
|
71
73
|
});
|
|
72
74
|
|
|
73
|
-
|
|
75
|
+
export type MachineDeploymentResources = z.infer<typeof MachineDeploymentResourcesSchema>;
|
|
76
|
+
|
|
77
|
+
export const MachineDeploymentSchema = z.object({
|
|
74
78
|
id: z.string(),
|
|
75
79
|
identifier: z.string().optional(),
|
|
76
80
|
state: z.string().optional(),
|
|
@@ -82,7 +86,7 @@ const MachineDeploymentSchema = z.object({
|
|
|
82
86
|
domainSuffix: z.string(),
|
|
83
87
|
});
|
|
84
88
|
|
|
85
|
-
const MachineDeploymentsResponseSchema = APIResponseSchema(z.array(MachineDeploymentSchema));
|
|
89
|
+
export const MachineDeploymentsResponseSchema = APIResponseSchema(z.array(MachineDeploymentSchema));
|
|
86
90
|
|
|
87
91
|
export type MachineDeployment = z.infer<typeof MachineDeploymentSchema>;
|
|
88
92
|
|
|
@@ -100,7 +104,7 @@ export async function machineDeployments(
|
|
|
100
104
|
throw new MachineResponseError({ message: resp.message });
|
|
101
105
|
}
|
|
102
106
|
|
|
103
|
-
const OrgAuthEnrollResponseSchema = APIResponseSchema(
|
|
107
|
+
export const OrgAuthEnrollResponseSchema = APIResponseSchema(
|
|
104
108
|
z.object({
|
|
105
109
|
orgId: z.string(),
|
|
106
110
|
})
|
|
@@ -122,7 +126,7 @@ export async function orgAuthEnroll(
|
|
|
122
126
|
throw new MachineResponseError({ message: resp.message });
|
|
123
127
|
}
|
|
124
128
|
|
|
125
|
-
const OrgAuthStatusResponseSchema = APIResponseSchema(
|
|
129
|
+
export const OrgAuthStatusResponseSchema = APIResponseSchema(
|
|
126
130
|
z.object({
|
|
127
131
|
publicKey: z.string().nullable(),
|
|
128
132
|
})
|
|
@@ -139,7 +143,7 @@ export async function orgAuthStatus(
|
|
|
139
143
|
throw new MachineResponseError({ message: resp.message });
|
|
140
144
|
}
|
|
141
145
|
|
|
142
|
-
const OrgAuthUnenrollResponseSchema = APIResponseSchemaNoData();
|
|
146
|
+
export const OrgAuthUnenrollResponseSchema = APIResponseSchemaNoData();
|
|
143
147
|
|
|
144
148
|
export async function orgAuthUnenroll(client: APIClient, orgId: string): Promise<void> {
|
|
145
149
|
const resp = await client.delete(
|
|
@@ -2,16 +2,16 @@ import { z } from 'zod';
|
|
|
2
2
|
import { APIClient, APIResponseSchemaNoData } from '../api';
|
|
3
3
|
import { OrgResponseError } from './util';
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
export const OrgEnvDeleteRequestSchema = z.object({
|
|
6
6
|
id: z.string().describe('the organization id'),
|
|
7
7
|
env: z.array(z.string()).optional().describe('environment variable keys to delete'),
|
|
8
8
|
secrets: z.array(z.string()).optional().describe('secret keys to delete'),
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
const OrgEnvDeleteResponseSchema = APIResponseSchemaNoData();
|
|
11
|
+
export const OrgEnvDeleteResponseSchema = APIResponseSchemaNoData();
|
|
12
12
|
|
|
13
|
-
type OrgEnvDeleteRequest = z.infer<typeof
|
|
14
|
-
type OrgEnvDeleteResponse = z.infer<typeof OrgEnvDeleteResponseSchema>;
|
|
13
|
+
export type OrgEnvDeleteRequest = z.infer<typeof OrgEnvDeleteRequestSchema>;
|
|
14
|
+
export type OrgEnvDeleteResponse = z.infer<typeof OrgEnvDeleteResponseSchema>;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Delete environment variables and/or secrets from an organization.
|
package/src/api/org/env-get.ts
CHANGED
|
@@ -2,19 +2,19 @@ import { z } from 'zod';
|
|
|
2
2
|
import { APIClient, APIResponseSchema } from '../api';
|
|
3
3
|
import { OrgResponseError } from './util';
|
|
4
4
|
|
|
5
|
-
const OrgEnvDataSchema = z.object({
|
|
5
|
+
export const OrgEnvDataSchema = z.object({
|
|
6
6
|
id: z.string().describe('the organization id'),
|
|
7
7
|
env: z.record(z.string(), z.string()).optional().describe('environment variables'),
|
|
8
8
|
secrets: z.record(z.string(), z.string()).optional().describe('secrets (may be masked)'),
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
const OrgEnvGetResponseSchema = APIResponseSchema(OrgEnvDataSchema);
|
|
11
|
+
export const OrgEnvGetResponseSchema = APIResponseSchema(OrgEnvDataSchema);
|
|
12
12
|
|
|
13
13
|
interface OrgEnvGetRequest {
|
|
14
14
|
id: string;
|
|
15
15
|
mask?: boolean;
|
|
16
16
|
}
|
|
17
|
-
type OrgEnvGetResponse = z.infer<typeof OrgEnvGetResponseSchema>;
|
|
17
|
+
export type OrgEnvGetResponse = z.infer<typeof OrgEnvGetResponseSchema>;
|
|
18
18
|
|
|
19
19
|
export type OrgEnv = z.infer<typeof OrgEnvDataSchema>;
|
|
20
20
|
|
|
@@ -2,16 +2,16 @@ import { z } from 'zod';
|
|
|
2
2
|
import { APIClient, APIResponseSchemaNoData } from '../api';
|
|
3
3
|
import { OrgResponseError } from './util';
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
export const OrgEnvUpdateRequestSchema = z.object({
|
|
6
6
|
id: z.string().describe('the organization id'),
|
|
7
7
|
env: z.record(z.string(), z.string()).optional().describe('environment variables to set/update'),
|
|
8
8
|
secrets: z.record(z.string(), z.string()).optional().describe('secrets to set/update'),
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
const OrgEnvUpdateResponseSchema = APIResponseSchemaNoData();
|
|
11
|
+
export const OrgEnvUpdateResponseSchema = APIResponseSchemaNoData();
|
|
12
12
|
|
|
13
|
-
type OrgEnvUpdateRequest = z.infer<typeof
|
|
14
|
-
type OrgEnvUpdateResponse = z.infer<typeof OrgEnvUpdateResponseSchema>;
|
|
13
|
+
export type OrgEnvUpdateRequest = z.infer<typeof OrgEnvUpdateRequestSchema>;
|
|
14
|
+
export type OrgEnvUpdateResponse = z.infer<typeof OrgEnvUpdateResponseSchema>;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Update environment variables and/or secrets for an organization.
|
package/src/api/org/list.ts
CHANGED
|
@@ -2,13 +2,13 @@ import { z } from 'zod';
|
|
|
2
2
|
import { APIResponseSchema, APIClient } from '../api';
|
|
3
3
|
import { OrgResponseError } from './util';
|
|
4
4
|
|
|
5
|
-
const ListOrganizationsResponse = z.array(
|
|
5
|
+
export const ListOrganizationsResponse = z.array(
|
|
6
6
|
z.object({
|
|
7
7
|
id: z.string().describe('the unique id for the organization'),
|
|
8
8
|
name: z.string().describe('the name of the organization'),
|
|
9
9
|
})
|
|
10
10
|
);
|
|
11
|
-
const ListOrganizationsResponseSchema = APIResponseSchema(ListOrganizationsResponse);
|
|
11
|
+
export const ListOrganizationsResponseSchema = APIResponseSchema(ListOrganizationsResponse);
|
|
12
12
|
|
|
13
13
|
export type ListOrganizationsResponse = z.infer<typeof ListOrganizationsResponseSchema>;
|
|
14
14
|
export type OrganizationList = z.infer<typeof ListOrganizationsResponse>;
|
package/src/api/org/resources.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { APIResponseSchema, APIClient } from '../api';
|
|
3
3
|
import { OrgResourceResponseError } from './util';
|
|
4
4
|
|
|
5
|
-
const OrgS3Resource = z.object({
|
|
5
|
+
export const OrgS3Resource = z.object({
|
|
6
6
|
bucket_name: z.string().describe('the S3 bucket name'),
|
|
7
7
|
access_key: z.string().nullable().optional().describe('the S3 access key'),
|
|
8
8
|
secret_key: z.string().nullable().optional().describe('the S3 secret key'),
|
|
@@ -16,7 +16,7 @@ const OrgS3Resource = z.object({
|
|
|
16
16
|
description: z.string().nullable().optional().describe('optional description of the bucket'),
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
const OrgDBResource = z.object({
|
|
19
|
+
export const OrgDBResource = z.object({
|
|
20
20
|
name: z.string().describe('the database name'),
|
|
21
21
|
description: z.string().nullable().optional().describe('optional description of the database'),
|
|
22
22
|
username: z.string().nullable().optional().describe('the database username'),
|
|
@@ -28,12 +28,12 @@ const OrgDBResource = z.object({
|
|
|
28
28
|
internal: z.boolean().describe('whether this is a system-managed database (KV/Vector/Queue)'),
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
const OrgResourceListResponse = z.object({
|
|
31
|
+
export const OrgResourceListResponse = z.object({
|
|
32
32
|
s3: z.array(OrgS3Resource),
|
|
33
33
|
db: z.array(OrgDBResource),
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
const OrgResourceListResponseSchema = APIResponseSchema(OrgResourceListResponse);
|
|
36
|
+
export const OrgResourceListResponseSchema = APIResponseSchema(OrgResourceListResponse);
|
|
37
37
|
|
|
38
38
|
export type OrgResourceListResponse = z.infer<typeof OrgResourceListResponseSchema>;
|
|
39
39
|
export type OrgResourceList = z.infer<typeof OrgResourceListResponse>;
|
package/src/api/project/agent.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { APIClient } from '../api';
|
|
|
3
3
|
import { APIResponseSchema } from '../api';
|
|
4
4
|
import { AgentNotFoundError, ProjectResponseError } from './util';
|
|
5
5
|
|
|
6
|
-
const AgentSchema = z.object({
|
|
6
|
+
export const AgentSchema = z.object({
|
|
7
7
|
id: z.string().describe('Agent ID (same as identifier)'),
|
|
8
8
|
name: z.string().describe('Agent name'),
|
|
9
9
|
description: z.string().nullable().describe('Agent description'),
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { APIClient, APIResponseSchema } from '../api';
|
|
3
3
|
import { ProjectResponseError } from './util';
|
|
4
4
|
|
|
5
|
-
const CreateProjectRequestSchema = z.object({
|
|
5
|
+
export const CreateProjectRequestSchema = z.object({
|
|
6
6
|
name: z.string().max(255).min(1).describe('the name of the new project'),
|
|
7
7
|
description: z.string().max(255).min(0).optional().describe('the description of the project'),
|
|
8
8
|
tags: z.array(z.string()).optional().describe('tags for the project'),
|
|
@@ -11,16 +11,16 @@ const CreateProjectRequestSchema = z.object({
|
|
|
11
11
|
domains: z.array(z.string()).optional().describe('the custom domains for this project'),
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
const
|
|
14
|
+
export const NewProjectSchema = z.object({
|
|
15
15
|
id: z.string().describe('the unique id for the project'),
|
|
16
16
|
sdkKey: z.string().describe('the SDK key for the project'),
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
const CreateProjectResponseSchema = APIResponseSchema(
|
|
19
|
+
const CreateProjectResponseSchema = APIResponseSchema(NewProjectSchema);
|
|
20
20
|
|
|
21
21
|
export type CreateProjectRequest = z.infer<typeof CreateProjectRequestSchema>;
|
|
22
22
|
export type CreateProjectResponse = z.infer<typeof CreateProjectResponseSchema>;
|
|
23
|
-
export type NewProject = z.infer<typeof
|
|
23
|
+
export type NewProject = z.infer<typeof NewProjectSchema>;
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Create a new Project
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { APIClient, APIResponseSchema } from '../api';
|
|
3
3
|
import { ProjectResponseError } from './util';
|
|
4
4
|
|
|
5
|
-
const ProjectDeleteRequestSchema = z.object({ ids: z.array(z.string()) });
|
|
5
|
+
export const ProjectDeleteRequestSchema = z.object({ ids: z.array(z.string()) });
|
|
6
6
|
const ProjectDeleteResponseSchema = APIResponseSchema(z.array(z.string()));
|
|
7
7
|
|
|
8
8
|
type ProjectDeleteRequest = z.infer<typeof ProjectDeleteRequestSchema>;
|
|
@@ -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,11 @@ 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
|
+
const CreateProjectDeploymentResponseSchema = APIResponseSchema(CreateProjectDeploymentSchema);
|
|
182
182
|
|
|
183
|
-
type CreateProjectDeploymentPayload = z.infer<typeof
|
|
183
|
+
type CreateProjectDeploymentPayload = z.infer<typeof CreateProjectDeploymentResponseSchema>;
|
|
184
184
|
|
|
185
|
-
export type Deployment = z.infer<typeof
|
|
185
|
+
export type Deployment = z.infer<typeof CreateProjectDeploymentSchema>;
|
|
186
186
|
|
|
187
187
|
/**
|
|
188
188
|
* Create a new project deployment
|
|
@@ -199,7 +199,7 @@ export async function projectDeploymentCreate(
|
|
|
199
199
|
const resp = await client.request<CreateProjectDeploymentPayload>(
|
|
200
200
|
'POST',
|
|
201
201
|
`/cli/deploy/1/start/${projectId}`,
|
|
202
|
-
|
|
202
|
+
CreateProjectDeploymentResponseSchema,
|
|
203
203
|
deploymentConfig ?? {}
|
|
204
204
|
);
|
|
205
205
|
if (resp.success) {
|
|
@@ -208,7 +208,7 @@ export async function projectDeploymentCreate(
|
|
|
208
208
|
throw new ProjectResponseError({ message: resp.message });
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
const
|
|
211
|
+
export const DeploymentInstructionsSchema = z.object({
|
|
212
212
|
deployment: z.string().describe('the url for uploading the encrypted deployment archive'),
|
|
213
213
|
assets: z
|
|
214
214
|
.record(
|
|
@@ -218,10 +218,10 @@ const DeploymentInstructionsObject = z.object({
|
|
|
218
218
|
.describe('the upload metadata for public assets'),
|
|
219
219
|
});
|
|
220
220
|
|
|
221
|
-
const
|
|
221
|
+
const DeploymentInstructionsResponseSchema = APIResponseSchema(DeploymentInstructionsSchema);
|
|
222
222
|
|
|
223
|
-
type DeploymentInstructionsResponse = z.infer<typeof
|
|
224
|
-
export type DeploymentInstructions = z.infer<typeof
|
|
223
|
+
type DeploymentInstructionsResponse = z.infer<typeof DeploymentInstructionsResponseSchema>;
|
|
224
|
+
export type DeploymentInstructions = z.infer<typeof DeploymentInstructionsSchema>;
|
|
225
225
|
|
|
226
226
|
/**
|
|
227
227
|
* Update the deployment with the build metadata
|
|
@@ -238,7 +238,7 @@ export async function projectDeploymentUpdate(
|
|
|
238
238
|
const resp = await client.request<DeploymentInstructionsResponse, BuildMetadata>(
|
|
239
239
|
'PUT',
|
|
240
240
|
`/cli/deploy/1/start/${deploymentId}`,
|
|
241
|
-
|
|
241
|
+
DeploymentInstructionsResponseSchema,
|
|
242
242
|
deployment,
|
|
243
243
|
BuildMetadataSchema
|
|
244
244
|
);
|
|
@@ -248,7 +248,7 @@ export async function projectDeploymentUpdate(
|
|
|
248
248
|
throw new ProjectResponseError({ message: resp.message });
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
const
|
|
251
|
+
export const DeploymentCompleteSchema = z.object({
|
|
252
252
|
streamId: z.string().optional().describe('the stream id for warmup logs'),
|
|
253
253
|
publicUrls: z
|
|
254
254
|
.object({
|
|
@@ -259,10 +259,10 @@ const DeploymentCompleteObject = z.object({
|
|
|
259
259
|
.describe('the map of public urls'),
|
|
260
260
|
});
|
|
261
261
|
|
|
262
|
-
const
|
|
262
|
+
const DeploymentCompleteResponseSchema = APIResponseSchema(DeploymentCompleteSchema);
|
|
263
263
|
|
|
264
|
-
type DeploymentCompleteResponse = z.infer<typeof
|
|
265
|
-
export type DeploymentComplete = z.infer<typeof
|
|
264
|
+
type DeploymentCompleteResponse = z.infer<typeof DeploymentCompleteResponseSchema>;
|
|
265
|
+
export type DeploymentComplete = z.infer<typeof DeploymentCompleteSchema>;
|
|
266
266
|
|
|
267
267
|
export const DeploymentStateValue = z.enum([
|
|
268
268
|
'pending',
|
|
@@ -274,14 +274,14 @@ export const DeploymentStateValue = z.enum([
|
|
|
274
274
|
|
|
275
275
|
export type DeploymentState = z.infer<typeof DeploymentStateValue>;
|
|
276
276
|
|
|
277
|
-
const
|
|
277
|
+
export const DeploymentStatusSchema = z.object({
|
|
278
278
|
state: DeploymentStateValue.describe('the current deployment state'),
|
|
279
279
|
});
|
|
280
280
|
|
|
281
|
-
const
|
|
281
|
+
const DeploymentStatusResponseSchema = APIResponseSchema(DeploymentStatusSchema);
|
|
282
282
|
|
|
283
|
-
type DeploymentStatusResponse = z.infer<typeof
|
|
284
|
-
export type DeploymentStatusResult = z.infer<typeof
|
|
283
|
+
type DeploymentStatusResponse = z.infer<typeof DeploymentStatusResponseSchema>;
|
|
284
|
+
export type DeploymentStatusResult = z.infer<typeof DeploymentStatusSchema>;
|
|
285
285
|
|
|
286
286
|
/**
|
|
287
287
|
* Complete the deployment once build is uploaded
|
|
@@ -297,7 +297,7 @@ export async function projectDeploymentComplete(
|
|
|
297
297
|
const resp = await client.request<DeploymentCompleteResponse>(
|
|
298
298
|
'POST',
|
|
299
299
|
`/cli/deploy/1/complete/${deploymentId}`,
|
|
300
|
-
|
|
300
|
+
DeploymentCompleteResponseSchema
|
|
301
301
|
);
|
|
302
302
|
if (resp.success) {
|
|
303
303
|
return resp.data;
|
|
@@ -321,7 +321,7 @@ export async function projectDeploymentStatus(
|
|
|
321
321
|
const resp = await client.request<DeploymentStatusResponse>(
|
|
322
322
|
'GET',
|
|
323
323
|
`/cli/deploy/1/status/${deploymentId}`,
|
|
324
|
-
|
|
324
|
+
DeploymentStatusResponseSchema
|
|
325
325
|
);
|
|
326
326
|
if (resp.success) {
|
|
327
327
|
return resp.data;
|
|
@@ -359,7 +359,7 @@ export interface DeploymentFailPayload {
|
|
|
359
359
|
diagnostics?: ClientDiagnostics;
|
|
360
360
|
}
|
|
361
361
|
|
|
362
|
-
const ClientDiagnosticsErrorSchema = z.object({
|
|
362
|
+
export const ClientDiagnosticsErrorSchema = z.object({
|
|
363
363
|
type: z.enum(['file', 'general']),
|
|
364
364
|
scope: z.enum(['typescript', 'ast', 'build', 'bundler', 'validation', 'deploy']),
|
|
365
365
|
path: z.string().optional(),
|
|
@@ -369,14 +369,14 @@ const ClientDiagnosticsErrorSchema = z.object({
|
|
|
369
369
|
code: z.string().optional(),
|
|
370
370
|
});
|
|
371
371
|
|
|
372
|
-
const ClientDiagnosticsTimingSchema = z.object({
|
|
372
|
+
export const ClientDiagnosticsTimingSchema = z.object({
|
|
373
373
|
name: z.string(),
|
|
374
374
|
startedAt: z.string(),
|
|
375
375
|
completedAt: z.string(),
|
|
376
376
|
durationMs: z.number(),
|
|
377
377
|
});
|
|
378
378
|
|
|
379
|
-
const ClientDiagnosticsSchema = z.object({
|
|
379
|
+
export const ClientDiagnosticsSchema = z.object({
|
|
380
380
|
success: z.boolean(),
|
|
381
381
|
errors: z.array(ClientDiagnosticsErrorSchema),
|
|
382
382
|
warnings: z.array(ClientDiagnosticsErrorSchema),
|
|
@@ -384,17 +384,17 @@ const ClientDiagnosticsSchema = z.object({
|
|
|
384
384
|
error: z.string().optional(),
|
|
385
385
|
});
|
|
386
386
|
|
|
387
|
-
const DeploymentFailPayloadSchema = z.object({
|
|
387
|
+
export const DeploymentFailPayloadSchema = z.object({
|
|
388
388
|
error: z.string().optional(),
|
|
389
389
|
diagnostics: ClientDiagnosticsSchema.optional(),
|
|
390
390
|
});
|
|
391
391
|
|
|
392
|
-
const
|
|
392
|
+
export const DeploymentFailResponseSchema = z.object({
|
|
393
393
|
state: z.literal('failed'),
|
|
394
394
|
});
|
|
395
395
|
|
|
396
|
-
const
|
|
397
|
-
type DeploymentFailResponse = z.infer<typeof
|
|
396
|
+
const DeploymentFailAPIResponseSchema = APIResponseSchema(DeploymentFailResponseSchema);
|
|
397
|
+
type DeploymentFailResponse = z.infer<typeof DeploymentFailAPIResponseSchema>;
|
|
398
398
|
|
|
399
399
|
/**
|
|
400
400
|
* Report a deployment failure from the client
|
|
@@ -412,7 +412,7 @@ export async function projectDeploymentFail(
|
|
|
412
412
|
const resp = await client.request<DeploymentFailResponse, DeploymentFailPayload>(
|
|
413
413
|
'POST',
|
|
414
414
|
`/cli/deploy/1/fail/${deploymentId}`,
|
|
415
|
-
|
|
415
|
+
DeploymentFailAPIResponseSchema,
|
|
416
416
|
payload,
|
|
417
417
|
DeploymentFailPayloadSchema
|
|
418
418
|
);
|
|
@@ -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(),
|
|
@@ -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(),
|
|
@@ -2,15 +2,19 @@ import { z } from 'zod';
|
|
|
2
2
|
import { 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
15
|
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
|
/**
|
|
@@ -4,7 +4,7 @@ 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'),
|
|
@@ -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
|
/**
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { APIClient, APIResponseSchema, APIError } 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()
|
|
@@ -13,7 +13,7 @@ const _ProjectExistsRequestSchema = z.object({
|
|
|
13
13
|
|
|
14
14
|
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
|
@@ -2,13 +2,13 @@ import { z } from 'zod';
|
|
|
2
2
|
import { 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'),
|
|
@@ -22,7 +22,7 @@ const ProjectSchema = z.object({
|
|
|
22
22
|
|
|
23
23
|
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
|
@@ -2,22 +2,22 @@ import { z } from 'zod';
|
|
|
2
2
|
import { 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
|
+
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
|