@alpic-ai/api 0.0.0-staging.a31e885 → 0.0.0-staging.a322fe8
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 +334 -4
- package/dist/index.mjs +259 -17
- package/package.json +8 -6
package/dist/index.d.mts
CHANGED
|
@@ -5,9 +5,17 @@ import { z } from "zod";
|
|
|
5
5
|
//#region src/api.contract.d.ts
|
|
6
6
|
type ApiContext = {
|
|
7
7
|
request: Request & {
|
|
8
|
-
|
|
8
|
+
teamIds: string[];
|
|
9
|
+
defaultTeamId: string | undefined;
|
|
10
|
+
awsCognitoUserSub: string | undefined;
|
|
9
11
|
};
|
|
10
12
|
};
|
|
13
|
+
declare const deploymentStatusSchema: z.ZodEnum<{
|
|
14
|
+
ongoing: "ongoing";
|
|
15
|
+
deployed: "deployed";
|
|
16
|
+
failed: "failed";
|
|
17
|
+
canceled: "canceled";
|
|
18
|
+
}>;
|
|
11
19
|
declare const createEnvironmentContractV1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
12
20
|
projectId: z.ZodString;
|
|
13
21
|
name: z.ZodString;
|
|
@@ -29,7 +37,101 @@ declare const createEnvironmentContractV1: _orpc_contract0.ContractProcedureBuil
|
|
|
29
37
|
BAD_REQUEST: {};
|
|
30
38
|
}>, Record<never, never>>;
|
|
31
39
|
declare const contract: {
|
|
40
|
+
teams: {
|
|
41
|
+
list: {
|
|
42
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithOutput<_orpc_contract0.Schema<unknown, unknown>, z.ZodArray<z.ZodObject<{
|
|
43
|
+
id: z.ZodString;
|
|
44
|
+
name: z.ZodString;
|
|
45
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
46
|
+
hasStripeAccount: z.ZodBoolean;
|
|
47
|
+
}, z.core.$strip>>, Record<never, never>, Record<never, never>>;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
analytics: {
|
|
51
|
+
get: {
|
|
52
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
53
|
+
projectId: z.ZodString;
|
|
54
|
+
startTimestamp: z.ZodCoercedNumber<unknown>;
|
|
55
|
+
endTimestamp: z.ZodCoercedNumber<unknown>;
|
|
56
|
+
timeZone: z.ZodString;
|
|
57
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
58
|
+
metadata: z.ZodObject<{
|
|
59
|
+
startTimestamp: z.ZodNumber;
|
|
60
|
+
endTimestamp: z.ZodNumber;
|
|
61
|
+
timeZone: z.ZodString;
|
|
62
|
+
startDate: z.ZodCoercedDate<unknown>;
|
|
63
|
+
interval: z.ZodString;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
timeSeries: z.ZodObject<{
|
|
66
|
+
sessions_count: z.ZodArray<z.ZodObject<{
|
|
67
|
+
timestamp: z.ZodNumber;
|
|
68
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
69
|
+
}, z.core.$strip>>;
|
|
70
|
+
requests_count: z.ZodArray<z.ZodObject<{
|
|
71
|
+
timestamp: z.ZodNumber;
|
|
72
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
73
|
+
}, z.core.$strip>>;
|
|
74
|
+
requests_latency_mean: z.ZodArray<z.ZodObject<{
|
|
75
|
+
timestamp: z.ZodNumber;
|
|
76
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
77
|
+
}, z.core.$strip>>;
|
|
78
|
+
tool_errors: z.ZodArray<z.ZodObject<{
|
|
79
|
+
timestamp: z.ZodNumber;
|
|
80
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
81
|
+
}, z.core.$strip>>;
|
|
82
|
+
mcp_errors: z.ZodArray<z.ZodObject<{
|
|
83
|
+
timestamp: z.ZodNumber;
|
|
84
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
output_token_mean: z.ZodArray<z.ZodObject<{
|
|
87
|
+
timestamp: z.ZodNumber;
|
|
88
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
89
|
+
}, z.core.$strip>>;
|
|
90
|
+
task_count: z.ZodArray<z.ZodObject<{
|
|
91
|
+
timestamp: z.ZodNumber;
|
|
92
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
93
|
+
}, z.core.$strip>>;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
96
|
+
NOT_FOUND: {};
|
|
97
|
+
BAD_REQUEST: {};
|
|
98
|
+
}>, Record<never, never>>;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
32
101
|
deployments: {
|
|
102
|
+
list: {
|
|
103
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
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>;
|
|
112
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
113
|
+
id: z.ZodString;
|
|
114
|
+
status: z.ZodEnum<{
|
|
115
|
+
ongoing: "ongoing";
|
|
116
|
+
deployed: "deployed";
|
|
117
|
+
failed: "failed";
|
|
118
|
+
canceled: "canceled";
|
|
119
|
+
}>;
|
|
120
|
+
sourceRef: z.ZodNullable<z.ZodString>;
|
|
121
|
+
sourceCommitId: z.ZodNullable<z.ZodString>;
|
|
122
|
+
sourceCommitMessage: z.ZodNullable<z.ZodString>;
|
|
123
|
+
authorUsername: z.ZodNullable<z.ZodString>;
|
|
124
|
+
authorAvatarUrl: z.ZodNullable<z.ZodString>;
|
|
125
|
+
startedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
126
|
+
completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
127
|
+
environmentId: z.ZodString;
|
|
128
|
+
environmentName: z.ZodString;
|
|
129
|
+
isCurrent: z.ZodBoolean;
|
|
130
|
+
deploymentPageUrl: z.ZodNullable<z.ZodURL>;
|
|
131
|
+
}, z.core.$strip>>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
132
|
+
NOT_FOUND: {};
|
|
133
|
+
}>, Record<never, never>>;
|
|
134
|
+
};
|
|
33
135
|
get: {
|
|
34
136
|
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
35
137
|
deploymentId: z.ZodString;
|
|
@@ -48,17 +150,36 @@ declare const contract: {
|
|
|
48
150
|
authorAvatarUrl: z.ZodNullable<z.ZodString>;
|
|
49
151
|
startedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
50
152
|
completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
153
|
+
environmentId: z.ZodString;
|
|
154
|
+
environmentName: z.ZodString;
|
|
155
|
+
isCurrent: z.ZodBoolean;
|
|
156
|
+
deploymentPageUrl: z.ZodNullable<z.ZodURL>;
|
|
51
157
|
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
52
158
|
NOT_FOUND: {};
|
|
53
159
|
}>, Record<never, never>>;
|
|
54
160
|
};
|
|
55
161
|
uploadArtifact: {
|
|
56
|
-
v1: _orpc_contract0.
|
|
162
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodOptional<z.ZodObject<{
|
|
163
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
164
|
+
}, z.core.$strip>>, z.ZodObject<{
|
|
57
165
|
uploadUrl: z.ZodString;
|
|
58
166
|
token: z.ZodString;
|
|
59
167
|
expiresAt: z.ZodCoercedDate<unknown>;
|
|
60
168
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
61
169
|
};
|
|
170
|
+
getLogs: {
|
|
171
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
172
|
+
deploymentId: z.ZodString;
|
|
173
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
174
|
+
logs: z.ZodArray<z.ZodObject<{
|
|
175
|
+
timestamp: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
176
|
+
content: z.ZodOptional<z.ZodString>;
|
|
177
|
+
}, z.core.$strip>>;
|
|
178
|
+
hasMoreLogs: z.ZodBoolean;
|
|
179
|
+
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
180
|
+
NOT_FOUND: {};
|
|
181
|
+
}>, Record<never, never>>;
|
|
182
|
+
};
|
|
62
183
|
};
|
|
63
184
|
environments: {
|
|
64
185
|
create: {
|
|
@@ -117,13 +238,183 @@ declare const contract: {
|
|
|
117
238
|
authorAvatarUrl: z.ZodNullable<z.ZodString>;
|
|
118
239
|
startedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
119
240
|
completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
241
|
+
environmentId: z.ZodString;
|
|
242
|
+
environmentName: z.ZodString;
|
|
243
|
+
isCurrent: z.ZodBoolean;
|
|
244
|
+
deploymentPageUrl: z.ZodNullable<z.ZodURL>;
|
|
245
|
+
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
246
|
+
NOT_FOUND: {};
|
|
247
|
+
BAD_REQUEST: {};
|
|
248
|
+
}>, Record<never, never>>;
|
|
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
|
+
};
|
|
286
|
+
};
|
|
287
|
+
environmentVariables: {
|
|
288
|
+
list: {
|
|
289
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
290
|
+
environmentId: z.ZodString;
|
|
291
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
292
|
+
id: z.ZodString;
|
|
293
|
+
key: z.ZodString;
|
|
294
|
+
value: z.ZodString;
|
|
295
|
+
isSecret: z.ZodBoolean;
|
|
296
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
297
|
+
}, z.core.$strip>>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
298
|
+
NOT_FOUND: {};
|
|
299
|
+
}>, Record<never, never>>;
|
|
300
|
+
};
|
|
301
|
+
create: {
|
|
302
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
303
|
+
environmentId: z.ZodString;
|
|
304
|
+
environmentVariables: z.ZodArray<z.ZodObject<{
|
|
305
|
+
key: z.ZodString;
|
|
306
|
+
value: z.ZodString;
|
|
307
|
+
isSecret: z.ZodDefault<z.ZodBoolean>;
|
|
308
|
+
}, z.core.$strip>>;
|
|
309
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
310
|
+
success: z.ZodLiteral<true>;
|
|
311
|
+
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
312
|
+
NOT_FOUND: {};
|
|
313
|
+
BAD_REQUEST: {};
|
|
314
|
+
}>, Record<never, never>>;
|
|
315
|
+
};
|
|
316
|
+
update: {
|
|
317
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
318
|
+
environmentVariableId: z.ZodString;
|
|
319
|
+
key: z.ZodString;
|
|
320
|
+
value: z.ZodOptional<z.ZodString>;
|
|
321
|
+
isSecret: z.ZodDefault<z.ZodBoolean>;
|
|
322
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
323
|
+
success: z.ZodLiteral<true>;
|
|
120
324
|
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
121
325
|
NOT_FOUND: {};
|
|
122
326
|
BAD_REQUEST: {};
|
|
123
327
|
}>, Record<never, never>>;
|
|
124
328
|
};
|
|
329
|
+
delete: {
|
|
330
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
331
|
+
environmentVariableId: z.ZodString;
|
|
332
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
333
|
+
success: z.ZodLiteral<true>;
|
|
334
|
+
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
335
|
+
NOT_FOUND: {};
|
|
336
|
+
}>, Record<never, never>>;
|
|
337
|
+
};
|
|
125
338
|
};
|
|
126
339
|
projects: {
|
|
340
|
+
update: {
|
|
341
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
342
|
+
projectId: z.ZodString;
|
|
343
|
+
name: z.ZodOptional<z.ZodString>;
|
|
344
|
+
sourceRepository: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
345
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
346
|
+
id: z.ZodString;
|
|
347
|
+
name: z.ZodString;
|
|
348
|
+
teamId: z.ZodString;
|
|
349
|
+
sourceRepository: z.ZodNullable<z.ZodString>;
|
|
350
|
+
runtime: z.ZodEnum<{
|
|
351
|
+
"python3.13": "python3.13";
|
|
352
|
+
"python3.14": "python3.14";
|
|
353
|
+
node22: "node22";
|
|
354
|
+
node24: "node24";
|
|
355
|
+
}>;
|
|
356
|
+
transport: z.ZodNullable<z.ZodEnum<{
|
|
357
|
+
stdio: "stdio";
|
|
358
|
+
sse: "sse";
|
|
359
|
+
streamablehttp: "streamablehttp";
|
|
360
|
+
}>>;
|
|
361
|
+
rootDirectory: z.ZodNullable<z.ZodString>;
|
|
362
|
+
buildCommand: z.ZodNullable<z.ZodString>;
|
|
363
|
+
buildOutputDir: z.ZodNullable<z.ZodString>;
|
|
364
|
+
installCommand: z.ZodNullable<z.ZodString>;
|
|
365
|
+
startCommand: z.ZodNullable<z.ZodString>;
|
|
366
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
367
|
+
productionEnvironment: z.ZodNullable<z.ZodObject<{
|
|
368
|
+
id: z.ZodString;
|
|
369
|
+
name: z.ZodString;
|
|
370
|
+
mcpServerUrl: z.ZodString;
|
|
371
|
+
domains: z.ZodArray<z.ZodObject<{
|
|
372
|
+
domain: z.ZodString;
|
|
373
|
+
status: z.ZodEnum<{
|
|
374
|
+
ongoing: "ongoing";
|
|
375
|
+
deployed: "deployed";
|
|
376
|
+
failed: "failed";
|
|
377
|
+
}>;
|
|
378
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
379
|
+
}, z.core.$strip>>;
|
|
380
|
+
latestDeployment: z.ZodNullable<z.ZodObject<{
|
|
381
|
+
id: z.ZodString;
|
|
382
|
+
status: z.ZodEnum<{
|
|
383
|
+
ongoing: "ongoing";
|
|
384
|
+
deployed: "deployed";
|
|
385
|
+
failed: "failed";
|
|
386
|
+
canceled: "canceled";
|
|
387
|
+
}>;
|
|
388
|
+
sourceCommitId: z.ZodNullable<z.ZodString>;
|
|
389
|
+
sourceCommitMessage: z.ZodNullable<z.ZodString>;
|
|
390
|
+
completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
391
|
+
}, z.core.$strip>>;
|
|
392
|
+
}, z.core.$strip>>;
|
|
393
|
+
environments: z.ZodArray<z.ZodObject<{
|
|
394
|
+
id: z.ZodString;
|
|
395
|
+
name: z.ZodString;
|
|
396
|
+
sourceBranch: z.ZodNullable<z.ZodString>;
|
|
397
|
+
mcpServerUrl: z.ZodString;
|
|
398
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
399
|
+
projectId: z.ZodString;
|
|
400
|
+
latestDeployment: z.ZodNullable<z.ZodObject<{
|
|
401
|
+
id: z.ZodString;
|
|
402
|
+
status: z.ZodEnum<{
|
|
403
|
+
ongoing: "ongoing";
|
|
404
|
+
deployed: "deployed";
|
|
405
|
+
failed: "failed";
|
|
406
|
+
canceled: "canceled";
|
|
407
|
+
}>;
|
|
408
|
+
sourceCommitId: z.ZodNullable<z.ZodString>;
|
|
409
|
+
sourceCommitMessage: z.ZodNullable<z.ZodString>;
|
|
410
|
+
completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
411
|
+
}, z.core.$strip>>;
|
|
412
|
+
}, z.core.$strip>>;
|
|
413
|
+
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
414
|
+
NOT_FOUND: {};
|
|
415
|
+
BAD_REQUEST: {};
|
|
416
|
+
}>, Record<never, never>>;
|
|
417
|
+
};
|
|
127
418
|
get: {
|
|
128
419
|
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
129
420
|
projectId: z.ZodString;
|
|
@@ -153,6 +444,15 @@ declare const contract: {
|
|
|
153
444
|
id: z.ZodString;
|
|
154
445
|
name: z.ZodString;
|
|
155
446
|
mcpServerUrl: z.ZodString;
|
|
447
|
+
domains: z.ZodArray<z.ZodObject<{
|
|
448
|
+
domain: z.ZodString;
|
|
449
|
+
status: z.ZodEnum<{
|
|
450
|
+
ongoing: "ongoing";
|
|
451
|
+
deployed: "deployed";
|
|
452
|
+
failed: "failed";
|
|
453
|
+
}>;
|
|
454
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
455
|
+
}, z.core.$strip>>;
|
|
156
456
|
latestDeployment: z.ZodNullable<z.ZodObject<{
|
|
157
457
|
id: z.ZodString;
|
|
158
458
|
status: z.ZodEnum<{
|
|
@@ -191,7 +491,9 @@ declare const contract: {
|
|
|
191
491
|
}>, Record<never, never>>;
|
|
192
492
|
};
|
|
193
493
|
list: {
|
|
194
|
-
v1: _orpc_contract0.
|
|
494
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodOptional<z.ZodObject<{
|
|
495
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
496
|
+
}, z.core.$strip>>, z.ZodArray<z.ZodObject<{
|
|
195
497
|
id: z.ZodString;
|
|
196
498
|
name: z.ZodString;
|
|
197
499
|
teamId: z.ZodString;
|
|
@@ -217,6 +519,15 @@ declare const contract: {
|
|
|
217
519
|
id: z.ZodString;
|
|
218
520
|
name: z.ZodString;
|
|
219
521
|
mcpServerUrl: z.ZodString;
|
|
522
|
+
domains: z.ZodArray<z.ZodObject<{
|
|
523
|
+
domain: z.ZodString;
|
|
524
|
+
status: z.ZodEnum<{
|
|
525
|
+
ongoing: "ongoing";
|
|
526
|
+
deployed: "deployed";
|
|
527
|
+
failed: "failed";
|
|
528
|
+
}>;
|
|
529
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
530
|
+
}, z.core.$strip>>;
|
|
220
531
|
latestDeployment: z.ZodNullable<z.ZodObject<{
|
|
221
532
|
id: z.ZodString;
|
|
222
533
|
status: z.ZodEnum<{
|
|
@@ -254,6 +565,7 @@ declare const contract: {
|
|
|
254
565
|
};
|
|
255
566
|
create: {
|
|
256
567
|
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
568
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
257
569
|
name: z.ZodString;
|
|
258
570
|
sourceRepository: z.ZodOptional<z.ZodString>;
|
|
259
571
|
branchName: z.ZodOptional<z.ZodString>;
|
|
@@ -315,6 +627,24 @@ declare const contract: {
|
|
|
315
627
|
BAD_REQUEST: {};
|
|
316
628
|
}>, Record<never, never>>;
|
|
317
629
|
};
|
|
630
|
+
delete: {
|
|
631
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
632
|
+
projectId: z.ZodString;
|
|
633
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
634
|
+
success: z.ZodLiteral<true>;
|
|
635
|
+
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
636
|
+
NOT_FOUND: {};
|
|
637
|
+
}>, Record<never, never>>;
|
|
638
|
+
};
|
|
639
|
+
};
|
|
640
|
+
tunnels: {
|
|
641
|
+
getTicket: {
|
|
642
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithOutput<_orpc_contract0.Schema<unknown, unknown>, z.ZodObject<{
|
|
643
|
+
subdomain: z.ZodString;
|
|
644
|
+
ticket: z.ZodString;
|
|
645
|
+
tunnelHost: z.ZodString;
|
|
646
|
+
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
647
|
+
};
|
|
318
648
|
};
|
|
319
649
|
};
|
|
320
650
|
type RouterInput = InferContractRouterInputs<typeof contract>;
|
|
@@ -351,4 +681,4 @@ declare const transportSchema: z.ZodEnum<{
|
|
|
351
681
|
}>;
|
|
352
682
|
type Transport = z.infer<typeof transportSchema>;
|
|
353
683
|
//#endregion
|
|
354
|
-
export { ApiContext, RouterInput, RouterOutput, Runtime, Transport, buildSettingsSchema, contract, createEnvironmentContractV1, environmentVariableSchema, environmentVariablesSchema, runtimeSchema, transportSchema };
|
|
684
|
+
export { ApiContext, RouterInput, RouterOutput, Runtime, Transport, buildSettingsSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, runtimeSchema, transportSchema };
|
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"),
|
|
@@ -55,7 +60,6 @@ const transportSchema = z.enum([
|
|
|
55
60
|
"sse",
|
|
56
61
|
"streamablehttp"
|
|
57
62
|
]);
|
|
58
|
-
|
|
59
63
|
//#endregion
|
|
60
64
|
//#region src/api.contract.ts
|
|
61
65
|
const deploymentStatusSchema = z.enum([
|
|
@@ -80,8 +84,16 @@ const deploymentSchema = z.object({
|
|
|
80
84
|
authorUsername: z.string().nullable(),
|
|
81
85
|
authorAvatarUrl: z.string().nullable(),
|
|
82
86
|
startedAt: z.coerce.date().nullable(),
|
|
83
|
-
completedAt: z.coerce.date().nullable()
|
|
87
|
+
completedAt: z.coerce.date().nullable(),
|
|
88
|
+
environmentId: z.string(),
|
|
89
|
+
environmentName: z.string(),
|
|
90
|
+
isCurrent: z.boolean(),
|
|
91
|
+
deploymentPageUrl: z.url().nullable()
|
|
84
92
|
});
|
|
93
|
+
const isValidLogTimeInput = (value) => {
|
|
94
|
+
if (ms(value) !== void 0) return true;
|
|
95
|
+
return !Number.isNaN(new Date(value).getTime());
|
|
96
|
+
};
|
|
85
97
|
const createEnvironmentContractV1 = oc.route({
|
|
86
98
|
path: "/v1/environments",
|
|
87
99
|
method: "POST",
|
|
@@ -106,7 +118,7 @@ const createEnvironmentContractV1 = oc.route({
|
|
|
106
118
|
projectId: z.string().describe("The ID of the project the environment belongs to")
|
|
107
119
|
}));
|
|
108
120
|
const getEnvironmentContractV1 = oc.route({
|
|
109
|
-
path: "/v1/environments
|
|
121
|
+
path: "/v1/environments/{environmentId}",
|
|
110
122
|
method: "GET",
|
|
111
123
|
summary: "Get an environment",
|
|
112
124
|
description: "Get an environment by ID",
|
|
@@ -121,10 +133,20 @@ const getEnvironmentContractV1 = oc.route({
|
|
|
121
133
|
createdAt: z.coerce.date(),
|
|
122
134
|
projectId: z.string()
|
|
123
135
|
}));
|
|
136
|
+
const domainSchema = z.object({
|
|
137
|
+
domain: z.string(),
|
|
138
|
+
status: z.enum([
|
|
139
|
+
"ongoing",
|
|
140
|
+
"deployed",
|
|
141
|
+
"failed"
|
|
142
|
+
]),
|
|
143
|
+
createdAt: z.coerce.date()
|
|
144
|
+
});
|
|
124
145
|
const productionEnvironmentSchema = z.object({
|
|
125
146
|
id: z.string(),
|
|
126
147
|
name: z.string(),
|
|
127
148
|
mcpServerUrl: z.string(),
|
|
149
|
+
domains: z.array(domainSchema),
|
|
128
150
|
latestDeployment: latestDeploymentSchema.nullable()
|
|
129
151
|
});
|
|
130
152
|
const environmentSchema = z.object({
|
|
@@ -153,7 +175,7 @@ const projectOutputSchema = z.object({
|
|
|
153
175
|
environments: z.array(environmentSchema)
|
|
154
176
|
});
|
|
155
177
|
const getProjectContractV1 = oc.route({
|
|
156
|
-
path: "/v1/projects
|
|
178
|
+
path: "/v1/projects/{projectId}",
|
|
157
179
|
method: "GET",
|
|
158
180
|
summary: "Get a project",
|
|
159
181
|
description: "Get a project by ID",
|
|
@@ -167,7 +189,7 @@ const listProjectsContractV1 = oc.route({
|
|
|
167
189
|
description: "List all projects for a team",
|
|
168
190
|
tags: ["projects"],
|
|
169
191
|
successDescription: "The list of projects"
|
|
170
|
-
}).output(z.array(projectOutputSchema));
|
|
192
|
+
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.array(projectOutputSchema));
|
|
171
193
|
const createProjectContractV1 = oc.route({
|
|
172
194
|
path: "/v1/projects",
|
|
173
195
|
method: "POST",
|
|
@@ -179,7 +201,8 @@ const createProjectContractV1 = oc.route({
|
|
|
179
201
|
NOT_FOUND: {},
|
|
180
202
|
BAD_REQUEST: {}
|
|
181
203
|
}).input(z.object({
|
|
182
|
-
|
|
204
|
+
teamId: z.string().optional(),
|
|
205
|
+
name: z.string().trim().min(1).max(100),
|
|
183
206
|
sourceRepository: z.string().optional(),
|
|
184
207
|
branchName: z.string().min(1).optional(),
|
|
185
208
|
runtime: runtimeSchema,
|
|
@@ -209,8 +232,84 @@ const createProjectContractV1 = oc.route({
|
|
|
209
232
|
startCommand: z.string().nullable(),
|
|
210
233
|
createdAt: z.coerce.date()
|
|
211
234
|
}));
|
|
235
|
+
const environmentVariableOutputSchema = z.object({
|
|
236
|
+
id: z.string(),
|
|
237
|
+
key: z.string(),
|
|
238
|
+
value: z.string(),
|
|
239
|
+
isSecret: z.boolean(),
|
|
240
|
+
createdAt: z.coerce.date()
|
|
241
|
+
});
|
|
242
|
+
const listEnvironmentVariablesContractV1 = oc.route({
|
|
243
|
+
path: "/v1/environments/{environmentId}/environment-variables",
|
|
244
|
+
method: "GET",
|
|
245
|
+
summary: "List environment variables",
|
|
246
|
+
description: "List all environment variables for an environment",
|
|
247
|
+
tags: ["environments"],
|
|
248
|
+
successDescription: "The list of environment variables"
|
|
249
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(z.array(environmentVariableOutputSchema));
|
|
250
|
+
const createEnvironmentVariablesContractV1 = oc.route({
|
|
251
|
+
path: "/v1/environments/{environmentId}/environment-variables",
|
|
252
|
+
method: "POST",
|
|
253
|
+
summary: "Add environment variables",
|
|
254
|
+
description: "Add one or more environment variables to an environment",
|
|
255
|
+
tags: ["environments"],
|
|
256
|
+
successDescription: "The environment variables have been added successfully"
|
|
257
|
+
}).errors({
|
|
258
|
+
NOT_FOUND: {},
|
|
259
|
+
BAD_REQUEST: {}
|
|
260
|
+
}).input(z.object({
|
|
261
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
262
|
+
environmentVariables: environmentVariablesSchema
|
|
263
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
264
|
+
const updateEnvironmentVariableContractV1 = oc.route({
|
|
265
|
+
path: "/v1/environment-variables/{environmentVariableId}",
|
|
266
|
+
method: "PATCH",
|
|
267
|
+
summary: "Update an environment variable",
|
|
268
|
+
description: "Update an environment variable by ID",
|
|
269
|
+
tags: ["environments"],
|
|
270
|
+
successDescription: "The environment variable has been updated successfully"
|
|
271
|
+
}).errors({
|
|
272
|
+
NOT_FOUND: {},
|
|
273
|
+
BAD_REQUEST: {}
|
|
274
|
+
}).input(z.object({
|
|
275
|
+
environmentVariableId: z.string().describe("The ID of the environment variable"),
|
|
276
|
+
key: environmentVariableSchema.shape.key,
|
|
277
|
+
value: environmentVariableSchema.shape.value.optional(),
|
|
278
|
+
isSecret: environmentVariableSchema.shape.isSecret
|
|
279
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
280
|
+
const deleteEnvironmentVariableContractV1 = oc.route({
|
|
281
|
+
path: "/v1/environment-variables/{environmentVariableId}",
|
|
282
|
+
method: "DELETE",
|
|
283
|
+
summary: "Delete an environment variable",
|
|
284
|
+
description: "Delete an environment variable by ID",
|
|
285
|
+
tags: ["environments"],
|
|
286
|
+
successDescription: "The environment variable has been deleted successfully"
|
|
287
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentVariableId: z.string().describe("The ID of the environment variable") })).output(z.object({ success: z.literal(true) }));
|
|
288
|
+
const deleteProjectContractV1 = oc.route({
|
|
289
|
+
path: "/v1/projects/:projectId",
|
|
290
|
+
method: "DELETE",
|
|
291
|
+
summary: "Delete a project",
|
|
292
|
+
description: "Delete a project and all its environments",
|
|
293
|
+
tags: ["projects"],
|
|
294
|
+
successDescription: "The project has been deleted successfully"
|
|
295
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ projectId: z.string().describe("The ID of the project") })).output(z.object({ success: z.literal(true) }));
|
|
296
|
+
const updateProjectContractV1 = oc.route({
|
|
297
|
+
path: "/v1/projects/{projectId}",
|
|
298
|
+
method: "PATCH",
|
|
299
|
+
summary: "Update a project",
|
|
300
|
+
description: "Update project settings",
|
|
301
|
+
tags: ["projects"],
|
|
302
|
+
successDescription: "The project has been updated successfully"
|
|
303
|
+
}).errors({
|
|
304
|
+
NOT_FOUND: {},
|
|
305
|
+
BAD_REQUEST: {}
|
|
306
|
+
}).input(z.object({
|
|
307
|
+
projectId: z.string().describe("The ID of the project"),
|
|
308
|
+
name: z.string().min(1).max(100).optional().describe("The new name for the project"),
|
|
309
|
+
sourceRepository: z.string().nullable().optional().describe("The source repository to connect to the project")
|
|
310
|
+
})).output(projectOutputSchema);
|
|
212
311
|
const deployEnvironmentContractV1 = oc.route({
|
|
213
|
-
path: "/v1/environments
|
|
312
|
+
path: "/v1/environments/{environmentId}/deploy",
|
|
214
313
|
method: "POST",
|
|
215
314
|
summary: "Deploy an environment",
|
|
216
315
|
description: "Deploy an environment",
|
|
@@ -230,35 +329,178 @@ const uploadDeploymentArtifactContractV1 = oc.route({
|
|
|
230
329
|
description: "Return a presigned S3 URL to upload a deployment artifact",
|
|
231
330
|
tags: ["deployments"],
|
|
232
331
|
successDescription: "The presigned upload URL has been generated successfully"
|
|
233
|
-
}).output(z.object({
|
|
332
|
+
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.object({
|
|
234
333
|
uploadUrl: z.string().url().describe("Presigned S3 URL to upload the source archive with HTTP PUT"),
|
|
235
334
|
token: z.string().describe("Token to identify the source archive"),
|
|
236
335
|
expiresAt: z.coerce.date().describe("Expiration date of the presigned URL")
|
|
237
336
|
}));
|
|
337
|
+
const listDeploymentsContractV1 = oc.route({
|
|
338
|
+
path: "/v1/projects/{projectId}/deployments",
|
|
339
|
+
method: "GET",
|
|
340
|
+
summary: "List project deployments",
|
|
341
|
+
description: "List all deployments for a project",
|
|
342
|
+
tags: ["deployments"],
|
|
343
|
+
successDescription: "The list of deployments"
|
|
344
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
345
|
+
projectId: z.string().describe("The ID of the project"),
|
|
346
|
+
status: z.array(deploymentStatusSchema).optional().describe("Filter by one or more statuses"),
|
|
347
|
+
environmentId: z.string().optional().describe("Filter by environment ID")
|
|
348
|
+
})).output(z.array(deploymentSchema));
|
|
238
349
|
const getDeploymentContractV1 = oc.route({
|
|
239
|
-
path: "/v1/deployments
|
|
350
|
+
path: "/v1/deployments/{deploymentId}",
|
|
240
351
|
method: "GET",
|
|
241
352
|
summary: "Get a deployment",
|
|
242
353
|
description: "Get a deployment by ID",
|
|
243
354
|
tags: ["deployments"],
|
|
244
355
|
successDescription: "The deployment details"
|
|
245
356
|
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(deploymentSchema);
|
|
357
|
+
const getLogsContractV1 = oc.route({
|
|
358
|
+
path: "/v1/environments/{environmentId}/logs",
|
|
359
|
+
method: "GET",
|
|
360
|
+
summary: "Get logs",
|
|
361
|
+
description: "Get logs for an environment",
|
|
362
|
+
tags: ["environments"],
|
|
363
|
+
successDescription: "The logs"
|
|
364
|
+
}).errors({
|
|
365
|
+
NOT_FOUND: {},
|
|
366
|
+
BAD_REQUEST: {}
|
|
367
|
+
}).input(z.object({
|
|
368
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
369
|
+
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)"),
|
|
370
|
+
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"),
|
|
371
|
+
limit: z.coerce.number().int().min(1).max(1e3).default(1e3).describe("Maximum number of log entries to return."),
|
|
372
|
+
level: z.array(z.enum([
|
|
373
|
+
"INFO",
|
|
374
|
+
"ERROR",
|
|
375
|
+
"WARNING",
|
|
376
|
+
"DEBUG"
|
|
377
|
+
])).optional().describe("Filter by log level"),
|
|
378
|
+
search: z.string().optional().describe("Filter pattern to search for in log content"),
|
|
379
|
+
nextToken: z.string().optional().describe("Pagination token from a previous response")
|
|
380
|
+
})).output(z.object({
|
|
381
|
+
logs: z.array(z.object({
|
|
382
|
+
timestamp: z.coerce.date(),
|
|
383
|
+
type: z.enum([
|
|
384
|
+
"START",
|
|
385
|
+
"END",
|
|
386
|
+
"INFO",
|
|
387
|
+
"ERROR",
|
|
388
|
+
"WARNING",
|
|
389
|
+
"DEBUG"
|
|
390
|
+
]),
|
|
391
|
+
requestId: z.string(),
|
|
392
|
+
content: z.string().optional(),
|
|
393
|
+
method: z.string().optional(),
|
|
394
|
+
durationInMs: z.number().optional()
|
|
395
|
+
})),
|
|
396
|
+
nextToken: z.string().nullable()
|
|
397
|
+
}));
|
|
398
|
+
const getDeploymentLogsContractV1 = oc.route({
|
|
399
|
+
path: "/v1/deployments/{deploymentId}/logs",
|
|
400
|
+
method: "GET",
|
|
401
|
+
summary: "Get deployment logs",
|
|
402
|
+
description: "Get the logs for a deployment",
|
|
403
|
+
tags: ["deployments"],
|
|
404
|
+
successDescription: "The deployment logs"
|
|
405
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(z.object({
|
|
406
|
+
logs: z.array(z.object({
|
|
407
|
+
timestamp: z.coerce.date().optional(),
|
|
408
|
+
content: z.string().optional()
|
|
409
|
+
})),
|
|
410
|
+
hasMoreLogs: z.boolean()
|
|
411
|
+
}));
|
|
412
|
+
const analyticsDataPointSchema = z.object({
|
|
413
|
+
timestamp: z.number(),
|
|
414
|
+
categories: z.record(z.string(), z.unknown())
|
|
415
|
+
});
|
|
416
|
+
const analyticsTimeSeriesSchema = z.object({
|
|
417
|
+
sessions_count: z.array(analyticsDataPointSchema),
|
|
418
|
+
requests_count: z.array(analyticsDataPointSchema),
|
|
419
|
+
requests_latency_mean: z.array(analyticsDataPointSchema),
|
|
420
|
+
tool_errors: z.array(analyticsDataPointSchema),
|
|
421
|
+
mcp_errors: z.array(analyticsDataPointSchema),
|
|
422
|
+
output_token_mean: z.array(analyticsDataPointSchema),
|
|
423
|
+
task_count: z.array(analyticsDataPointSchema)
|
|
424
|
+
});
|
|
425
|
+
const getProjectAnalyticsContractV1 = oc.route({
|
|
426
|
+
path: "/v1/analytics/{projectId}",
|
|
427
|
+
method: "GET",
|
|
428
|
+
summary: "Get project analytics",
|
|
429
|
+
description: "Get analytics data for a project over a time range",
|
|
430
|
+
tags: ["analytics"],
|
|
431
|
+
successDescription: "The project analytics data"
|
|
432
|
+
}).errors({
|
|
433
|
+
NOT_FOUND: {},
|
|
434
|
+
BAD_REQUEST: {}
|
|
435
|
+
}).input(z.object({
|
|
436
|
+
projectId: z.string().describe("The ID of the project"),
|
|
437
|
+
startTimestamp: z.coerce.number().describe("Start timestamp in milliseconds"),
|
|
438
|
+
endTimestamp: z.coerce.number().describe("End timestamp in milliseconds"),
|
|
439
|
+
timeZone: z.string().describe("IANA timezone (e.g. Europe/Paris)")
|
|
440
|
+
}).refine(({ startTimestamp, endTimestamp }) => endTimestamp - startTimestamp > 0, { message: "End date must be after start date" }).refine(({ startTimestamp, endTimestamp }) => endTimestamp - startTimestamp <= 744 * 60 * 60 * 1e3, { message: "Date range must be less than 1 month" }).refine(({ timeZone }) => Intl.supportedValuesOf("timeZone").includes(timeZone), { message: "Time zone must be a valid IANA timezone" })).output(z.object({
|
|
441
|
+
metadata: z.object({
|
|
442
|
+
startTimestamp: z.number(),
|
|
443
|
+
endTimestamp: z.number(),
|
|
444
|
+
timeZone: z.string(),
|
|
445
|
+
startDate: z.coerce.date(),
|
|
446
|
+
interval: z.string()
|
|
447
|
+
}),
|
|
448
|
+
timeSeries: analyticsTimeSeriesSchema
|
|
449
|
+
}));
|
|
450
|
+
const listTeamsContractV1 = oc.route({
|
|
451
|
+
path: "/v1/teams",
|
|
452
|
+
method: "GET",
|
|
453
|
+
summary: "List teams",
|
|
454
|
+
description: "List all teams for the authenticated user",
|
|
455
|
+
tags: ["teams"],
|
|
456
|
+
successDescription: "The list of teams"
|
|
457
|
+
}).output(z.array(z.object({
|
|
458
|
+
id: z.string(),
|
|
459
|
+
name: z.string(),
|
|
460
|
+
createdAt: z.coerce.date(),
|
|
461
|
+
hasStripeAccount: z.boolean()
|
|
462
|
+
})));
|
|
463
|
+
const getTunnelTicketContractV1 = oc.route({
|
|
464
|
+
path: "/v1/tunnels/ticket",
|
|
465
|
+
method: "GET",
|
|
466
|
+
summary: "Get a tunnel ticket",
|
|
467
|
+
description: "Get a signed ticket for establishing a tunnel connection. Requires user authentication (API keys are not supported).",
|
|
468
|
+
tags: ["tunnels"],
|
|
469
|
+
successDescription: "The tunnel ticket"
|
|
470
|
+
}).output(z.object({
|
|
471
|
+
subdomain: z.string().describe("The subdomain assigned to the user"),
|
|
472
|
+
ticket: z.string().describe("The signed tunnel ticket"),
|
|
473
|
+
tunnelHost: z.string().describe("The tunnel host to connect to")
|
|
474
|
+
}));
|
|
246
475
|
const contract = {
|
|
476
|
+
teams: { list: { v1: listTeamsContractV1 } },
|
|
477
|
+
analytics: { get: { v1: getProjectAnalyticsContractV1 } },
|
|
247
478
|
deployments: {
|
|
479
|
+
list: { v1: listDeploymentsContractV1 },
|
|
248
480
|
get: { v1: getDeploymentContractV1 },
|
|
249
|
-
uploadArtifact: { v1: uploadDeploymentArtifactContractV1 }
|
|
481
|
+
uploadArtifact: { v1: uploadDeploymentArtifactContractV1 },
|
|
482
|
+
getLogs: { v1: getDeploymentLogsContractV1 }
|
|
250
483
|
},
|
|
251
484
|
environments: {
|
|
252
485
|
create: { v1: createEnvironmentContractV1 },
|
|
253
486
|
get: { v1: getEnvironmentContractV1 },
|
|
254
|
-
deploy: { v1: deployEnvironmentContractV1 }
|
|
487
|
+
deploy: { v1: deployEnvironmentContractV1 },
|
|
488
|
+
getLogs: { v1: getLogsContractV1 }
|
|
489
|
+
},
|
|
490
|
+
environmentVariables: {
|
|
491
|
+
list: { v1: listEnvironmentVariablesContractV1 },
|
|
492
|
+
create: { v1: createEnvironmentVariablesContractV1 },
|
|
493
|
+
update: { v1: updateEnvironmentVariableContractV1 },
|
|
494
|
+
delete: { v1: deleteEnvironmentVariableContractV1 }
|
|
255
495
|
},
|
|
256
496
|
projects: {
|
|
497
|
+
update: { v1: updateProjectContractV1 },
|
|
257
498
|
get: { v1: getProjectContractV1 },
|
|
258
499
|
list: { v1: listProjectsContractV1 },
|
|
259
|
-
create: { v1: createProjectContractV1 }
|
|
260
|
-
|
|
500
|
+
create: { v1: createProjectContractV1 },
|
|
501
|
+
delete: { v1: deleteProjectContractV1 }
|
|
502
|
+
},
|
|
503
|
+
tunnels: { getTicket: { v1: getTunnelTicketContractV1 } }
|
|
261
504
|
};
|
|
262
|
-
|
|
263
505
|
//#endregion
|
|
264
|
-
export { buildSettingsSchema, contract, createEnvironmentContractV1, environmentVariableSchema, environmentVariablesSchema, runtimeSchema, transportSchema };
|
|
506
|
+
export { buildSettingsSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, runtimeSchema, transportSchema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alpic-ai/api",
|
|
3
|
-
"version": "0.0.0-staging.
|
|
3
|
+
"version": "0.0.0-staging.a322fe8",
|
|
4
4
|
"description": "Contract for the Alpic API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -17,16 +17,17 @@
|
|
|
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",
|
|
25
|
-
"
|
|
26
|
+
"@types/ms": "^2.1.0",
|
|
26
27
|
"shx": "^0.4.0",
|
|
27
|
-
"tsdown": "^0.
|
|
28
|
+
"tsdown": "^0.21.4",
|
|
28
29
|
"typescript": "^5.9.3",
|
|
29
|
-
"vitest": "^4.0
|
|
30
|
+
"vitest": "^4.1.0"
|
|
30
31
|
},
|
|
31
32
|
"scripts": {
|
|
32
33
|
"build": "shx rm -rf dist && tsdown",
|
|
@@ -34,6 +35,7 @@
|
|
|
34
35
|
"test": "pnpm run test:unit && pnpm run test:type && pnpm run test:format",
|
|
35
36
|
"test:unit": "vitest run",
|
|
36
37
|
"test:format": "prettier --check .",
|
|
37
|
-
"test:type": "tsc --noEmit"
|
|
38
|
+
"test:type": "tsc --noEmit",
|
|
39
|
+
"publish:npm": "pnpm publish --tag \"${NPM_TAG}\" --access public --no-git-checks"
|
|
38
40
|
}
|
|
39
41
|
}
|