@alpic-ai/api 1.85.0 → 1.87.0
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 +93 -2
- package/dist/index.mjs +69 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ 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
9
|
};
|
|
10
10
|
};
|
|
11
11
|
declare const createEnvironmentContractV1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
@@ -29,7 +29,82 @@ declare const createEnvironmentContractV1: _orpc_contract0.ContractProcedureBuil
|
|
|
29
29
|
BAD_REQUEST: {};
|
|
30
30
|
}>, Record<never, never>>;
|
|
31
31
|
declare const contract: {
|
|
32
|
+
analytics: {
|
|
33
|
+
get: {
|
|
34
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
35
|
+
projectId: z.ZodString;
|
|
36
|
+
startTimestamp: z.ZodCoercedNumber<unknown>;
|
|
37
|
+
endTimestamp: z.ZodCoercedNumber<unknown>;
|
|
38
|
+
timeZone: z.ZodString;
|
|
39
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
40
|
+
metadata: z.ZodObject<{
|
|
41
|
+
startTimestamp: z.ZodNumber;
|
|
42
|
+
endTimestamp: z.ZodNumber;
|
|
43
|
+
timeZone: z.ZodString;
|
|
44
|
+
startDate: z.ZodCoercedDate<unknown>;
|
|
45
|
+
interval: z.ZodString;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
timeSeries: z.ZodObject<{
|
|
48
|
+
sessions_count: z.ZodArray<z.ZodObject<{
|
|
49
|
+
timestamp: z.ZodNumber;
|
|
50
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
51
|
+
}, z.core.$strip>>;
|
|
52
|
+
requests_count: z.ZodArray<z.ZodObject<{
|
|
53
|
+
timestamp: z.ZodNumber;
|
|
54
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
55
|
+
}, z.core.$strip>>;
|
|
56
|
+
requests_latency_mean: z.ZodArray<z.ZodObject<{
|
|
57
|
+
timestamp: z.ZodNumber;
|
|
58
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
59
|
+
}, z.core.$strip>>;
|
|
60
|
+
tool_errors: z.ZodArray<z.ZodObject<{
|
|
61
|
+
timestamp: z.ZodNumber;
|
|
62
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
63
|
+
}, z.core.$strip>>;
|
|
64
|
+
mcp_errors: z.ZodArray<z.ZodObject<{
|
|
65
|
+
timestamp: z.ZodNumber;
|
|
66
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
67
|
+
}, z.core.$strip>>;
|
|
68
|
+
output_token_mean: z.ZodArray<z.ZodObject<{
|
|
69
|
+
timestamp: z.ZodNumber;
|
|
70
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
71
|
+
}, z.core.$strip>>;
|
|
72
|
+
task_count: z.ZodArray<z.ZodObject<{
|
|
73
|
+
timestamp: z.ZodNumber;
|
|
74
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
75
|
+
}, z.core.$strip>>;
|
|
76
|
+
}, z.core.$strip>;
|
|
77
|
+
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
78
|
+
NOT_FOUND: {};
|
|
79
|
+
BAD_REQUEST: {};
|
|
80
|
+
}>, Record<never, never>>;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
32
83
|
deployments: {
|
|
84
|
+
list: {
|
|
85
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
86
|
+
projectId: z.ZodString;
|
|
87
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
88
|
+
id: z.ZodString;
|
|
89
|
+
status: z.ZodEnum<{
|
|
90
|
+
ongoing: "ongoing";
|
|
91
|
+
deployed: "deployed";
|
|
92
|
+
failed: "failed";
|
|
93
|
+
canceled: "canceled";
|
|
94
|
+
}>;
|
|
95
|
+
sourceRef: z.ZodNullable<z.ZodString>;
|
|
96
|
+
sourceCommitId: z.ZodNullable<z.ZodString>;
|
|
97
|
+
sourceCommitMessage: z.ZodNullable<z.ZodString>;
|
|
98
|
+
authorUsername: z.ZodNullable<z.ZodString>;
|
|
99
|
+
authorAvatarUrl: z.ZodNullable<z.ZodString>;
|
|
100
|
+
startedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
101
|
+
completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
102
|
+
isCurrent: z.ZodBoolean;
|
|
103
|
+
environmentId: z.ZodString;
|
|
104
|
+
}, z.core.$strip>>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
105
|
+
NOT_FOUND: {};
|
|
106
|
+
}>, Record<never, never>>;
|
|
107
|
+
};
|
|
33
108
|
get: {
|
|
34
109
|
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
35
110
|
deploymentId: z.ZodString;
|
|
@@ -53,12 +128,27 @@ declare const contract: {
|
|
|
53
128
|
}>, Record<never, never>>;
|
|
54
129
|
};
|
|
55
130
|
uploadArtifact: {
|
|
56
|
-
v1: _orpc_contract0.
|
|
131
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodOptional<z.ZodObject<{
|
|
132
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
133
|
+
}, z.core.$strip>>, z.ZodObject<{
|
|
57
134
|
uploadUrl: z.ZodString;
|
|
58
135
|
token: z.ZodString;
|
|
59
136
|
expiresAt: z.ZodCoercedDate<unknown>;
|
|
60
137
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
61
138
|
};
|
|
139
|
+
getLogs: {
|
|
140
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
141
|
+
deploymentId: z.ZodString;
|
|
142
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
143
|
+
logs: z.ZodArray<z.ZodObject<{
|
|
144
|
+
timestamp: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
145
|
+
content: z.ZodOptional<z.ZodString>;
|
|
146
|
+
}, z.core.$strip>>;
|
|
147
|
+
hasMoreLogs: z.ZodBoolean;
|
|
148
|
+
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
149
|
+
NOT_FOUND: {};
|
|
150
|
+
}>, Record<never, never>>;
|
|
151
|
+
};
|
|
62
152
|
};
|
|
63
153
|
environments: {
|
|
64
154
|
create: {
|
|
@@ -254,6 +344,7 @@ declare const contract: {
|
|
|
254
344
|
};
|
|
255
345
|
create: {
|
|
256
346
|
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
347
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
257
348
|
name: z.ZodString;
|
|
258
349
|
sourceRepository: z.ZodOptional<z.ZodString>;
|
|
259
350
|
branchName: z.ZodOptional<z.ZodString>;
|
package/dist/index.mjs
CHANGED
|
@@ -179,6 +179,7 @@ const createProjectContractV1 = oc.route({
|
|
|
179
179
|
NOT_FOUND: {},
|
|
180
180
|
BAD_REQUEST: {}
|
|
181
181
|
}).input(z.object({
|
|
182
|
+
teamId: z.string().optional(),
|
|
182
183
|
name: z.string().min(1).max(100),
|
|
183
184
|
sourceRepository: z.string().optional(),
|
|
184
185
|
branchName: z.string().min(1).optional(),
|
|
@@ -230,11 +231,22 @@ const uploadDeploymentArtifactContractV1 = oc.route({
|
|
|
230
231
|
description: "Return a presigned S3 URL to upload a deployment artifact",
|
|
231
232
|
tags: ["deployments"],
|
|
232
233
|
successDescription: "The presigned upload URL has been generated successfully"
|
|
233
|
-
}).output(z.object({
|
|
234
|
+
}).input(z.object({ teamId: z.string().optional() }).optional()).output(z.object({
|
|
234
235
|
uploadUrl: z.string().url().describe("Presigned S3 URL to upload the source archive with HTTP PUT"),
|
|
235
236
|
token: z.string().describe("Token to identify the source archive"),
|
|
236
237
|
expiresAt: z.coerce.date().describe("Expiration date of the presigned URL")
|
|
237
238
|
}));
|
|
239
|
+
const listProjectDeploymentsContractV1 = oc.route({
|
|
240
|
+
path: "/v1/projects/:projectId/deployments",
|
|
241
|
+
method: "GET",
|
|
242
|
+
summary: "List project deployments",
|
|
243
|
+
description: "List all deployments for a project",
|
|
244
|
+
tags: ["deployments"],
|
|
245
|
+
successDescription: "The list of deployments"
|
|
246
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ projectId: z.string().describe("The ID of the project") })).output(z.array(deploymentSchema.extend({
|
|
247
|
+
isCurrent: z.boolean(),
|
|
248
|
+
environmentId: z.string()
|
|
249
|
+
})));
|
|
238
250
|
const getDeploymentContractV1 = oc.route({
|
|
239
251
|
path: "/v1/deployments/:deploymentId",
|
|
240
252
|
method: "GET",
|
|
@@ -243,10 +255,65 @@ const getDeploymentContractV1 = oc.route({
|
|
|
243
255
|
tags: ["deployments"],
|
|
244
256
|
successDescription: "The deployment details"
|
|
245
257
|
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(deploymentSchema);
|
|
258
|
+
const getDeploymentLogsContractV1 = oc.route({
|
|
259
|
+
path: "/v1/deployments/:deploymentId/logs",
|
|
260
|
+
method: "GET",
|
|
261
|
+
summary: "Get deployment logs",
|
|
262
|
+
description: "Get the logs for a deployment",
|
|
263
|
+
tags: ["deployments"],
|
|
264
|
+
successDescription: "The deployment logs"
|
|
265
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(z.object({
|
|
266
|
+
logs: z.array(z.object({
|
|
267
|
+
timestamp: z.coerce.date().optional(),
|
|
268
|
+
content: z.string().optional()
|
|
269
|
+
})),
|
|
270
|
+
hasMoreLogs: z.boolean()
|
|
271
|
+
}));
|
|
272
|
+
const analyticsDataPointSchema = z.object({
|
|
273
|
+
timestamp: z.number(),
|
|
274
|
+
categories: z.record(z.string(), z.unknown())
|
|
275
|
+
});
|
|
276
|
+
const analyticsTimeSeriesSchema = z.object({
|
|
277
|
+
sessions_count: z.array(analyticsDataPointSchema),
|
|
278
|
+
requests_count: z.array(analyticsDataPointSchema),
|
|
279
|
+
requests_latency_mean: z.array(analyticsDataPointSchema),
|
|
280
|
+
tool_errors: z.array(analyticsDataPointSchema),
|
|
281
|
+
mcp_errors: z.array(analyticsDataPointSchema),
|
|
282
|
+
output_token_mean: z.array(analyticsDataPointSchema),
|
|
283
|
+
task_count: z.array(analyticsDataPointSchema)
|
|
284
|
+
});
|
|
285
|
+
const getProjectAnalyticsContractV1 = oc.route({
|
|
286
|
+
path: "/v1/analytics/:projectId",
|
|
287
|
+
method: "GET",
|
|
288
|
+
summary: "Get project analytics",
|
|
289
|
+
description: "Get analytics data for a project over a time range",
|
|
290
|
+
tags: ["analytics"],
|
|
291
|
+
successDescription: "The project analytics data"
|
|
292
|
+
}).errors({
|
|
293
|
+
NOT_FOUND: {},
|
|
294
|
+
BAD_REQUEST: {}
|
|
295
|
+
}).input(z.object({
|
|
296
|
+
projectId: z.string().describe("The ID of the project"),
|
|
297
|
+
startTimestamp: z.coerce.number().describe("Start timestamp in milliseconds"),
|
|
298
|
+
endTimestamp: z.coerce.number().describe("End timestamp in milliseconds"),
|
|
299
|
+
timeZone: z.string().describe("IANA timezone (e.g. Europe/Paris)")
|
|
300
|
+
}).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({
|
|
301
|
+
metadata: z.object({
|
|
302
|
+
startTimestamp: z.number(),
|
|
303
|
+
endTimestamp: z.number(),
|
|
304
|
+
timeZone: z.string(),
|
|
305
|
+
startDate: z.coerce.date(),
|
|
306
|
+
interval: z.string()
|
|
307
|
+
}),
|
|
308
|
+
timeSeries: analyticsTimeSeriesSchema
|
|
309
|
+
}));
|
|
246
310
|
const contract = {
|
|
311
|
+
analytics: { get: { v1: getProjectAnalyticsContractV1 } },
|
|
247
312
|
deployments: {
|
|
313
|
+
list: { v1: listProjectDeploymentsContractV1 },
|
|
248
314
|
get: { v1: getDeploymentContractV1 },
|
|
249
|
-
uploadArtifact: { v1: uploadDeploymentArtifactContractV1 }
|
|
315
|
+
uploadArtifact: { v1: uploadDeploymentArtifactContractV1 },
|
|
316
|
+
getLogs: { v1: getDeploymentLogsContractV1 }
|
|
250
317
|
},
|
|
251
318
|
environments: {
|
|
252
319
|
create: { v1: createEnvironmentContractV1 },
|