@alpic-ai/api 0.0.0-staging.dfd352e → 0.0.0-staging.e2ffb8b
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 +44 -2
- package/dist/index.mjs +38 -12
- package/package.json +3 -4
package/dist/index.d.mts
CHANGED
|
@@ -6,6 +6,8 @@ import { z } from "zod";
|
|
|
6
6
|
type ApiContext = {
|
|
7
7
|
request: Request & {
|
|
8
8
|
teamIds: string[];
|
|
9
|
+
defaultTeamId: string | undefined;
|
|
10
|
+
awsCognitoUserSub: string | undefined;
|
|
9
11
|
};
|
|
10
12
|
};
|
|
11
13
|
declare const createEnvironmentContractV1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
@@ -36,7 +38,6 @@ declare const contract: {
|
|
|
36
38
|
name: z.ZodString;
|
|
37
39
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
38
40
|
hasStripeAccount: z.ZodBoolean;
|
|
39
|
-
hasActiveSubscription: z.ZodBoolean;
|
|
40
41
|
}, z.core.$strip>>, Record<never, never>, Record<never, never>>;
|
|
41
42
|
};
|
|
42
43
|
};
|
|
@@ -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<{
|
|
@@ -495,6 +528,15 @@ declare const contract: {
|
|
|
495
528
|
}>, Record<never, never>>;
|
|
496
529
|
};
|
|
497
530
|
};
|
|
531
|
+
tunnels: {
|
|
532
|
+
getTicket: {
|
|
533
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithOutput<_orpc_contract0.Schema<unknown, unknown>, z.ZodObject<{
|
|
534
|
+
subdomain: z.ZodString;
|
|
535
|
+
ticket: z.ZodString;
|
|
536
|
+
tunnelHost: z.ZodString;
|
|
537
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
538
|
+
};
|
|
539
|
+
};
|
|
498
540
|
};
|
|
499
541
|
type RouterInput = InferContractRouterInputs<typeof contract>;
|
|
500
542
|
type RouterOutput = InferContractRouterOutputs<typeof contract>;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
|
|
4
3
|
//#region src/schemas.ts
|
|
5
4
|
const RESERVED_KEYS = [
|
|
6
5
|
"_HANDLER",
|
|
@@ -13,7 +12,11 @@ const RESERVED_KEYS = [
|
|
|
13
12
|
"AWS_LAMBDA_FUNCTION_VERSION",
|
|
14
13
|
"AWS_LAMBDA_INITIALIZATION_TYPE",
|
|
15
14
|
"AWS_LAMBDA_LOG_GROUP_NAME",
|
|
15
|
+
"AWS_LAMBDA_LOG_STREAM_NAME",
|
|
16
16
|
"AWS_ACCESS_KEY",
|
|
17
|
+
"AWS_ACCESS_KEY_ID",
|
|
18
|
+
"AWS_SECRET_ACCESS_KEY",
|
|
19
|
+
"AWS_SESSION_TOKEN",
|
|
17
20
|
"AWS_LAMBDA_RUNTIME_API",
|
|
18
21
|
"LAMBDA_TASK_ROOT",
|
|
19
22
|
"LAMBDA_RUNTIME_DIR",
|
|
@@ -30,7 +33,8 @@ const RESERVED_KEYS = [
|
|
|
30
33
|
"BUILD_ARG_BUILD_COMMAND",
|
|
31
34
|
"BUILD_ARG_BUILD_OUTPUT_DIR",
|
|
32
35
|
"BUILD_ARG_START_COMMAND",
|
|
33
|
-
"ALPIC_HOST"
|
|
36
|
+
"ALPIC_HOST",
|
|
37
|
+
"ALPIC_CUSTOM_DOMAINS"
|
|
34
38
|
];
|
|
35
39
|
const environmentVariableSchema = z.object({
|
|
36
40
|
key: z.string().min(2, "Key must be at least 2 characters").regex(/^[a-zA-Z]([a-zA-Z0-9_])+$/, "Key must start with a letter and contain only letters, numbers, and underscores").refine((key) => !RESERVED_KEYS.includes(key), "This key is reserved and cannot be used as an environment variable key"),
|
|
@@ -55,7 +59,6 @@ const transportSchema = z.enum([
|
|
|
55
59
|
"sse",
|
|
56
60
|
"streamablehttp"
|
|
57
61
|
]);
|
|
58
|
-
|
|
59
62
|
//#endregion
|
|
60
63
|
//#region src/api.contract.ts
|
|
61
64
|
const deploymentStatusSchema = z.enum([
|
|
@@ -82,6 +85,7 @@ const deploymentSchema = z.object({
|
|
|
82
85
|
startedAt: z.coerce.date().nullable(),
|
|
83
86
|
completedAt: z.coerce.date().nullable()
|
|
84
87
|
});
|
|
88
|
+
const deploymentWithPageUrlSchema = deploymentSchema.extend({ deploymentPageUrl: z.url().nullable() });
|
|
85
89
|
const createEnvironmentContractV1 = oc.route({
|
|
86
90
|
path: "/v1/environments",
|
|
87
91
|
method: "POST",
|
|
@@ -121,10 +125,20 @@ const getEnvironmentContractV1 = oc.route({
|
|
|
121
125
|
createdAt: z.coerce.date(),
|
|
122
126
|
projectId: z.string()
|
|
123
127
|
}));
|
|
128
|
+
const domainSchema = z.object({
|
|
129
|
+
domain: z.string(),
|
|
130
|
+
status: z.enum([
|
|
131
|
+
"ongoing",
|
|
132
|
+
"deployed",
|
|
133
|
+
"failed"
|
|
134
|
+
]),
|
|
135
|
+
createdAt: z.coerce.date()
|
|
136
|
+
});
|
|
124
137
|
const productionEnvironmentSchema = z.object({
|
|
125
138
|
id: z.string(),
|
|
126
139
|
name: z.string(),
|
|
127
140
|
mcpServerUrl: z.string(),
|
|
141
|
+
domains: z.array(domainSchema),
|
|
128
142
|
latestDeployment: latestDeploymentSchema.nullable()
|
|
129
143
|
});
|
|
130
144
|
const environmentSchema = z.object({
|
|
@@ -167,7 +181,7 @@ const listProjectsContractV1 = oc.route({
|
|
|
167
181
|
description: "List all projects for a team",
|
|
168
182
|
tags: ["projects"],
|
|
169
183
|
successDescription: "The list of projects"
|
|
170
|
-
}).output(z.array(projectOutputSchema));
|
|
184
|
+
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.array(projectOutputSchema));
|
|
171
185
|
const createProjectContractV1 = oc.route({
|
|
172
186
|
path: "/v1/projects",
|
|
173
187
|
method: "POST",
|
|
@@ -180,7 +194,7 @@ const createProjectContractV1 = oc.route({
|
|
|
180
194
|
BAD_REQUEST: {}
|
|
181
195
|
}).input(z.object({
|
|
182
196
|
teamId: z.string().optional(),
|
|
183
|
-
name: z.string().min(1).max(100),
|
|
197
|
+
name: z.string().trim().min(1).max(100),
|
|
184
198
|
sourceRepository: z.string().optional(),
|
|
185
199
|
branchName: z.string().min(1).optional(),
|
|
186
200
|
runtime: runtimeSchema,
|
|
@@ -230,6 +244,7 @@ const updateProjectContractV1 = oc.route({
|
|
|
230
244
|
BAD_REQUEST: {}
|
|
231
245
|
}).input(z.object({
|
|
232
246
|
projectId: z.string().describe("The ID of the project"),
|
|
247
|
+
name: z.string().min(1).max(100).optional().describe("The new name for the project"),
|
|
233
248
|
sourceRepository: z.string().nullable().optional().describe("The source repository to connect to the project")
|
|
234
249
|
})).output(projectOutputSchema);
|
|
235
250
|
const deployEnvironmentContractV1 = oc.route({
|
|
@@ -245,7 +260,7 @@ const deployEnvironmentContractV1 = oc.route({
|
|
|
245
260
|
}).input(z.object({
|
|
246
261
|
environmentId: z.string().describe("The ID of the environment to deploy"),
|
|
247
262
|
token: z.string().describe("The token to identify the source archive").optional()
|
|
248
|
-
})).output(
|
|
263
|
+
})).output(deploymentWithPageUrlSchema);
|
|
249
264
|
const uploadDeploymentArtifactContractV1 = oc.route({
|
|
250
265
|
path: "/v1/deployments/upload",
|
|
251
266
|
method: "POST",
|
|
@@ -276,7 +291,7 @@ const getDeploymentContractV1 = oc.route({
|
|
|
276
291
|
description: "Get a deployment by ID",
|
|
277
292
|
tags: ["deployments"],
|
|
278
293
|
successDescription: "The deployment details"
|
|
279
|
-
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(
|
|
294
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(deploymentWithPageUrlSchema);
|
|
280
295
|
const getDeploymentLogsContractV1 = oc.route({
|
|
281
296
|
path: "/v1/deployments/{deploymentId}/logs",
|
|
282
297
|
method: "GET",
|
|
@@ -340,9 +355,20 @@ const listTeamsContractV1 = oc.route({
|
|
|
340
355
|
id: z.string(),
|
|
341
356
|
name: z.string(),
|
|
342
357
|
createdAt: z.coerce.date(),
|
|
343
|
-
hasStripeAccount: z.boolean()
|
|
344
|
-
hasActiveSubscription: z.boolean()
|
|
358
|
+
hasStripeAccount: z.boolean()
|
|
345
359
|
})));
|
|
360
|
+
const getTunnelTicketContractV1 = oc.route({
|
|
361
|
+
path: "/v1/tunnels/ticket",
|
|
362
|
+
method: "GET",
|
|
363
|
+
summary: "Get a tunnel ticket",
|
|
364
|
+
description: "Get a signed ticket for establishing a tunnel connection. Requires user authentication (API keys are not supported).",
|
|
365
|
+
tags: ["tunnels"],
|
|
366
|
+
successDescription: "The tunnel ticket"
|
|
367
|
+
}).output(z.object({
|
|
368
|
+
subdomain: z.string().describe("The subdomain assigned to the user"),
|
|
369
|
+
ticket: z.string().describe("The signed tunnel ticket"),
|
|
370
|
+
tunnelHost: z.string().describe("The tunnel host to connect to")
|
|
371
|
+
}));
|
|
346
372
|
const contract = {
|
|
347
373
|
teams: { list: { v1: listTeamsContractV1 } },
|
|
348
374
|
analytics: { get: { v1: getProjectAnalyticsContractV1 } },
|
|
@@ -363,8 +389,8 @@ const contract = {
|
|
|
363
389
|
list: { v1: listProjectsContractV1 },
|
|
364
390
|
create: { v1: createProjectContractV1 },
|
|
365
391
|
delete: { v1: deleteProjectContractV1 }
|
|
366
|
-
}
|
|
392
|
+
},
|
|
393
|
+
tunnels: { getTicket: { v1: getTunnelTicketContractV1 } }
|
|
367
394
|
};
|
|
368
|
-
|
|
369
395
|
//#endregion
|
|
370
|
-
export { buildSettingsSchema, contract, createEnvironmentContractV1, environmentVariableSchema, environmentVariablesSchema, runtimeSchema, transportSchema };
|
|
396
|
+
export { buildSettingsSchema, contract, createEnvironmentContractV1, environmentVariableSchema, environmentVariablesSchema, runtimeSchema, transportSchema };
|
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.e2ffb8b",
|
|
4
4
|
"description": "Contract for the Alpic API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -17,14 +17,13 @@
|
|
|
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
|
-
"tsdown": "^0.
|
|
26
|
+
"tsdown": "^0.21.1",
|
|
28
27
|
"typescript": "^5.9.3",
|
|
29
28
|
"vitest": "^4.0.18"
|
|
30
29
|
},
|