@alpic-ai/api 0.0.0-staging.1d230fc → 0.0.0-staging.1e2eb17
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/index.d.mts +43 -1
- package/dist/index.mjs +30 -5
- package/package.json +2 -3
package/dist/index.d.mts
CHANGED
|
@@ -6,6 +6,7 @@ import { z } from "zod";
|
|
|
6
6
|
type ApiContext = {
|
|
7
7
|
request: Request & {
|
|
8
8
|
teamIds: string[];
|
|
9
|
+
defaultTeamId: string | undefined;
|
|
9
10
|
};
|
|
10
11
|
};
|
|
11
12
|
declare const createEnvironmentContractV1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
@@ -134,6 +135,7 @@ declare const contract: {
|
|
|
134
135
|
authorAvatarUrl: z.ZodNullable<z.ZodString>;
|
|
135
136
|
startedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
136
137
|
completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
138
|
+
deploymentPageUrl: z.ZodNullable<z.ZodURL>;
|
|
137
139
|
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
138
140
|
NOT_FOUND: {};
|
|
139
141
|
}>, Record<never, never>>;
|
|
@@ -218,6 +220,7 @@ declare const contract: {
|
|
|
218
220
|
authorAvatarUrl: z.ZodNullable<z.ZodString>;
|
|
219
221
|
startedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
220
222
|
completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
223
|
+
deploymentPageUrl: z.ZodNullable<z.ZodURL>;
|
|
221
224
|
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
222
225
|
NOT_FOUND: {};
|
|
223
226
|
BAD_REQUEST: {};
|
|
@@ -228,6 +231,7 @@ declare const contract: {
|
|
|
228
231
|
update: {
|
|
229
232
|
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
230
233
|
projectId: z.ZodString;
|
|
234
|
+
name: z.ZodOptional<z.ZodString>;
|
|
231
235
|
sourceRepository: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
232
236
|
}, z.core.$strip>, z.ZodObject<{
|
|
233
237
|
id: z.ZodString;
|
|
@@ -255,6 +259,15 @@ declare const contract: {
|
|
|
255
259
|
id: z.ZodString;
|
|
256
260
|
name: z.ZodString;
|
|
257
261
|
mcpServerUrl: z.ZodString;
|
|
262
|
+
domains: z.ZodArray<z.ZodObject<{
|
|
263
|
+
domain: z.ZodString;
|
|
264
|
+
status: z.ZodEnum<{
|
|
265
|
+
ongoing: "ongoing";
|
|
266
|
+
deployed: "deployed";
|
|
267
|
+
failed: "failed";
|
|
268
|
+
}>;
|
|
269
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
270
|
+
}, z.core.$strip>>;
|
|
258
271
|
latestDeployment: z.ZodNullable<z.ZodObject<{
|
|
259
272
|
id: z.ZodString;
|
|
260
273
|
status: z.ZodEnum<{
|
|
@@ -322,6 +335,15 @@ declare const contract: {
|
|
|
322
335
|
id: z.ZodString;
|
|
323
336
|
name: z.ZodString;
|
|
324
337
|
mcpServerUrl: z.ZodString;
|
|
338
|
+
domains: z.ZodArray<z.ZodObject<{
|
|
339
|
+
domain: z.ZodString;
|
|
340
|
+
status: z.ZodEnum<{
|
|
341
|
+
ongoing: "ongoing";
|
|
342
|
+
deployed: "deployed";
|
|
343
|
+
failed: "failed";
|
|
344
|
+
}>;
|
|
345
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
346
|
+
}, z.core.$strip>>;
|
|
325
347
|
latestDeployment: z.ZodNullable<z.ZodObject<{
|
|
326
348
|
id: z.ZodString;
|
|
327
349
|
status: z.ZodEnum<{
|
|
@@ -360,7 +382,9 @@ declare const contract: {
|
|
|
360
382
|
}>, Record<never, never>>;
|
|
361
383
|
};
|
|
362
384
|
list: {
|
|
363
|
-
v1: _orpc_contract0.
|
|
385
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodOptional<z.ZodObject<{
|
|
386
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
387
|
+
}, z.core.$strip>>, z.ZodArray<z.ZodObject<{
|
|
364
388
|
id: z.ZodString;
|
|
365
389
|
name: z.ZodString;
|
|
366
390
|
teamId: z.ZodString;
|
|
@@ -386,6 +410,15 @@ declare const contract: {
|
|
|
386
410
|
id: z.ZodString;
|
|
387
411
|
name: z.ZodString;
|
|
388
412
|
mcpServerUrl: z.ZodString;
|
|
413
|
+
domains: z.ZodArray<z.ZodObject<{
|
|
414
|
+
domain: z.ZodString;
|
|
415
|
+
status: z.ZodEnum<{
|
|
416
|
+
ongoing: "ongoing";
|
|
417
|
+
deployed: "deployed";
|
|
418
|
+
failed: "failed";
|
|
419
|
+
}>;
|
|
420
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
421
|
+
}, z.core.$strip>>;
|
|
389
422
|
latestDeployment: z.ZodNullable<z.ZodObject<{
|
|
390
423
|
id: z.ZodString;
|
|
391
424
|
status: z.ZodEnum<{
|
|
@@ -485,6 +518,15 @@ declare const contract: {
|
|
|
485
518
|
BAD_REQUEST: {};
|
|
486
519
|
}>, Record<never, never>>;
|
|
487
520
|
};
|
|
521
|
+
delete: {
|
|
522
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
523
|
+
projectId: z.ZodString;
|
|
524
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
525
|
+
success: z.ZodLiteral<true>;
|
|
526
|
+
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
527
|
+
NOT_FOUND: {};
|
|
528
|
+
}>, Record<never, never>>;
|
|
529
|
+
};
|
|
488
530
|
};
|
|
489
531
|
};
|
|
490
532
|
type RouterInput = InferContractRouterInputs<typeof contract>;
|
package/dist/index.mjs
CHANGED
|
@@ -13,7 +13,11 @@ const RESERVED_KEYS = [
|
|
|
13
13
|
"AWS_LAMBDA_FUNCTION_VERSION",
|
|
14
14
|
"AWS_LAMBDA_INITIALIZATION_TYPE",
|
|
15
15
|
"AWS_LAMBDA_LOG_GROUP_NAME",
|
|
16
|
+
"AWS_LAMBDA_LOG_STREAM_NAME",
|
|
16
17
|
"AWS_ACCESS_KEY",
|
|
18
|
+
"AWS_ACCESS_KEY_ID",
|
|
19
|
+
"AWS_SECRET_ACCESS_KEY",
|
|
20
|
+
"AWS_SESSION_TOKEN",
|
|
17
21
|
"AWS_LAMBDA_RUNTIME_API",
|
|
18
22
|
"LAMBDA_TASK_ROOT",
|
|
19
23
|
"LAMBDA_RUNTIME_DIR",
|
|
@@ -82,6 +86,7 @@ const deploymentSchema = z.object({
|
|
|
82
86
|
startedAt: z.coerce.date().nullable(),
|
|
83
87
|
completedAt: z.coerce.date().nullable()
|
|
84
88
|
});
|
|
89
|
+
const deploymentWithPageUrlSchema = deploymentSchema.extend({ deploymentPageUrl: z.url().nullable() });
|
|
85
90
|
const createEnvironmentContractV1 = oc.route({
|
|
86
91
|
path: "/v1/environments",
|
|
87
92
|
method: "POST",
|
|
@@ -121,10 +126,20 @@ const getEnvironmentContractV1 = oc.route({
|
|
|
121
126
|
createdAt: z.coerce.date(),
|
|
122
127
|
projectId: z.string()
|
|
123
128
|
}));
|
|
129
|
+
const domainSchema = z.object({
|
|
130
|
+
domain: z.string(),
|
|
131
|
+
status: z.enum([
|
|
132
|
+
"ongoing",
|
|
133
|
+
"deployed",
|
|
134
|
+
"failed"
|
|
135
|
+
]),
|
|
136
|
+
createdAt: z.coerce.date()
|
|
137
|
+
});
|
|
124
138
|
const productionEnvironmentSchema = z.object({
|
|
125
139
|
id: z.string(),
|
|
126
140
|
name: z.string(),
|
|
127
141
|
mcpServerUrl: z.string(),
|
|
142
|
+
domains: z.array(domainSchema),
|
|
128
143
|
latestDeployment: latestDeploymentSchema.nullable()
|
|
129
144
|
});
|
|
130
145
|
const environmentSchema = z.object({
|
|
@@ -167,7 +182,7 @@ const listProjectsContractV1 = oc.route({
|
|
|
167
182
|
description: "List all projects for a team",
|
|
168
183
|
tags: ["projects"],
|
|
169
184
|
successDescription: "The list of projects"
|
|
170
|
-
}).output(z.array(projectOutputSchema));
|
|
185
|
+
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.array(projectOutputSchema));
|
|
171
186
|
const createProjectContractV1 = oc.route({
|
|
172
187
|
path: "/v1/projects",
|
|
173
188
|
method: "POST",
|
|
@@ -180,7 +195,7 @@ const createProjectContractV1 = oc.route({
|
|
|
180
195
|
BAD_REQUEST: {}
|
|
181
196
|
}).input(z.object({
|
|
182
197
|
teamId: z.string().optional(),
|
|
183
|
-
name: z.string().min(1).max(100),
|
|
198
|
+
name: z.string().trim().min(1).max(100),
|
|
184
199
|
sourceRepository: z.string().optional(),
|
|
185
200
|
branchName: z.string().min(1).optional(),
|
|
186
201
|
runtime: runtimeSchema,
|
|
@@ -210,6 +225,14 @@ const createProjectContractV1 = oc.route({
|
|
|
210
225
|
startCommand: z.string().nullable(),
|
|
211
226
|
createdAt: z.coerce.date()
|
|
212
227
|
}));
|
|
228
|
+
const deleteProjectContractV1 = oc.route({
|
|
229
|
+
path: "/v1/projects/:projectId",
|
|
230
|
+
method: "DELETE",
|
|
231
|
+
summary: "Delete a project",
|
|
232
|
+
description: "Delete a project and all its environments",
|
|
233
|
+
tags: ["projects"],
|
|
234
|
+
successDescription: "The project has been deleted successfully"
|
|
235
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ projectId: z.string().describe("The ID of the project") })).output(z.object({ success: z.literal(true) }));
|
|
213
236
|
const updateProjectContractV1 = oc.route({
|
|
214
237
|
path: "/v1/projects/{projectId}",
|
|
215
238
|
method: "PATCH",
|
|
@@ -222,6 +245,7 @@ const updateProjectContractV1 = oc.route({
|
|
|
222
245
|
BAD_REQUEST: {}
|
|
223
246
|
}).input(z.object({
|
|
224
247
|
projectId: z.string().describe("The ID of the project"),
|
|
248
|
+
name: z.string().min(1).max(100).optional().describe("The new name for the project"),
|
|
225
249
|
sourceRepository: z.string().nullable().optional().describe("The source repository to connect to the project")
|
|
226
250
|
})).output(projectOutputSchema);
|
|
227
251
|
const deployEnvironmentContractV1 = oc.route({
|
|
@@ -237,7 +261,7 @@ const deployEnvironmentContractV1 = oc.route({
|
|
|
237
261
|
}).input(z.object({
|
|
238
262
|
environmentId: z.string().describe("The ID of the environment to deploy"),
|
|
239
263
|
token: z.string().describe("The token to identify the source archive").optional()
|
|
240
|
-
})).output(
|
|
264
|
+
})).output(deploymentWithPageUrlSchema);
|
|
241
265
|
const uploadDeploymentArtifactContractV1 = oc.route({
|
|
242
266
|
path: "/v1/deployments/upload",
|
|
243
267
|
method: "POST",
|
|
@@ -268,7 +292,7 @@ const getDeploymentContractV1 = oc.route({
|
|
|
268
292
|
description: "Get a deployment by ID",
|
|
269
293
|
tags: ["deployments"],
|
|
270
294
|
successDescription: "The deployment details"
|
|
271
|
-
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(
|
|
295
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(deploymentWithPageUrlSchema);
|
|
272
296
|
const getDeploymentLogsContractV1 = oc.route({
|
|
273
297
|
path: "/v1/deployments/{deploymentId}/logs",
|
|
274
298
|
method: "GET",
|
|
@@ -353,7 +377,8 @@ const contract = {
|
|
|
353
377
|
update: { v1: updateProjectContractV1 },
|
|
354
378
|
get: { v1: getProjectContractV1 },
|
|
355
379
|
list: { v1: listProjectsContractV1 },
|
|
356
|
-
create: { v1: createProjectContractV1 }
|
|
380
|
+
create: { v1: createProjectContractV1 },
|
|
381
|
+
delete: { v1: deleteProjectContractV1 }
|
|
357
382
|
}
|
|
358
383
|
};
|
|
359
384
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alpic-ai/api",
|
|
3
|
-
"version": "0.0.0-staging.
|
|
3
|
+
"version": "0.0.0-staging.1e2eb17",
|
|
4
4
|
"description": "Contract for the Alpic API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -17,12 +17,11 @@
|
|
|
17
17
|
"author": "Alpic",
|
|
18
18
|
"license": "ISC",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@orpc/contract": "^1.13.
|
|
20
|
+
"@orpc/contract": "^1.13.6",
|
|
21
21
|
"zod": "^4.3.6"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
25
|
-
"biome": "^0.3.3",
|
|
26
25
|
"shx": "^0.4.0",
|
|
27
26
|
"tsdown": "^0.20.3",
|
|
28
27
|
"typescript": "^5.9.3",
|