@alpic-ai/api 0.0.0-staging.b38b734 → 0.0.0-staging.ba36d73
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 +156 -3
- package/dist/index.mjs +124 -14
- package/package.json +10 -7
package/dist/index.d.mts
CHANGED
|
@@ -10,6 +10,12 @@ type ApiContext = {
|
|
|
10
10
|
awsCognitoUserSub: string | undefined;
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
|
+
declare const deploymentStatusSchema: z.ZodEnum<{
|
|
14
|
+
ongoing: "ongoing";
|
|
15
|
+
deployed: "deployed";
|
|
16
|
+
failed: "failed";
|
|
17
|
+
canceled: "canceled";
|
|
18
|
+
}>;
|
|
13
19
|
declare const createEnvironmentContractV1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
14
20
|
projectId: z.ZodString;
|
|
15
21
|
name: z.ZodString;
|
|
@@ -96,6 +102,13 @@ declare const contract: {
|
|
|
96
102
|
list: {
|
|
97
103
|
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
98
104
|
projectId: z.ZodString;
|
|
105
|
+
status: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
106
|
+
ongoing: "ongoing";
|
|
107
|
+
deployed: "deployed";
|
|
108
|
+
failed: "failed";
|
|
109
|
+
canceled: "canceled";
|
|
110
|
+
}>>>;
|
|
111
|
+
environmentId: z.ZodOptional<z.ZodString>;
|
|
99
112
|
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
100
113
|
id: z.ZodString;
|
|
101
114
|
status: z.ZodEnum<{
|
|
@@ -111,8 +124,10 @@ declare const contract: {
|
|
|
111
124
|
authorAvatarUrl: z.ZodNullable<z.ZodString>;
|
|
112
125
|
startedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
113
126
|
completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
114
|
-
isCurrent: z.ZodBoolean;
|
|
115
127
|
environmentId: z.ZodString;
|
|
128
|
+
environmentName: z.ZodString;
|
|
129
|
+
isCurrent: z.ZodBoolean;
|
|
130
|
+
deploymentPageUrl: z.ZodNullable<z.ZodURL>;
|
|
116
131
|
}, z.core.$strip>>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
117
132
|
NOT_FOUND: {};
|
|
118
133
|
}>, Record<never, never>>;
|
|
@@ -135,6 +150,9 @@ declare const contract: {
|
|
|
135
150
|
authorAvatarUrl: z.ZodNullable<z.ZodString>;
|
|
136
151
|
startedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
137
152
|
completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
153
|
+
environmentId: z.ZodString;
|
|
154
|
+
environmentName: z.ZodString;
|
|
155
|
+
isCurrent: z.ZodBoolean;
|
|
138
156
|
deploymentPageUrl: z.ZodNullable<z.ZodURL>;
|
|
139
157
|
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
140
158
|
NOT_FOUND: {};
|
|
@@ -144,7 +162,7 @@ declare const contract: {
|
|
|
144
162
|
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodOptional<z.ZodObject<{
|
|
145
163
|
teamId: z.ZodOptional<z.ZodString>;
|
|
146
164
|
}, z.core.$strip>>, z.ZodObject<{
|
|
147
|
-
uploadUrl: z.
|
|
165
|
+
uploadUrl: z.ZodURL;
|
|
148
166
|
token: z.ZodString;
|
|
149
167
|
expiresAt: z.ZodCoercedDate<unknown>;
|
|
150
168
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
@@ -220,12 +238,51 @@ declare const contract: {
|
|
|
220
238
|
authorAvatarUrl: z.ZodNullable<z.ZodString>;
|
|
221
239
|
startedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
222
240
|
completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
241
|
+
environmentId: z.ZodString;
|
|
242
|
+
environmentName: z.ZodString;
|
|
243
|
+
isCurrent: z.ZodBoolean;
|
|
223
244
|
deploymentPageUrl: z.ZodNullable<z.ZodURL>;
|
|
224
245
|
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
225
246
|
NOT_FOUND: {};
|
|
226
247
|
BAD_REQUEST: {};
|
|
227
248
|
}>, Record<never, never>>;
|
|
228
249
|
};
|
|
250
|
+
getLogs: {
|
|
251
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
252
|
+
environmentId: z.ZodString;
|
|
253
|
+
since: z.ZodOptional<z.ZodString>;
|
|
254
|
+
until: z.ZodOptional<z.ZodString>;
|
|
255
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
256
|
+
level: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
257
|
+
INFO: "INFO";
|
|
258
|
+
ERROR: "ERROR";
|
|
259
|
+
WARNING: "WARNING";
|
|
260
|
+
DEBUG: "DEBUG";
|
|
261
|
+
}>>>;
|
|
262
|
+
search: z.ZodOptional<z.ZodString>;
|
|
263
|
+
nextToken: z.ZodOptional<z.ZodString>;
|
|
264
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
265
|
+
logs: z.ZodArray<z.ZodObject<{
|
|
266
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
267
|
+
type: z.ZodEnum<{
|
|
268
|
+
INFO: "INFO";
|
|
269
|
+
ERROR: "ERROR";
|
|
270
|
+
WARNING: "WARNING";
|
|
271
|
+
DEBUG: "DEBUG";
|
|
272
|
+
START: "START";
|
|
273
|
+
END: "END";
|
|
274
|
+
}>;
|
|
275
|
+
requestId: z.ZodString;
|
|
276
|
+
content: z.ZodOptional<z.ZodString>;
|
|
277
|
+
method: z.ZodOptional<z.ZodString>;
|
|
278
|
+
durationInMs: z.ZodOptional<z.ZodNumber>;
|
|
279
|
+
}, z.core.$strip>>;
|
|
280
|
+
nextToken: z.ZodNullable<z.ZodString>;
|
|
281
|
+
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
282
|
+
NOT_FOUND: {};
|
|
283
|
+
BAD_REQUEST: {};
|
|
284
|
+
}>, Record<never, never>>;
|
|
285
|
+
};
|
|
229
286
|
};
|
|
230
287
|
environmentVariables: {
|
|
231
288
|
list: {
|
|
@@ -589,6 +646,79 @@ declare const contract: {
|
|
|
589
646
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
590
647
|
};
|
|
591
648
|
};
|
|
649
|
+
distribution: {
|
|
650
|
+
publish: {
|
|
651
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
652
|
+
projectId: z.ZodString;
|
|
653
|
+
domain: z.ZodString;
|
|
654
|
+
title: z.ZodString;
|
|
655
|
+
description: z.ZodString;
|
|
656
|
+
websiteUrl: z.ZodOptional<z.ZodURL>;
|
|
657
|
+
iconSrc: z.ZodOptional<z.ZodURL>;
|
|
658
|
+
dryRun: z.ZodOptional<z.ZodBoolean>;
|
|
659
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
660
|
+
serverFields: z.ZodObject<{
|
|
661
|
+
$schema: z.ZodString;
|
|
662
|
+
name: z.ZodString;
|
|
663
|
+
description: z.ZodString;
|
|
664
|
+
version: z.ZodOptional<z.ZodString>;
|
|
665
|
+
title: z.ZodOptional<z.ZodString>;
|
|
666
|
+
websiteUrl: z.ZodOptional<z.ZodURL>;
|
|
667
|
+
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
668
|
+
src: z.ZodURL;
|
|
669
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
670
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
671
|
+
}, z.core.$strip>>>;
|
|
672
|
+
remotes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
673
|
+
type: z.ZodString;
|
|
674
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
675
|
+
headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
676
|
+
name: z.ZodString;
|
|
677
|
+
description: z.ZodString;
|
|
678
|
+
isRequired: z.ZodOptional<z.ZodBoolean>;
|
|
679
|
+
isSecret: z.ZodOptional<z.ZodBoolean>;
|
|
680
|
+
}, z.core.$strip>>>;
|
|
681
|
+
}, z.core.$strip>>>;
|
|
682
|
+
}, z.core.$strip>;
|
|
683
|
+
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
684
|
+
NOT_FOUND: {};
|
|
685
|
+
BAD_REQUEST: {};
|
|
686
|
+
}>, Record<never, never>>;
|
|
687
|
+
};
|
|
688
|
+
get: {
|
|
689
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
690
|
+
projectId: z.ZodString;
|
|
691
|
+
domain: z.ZodString;
|
|
692
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
693
|
+
serverFields: z.ZodObject<{
|
|
694
|
+
$schema: z.ZodString;
|
|
695
|
+
name: z.ZodString;
|
|
696
|
+
description: z.ZodString;
|
|
697
|
+
version: z.ZodOptional<z.ZodString>;
|
|
698
|
+
title: z.ZodOptional<z.ZodString>;
|
|
699
|
+
websiteUrl: z.ZodOptional<z.ZodURL>;
|
|
700
|
+
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
701
|
+
src: z.ZodURL;
|
|
702
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
703
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
704
|
+
}, z.core.$strip>>>;
|
|
705
|
+
remotes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
706
|
+
type: z.ZodString;
|
|
707
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
708
|
+
headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
709
|
+
name: z.ZodString;
|
|
710
|
+
description: z.ZodString;
|
|
711
|
+
isRequired: z.ZodOptional<z.ZodBoolean>;
|
|
712
|
+
isSecret: z.ZodOptional<z.ZodBoolean>;
|
|
713
|
+
}, z.core.$strip>>>;
|
|
714
|
+
}, z.core.$strip>>>;
|
|
715
|
+
}, z.core.$strip>;
|
|
716
|
+
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
717
|
+
NOT_FOUND: {};
|
|
718
|
+
BAD_REQUEST: {};
|
|
719
|
+
}>, Record<never, never>>;
|
|
720
|
+
};
|
|
721
|
+
};
|
|
592
722
|
};
|
|
593
723
|
type RouterInput = InferContractRouterInputs<typeof contract>;
|
|
594
724
|
type RouterOutput = InferContractRouterOutputs<typeof contract>;
|
|
@@ -623,5 +753,28 @@ declare const transportSchema: z.ZodEnum<{
|
|
|
623
753
|
streamablehttp: "streamablehttp";
|
|
624
754
|
}>;
|
|
625
755
|
type Transport = z.infer<typeof transportSchema>;
|
|
756
|
+
declare const serverFieldsSchema: z.ZodObject<{
|
|
757
|
+
$schema: z.ZodString;
|
|
758
|
+
name: z.ZodString;
|
|
759
|
+
description: z.ZodString;
|
|
760
|
+
version: z.ZodOptional<z.ZodString>;
|
|
761
|
+
title: z.ZodOptional<z.ZodString>;
|
|
762
|
+
websiteUrl: z.ZodOptional<z.ZodURL>;
|
|
763
|
+
icons: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
764
|
+
src: z.ZodURL;
|
|
765
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
766
|
+
sizes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
767
|
+
}, z.core.$strip>>>;
|
|
768
|
+
remotes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
769
|
+
type: z.ZodString;
|
|
770
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
771
|
+
headers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
772
|
+
name: z.ZodString;
|
|
773
|
+
description: z.ZodString;
|
|
774
|
+
isRequired: z.ZodOptional<z.ZodBoolean>;
|
|
775
|
+
isSecret: z.ZodOptional<z.ZodBoolean>;
|
|
776
|
+
}, z.core.$strip>>>;
|
|
777
|
+
}, z.core.$strip>>>;
|
|
778
|
+
}, z.core.$strip>;
|
|
626
779
|
//#endregion
|
|
627
|
-
export { ApiContext, RouterInput, RouterOutput, Runtime, Transport, buildSettingsSchema, contract, createEnvironmentContractV1, environmentVariableSchema, environmentVariablesSchema, runtimeSchema, transportSchema };
|
|
780
|
+
export { ApiContext, RouterInput, RouterOutput, Runtime, Transport, buildSettingsSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, runtimeSchema, serverFieldsSchema, transportSchema };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { oc } from "@orpc/contract";
|
|
2
|
+
import ms from "ms";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
//#region src/schemas.ts
|
|
4
5
|
const RESERVED_KEYS = [
|
|
@@ -59,6 +60,29 @@ const transportSchema = z.enum([
|
|
|
59
60
|
"sse",
|
|
60
61
|
"streamablehttp"
|
|
61
62
|
]);
|
|
63
|
+
const serverFieldsSchema = z.object({
|
|
64
|
+
$schema: z.string(),
|
|
65
|
+
name: z.string(),
|
|
66
|
+
description: z.string(),
|
|
67
|
+
version: z.string().optional(),
|
|
68
|
+
title: z.string().optional(),
|
|
69
|
+
websiteUrl: z.url().optional(),
|
|
70
|
+
icons: z.array(z.object({
|
|
71
|
+
src: z.url(),
|
|
72
|
+
mimeType: z.string().optional(),
|
|
73
|
+
sizes: z.array(z.string()).optional()
|
|
74
|
+
})).optional(),
|
|
75
|
+
remotes: z.array(z.object({
|
|
76
|
+
type: z.string(),
|
|
77
|
+
url: z.url().optional(),
|
|
78
|
+
headers: z.array(z.object({
|
|
79
|
+
name: z.string(),
|
|
80
|
+
description: z.string(),
|
|
81
|
+
isRequired: z.boolean().optional(),
|
|
82
|
+
isSecret: z.boolean().optional()
|
|
83
|
+
})).optional()
|
|
84
|
+
})).optional()
|
|
85
|
+
});
|
|
62
86
|
//#endregion
|
|
63
87
|
//#region src/api.contract.ts
|
|
64
88
|
const deploymentStatusSchema = z.enum([
|
|
@@ -83,9 +107,16 @@ const deploymentSchema = z.object({
|
|
|
83
107
|
authorUsername: z.string().nullable(),
|
|
84
108
|
authorAvatarUrl: z.string().nullable(),
|
|
85
109
|
startedAt: z.coerce.date().nullable(),
|
|
86
|
-
completedAt: z.coerce.date().nullable()
|
|
110
|
+
completedAt: z.coerce.date().nullable(),
|
|
111
|
+
environmentId: z.string(),
|
|
112
|
+
environmentName: z.string(),
|
|
113
|
+
isCurrent: z.boolean(),
|
|
114
|
+
deploymentPageUrl: z.url().nullable()
|
|
87
115
|
});
|
|
88
|
-
const
|
|
116
|
+
const isValidLogTimeInput = (value) => {
|
|
117
|
+
if (ms(value) !== void 0) return true;
|
|
118
|
+
return !Number.isNaN(new Date(value).getTime());
|
|
119
|
+
};
|
|
89
120
|
const createEnvironmentContractV1 = oc.route({
|
|
90
121
|
path: "/v1/environments",
|
|
91
122
|
method: "POST",
|
|
@@ -313,7 +344,7 @@ const deployEnvironmentContractV1 = oc.route({
|
|
|
313
344
|
}).input(z.object({
|
|
314
345
|
environmentId: z.string().describe("The ID of the environment to deploy"),
|
|
315
346
|
token: z.string().describe("The token to identify the source archive").optional()
|
|
316
|
-
})).output(
|
|
347
|
+
})).output(deploymentSchema);
|
|
317
348
|
const uploadDeploymentArtifactContractV1 = oc.route({
|
|
318
349
|
path: "/v1/deployments/upload",
|
|
319
350
|
method: "POST",
|
|
@@ -322,21 +353,22 @@ const uploadDeploymentArtifactContractV1 = oc.route({
|
|
|
322
353
|
tags: ["deployments"],
|
|
323
354
|
successDescription: "The presigned upload URL has been generated successfully"
|
|
324
355
|
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.object({
|
|
325
|
-
uploadUrl: z.
|
|
356
|
+
uploadUrl: z.url().describe("Presigned S3 URL to upload the source archive with HTTP PUT"),
|
|
326
357
|
token: z.string().describe("Token to identify the source archive"),
|
|
327
358
|
expiresAt: z.coerce.date().describe("Expiration date of the presigned URL")
|
|
328
359
|
}));
|
|
329
|
-
const
|
|
360
|
+
const listDeploymentsContractV1 = oc.route({
|
|
330
361
|
path: "/v1/projects/{projectId}/deployments",
|
|
331
362
|
method: "GET",
|
|
332
363
|
summary: "List project deployments",
|
|
333
364
|
description: "List all deployments for a project",
|
|
334
365
|
tags: ["deployments"],
|
|
335
366
|
successDescription: "The list of deployments"
|
|
336
|
-
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
367
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
368
|
+
projectId: z.string().describe("The ID of the project"),
|
|
369
|
+
status: z.array(deploymentStatusSchema).optional().describe("Filter by one or more statuses"),
|
|
370
|
+
environmentId: z.string().optional().describe("Filter by environment ID")
|
|
371
|
+
})).output(z.array(deploymentSchema));
|
|
340
372
|
const getDeploymentContractV1 = oc.route({
|
|
341
373
|
path: "/v1/deployments/{deploymentId}",
|
|
342
374
|
method: "GET",
|
|
@@ -344,7 +376,48 @@ const getDeploymentContractV1 = oc.route({
|
|
|
344
376
|
description: "Get a deployment by ID",
|
|
345
377
|
tags: ["deployments"],
|
|
346
378
|
successDescription: "The deployment details"
|
|
347
|
-
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(
|
|
379
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(deploymentSchema);
|
|
380
|
+
const getLogsContractV1 = oc.route({
|
|
381
|
+
path: "/v1/environments/{environmentId}/logs",
|
|
382
|
+
method: "GET",
|
|
383
|
+
summary: "Get logs",
|
|
384
|
+
description: "Get logs for an environment",
|
|
385
|
+
tags: ["environments"],
|
|
386
|
+
successDescription: "The logs"
|
|
387
|
+
}).errors({
|
|
388
|
+
NOT_FOUND: {},
|
|
389
|
+
BAD_REQUEST: {}
|
|
390
|
+
}).input(z.object({
|
|
391
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
392
|
+
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)"),
|
|
393
|
+
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"),
|
|
394
|
+
limit: z.coerce.number().int().min(1).max(1e3).default(1e3).describe("Maximum number of log entries to return."),
|
|
395
|
+
level: z.array(z.enum([
|
|
396
|
+
"INFO",
|
|
397
|
+
"ERROR",
|
|
398
|
+
"WARNING",
|
|
399
|
+
"DEBUG"
|
|
400
|
+
])).optional().describe("Filter by log level"),
|
|
401
|
+
search: z.string().optional().describe("Filter pattern to search for in log content"),
|
|
402
|
+
nextToken: z.string().optional().describe("Pagination token from a previous response")
|
|
403
|
+
})).output(z.object({
|
|
404
|
+
logs: z.array(z.object({
|
|
405
|
+
timestamp: z.coerce.date(),
|
|
406
|
+
type: z.enum([
|
|
407
|
+
"START",
|
|
408
|
+
"END",
|
|
409
|
+
"INFO",
|
|
410
|
+
"ERROR",
|
|
411
|
+
"WARNING",
|
|
412
|
+
"DEBUG"
|
|
413
|
+
]),
|
|
414
|
+
requestId: z.string(),
|
|
415
|
+
content: z.string().optional(),
|
|
416
|
+
method: z.string().optional(),
|
|
417
|
+
durationInMs: z.number().optional()
|
|
418
|
+
})),
|
|
419
|
+
nextToken: z.string().nullable()
|
|
420
|
+
}));
|
|
348
421
|
const getDeploymentLogsContractV1 = oc.route({
|
|
349
422
|
path: "/v1/deployments/{deploymentId}/logs",
|
|
350
423
|
method: "GET",
|
|
@@ -422,11 +495,43 @@ const getTunnelTicketContractV1 = oc.route({
|
|
|
422
495
|
ticket: z.string().describe("The signed tunnel ticket"),
|
|
423
496
|
tunnelHost: z.string().describe("The tunnel host to connect to")
|
|
424
497
|
}));
|
|
498
|
+
const publishServerContractV1 = oc.route({
|
|
499
|
+
path: "/v1/distribution/publish",
|
|
500
|
+
method: "POST",
|
|
501
|
+
summary: "Publish a server to the MCP registry",
|
|
502
|
+
tags: ["distribution"],
|
|
503
|
+
successDescription: "The server has been published successfully"
|
|
504
|
+
}).errors({
|
|
505
|
+
NOT_FOUND: {},
|
|
506
|
+
BAD_REQUEST: {}
|
|
507
|
+
}).input(z.object({
|
|
508
|
+
projectId: z.string(),
|
|
509
|
+
domain: z.string(),
|
|
510
|
+
title: z.string().min(1).max(100),
|
|
511
|
+
description: z.string().min(1).max(100),
|
|
512
|
+
websiteUrl: z.url().max(255).optional(),
|
|
513
|
+
iconSrc: z.url().max(255).optional(),
|
|
514
|
+
dryRun: z.boolean().optional()
|
|
515
|
+
})).output(z.object({ serverFields: serverFieldsSchema }));
|
|
516
|
+
const getServerInfoContractV1 = oc.route({
|
|
517
|
+
path: "/v1/distribution/get",
|
|
518
|
+
method: "GET",
|
|
519
|
+
summary: "Get server info",
|
|
520
|
+
description: "Get info about a server",
|
|
521
|
+
tags: ["distribution"],
|
|
522
|
+
successDescription: "The server info"
|
|
523
|
+
}).errors({
|
|
524
|
+
NOT_FOUND: {},
|
|
525
|
+
BAD_REQUEST: {}
|
|
526
|
+
}).input(z.object({
|
|
527
|
+
projectId: z.string(),
|
|
528
|
+
domain: z.string()
|
|
529
|
+
})).output(z.object({ serverFields: serverFieldsSchema }));
|
|
425
530
|
const contract = {
|
|
426
531
|
teams: { list: { v1: listTeamsContractV1 } },
|
|
427
532
|
analytics: { get: { v1: getProjectAnalyticsContractV1 } },
|
|
428
533
|
deployments: {
|
|
429
|
-
list: { v1:
|
|
534
|
+
list: { v1: listDeploymentsContractV1 },
|
|
430
535
|
get: { v1: getDeploymentContractV1 },
|
|
431
536
|
uploadArtifact: { v1: uploadDeploymentArtifactContractV1 },
|
|
432
537
|
getLogs: { v1: getDeploymentLogsContractV1 }
|
|
@@ -434,7 +539,8 @@ const contract = {
|
|
|
434
539
|
environments: {
|
|
435
540
|
create: { v1: createEnvironmentContractV1 },
|
|
436
541
|
get: { v1: getEnvironmentContractV1 },
|
|
437
|
-
deploy: { v1: deployEnvironmentContractV1 }
|
|
542
|
+
deploy: { v1: deployEnvironmentContractV1 },
|
|
543
|
+
getLogs: { v1: getLogsContractV1 }
|
|
438
544
|
},
|
|
439
545
|
environmentVariables: {
|
|
440
546
|
list: { v1: listEnvironmentVariablesContractV1 },
|
|
@@ -449,7 +555,11 @@ const contract = {
|
|
|
449
555
|
create: { v1: createProjectContractV1 },
|
|
450
556
|
delete: { v1: deleteProjectContractV1 }
|
|
451
557
|
},
|
|
452
|
-
tunnels: { getTicket: { v1: getTunnelTicketContractV1 } }
|
|
558
|
+
tunnels: { getTicket: { v1: getTunnelTicketContractV1 } },
|
|
559
|
+
distribution: {
|
|
560
|
+
publish: { v1: publishServerContractV1 },
|
|
561
|
+
get: { v1: getServerInfoContractV1 }
|
|
562
|
+
}
|
|
453
563
|
};
|
|
454
564
|
//#endregion
|
|
455
|
-
export { buildSettingsSchema, contract, createEnvironmentContractV1, environmentVariableSchema, environmentVariablesSchema, runtimeSchema, transportSchema };
|
|
565
|
+
export { buildSettingsSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, 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.ba36d73",
|
|
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.8",
|
|
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.21.
|
|
28
|
+
"tsdown": "^0.21.4",
|
|
27
29
|
"typescript": "^5.9.3",
|
|
28
|
-
"vitest": "^4.0
|
|
30
|
+
"vitest": "^4.1.0"
|
|
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
|
}
|