@alpic-ai/api 0.0.0-staging.1e02ef4 → 0.0.0-staging.255c28c
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 +104 -2
- package/dist/index.mjs +84 -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,93 @@ declare const createEnvironmentContractV1: _orpc_contract0.ContractProcedureBuil
|
|
|
29
29
|
BAD_REQUEST: {};
|
|
30
30
|
}>, Record<never, never>>;
|
|
31
31
|
declare const contract: {
|
|
32
|
+
teams: {
|
|
33
|
+
list: {
|
|
34
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithOutput<_orpc_contract0.Schema<unknown, unknown>, z.ZodArray<z.ZodObject<{
|
|
35
|
+
id: z.ZodString;
|
|
36
|
+
name: z.ZodString;
|
|
37
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
38
|
+
hasStripeAccount: z.ZodBoolean;
|
|
39
|
+
hasActiveSubscription: z.ZodBoolean;
|
|
40
|
+
}, z.core.$strip>>, Record<never, never>, Record<never, never>>;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
analytics: {
|
|
44
|
+
get: {
|
|
45
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
46
|
+
projectId: z.ZodString;
|
|
47
|
+
startTimestamp: z.ZodCoercedNumber<unknown>;
|
|
48
|
+
endTimestamp: z.ZodCoercedNumber<unknown>;
|
|
49
|
+
timeZone: z.ZodString;
|
|
50
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
51
|
+
metadata: z.ZodObject<{
|
|
52
|
+
startTimestamp: z.ZodNumber;
|
|
53
|
+
endTimestamp: z.ZodNumber;
|
|
54
|
+
timeZone: z.ZodString;
|
|
55
|
+
startDate: z.ZodCoercedDate<unknown>;
|
|
56
|
+
interval: z.ZodString;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
timeSeries: z.ZodObject<{
|
|
59
|
+
sessions_count: z.ZodArray<z.ZodObject<{
|
|
60
|
+
timestamp: z.ZodNumber;
|
|
61
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
requests_count: z.ZodArray<z.ZodObject<{
|
|
64
|
+
timestamp: z.ZodNumber;
|
|
65
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
66
|
+
}, z.core.$strip>>;
|
|
67
|
+
requests_latency_mean: z.ZodArray<z.ZodObject<{
|
|
68
|
+
timestamp: z.ZodNumber;
|
|
69
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
70
|
+
}, z.core.$strip>>;
|
|
71
|
+
tool_errors: z.ZodArray<z.ZodObject<{
|
|
72
|
+
timestamp: z.ZodNumber;
|
|
73
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
74
|
+
}, z.core.$strip>>;
|
|
75
|
+
mcp_errors: z.ZodArray<z.ZodObject<{
|
|
76
|
+
timestamp: z.ZodNumber;
|
|
77
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
78
|
+
}, z.core.$strip>>;
|
|
79
|
+
output_token_mean: z.ZodArray<z.ZodObject<{
|
|
80
|
+
timestamp: z.ZodNumber;
|
|
81
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
82
|
+
}, z.core.$strip>>;
|
|
83
|
+
task_count: z.ZodArray<z.ZodObject<{
|
|
84
|
+
timestamp: z.ZodNumber;
|
|
85
|
+
categories: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
86
|
+
}, z.core.$strip>>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
89
|
+
NOT_FOUND: {};
|
|
90
|
+
BAD_REQUEST: {};
|
|
91
|
+
}>, Record<never, never>>;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
32
94
|
deployments: {
|
|
95
|
+
list: {
|
|
96
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
97
|
+
projectId: z.ZodString;
|
|
98
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
99
|
+
id: z.ZodString;
|
|
100
|
+
status: z.ZodEnum<{
|
|
101
|
+
ongoing: "ongoing";
|
|
102
|
+
deployed: "deployed";
|
|
103
|
+
failed: "failed";
|
|
104
|
+
canceled: "canceled";
|
|
105
|
+
}>;
|
|
106
|
+
sourceRef: z.ZodNullable<z.ZodString>;
|
|
107
|
+
sourceCommitId: z.ZodNullable<z.ZodString>;
|
|
108
|
+
sourceCommitMessage: z.ZodNullable<z.ZodString>;
|
|
109
|
+
authorUsername: z.ZodNullable<z.ZodString>;
|
|
110
|
+
authorAvatarUrl: z.ZodNullable<z.ZodString>;
|
|
111
|
+
startedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
112
|
+
completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
113
|
+
isCurrent: z.ZodBoolean;
|
|
114
|
+
environmentId: z.ZodString;
|
|
115
|
+
}, z.core.$strip>>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
116
|
+
NOT_FOUND: {};
|
|
117
|
+
}>, Record<never, never>>;
|
|
118
|
+
};
|
|
33
119
|
get: {
|
|
34
120
|
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
35
121
|
deploymentId: z.ZodString;
|
|
@@ -53,12 +139,27 @@ declare const contract: {
|
|
|
53
139
|
}>, Record<never, never>>;
|
|
54
140
|
};
|
|
55
141
|
uploadArtifact: {
|
|
56
|
-
v1: _orpc_contract0.
|
|
142
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodOptional<z.ZodObject<{
|
|
143
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
144
|
+
}, z.core.$strip>>, z.ZodObject<{
|
|
57
145
|
uploadUrl: z.ZodString;
|
|
58
146
|
token: z.ZodString;
|
|
59
147
|
expiresAt: z.ZodCoercedDate<unknown>;
|
|
60
148
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
61
149
|
};
|
|
150
|
+
getLogs: {
|
|
151
|
+
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
152
|
+
deploymentId: z.ZodString;
|
|
153
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
154
|
+
logs: z.ZodArray<z.ZodObject<{
|
|
155
|
+
timestamp: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
156
|
+
content: z.ZodOptional<z.ZodString>;
|
|
157
|
+
}, z.core.$strip>>;
|
|
158
|
+
hasMoreLogs: z.ZodBoolean;
|
|
159
|
+
}, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
|
|
160
|
+
NOT_FOUND: {};
|
|
161
|
+
}>, Record<never, never>>;
|
|
162
|
+
};
|
|
62
163
|
};
|
|
63
164
|
environments: {
|
|
64
165
|
create: {
|
|
@@ -254,6 +355,7 @@ declare const contract: {
|
|
|
254
355
|
};
|
|
255
356
|
create: {
|
|
256
357
|
v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
358
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
257
359
|
name: z.ZodString;
|
|
258
360
|
sourceRepository: z.ZodOptional<z.ZodString>;
|
|
259
361
|
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,80 @@ 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
|
+
}));
|
|
310
|
+
const listTeamsContractV1 = oc.route({
|
|
311
|
+
path: "/v1/teams",
|
|
312
|
+
method: "GET",
|
|
313
|
+
summary: "List teams",
|
|
314
|
+
description: "List all teams for the authenticated user",
|
|
315
|
+
tags: ["teams"],
|
|
316
|
+
successDescription: "The list of teams"
|
|
317
|
+
}).output(z.array(z.object({
|
|
318
|
+
id: z.string(),
|
|
319
|
+
name: z.string(),
|
|
320
|
+
createdAt: z.coerce.date(),
|
|
321
|
+
hasStripeAccount: z.boolean(),
|
|
322
|
+
hasActiveSubscription: z.boolean()
|
|
323
|
+
})));
|
|
246
324
|
const contract = {
|
|
325
|
+
teams: { list: { v1: listTeamsContractV1 } },
|
|
326
|
+
analytics: { get: { v1: getProjectAnalyticsContractV1 } },
|
|
247
327
|
deployments: {
|
|
328
|
+
list: { v1: listProjectDeploymentsContractV1 },
|
|
248
329
|
get: { v1: getDeploymentContractV1 },
|
|
249
|
-
uploadArtifact: { v1: uploadDeploymentArtifactContractV1 }
|
|
330
|
+
uploadArtifact: { v1: uploadDeploymentArtifactContractV1 },
|
|
331
|
+
getLogs: { v1: getDeploymentLogsContractV1 }
|
|
250
332
|
},
|
|
251
333
|
environments: {
|
|
252
334
|
create: { v1: createEnvironmentContractV1 },
|