spiceflow 0.0.7 → 1.0.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/README.md +1 -171
- package/dist/client/errors.d.ts +7 -0
- package/dist/client/errors.d.ts.map +1 -0
- package/dist/client/errors.js +18 -0
- package/dist/client/errors.js.map +1 -0
- package/dist/client/index.d.ts +14 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +376 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/types.d.ts +87 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +2 -0
- package/dist/client/types.js.map +1 -0
- package/dist/client/utils.d.ts +2 -0
- package/dist/client/utils.d.ts.map +1 -0
- package/dist/client/utils.js +9 -0
- package/dist/client/utils.js.map +1 -0
- package/dist/client/ws.d.ts +15 -0
- package/dist/client/ws.d.ts.map +1 -0
- package/dist/client/ws.js +51 -0
- package/dist/client/ws.js.map +1 -0
- package/dist/client.test.d.ts +2 -0
- package/dist/client.test.d.ts.map +1 -0
- package/dist/client.test.js +237 -0
- package/dist/client.test.js.map +1 -0
- package/dist/elysia-fork/context.d.ts +87 -0
- package/dist/elysia-fork/context.d.ts.map +1 -0
- package/dist/elysia-fork/context.js +2 -0
- package/dist/elysia-fork/context.js.map +1 -0
- package/dist/elysia-fork/error.d.ts +246 -0
- package/dist/elysia-fork/error.d.ts.map +1 -0
- package/dist/elysia-fork/error.js +195 -0
- package/dist/elysia-fork/error.js.map +1 -0
- package/dist/elysia-fork/types.d.ts +652 -0
- package/dist/elysia-fork/types.d.ts.map +1 -0
- package/dist/elysia-fork/types.js +3 -0
- package/dist/elysia-fork/types.js.map +1 -0
- package/dist/elysia-fork/utils.d.ts +134 -0
- package/dist/elysia-fork/utils.d.ts.map +1 -0
- package/dist/elysia-fork/utils.js +70 -0
- package/dist/elysia-fork/utils.js.map +1 -0
- package/dist/spiceflow.d.ts +253 -0
- package/dist/spiceflow.d.ts.map +1 -0
- package/dist/spiceflow.js +500 -0
- package/dist/spiceflow.js.map +1 -0
- package/dist/spiceflow.test.d.ts +2 -0
- package/dist/spiceflow.test.d.ts.map +1 -0
- package/dist/spiceflow.test.js +225 -0
- package/dist/spiceflow.test.js.map +1 -0
- package/dist/stream.test.d.ts +2 -0
- package/dist/stream.test.d.ts.map +1 -0
- package/dist/stream.test.js +286 -0
- package/dist/stream.test.js.map +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +4 -20
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +17 -46
- package/dist/utils.js.map +1 -1
- package/package.json +12 -36
- package/src/client/errors.ts +21 -0
- package/src/client/index.ts +539 -0
- package/src/client/types.ts +233 -0
- package/src/client/utils.ts +7 -0
- package/src/client/ws.ts +99 -0
- package/src/client.test.ts +235 -0
- package/src/elysia-fork/context.ts +196 -0
- package/src/elysia-fork/error.ts +293 -0
- package/src/elysia-fork/types.ts +1454 -0
- package/src/elysia-fork/utils.ts +85 -0
- package/src/spiceflow.test.ts +290 -0
- package/src/spiceflow.ts +1266 -0
- package/src/stream.test.ts +342 -0
- package/src/types.ts +0 -0
- package/src/utils.ts +21 -70
- package/context.d.ts +0 -2
- package/context.js +0 -1
- package/dist/babel.test.d.ts +0 -2
- package/dist/babel.test.d.ts.map +0 -1
- package/dist/babel.test.js +0 -27
- package/dist/babel.test.js.map +0 -1
- package/dist/babelDebugOutputs.d.ts +0 -9
- package/dist/babelDebugOutputs.d.ts.map +0 -1
- package/dist/babelDebugOutputs.js +0 -34
- package/dist/babelDebugOutputs.js.map +0 -1
- package/dist/babelTransformRpc.d.ts +0 -19
- package/dist/babelTransformRpc.d.ts.map +0 -1
- package/dist/babelTransformRpc.js +0 -285
- package/dist/babelTransformRpc.js.map +0 -1
- package/dist/browser.d.ts +0 -8
- package/dist/browser.d.ts.map +0 -1
- package/dist/browser.js +0 -126
- package/dist/browser.js.map +0 -1
- package/dist/build.d.ts +0 -13
- package/dist/build.d.ts.map +0 -1
- package/dist/build.js +0 -230
- package/dist/build.js.map +0 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -111
- package/dist/cli.js.map +0 -1
- package/dist/context-internal.d.ts +0 -20
- package/dist/context-internal.d.ts.map +0 -1
- package/dist/context-internal.js +0 -16
- package/dist/context-internal.js.map +0 -1
- package/dist/context.d.ts +0 -2
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js +0 -2
- package/dist/context.js.map +0 -1
- package/dist/expose.d.ts +0 -6
- package/dist/expose.d.ts.map +0 -1
- package/dist/expose.js +0 -32
- package/dist/expose.js.map +0 -1
- package/dist/headers.d.ts +0 -2
- package/dist/headers.d.ts.map +0 -1
- package/dist/headers.js +0 -18
- package/dist/headers.js.map +0 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -23
- package/dist/index.js.map +0 -1
- package/dist/jsonRpc.d.ts +0 -32
- package/dist/jsonRpc.d.ts.map +0 -1
- package/dist/jsonRpc.js +0 -3
- package/dist/jsonRpc.js.map +0 -1
- package/dist/server.d.ts +0 -32
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -292
- package/dist/server.js.map +0 -1
- package/headers.d.ts +0 -2
- package/headers.js +0 -1
- package/sdk-template/package.json +0 -22
- package/sdk-template/src/index.ts +0 -2
- package/sdk-template/src/v1/example.ts +0 -5
- package/sdk-template/src/v1/generator.ts +0 -12
- package/sdk-template/tsconfig.json +0 -16
- package/src/babel.test.ts +0 -35
- package/src/babelDebugOutputs.ts +0 -56
- package/src/babelTransformRpc.ts +0 -394
- package/src/browser.ts +0 -141
- package/src/build.ts +0 -298
- package/src/cli.ts +0 -132
- package/src/context-internal.ts +0 -36
- package/src/context.ts +0 -5
- package/src/expose.ts +0 -34
- package/src/headers.ts +0 -19
- package/src/index.ts +0 -34
- package/src/jsonRpc.ts +0 -43
- package/src/server.ts +0 -384
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import type { TSchema } from '@sinclair/typebox';
|
|
2
|
+
import type { TypeCheck, ValueError } from '@sinclair/typebox/compiler';
|
|
3
|
+
export declare const ERROR_CODE: unique symbol;
|
|
4
|
+
export type ERROR_CODE = typeof ERROR_CODE;
|
|
5
|
+
export declare const ELYSIA_RESPONSE: unique symbol;
|
|
6
|
+
export type ELYSIA_RESPONSE = typeof ELYSIA_RESPONSE;
|
|
7
|
+
export declare const isProduction: boolean;
|
|
8
|
+
export type ElysiaErrors = InternalServerError | NotFoundError | ParseError | ValidationError | InvalidCookieSignature;
|
|
9
|
+
export declare const error: <const Code extends number | "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | "Partial Content" | "Multi-Status" | "Already Reported" | "Multiple Choices" | "Moved Permanently" | "Found" | "See Other" | "Not Modified" | "Temporary Redirect" | "Permanent Redirect" | "Bad Request" | "Unauthorized" | "Payment Required" | "Forbidden" | "Not Found" | "Method Not Allowed" | "Not Acceptable" | "Proxy Authentication Required" | "Request Timeout" | "Conflict" | "Gone" | "Length Required" | "Precondition Failed" | "Payload Too Large" | "URI Too Long" | "Unsupported Media Type" | "Range Not Satisfiable" | "Expectation Failed" | "I'm a teapot" | "Misdirected Request" | "Unprocessable Content" | "Locked" | "Failed Dependency" | "Too Early" | "Upgrade Required" | "Precondition Required" | "Too Many Requests" | "Request Header Fields Too Large" | "Unavailable For Legal Reasons" | "Internal Server Error" | "Not Implemented" | "Bad Gateway" | "Service Unavailable" | "Gateway Timeout" | "HTTP Version Not Supported" | "Variant Also Negotiates" | "Insufficient Storage" | "Loop Detected" | "Not Extended" | "Network Authentication Required", const T = Code extends 100 | 101 | 102 | 103 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 300 | 301 | 302 | 303 | 304 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511 ? {
|
|
10
|
+
readonly 100: "Continue";
|
|
11
|
+
readonly 101: "Switching Protocols";
|
|
12
|
+
readonly 102: "Processing";
|
|
13
|
+
readonly 103: "Early Hints";
|
|
14
|
+
readonly 200: "OK";
|
|
15
|
+
readonly 201: "Created";
|
|
16
|
+
readonly 202: "Accepted";
|
|
17
|
+
readonly 203: "Non-Authoritative Information";
|
|
18
|
+
readonly 204: "No Content";
|
|
19
|
+
readonly 205: "Reset Content";
|
|
20
|
+
readonly 206: "Partial Content";
|
|
21
|
+
readonly 207: "Multi-Status";
|
|
22
|
+
readonly 208: "Already Reported";
|
|
23
|
+
readonly 300: "Multiple Choices";
|
|
24
|
+
readonly 301: "Moved Permanently";
|
|
25
|
+
readonly 302: "Found";
|
|
26
|
+
readonly 303: "See Other";
|
|
27
|
+
readonly 304: "Not Modified";
|
|
28
|
+
readonly 307: "Temporary Redirect";
|
|
29
|
+
readonly 308: "Permanent Redirect";
|
|
30
|
+
readonly 400: "Bad Request";
|
|
31
|
+
readonly 401: "Unauthorized";
|
|
32
|
+
readonly 402: "Payment Required";
|
|
33
|
+
readonly 403: "Forbidden";
|
|
34
|
+
readonly 404: "Not Found";
|
|
35
|
+
readonly 405: "Method Not Allowed";
|
|
36
|
+
readonly 406: "Not Acceptable";
|
|
37
|
+
readonly 407: "Proxy Authentication Required";
|
|
38
|
+
readonly 408: "Request Timeout";
|
|
39
|
+
readonly 409: "Conflict";
|
|
40
|
+
readonly 410: "Gone";
|
|
41
|
+
readonly 411: "Length Required";
|
|
42
|
+
readonly 412: "Precondition Failed";
|
|
43
|
+
readonly 413: "Payload Too Large";
|
|
44
|
+
readonly 414: "URI Too Long";
|
|
45
|
+
readonly 415: "Unsupported Media Type";
|
|
46
|
+
readonly 416: "Range Not Satisfiable";
|
|
47
|
+
readonly 417: "Expectation Failed";
|
|
48
|
+
readonly 418: "I'm a teapot";
|
|
49
|
+
readonly 421: "Misdirected Request";
|
|
50
|
+
readonly 422: "Unprocessable Content";
|
|
51
|
+
readonly 423: "Locked";
|
|
52
|
+
readonly 424: "Failed Dependency";
|
|
53
|
+
readonly 425: "Too Early";
|
|
54
|
+
readonly 426: "Upgrade Required";
|
|
55
|
+
readonly 428: "Precondition Required";
|
|
56
|
+
readonly 429: "Too Many Requests";
|
|
57
|
+
readonly 431: "Request Header Fields Too Large";
|
|
58
|
+
readonly 451: "Unavailable For Legal Reasons";
|
|
59
|
+
readonly 500: "Internal Server Error";
|
|
60
|
+
readonly 501: "Not Implemented";
|
|
61
|
+
readonly 502: "Bad Gateway";
|
|
62
|
+
readonly 503: "Service Unavailable";
|
|
63
|
+
readonly 504: "Gateway Timeout";
|
|
64
|
+
readonly 505: "HTTP Version Not Supported";
|
|
65
|
+
readonly 506: "Variant Also Negotiates";
|
|
66
|
+
readonly 507: "Insufficient Storage";
|
|
67
|
+
readonly 508: "Loop Detected";
|
|
68
|
+
readonly 510: "Not Extended";
|
|
69
|
+
readonly 511: "Network Authentication Required";
|
|
70
|
+
}[Code] : Code, const Status extends Code extends "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | "Partial Content" | "Multi-Status" | "Already Reported" | "Multiple Choices" | "Moved Permanently" | "Found" | "See Other" | "Not Modified" | "Temporary Redirect" | "Permanent Redirect" | "Bad Request" | "Unauthorized" | "Payment Required" | "Forbidden" | "Not Found" | "Method Not Allowed" | "Not Acceptable" | "Proxy Authentication Required" | "Request Timeout" | "Conflict" | "Gone" | "Length Required" | "Precondition Failed" | "Payload Too Large" | "URI Too Long" | "Unsupported Media Type" | "Range Not Satisfiable" | "Expectation Failed" | "I'm a teapot" | "Misdirected Request" | "Unprocessable Content" | "Locked" | "Failed Dependency" | "Too Early" | "Upgrade Required" | "Precondition Required" | "Too Many Requests" | "Request Header Fields Too Large" | "Unavailable For Legal Reasons" | "Internal Server Error" | "Not Implemented" | "Bad Gateway" | "Service Unavailable" | "Gateway Timeout" | "HTTP Version Not Supported" | "Variant Also Negotiates" | "Insufficient Storage" | "Loop Detected" | "Not Extended" | "Network Authentication Required" ? {
|
|
71
|
+
readonly Continue: 100;
|
|
72
|
+
readonly 'Switching Protocols': 101;
|
|
73
|
+
readonly Processing: 102;
|
|
74
|
+
readonly 'Early Hints': 103;
|
|
75
|
+
readonly OK: 200;
|
|
76
|
+
readonly Created: 201;
|
|
77
|
+
readonly Accepted: 202;
|
|
78
|
+
readonly 'Non-Authoritative Information': 203;
|
|
79
|
+
readonly 'No Content': 204;
|
|
80
|
+
readonly 'Reset Content': 205;
|
|
81
|
+
readonly 'Partial Content': 206;
|
|
82
|
+
readonly 'Multi-Status': 207;
|
|
83
|
+
readonly 'Already Reported': 208;
|
|
84
|
+
readonly 'Multiple Choices': 300;
|
|
85
|
+
readonly 'Moved Permanently': 301;
|
|
86
|
+
readonly Found: 302;
|
|
87
|
+
readonly 'See Other': 303;
|
|
88
|
+
readonly 'Not Modified': 304;
|
|
89
|
+
readonly 'Temporary Redirect': 307;
|
|
90
|
+
readonly 'Permanent Redirect': 308;
|
|
91
|
+
readonly 'Bad Request': 400;
|
|
92
|
+
readonly Unauthorized: 401;
|
|
93
|
+
readonly 'Payment Required': 402;
|
|
94
|
+
readonly Forbidden: 403;
|
|
95
|
+
readonly 'Not Found': 404;
|
|
96
|
+
readonly 'Method Not Allowed': 405;
|
|
97
|
+
readonly 'Not Acceptable': 406;
|
|
98
|
+
readonly 'Proxy Authentication Required': 407;
|
|
99
|
+
readonly 'Request Timeout': 408;
|
|
100
|
+
readonly Conflict: 409;
|
|
101
|
+
readonly Gone: 410;
|
|
102
|
+
readonly 'Length Required': 411;
|
|
103
|
+
readonly 'Precondition Failed': 412;
|
|
104
|
+
readonly 'Payload Too Large': 413;
|
|
105
|
+
readonly 'URI Too Long': 414;
|
|
106
|
+
readonly 'Unsupported Media Type': 415;
|
|
107
|
+
readonly 'Range Not Satisfiable': 416;
|
|
108
|
+
readonly 'Expectation Failed': 417;
|
|
109
|
+
readonly "I'm a teapot": 418;
|
|
110
|
+
readonly 'Misdirected Request': 421;
|
|
111
|
+
readonly 'Unprocessable Content': 422;
|
|
112
|
+
readonly Locked: 423;
|
|
113
|
+
readonly 'Failed Dependency': 424;
|
|
114
|
+
readonly 'Too Early': 425;
|
|
115
|
+
readonly 'Upgrade Required': 426;
|
|
116
|
+
readonly 'Precondition Required': 428;
|
|
117
|
+
readonly 'Too Many Requests': 429;
|
|
118
|
+
readonly 'Request Header Fields Too Large': 431;
|
|
119
|
+
readonly 'Unavailable For Legal Reasons': 451;
|
|
120
|
+
readonly 'Internal Server Error': 500;
|
|
121
|
+
readonly 'Not Implemented': 501;
|
|
122
|
+
readonly 'Bad Gateway': 502;
|
|
123
|
+
readonly 'Service Unavailable': 503;
|
|
124
|
+
readonly 'Gateway Timeout': 504;
|
|
125
|
+
readonly 'HTTP Version Not Supported': 505;
|
|
126
|
+
readonly 'Variant Also Negotiates': 506;
|
|
127
|
+
readonly 'Insufficient Storage': 507;
|
|
128
|
+
readonly 'Loop Detected': 508;
|
|
129
|
+
readonly 'Not Extended': 510;
|
|
130
|
+
readonly 'Network Authentication Required': 511;
|
|
131
|
+
}[Code] : Code = Code extends "Continue" | "Switching Protocols" | "Processing" | "Early Hints" | "OK" | "Created" | "Accepted" | "Non-Authoritative Information" | "No Content" | "Reset Content" | "Partial Content" | "Multi-Status" | "Already Reported" | "Multiple Choices" | "Moved Permanently" | "Found" | "See Other" | "Not Modified" | "Temporary Redirect" | "Permanent Redirect" | "Bad Request" | "Unauthorized" | "Payment Required" | "Forbidden" | "Not Found" | "Method Not Allowed" | "Not Acceptable" | "Proxy Authentication Required" | "Request Timeout" | "Conflict" | "Gone" | "Length Required" | "Precondition Failed" | "Payload Too Large" | "URI Too Long" | "Unsupported Media Type" | "Range Not Satisfiable" | "Expectation Failed" | "I'm a teapot" | "Misdirected Request" | "Unprocessable Content" | "Locked" | "Failed Dependency" | "Too Early" | "Upgrade Required" | "Precondition Required" | "Too Many Requests" | "Request Header Fields Too Large" | "Unavailable For Legal Reasons" | "Internal Server Error" | "Not Implemented" | "Bad Gateway" | "Service Unavailable" | "Gateway Timeout" | "HTTP Version Not Supported" | "Variant Also Negotiates" | "Insufficient Storage" | "Loop Detected" | "Not Extended" | "Network Authentication Required" ? {
|
|
132
|
+
readonly Continue: 100;
|
|
133
|
+
readonly 'Switching Protocols': 101;
|
|
134
|
+
readonly Processing: 102;
|
|
135
|
+
readonly 'Early Hints': 103;
|
|
136
|
+
readonly OK: 200;
|
|
137
|
+
readonly Created: 201;
|
|
138
|
+
readonly Accepted: 202;
|
|
139
|
+
readonly 'Non-Authoritative Information': 203;
|
|
140
|
+
readonly 'No Content': 204;
|
|
141
|
+
readonly 'Reset Content': 205;
|
|
142
|
+
readonly 'Partial Content': 206;
|
|
143
|
+
readonly 'Multi-Status': 207;
|
|
144
|
+
readonly 'Already Reported': 208;
|
|
145
|
+
readonly 'Multiple Choices': 300;
|
|
146
|
+
readonly 'Moved Permanently': 301;
|
|
147
|
+
readonly Found: 302;
|
|
148
|
+
readonly 'See Other': 303;
|
|
149
|
+
readonly 'Not Modified': 304;
|
|
150
|
+
readonly 'Temporary Redirect': 307;
|
|
151
|
+
readonly 'Permanent Redirect': 308;
|
|
152
|
+
readonly 'Bad Request': 400;
|
|
153
|
+
readonly Unauthorized: 401;
|
|
154
|
+
readonly 'Payment Required': 402;
|
|
155
|
+
readonly Forbidden: 403;
|
|
156
|
+
readonly 'Not Found': 404;
|
|
157
|
+
readonly 'Method Not Allowed': 405;
|
|
158
|
+
readonly 'Not Acceptable': 406;
|
|
159
|
+
readonly 'Proxy Authentication Required': 407;
|
|
160
|
+
readonly 'Request Timeout': 408;
|
|
161
|
+
readonly Conflict: 409;
|
|
162
|
+
readonly Gone: 410;
|
|
163
|
+
readonly 'Length Required': 411;
|
|
164
|
+
readonly 'Precondition Failed': 412;
|
|
165
|
+
readonly 'Payload Too Large': 413;
|
|
166
|
+
readonly 'URI Too Long': 414;
|
|
167
|
+
readonly 'Unsupported Media Type': 415;
|
|
168
|
+
readonly 'Range Not Satisfiable': 416;
|
|
169
|
+
readonly 'Expectation Failed': 417;
|
|
170
|
+
readonly "I'm a teapot": 418;
|
|
171
|
+
readonly 'Misdirected Request': 421;
|
|
172
|
+
readonly 'Unprocessable Content': 422;
|
|
173
|
+
readonly Locked: 423;
|
|
174
|
+
readonly 'Failed Dependency': 424;
|
|
175
|
+
readonly 'Too Early': 425;
|
|
176
|
+
readonly 'Upgrade Required': 426;
|
|
177
|
+
readonly 'Precondition Required': 428;
|
|
178
|
+
readonly 'Too Many Requests': 429;
|
|
179
|
+
readonly 'Request Header Fields Too Large': 431;
|
|
180
|
+
readonly 'Unavailable For Legal Reasons': 451;
|
|
181
|
+
readonly 'Internal Server Error': 500;
|
|
182
|
+
readonly 'Not Implemented': 501;
|
|
183
|
+
readonly 'Bad Gateway': 502;
|
|
184
|
+
readonly 'Service Unavailable': 503;
|
|
185
|
+
readonly 'Gateway Timeout': 504;
|
|
186
|
+
readonly 'HTTP Version Not Supported': 505;
|
|
187
|
+
readonly 'Variant Also Negotiates': 506;
|
|
188
|
+
readonly 'Insufficient Storage': 507;
|
|
189
|
+
readonly 'Loop Detected': 508;
|
|
190
|
+
readonly 'Not Extended': 510;
|
|
191
|
+
readonly 'Network Authentication Required': 511;
|
|
192
|
+
}[Code] : Code>(code: Code, response?: T) => {
|
|
193
|
+
response: T;
|
|
194
|
+
_type: { [ERROR_CODE in Status]: T; };
|
|
195
|
+
error: Error;
|
|
196
|
+
[ELYSIA_RESPONSE]: Status;
|
|
197
|
+
};
|
|
198
|
+
export declare class InternalServerError extends Error {
|
|
199
|
+
code: string;
|
|
200
|
+
status: number;
|
|
201
|
+
constructor(message?: string);
|
|
202
|
+
}
|
|
203
|
+
export declare class NotFoundError extends Error {
|
|
204
|
+
code: string;
|
|
205
|
+
status: number;
|
|
206
|
+
constructor(message?: string);
|
|
207
|
+
}
|
|
208
|
+
export declare class ParseError extends Error {
|
|
209
|
+
code: string;
|
|
210
|
+
status: number;
|
|
211
|
+
constructor();
|
|
212
|
+
}
|
|
213
|
+
export declare class InvalidCookieSignature extends Error {
|
|
214
|
+
key: string;
|
|
215
|
+
code: string;
|
|
216
|
+
status: number;
|
|
217
|
+
constructor(key: string, message?: string);
|
|
218
|
+
}
|
|
219
|
+
export declare const mapValueError: (error: ValueError) => {
|
|
220
|
+
summary: string;
|
|
221
|
+
type: import("@sinclair/typebox/build/cjs/value").ValueErrorType;
|
|
222
|
+
schema: TSchema;
|
|
223
|
+
path: string;
|
|
224
|
+
value: unknown;
|
|
225
|
+
message: string;
|
|
226
|
+
};
|
|
227
|
+
export declare class ValidationError extends Error {
|
|
228
|
+
type: string;
|
|
229
|
+
validator: TSchema | TypeCheck<any>;
|
|
230
|
+
value: unknown;
|
|
231
|
+
code: string;
|
|
232
|
+
status: number;
|
|
233
|
+
constructor(type: string, validator: TSchema | TypeCheck<any>, value: unknown);
|
|
234
|
+
get all(): {
|
|
235
|
+
summary: string;
|
|
236
|
+
type: import("@sinclair/typebox/build/cjs/value").ValueErrorType;
|
|
237
|
+
schema: TSchema;
|
|
238
|
+
path: string;
|
|
239
|
+
value: unknown;
|
|
240
|
+
message: string;
|
|
241
|
+
}[];
|
|
242
|
+
static simplifyModel(validator: TSchema | TypeCheck<any>): any;
|
|
243
|
+
get model(): any;
|
|
244
|
+
toResponse(headers?: Record<string, any>): Response;
|
|
245
|
+
}
|
|
246
|
+
//# sourceMappingURL=error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/elysia-fork/error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO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ED,qBAAa,eAAgB,SAAQ,KAAK;IAKjC,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC;IACnC,KAAK,EAAE,OAAO;IANtB,IAAI,SAAe;IACnB,MAAM,SAAM;gBAGJ,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,EACnC,KAAK,EAAE,OAAO;IAsFtB,IAAI,GAAG;;;;;;;QAKN;IAED,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC;IAWxD,IAAI,KAAK,QAER;IAED,UAAU,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CASxC"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import { Value } from '@sinclair/typebox/value';
|
|
3
|
+
import { StatusMap, InvertedStatusMap } from './utils';
|
|
4
|
+
// ? Cloudflare worker support
|
|
5
|
+
const env =
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
typeof Bun !== 'undefined'
|
|
8
|
+
? // @ts-ignore
|
|
9
|
+
Bun.env
|
|
10
|
+
: typeof process !== 'undefined'
|
|
11
|
+
? process === null || process === void 0 ? void 0 : process.env
|
|
12
|
+
: undefined;
|
|
13
|
+
export const ERROR_CODE = Symbol('ElysiaErrorCode');
|
|
14
|
+
export const ELYSIA_RESPONSE = Symbol('ElysiaResponse');
|
|
15
|
+
export const isProduction = ((_a = env === null || env === void 0 ? void 0 : env.NODE_ENV) !== null && _a !== void 0 ? _a : env === null || env === void 0 ? void 0 : env.ENV) === 'production';
|
|
16
|
+
export const error = (code, response) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const res = response !== null && response !== void 0 ? response : (code in InvertedStatusMap
|
|
19
|
+
? // @ts-expect-error Always correct
|
|
20
|
+
InvertedStatusMap[code]
|
|
21
|
+
: code);
|
|
22
|
+
return {
|
|
23
|
+
// @ts-expect-error trust me bro
|
|
24
|
+
[ELYSIA_RESPONSE]: (_a = StatusMap[code]) !== null && _a !== void 0 ? _a : code,
|
|
25
|
+
response: res,
|
|
26
|
+
_type: undefined,
|
|
27
|
+
error: new Error(res)
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export class InternalServerError extends Error {
|
|
31
|
+
constructor(message) {
|
|
32
|
+
super(message !== null && message !== void 0 ? message : 'INTERNAL_SERVER_ERROR');
|
|
33
|
+
this.code = 'INTERNAL_SERVER_ERROR';
|
|
34
|
+
this.status = 500;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export class NotFoundError extends Error {
|
|
38
|
+
constructor(message) {
|
|
39
|
+
super(message !== null && message !== void 0 ? message : 'NOT_FOUND');
|
|
40
|
+
this.code = 'NOT_FOUND';
|
|
41
|
+
this.status = 404;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export class ParseError extends Error {
|
|
45
|
+
constructor() {
|
|
46
|
+
super('Failed to parse body');
|
|
47
|
+
this.code = 'PARSE';
|
|
48
|
+
this.status = 400;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export class InvalidCookieSignature extends Error {
|
|
52
|
+
constructor(key, message) {
|
|
53
|
+
super(message !== null && message !== void 0 ? message : `"${key}" has invalid cookie signature`);
|
|
54
|
+
this.key = key;
|
|
55
|
+
this.code = 'INVALID_COOKIE_SIGNATURE';
|
|
56
|
+
this.status = 400;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export const mapValueError = (error) => {
|
|
60
|
+
const { message, path, value, type } = error;
|
|
61
|
+
const property = path.slice(1).replaceAll('/', '.');
|
|
62
|
+
const isRoot = path === '';
|
|
63
|
+
switch (type) {
|
|
64
|
+
case 42:
|
|
65
|
+
return Object.assign(Object.assign({}, error), { summary: isRoot
|
|
66
|
+
? `Value should not be provided`
|
|
67
|
+
: `Property '${property}' should not be provided` });
|
|
68
|
+
case 45:
|
|
69
|
+
return Object.assign(Object.assign({}, error), { summary: isRoot
|
|
70
|
+
? `Value is missing`
|
|
71
|
+
: `Property '${property}' is missing` });
|
|
72
|
+
case 50:
|
|
73
|
+
// Expected string to match 'email' format
|
|
74
|
+
const quoteIndex = message.indexOf("'");
|
|
75
|
+
const format = message.slice(quoteIndex + 1, message.indexOf("'", quoteIndex + 1));
|
|
76
|
+
return Object.assign(Object.assign({}, error), { summary: isRoot
|
|
77
|
+
? `Value should be an email`
|
|
78
|
+
: `Property '${property}' should be ${format}` });
|
|
79
|
+
case 54:
|
|
80
|
+
return Object.assign(Object.assign({}, error), { summary: `${message.slice(0, 9)} property '${property}' to be ${message.slice(8)} but found: ${value}` });
|
|
81
|
+
case 62:
|
|
82
|
+
const union = error.schema.anyOf
|
|
83
|
+
.map((x) => { var _a; return `'${(_a = x === null || x === void 0 ? void 0 : x.format) !== null && _a !== void 0 ? _a : x.type}'`; })
|
|
84
|
+
.join(', ');
|
|
85
|
+
return Object.assign(Object.assign({}, error), { summary: isRoot
|
|
86
|
+
? `Value should be one of ${union}`
|
|
87
|
+
: `Property '${property}' should be one of: ${union}` });
|
|
88
|
+
default:
|
|
89
|
+
return Object.assign({ summary: message }, error);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
export class ValidationError extends Error {
|
|
93
|
+
constructor(type, validator, value) {
|
|
94
|
+
var _a, _b;
|
|
95
|
+
if (value && typeof value === 'object' && ELYSIA_RESPONSE in value)
|
|
96
|
+
// @ts-expect-error
|
|
97
|
+
value = value.response;
|
|
98
|
+
const error = isProduction
|
|
99
|
+
? undefined
|
|
100
|
+
: 'Errors' in validator
|
|
101
|
+
? validator.Errors(value).First()
|
|
102
|
+
: Value.Errors(validator, value).First();
|
|
103
|
+
const customError = (error === null || error === void 0 ? void 0 : error.schema.error) !== undefined
|
|
104
|
+
? typeof error.schema.error === 'function'
|
|
105
|
+
? error.schema.error({
|
|
106
|
+
type,
|
|
107
|
+
validator,
|
|
108
|
+
value,
|
|
109
|
+
get errors() {
|
|
110
|
+
return [...validator.Errors(value)].map(mapValueError);
|
|
111
|
+
}
|
|
112
|
+
})
|
|
113
|
+
: error.schema.error
|
|
114
|
+
: undefined;
|
|
115
|
+
const accessor = (error === null || error === void 0 ? void 0 : error.path) || 'root';
|
|
116
|
+
let message = '';
|
|
117
|
+
if (customError !== undefined) {
|
|
118
|
+
message =
|
|
119
|
+
typeof customError === 'object'
|
|
120
|
+
? JSON.stringify(customError)
|
|
121
|
+
: customError + '';
|
|
122
|
+
}
|
|
123
|
+
else if (isProduction) {
|
|
124
|
+
message = JSON.stringify({
|
|
125
|
+
type: 'validation',
|
|
126
|
+
on: type,
|
|
127
|
+
summary: mapValueError(error).summary,
|
|
128
|
+
message: error === null || error === void 0 ? void 0 : error.message,
|
|
129
|
+
found: value
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
// @ts-ignore private field
|
|
134
|
+
const schema = (_a = validator === null || validator === void 0 ? void 0 : validator.schema) !== null && _a !== void 0 ? _a : validator;
|
|
135
|
+
const errors = 'Errors' in validator
|
|
136
|
+
? [...validator.Errors(value)].map(mapValueError)
|
|
137
|
+
: [...Value.Errors(validator, value)].map(mapValueError);
|
|
138
|
+
let expected;
|
|
139
|
+
try {
|
|
140
|
+
expected = Value.Create(schema);
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
expected = {
|
|
144
|
+
type: 'Could not create expected value',
|
|
145
|
+
// @ts-expect-error
|
|
146
|
+
message: error === null || error === void 0 ? void 0 : error.message,
|
|
147
|
+
error
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
message = JSON.stringify({
|
|
151
|
+
type: 'validation',
|
|
152
|
+
on: type,
|
|
153
|
+
summary: (_b = errors[0]) === null || _b === void 0 ? void 0 : _b.summary,
|
|
154
|
+
property: accessor,
|
|
155
|
+
message: error === null || error === void 0 ? void 0 : error.message,
|
|
156
|
+
expected,
|
|
157
|
+
found: value,
|
|
158
|
+
errors
|
|
159
|
+
}, null, 2);
|
|
160
|
+
}
|
|
161
|
+
super(message);
|
|
162
|
+
this.type = type;
|
|
163
|
+
this.validator = validator;
|
|
164
|
+
this.value = value;
|
|
165
|
+
this.code = 'VALIDATION';
|
|
166
|
+
this.status = 422;
|
|
167
|
+
Object.setPrototypeOf(this, ValidationError.prototype);
|
|
168
|
+
}
|
|
169
|
+
get all() {
|
|
170
|
+
return 'Errors' in this.validator
|
|
171
|
+
? [...this.validator.Errors(this.value)].map(mapValueError)
|
|
172
|
+
: // @ts-ignore
|
|
173
|
+
[...Value.Errors(this.validator, this.value)].map(mapValueError);
|
|
174
|
+
}
|
|
175
|
+
static simplifyModel(validator) {
|
|
176
|
+
// @ts-ignore
|
|
177
|
+
const model = 'schema' in validator ? validator.schema : validator;
|
|
178
|
+
try {
|
|
179
|
+
return Value.Create(model);
|
|
180
|
+
}
|
|
181
|
+
catch (_a) {
|
|
182
|
+
return model;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
get model() {
|
|
186
|
+
return ValidationError.simplifyModel(this.validator);
|
|
187
|
+
}
|
|
188
|
+
toResponse(headers) {
|
|
189
|
+
return new Response(this.message, {
|
|
190
|
+
status: 400,
|
|
191
|
+
headers: Object.assign(Object.assign({}, headers), { 'content-type': 'application/json' })
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/elysia-fork/error.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAG/C,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAEtD,8BAA8B;AAC9B,MAAM,GAAG;AACR,aAAa;AACb,OAAO,GAAG,KAAK,WAAW;IACzB,CAAC,CAAC,aAAa;QACb,GAAG,CAAC,GAAG;IACT,CA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