@alpic-ai/api 0.0.0-staging.32beedb → 0.0.0-staging.33511be
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 +41 -2
- package/dist/index.mjs +31 -8
- package/package.json +3 -3
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
|
};
|
|
@@ -258,6 +259,15 @@ declare const contract: {
|
|
|
258
259
|
id: z.ZodString;
|
|
259
260
|
name: z.ZodString;
|
|
260
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>>;
|
|
261
271
|
latestDeployment: z.ZodNullable<z.ZodObject<{
|
|
262
272
|
id: z.ZodString;
|
|
263
273
|
status: z.ZodEnum<{
|
|
@@ -325,6 +335,15 @@ declare const contract: {
|
|
|
325
335
|
id: z.ZodString;
|
|
326
336
|
name: z.ZodString;
|
|
327
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>>;
|
|
328
347
|
latestDeployment: z.ZodNullable<z.ZodObject<{
|
|
329
348
|
id: z.ZodString;
|
|
330
349
|
status: z.ZodEnum<{
|
|
@@ -363,7 +382,9 @@ declare const contract: {
|
|
|
363
382
|
}>, Record<never, never>>;
|
|
364
383
|
};
|
|
365
384
|
list: {
|
|
366
|
-
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<{
|
|
367
388
|
id: z.ZodString;
|
|
368
389
|
name: z.ZodString;
|
|
369
390
|
teamId: z.ZodString;
|
|
@@ -389,6 +410,15 @@ declare const contract: {
|
|
|
389
410
|
id: z.ZodString;
|
|
390
411
|
name: z.ZodString;
|
|
391
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>>;
|
|
392
422
|
latestDeployment: z.ZodNullable<z.ZodObject<{
|
|
393
423
|
id: z.ZodString;
|
|
394
424
|
status: z.ZodEnum<{
|
|
@@ -498,6 +528,15 @@ declare const contract: {
|
|
|
498
528
|
}>, Record<never, never>>;
|
|
499
529
|
};
|
|
500
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
|
+
};
|
|
501
540
|
};
|
|
502
541
|
type RouterInput = InferContractRouterInputs<typeof contract>;
|
|
503
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",
|
|
@@ -55,7 +58,6 @@ const transportSchema = z.enum([
|
|
|
55
58
|
"sse",
|
|
56
59
|
"streamablehttp"
|
|
57
60
|
]);
|
|
58
|
-
|
|
59
61
|
//#endregion
|
|
60
62
|
//#region src/api.contract.ts
|
|
61
63
|
const deploymentStatusSchema = z.enum([
|
|
@@ -122,10 +124,20 @@ const getEnvironmentContractV1 = oc.route({
|
|
|
122
124
|
createdAt: z.coerce.date(),
|
|
123
125
|
projectId: z.string()
|
|
124
126
|
}));
|
|
127
|
+
const domainSchema = z.object({
|
|
128
|
+
domain: z.string(),
|
|
129
|
+
status: z.enum([
|
|
130
|
+
"ongoing",
|
|
131
|
+
"deployed",
|
|
132
|
+
"failed"
|
|
133
|
+
]),
|
|
134
|
+
createdAt: z.coerce.date()
|
|
135
|
+
});
|
|
125
136
|
const productionEnvironmentSchema = z.object({
|
|
126
137
|
id: z.string(),
|
|
127
138
|
name: z.string(),
|
|
128
139
|
mcpServerUrl: z.string(),
|
|
140
|
+
domains: z.array(domainSchema),
|
|
129
141
|
latestDeployment: latestDeploymentSchema.nullable()
|
|
130
142
|
});
|
|
131
143
|
const environmentSchema = z.object({
|
|
@@ -168,7 +180,7 @@ const listProjectsContractV1 = oc.route({
|
|
|
168
180
|
description: "List all projects for a team",
|
|
169
181
|
tags: ["projects"],
|
|
170
182
|
successDescription: "The list of projects"
|
|
171
|
-
}).output(z.array(projectOutputSchema));
|
|
183
|
+
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.array(projectOutputSchema));
|
|
172
184
|
const createProjectContractV1 = oc.route({
|
|
173
185
|
path: "/v1/projects",
|
|
174
186
|
method: "POST",
|
|
@@ -342,9 +354,20 @@ const listTeamsContractV1 = oc.route({
|
|
|
342
354
|
id: z.string(),
|
|
343
355
|
name: z.string(),
|
|
344
356
|
createdAt: z.coerce.date(),
|
|
345
|
-
hasStripeAccount: z.boolean()
|
|
346
|
-
hasActiveSubscription: z.boolean()
|
|
357
|
+
hasStripeAccount: z.boolean()
|
|
347
358
|
})));
|
|
359
|
+
const getTunnelTicketContractV1 = oc.route({
|
|
360
|
+
path: "/v1/tunnels/ticket",
|
|
361
|
+
method: "GET",
|
|
362
|
+
summary: "Get a tunnel ticket",
|
|
363
|
+
description: "Get a signed ticket for establishing a tunnel connection. Requires user authentication (API keys are not supported).",
|
|
364
|
+
tags: ["tunnels"],
|
|
365
|
+
successDescription: "The tunnel ticket"
|
|
366
|
+
}).output(z.object({
|
|
367
|
+
subdomain: z.string().describe("The subdomain assigned to the user"),
|
|
368
|
+
ticket: z.string().describe("The signed tunnel ticket"),
|
|
369
|
+
tunnelHost: z.string().describe("The tunnel host to connect to")
|
|
370
|
+
}));
|
|
348
371
|
const contract = {
|
|
349
372
|
teams: { list: { v1: listTeamsContractV1 } },
|
|
350
373
|
analytics: { get: { v1: getProjectAnalyticsContractV1 } },
|
|
@@ -365,8 +388,8 @@ const contract = {
|
|
|
365
388
|
list: { v1: listProjectsContractV1 },
|
|
366
389
|
create: { v1: createProjectContractV1 },
|
|
367
390
|
delete: { v1: deleteProjectContractV1 }
|
|
368
|
-
}
|
|
391
|
+
},
|
|
392
|
+
tunnels: { getTicket: { v1: getTunnelTicketContractV1 } }
|
|
369
393
|
};
|
|
370
|
-
|
|
371
394
|
//#endregion
|
|
372
|
-
export { buildSettingsSchema, contract, createEnvironmentContractV1, environmentVariableSchema, environmentVariablesSchema, runtimeSchema, transportSchema };
|
|
395
|
+
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.33511be",
|
|
4
4
|
"description": "Contract for the Alpic API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -17,13 +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
25
|
"shx": "^0.4.0",
|
|
26
|
-
"tsdown": "^0.
|
|
26
|
+
"tsdown": "^0.21.1",
|
|
27
27
|
"typescript": "^5.9.3",
|
|
28
28
|
"vitest": "^4.0.18"
|
|
29
29
|
},
|