@alpic-ai/api 0.0.0-staging.f2a9041 → 0.0.0-staging.f2b9397
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 +656 -41
- package/dist/index.mjs +409 -19
- package/package.json +11 -9
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,8 +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
|
});
|
|
195
|
+
const isValidLogTimeInput = (value) => {
|
|
196
|
+
if (ms(value) !== void 0) return true;
|
|
197
|
+
return !Number.isNaN(new Date(value).getTime());
|
|
198
|
+
};
|
|
85
199
|
const createEnvironmentContractV1 = oc.route({
|
|
86
200
|
path: "/v1/environments",
|
|
87
201
|
method: "POST",
|
|
@@ -121,10 +235,20 @@ const getEnvironmentContractV1 = oc.route({
|
|
|
121
235
|
createdAt: z.coerce.date(),
|
|
122
236
|
projectId: z.string()
|
|
123
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
|
+
});
|
|
124
247
|
const productionEnvironmentSchema = z.object({
|
|
125
248
|
id: z.string(),
|
|
126
249
|
name: z.string(),
|
|
127
250
|
mcpServerUrl: z.string(),
|
|
251
|
+
domains: z.array(domainSchema),
|
|
128
252
|
latestDeployment: latestDeploymentSchema.nullable()
|
|
129
253
|
});
|
|
130
254
|
const environmentSchema = z.object({
|
|
@@ -167,7 +291,7 @@ const listProjectsContractV1 = oc.route({
|
|
|
167
291
|
description: "List all projects for a team",
|
|
168
292
|
tags: ["projects"],
|
|
169
293
|
successDescription: "The list of projects"
|
|
170
|
-
}).output(z.array(projectOutputSchema));
|
|
294
|
+
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.array(projectOutputSchema));
|
|
171
295
|
const createProjectContractV1 = oc.route({
|
|
172
296
|
path: "/v1/projects",
|
|
173
297
|
method: "POST",
|
|
@@ -180,7 +304,7 @@ const createProjectContractV1 = oc.route({
|
|
|
180
304
|
BAD_REQUEST: {}
|
|
181
305
|
}).input(z.object({
|
|
182
306
|
teamId: z.string().optional(),
|
|
183
|
-
name: z.string().min(1).max(100),
|
|
307
|
+
name: z.string().trim().min(1).max(100),
|
|
184
308
|
sourceRepository: z.string().optional(),
|
|
185
309
|
branchName: z.string().min(1).optional(),
|
|
186
310
|
runtime: runtimeSchema,
|
|
@@ -210,8 +334,61 @@ const createProjectContractV1 = oc.route({
|
|
|
210
334
|
startCommand: z.string().nullable(),
|
|
211
335
|
createdAt: z.coerce.date()
|
|
212
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) }));
|
|
213
390
|
const deleteProjectContractV1 = oc.route({
|
|
214
|
-
path: "/v1/projects
|
|
391
|
+
path: "/v1/projects/{projectId}",
|
|
215
392
|
method: "DELETE",
|
|
216
393
|
summary: "Delete a project",
|
|
217
394
|
description: "Delete a project and all its environments",
|
|
@@ -230,6 +407,7 @@ const updateProjectContractV1 = oc.route({
|
|
|
230
407
|
BAD_REQUEST: {}
|
|
231
408
|
}).input(z.object({
|
|
232
409
|
projectId: z.string().describe("The ID of the project"),
|
|
410
|
+
name: z.string().min(1).max(100).optional().describe("The new name for the project"),
|
|
233
411
|
sourceRepository: z.string().nullable().optional().describe("The source repository to connect to the project")
|
|
234
412
|
})).output(projectOutputSchema);
|
|
235
413
|
const deployEnvironmentContractV1 = oc.route({
|
|
@@ -254,21 +432,22 @@ const uploadDeploymentArtifactContractV1 = oc.route({
|
|
|
254
432
|
tags: ["deployments"],
|
|
255
433
|
successDescription: "The presigned upload URL has been generated successfully"
|
|
256
434
|
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.object({
|
|
257
|
-
uploadUrl: z.
|
|
435
|
+
uploadUrl: z.url().describe("Presigned S3 URL to upload the source archive with HTTP PUT"),
|
|
258
436
|
token: z.string().describe("Token to identify the source archive"),
|
|
259
437
|
expiresAt: z.coerce.date().describe("Expiration date of the presigned URL")
|
|
260
438
|
}));
|
|
261
|
-
const
|
|
439
|
+
const listDeploymentsContractV1 = oc.route({
|
|
262
440
|
path: "/v1/projects/{projectId}/deployments",
|
|
263
441
|
method: "GET",
|
|
264
442
|
summary: "List project deployments",
|
|
265
443
|
description: "List all deployments for a project",
|
|
266
444
|
tags: ["deployments"],
|
|
267
445
|
successDescription: "The list of deployments"
|
|
268
|
-
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
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));
|
|
272
451
|
const getDeploymentContractV1 = oc.route({
|
|
273
452
|
path: "/v1/deployments/{deploymentId}",
|
|
274
453
|
method: "GET",
|
|
@@ -277,6 +456,82 @@ const getDeploymentContractV1 = oc.route({
|
|
|
277
456
|
tags: ["deployments"],
|
|
278
457
|
successDescription: "The deployment details"
|
|
279
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
|
+
})) }));
|
|
280
535
|
const getDeploymentLogsContractV1 = oc.route({
|
|
281
536
|
path: "/v1/deployments/{deploymentId}/logs",
|
|
282
537
|
method: "GET",
|
|
@@ -340,14 +595,129 @@ const listTeamsContractV1 = oc.route({
|
|
|
340
595
|
id: z.string(),
|
|
341
596
|
name: z.string(),
|
|
342
597
|
createdAt: z.coerce.date(),
|
|
343
|
-
hasStripeAccount: z.boolean()
|
|
344
|
-
hasActiveSubscription: z.boolean()
|
|
598
|
+
hasStripeAccount: z.boolean()
|
|
345
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
|
+
}));
|
|
346
716
|
const contract = {
|
|
347
717
|
teams: { list: { v1: listTeamsContractV1 } },
|
|
348
718
|
analytics: { get: { v1: getProjectAnalyticsContractV1 } },
|
|
349
719
|
deployments: {
|
|
350
|
-
list: { v1:
|
|
720
|
+
list: { v1: listDeploymentsContractV1 },
|
|
351
721
|
get: { v1: getDeploymentContractV1 },
|
|
352
722
|
uploadArtifact: { v1: uploadDeploymentArtifactContractV1 },
|
|
353
723
|
getLogs: { v1: getDeploymentLogsContractV1 }
|
|
@@ -355,7 +725,15 @@ const contract = {
|
|
|
355
725
|
environments: {
|
|
356
726
|
create: { v1: createEnvironmentContractV1 },
|
|
357
727
|
get: { v1: getEnvironmentContractV1 },
|
|
358
|
-
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 }
|
|
359
737
|
},
|
|
360
738
|
projects: {
|
|
361
739
|
update: { v1: updateProjectContractV1 },
|
|
@@ -363,8 +741,20 @@ const contract = {
|
|
|
363
741
|
list: { v1: listProjectsContractV1 },
|
|
364
742
|
create: { v1: createProjectContractV1 },
|
|
365
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 }
|
|
366
757
|
}
|
|
367
758
|
};
|
|
368
|
-
|
|
369
759
|
//#endregion
|
|
370
|
-
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.f2b9397",
|
|
4
4
|
"description": "Contract for the Alpic API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -17,23 +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",
|
|
25
|
-
"
|
|
26
|
+
"@types/ms": "^2.1.0",
|
|
26
27
|
"shx": "^0.4.0",
|
|
27
|
-
"tsdown": "^0.
|
|
28
|
-
"typescript": "^
|
|
29
|
-
"vitest": "^4.
|
|
28
|
+
"tsdown": "^0.21.8",
|
|
29
|
+
"typescript": "^6.0.2",
|
|
30
|
+
"vitest": "^4.1.4"
|
|
30
31
|
},
|
|
31
32
|
"scripts": {
|
|
32
33
|
"build": "shx rm -rf dist && tsdown",
|
|
33
|
-
"format": "biome check --write --error-on-warnings",
|
|
34
|
+
"format": "biome check --write --error-on-warnings .",
|
|
34
35
|
"test": "pnpm run test:unit && pnpm run test:type && pnpm run test:format",
|
|
35
36
|
"test:unit": "vitest run",
|
|
36
|
-
"test:format": "
|
|
37
|
-
"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"
|
|
38
40
|
}
|
|
39
41
|
}
|