@alpic-ai/api 0.0.0-staging.0848c65 → 0.0.0-staging.08782cb
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 +653 -41
- package/dist/index.mjs +410 -22
- package/package.json +11 -8
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import ms from "ms";
|
|
2
3
|
import { z } from "zod";
|
|
3
|
-
|
|
4
4
|
//#region src/schemas.ts
|
|
5
5
|
const RESERVED_KEYS = [
|
|
6
6
|
"_HANDLER",
|
|
@@ -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",
|
|
@@ -30,7 +34,8 @@ const RESERVED_KEYS = [
|
|
|
30
34
|
"BUILD_ARG_BUILD_COMMAND",
|
|
31
35
|
"BUILD_ARG_BUILD_OUTPUT_DIR",
|
|
32
36
|
"BUILD_ARG_START_COMMAND",
|
|
33
|
-
"ALPIC_HOST"
|
|
37
|
+
"ALPIC_HOST",
|
|
38
|
+
"ALPIC_CUSTOM_DOMAINS"
|
|
34
39
|
];
|
|
35
40
|
const environmentVariableSchema = z.object({
|
|
36
41
|
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"),
|
|
@@ -38,6 +43,10 @@ const environmentVariableSchema = z.object({
|
|
|
38
43
|
isSecret: z.boolean().default(false)
|
|
39
44
|
});
|
|
40
45
|
const environmentVariablesSchema = z.array(environmentVariableSchema);
|
|
46
|
+
const updateEnvironmentVariableSchema = environmentVariableSchema.partial({
|
|
47
|
+
value: true,
|
|
48
|
+
isSecret: true
|
|
49
|
+
});
|
|
41
50
|
const buildSettingsSchema = z.object({
|
|
42
51
|
installCommand: z.string().optional(),
|
|
43
52
|
buildCommand: z.string().optional(),
|
|
@@ -55,7 +64,104 @@ const transportSchema = z.enum([
|
|
|
55
64
|
"sse",
|
|
56
65
|
"streamablehttp"
|
|
57
66
|
]);
|
|
58
|
-
|
|
67
|
+
const auditStatusSchema = z.enum([
|
|
68
|
+
"pending",
|
|
69
|
+
"partial",
|
|
70
|
+
"completed",
|
|
71
|
+
"failed"
|
|
72
|
+
]);
|
|
73
|
+
const platformSchema = z.enum(["chatgpt", "claudeai"]);
|
|
74
|
+
const checkSeveritySchema = z.enum([
|
|
75
|
+
"error",
|
|
76
|
+
"warning",
|
|
77
|
+
"info"
|
|
78
|
+
]);
|
|
79
|
+
const checkCategorySchema = z.enum([
|
|
80
|
+
"connectivity",
|
|
81
|
+
"tool-metadata",
|
|
82
|
+
"resource-metadata",
|
|
83
|
+
"performance",
|
|
84
|
+
"e2e"
|
|
85
|
+
]);
|
|
86
|
+
const checkScopeSchema = z.enum(["server", "view"]);
|
|
87
|
+
const checkDetailSchema = z.object({
|
|
88
|
+
label: z.string(),
|
|
89
|
+
value: z.string().optional()
|
|
90
|
+
});
|
|
91
|
+
const checkResultSchema = z.object({
|
|
92
|
+
checkId: z.string(),
|
|
93
|
+
checkName: z.string(),
|
|
94
|
+
description: z.string(),
|
|
95
|
+
status: z.enum([
|
|
96
|
+
"pass",
|
|
97
|
+
"fail",
|
|
98
|
+
"skip",
|
|
99
|
+
"pending"
|
|
100
|
+
]),
|
|
101
|
+
message: z.string(),
|
|
102
|
+
skipReason: z.string().optional(),
|
|
103
|
+
severity: checkSeveritySchema,
|
|
104
|
+
category: checkCategorySchema,
|
|
105
|
+
scope: checkScopeSchema,
|
|
106
|
+
platforms: z.array(platformSchema).readonly().optional(),
|
|
107
|
+
durationMs: z.number(),
|
|
108
|
+
details: z.array(checkDetailSchema).optional(),
|
|
109
|
+
hint: z.object({ text: z.string() }).optional()
|
|
110
|
+
});
|
|
111
|
+
const auditReportSchema = z.object({
|
|
112
|
+
schemaVersion: z.string(),
|
|
113
|
+
auditId: z.string(),
|
|
114
|
+
targetUrl: z.string(),
|
|
115
|
+
startedAt: z.string(),
|
|
116
|
+
completedAt: z.string(),
|
|
117
|
+
durationMs: z.number(),
|
|
118
|
+
results: z.array(checkResultSchema),
|
|
119
|
+
requiresAuth: z.boolean(),
|
|
120
|
+
hasViewSupport: z.boolean(),
|
|
121
|
+
viewPlatforms: z.array(platformSchema).readonly().optional(),
|
|
122
|
+
isReadyForPlatform: z.record(platformSchema, z.boolean()),
|
|
123
|
+
widgetScreenshotKeys: z.object({
|
|
124
|
+
chatgpt: z.string().optional(),
|
|
125
|
+
claudeai: z.string().optional()
|
|
126
|
+
}).optional(),
|
|
127
|
+
widgetScreenshots: z.object({
|
|
128
|
+
chatgpt: z.object({ url: z.string() }).optional(),
|
|
129
|
+
claudeai: z.object({ url: z.string() }).optional()
|
|
130
|
+
}).optional()
|
|
131
|
+
});
|
|
132
|
+
const playgroundHeaderSchema = z.object({
|
|
133
|
+
name: z.string().min(1).max(100),
|
|
134
|
+
description: z.string().max(200),
|
|
135
|
+
isRequired: z.boolean().default(false),
|
|
136
|
+
isSecret: z.boolean().default(false)
|
|
137
|
+
});
|
|
138
|
+
const playgroundExamplePromptSchema = z.object({
|
|
139
|
+
title: z.string().min(1).max(100),
|
|
140
|
+
prompt: z.string().min(1).max(500)
|
|
141
|
+
});
|
|
142
|
+
const serverFieldsSchema = z.object({
|
|
143
|
+
$schema: z.string(),
|
|
144
|
+
name: z.string(),
|
|
145
|
+
description: z.string(),
|
|
146
|
+
version: z.string().optional(),
|
|
147
|
+
title: z.string().optional(),
|
|
148
|
+
websiteUrl: z.url().optional(),
|
|
149
|
+
icons: z.array(z.object({
|
|
150
|
+
src: z.url(),
|
|
151
|
+
mimeType: z.string().optional(),
|
|
152
|
+
sizes: z.array(z.string()).optional()
|
|
153
|
+
})).optional(),
|
|
154
|
+
remotes: z.array(z.object({
|
|
155
|
+
type: z.string(),
|
|
156
|
+
url: z.url().optional(),
|
|
157
|
+
headers: z.array(z.object({
|
|
158
|
+
name: z.string(),
|
|
159
|
+
description: z.string(),
|
|
160
|
+
isRequired: z.boolean().optional(),
|
|
161
|
+
isSecret: z.boolean().optional()
|
|
162
|
+
})).optional()
|
|
163
|
+
})).optional()
|
|
164
|
+
});
|
|
59
165
|
//#endregion
|
|
60
166
|
//#region src/api.contract.ts
|
|
61
167
|
const deploymentStatusSchema = z.enum([
|
|
@@ -80,9 +186,16 @@ const deploymentSchema = z.object({
|
|
|
80
186
|
authorUsername: z.string().nullable(),
|
|
81
187
|
authorAvatarUrl: z.string().nullable(),
|
|
82
188
|
startedAt: z.coerce.date().nullable(),
|
|
83
|
-
completedAt: z.coerce.date().nullable()
|
|
189
|
+
completedAt: z.coerce.date().nullable(),
|
|
190
|
+
environmentId: z.string(),
|
|
191
|
+
environmentName: z.string(),
|
|
192
|
+
isCurrent: z.boolean(),
|
|
193
|
+
deploymentPageUrl: z.url().nullable()
|
|
84
194
|
});
|
|
85
|
-
const
|
|
195
|
+
const isValidLogTimeInput = (value) => {
|
|
196
|
+
if (ms(value) !== void 0) return true;
|
|
197
|
+
return !Number.isNaN(new Date(value).getTime());
|
|
198
|
+
};
|
|
86
199
|
const createEnvironmentContractV1 = oc.route({
|
|
87
200
|
path: "/v1/environments",
|
|
88
201
|
method: "POST",
|
|
@@ -122,10 +235,20 @@ const getEnvironmentContractV1 = oc.route({
|
|
|
122
235
|
createdAt: z.coerce.date(),
|
|
123
236
|
projectId: z.string()
|
|
124
237
|
}));
|
|
238
|
+
const domainSchema = z.object({
|
|
239
|
+
domain: z.string(),
|
|
240
|
+
status: z.enum([
|
|
241
|
+
"ongoing",
|
|
242
|
+
"deployed",
|
|
243
|
+
"failed"
|
|
244
|
+
]),
|
|
245
|
+
createdAt: z.coerce.date()
|
|
246
|
+
});
|
|
125
247
|
const productionEnvironmentSchema = z.object({
|
|
126
248
|
id: z.string(),
|
|
127
249
|
name: z.string(),
|
|
128
250
|
mcpServerUrl: z.string(),
|
|
251
|
+
domains: z.array(domainSchema),
|
|
129
252
|
latestDeployment: latestDeploymentSchema.nullable()
|
|
130
253
|
});
|
|
131
254
|
const environmentSchema = z.object({
|
|
@@ -168,7 +291,7 @@ const listProjectsContractV1 = oc.route({
|
|
|
168
291
|
description: "List all projects for a team",
|
|
169
292
|
tags: ["projects"],
|
|
170
293
|
successDescription: "The list of projects"
|
|
171
|
-
}).output(z.array(projectOutputSchema));
|
|
294
|
+
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.array(projectOutputSchema));
|
|
172
295
|
const createProjectContractV1 = oc.route({
|
|
173
296
|
path: "/v1/projects",
|
|
174
297
|
method: "POST",
|
|
@@ -181,7 +304,7 @@ const createProjectContractV1 = oc.route({
|
|
|
181
304
|
BAD_REQUEST: {}
|
|
182
305
|
}).input(z.object({
|
|
183
306
|
teamId: z.string().optional(),
|
|
184
|
-
name: z.string().min(1).max(100),
|
|
307
|
+
name: z.string().trim().min(1).max(100),
|
|
185
308
|
sourceRepository: z.string().optional(),
|
|
186
309
|
branchName: z.string().min(1).optional(),
|
|
187
310
|
runtime: runtimeSchema,
|
|
@@ -211,8 +334,61 @@ const createProjectContractV1 = oc.route({
|
|
|
211
334
|
startCommand: z.string().nullable(),
|
|
212
335
|
createdAt: z.coerce.date()
|
|
213
336
|
}));
|
|
337
|
+
const environmentVariableOutputSchema = z.object({
|
|
338
|
+
id: z.string(),
|
|
339
|
+
key: z.string(),
|
|
340
|
+
value: z.string(),
|
|
341
|
+
isSecret: z.boolean(),
|
|
342
|
+
createdAt: z.coerce.date()
|
|
343
|
+
});
|
|
344
|
+
const listEnvironmentVariablesContractV1 = oc.route({
|
|
345
|
+
path: "/v1/environments/{environmentId}/environment-variables",
|
|
346
|
+
method: "GET",
|
|
347
|
+
summary: "List environment variables",
|
|
348
|
+
description: "List all environment variables for an environment",
|
|
349
|
+
tags: ["environments"],
|
|
350
|
+
successDescription: "The list of environment variables"
|
|
351
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(z.array(environmentVariableOutputSchema));
|
|
352
|
+
const createEnvironmentVariablesContractV1 = oc.route({
|
|
353
|
+
path: "/v1/environments/{environmentId}/environment-variables",
|
|
354
|
+
method: "POST",
|
|
355
|
+
summary: "Add environment variables",
|
|
356
|
+
description: "Add one or more environment variables to an environment",
|
|
357
|
+
tags: ["environments"],
|
|
358
|
+
successDescription: "The environment variables have been added successfully"
|
|
359
|
+
}).errors({
|
|
360
|
+
NOT_FOUND: {},
|
|
361
|
+
BAD_REQUEST: {}
|
|
362
|
+
}).input(z.object({
|
|
363
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
364
|
+
environmentVariables: environmentVariablesSchema
|
|
365
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
366
|
+
const updateEnvironmentVariableContractV1 = oc.route({
|
|
367
|
+
path: "/v1/environment-variables/{environmentVariableId}",
|
|
368
|
+
method: "PATCH",
|
|
369
|
+
summary: "Update an environment variable",
|
|
370
|
+
description: "Update an environment variable by ID",
|
|
371
|
+
tags: ["environments"],
|
|
372
|
+
successDescription: "The environment variable has been updated successfully"
|
|
373
|
+
}).errors({
|
|
374
|
+
NOT_FOUND: {},
|
|
375
|
+
BAD_REQUEST: {}
|
|
376
|
+
}).input(z.object({
|
|
377
|
+
environmentVariableId: z.string().describe("The ID of the environment variable"),
|
|
378
|
+
key: environmentVariableSchema.shape.key,
|
|
379
|
+
value: environmentVariableSchema.shape.value.optional(),
|
|
380
|
+
isSecret: environmentVariableSchema.shape.isSecret.optional()
|
|
381
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
382
|
+
const deleteEnvironmentVariableContractV1 = oc.route({
|
|
383
|
+
path: "/v1/environment-variables/{environmentVariableId}",
|
|
384
|
+
method: "DELETE",
|
|
385
|
+
summary: "Delete an environment variable",
|
|
386
|
+
description: "Delete an environment variable by ID",
|
|
387
|
+
tags: ["environments"],
|
|
388
|
+
successDescription: "The environment variable has been deleted successfully"
|
|
389
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentVariableId: z.string().describe("The ID of the environment variable") })).output(z.object({ success: z.literal(true) }));
|
|
214
390
|
const deleteProjectContractV1 = oc.route({
|
|
215
|
-
path: "/v1/projects
|
|
391
|
+
path: "/v1/projects/{projectId}",
|
|
216
392
|
method: "DELETE",
|
|
217
393
|
summary: "Delete a project",
|
|
218
394
|
description: "Delete a project and all its environments",
|
|
@@ -247,7 +423,7 @@ const deployEnvironmentContractV1 = oc.route({
|
|
|
247
423
|
}).input(z.object({
|
|
248
424
|
environmentId: z.string().describe("The ID of the environment to deploy"),
|
|
249
425
|
token: z.string().describe("The token to identify the source archive").optional()
|
|
250
|
-
})).output(
|
|
426
|
+
})).output(deploymentSchema);
|
|
251
427
|
const uploadDeploymentArtifactContractV1 = oc.route({
|
|
252
428
|
path: "/v1/deployments/upload",
|
|
253
429
|
method: "POST",
|
|
@@ -256,21 +432,22 @@ const uploadDeploymentArtifactContractV1 = oc.route({
|
|
|
256
432
|
tags: ["deployments"],
|
|
257
433
|
successDescription: "The presigned upload URL has been generated successfully"
|
|
258
434
|
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.object({
|
|
259
|
-
uploadUrl: z.
|
|
435
|
+
uploadUrl: z.url().describe("Presigned S3 URL to upload the source archive with HTTP PUT"),
|
|
260
436
|
token: z.string().describe("Token to identify the source archive"),
|
|
261
437
|
expiresAt: z.coerce.date().describe("Expiration date of the presigned URL")
|
|
262
438
|
}));
|
|
263
|
-
const
|
|
439
|
+
const listDeploymentsContractV1 = oc.route({
|
|
264
440
|
path: "/v1/projects/{projectId}/deployments",
|
|
265
441
|
method: "GET",
|
|
266
442
|
summary: "List project deployments",
|
|
267
443
|
description: "List all deployments for a project",
|
|
268
444
|
tags: ["deployments"],
|
|
269
445
|
successDescription: "The list of deployments"
|
|
270
|
-
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
446
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
447
|
+
projectId: z.string().describe("The ID of the project"),
|
|
448
|
+
status: z.array(deploymentStatusSchema).optional().describe("Filter by one or more statuses"),
|
|
449
|
+
environmentId: z.string().optional().describe("Filter by environment ID")
|
|
450
|
+
})).output(z.array(deploymentSchema));
|
|
274
451
|
const getDeploymentContractV1 = oc.route({
|
|
275
452
|
path: "/v1/deployments/{deploymentId}",
|
|
276
453
|
method: "GET",
|
|
@@ -278,7 +455,83 @@ const getDeploymentContractV1 = oc.route({
|
|
|
278
455
|
description: "Get a deployment by ID",
|
|
279
456
|
tags: ["deployments"],
|
|
280
457
|
successDescription: "The deployment details"
|
|
281
|
-
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(
|
|
458
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(deploymentSchema);
|
|
459
|
+
const getLogsContractV1 = oc.route({
|
|
460
|
+
path: "/v1/environments/{environmentId}/logs",
|
|
461
|
+
method: "GET",
|
|
462
|
+
summary: "Get logs",
|
|
463
|
+
description: "Get logs for an environment",
|
|
464
|
+
tags: ["environments"],
|
|
465
|
+
successDescription: "The logs"
|
|
466
|
+
}).errors({
|
|
467
|
+
NOT_FOUND: {},
|
|
468
|
+
BAD_REQUEST: {}
|
|
469
|
+
}).input(z.object({
|
|
470
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
471
|
+
since: z.string().refine(isValidLogTimeInput, { message: "Invalid time. Use relative (1h, 30m, 2d) or ISO 8601 format." }).optional().describe("Start time — ISO 8601 (2024-01-01T00:00:00Z) or relative (1h, 30m, 2d)"),
|
|
472
|
+
until: z.string().refine(isValidLogTimeInput, { message: "Invalid time. Use relative (1h, 30m, 2d) or ISO 8601 format." }).optional().describe("End time — ISO 8601 or relative"),
|
|
473
|
+
limit: z.coerce.number().int().min(1).max(1e3).default(1e3).describe("Maximum number of log entries to return."),
|
|
474
|
+
level: z.array(z.enum([
|
|
475
|
+
"INFO",
|
|
476
|
+
"ERROR",
|
|
477
|
+
"WARNING",
|
|
478
|
+
"DEBUG"
|
|
479
|
+
])).optional().describe("Filter by log level"),
|
|
480
|
+
search: z.string().optional().describe("Filter pattern to search for in log content"),
|
|
481
|
+
nextToken: z.string().optional().describe("Pagination token from a previous response")
|
|
482
|
+
})).output(z.object({
|
|
483
|
+
logs: z.array(z.object({
|
|
484
|
+
timestamp: z.coerce.date(),
|
|
485
|
+
type: z.enum([
|
|
486
|
+
"START",
|
|
487
|
+
"END",
|
|
488
|
+
"INFO",
|
|
489
|
+
"ERROR",
|
|
490
|
+
"WARNING",
|
|
491
|
+
"DEBUG"
|
|
492
|
+
]),
|
|
493
|
+
requestId: z.string(),
|
|
494
|
+
content: z.string().optional(),
|
|
495
|
+
method: z.string().optional(),
|
|
496
|
+
durationInMs: z.number().optional()
|
|
497
|
+
})),
|
|
498
|
+
nextToken: z.string().nullable()
|
|
499
|
+
}));
|
|
500
|
+
const getLatestLogsContractV1 = oc.route({
|
|
501
|
+
path: "/v1/environments/{environmentId}/latest-logs",
|
|
502
|
+
method: "GET",
|
|
503
|
+
summary: "Get latest logs",
|
|
504
|
+
description: "Get the N most recent logs for an environment",
|
|
505
|
+
tags: ["environments"],
|
|
506
|
+
successDescription: "The latest logs"
|
|
507
|
+
}).errors({
|
|
508
|
+
NOT_FOUND: {},
|
|
509
|
+
BAD_REQUEST: {}
|
|
510
|
+
}).input(z.object({
|
|
511
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
512
|
+
limit: z.coerce.number().int().min(1).max(1e3).default(100).describe("Number of most recent log entries to return"),
|
|
513
|
+
level: z.array(z.enum([
|
|
514
|
+
"INFO",
|
|
515
|
+
"ERROR",
|
|
516
|
+
"WARNING",
|
|
517
|
+
"DEBUG"
|
|
518
|
+
])).optional().describe("Filter by log level"),
|
|
519
|
+
search: z.string().optional().describe("Filter pattern to search for in log content")
|
|
520
|
+
})).output(z.object({ logs: z.array(z.object({
|
|
521
|
+
timestamp: z.coerce.date(),
|
|
522
|
+
type: z.enum([
|
|
523
|
+
"START",
|
|
524
|
+
"END",
|
|
525
|
+
"INFO",
|
|
526
|
+
"ERROR",
|
|
527
|
+
"WARNING",
|
|
528
|
+
"DEBUG"
|
|
529
|
+
]),
|
|
530
|
+
requestId: z.string(),
|
|
531
|
+
content: z.string().optional(),
|
|
532
|
+
method: z.string().optional(),
|
|
533
|
+
durationInMs: z.number().optional()
|
|
534
|
+
})) }));
|
|
282
535
|
const getDeploymentLogsContractV1 = oc.route({
|
|
283
536
|
path: "/v1/deployments/{deploymentId}/logs",
|
|
284
537
|
method: "GET",
|
|
@@ -342,14 +595,129 @@ const listTeamsContractV1 = oc.route({
|
|
|
342
595
|
id: z.string(),
|
|
343
596
|
name: z.string(),
|
|
344
597
|
createdAt: z.coerce.date(),
|
|
345
|
-
hasStripeAccount: z.boolean()
|
|
346
|
-
hasActiveSubscription: z.boolean()
|
|
598
|
+
hasStripeAccount: z.boolean()
|
|
347
599
|
})));
|
|
600
|
+
const getTunnelTicketContractV1 = oc.route({
|
|
601
|
+
path: "/v1/tunnels/ticket",
|
|
602
|
+
method: "GET",
|
|
603
|
+
summary: "Get a tunnel ticket",
|
|
604
|
+
description: "Get a signed ticket for establishing a tunnel connection. Requires user authentication (API keys are not supported).",
|
|
605
|
+
tags: ["tunnels"],
|
|
606
|
+
successDescription: "The tunnel ticket"
|
|
607
|
+
}).output(z.object({
|
|
608
|
+
subdomain: z.string().describe("The subdomain assigned to the user"),
|
|
609
|
+
ticket: z.string().describe("The signed tunnel ticket"),
|
|
610
|
+
tunnelHost: z.string().describe("The tunnel host to connect to")
|
|
611
|
+
}));
|
|
612
|
+
const publishServerContractV1 = oc.route({
|
|
613
|
+
path: "/v1/distribution/publish",
|
|
614
|
+
method: "POST",
|
|
615
|
+
summary: "Publish a server to the MCP registry",
|
|
616
|
+
tags: ["distribution"],
|
|
617
|
+
successDescription: "The server has been published successfully"
|
|
618
|
+
}).errors({
|
|
619
|
+
NOT_FOUND: {},
|
|
620
|
+
BAD_REQUEST: {}
|
|
621
|
+
}).input(z.object({
|
|
622
|
+
projectId: z.string(),
|
|
623
|
+
domain: z.string(),
|
|
624
|
+
title: z.string().min(1).max(100),
|
|
625
|
+
description: z.string().min(1).max(100),
|
|
626
|
+
websiteUrl: z.url().max(255).optional(),
|
|
627
|
+
iconSrc: z.url().max(255).optional(),
|
|
628
|
+
dryRun: z.boolean().optional()
|
|
629
|
+
})).output(z.object({ serverFields: serverFieldsSchema }));
|
|
630
|
+
const getServerInfoContractV1 = oc.route({
|
|
631
|
+
path: "/v1/distribution/get",
|
|
632
|
+
method: "GET",
|
|
633
|
+
summary: "Get server info",
|
|
634
|
+
description: "Get info about a server",
|
|
635
|
+
tags: ["distribution"],
|
|
636
|
+
successDescription: "The server info"
|
|
637
|
+
}).errors({
|
|
638
|
+
NOT_FOUND: {},
|
|
639
|
+
BAD_REQUEST: {}
|
|
640
|
+
}).input(z.object({
|
|
641
|
+
projectId: z.string(),
|
|
642
|
+
domain: z.string()
|
|
643
|
+
})).output(z.object({ serverFields: serverFieldsSchema }));
|
|
644
|
+
const playgroundServerMetadataOutputSchema = z.object({
|
|
645
|
+
name: z.string(),
|
|
646
|
+
description: z.string(),
|
|
647
|
+
headers: z.array(z.object({
|
|
648
|
+
name: z.string(),
|
|
649
|
+
description: z.string(),
|
|
650
|
+
isRequired: z.boolean(),
|
|
651
|
+
isSecret: z.boolean()
|
|
652
|
+
})),
|
|
653
|
+
examplePrompts: z.array(playgroundExamplePromptSchema)
|
|
654
|
+
});
|
|
655
|
+
const playgroundOutputSchema = z.object({
|
|
656
|
+
isPlaygroundEnabled: z.boolean(),
|
|
657
|
+
serverMetadata: playgroundServerMetadataOutputSchema.nullable()
|
|
658
|
+
});
|
|
659
|
+
const getPlaygroundContractV1 = oc.route({
|
|
660
|
+
path: "/v1/environments/{environmentId}/playground",
|
|
661
|
+
method: "GET",
|
|
662
|
+
summary: "Get playground configuration",
|
|
663
|
+
description: "Get the playground configuration for an environment",
|
|
664
|
+
tags: ["environments"],
|
|
665
|
+
successDescription: "The playground configuration"
|
|
666
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(playgroundOutputSchema);
|
|
667
|
+
const upsertPlaygroundContractV1 = oc.route({
|
|
668
|
+
path: "/v1/environments/{environmentId}/playground",
|
|
669
|
+
method: "PUT",
|
|
670
|
+
summary: "Update playground configuration",
|
|
671
|
+
description: "Update the playground configuration for an environment. All fields are optional — only provided fields are updated.",
|
|
672
|
+
tags: ["environments"],
|
|
673
|
+
successDescription: "The updated playground configuration"
|
|
674
|
+
}).errors({
|
|
675
|
+
NOT_FOUND: {},
|
|
676
|
+
BAD_REQUEST: {}
|
|
677
|
+
}).input(z.object({
|
|
678
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
679
|
+
isPlaygroundEnabled: z.boolean().optional(),
|
|
680
|
+
name: z.string().min(1).max(100).optional(),
|
|
681
|
+
description: z.string().min(1).max(500).optional(),
|
|
682
|
+
headers: z.array(playgroundHeaderSchema).optional(),
|
|
683
|
+
examplePrompts: z.array(playgroundExamplePromptSchema).max(3).optional()
|
|
684
|
+
})).output(playgroundOutputSchema);
|
|
685
|
+
const createBeaconContractV1 = oc.route({
|
|
686
|
+
path: "/v1/beacon/audits",
|
|
687
|
+
method: "POST",
|
|
688
|
+
summary: "Create a beacon audit",
|
|
689
|
+
description: "Audit an MCP server for spec compliance and AI client compatibility",
|
|
690
|
+
tags: ["beacon"],
|
|
691
|
+
successDescription: "The audit has been created"
|
|
692
|
+
}).errors({
|
|
693
|
+
NOT_FOUND: {},
|
|
694
|
+
BAD_REQUEST: {}
|
|
695
|
+
}).input(z.object({
|
|
696
|
+
targetUrl: z.string().url().describe("The HTTPS URL of the MCP server to audit"),
|
|
697
|
+
teamId: z.string().optional().describe("The team ID to associate the audit with"),
|
|
698
|
+
projectId: z.string().optional().describe("The project ID to associate the audit with"),
|
|
699
|
+
excludeCategories: z.array(checkCategorySchema).optional().describe("Check categories to exclude from the audit")
|
|
700
|
+
})).output(z.object({ id: z.string() }));
|
|
701
|
+
const getBeaconContractV1 = oc.route({
|
|
702
|
+
path: "/v1/beacon/audits/{auditId}",
|
|
703
|
+
method: "GET",
|
|
704
|
+
summary: "Get a beacon audit",
|
|
705
|
+
description: "Get a beacon audit by ID, including the report if completed",
|
|
706
|
+
tags: ["beacon"],
|
|
707
|
+
successDescription: "The audit details"
|
|
708
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ auditId: z.string().describe("The ID of the audit") })).output(z.object({
|
|
709
|
+
id: z.string(),
|
|
710
|
+
targetUrl: z.string(),
|
|
711
|
+
status: auditStatusSchema,
|
|
712
|
+
durationMs: z.number().nullable(),
|
|
713
|
+
createdAt: z.coerce.date(),
|
|
714
|
+
report: auditReportSchema.nullable()
|
|
715
|
+
}));
|
|
348
716
|
const contract = {
|
|
349
717
|
teams: { list: { v1: listTeamsContractV1 } },
|
|
350
718
|
analytics: { get: { v1: getProjectAnalyticsContractV1 } },
|
|
351
719
|
deployments: {
|
|
352
|
-
list: { v1:
|
|
720
|
+
list: { v1: listDeploymentsContractV1 },
|
|
353
721
|
get: { v1: getDeploymentContractV1 },
|
|
354
722
|
uploadArtifact: { v1: uploadDeploymentArtifactContractV1 },
|
|
355
723
|
getLogs: { v1: getDeploymentLogsContractV1 }
|
|
@@ -357,7 +725,15 @@ const contract = {
|
|
|
357
725
|
environments: {
|
|
358
726
|
create: { v1: createEnvironmentContractV1 },
|
|
359
727
|
get: { v1: getEnvironmentContractV1 },
|
|
360
|
-
deploy: { v1: deployEnvironmentContractV1 }
|
|
728
|
+
deploy: { v1: deployEnvironmentContractV1 },
|
|
729
|
+
getLogs: { v1: getLogsContractV1 },
|
|
730
|
+
getLatestLogs: { v1: getLatestLogsContractV1 }
|
|
731
|
+
},
|
|
732
|
+
environmentVariables: {
|
|
733
|
+
list: { v1: listEnvironmentVariablesContractV1 },
|
|
734
|
+
create: { v1: createEnvironmentVariablesContractV1 },
|
|
735
|
+
update: { v1: updateEnvironmentVariableContractV1 },
|
|
736
|
+
delete: { v1: deleteEnvironmentVariableContractV1 }
|
|
361
737
|
},
|
|
362
738
|
projects: {
|
|
363
739
|
update: { v1: updateProjectContractV1 },
|
|
@@ -365,8 +741,20 @@ const contract = {
|
|
|
365
741
|
list: { v1: listProjectsContractV1 },
|
|
366
742
|
create: { v1: createProjectContractV1 },
|
|
367
743
|
delete: { v1: deleteProjectContractV1 }
|
|
744
|
+
},
|
|
745
|
+
playground: {
|
|
746
|
+
get: { v1: getPlaygroundContractV1 },
|
|
747
|
+
upsert: { v1: upsertPlaygroundContractV1 }
|
|
748
|
+
},
|
|
749
|
+
tunnels: { getTicket: { v1: getTunnelTicketContractV1 } },
|
|
750
|
+
distribution: {
|
|
751
|
+
publish: { v1: publishServerContractV1 },
|
|
752
|
+
get: { v1: getServerInfoContractV1 }
|
|
753
|
+
},
|
|
754
|
+
beacon: {
|
|
755
|
+
create: { v1: createBeaconContractV1 },
|
|
756
|
+
get: { v1: getBeaconContractV1 }
|
|
368
757
|
}
|
|
369
758
|
};
|
|
370
|
-
|
|
371
759
|
//#endregion
|
|
372
|
-
export { buildSettingsSchema, contract, createEnvironmentContractV1, environmentVariableSchema, environmentVariablesSchema, runtimeSchema, transportSchema };
|
|
760
|
+
export { auditReportSchema, auditStatusSchema, buildSettingsSchema, checkCategorySchema, checkDetailSchema, checkResultSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, platformSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
|
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.08782cb",
|
|
4
4
|
"description": "Contract for the Alpic API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -17,22 +17,25 @@
|
|
|
17
17
|
"author": "Alpic",
|
|
18
18
|
"license": "ISC",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@orpc/contract": "^1.13.
|
|
20
|
+
"@orpc/contract": "^1.13.14",
|
|
21
|
+
"ms": "^2.1.3",
|
|
21
22
|
"zod": "^4.3.6"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
26
|
+
"@types/ms": "^2.1.0",
|
|
25
27
|
"shx": "^0.4.0",
|
|
26
|
-
"tsdown": "^0.
|
|
27
|
-
"typescript": "^
|
|
28
|
-
"vitest": "^4.
|
|
28
|
+
"tsdown": "^0.21.8",
|
|
29
|
+
"typescript": "^6.0.2",
|
|
30
|
+
"vitest": "^4.1.4"
|
|
29
31
|
},
|
|
30
32
|
"scripts": {
|
|
31
33
|
"build": "shx rm -rf dist && tsdown",
|
|
32
|
-
"format": "biome check --write --error-on-warnings",
|
|
34
|
+
"format": "biome check --write --error-on-warnings .",
|
|
33
35
|
"test": "pnpm run test:unit && pnpm run test:type && pnpm run test:format",
|
|
34
36
|
"test:unit": "vitest run",
|
|
35
|
-
"test:format": "
|
|
36
|
-
"test:type": "tsc --noEmit"
|
|
37
|
+
"test:format": "biome check --error-on-warnings .",
|
|
38
|
+
"test:type": "tsc --noEmit",
|
|
39
|
+
"publish:npm": "pnpm publish --tag \"${NPM_TAG}\" --access public --no-git-checks"
|
|
37
40
|
}
|
|
38
41
|
}
|