@inkeep/agents-core 0.0.0-dev-20260331052759 → 0.0.0-dev-20260331152429
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/auth/auth-validation-schemas.d.ts +17 -17
- package/dist/auth/auth.d.ts +6 -6
- package/dist/auth/auth.js +28 -9
- package/dist/auth/entitlement-constants.d.ts +11 -0
- package/dist/auth/entitlement-constants.js +10 -0
- package/dist/auth/entitlement-lock.d.ts +6 -0
- package/dist/auth/entitlement-lock.js +13 -0
- package/dist/auth/entitlements.d.ts +11 -0
- package/dist/auth/entitlements.js +55 -0
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/client-exports.d.ts +4 -3
- package/dist/client-exports.js +2 -1
- package/dist/data-access/index.d.ts +3 -2
- package/dist/data-access/index.js +2 -1
- package/dist/data-access/manage/agents.d.ts +18 -18
- package/dist/data-access/manage/artifactComponents.d.ts +8 -8
- package/dist/data-access/manage/contextConfigs.d.ts +8 -8
- package/dist/data-access/manage/dataComponents.d.ts +4 -4
- package/dist/data-access/manage/evalConfig.d.ts +1 -1
- package/dist/data-access/manage/functionTools.d.ts +10 -10
- package/dist/data-access/manage/projectLifecycle.d.ts +1 -1
- package/dist/data-access/manage/skills.d.ts +11 -11
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgentRelations.d.ts +14 -14
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgents.d.ts +6 -6
- package/dist/data-access/manage/tools.d.ts +21 -21
- package/dist/data-access/runtime/apiKeys.d.ts +8 -8
- package/dist/data-access/runtime/apps.d.ts +14 -14
- package/dist/data-access/runtime/cascade-delete.d.ts +1 -1
- package/dist/data-access/runtime/conversations.d.ts +17 -17
- package/dist/data-access/runtime/entitlements.d.ts +13 -0
- package/dist/data-access/runtime/entitlements.js +33 -0
- package/dist/data-access/runtime/ledgerArtifacts.d.ts +1 -1
- package/dist/data-access/runtime/messages.d.ts +22 -22
- package/dist/data-access/runtime/tasks.d.ts +6 -6
- package/dist/data-access/runtime/workflowExecutions.d.ts +1 -1
- package/dist/data-reconciliation/types.d.ts +1 -1
- package/dist/db/clean.d.ts +1 -1
- package/dist/db/manage/manage-schema.d.ts +2 -218
- package/dist/db/manage/manage-schema.js +2 -128
- package/dist/db/runtime/runtime-schema.d.ts +485 -372
- package/dist/db/runtime/runtime-schema.js +20 -3
- package/dist/index.d.ts +13 -9
- package/dist/index.js +7 -3
- package/dist/middleware/create-protected-route.d.ts +3 -0
- package/dist/middleware/create-protected-route.js +7 -2
- package/dist/middleware/entitlement-meta.d.ts +9 -0
- package/dist/middleware/entitlement-meta.js +11 -0
- package/dist/middleware/index.d.ts +2 -1
- package/dist/middleware/index.js +2 -1
- package/dist/utils/error.d.ts +54 -51
- package/dist/utils/error.js +3 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas/skills.d.ts +49 -49
- package/dist/validation/schemas.d.ts +450 -450
- package/drizzle/manage/0016_complex_klaw.sql +2 -0
- package/drizzle/manage/meta/0016_snapshot.json +3530 -0
- package/drizzle/manage/meta/_journal.json +7 -0
- package/drizzle/runtime/0029_burly_satana.sql +13 -0
- package/drizzle/runtime/meta/0029_snapshot.json +4756 -0
- package/drizzle/runtime/meta/_journal.json +7 -0
- package/package.json +1 -1
- /package/drizzle/runtime/meta/{0023_snapshot.json → 0025_snapshot.json} +0 -0
package/dist/utils/error.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ import { HTTPException } from "hono/http-exception";
|
|
|
3
3
|
|
|
4
4
|
//#region src/utils/error.d.ts
|
|
5
5
|
declare const ErrorCode: z.ZodEnum<{
|
|
6
|
-
bad_request: "bad_request";
|
|
7
6
|
unauthorized: "unauthorized";
|
|
7
|
+
bad_request: "bad_request";
|
|
8
|
+
payment_required: "payment_required";
|
|
8
9
|
forbidden: "forbidden";
|
|
9
10
|
not_found: "not_found";
|
|
10
11
|
conflict: "conflict";
|
|
@@ -20,8 +21,9 @@ declare const problemDetailsSchema: z.ZodObject<{
|
|
|
20
21
|
instance: z.ZodOptional<z.ZodString>;
|
|
21
22
|
requestId: z.ZodOptional<z.ZodString>;
|
|
22
23
|
code: z.ZodEnum<{
|
|
23
|
-
bad_request: "bad_request";
|
|
24
24
|
unauthorized: "unauthorized";
|
|
25
|
+
bad_request: "bad_request";
|
|
26
|
+
payment_required: "payment_required";
|
|
25
27
|
forbidden: "forbidden";
|
|
26
28
|
not_found: "not_found";
|
|
27
29
|
conflict: "conflict";
|
|
@@ -35,8 +37,9 @@ type ErrorCodes = z.infer<typeof ErrorCode>;
|
|
|
35
37
|
declare const errorResponseSchema: z.ZodObject<{
|
|
36
38
|
error: z.ZodObject<{
|
|
37
39
|
code: z.ZodEnum<{
|
|
38
|
-
bad_request: "bad_request";
|
|
39
40
|
unauthorized: "unauthorized";
|
|
41
|
+
bad_request: "bad_request";
|
|
42
|
+
payment_required: "payment_required";
|
|
40
43
|
forbidden: "forbidden";
|
|
41
44
|
not_found: "not_found";
|
|
42
45
|
conflict: "conflict";
|
|
@@ -74,12 +77,12 @@ declare const errorSchemaFactory: (code: ErrorCodes, description: string) => {
|
|
|
74
77
|
schema: z.ZodObject<{
|
|
75
78
|
instance: z.ZodOptional<z.ZodString>;
|
|
76
79
|
requestId: z.ZodOptional<z.ZodString>;
|
|
77
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
80
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
78
81
|
detail: z.ZodString;
|
|
79
82
|
title: z.ZodString;
|
|
80
83
|
status: z.ZodNumber;
|
|
81
84
|
error: z.ZodObject<{
|
|
82
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
85
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
83
86
|
message: z.ZodString;
|
|
84
87
|
}, z.core.$strip>;
|
|
85
88
|
}, z.core.$strip>;
|
|
@@ -96,12 +99,12 @@ declare const commonCreateErrorResponses: {
|
|
|
96
99
|
schema: z.ZodObject<{
|
|
97
100
|
instance: z.ZodOptional<z.ZodString>;
|
|
98
101
|
requestId: z.ZodOptional<z.ZodString>;
|
|
99
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
102
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
100
103
|
detail: z.ZodString;
|
|
101
104
|
title: z.ZodString;
|
|
102
105
|
status: z.ZodNumber;
|
|
103
106
|
error: z.ZodObject<{
|
|
104
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
107
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
105
108
|
message: z.ZodString;
|
|
106
109
|
}, z.core.$strip>;
|
|
107
110
|
}, z.core.$strip>;
|
|
@@ -115,12 +118,12 @@ declare const commonCreateErrorResponses: {
|
|
|
115
118
|
schema: z.ZodObject<{
|
|
116
119
|
instance: z.ZodOptional<z.ZodString>;
|
|
117
120
|
requestId: z.ZodOptional<z.ZodString>;
|
|
118
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
121
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
119
122
|
detail: z.ZodString;
|
|
120
123
|
title: z.ZodString;
|
|
121
124
|
status: z.ZodNumber;
|
|
122
125
|
error: z.ZodObject<{
|
|
123
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
126
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
124
127
|
message: z.ZodString;
|
|
125
128
|
}, z.core.$strip>;
|
|
126
129
|
}, z.core.$strip>;
|
|
@@ -134,12 +137,12 @@ declare const commonCreateErrorResponses: {
|
|
|
134
137
|
schema: z.ZodObject<{
|
|
135
138
|
instance: z.ZodOptional<z.ZodString>;
|
|
136
139
|
requestId: z.ZodOptional<z.ZodString>;
|
|
137
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
140
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
138
141
|
detail: z.ZodString;
|
|
139
142
|
title: z.ZodString;
|
|
140
143
|
status: z.ZodNumber;
|
|
141
144
|
error: z.ZodObject<{
|
|
142
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
145
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
143
146
|
message: z.ZodString;
|
|
144
147
|
}, z.core.$strip>;
|
|
145
148
|
}, z.core.$strip>;
|
|
@@ -153,12 +156,12 @@ declare const commonCreateErrorResponses: {
|
|
|
153
156
|
schema: z.ZodObject<{
|
|
154
157
|
instance: z.ZodOptional<z.ZodString>;
|
|
155
158
|
requestId: z.ZodOptional<z.ZodString>;
|
|
156
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
159
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
157
160
|
detail: z.ZodString;
|
|
158
161
|
title: z.ZodString;
|
|
159
162
|
status: z.ZodNumber;
|
|
160
163
|
error: z.ZodObject<{
|
|
161
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
164
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
162
165
|
message: z.ZodString;
|
|
163
166
|
}, z.core.$strip>;
|
|
164
167
|
}, z.core.$strip>;
|
|
@@ -172,12 +175,12 @@ declare const commonCreateErrorResponses: {
|
|
|
172
175
|
schema: z.ZodObject<{
|
|
173
176
|
instance: z.ZodOptional<z.ZodString>;
|
|
174
177
|
requestId: z.ZodOptional<z.ZodString>;
|
|
175
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
178
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
176
179
|
detail: z.ZodString;
|
|
177
180
|
title: z.ZodString;
|
|
178
181
|
status: z.ZodNumber;
|
|
179
182
|
error: z.ZodObject<{
|
|
180
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
183
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
181
184
|
message: z.ZodString;
|
|
182
185
|
}, z.core.$strip>;
|
|
183
186
|
}, z.core.$strip>;
|
|
@@ -193,12 +196,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
193
196
|
schema: z.ZodObject<{
|
|
194
197
|
instance: z.ZodOptional<z.ZodString>;
|
|
195
198
|
requestId: z.ZodOptional<z.ZodString>;
|
|
196
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
199
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
197
200
|
detail: z.ZodString;
|
|
198
201
|
title: z.ZodString;
|
|
199
202
|
status: z.ZodNumber;
|
|
200
203
|
error: z.ZodObject<{
|
|
201
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
204
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
202
205
|
message: z.ZodString;
|
|
203
206
|
}, z.core.$strip>;
|
|
204
207
|
}, z.core.$strip>;
|
|
@@ -212,12 +215,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
212
215
|
schema: z.ZodObject<{
|
|
213
216
|
instance: z.ZodOptional<z.ZodString>;
|
|
214
217
|
requestId: z.ZodOptional<z.ZodString>;
|
|
215
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
218
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
216
219
|
detail: z.ZodString;
|
|
217
220
|
title: z.ZodString;
|
|
218
221
|
status: z.ZodNumber;
|
|
219
222
|
error: z.ZodObject<{
|
|
220
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
223
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
221
224
|
message: z.ZodString;
|
|
222
225
|
}, z.core.$strip>;
|
|
223
226
|
}, z.core.$strip>;
|
|
@@ -231,12 +234,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
231
234
|
schema: z.ZodObject<{
|
|
232
235
|
instance: z.ZodOptional<z.ZodString>;
|
|
233
236
|
requestId: z.ZodOptional<z.ZodString>;
|
|
234
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
237
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
235
238
|
detail: z.ZodString;
|
|
236
239
|
title: z.ZodString;
|
|
237
240
|
status: z.ZodNumber;
|
|
238
241
|
error: z.ZodObject<{
|
|
239
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
242
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
240
243
|
message: z.ZodString;
|
|
241
244
|
}, z.core.$strip>;
|
|
242
245
|
}, z.core.$strip>;
|
|
@@ -250,12 +253,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
250
253
|
schema: z.ZodObject<{
|
|
251
254
|
instance: z.ZodOptional<z.ZodString>;
|
|
252
255
|
requestId: z.ZodOptional<z.ZodString>;
|
|
253
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
256
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
254
257
|
detail: z.ZodString;
|
|
255
258
|
title: z.ZodString;
|
|
256
259
|
status: z.ZodNumber;
|
|
257
260
|
error: z.ZodObject<{
|
|
258
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
261
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
259
262
|
message: z.ZodString;
|
|
260
263
|
}, z.core.$strip>;
|
|
261
264
|
}, z.core.$strip>;
|
|
@@ -269,12 +272,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
269
272
|
schema: z.ZodObject<{
|
|
270
273
|
instance: z.ZodOptional<z.ZodString>;
|
|
271
274
|
requestId: z.ZodOptional<z.ZodString>;
|
|
272
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
275
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
273
276
|
detail: z.ZodString;
|
|
274
277
|
title: z.ZodString;
|
|
275
278
|
status: z.ZodNumber;
|
|
276
279
|
error: z.ZodObject<{
|
|
277
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
280
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
278
281
|
message: z.ZodString;
|
|
279
282
|
}, z.core.$strip>;
|
|
280
283
|
}, z.core.$strip>;
|
|
@@ -288,12 +291,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
288
291
|
schema: z.ZodObject<{
|
|
289
292
|
instance: z.ZodOptional<z.ZodString>;
|
|
290
293
|
requestId: z.ZodOptional<z.ZodString>;
|
|
291
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
294
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
292
295
|
detail: z.ZodString;
|
|
293
296
|
title: z.ZodString;
|
|
294
297
|
status: z.ZodNumber;
|
|
295
298
|
error: z.ZodObject<{
|
|
296
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
299
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
297
300
|
message: z.ZodString;
|
|
298
301
|
}, z.core.$strip>;
|
|
299
302
|
}, z.core.$strip>;
|
|
@@ -309,12 +312,12 @@ declare const commonGetErrorResponses: {
|
|
|
309
312
|
schema: z.ZodObject<{
|
|
310
313
|
instance: z.ZodOptional<z.ZodString>;
|
|
311
314
|
requestId: z.ZodOptional<z.ZodString>;
|
|
312
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
315
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
313
316
|
detail: z.ZodString;
|
|
314
317
|
title: z.ZodString;
|
|
315
318
|
status: z.ZodNumber;
|
|
316
319
|
error: z.ZodObject<{
|
|
317
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
320
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
318
321
|
message: z.ZodString;
|
|
319
322
|
}, z.core.$strip>;
|
|
320
323
|
}, z.core.$strip>;
|
|
@@ -328,12 +331,12 @@ declare const commonGetErrorResponses: {
|
|
|
328
331
|
schema: z.ZodObject<{
|
|
329
332
|
instance: z.ZodOptional<z.ZodString>;
|
|
330
333
|
requestId: z.ZodOptional<z.ZodString>;
|
|
331
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
334
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
332
335
|
detail: z.ZodString;
|
|
333
336
|
title: z.ZodString;
|
|
334
337
|
status: z.ZodNumber;
|
|
335
338
|
error: z.ZodObject<{
|
|
336
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
339
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
337
340
|
message: z.ZodString;
|
|
338
341
|
}, z.core.$strip>;
|
|
339
342
|
}, z.core.$strip>;
|
|
@@ -347,12 +350,12 @@ declare const commonGetErrorResponses: {
|
|
|
347
350
|
schema: z.ZodObject<{
|
|
348
351
|
instance: z.ZodOptional<z.ZodString>;
|
|
349
352
|
requestId: z.ZodOptional<z.ZodString>;
|
|
350
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
353
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
351
354
|
detail: z.ZodString;
|
|
352
355
|
title: z.ZodString;
|
|
353
356
|
status: z.ZodNumber;
|
|
354
357
|
error: z.ZodObject<{
|
|
355
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
358
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
356
359
|
message: z.ZodString;
|
|
357
360
|
}, z.core.$strip>;
|
|
358
361
|
}, z.core.$strip>;
|
|
@@ -366,12 +369,12 @@ declare const commonGetErrorResponses: {
|
|
|
366
369
|
schema: z.ZodObject<{
|
|
367
370
|
instance: z.ZodOptional<z.ZodString>;
|
|
368
371
|
requestId: z.ZodOptional<z.ZodString>;
|
|
369
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
372
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
370
373
|
detail: z.ZodString;
|
|
371
374
|
title: z.ZodString;
|
|
372
375
|
status: z.ZodNumber;
|
|
373
376
|
error: z.ZodObject<{
|
|
374
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
377
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
375
378
|
message: z.ZodString;
|
|
376
379
|
}, z.core.$strip>;
|
|
377
380
|
}, z.core.$strip>;
|
|
@@ -385,12 +388,12 @@ declare const commonGetErrorResponses: {
|
|
|
385
388
|
schema: z.ZodObject<{
|
|
386
389
|
instance: z.ZodOptional<z.ZodString>;
|
|
387
390
|
requestId: z.ZodOptional<z.ZodString>;
|
|
388
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
391
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
389
392
|
detail: z.ZodString;
|
|
390
393
|
title: z.ZodString;
|
|
391
394
|
status: z.ZodNumber;
|
|
392
395
|
error: z.ZodObject<{
|
|
393
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
396
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
394
397
|
message: z.ZodString;
|
|
395
398
|
}, z.core.$strip>;
|
|
396
399
|
}, z.core.$strip>;
|
|
@@ -404,12 +407,12 @@ declare const commonGetErrorResponses: {
|
|
|
404
407
|
schema: z.ZodObject<{
|
|
405
408
|
instance: z.ZodOptional<z.ZodString>;
|
|
406
409
|
requestId: z.ZodOptional<z.ZodString>;
|
|
407
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
410
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
408
411
|
detail: z.ZodString;
|
|
409
412
|
title: z.ZodString;
|
|
410
413
|
status: z.ZodNumber;
|
|
411
414
|
error: z.ZodObject<{
|
|
412
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
415
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
413
416
|
message: z.ZodString;
|
|
414
417
|
}, z.core.$strip>;
|
|
415
418
|
}, z.core.$strip>;
|
|
@@ -425,12 +428,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
425
428
|
schema: z.ZodObject<{
|
|
426
429
|
instance: z.ZodOptional<z.ZodString>;
|
|
427
430
|
requestId: z.ZodOptional<z.ZodString>;
|
|
428
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
431
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
429
432
|
detail: z.ZodString;
|
|
430
433
|
title: z.ZodString;
|
|
431
434
|
status: z.ZodNumber;
|
|
432
435
|
error: z.ZodObject<{
|
|
433
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
436
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
434
437
|
message: z.ZodString;
|
|
435
438
|
}, z.core.$strip>;
|
|
436
439
|
}, z.core.$strip>;
|
|
@@ -444,12 +447,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
444
447
|
schema: z.ZodObject<{
|
|
445
448
|
instance: z.ZodOptional<z.ZodString>;
|
|
446
449
|
requestId: z.ZodOptional<z.ZodString>;
|
|
447
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
450
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
448
451
|
detail: z.ZodString;
|
|
449
452
|
title: z.ZodString;
|
|
450
453
|
status: z.ZodNumber;
|
|
451
454
|
error: z.ZodObject<{
|
|
452
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
455
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
453
456
|
message: z.ZodString;
|
|
454
457
|
}, z.core.$strip>;
|
|
455
458
|
}, z.core.$strip>;
|
|
@@ -463,12 +466,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
463
466
|
schema: z.ZodObject<{
|
|
464
467
|
instance: z.ZodOptional<z.ZodString>;
|
|
465
468
|
requestId: z.ZodOptional<z.ZodString>;
|
|
466
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
469
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
467
470
|
detail: z.ZodString;
|
|
468
471
|
title: z.ZodString;
|
|
469
472
|
status: z.ZodNumber;
|
|
470
473
|
error: z.ZodObject<{
|
|
471
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
474
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
472
475
|
message: z.ZodString;
|
|
473
476
|
}, z.core.$strip>;
|
|
474
477
|
}, z.core.$strip>;
|
|
@@ -482,12 +485,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
482
485
|
schema: z.ZodObject<{
|
|
483
486
|
instance: z.ZodOptional<z.ZodString>;
|
|
484
487
|
requestId: z.ZodOptional<z.ZodString>;
|
|
485
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
488
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
486
489
|
detail: z.ZodString;
|
|
487
490
|
title: z.ZodString;
|
|
488
491
|
status: z.ZodNumber;
|
|
489
492
|
error: z.ZodObject<{
|
|
490
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
493
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
491
494
|
message: z.ZodString;
|
|
492
495
|
}, z.core.$strip>;
|
|
493
496
|
}, z.core.$strip>;
|
|
@@ -501,12 +504,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
501
504
|
schema: z.ZodObject<{
|
|
502
505
|
instance: z.ZodOptional<z.ZodString>;
|
|
503
506
|
requestId: z.ZodOptional<z.ZodString>;
|
|
504
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
507
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
505
508
|
detail: z.ZodString;
|
|
506
509
|
title: z.ZodString;
|
|
507
510
|
status: z.ZodNumber;
|
|
508
511
|
error: z.ZodObject<{
|
|
509
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
512
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
510
513
|
message: z.ZodString;
|
|
511
514
|
}, z.core.$strip>;
|
|
512
515
|
}, z.core.$strip>;
|
|
@@ -520,12 +523,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
520
523
|
schema: z.ZodObject<{
|
|
521
524
|
instance: z.ZodOptional<z.ZodString>;
|
|
522
525
|
requestId: z.ZodOptional<z.ZodString>;
|
|
523
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
526
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
524
527
|
detail: z.ZodString;
|
|
525
528
|
title: z.ZodString;
|
|
526
529
|
status: z.ZodNumber;
|
|
527
530
|
error: z.ZodObject<{
|
|
528
|
-
code: z.ZodLiteral<"bad_request" | "
|
|
531
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "payment_required" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
529
532
|
message: z.ZodString;
|
|
530
533
|
}, z.core.$strip>;
|
|
531
534
|
}, z.core.$strip>;
|
package/dist/utils/error.js
CHANGED
|
@@ -6,6 +6,7 @@ import { HTTPException } from "hono/http-exception";
|
|
|
6
6
|
const ErrorCode = z.enum([
|
|
7
7
|
"bad_request",
|
|
8
8
|
"unauthorized",
|
|
9
|
+
"payment_required",
|
|
9
10
|
"forbidden",
|
|
10
11
|
"not_found",
|
|
11
12
|
"conflict",
|
|
@@ -16,6 +17,7 @@ const ErrorCode = z.enum([
|
|
|
16
17
|
const errorCodeToHttpStatus = {
|
|
17
18
|
bad_request: 400,
|
|
18
19
|
unauthorized: 401,
|
|
20
|
+
payment_required: 402,
|
|
19
21
|
forbidden: 403,
|
|
20
22
|
not_found: 404,
|
|
21
23
|
conflict: 409,
|
|
@@ -153,6 +155,7 @@ function getTitleFromCode(code) {
|
|
|
153
155
|
switch (code) {
|
|
154
156
|
case "bad_request": return "Bad Request";
|
|
155
157
|
case "unauthorized": return "Unauthorized";
|
|
158
|
+
case "payment_required": return "Payment Required";
|
|
156
159
|
case "forbidden": return "Forbidden";
|
|
157
160
|
case "not_found": return "Not Found";
|
|
158
161
|
case "conflict": return "Conflict";
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { JwtVerifyResult, SignJwtOptions, VerifyJwtOptions, decodeJwtPayload, derivePlaygroundKid, extractBearerToken, getJwtSecret, hasIssuer, signJwt, verifyJwt } from "./jwt-helpers.js";
|
|
2
2
|
import { GenerateInternalServiceTokenParams, InternalServiceId, InternalServiceTokenPayload, InternalServices, VerifyInternalServiceTokenResult, generateInternalServiceToken, isInternalServiceToken, validateInternalServiceProjectAccess, validateInternalServiceTenantAccess, verifyInternalServiceAuthHeader, verifyInternalServiceToken } from "./internal-service-auth.js";
|
|
3
|
+
import { GenerationType } from "../db/runtime/runtime-schema.js";
|
|
3
4
|
import { LoggerFactoryConfig, PinoLogger, PinoLoggerConfig, getLogger, loggerFactory } from "./logger.js";
|
|
4
5
|
import { McpClient, McpClientOptions, McpSSEConfig, McpServerConfig, McpStreamableHttpConfig, activeMcpClients } from "./mcp-client.js";
|
|
5
|
-
import { GenerationType } from "../db/runtime/runtime-schema.js";
|
|
6
6
|
import { ApiKeyGenerationResult, AppCredentialResult, extractPublicId, generateApiKey, generateAppCredential, getMetadataFromApiKey, hashApiKey, isApiKeyExpired, maskApiKey, sanitizeAppConfig, validateApiKey } from "./apiKeys.js";
|
|
7
7
|
import { McpOAuthFlowResult, McpTokenExchangeResult, OAuthConfig, detectAuthenticationRequired, exchangeMcpAuthorizationCode, initiateMcpOAuthFlow } from "./auth-detection.js";
|
|
8
8
|
import { computeNextRunAt } from "./compute-next-run-at.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from "@hono/zod-openapi";
|
|
2
|
-
import * as
|
|
2
|
+
import * as drizzle_zod0 from "drizzle-zod";
|
|
3
3
|
import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
|
|
4
4
|
|
|
5
5
|
//#region src/validation/drizzle-schema-helpers.d.ts
|
|
6
|
-
declare function createSelectSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>):
|
|
7
|
-
declare function createInsertSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>):
|
|
6
|
+
declare function createSelectSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>): drizzle_zod0.BuildSchema<"select", T["_"]["columns"], drizzle_zod0.BuildRefine<T["_"]["columns"], undefined>, undefined>;
|
|
7
|
+
declare function createInsertSchemaWithModifiers<T extends AnySQLiteTable>(table: T, overrides?: Partial<Record<keyof T['_']['columns'], (schema: z.ZodTypeAny) => z.ZodTypeAny>>): drizzle_zod0.BuildSchema<"insert", T["_"]["columns"], drizzle_zod0.BuildRefine<Pick<T["_"]["columns"], keyof T["$inferInsert"]>, undefined>, undefined>;
|
|
8
8
|
declare const createSelectSchema: typeof createSelectSchemaWithModifiers;
|
|
9
9
|
declare const createInsertSchema: typeof createInsertSchemaWithModifiers;
|
|
10
10
|
/**
|