@alpic-ai/api 0.0.0-staging.e8d3266 → 0.0.0-staging.eb73fc4
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 +583 -44
- package/dist/index.mjs +352 -20
- 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",
|
|
@@ -34,7 +34,8 @@ const RESERVED_KEYS = [
|
|
|
34
34
|
"BUILD_ARG_BUILD_COMMAND",
|
|
35
35
|
"BUILD_ARG_BUILD_OUTPUT_DIR",
|
|
36
36
|
"BUILD_ARG_START_COMMAND",
|
|
37
|
-
"ALPIC_HOST"
|
|
37
|
+
"ALPIC_HOST",
|
|
38
|
+
"ALPIC_CUSTOM_DOMAINS"
|
|
38
39
|
];
|
|
39
40
|
const environmentVariableSchema = z.object({
|
|
40
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"),
|
|
@@ -59,7 +60,102 @@ const transportSchema = z.enum([
|
|
|
59
60
|
"sse",
|
|
60
61
|
"streamablehttp"
|
|
61
62
|
]);
|
|
62
|
-
|
|
63
|
+
const auditStatusSchema = z.enum([
|
|
64
|
+
"pending",
|
|
65
|
+
"partial",
|
|
66
|
+
"completed",
|
|
67
|
+
"failed"
|
|
68
|
+
]);
|
|
69
|
+
const platformSchema = z.enum(["chatgpt", "claudeai"]);
|
|
70
|
+
const checkSeveritySchema = z.enum([
|
|
71
|
+
"error",
|
|
72
|
+
"warning",
|
|
73
|
+
"info"
|
|
74
|
+
]);
|
|
75
|
+
const checkCategorySchema = z.enum([
|
|
76
|
+
"connectivity",
|
|
77
|
+
"tool-metadata",
|
|
78
|
+
"resource-metadata",
|
|
79
|
+
"performance",
|
|
80
|
+
"e2e"
|
|
81
|
+
]);
|
|
82
|
+
const checkScopeSchema = z.enum(["server", "view"]);
|
|
83
|
+
const checkDetailSchema = z.object({
|
|
84
|
+
label: z.string(),
|
|
85
|
+
value: z.string().optional()
|
|
86
|
+
});
|
|
87
|
+
const checkResultSchema = z.object({
|
|
88
|
+
checkId: z.string(),
|
|
89
|
+
status: z.enum([
|
|
90
|
+
"pass",
|
|
91
|
+
"fail",
|
|
92
|
+
"skip",
|
|
93
|
+
"pending"
|
|
94
|
+
]),
|
|
95
|
+
message: z.string(),
|
|
96
|
+
skipReason: z.string().optional(),
|
|
97
|
+
severity: checkSeveritySchema,
|
|
98
|
+
category: checkCategorySchema,
|
|
99
|
+
scope: checkScopeSchema,
|
|
100
|
+
platforms: z.array(platformSchema).readonly().optional(),
|
|
101
|
+
durationMs: z.number(),
|
|
102
|
+
details: z.array(checkDetailSchema).optional(),
|
|
103
|
+
hint: z.object({ text: z.string() }).optional()
|
|
104
|
+
});
|
|
105
|
+
const auditReportSchema = z.object({
|
|
106
|
+
schemaVersion: z.string(),
|
|
107
|
+
auditId: z.string(),
|
|
108
|
+
targetUrl: z.string(),
|
|
109
|
+
startedAt: z.string(),
|
|
110
|
+
completedAt: z.string(),
|
|
111
|
+
durationMs: z.number(),
|
|
112
|
+
results: z.array(checkResultSchema),
|
|
113
|
+
requiresAuth: z.boolean(),
|
|
114
|
+
hasViewSupport: z.boolean(),
|
|
115
|
+
viewPlatforms: z.array(platformSchema).readonly().optional(),
|
|
116
|
+
isReadyForPlatform: z.record(platformSchema, z.boolean()),
|
|
117
|
+
widgetScreenshotKeys: z.object({
|
|
118
|
+
chatgpt: z.string().optional(),
|
|
119
|
+
claudeai: z.string().optional()
|
|
120
|
+
}).optional(),
|
|
121
|
+
widgetScreenshots: z.object({
|
|
122
|
+
chatgpt: z.object({ url: z.string() }).optional(),
|
|
123
|
+
claudeai: z.object({ url: z.string() }).optional()
|
|
124
|
+
}).optional()
|
|
125
|
+
});
|
|
126
|
+
const playgroundHeaderSchema = z.object({
|
|
127
|
+
name: z.string().min(1).max(100),
|
|
128
|
+
description: z.string().max(200),
|
|
129
|
+
isRequired: z.boolean().default(false),
|
|
130
|
+
isSecret: z.boolean().default(false)
|
|
131
|
+
});
|
|
132
|
+
const playgroundExamplePromptSchema = z.object({
|
|
133
|
+
title: z.string().min(1).max(100),
|
|
134
|
+
prompt: z.string().min(1).max(500)
|
|
135
|
+
});
|
|
136
|
+
const serverFieldsSchema = z.object({
|
|
137
|
+
$schema: z.string(),
|
|
138
|
+
name: z.string(),
|
|
139
|
+
description: z.string(),
|
|
140
|
+
version: z.string().optional(),
|
|
141
|
+
title: z.string().optional(),
|
|
142
|
+
websiteUrl: z.url().optional(),
|
|
143
|
+
icons: z.array(z.object({
|
|
144
|
+
src: z.url(),
|
|
145
|
+
mimeType: z.string().optional(),
|
|
146
|
+
sizes: z.array(z.string()).optional()
|
|
147
|
+
})).optional(),
|
|
148
|
+
remotes: z.array(z.object({
|
|
149
|
+
type: z.string(),
|
|
150
|
+
url: z.url().optional(),
|
|
151
|
+
headers: z.array(z.object({
|
|
152
|
+
name: z.string(),
|
|
153
|
+
description: z.string(),
|
|
154
|
+
isRequired: z.boolean().optional(),
|
|
155
|
+
isSecret: z.boolean().optional()
|
|
156
|
+
})).optional()
|
|
157
|
+
})).optional()
|
|
158
|
+
});
|
|
63
159
|
//#endregion
|
|
64
160
|
//#region src/api.contract.ts
|
|
65
161
|
const deploymentStatusSchema = z.enum([
|
|
@@ -84,9 +180,16 @@ const deploymentSchema = z.object({
|
|
|
84
180
|
authorUsername: z.string().nullable(),
|
|
85
181
|
authorAvatarUrl: z.string().nullable(),
|
|
86
182
|
startedAt: z.coerce.date().nullable(),
|
|
87
|
-
completedAt: z.coerce.date().nullable()
|
|
183
|
+
completedAt: z.coerce.date().nullable(),
|
|
184
|
+
environmentId: z.string(),
|
|
185
|
+
environmentName: z.string(),
|
|
186
|
+
isCurrent: z.boolean(),
|
|
187
|
+
deploymentPageUrl: z.url().nullable()
|
|
88
188
|
});
|
|
89
|
-
const
|
|
189
|
+
const isValidLogTimeInput = (value) => {
|
|
190
|
+
if (ms(value) !== void 0) return true;
|
|
191
|
+
return !Number.isNaN(new Date(value).getTime());
|
|
192
|
+
};
|
|
90
193
|
const createEnvironmentContractV1 = oc.route({
|
|
91
194
|
path: "/v1/environments",
|
|
92
195
|
method: "POST",
|
|
@@ -225,8 +328,61 @@ const createProjectContractV1 = oc.route({
|
|
|
225
328
|
startCommand: z.string().nullable(),
|
|
226
329
|
createdAt: z.coerce.date()
|
|
227
330
|
}));
|
|
331
|
+
const environmentVariableOutputSchema = z.object({
|
|
332
|
+
id: z.string(),
|
|
333
|
+
key: z.string(),
|
|
334
|
+
value: z.string(),
|
|
335
|
+
isSecret: z.boolean(),
|
|
336
|
+
createdAt: z.coerce.date()
|
|
337
|
+
});
|
|
338
|
+
const listEnvironmentVariablesContractV1 = oc.route({
|
|
339
|
+
path: "/v1/environments/{environmentId}/environment-variables",
|
|
340
|
+
method: "GET",
|
|
341
|
+
summary: "List environment variables",
|
|
342
|
+
description: "List all environment variables for an environment",
|
|
343
|
+
tags: ["environments"],
|
|
344
|
+
successDescription: "The list of environment variables"
|
|
345
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(z.array(environmentVariableOutputSchema));
|
|
346
|
+
const createEnvironmentVariablesContractV1 = oc.route({
|
|
347
|
+
path: "/v1/environments/{environmentId}/environment-variables",
|
|
348
|
+
method: "POST",
|
|
349
|
+
summary: "Add environment variables",
|
|
350
|
+
description: "Add one or more environment variables to an environment",
|
|
351
|
+
tags: ["environments"],
|
|
352
|
+
successDescription: "The environment variables have been added successfully"
|
|
353
|
+
}).errors({
|
|
354
|
+
NOT_FOUND: {},
|
|
355
|
+
BAD_REQUEST: {}
|
|
356
|
+
}).input(z.object({
|
|
357
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
358
|
+
environmentVariables: environmentVariablesSchema
|
|
359
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
360
|
+
const updateEnvironmentVariableContractV1 = oc.route({
|
|
361
|
+
path: "/v1/environment-variables/{environmentVariableId}",
|
|
362
|
+
method: "PATCH",
|
|
363
|
+
summary: "Update an environment variable",
|
|
364
|
+
description: "Update an environment variable by ID",
|
|
365
|
+
tags: ["environments"],
|
|
366
|
+
successDescription: "The environment variable has been updated successfully"
|
|
367
|
+
}).errors({
|
|
368
|
+
NOT_FOUND: {},
|
|
369
|
+
BAD_REQUEST: {}
|
|
370
|
+
}).input(z.object({
|
|
371
|
+
environmentVariableId: z.string().describe("The ID of the environment variable"),
|
|
372
|
+
key: environmentVariableSchema.shape.key,
|
|
373
|
+
value: environmentVariableSchema.shape.value.optional(),
|
|
374
|
+
isSecret: environmentVariableSchema.shape.isSecret
|
|
375
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
376
|
+
const deleteEnvironmentVariableContractV1 = oc.route({
|
|
377
|
+
path: "/v1/environment-variables/{environmentVariableId}",
|
|
378
|
+
method: "DELETE",
|
|
379
|
+
summary: "Delete an environment variable",
|
|
380
|
+
description: "Delete an environment variable by ID",
|
|
381
|
+
tags: ["environments"],
|
|
382
|
+
successDescription: "The environment variable has been deleted successfully"
|
|
383
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentVariableId: z.string().describe("The ID of the environment variable") })).output(z.object({ success: z.literal(true) }));
|
|
228
384
|
const deleteProjectContractV1 = oc.route({
|
|
229
|
-
path: "/v1/projects
|
|
385
|
+
path: "/v1/projects/{projectId}",
|
|
230
386
|
method: "DELETE",
|
|
231
387
|
summary: "Delete a project",
|
|
232
388
|
description: "Delete a project and all its environments",
|
|
@@ -261,7 +417,7 @@ const deployEnvironmentContractV1 = oc.route({
|
|
|
261
417
|
}).input(z.object({
|
|
262
418
|
environmentId: z.string().describe("The ID of the environment to deploy"),
|
|
263
419
|
token: z.string().describe("The token to identify the source archive").optional()
|
|
264
|
-
})).output(
|
|
420
|
+
})).output(deploymentSchema);
|
|
265
421
|
const uploadDeploymentArtifactContractV1 = oc.route({
|
|
266
422
|
path: "/v1/deployments/upload",
|
|
267
423
|
method: "POST",
|
|
@@ -270,21 +426,22 @@ const uploadDeploymentArtifactContractV1 = oc.route({
|
|
|
270
426
|
tags: ["deployments"],
|
|
271
427
|
successDescription: "The presigned upload URL has been generated successfully"
|
|
272
428
|
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.object({
|
|
273
|
-
uploadUrl: z.
|
|
429
|
+
uploadUrl: z.url().describe("Presigned S3 URL to upload the source archive with HTTP PUT"),
|
|
274
430
|
token: z.string().describe("Token to identify the source archive"),
|
|
275
431
|
expiresAt: z.coerce.date().describe("Expiration date of the presigned URL")
|
|
276
432
|
}));
|
|
277
|
-
const
|
|
433
|
+
const listDeploymentsContractV1 = oc.route({
|
|
278
434
|
path: "/v1/projects/{projectId}/deployments",
|
|
279
435
|
method: "GET",
|
|
280
436
|
summary: "List project deployments",
|
|
281
437
|
description: "List all deployments for a project",
|
|
282
438
|
tags: ["deployments"],
|
|
283
439
|
successDescription: "The list of deployments"
|
|
284
|
-
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
440
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
441
|
+
projectId: z.string().describe("The ID of the project"),
|
|
442
|
+
status: z.array(deploymentStatusSchema).optional().describe("Filter by one or more statuses"),
|
|
443
|
+
environmentId: z.string().optional().describe("Filter by environment ID")
|
|
444
|
+
})).output(z.array(deploymentSchema));
|
|
288
445
|
const getDeploymentContractV1 = oc.route({
|
|
289
446
|
path: "/v1/deployments/{deploymentId}",
|
|
290
447
|
method: "GET",
|
|
@@ -292,7 +449,48 @@ const getDeploymentContractV1 = oc.route({
|
|
|
292
449
|
description: "Get a deployment by ID",
|
|
293
450
|
tags: ["deployments"],
|
|
294
451
|
successDescription: "The deployment details"
|
|
295
|
-
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(
|
|
452
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(deploymentSchema);
|
|
453
|
+
const getLogsContractV1 = oc.route({
|
|
454
|
+
path: "/v1/environments/{environmentId}/logs",
|
|
455
|
+
method: "GET",
|
|
456
|
+
summary: "Get logs",
|
|
457
|
+
description: "Get logs for an environment",
|
|
458
|
+
tags: ["environments"],
|
|
459
|
+
successDescription: "The logs"
|
|
460
|
+
}).errors({
|
|
461
|
+
NOT_FOUND: {},
|
|
462
|
+
BAD_REQUEST: {}
|
|
463
|
+
}).input(z.object({
|
|
464
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
465
|
+
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)"),
|
|
466
|
+
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"),
|
|
467
|
+
limit: z.coerce.number().int().min(1).max(1e3).default(1e3).describe("Maximum number of log entries to return."),
|
|
468
|
+
level: z.array(z.enum([
|
|
469
|
+
"INFO",
|
|
470
|
+
"ERROR",
|
|
471
|
+
"WARNING",
|
|
472
|
+
"DEBUG"
|
|
473
|
+
])).optional().describe("Filter by log level"),
|
|
474
|
+
search: z.string().optional().describe("Filter pattern to search for in log content"),
|
|
475
|
+
nextToken: z.string().optional().describe("Pagination token from a previous response")
|
|
476
|
+
})).output(z.object({
|
|
477
|
+
logs: z.array(z.object({
|
|
478
|
+
timestamp: z.coerce.date(),
|
|
479
|
+
type: z.enum([
|
|
480
|
+
"START",
|
|
481
|
+
"END",
|
|
482
|
+
"INFO",
|
|
483
|
+
"ERROR",
|
|
484
|
+
"WARNING",
|
|
485
|
+
"DEBUG"
|
|
486
|
+
]),
|
|
487
|
+
requestId: z.string(),
|
|
488
|
+
content: z.string().optional(),
|
|
489
|
+
method: z.string().optional(),
|
|
490
|
+
durationInMs: z.number().optional()
|
|
491
|
+
})),
|
|
492
|
+
nextToken: z.string().nullable()
|
|
493
|
+
}));
|
|
296
494
|
const getDeploymentLogsContractV1 = oc.route({
|
|
297
495
|
path: "/v1/deployments/{deploymentId}/logs",
|
|
298
496
|
method: "GET",
|
|
@@ -356,14 +554,129 @@ const listTeamsContractV1 = oc.route({
|
|
|
356
554
|
id: z.string(),
|
|
357
555
|
name: z.string(),
|
|
358
556
|
createdAt: z.coerce.date(),
|
|
359
|
-
hasStripeAccount: z.boolean()
|
|
360
|
-
hasActiveSubscription: z.boolean()
|
|
557
|
+
hasStripeAccount: z.boolean()
|
|
361
558
|
})));
|
|
559
|
+
const getTunnelTicketContractV1 = oc.route({
|
|
560
|
+
path: "/v1/tunnels/ticket",
|
|
561
|
+
method: "GET",
|
|
562
|
+
summary: "Get a tunnel ticket",
|
|
563
|
+
description: "Get a signed ticket for establishing a tunnel connection. Requires user authentication (API keys are not supported).",
|
|
564
|
+
tags: ["tunnels"],
|
|
565
|
+
successDescription: "The tunnel ticket"
|
|
566
|
+
}).output(z.object({
|
|
567
|
+
subdomain: z.string().describe("The subdomain assigned to the user"),
|
|
568
|
+
ticket: z.string().describe("The signed tunnel ticket"),
|
|
569
|
+
tunnelHost: z.string().describe("The tunnel host to connect to")
|
|
570
|
+
}));
|
|
571
|
+
const publishServerContractV1 = oc.route({
|
|
572
|
+
path: "/v1/distribution/publish",
|
|
573
|
+
method: "POST",
|
|
574
|
+
summary: "Publish a server to the MCP registry",
|
|
575
|
+
tags: ["distribution"],
|
|
576
|
+
successDescription: "The server has been published successfully"
|
|
577
|
+
}).errors({
|
|
578
|
+
NOT_FOUND: {},
|
|
579
|
+
BAD_REQUEST: {}
|
|
580
|
+
}).input(z.object({
|
|
581
|
+
projectId: z.string(),
|
|
582
|
+
domain: z.string(),
|
|
583
|
+
title: z.string().min(1).max(100),
|
|
584
|
+
description: z.string().min(1).max(100),
|
|
585
|
+
websiteUrl: z.url().max(255).optional(),
|
|
586
|
+
iconSrc: z.url().max(255).optional(),
|
|
587
|
+
dryRun: z.boolean().optional()
|
|
588
|
+
})).output(z.object({ serverFields: serverFieldsSchema }));
|
|
589
|
+
const getServerInfoContractV1 = oc.route({
|
|
590
|
+
path: "/v1/distribution/get",
|
|
591
|
+
method: "GET",
|
|
592
|
+
summary: "Get server info",
|
|
593
|
+
description: "Get info about a server",
|
|
594
|
+
tags: ["distribution"],
|
|
595
|
+
successDescription: "The server info"
|
|
596
|
+
}).errors({
|
|
597
|
+
NOT_FOUND: {},
|
|
598
|
+
BAD_REQUEST: {}
|
|
599
|
+
}).input(z.object({
|
|
600
|
+
projectId: z.string(),
|
|
601
|
+
domain: z.string()
|
|
602
|
+
})).output(z.object({ serverFields: serverFieldsSchema }));
|
|
603
|
+
const playgroundServerMetadataOutputSchema = z.object({
|
|
604
|
+
name: z.string(),
|
|
605
|
+
description: z.string(),
|
|
606
|
+
headers: z.array(z.object({
|
|
607
|
+
name: z.string(),
|
|
608
|
+
description: z.string(),
|
|
609
|
+
isRequired: z.boolean(),
|
|
610
|
+
isSecret: z.boolean()
|
|
611
|
+
})),
|
|
612
|
+
examplePrompts: z.array(playgroundExamplePromptSchema)
|
|
613
|
+
});
|
|
614
|
+
const playgroundOutputSchema = z.object({
|
|
615
|
+
isPlaygroundEnabled: z.boolean(),
|
|
616
|
+
serverMetadata: playgroundServerMetadataOutputSchema.nullable()
|
|
617
|
+
});
|
|
618
|
+
const getPlaygroundContractV1 = oc.route({
|
|
619
|
+
path: "/v1/environments/{environmentId}/playground",
|
|
620
|
+
method: "GET",
|
|
621
|
+
summary: "Get playground configuration",
|
|
622
|
+
description: "Get the playground configuration for an environment",
|
|
623
|
+
tags: ["environments"],
|
|
624
|
+
successDescription: "The playground configuration"
|
|
625
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(playgroundOutputSchema);
|
|
626
|
+
const upsertPlaygroundContractV1 = oc.route({
|
|
627
|
+
path: "/v1/environments/{environmentId}/playground",
|
|
628
|
+
method: "PUT",
|
|
629
|
+
summary: "Update playground configuration",
|
|
630
|
+
description: "Update the playground configuration for an environment. All fields are optional — only provided fields are updated.",
|
|
631
|
+
tags: ["environments"],
|
|
632
|
+
successDescription: "The updated playground configuration"
|
|
633
|
+
}).errors({
|
|
634
|
+
NOT_FOUND: {},
|
|
635
|
+
BAD_REQUEST: {}
|
|
636
|
+
}).input(z.object({
|
|
637
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
638
|
+
isPlaygroundEnabled: z.boolean().optional(),
|
|
639
|
+
name: z.string().min(1).max(100).optional(),
|
|
640
|
+
description: z.string().min(1).max(500).optional(),
|
|
641
|
+
headers: z.array(playgroundHeaderSchema).optional(),
|
|
642
|
+
examplePrompts: z.array(playgroundExamplePromptSchema).max(3).optional()
|
|
643
|
+
})).output(playgroundOutputSchema);
|
|
644
|
+
const createBeaconContractV1 = oc.route({
|
|
645
|
+
path: "/v1/beacon/audits",
|
|
646
|
+
method: "POST",
|
|
647
|
+
summary: "Create a beacon audit",
|
|
648
|
+
description: "Audit an MCP server for spec compliance and AI client compatibility",
|
|
649
|
+
tags: ["beacon"],
|
|
650
|
+
successDescription: "The audit has been created"
|
|
651
|
+
}).errors({
|
|
652
|
+
NOT_FOUND: {},
|
|
653
|
+
BAD_REQUEST: {}
|
|
654
|
+
}).input(z.object({
|
|
655
|
+
targetUrl: z.string().url().describe("The HTTPS URL of the MCP server to audit"),
|
|
656
|
+
teamId: z.string().optional().describe("The team ID to associate the audit with"),
|
|
657
|
+
projectId: z.string().optional().describe("The project ID to associate the audit with"),
|
|
658
|
+
excludeCategories: z.array(checkCategorySchema).optional().describe("Check categories to exclude from the audit")
|
|
659
|
+
})).output(z.object({ id: z.string() }));
|
|
660
|
+
const getBeaconContractV1 = oc.route({
|
|
661
|
+
path: "/v1/beacon/audits/{auditId}",
|
|
662
|
+
method: "GET",
|
|
663
|
+
summary: "Get a beacon audit",
|
|
664
|
+
description: "Get a beacon audit by ID, including the report if completed",
|
|
665
|
+
tags: ["beacon"],
|
|
666
|
+
successDescription: "The audit details"
|
|
667
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ auditId: z.string().describe("The ID of the audit") })).output(z.object({
|
|
668
|
+
id: z.string(),
|
|
669
|
+
targetUrl: z.string(),
|
|
670
|
+
status: auditStatusSchema,
|
|
671
|
+
durationMs: z.number().nullable(),
|
|
672
|
+
createdAt: z.coerce.date(),
|
|
673
|
+
report: auditReportSchema.nullable()
|
|
674
|
+
}));
|
|
362
675
|
const contract = {
|
|
363
676
|
teams: { list: { v1: listTeamsContractV1 } },
|
|
364
677
|
analytics: { get: { v1: getProjectAnalyticsContractV1 } },
|
|
365
678
|
deployments: {
|
|
366
|
-
list: { v1:
|
|
679
|
+
list: { v1: listDeploymentsContractV1 },
|
|
367
680
|
get: { v1: getDeploymentContractV1 },
|
|
368
681
|
uploadArtifact: { v1: uploadDeploymentArtifactContractV1 },
|
|
369
682
|
getLogs: { v1: getDeploymentLogsContractV1 }
|
|
@@ -371,7 +684,14 @@ const contract = {
|
|
|
371
684
|
environments: {
|
|
372
685
|
create: { v1: createEnvironmentContractV1 },
|
|
373
686
|
get: { v1: getEnvironmentContractV1 },
|
|
374
|
-
deploy: { v1: deployEnvironmentContractV1 }
|
|
687
|
+
deploy: { v1: deployEnvironmentContractV1 },
|
|
688
|
+
getLogs: { v1: getLogsContractV1 }
|
|
689
|
+
},
|
|
690
|
+
environmentVariables: {
|
|
691
|
+
list: { v1: listEnvironmentVariablesContractV1 },
|
|
692
|
+
create: { v1: createEnvironmentVariablesContractV1 },
|
|
693
|
+
update: { v1: updateEnvironmentVariableContractV1 },
|
|
694
|
+
delete: { v1: deleteEnvironmentVariableContractV1 }
|
|
375
695
|
},
|
|
376
696
|
projects: {
|
|
377
697
|
update: { v1: updateProjectContractV1 },
|
|
@@ -379,8 +699,20 @@ const contract = {
|
|
|
379
699
|
list: { v1: listProjectsContractV1 },
|
|
380
700
|
create: { v1: createProjectContractV1 },
|
|
381
701
|
delete: { v1: deleteProjectContractV1 }
|
|
702
|
+
},
|
|
703
|
+
playground: {
|
|
704
|
+
get: { v1: getPlaygroundContractV1 },
|
|
705
|
+
upsert: { v1: upsertPlaygroundContractV1 }
|
|
706
|
+
},
|
|
707
|
+
tunnels: { getTicket: { v1: getTunnelTicketContractV1 } },
|
|
708
|
+
distribution: {
|
|
709
|
+
publish: { v1: publishServerContractV1 },
|
|
710
|
+
get: { v1: getServerInfoContractV1 }
|
|
711
|
+
},
|
|
712
|
+
beacon: {
|
|
713
|
+
create: { v1: createBeaconContractV1 },
|
|
714
|
+
get: { v1: getBeaconContractV1 }
|
|
382
715
|
}
|
|
383
716
|
};
|
|
384
|
-
|
|
385
717
|
//#endregion
|
|
386
|
-
export { buildSettingsSchema, contract, createEnvironmentContractV1, environmentVariableSchema, environmentVariablesSchema, runtimeSchema, transportSchema };
|
|
718
|
+
export { auditReportSchema, auditStatusSchema, buildSettingsSchema, checkCategorySchema, checkDetailSchema, checkResultSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, platformSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, 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.eb73fc4",
|
|
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.13",
|
|
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.7",
|
|
29
|
+
"typescript": "^6.0.2",
|
|
30
|
+
"vitest": "^4.1.2"
|
|
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
|
}
|