@alpic-ai/api 0.0.0-dev.f52c42d → 0.0.0-dev.f55bd3e
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 +99 -0
- package/dist/index.mjs +82 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -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;
|
|
@@ -61,6 +147,19 @@ declare const contract: {
|
|
|
61
147
|
expiresAt: z.ZodCoercedDate<unknown>;
|
|
62
148
|
}, z.core.$strip>, Record<never, never>, Record<never, never>>;
|
|
63
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
|
+
};
|
|
64
163
|
};
|
|
65
164
|
environments: {
|
|
66
165
|
create: {
|
package/dist/index.mjs
CHANGED
|
@@ -250,6 +250,17 @@ const uploadDeploymentArtifactContractV1 = oc.route({
|
|
|
250
250
|
token: z.string().describe("Token to identify the source archive"),
|
|
251
251
|
expiresAt: z.coerce.date().describe("Expiration date of the presigned URL")
|
|
252
252
|
}));
|
|
253
|
+
const listProjectDeploymentsContractV1 = oc.route({
|
|
254
|
+
path: "/v1/projects/:projectId/deployments",
|
|
255
|
+
method: "GET",
|
|
256
|
+
summary: "List project deployments",
|
|
257
|
+
description: "List all deployments for a project",
|
|
258
|
+
tags: ["deployments"],
|
|
259
|
+
successDescription: "The list of deployments"
|
|
260
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ projectId: z.string().describe("The ID of the project") })).output(z.array(deploymentSchema.extend({
|
|
261
|
+
isCurrent: z.boolean(),
|
|
262
|
+
environmentId: z.string()
|
|
263
|
+
})));
|
|
253
264
|
const getDeploymentContractV1 = oc.route({
|
|
254
265
|
path: "/v1/deployments/:deploymentId",
|
|
255
266
|
method: "GET",
|
|
@@ -258,10 +269,80 @@ const getDeploymentContractV1 = oc.route({
|
|
|
258
269
|
tags: ["deployments"],
|
|
259
270
|
successDescription: "The deployment details"
|
|
260
271
|
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(deploymentSchema);
|
|
272
|
+
const getDeploymentLogsContractV1 = oc.route({
|
|
273
|
+
path: "/v1/deployments/:deploymentId/logs",
|
|
274
|
+
method: "GET",
|
|
275
|
+
summary: "Get deployment logs",
|
|
276
|
+
description: "Get the logs for a deployment",
|
|
277
|
+
tags: ["deployments"],
|
|
278
|
+
successDescription: "The deployment logs"
|
|
279
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(z.object({
|
|
280
|
+
logs: z.array(z.object({
|
|
281
|
+
timestamp: z.coerce.date().optional(),
|
|
282
|
+
content: z.string().optional()
|
|
283
|
+
})),
|
|
284
|
+
hasMoreLogs: z.boolean()
|
|
285
|
+
}));
|
|
286
|
+
const analyticsDataPointSchema = z.object({
|
|
287
|
+
timestamp: z.number(),
|
|
288
|
+
categories: z.record(z.string(), z.unknown())
|
|
289
|
+
});
|
|
290
|
+
const analyticsTimeSeriesSchema = z.object({
|
|
291
|
+
sessions_count: z.array(analyticsDataPointSchema),
|
|
292
|
+
requests_count: z.array(analyticsDataPointSchema),
|
|
293
|
+
requests_latency_mean: z.array(analyticsDataPointSchema),
|
|
294
|
+
tool_errors: z.array(analyticsDataPointSchema),
|
|
295
|
+
mcp_errors: z.array(analyticsDataPointSchema),
|
|
296
|
+
output_token_mean: z.array(analyticsDataPointSchema),
|
|
297
|
+
task_count: z.array(analyticsDataPointSchema)
|
|
298
|
+
});
|
|
299
|
+
const getProjectAnalyticsContractV1 = oc.route({
|
|
300
|
+
path: "/v1/analytics/:projectId",
|
|
301
|
+
method: "GET",
|
|
302
|
+
summary: "Get project analytics",
|
|
303
|
+
description: "Get analytics data for a project over a time range",
|
|
304
|
+
tags: ["analytics"],
|
|
305
|
+
successDescription: "The project analytics data"
|
|
306
|
+
}).errors({
|
|
307
|
+
NOT_FOUND: {},
|
|
308
|
+
BAD_REQUEST: {}
|
|
309
|
+
}).input(z.object({
|
|
310
|
+
projectId: z.string().describe("The ID of the project"),
|
|
311
|
+
startTimestamp: z.coerce.number().describe("Start timestamp in milliseconds"),
|
|
312
|
+
endTimestamp: z.coerce.number().describe("End timestamp in milliseconds"),
|
|
313
|
+
timeZone: z.string().describe("IANA timezone (e.g. Europe/Paris)")
|
|
314
|
+
}).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({
|
|
315
|
+
metadata: z.object({
|
|
316
|
+
startTimestamp: z.number(),
|
|
317
|
+
endTimestamp: z.number(),
|
|
318
|
+
timeZone: z.string(),
|
|
319
|
+
startDate: z.coerce.date(),
|
|
320
|
+
interval: z.string()
|
|
321
|
+
}),
|
|
322
|
+
timeSeries: analyticsTimeSeriesSchema
|
|
323
|
+
}));
|
|
324
|
+
const listTeamsContractV1 = oc.route({
|
|
325
|
+
path: "/v1/teams",
|
|
326
|
+
method: "GET",
|
|
327
|
+
summary: "List teams",
|
|
328
|
+
description: "List all teams for the authenticated user",
|
|
329
|
+
tags: ["teams"],
|
|
330
|
+
successDescription: "The list of teams"
|
|
331
|
+
}).output(z.array(z.object({
|
|
332
|
+
id: z.string(),
|
|
333
|
+
name: z.string(),
|
|
334
|
+
createdAt: z.coerce.date(),
|
|
335
|
+
hasStripeAccount: z.boolean(),
|
|
336
|
+
hasActiveSubscription: z.boolean()
|
|
337
|
+
})));
|
|
261
338
|
const contract = {
|
|
339
|
+
teams: { list: { v1: listTeamsContractV1 } },
|
|
340
|
+
analytics: { get: { v1: getProjectAnalyticsContractV1 } },
|
|
262
341
|
deployments: {
|
|
342
|
+
list: { v1: listProjectDeploymentsContractV1 },
|
|
263
343
|
get: { v1: getDeploymentContractV1 },
|
|
264
|
-
uploadArtifact: { v1: uploadDeploymentArtifactContractV1 }
|
|
344
|
+
uploadArtifact: { v1: uploadDeploymentArtifactContractV1 },
|
|
345
|
+
getLogs: { v1: getDeploymentLogsContractV1 }
|
|
265
346
|
},
|
|
266
347
|
environments: {
|
|
267
348
|
create: { v1: createEnvironmentContractV1 },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alpic-ai/api",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.f55bd3e",
|
|
4
4
|
"description": "Contract for the Alpic API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"author": "Alpic",
|
|
18
18
|
"license": "ISC",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@orpc/contract": "^1.13.
|
|
20
|
+
"@orpc/contract": "^1.13.5",
|
|
21
21
|
"zod": "^4.3.6"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|