@alpic-ai/api 0.0.0-dev.gf047e2d → 0.0.0-dev.gf0c528e
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 +487 -1
- package/dist/index.mjs +232 -15
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -47,6 +47,26 @@ declare const contract: {
|
|
|
47
47
|
BAD_REQUEST: {};
|
|
48
48
|
}>, Record<never, never>>;
|
|
49
49
|
};
|
|
50
|
+
getUsage: {
|
|
51
|
+
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
52
|
+
teamId: z.ZodString;
|
|
53
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
54
|
+
teamId: z.ZodString;
|
|
55
|
+
plan: z.ZodNullable<z.ZodEnum<{
|
|
56
|
+
pro: "pro";
|
|
57
|
+
business: "business";
|
|
58
|
+
enterprise: "enterprise";
|
|
59
|
+
}>>;
|
|
60
|
+
periodStart: z.ZodCoercedDate<unknown>;
|
|
61
|
+
periodEnd: z.ZodCoercedDate<unknown>;
|
|
62
|
+
requestCount: z.ZodNumber;
|
|
63
|
+
includedRequests: z.ZodNullable<z.ZodNumber>;
|
|
64
|
+
}, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
65
|
+
BAD_REQUEST: {};
|
|
66
|
+
}>, {
|
|
67
|
+
NOT_FOUND: {};
|
|
68
|
+
}>, Record<never, never>>;
|
|
69
|
+
};
|
|
50
70
|
};
|
|
51
71
|
analytics: {
|
|
52
72
|
get: {
|
|
@@ -100,6 +120,222 @@ declare const contract: {
|
|
|
100
120
|
}>, Record<never, never>>;
|
|
101
121
|
};
|
|
102
122
|
};
|
|
123
|
+
intents: {
|
|
124
|
+
list: {
|
|
125
|
+
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
126
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
127
|
+
clientIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
128
|
+
categoryIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
129
|
+
sortDir: z.ZodDefault<z.ZodEnum<{
|
|
130
|
+
asc: "asc";
|
|
131
|
+
desc: "desc";
|
|
132
|
+
}>>;
|
|
133
|
+
environmentId: z.ZodString;
|
|
134
|
+
since: z.ZodDefault<z.ZodString>;
|
|
135
|
+
until: z.ZodOptional<z.ZodString>;
|
|
136
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
137
|
+
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
138
|
+
search: z.ZodOptional<z.ZodString>;
|
|
139
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
140
|
+
intents: z.ZodArray<z.ZodObject<{
|
|
141
|
+
id: z.ZodString;
|
|
142
|
+
intentIds: z.ZodArray<z.ZodString>;
|
|
143
|
+
environmentId: z.ZodString;
|
|
144
|
+
message: z.ZodString;
|
|
145
|
+
toolName: z.ZodString;
|
|
146
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
147
|
+
occurrenceCount: z.ZodNumber;
|
|
148
|
+
clientName: z.ZodNullable<z.ZodString>;
|
|
149
|
+
clientId: z.ZodNullable<z.ZodString>;
|
|
150
|
+
categories: z.ZodArray<z.ZodObject<{
|
|
151
|
+
id: z.ZodString;
|
|
152
|
+
name: z.ZodString;
|
|
153
|
+
color: z.ZodEnum<{
|
|
154
|
+
red: "red";
|
|
155
|
+
orange: "orange";
|
|
156
|
+
yellow: "yellow";
|
|
157
|
+
green: "green";
|
|
158
|
+
blue: "blue";
|
|
159
|
+
purple: "purple";
|
|
160
|
+
pink: "pink";
|
|
161
|
+
gray: "gray";
|
|
162
|
+
}>;
|
|
163
|
+
}, z.core.$strip>>;
|
|
164
|
+
}, z.core.$strip>>;
|
|
165
|
+
totalCount: z.ZodNumber;
|
|
166
|
+
}, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
167
|
+
BAD_REQUEST: {};
|
|
168
|
+
}>, {
|
|
169
|
+
NOT_FOUND: {};
|
|
170
|
+
}>, Record<never, never>>;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
intentCategories: {
|
|
174
|
+
list: {
|
|
175
|
+
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
176
|
+
environmentId: z.ZodString;
|
|
177
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
178
|
+
id: z.ZodString;
|
|
179
|
+
name: z.ZodString;
|
|
180
|
+
color: z.ZodEnum<{
|
|
181
|
+
red: "red";
|
|
182
|
+
orange: "orange";
|
|
183
|
+
yellow: "yellow";
|
|
184
|
+
green: "green";
|
|
185
|
+
blue: "blue";
|
|
186
|
+
purple: "purple";
|
|
187
|
+
pink: "pink";
|
|
188
|
+
gray: "gray";
|
|
189
|
+
}>;
|
|
190
|
+
intentCount: z.ZodNumber;
|
|
191
|
+
}, z.core.$strip>>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
192
|
+
BAD_REQUEST: {};
|
|
193
|
+
}>, {
|
|
194
|
+
NOT_FOUND: {};
|
|
195
|
+
}>, Record<never, never>>;
|
|
196
|
+
};
|
|
197
|
+
create: {
|
|
198
|
+
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
199
|
+
environmentId: z.ZodString;
|
|
200
|
+
name: z.ZodString;
|
|
201
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
202
|
+
red: "red";
|
|
203
|
+
orange: "orange";
|
|
204
|
+
yellow: "yellow";
|
|
205
|
+
green: "green";
|
|
206
|
+
blue: "blue";
|
|
207
|
+
purple: "purple";
|
|
208
|
+
pink: "pink";
|
|
209
|
+
gray: "gray";
|
|
210
|
+
}>>;
|
|
211
|
+
intentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
212
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
213
|
+
id: z.ZodString;
|
|
214
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
215
|
+
environmentId: z.ZodString;
|
|
216
|
+
name: z.ZodString;
|
|
217
|
+
color: z.ZodEnum<{
|
|
218
|
+
red: "red";
|
|
219
|
+
orange: "orange";
|
|
220
|
+
yellow: "yellow";
|
|
221
|
+
green: "green";
|
|
222
|
+
blue: "blue";
|
|
223
|
+
purple: "purple";
|
|
224
|
+
pink: "pink";
|
|
225
|
+
gray: "gray";
|
|
226
|
+
}>;
|
|
227
|
+
}, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
228
|
+
BAD_REQUEST: {};
|
|
229
|
+
}>, {
|
|
230
|
+
NOT_FOUND: {};
|
|
231
|
+
}>, Record<never, never>>;
|
|
232
|
+
};
|
|
233
|
+
update: {
|
|
234
|
+
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
235
|
+
environmentId: z.ZodString;
|
|
236
|
+
categoryId: z.ZodString;
|
|
237
|
+
name: z.ZodOptional<z.ZodString>;
|
|
238
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
239
|
+
red: "red";
|
|
240
|
+
orange: "orange";
|
|
241
|
+
yellow: "yellow";
|
|
242
|
+
green: "green";
|
|
243
|
+
blue: "blue";
|
|
244
|
+
purple: "purple";
|
|
245
|
+
pink: "pink";
|
|
246
|
+
gray: "gray";
|
|
247
|
+
}>>;
|
|
248
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
249
|
+
id: z.ZodString;
|
|
250
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
251
|
+
environmentId: z.ZodString;
|
|
252
|
+
name: z.ZodString;
|
|
253
|
+
color: z.ZodEnum<{
|
|
254
|
+
red: "red";
|
|
255
|
+
orange: "orange";
|
|
256
|
+
yellow: "yellow";
|
|
257
|
+
green: "green";
|
|
258
|
+
blue: "blue";
|
|
259
|
+
purple: "purple";
|
|
260
|
+
pink: "pink";
|
|
261
|
+
gray: "gray";
|
|
262
|
+
}>;
|
|
263
|
+
}, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
264
|
+
BAD_REQUEST: {};
|
|
265
|
+
}>, {
|
|
266
|
+
NOT_FOUND: {};
|
|
267
|
+
}>, Record<never, never>>;
|
|
268
|
+
};
|
|
269
|
+
delete: {
|
|
270
|
+
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
271
|
+
environmentId: z.ZodString;
|
|
272
|
+
categoryId: z.ZodString;
|
|
273
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
274
|
+
success: z.ZodLiteral<true>;
|
|
275
|
+
}, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
276
|
+
BAD_REQUEST: {};
|
|
277
|
+
}>, {
|
|
278
|
+
NOT_FOUND: {};
|
|
279
|
+
}>, Record<never, never>>;
|
|
280
|
+
};
|
|
281
|
+
link: {
|
|
282
|
+
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
283
|
+
environmentId: z.ZodString;
|
|
284
|
+
categoryId: z.ZodString;
|
|
285
|
+
intentIds: z.ZodArray<z.ZodString>;
|
|
286
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
287
|
+
success: z.ZodLiteral<true>;
|
|
288
|
+
}, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
289
|
+
BAD_REQUEST: {};
|
|
290
|
+
}>, {
|
|
291
|
+
NOT_FOUND: {};
|
|
292
|
+
}>, Record<never, never>>;
|
|
293
|
+
};
|
|
294
|
+
unlink: {
|
|
295
|
+
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
296
|
+
environmentId: z.ZodString;
|
|
297
|
+
categoryId: z.ZodString;
|
|
298
|
+
intentIds: z.ZodArray<z.ZodString>;
|
|
299
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
300
|
+
success: z.ZodLiteral<true>;
|
|
301
|
+
}, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
302
|
+
BAD_REQUEST: {};
|
|
303
|
+
}>, {
|
|
304
|
+
NOT_FOUND: {};
|
|
305
|
+
}>, Record<never, never>>;
|
|
306
|
+
};
|
|
307
|
+
};
|
|
308
|
+
feedbacks: {
|
|
309
|
+
list: {
|
|
310
|
+
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
311
|
+
clientIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
312
|
+
environmentId: z.ZodString;
|
|
313
|
+
since: z.ZodDefault<z.ZodString>;
|
|
314
|
+
until: z.ZodOptional<z.ZodString>;
|
|
315
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
316
|
+
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
317
|
+
search: z.ZodOptional<z.ZodString>;
|
|
318
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
319
|
+
feedbacks: z.ZodArray<z.ZodObject<{
|
|
320
|
+
id: z.ZodString;
|
|
321
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
322
|
+
environmentId: z.ZodString;
|
|
323
|
+
content: z.ZodString;
|
|
324
|
+
source: z.ZodEnum<{
|
|
325
|
+
model: "model";
|
|
326
|
+
user: "user";
|
|
327
|
+
}>;
|
|
328
|
+
clientName: z.ZodNullable<z.ZodString>;
|
|
329
|
+
clientId: z.ZodNullable<z.ZodString>;
|
|
330
|
+
}, z.core.$strip>>;
|
|
331
|
+
totalCount: z.ZodNumber;
|
|
332
|
+
}, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
333
|
+
BAD_REQUEST: {};
|
|
334
|
+
}>, {
|
|
335
|
+
NOT_FOUND: {};
|
|
336
|
+
}>, Record<never, never>>;
|
|
337
|
+
};
|
|
338
|
+
};
|
|
103
339
|
deployments: {
|
|
104
340
|
list: {
|
|
105
341
|
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
@@ -1079,6 +1315,26 @@ declare const contractForDocs: {
|
|
|
1079
1315
|
BAD_REQUEST: {};
|
|
1080
1316
|
}>, Record<never, never>>;
|
|
1081
1317
|
};
|
|
1318
|
+
getUsage: {
|
|
1319
|
+
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1320
|
+
teamId: z.ZodString;
|
|
1321
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1322
|
+
teamId: z.ZodString;
|
|
1323
|
+
plan: z.ZodNullable<z.ZodEnum<{
|
|
1324
|
+
pro: "pro";
|
|
1325
|
+
business: "business";
|
|
1326
|
+
enterprise: "enterprise";
|
|
1327
|
+
}>>;
|
|
1328
|
+
periodStart: z.ZodCoercedDate<unknown>;
|
|
1329
|
+
periodEnd: z.ZodCoercedDate<unknown>;
|
|
1330
|
+
requestCount: z.ZodNumber;
|
|
1331
|
+
includedRequests: z.ZodNullable<z.ZodNumber>;
|
|
1332
|
+
}, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
1333
|
+
BAD_REQUEST: {};
|
|
1334
|
+
}>, {
|
|
1335
|
+
NOT_FOUND: {};
|
|
1336
|
+
}>, Record<never, never>>;
|
|
1337
|
+
};
|
|
1082
1338
|
};
|
|
1083
1339
|
analytics: {
|
|
1084
1340
|
get: {
|
|
@@ -1132,6 +1388,222 @@ declare const contractForDocs: {
|
|
|
1132
1388
|
}>, Record<never, never>>;
|
|
1133
1389
|
};
|
|
1134
1390
|
};
|
|
1391
|
+
intents: {
|
|
1392
|
+
list: {
|
|
1393
|
+
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1394
|
+
tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1395
|
+
clientIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1396
|
+
categoryIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1397
|
+
sortDir: z.ZodDefault<z.ZodEnum<{
|
|
1398
|
+
asc: "asc";
|
|
1399
|
+
desc: "desc";
|
|
1400
|
+
}>>;
|
|
1401
|
+
environmentId: z.ZodString;
|
|
1402
|
+
since: z.ZodDefault<z.ZodString>;
|
|
1403
|
+
until: z.ZodOptional<z.ZodString>;
|
|
1404
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
1405
|
+
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
1406
|
+
search: z.ZodOptional<z.ZodString>;
|
|
1407
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1408
|
+
intents: z.ZodArray<z.ZodObject<{
|
|
1409
|
+
id: z.ZodString;
|
|
1410
|
+
intentIds: z.ZodArray<z.ZodString>;
|
|
1411
|
+
environmentId: z.ZodString;
|
|
1412
|
+
message: z.ZodString;
|
|
1413
|
+
toolName: z.ZodString;
|
|
1414
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
1415
|
+
occurrenceCount: z.ZodNumber;
|
|
1416
|
+
clientName: z.ZodNullable<z.ZodString>;
|
|
1417
|
+
clientId: z.ZodNullable<z.ZodString>;
|
|
1418
|
+
categories: z.ZodArray<z.ZodObject<{
|
|
1419
|
+
id: z.ZodString;
|
|
1420
|
+
name: z.ZodString;
|
|
1421
|
+
color: z.ZodEnum<{
|
|
1422
|
+
red: "red";
|
|
1423
|
+
orange: "orange";
|
|
1424
|
+
yellow: "yellow";
|
|
1425
|
+
green: "green";
|
|
1426
|
+
blue: "blue";
|
|
1427
|
+
purple: "purple";
|
|
1428
|
+
pink: "pink";
|
|
1429
|
+
gray: "gray";
|
|
1430
|
+
}>;
|
|
1431
|
+
}, z.core.$strip>>;
|
|
1432
|
+
}, z.core.$strip>>;
|
|
1433
|
+
totalCount: z.ZodNumber;
|
|
1434
|
+
}, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
1435
|
+
BAD_REQUEST: {};
|
|
1436
|
+
}>, {
|
|
1437
|
+
NOT_FOUND: {};
|
|
1438
|
+
}>, Record<never, never>>;
|
|
1439
|
+
};
|
|
1440
|
+
};
|
|
1441
|
+
intentCategories: {
|
|
1442
|
+
list: {
|
|
1443
|
+
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1444
|
+
environmentId: z.ZodString;
|
|
1445
|
+
}, z.core.$strip>, z.ZodArray<z.ZodObject<{
|
|
1446
|
+
id: z.ZodString;
|
|
1447
|
+
name: z.ZodString;
|
|
1448
|
+
color: z.ZodEnum<{
|
|
1449
|
+
red: "red";
|
|
1450
|
+
orange: "orange";
|
|
1451
|
+
yellow: "yellow";
|
|
1452
|
+
green: "green";
|
|
1453
|
+
blue: "blue";
|
|
1454
|
+
purple: "purple";
|
|
1455
|
+
pink: "pink";
|
|
1456
|
+
gray: "gray";
|
|
1457
|
+
}>;
|
|
1458
|
+
intentCount: z.ZodNumber;
|
|
1459
|
+
}, z.core.$strip>>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
1460
|
+
BAD_REQUEST: {};
|
|
1461
|
+
}>, {
|
|
1462
|
+
NOT_FOUND: {};
|
|
1463
|
+
}>, Record<never, never>>;
|
|
1464
|
+
};
|
|
1465
|
+
create: {
|
|
1466
|
+
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1467
|
+
environmentId: z.ZodString;
|
|
1468
|
+
name: z.ZodString;
|
|
1469
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
1470
|
+
red: "red";
|
|
1471
|
+
orange: "orange";
|
|
1472
|
+
yellow: "yellow";
|
|
1473
|
+
green: "green";
|
|
1474
|
+
blue: "blue";
|
|
1475
|
+
purple: "purple";
|
|
1476
|
+
pink: "pink";
|
|
1477
|
+
gray: "gray";
|
|
1478
|
+
}>>;
|
|
1479
|
+
intentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1480
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1481
|
+
id: z.ZodString;
|
|
1482
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
1483
|
+
environmentId: z.ZodString;
|
|
1484
|
+
name: z.ZodString;
|
|
1485
|
+
color: z.ZodEnum<{
|
|
1486
|
+
red: "red";
|
|
1487
|
+
orange: "orange";
|
|
1488
|
+
yellow: "yellow";
|
|
1489
|
+
green: "green";
|
|
1490
|
+
blue: "blue";
|
|
1491
|
+
purple: "purple";
|
|
1492
|
+
pink: "pink";
|
|
1493
|
+
gray: "gray";
|
|
1494
|
+
}>;
|
|
1495
|
+
}, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
1496
|
+
BAD_REQUEST: {};
|
|
1497
|
+
}>, {
|
|
1498
|
+
NOT_FOUND: {};
|
|
1499
|
+
}>, Record<never, never>>;
|
|
1500
|
+
};
|
|
1501
|
+
update: {
|
|
1502
|
+
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1503
|
+
environmentId: z.ZodString;
|
|
1504
|
+
categoryId: z.ZodString;
|
|
1505
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1506
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
1507
|
+
red: "red";
|
|
1508
|
+
orange: "orange";
|
|
1509
|
+
yellow: "yellow";
|
|
1510
|
+
green: "green";
|
|
1511
|
+
blue: "blue";
|
|
1512
|
+
purple: "purple";
|
|
1513
|
+
pink: "pink";
|
|
1514
|
+
gray: "gray";
|
|
1515
|
+
}>>;
|
|
1516
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1517
|
+
id: z.ZodString;
|
|
1518
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
1519
|
+
environmentId: z.ZodString;
|
|
1520
|
+
name: z.ZodString;
|
|
1521
|
+
color: z.ZodEnum<{
|
|
1522
|
+
red: "red";
|
|
1523
|
+
orange: "orange";
|
|
1524
|
+
yellow: "yellow";
|
|
1525
|
+
green: "green";
|
|
1526
|
+
blue: "blue";
|
|
1527
|
+
purple: "purple";
|
|
1528
|
+
pink: "pink";
|
|
1529
|
+
gray: "gray";
|
|
1530
|
+
}>;
|
|
1531
|
+
}, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
1532
|
+
BAD_REQUEST: {};
|
|
1533
|
+
}>, {
|
|
1534
|
+
NOT_FOUND: {};
|
|
1535
|
+
}>, Record<never, never>>;
|
|
1536
|
+
};
|
|
1537
|
+
delete: {
|
|
1538
|
+
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1539
|
+
environmentId: z.ZodString;
|
|
1540
|
+
categoryId: z.ZodString;
|
|
1541
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1542
|
+
success: z.ZodLiteral<true>;
|
|
1543
|
+
}, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
1544
|
+
BAD_REQUEST: {};
|
|
1545
|
+
}>, {
|
|
1546
|
+
NOT_FOUND: {};
|
|
1547
|
+
}>, Record<never, never>>;
|
|
1548
|
+
};
|
|
1549
|
+
link: {
|
|
1550
|
+
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1551
|
+
environmentId: z.ZodString;
|
|
1552
|
+
categoryId: z.ZodString;
|
|
1553
|
+
intentIds: z.ZodArray<z.ZodString>;
|
|
1554
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1555
|
+
success: z.ZodLiteral<true>;
|
|
1556
|
+
}, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
1557
|
+
BAD_REQUEST: {};
|
|
1558
|
+
}>, {
|
|
1559
|
+
NOT_FOUND: {};
|
|
1560
|
+
}>, Record<never, never>>;
|
|
1561
|
+
};
|
|
1562
|
+
unlink: {
|
|
1563
|
+
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1564
|
+
environmentId: z.ZodString;
|
|
1565
|
+
categoryId: z.ZodString;
|
|
1566
|
+
intentIds: z.ZodArray<z.ZodString>;
|
|
1567
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1568
|
+
success: z.ZodLiteral<true>;
|
|
1569
|
+
}, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
1570
|
+
BAD_REQUEST: {};
|
|
1571
|
+
}>, {
|
|
1572
|
+
NOT_FOUND: {};
|
|
1573
|
+
}>, Record<never, never>>;
|
|
1574
|
+
};
|
|
1575
|
+
};
|
|
1576
|
+
feedbacks: {
|
|
1577
|
+
list: {
|
|
1578
|
+
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
1579
|
+
clientIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1580
|
+
environmentId: z.ZodString;
|
|
1581
|
+
since: z.ZodDefault<z.ZodString>;
|
|
1582
|
+
until: z.ZodOptional<z.ZodString>;
|
|
1583
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
1584
|
+
offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
1585
|
+
search: z.ZodOptional<z.ZodString>;
|
|
1586
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1587
|
+
feedbacks: z.ZodArray<z.ZodObject<{
|
|
1588
|
+
id: z.ZodString;
|
|
1589
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
1590
|
+
environmentId: z.ZodString;
|
|
1591
|
+
content: z.ZodString;
|
|
1592
|
+
source: z.ZodEnum<{
|
|
1593
|
+
model: "model";
|
|
1594
|
+
user: "user";
|
|
1595
|
+
}>;
|
|
1596
|
+
clientName: z.ZodNullable<z.ZodString>;
|
|
1597
|
+
clientId: z.ZodNullable<z.ZodString>;
|
|
1598
|
+
}, z.core.$strip>>;
|
|
1599
|
+
totalCount: z.ZodNumber;
|
|
1600
|
+
}, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
|
|
1601
|
+
BAD_REQUEST: {};
|
|
1602
|
+
}>, {
|
|
1603
|
+
NOT_FOUND: {};
|
|
1604
|
+
}>, Record<never, never>>;
|
|
1605
|
+
};
|
|
1606
|
+
};
|
|
1135
1607
|
environments: {
|
|
1136
1608
|
create: {
|
|
1137
1609
|
v1: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
|
|
@@ -1940,6 +2412,20 @@ type RouteAuthMeta = {
|
|
|
1940
2412
|
authScope?: AuthScope;
|
|
1941
2413
|
};
|
|
1942
2414
|
//#endregion
|
|
2415
|
+
//#region ../domains/src/intents/schemas.d.ts
|
|
2416
|
+
declare const intentCategoryColorSchema: z.ZodEnum<{
|
|
2417
|
+
red: "red";
|
|
2418
|
+
orange: "orange";
|
|
2419
|
+
yellow: "yellow";
|
|
2420
|
+
green: "green";
|
|
2421
|
+
blue: "blue";
|
|
2422
|
+
purple: "purple";
|
|
2423
|
+
pink: "pink";
|
|
2424
|
+
gray: "gray";
|
|
2425
|
+
}>;
|
|
2426
|
+
type IntentCategoryColor = z.infer<typeof intentCategoryColorSchema>;
|
|
2427
|
+
declare const INTENT_CATEGORY_COLORS: ("red" | "orange" | "yellow" | "green" | "blue" | "purple" | "pink" | "gray")[];
|
|
2428
|
+
//#endregion
|
|
1943
2429
|
//#region ../domains/src/platforms/schemas.d.ts
|
|
1944
2430
|
declare const platformSchema: z.ZodEnum<{
|
|
1945
2431
|
chatgpt: "chatgpt";
|
|
@@ -2019,4 +2505,4 @@ declare const serverFieldsSchema: z.ZodObject<{
|
|
|
2019
2505
|
}, z.core.$strip>>>;
|
|
2020
2506
|
}, z.core.$strip>;
|
|
2021
2507
|
//#endregion
|
|
2022
|
-
export { AUTH_SCOPE_ANY, AUTH_SCOPE_USER, ApiContext, AuthScope, PLATFORM_LABELS, type Platform, RouteAuthMeta, RouterInput, RouterOutput, Runtime, Transport, buildSettingsSchema, contract, contractForDocs, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
|
|
2508
|
+
export { AUTH_SCOPE_ANY, AUTH_SCOPE_USER, ApiContext, AuthScope, INTENT_CATEGORY_COLORS, type IntentCategoryColor, PLATFORM_LABELS, type Platform, RouteAuthMeta, RouterInput, RouterOutput, Runtime, Transport, buildSettingsSchema, contract, contractForDocs, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, intentCategoryColorSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
|
package/dist/index.mjs
CHANGED
|
@@ -179,6 +179,7 @@ const PLATFORM_LABELS = {
|
|
|
179
179
|
};
|
|
180
180
|
const WAF_PLATFORMS = [
|
|
181
181
|
"akamai",
|
|
182
|
+
"cato",
|
|
182
183
|
"cloudflare",
|
|
183
184
|
"fastly"
|
|
184
185
|
];
|
|
@@ -256,6 +257,25 @@ z.object({
|
|
|
256
257
|
clientSecret: z.string(),
|
|
257
258
|
clientScopes: z.array(z.string())
|
|
258
259
|
});
|
|
260
|
+
const creditEntryReasonSchema = z.enum([
|
|
261
|
+
"free_seed",
|
|
262
|
+
"paid_conversion_floor",
|
|
263
|
+
"top_up",
|
|
264
|
+
"usage",
|
|
265
|
+
"admin_adjustment"
|
|
266
|
+
]);
|
|
267
|
+
z.enum(["playground"]);
|
|
268
|
+
z.number().int().min(500);
|
|
269
|
+
const creditActivityEntrySchema = z.object({
|
|
270
|
+
reason: creditEntryReasonSchema,
|
|
271
|
+
day: z.number(),
|
|
272
|
+
amountInNanoUSD: z.number(),
|
|
273
|
+
messageCount: z.number().nullable()
|
|
274
|
+
});
|
|
275
|
+
z.object({
|
|
276
|
+
balanceInNanoUSD: z.number(),
|
|
277
|
+
recentActivity: z.array(creditActivityEntrySchema)
|
|
278
|
+
});
|
|
259
279
|
const deploymentStatusSchema$1 = z.enum([
|
|
260
280
|
"ongoing",
|
|
261
281
|
"deployed",
|
|
@@ -402,7 +422,7 @@ z.object({
|
|
|
402
422
|
collectUserData: z.boolean(),
|
|
403
423
|
identityTraitKey: z.string().min(1).max(200).nullable()
|
|
404
424
|
});
|
|
405
|
-
z.object({
|
|
425
|
+
const feedbackSchema = z.object({
|
|
406
426
|
id: z.string(),
|
|
407
427
|
createdAt: z.coerce.date(),
|
|
408
428
|
environmentId: z.string(),
|
|
@@ -424,7 +444,7 @@ const intentCategoryColorSchema = z.enum([
|
|
|
424
444
|
"pink",
|
|
425
445
|
"gray"
|
|
426
446
|
]);
|
|
427
|
-
intentCategoryColorSchema.options;
|
|
447
|
+
const INTENT_CATEGORY_COLORS = intentCategoryColorSchema.options;
|
|
428
448
|
const intentCategorySchema = z.object({
|
|
429
449
|
id: z.string(),
|
|
430
450
|
createdAt: z.coerce.date(),
|
|
@@ -432,7 +452,7 @@ const intentCategorySchema = z.object({
|
|
|
432
452
|
name: z.string(),
|
|
433
453
|
color: intentCategoryColorSchema
|
|
434
454
|
});
|
|
435
|
-
z.object({
|
|
455
|
+
const intentCategorySummarySchema = z.object({
|
|
436
456
|
id: z.string(),
|
|
437
457
|
name: z.string(),
|
|
438
458
|
color: intentCategoryColorSchema,
|
|
@@ -503,6 +523,16 @@ z.object({
|
|
|
503
523
|
createdAt: z.coerce.date(),
|
|
504
524
|
updatedAt: z.coerce.date()
|
|
505
525
|
});
|
|
526
|
+
const alpicMcpRequestLogSchema = z.object({
|
|
527
|
+
type: z.literal("mcp_request"),
|
|
528
|
+
method: z.string()
|
|
529
|
+
});
|
|
530
|
+
const alpicMcpErrorLogSchema = z.object({
|
|
531
|
+
type: z.literal("mcp_error"),
|
|
532
|
+
method: z.string(),
|
|
533
|
+
error: z.string()
|
|
534
|
+
});
|
|
535
|
+
z.union([alpicMcpRequestLogSchema, alpicMcpErrorLogSchema]);
|
|
506
536
|
z.enum([
|
|
507
537
|
"INFO",
|
|
508
538
|
"WARNING",
|
|
@@ -1398,6 +1428,11 @@ const chatgptSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
|
|
|
1398
1428
|
});
|
|
1399
1429
|
z.discriminatedUnion("platform", [claudeSubmissionSchemaInternal, chatgptSubmissionSchemaInternal]);
|
|
1400
1430
|
z.union([claudeSubmissionDraftSchema, chatgptSubmissionDraftSchema]);
|
|
1431
|
+
z.literal([
|
|
1432
|
+
100,
|
|
1433
|
+
75,
|
|
1434
|
+
50
|
|
1435
|
+
]);
|
|
1401
1436
|
const subscriptionPlanSchema = z.enum([
|
|
1402
1437
|
"pro",
|
|
1403
1438
|
"business",
|
|
@@ -1409,17 +1444,45 @@ const customerCreditsSchema = z.object({
|
|
|
1409
1444
|
expiresAt: z.number().nullable(),
|
|
1410
1445
|
currency: z.string()
|
|
1411
1446
|
});
|
|
1412
|
-
const customerUsageSchema = z.object({
|
|
1413
|
-
amountInCents: z.number(),
|
|
1414
|
-
currency: z.string(),
|
|
1415
|
-
periodEnd: z.number()
|
|
1416
|
-
});
|
|
1417
1447
|
const partnerDiscountSchema = z.object({ endsAt: z.number() });
|
|
1418
1448
|
z.object({
|
|
1419
1449
|
customerCredits: customerCreditsSchema.nullable(),
|
|
1420
|
-
customerUsage: customerUsageSchema.nullable(),
|
|
1421
1450
|
partnerDiscount: partnerDiscountSchema.nullable()
|
|
1422
1451
|
});
|
|
1452
|
+
const telemetrySignalSchema = z.enum(["logs", "metrics"]);
|
|
1453
|
+
const otlpProtocolSchema = z.enum(["http/protobuf", "http/json"]);
|
|
1454
|
+
const otlpEndpointSchema = z.string().trim().min(1).max(2048);
|
|
1455
|
+
const OTLP_HEADER_VALUE_MAX_LENGTH = 2048;
|
|
1456
|
+
const otlpHeaderNameSchema = z.string().trim().min(1, "Enter a header name").max(128).regex(/^[A-Za-z0-9!#$%&'*+\-.^_`|~]+$/, "Use letters, digits and !#$%&'*+-.^_`|~ only");
|
|
1457
|
+
const otlpHeaderValueSchema = z.string().trim().max(OTLP_HEADER_VALUE_MAX_LENGTH).refine((value) => !/[\r\n]/.test(value), "Line breaks are not allowed in a header value");
|
|
1458
|
+
const telemetryDestinationHeaderSchema = z.object({
|
|
1459
|
+
id: z.string(),
|
|
1460
|
+
name: otlpHeaderNameSchema,
|
|
1461
|
+
value: otlpHeaderValueSchema,
|
|
1462
|
+
isSecret: z.boolean()
|
|
1463
|
+
});
|
|
1464
|
+
const otlpPushFailureReasonSchema = z.enum([
|
|
1465
|
+
"credentials",
|
|
1466
|
+
"wrong-path",
|
|
1467
|
+
"wrong-protocol",
|
|
1468
|
+
"invalid-payload",
|
|
1469
|
+
"partial-rejection",
|
|
1470
|
+
"blocked-target",
|
|
1471
|
+
"timeout",
|
|
1472
|
+
"unreachable",
|
|
1473
|
+
"receiver-error",
|
|
1474
|
+
"unexpected-status"
|
|
1475
|
+
]);
|
|
1476
|
+
const telemetryDestinationStatusSchema = z.enum(["active", "suspended"]);
|
|
1477
|
+
z.object({
|
|
1478
|
+
id: z.string(),
|
|
1479
|
+
signal: telemetrySignalSchema,
|
|
1480
|
+
endpoint: otlpEndpointSchema,
|
|
1481
|
+
protocol: otlpProtocolSchema,
|
|
1482
|
+
headers: z.array(telemetryDestinationHeaderSchema),
|
|
1483
|
+
status: telemetryDestinationStatusSchema,
|
|
1484
|
+
lastFailureReason: otlpPushFailureReasonSchema.nullable()
|
|
1485
|
+
});
|
|
1423
1486
|
//#endregion
|
|
1424
1487
|
//#region src/auth-scope.ts
|
|
1425
1488
|
/** Accepts an API key or OAuth access token (default for most routes). */
|
|
@@ -1546,10 +1609,11 @@ const deploymentSchema = z.object({
|
|
|
1546
1609
|
isCurrent: z.boolean(),
|
|
1547
1610
|
deploymentPageUrl: z.url().nullable()
|
|
1548
1611
|
});
|
|
1549
|
-
const
|
|
1612
|
+
const isValidTimeInput = (value) => {
|
|
1550
1613
|
if (ms(value) !== void 0) return true;
|
|
1551
1614
|
return !Number.isNaN(new Date(value).getTime());
|
|
1552
1615
|
};
|
|
1616
|
+
const timeInputSchema = z.string().refine(isValidTimeInput, { message: "Invalid time. Use relative (1h, 30m, 2d) or ISO 8601 format." });
|
|
1553
1617
|
const base = oc.errors({ BAD_REQUEST: {} });
|
|
1554
1618
|
const createEnvironmentContractV1 = base.route({
|
|
1555
1619
|
path: "/v1/environments",
|
|
@@ -1827,8 +1891,8 @@ const getLogsContractV1 = base.route({
|
|
|
1827
1891
|
successDescription: "The logs"
|
|
1828
1892
|
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
1829
1893
|
environmentId: z.string().describe("The ID of the environment"),
|
|
1830
|
-
since:
|
|
1831
|
-
until:
|
|
1894
|
+
since: timeInputSchema.optional().describe("Start time — ISO 8601 (2024-01-01T00:00:00Z) or relative (1h, 30m, 2d)"),
|
|
1895
|
+
until: timeInputSchema.optional().describe("End time — ISO 8601 or relative"),
|
|
1832
1896
|
limit: z.coerce.number().int().min(1).max(1e3).default(1e3).describe("Maximum number of log entries to return."),
|
|
1833
1897
|
level: z.array(z.enum([
|
|
1834
1898
|
"INFO",
|
|
@@ -1899,7 +1963,7 @@ const getProjectAnalyticsContractV1 = base.route({
|
|
|
1899
1963
|
startTimestamp: z.coerce.number().describe("Start timestamp in milliseconds"),
|
|
1900
1964
|
endTimestamp: z.coerce.number().describe("End timestamp in milliseconds"),
|
|
1901
1965
|
timeZone: z.string().describe("IANA timezone (e.g. Europe/Paris)")
|
|
1902
|
-
}).refine(({ startTimestamp, endTimestamp }) => endTimestamp - startTimestamp > 0, { message: "End date must be after start date" }).refine(({ startTimestamp, endTimestamp }) => endTimestamp - startTimestamp <=
|
|
1966
|
+
}).refine(({ startTimestamp, endTimestamp }) => endTimestamp - startTimestamp > 0, { message: "End date must be after start date" }).refine(({ startTimestamp, endTimestamp }) => endTimestamp - startTimestamp <= 26784e5, { 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({
|
|
1903
1967
|
metadata: z.object({
|
|
1904
1968
|
startTimestamp: z.number(),
|
|
1905
1969
|
endTimestamp: z.number(),
|
|
@@ -1909,6 +1973,131 @@ const getProjectAnalyticsContractV1 = base.route({
|
|
|
1909
1973
|
}),
|
|
1910
1974
|
timeSeries: analyticsTimeSeriesSchema
|
|
1911
1975
|
}));
|
|
1976
|
+
const paginatedInsightsInputShape = {
|
|
1977
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
1978
|
+
since: timeInputSchema.default("7d").describe("Start time — ISO 8601 (2024-01-01T00:00:00Z) or relative (1h, 30m, 2d)"),
|
|
1979
|
+
until: timeInputSchema.optional().describe("End time — ISO 8601 or relative"),
|
|
1980
|
+
limit: z.coerce.number().int().min(1).max(200).default(50),
|
|
1981
|
+
offset: z.coerce.number().int().min(0).default(0),
|
|
1982
|
+
search: z.string().trim().min(1).max(200).optional()
|
|
1983
|
+
};
|
|
1984
|
+
const listIntentsContractV1 = base.route({
|
|
1985
|
+
path: "/v1/environments/{environmentId}/intents",
|
|
1986
|
+
method: "GET",
|
|
1987
|
+
summary: "List intents",
|
|
1988
|
+
description: "List grouped user intents for an environment over a time range",
|
|
1989
|
+
tags: ["insights"],
|
|
1990
|
+
successDescription: "The grouped user intents"
|
|
1991
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
1992
|
+
...paginatedInsightsInputShape,
|
|
1993
|
+
tools: z.array(z.string().trim().min(1)).min(1).max(100).optional(),
|
|
1994
|
+
clientIds: z.array(z.string().min(1)).min(1).max(100).optional(),
|
|
1995
|
+
categoryIds: z.array(z.string().trim().min(1)).min(1).max(100).optional(),
|
|
1996
|
+
sortDir: z.enum(["asc", "desc"]).default("desc")
|
|
1997
|
+
})).output(z.object({
|
|
1998
|
+
intents: z.array(z.object({
|
|
1999
|
+
id: z.string(),
|
|
2000
|
+
intentIds: z.array(z.string()).min(1),
|
|
2001
|
+
environmentId: z.string(),
|
|
2002
|
+
message: z.string(),
|
|
2003
|
+
toolName: z.string(),
|
|
2004
|
+
createdAt: z.coerce.date(),
|
|
2005
|
+
occurrenceCount: z.number().int().positive(),
|
|
2006
|
+
clientName: z.string().nullable(),
|
|
2007
|
+
clientId: z.string().nullable(),
|
|
2008
|
+
categories: z.array(z.object({
|
|
2009
|
+
id: z.string(),
|
|
2010
|
+
name: z.string(),
|
|
2011
|
+
color: intentCategoryColorSchema
|
|
2012
|
+
}))
|
|
2013
|
+
})),
|
|
2014
|
+
totalCount: z.number().int().nonnegative()
|
|
2015
|
+
}));
|
|
2016
|
+
const listFeedbacksContractV1 = base.route({
|
|
2017
|
+
path: "/v1/environments/{environmentId}/feedbacks",
|
|
2018
|
+
method: "GET",
|
|
2019
|
+
summary: "List feedbacks",
|
|
2020
|
+
description: "List user feedback for an environment over a time range",
|
|
2021
|
+
tags: ["insights"],
|
|
2022
|
+
successDescription: "The user feedback"
|
|
2023
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
2024
|
+
...paginatedInsightsInputShape,
|
|
2025
|
+
clientIds: z.array(z.string().min(1)).min(1).max(100).optional()
|
|
2026
|
+
})).output(z.object({
|
|
2027
|
+
feedbacks: z.array(feedbackSchema.extend({ clientId: z.string().nullable() })),
|
|
2028
|
+
totalCount: z.number().int().nonnegative()
|
|
2029
|
+
}));
|
|
2030
|
+
const intentCategoryNameSchema = z.string().trim().min(1).max(100).describe("The category name");
|
|
2031
|
+
const categorizableIntentIdsSchema = z.array(z.string().trim().min(1)).min(1).max(100).describe("IDs of the intents to categorize");
|
|
2032
|
+
const listIntentCategoriesContractV1 = base.route({
|
|
2033
|
+
path: "/v1/environments/{environmentId}/intent-categories",
|
|
2034
|
+
method: "GET",
|
|
2035
|
+
summary: "List intent categories",
|
|
2036
|
+
description: "List intent categories for an environment, including how many intents each category is linked to",
|
|
2037
|
+
tags: ["insights"],
|
|
2038
|
+
successDescription: "The intent categories"
|
|
2039
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ environmentId: z.string().describe("The ID of the environment") })).output(z.array(intentCategorySummarySchema));
|
|
2040
|
+
const createIntentCategoryContractV1 = base.route({
|
|
2041
|
+
path: "/v1/environments/{environmentId}/intent-categories",
|
|
2042
|
+
method: "POST",
|
|
2043
|
+
summary: "Create an intent category",
|
|
2044
|
+
description: "Create an intent category, optionally linking it to existing intents",
|
|
2045
|
+
tags: ["insights"],
|
|
2046
|
+
successDescription: "The created intent category"
|
|
2047
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
2048
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
2049
|
+
name: intentCategoryNameSchema,
|
|
2050
|
+
color: intentCategoryColorSchema.optional().describe("The category color; derived from the name when omitted"),
|
|
2051
|
+
intentIds: categorizableIntentIdsSchema.optional().describe("IDs of intents to link to the new category")
|
|
2052
|
+
})).output(intentCategorySchema);
|
|
2053
|
+
const updateIntentCategoryContractV1 = base.route({
|
|
2054
|
+
path: "/v1/environments/{environmentId}/intent-categories/{categoryId}",
|
|
2055
|
+
method: "PATCH",
|
|
2056
|
+
summary: "Update an intent category",
|
|
2057
|
+
description: "Rename or recolor an intent category",
|
|
2058
|
+
tags: ["insights"],
|
|
2059
|
+
successDescription: "The updated intent category"
|
|
2060
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
2061
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
2062
|
+
categoryId: z.string().describe("The ID of the category"),
|
|
2063
|
+
name: intentCategoryNameSchema.optional(),
|
|
2064
|
+
color: intentCategoryColorSchema.optional().describe("The category color")
|
|
2065
|
+
}).refine(({ name, color }) => name !== void 0 || color !== void 0, { message: "At least one of name or color must be provided" })).output(intentCategorySchema);
|
|
2066
|
+
const deleteIntentCategoryContractV1 = base.route({
|
|
2067
|
+
path: "/v1/environments/{environmentId}/intent-categories/{categoryId}",
|
|
2068
|
+
method: "DELETE",
|
|
2069
|
+
summary: "Delete an intent category",
|
|
2070
|
+
description: "Delete an intent category; its intents are unlinked but not deleted",
|
|
2071
|
+
tags: ["insights"],
|
|
2072
|
+
successDescription: "The intent category has been deleted successfully"
|
|
2073
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
2074
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
2075
|
+
categoryId: z.string().describe("The ID of the category")
|
|
2076
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
2077
|
+
const linkIntentCategoryContractV1 = base.route({
|
|
2078
|
+
path: "/v1/environments/{environmentId}/intent-categories/{categoryId}/link",
|
|
2079
|
+
method: "POST",
|
|
2080
|
+
summary: "Link an intent category",
|
|
2081
|
+
description: "Link an intent category to intents; already linked intents are ignored",
|
|
2082
|
+
tags: ["insights"],
|
|
2083
|
+
successDescription: "The intents have been linked successfully"
|
|
2084
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
2085
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
2086
|
+
categoryId: z.string().describe("The ID of the category"),
|
|
2087
|
+
intentIds: categorizableIntentIdsSchema
|
|
2088
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
2089
|
+
const unlinkIntentCategoryContractV1 = base.route({
|
|
2090
|
+
path: "/v1/environments/{environmentId}/intent-categories/{categoryId}/unlink",
|
|
2091
|
+
method: "POST",
|
|
2092
|
+
summary: "Unlink an intent category",
|
|
2093
|
+
description: "Unlink an intent category from intents; intents without the category are ignored",
|
|
2094
|
+
tags: ["insights"],
|
|
2095
|
+
successDescription: "The intents have been unlinked successfully"
|
|
2096
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({
|
|
2097
|
+
environmentId: z.string().describe("The ID of the environment"),
|
|
2098
|
+
categoryId: z.string().describe("The ID of the category"),
|
|
2099
|
+
intentIds: categorizableIntentIdsSchema
|
|
2100
|
+
})).output(z.object({ success: z.literal(true) }));
|
|
1912
2101
|
const listTeamsContractV1 = base.route({
|
|
1913
2102
|
path: "/v1/teams",
|
|
1914
2103
|
method: "GET",
|
|
@@ -1922,6 +2111,21 @@ const listTeamsContractV1 = base.route({
|
|
|
1922
2111
|
createdAt: z.coerce.date(),
|
|
1923
2112
|
hasStripeAccount: z.boolean()
|
|
1924
2113
|
})));
|
|
2114
|
+
const getTeamUsageContractV1 = base.route({
|
|
2115
|
+
path: "/v1/teams/{teamId}/usage",
|
|
2116
|
+
method: "GET",
|
|
2117
|
+
summary: "Get team usage",
|
|
2118
|
+
description: "Get the MCP request usage of a team for its current billing window. A team that has made no request in the window reports zero.",
|
|
2119
|
+
tags: ["teams"],
|
|
2120
|
+
successDescription: "The current billing window usage"
|
|
2121
|
+
}).errors({ NOT_FOUND: {} }).input(z.object({ teamId: z.string().describe("The ID of the team") })).output(z.object({
|
|
2122
|
+
teamId: z.string(),
|
|
2123
|
+
plan: subscriptionPlanSchema.nullable().describe("The plan in force for the window, null on the Free plan"),
|
|
2124
|
+
periodStart: z.coerce.date().describe("Start of the current billing window"),
|
|
2125
|
+
periodEnd: z.coerce.date().describe("End of the current billing window"),
|
|
2126
|
+
requestCount: z.number().int().describe("MCP requests settled during the current billing window"),
|
|
2127
|
+
includedRequests: z.number().int().nullable().describe("Requests included in the plan for one window, null when the allowance is contract-specific")
|
|
2128
|
+
}));
|
|
1925
2129
|
const getTunnelTicketContractV1 = base.route({
|
|
1926
2130
|
path: "/v1/tunnels/ticket",
|
|
1927
2131
|
method: "GET",
|
|
@@ -2030,8 +2234,21 @@ const getBeaconContractV1 = base.route({
|
|
|
2030
2234
|
report: auditReportWithScreenshotsSchema.nullable()
|
|
2031
2235
|
}));
|
|
2032
2236
|
const contract = {
|
|
2033
|
-
teams: {
|
|
2237
|
+
teams: {
|
|
2238
|
+
list: { v1: listTeamsContractV1 },
|
|
2239
|
+
getUsage: { v1: getTeamUsageContractV1 }
|
|
2240
|
+
},
|
|
2034
2241
|
analytics: { get: { v1: getProjectAnalyticsContractV1 } },
|
|
2242
|
+
intents: { list: { v1: listIntentsContractV1 } },
|
|
2243
|
+
intentCategories: {
|
|
2244
|
+
list: { v1: listIntentCategoriesContractV1 },
|
|
2245
|
+
create: { v1: createIntentCategoryContractV1 },
|
|
2246
|
+
update: { v1: updateIntentCategoryContractV1 },
|
|
2247
|
+
delete: { v1: deleteIntentCategoryContractV1 },
|
|
2248
|
+
link: { v1: linkIntentCategoryContractV1 },
|
|
2249
|
+
unlink: { v1: unlinkIntentCategoryContractV1 }
|
|
2250
|
+
},
|
|
2251
|
+
feedbacks: { list: { v1: listFeedbacksContractV1 } },
|
|
2035
2252
|
deployments: {
|
|
2036
2253
|
list: { v1: listDeploymentsContractV1 },
|
|
2037
2254
|
get: { v1: getDeploymentContractV1 },
|
|
@@ -2078,4 +2295,4 @@ const contractForDocs = {
|
|
|
2078
2295
|
deployments: deploymentsForDocs
|
|
2079
2296
|
};
|
|
2080
2297
|
//#endregion
|
|
2081
|
-
export { AUTH_SCOPE_ANY, AUTH_SCOPE_USER, PLATFORM_LABELS, buildSettingsSchema, contract, contractForDocs, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
|
|
2298
|
+
export { AUTH_SCOPE_ANY, AUTH_SCOPE_USER, INTENT_CATEGORY_COLORS, PLATFORM_LABELS, buildSettingsSchema, contract, contractForDocs, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, intentCategoryColorSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
|
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.gf0c528e",
|
|
4
4
|
"description": "Contract for the Alpic API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -55,6 +55,6 @@
|
|
|
55
55
|
"test:unit": "vitest run",
|
|
56
56
|
"test:format": "biome check --error-on-warnings .",
|
|
57
57
|
"test:type": "tsgo --noEmit",
|
|
58
|
-
"publish:npm": "
|
|
58
|
+
"publish:npm": "../../scripts/publish-if-new.sh"
|
|
59
59
|
}
|
|
60
60
|
}
|