@inkeep/agents-core 0.58.21 → 0.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/auth-config-utils.d.ts +49 -0
- package/dist/auth/auth-config-utils.js +133 -0
- package/dist/auth/auth-schema.d.ts +102 -85
- package/dist/auth/auth-schema.js +1 -0
- package/dist/auth/auth-types.d.ts +170 -0
- package/dist/auth/auth-types.js +53 -0
- package/dist/auth/auth-validation-schemas.d.ts +186 -152
- package/dist/auth/auth.d.ts +43 -1286
- package/dist/auth/auth.js +61 -70
- package/dist/auth/email-send-status-store.js +15 -3
- package/dist/auth/init.js +2 -1
- package/dist/auth/password-reset-link-store.js +8 -1
- package/dist/auth/permissions.d.ts +13 -13
- package/dist/data-access/index.d.ts +4 -3
- package/dist/data-access/index.js +3 -3
- package/dist/data-access/manage/skills.d.ts +1 -1
- package/dist/data-access/runtime/auth.d.ts +9 -9
- package/dist/data-access/runtime/auth.js +19 -21
- package/dist/data-access/runtime/conversations.d.ts +4 -4
- package/dist/data-access/runtime/messages.d.ts +9 -9
- package/dist/data-access/runtime/organizations.d.ts +28 -4
- package/dist/data-access/runtime/organizations.js +131 -9
- package/dist/data-access/runtime/tasks.d.ts +2 -2
- package/dist/db/manage/manage-schema.d.ts +357 -357
- package/dist/db/runtime/runtime-schema.d.ts +298 -298
- package/dist/index.d.ts +4 -3
- package/dist/index.js +3 -3
- package/dist/middleware/no-auth.d.ts +2 -2
- package/dist/utils/error.d.ts +51 -48
- package/dist/utils/error.js +3 -0
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas.d.ts +1535 -1535
- package/drizzle/runtime/0023_lazy_energizer.sql +1 -0
- package/drizzle/runtime/0024_moaning_kingpin.sql +1 -0
- package/drizzle/runtime/meta/0024_snapshot.json +4270 -0
- package/drizzle/runtime/meta/_journal.json +7 -0
- package/package.json +8 -3
package/dist/utils/error.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ declare const ErrorCode: z.ZodEnum<{
|
|
|
8
8
|
forbidden: "forbidden";
|
|
9
9
|
not_found: "not_found";
|
|
10
10
|
conflict: "conflict";
|
|
11
|
+
too_many_requests: "too_many_requests";
|
|
11
12
|
internal_server_error: "internal_server_error";
|
|
12
13
|
unprocessable_entity: "unprocessable_entity";
|
|
13
14
|
}>;
|
|
@@ -24,6 +25,7 @@ declare const problemDetailsSchema: z.ZodObject<{
|
|
|
24
25
|
forbidden: "forbidden";
|
|
25
26
|
not_found: "not_found";
|
|
26
27
|
conflict: "conflict";
|
|
28
|
+
too_many_requests: "too_many_requests";
|
|
27
29
|
internal_server_error: "internal_server_error";
|
|
28
30
|
unprocessable_entity: "unprocessable_entity";
|
|
29
31
|
}>;
|
|
@@ -38,6 +40,7 @@ declare const errorResponseSchema: z.ZodObject<{
|
|
|
38
40
|
forbidden: "forbidden";
|
|
39
41
|
not_found: "not_found";
|
|
40
42
|
conflict: "conflict";
|
|
43
|
+
too_many_requests: "too_many_requests";
|
|
41
44
|
internal_server_error: "internal_server_error";
|
|
42
45
|
unprocessable_entity: "unprocessable_entity";
|
|
43
46
|
}>;
|
|
@@ -71,12 +74,12 @@ declare const errorSchemaFactory: (code: ErrorCodes, description: string) => {
|
|
|
71
74
|
schema: z.ZodObject<{
|
|
72
75
|
instance: z.ZodOptional<z.ZodString>;
|
|
73
76
|
requestId: z.ZodOptional<z.ZodString>;
|
|
74
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
77
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
75
78
|
detail: z.ZodString;
|
|
76
79
|
title: z.ZodString;
|
|
77
80
|
status: z.ZodNumber;
|
|
78
81
|
error: z.ZodObject<{
|
|
79
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
82
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
80
83
|
message: z.ZodString;
|
|
81
84
|
}, z.core.$strip>;
|
|
82
85
|
}, z.core.$strip>;
|
|
@@ -93,12 +96,12 @@ declare const commonCreateErrorResponses: {
|
|
|
93
96
|
schema: z.ZodObject<{
|
|
94
97
|
instance: z.ZodOptional<z.ZodString>;
|
|
95
98
|
requestId: z.ZodOptional<z.ZodString>;
|
|
96
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
99
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
97
100
|
detail: z.ZodString;
|
|
98
101
|
title: z.ZodString;
|
|
99
102
|
status: z.ZodNumber;
|
|
100
103
|
error: z.ZodObject<{
|
|
101
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
104
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
102
105
|
message: z.ZodString;
|
|
103
106
|
}, z.core.$strip>;
|
|
104
107
|
}, z.core.$strip>;
|
|
@@ -112,12 +115,12 @@ declare const commonCreateErrorResponses: {
|
|
|
112
115
|
schema: z.ZodObject<{
|
|
113
116
|
instance: z.ZodOptional<z.ZodString>;
|
|
114
117
|
requestId: z.ZodOptional<z.ZodString>;
|
|
115
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
118
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
116
119
|
detail: z.ZodString;
|
|
117
120
|
title: z.ZodString;
|
|
118
121
|
status: z.ZodNumber;
|
|
119
122
|
error: z.ZodObject<{
|
|
120
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
123
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
121
124
|
message: z.ZodString;
|
|
122
125
|
}, z.core.$strip>;
|
|
123
126
|
}, z.core.$strip>;
|
|
@@ -131,12 +134,12 @@ declare const commonCreateErrorResponses: {
|
|
|
131
134
|
schema: z.ZodObject<{
|
|
132
135
|
instance: z.ZodOptional<z.ZodString>;
|
|
133
136
|
requestId: z.ZodOptional<z.ZodString>;
|
|
134
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
137
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
135
138
|
detail: z.ZodString;
|
|
136
139
|
title: z.ZodString;
|
|
137
140
|
status: z.ZodNumber;
|
|
138
141
|
error: z.ZodObject<{
|
|
139
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
142
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
140
143
|
message: z.ZodString;
|
|
141
144
|
}, z.core.$strip>;
|
|
142
145
|
}, z.core.$strip>;
|
|
@@ -150,12 +153,12 @@ declare const commonCreateErrorResponses: {
|
|
|
150
153
|
schema: z.ZodObject<{
|
|
151
154
|
instance: z.ZodOptional<z.ZodString>;
|
|
152
155
|
requestId: z.ZodOptional<z.ZodString>;
|
|
153
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
156
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
154
157
|
detail: z.ZodString;
|
|
155
158
|
title: z.ZodString;
|
|
156
159
|
status: z.ZodNumber;
|
|
157
160
|
error: z.ZodObject<{
|
|
158
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
161
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
159
162
|
message: z.ZodString;
|
|
160
163
|
}, z.core.$strip>;
|
|
161
164
|
}, z.core.$strip>;
|
|
@@ -169,12 +172,12 @@ declare const commonCreateErrorResponses: {
|
|
|
169
172
|
schema: z.ZodObject<{
|
|
170
173
|
instance: z.ZodOptional<z.ZodString>;
|
|
171
174
|
requestId: z.ZodOptional<z.ZodString>;
|
|
172
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
175
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
173
176
|
detail: z.ZodString;
|
|
174
177
|
title: z.ZodString;
|
|
175
178
|
status: z.ZodNumber;
|
|
176
179
|
error: z.ZodObject<{
|
|
177
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
180
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
178
181
|
message: z.ZodString;
|
|
179
182
|
}, z.core.$strip>;
|
|
180
183
|
}, z.core.$strip>;
|
|
@@ -190,12 +193,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
190
193
|
schema: z.ZodObject<{
|
|
191
194
|
instance: z.ZodOptional<z.ZodString>;
|
|
192
195
|
requestId: z.ZodOptional<z.ZodString>;
|
|
193
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
196
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
194
197
|
detail: z.ZodString;
|
|
195
198
|
title: z.ZodString;
|
|
196
199
|
status: z.ZodNumber;
|
|
197
200
|
error: z.ZodObject<{
|
|
198
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
201
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
199
202
|
message: z.ZodString;
|
|
200
203
|
}, z.core.$strip>;
|
|
201
204
|
}, z.core.$strip>;
|
|
@@ -209,12 +212,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
209
212
|
schema: z.ZodObject<{
|
|
210
213
|
instance: z.ZodOptional<z.ZodString>;
|
|
211
214
|
requestId: z.ZodOptional<z.ZodString>;
|
|
212
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
215
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
213
216
|
detail: z.ZodString;
|
|
214
217
|
title: z.ZodString;
|
|
215
218
|
status: z.ZodNumber;
|
|
216
219
|
error: z.ZodObject<{
|
|
217
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
220
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
218
221
|
message: z.ZodString;
|
|
219
222
|
}, z.core.$strip>;
|
|
220
223
|
}, z.core.$strip>;
|
|
@@ -228,12 +231,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
228
231
|
schema: z.ZodObject<{
|
|
229
232
|
instance: z.ZodOptional<z.ZodString>;
|
|
230
233
|
requestId: z.ZodOptional<z.ZodString>;
|
|
231
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
234
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
232
235
|
detail: z.ZodString;
|
|
233
236
|
title: z.ZodString;
|
|
234
237
|
status: z.ZodNumber;
|
|
235
238
|
error: z.ZodObject<{
|
|
236
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
239
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
237
240
|
message: z.ZodString;
|
|
238
241
|
}, z.core.$strip>;
|
|
239
242
|
}, z.core.$strip>;
|
|
@@ -247,12 +250,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
247
250
|
schema: z.ZodObject<{
|
|
248
251
|
instance: z.ZodOptional<z.ZodString>;
|
|
249
252
|
requestId: z.ZodOptional<z.ZodString>;
|
|
250
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
253
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
251
254
|
detail: z.ZodString;
|
|
252
255
|
title: z.ZodString;
|
|
253
256
|
status: z.ZodNumber;
|
|
254
257
|
error: z.ZodObject<{
|
|
255
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
258
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
256
259
|
message: z.ZodString;
|
|
257
260
|
}, z.core.$strip>;
|
|
258
261
|
}, z.core.$strip>;
|
|
@@ -266,12 +269,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
266
269
|
schema: z.ZodObject<{
|
|
267
270
|
instance: z.ZodOptional<z.ZodString>;
|
|
268
271
|
requestId: z.ZodOptional<z.ZodString>;
|
|
269
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
272
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
270
273
|
detail: z.ZodString;
|
|
271
274
|
title: z.ZodString;
|
|
272
275
|
status: z.ZodNumber;
|
|
273
276
|
error: z.ZodObject<{
|
|
274
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
277
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
275
278
|
message: z.ZodString;
|
|
276
279
|
}, z.core.$strip>;
|
|
277
280
|
}, z.core.$strip>;
|
|
@@ -285,12 +288,12 @@ declare const commonUpdateErrorResponses: {
|
|
|
285
288
|
schema: z.ZodObject<{
|
|
286
289
|
instance: z.ZodOptional<z.ZodString>;
|
|
287
290
|
requestId: z.ZodOptional<z.ZodString>;
|
|
288
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
291
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
289
292
|
detail: z.ZodString;
|
|
290
293
|
title: z.ZodString;
|
|
291
294
|
status: z.ZodNumber;
|
|
292
295
|
error: z.ZodObject<{
|
|
293
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
296
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
294
297
|
message: z.ZodString;
|
|
295
298
|
}, z.core.$strip>;
|
|
296
299
|
}, z.core.$strip>;
|
|
@@ -306,12 +309,12 @@ declare const commonGetErrorResponses: {
|
|
|
306
309
|
schema: z.ZodObject<{
|
|
307
310
|
instance: z.ZodOptional<z.ZodString>;
|
|
308
311
|
requestId: z.ZodOptional<z.ZodString>;
|
|
309
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
312
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
310
313
|
detail: z.ZodString;
|
|
311
314
|
title: z.ZodString;
|
|
312
315
|
status: z.ZodNumber;
|
|
313
316
|
error: z.ZodObject<{
|
|
314
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
317
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
315
318
|
message: z.ZodString;
|
|
316
319
|
}, z.core.$strip>;
|
|
317
320
|
}, z.core.$strip>;
|
|
@@ -325,12 +328,12 @@ declare const commonGetErrorResponses: {
|
|
|
325
328
|
schema: z.ZodObject<{
|
|
326
329
|
instance: z.ZodOptional<z.ZodString>;
|
|
327
330
|
requestId: z.ZodOptional<z.ZodString>;
|
|
328
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
331
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
329
332
|
detail: z.ZodString;
|
|
330
333
|
title: z.ZodString;
|
|
331
334
|
status: z.ZodNumber;
|
|
332
335
|
error: z.ZodObject<{
|
|
333
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
336
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
334
337
|
message: z.ZodString;
|
|
335
338
|
}, z.core.$strip>;
|
|
336
339
|
}, z.core.$strip>;
|
|
@@ -344,12 +347,12 @@ declare const commonGetErrorResponses: {
|
|
|
344
347
|
schema: z.ZodObject<{
|
|
345
348
|
instance: z.ZodOptional<z.ZodString>;
|
|
346
349
|
requestId: z.ZodOptional<z.ZodString>;
|
|
347
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
350
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
348
351
|
detail: z.ZodString;
|
|
349
352
|
title: z.ZodString;
|
|
350
353
|
status: z.ZodNumber;
|
|
351
354
|
error: z.ZodObject<{
|
|
352
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
355
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
353
356
|
message: z.ZodString;
|
|
354
357
|
}, z.core.$strip>;
|
|
355
358
|
}, z.core.$strip>;
|
|
@@ -363,12 +366,12 @@ declare const commonGetErrorResponses: {
|
|
|
363
366
|
schema: z.ZodObject<{
|
|
364
367
|
instance: z.ZodOptional<z.ZodString>;
|
|
365
368
|
requestId: z.ZodOptional<z.ZodString>;
|
|
366
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
369
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
367
370
|
detail: z.ZodString;
|
|
368
371
|
title: z.ZodString;
|
|
369
372
|
status: z.ZodNumber;
|
|
370
373
|
error: z.ZodObject<{
|
|
371
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
374
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
372
375
|
message: z.ZodString;
|
|
373
376
|
}, z.core.$strip>;
|
|
374
377
|
}, z.core.$strip>;
|
|
@@ -382,12 +385,12 @@ declare const commonGetErrorResponses: {
|
|
|
382
385
|
schema: z.ZodObject<{
|
|
383
386
|
instance: z.ZodOptional<z.ZodString>;
|
|
384
387
|
requestId: z.ZodOptional<z.ZodString>;
|
|
385
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
388
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
386
389
|
detail: z.ZodString;
|
|
387
390
|
title: z.ZodString;
|
|
388
391
|
status: z.ZodNumber;
|
|
389
392
|
error: z.ZodObject<{
|
|
390
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
393
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
391
394
|
message: z.ZodString;
|
|
392
395
|
}, z.core.$strip>;
|
|
393
396
|
}, z.core.$strip>;
|
|
@@ -401,12 +404,12 @@ declare const commonGetErrorResponses: {
|
|
|
401
404
|
schema: z.ZodObject<{
|
|
402
405
|
instance: z.ZodOptional<z.ZodString>;
|
|
403
406
|
requestId: z.ZodOptional<z.ZodString>;
|
|
404
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
407
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
405
408
|
detail: z.ZodString;
|
|
406
409
|
title: z.ZodString;
|
|
407
410
|
status: z.ZodNumber;
|
|
408
411
|
error: z.ZodObject<{
|
|
409
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
412
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
410
413
|
message: z.ZodString;
|
|
411
414
|
}, z.core.$strip>;
|
|
412
415
|
}, z.core.$strip>;
|
|
@@ -422,12 +425,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
422
425
|
schema: z.ZodObject<{
|
|
423
426
|
instance: z.ZodOptional<z.ZodString>;
|
|
424
427
|
requestId: z.ZodOptional<z.ZodString>;
|
|
425
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
428
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
426
429
|
detail: z.ZodString;
|
|
427
430
|
title: z.ZodString;
|
|
428
431
|
status: z.ZodNumber;
|
|
429
432
|
error: z.ZodObject<{
|
|
430
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
433
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
431
434
|
message: z.ZodString;
|
|
432
435
|
}, z.core.$strip>;
|
|
433
436
|
}, z.core.$strip>;
|
|
@@ -441,12 +444,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
441
444
|
schema: z.ZodObject<{
|
|
442
445
|
instance: z.ZodOptional<z.ZodString>;
|
|
443
446
|
requestId: z.ZodOptional<z.ZodString>;
|
|
444
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
447
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
445
448
|
detail: z.ZodString;
|
|
446
449
|
title: z.ZodString;
|
|
447
450
|
status: z.ZodNumber;
|
|
448
451
|
error: z.ZodObject<{
|
|
449
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
452
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
450
453
|
message: z.ZodString;
|
|
451
454
|
}, z.core.$strip>;
|
|
452
455
|
}, z.core.$strip>;
|
|
@@ -460,12 +463,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
460
463
|
schema: z.ZodObject<{
|
|
461
464
|
instance: z.ZodOptional<z.ZodString>;
|
|
462
465
|
requestId: z.ZodOptional<z.ZodString>;
|
|
463
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
466
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
464
467
|
detail: z.ZodString;
|
|
465
468
|
title: z.ZodString;
|
|
466
469
|
status: z.ZodNumber;
|
|
467
470
|
error: z.ZodObject<{
|
|
468
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
471
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
469
472
|
message: z.ZodString;
|
|
470
473
|
}, z.core.$strip>;
|
|
471
474
|
}, z.core.$strip>;
|
|
@@ -479,12 +482,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
479
482
|
schema: z.ZodObject<{
|
|
480
483
|
instance: z.ZodOptional<z.ZodString>;
|
|
481
484
|
requestId: z.ZodOptional<z.ZodString>;
|
|
482
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
485
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
483
486
|
detail: z.ZodString;
|
|
484
487
|
title: z.ZodString;
|
|
485
488
|
status: z.ZodNumber;
|
|
486
489
|
error: z.ZodObject<{
|
|
487
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
490
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
488
491
|
message: z.ZodString;
|
|
489
492
|
}, z.core.$strip>;
|
|
490
493
|
}, z.core.$strip>;
|
|
@@ -498,12 +501,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
498
501
|
schema: z.ZodObject<{
|
|
499
502
|
instance: z.ZodOptional<z.ZodString>;
|
|
500
503
|
requestId: z.ZodOptional<z.ZodString>;
|
|
501
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
504
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
502
505
|
detail: z.ZodString;
|
|
503
506
|
title: z.ZodString;
|
|
504
507
|
status: z.ZodNumber;
|
|
505
508
|
error: z.ZodObject<{
|
|
506
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
509
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
507
510
|
message: z.ZodString;
|
|
508
511
|
}, z.core.$strip>;
|
|
509
512
|
}, z.core.$strip>;
|
|
@@ -517,12 +520,12 @@ declare const commonDeleteErrorResponses: {
|
|
|
517
520
|
schema: z.ZodObject<{
|
|
518
521
|
instance: z.ZodOptional<z.ZodString>;
|
|
519
522
|
requestId: z.ZodOptional<z.ZodString>;
|
|
520
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
523
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
521
524
|
detail: z.ZodString;
|
|
522
525
|
title: z.ZodString;
|
|
523
526
|
status: z.ZodNumber;
|
|
524
527
|
error: z.ZodObject<{
|
|
525
|
-
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "internal_server_error" | "unprocessable_entity">;
|
|
528
|
+
code: z.ZodLiteral<"unauthorized" | "bad_request" | "forbidden" | "not_found" | "conflict" | "too_many_requests" | "internal_server_error" | "unprocessable_entity">;
|
|
526
529
|
message: z.ZodString;
|
|
527
530
|
}, z.core.$strip>;
|
|
528
531
|
}, z.core.$strip>;
|
package/dist/utils/error.js
CHANGED
|
@@ -9,6 +9,7 @@ const ErrorCode = z.enum([
|
|
|
9
9
|
"forbidden",
|
|
10
10
|
"not_found",
|
|
11
11
|
"conflict",
|
|
12
|
+
"too_many_requests",
|
|
12
13
|
"internal_server_error",
|
|
13
14
|
"unprocessable_entity"
|
|
14
15
|
]);
|
|
@@ -18,6 +19,7 @@ const errorCodeToHttpStatus = {
|
|
|
18
19
|
forbidden: 403,
|
|
19
20
|
not_found: 404,
|
|
20
21
|
conflict: 409,
|
|
22
|
+
too_many_requests: 429,
|
|
21
23
|
unprocessable_entity: 422,
|
|
22
24
|
internal_server_error: 500
|
|
23
25
|
};
|
|
@@ -154,6 +156,7 @@ function getTitleFromCode(code) {
|
|
|
154
156
|
case "forbidden": return "Forbidden";
|
|
155
157
|
case "not_found": return "Not Found";
|
|
156
158
|
case "conflict": return "Conflict";
|
|
159
|
+
case "too_many_requests": return "Too Many Requests";
|
|
157
160
|
case "unprocessable_entity": return "Unprocessable Entity";
|
|
158
161
|
case "internal_server_error": return "Internal Server Error";
|
|
159
162
|
default: return "Error";
|
|
@@ -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
|
/**
|