@vercube/core 0.0.34 → 0.0.35
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 +25 -43
- package/dist/index.d.mts +5548 -4
- package/dist/index.mjs +269 -134
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -121,6 +121,109 @@ var BadRequestError = class BadRequestError extends HttpError {
|
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/Utils/Security.ts
|
|
126
|
+
/**
|
|
127
|
+
* Dangerous property names that can lead to prototype pollution attacks.
|
|
128
|
+
* These properties should never be set on objects from untrusted sources.
|
|
129
|
+
*/
|
|
130
|
+
const DANGEROUS_PROPERTIES = Object.freeze([
|
|
131
|
+
"__proto__",
|
|
132
|
+
"constructor",
|
|
133
|
+
"prototype"
|
|
134
|
+
]);
|
|
135
|
+
/**
|
|
136
|
+
* Checks if a property name is safe to use (not a prototype pollution vector).
|
|
137
|
+
*
|
|
138
|
+
* @param {string} key - The property name to check
|
|
139
|
+
* @returns {boolean} True if the property is safe to use, false if it's dangerous
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* isSafeProperty('name') // true
|
|
143
|
+
* isSafeProperty('__proto__') // false
|
|
144
|
+
* isSafeProperty('constructor') // false
|
|
145
|
+
*/
|
|
146
|
+
function isSafeProperty(key) {
|
|
147
|
+
return !DANGEROUS_PROPERTIES.includes(key);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Custom reviver function for JSON.parse that filters out dangerous properties
|
|
151
|
+
* that could lead to prototype pollution attacks.
|
|
152
|
+
*
|
|
153
|
+
* @param {string} key - The property key being processed
|
|
154
|
+
* @param {unknown} value - The property value
|
|
155
|
+
* @returns {unknown} The value if safe, undefined if dangerous
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* JSON.parse('{"__proto__": {"admin": true}}', secureReviver)
|
|
159
|
+
* // Returns an empty object, filtering out __proto__
|
|
160
|
+
*/
|
|
161
|
+
function secureReviver(key, value) {
|
|
162
|
+
if (!isSafeProperty(key)) return;
|
|
163
|
+
return value;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Safely parses a JSON string, filtering out properties that could lead to
|
|
167
|
+
* prototype pollution attacks.
|
|
168
|
+
*
|
|
169
|
+
* This function uses a custom reviver to prevent __proto__, constructor, and
|
|
170
|
+
* prototype properties from being set on the parsed object.
|
|
171
|
+
*
|
|
172
|
+
* @param {string} text - The JSON string to parse
|
|
173
|
+
* @returns {unknown} The parsed object with dangerous properties filtered out
|
|
174
|
+
* @throws {SyntaxError} If the JSON string is malformed
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* const obj = safeJsonParse('{"name": "John", "__proto__": {"isAdmin": true}}');
|
|
178
|
+
* // Returns { name: 'John' } - __proto__ is filtered out
|
|
179
|
+
*
|
|
180
|
+
* @example
|
|
181
|
+
* const malicious = safeJsonParse('{"constructor": {"prototype": {"polluted": true}}}');
|
|
182
|
+
* // Returns {} - dangerous properties are filtered out
|
|
183
|
+
*/
|
|
184
|
+
function safeJsonParse(text) {
|
|
185
|
+
return JSON.parse(text, secureReviver);
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Sanitizes an object by removing dangerous properties that could lead to
|
|
189
|
+
* prototype pollution attacks. Creates a new object with only safe properties.
|
|
190
|
+
*
|
|
191
|
+
* @param {Record<string, unknown>} obj - The object to sanitize
|
|
192
|
+
* @returns {Record<string, unknown>} A new object with dangerous properties removed
|
|
193
|
+
*
|
|
194
|
+
* @example
|
|
195
|
+
* const unsafe = { name: 'John', __proto__: { isAdmin: true } };
|
|
196
|
+
* const safe = sanitizeObject(unsafe);
|
|
197
|
+
* // Returns { name: 'John' }
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* const malicious = { constructor: { prototype: { polluted: true } } };
|
|
201
|
+
* const clean = sanitizeObject(malicious);
|
|
202
|
+
* // Returns {}
|
|
203
|
+
*/
|
|
204
|
+
function sanitizeObject(obj) {
|
|
205
|
+
const sanitized = Object.create(null);
|
|
206
|
+
for (const key of Object.keys(obj)) if (isSafeProperty(key) && Object.prototype.hasOwnProperty.call(obj, key)) sanitized[key] = obj[key];
|
|
207
|
+
return Object.assign({}, sanitized);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Safely assigns properties from source to target, filtering out dangerous
|
|
211
|
+
* properties that could lead to prototype pollution.
|
|
212
|
+
*
|
|
213
|
+
* @param {any} target - The target object to assign properties to
|
|
214
|
+
* @param {Record<string, unknown>} source - The source object with properties to copy
|
|
215
|
+
* @returns {void}
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* const target = { existing: 'value' };
|
|
219
|
+
* const source = { name: 'John', __proto__: { isAdmin: true } };
|
|
220
|
+
* safeAssign(target, source);
|
|
221
|
+
* // target is now { existing: 'value', name: 'John' }
|
|
222
|
+
*/
|
|
223
|
+
function safeAssign(target, source) {
|
|
224
|
+
for (const key of Object.keys(source)) if (isSafeProperty(key) && Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
225
|
+
}
|
|
226
|
+
|
|
124
227
|
//#endregion
|
|
125
228
|
//#region src/Resolvers/Body.ts
|
|
126
229
|
/**
|
|
@@ -147,7 +250,7 @@ async function resolveRequestBody(event) {
|
|
|
147
250
|
const text = await event.request.clone().text();
|
|
148
251
|
if (!text) return;
|
|
149
252
|
try {
|
|
150
|
-
return
|
|
253
|
+
return safeJsonParse(text);
|
|
151
254
|
} catch {
|
|
152
255
|
throw new BadRequestError("Invalid JSON body");
|
|
153
256
|
}
|
|
@@ -435,7 +538,7 @@ var RequestContext = class {
|
|
|
435
538
|
};
|
|
436
539
|
|
|
437
540
|
//#endregion
|
|
438
|
-
//#region \0@oxc-project+runtime@0.
|
|
541
|
+
//#region \0@oxc-project+runtime@0.110.0/helpers/decorate.js
|
|
439
542
|
function __decorate(decorators, target, key, desc) {
|
|
440
543
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
441
544
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -782,6 +885,29 @@ var RouterBeforeInitHook = class {};
|
|
|
782
885
|
//#endregion
|
|
783
886
|
//#region src/Services/Hooks/HooksService.ts
|
|
784
887
|
/**
|
|
888
|
+
* This module is responsible for managing type-safe hooks observer pattern.
|
|
889
|
+
*
|
|
890
|
+
* You may create an Hook class that will function as single hook with some data,
|
|
891
|
+
* eg:
|
|
892
|
+
*
|
|
893
|
+
* class ECylinderSelected {
|
|
894
|
+
* public cylinder: ICylinder;
|
|
895
|
+
* }
|
|
896
|
+
*
|
|
897
|
+
* And then you can trigger this hook at any time, passing proper payload:
|
|
898
|
+
*
|
|
899
|
+
* HooksService.trigger(ECylinderSelected, { cylinder: someCylinder });
|
|
900
|
+
*
|
|
901
|
+
* And you can also listen to this hook:
|
|
902
|
+
*
|
|
903
|
+
* HooksService.listen(ECylinderSelected, payload => console.log(payload.cylinder));
|
|
904
|
+
*
|
|
905
|
+
*
|
|
906
|
+
* HooksService.on(ECylinderSelected, payload => console.log(payload.cylinder));
|
|
907
|
+
*
|
|
908
|
+
* Everything 100% typechecked.
|
|
909
|
+
*/
|
|
910
|
+
/**
|
|
785
911
|
* This class is responsible for managing events.
|
|
786
912
|
*/
|
|
787
913
|
var HooksService = class {
|
|
@@ -880,10 +1006,7 @@ var HooksService = class {
|
|
|
880
1006
|
*/
|
|
881
1007
|
objectToClass(ClassConstructor, data) {
|
|
882
1008
|
const instance = new ClassConstructor();
|
|
883
|
-
if (data)
|
|
884
|
-
const rawInstance = instance;
|
|
885
|
-
rawInstance[key] = data[key];
|
|
886
|
-
}
|
|
1009
|
+
if (data) safeAssign(instance, data);
|
|
887
1010
|
return instance;
|
|
888
1011
|
}
|
|
889
1012
|
};
|
|
@@ -1432,6 +1555,18 @@ function generateRandomHash() {
|
|
|
1432
1555
|
//#endregion
|
|
1433
1556
|
//#region src/Config/DefaultConfig.ts
|
|
1434
1557
|
/**
|
|
1558
|
+
* Gets the session secret from environment or generates one for development.
|
|
1559
|
+
* In production, requires the SECRET environment variable to be set.
|
|
1560
|
+
* @throws {Error} If in production and SECRET environment variable is not set
|
|
1561
|
+
* @returns {string} The session secret
|
|
1562
|
+
*/
|
|
1563
|
+
function getSessionSecret() {
|
|
1564
|
+
const isProduction = process.env.NODE_ENV === "production";
|
|
1565
|
+
const envSecret = process.env.SECRET;
|
|
1566
|
+
if (isProduction && !envSecret) throw new Error("SESSION SECRET ERROR: In production mode, you must set a strong SECRET environment variable. Using a dynamically generated secret is insecure and will cause session data to be lost on server restart. Please set the SECRET environment variable to a strong, randomly generated string (at least 32 characters). Example: SECRET=your-strong-random-secret-here-at-least-32-chars");
|
|
1567
|
+
return envSecret ?? generateRandomHash();
|
|
1568
|
+
}
|
|
1569
|
+
/**
|
|
1435
1570
|
* Default configuration for the Vercube application.
|
|
1436
1571
|
* This configuration serves as the base settings and can be overridden by user configuration.
|
|
1437
1572
|
*/
|
|
@@ -1457,7 +1592,7 @@ const defaultConfig = {
|
|
|
1457
1592
|
},
|
|
1458
1593
|
experimental: {},
|
|
1459
1594
|
runtime: { session: {
|
|
1460
|
-
secret:
|
|
1595
|
+
secret: getSessionSecret(),
|
|
1461
1596
|
name: "vercube_session",
|
|
1462
1597
|
duration: 3600 * 24 * 7
|
|
1463
1598
|
} }
|
|
@@ -2496,69 +2631,69 @@ function SetHeader(key, value) {
|
|
|
2496
2631
|
|
|
2497
2632
|
//#endregion
|
|
2498
2633
|
//#region src/Types/HttpTypes.ts
|
|
2499
|
-
let HTTPStatus = /* @__PURE__ */ function(HTTPStatus
|
|
2500
|
-
HTTPStatus
|
|
2501
|
-
HTTPStatus
|
|
2502
|
-
HTTPStatus
|
|
2503
|
-
HTTPStatus
|
|
2504
|
-
HTTPStatus
|
|
2505
|
-
HTTPStatus
|
|
2506
|
-
HTTPStatus
|
|
2507
|
-
HTTPStatus
|
|
2508
|
-
HTTPStatus
|
|
2509
|
-
HTTPStatus
|
|
2510
|
-
HTTPStatus
|
|
2511
|
-
HTTPStatus
|
|
2512
|
-
HTTPStatus
|
|
2513
|
-
HTTPStatus
|
|
2514
|
-
HTTPStatus
|
|
2515
|
-
HTTPStatus
|
|
2516
|
-
HTTPStatus
|
|
2517
|
-
HTTPStatus
|
|
2518
|
-
HTTPStatus
|
|
2519
|
-
HTTPStatus
|
|
2520
|
-
HTTPStatus
|
|
2521
|
-
HTTPStatus
|
|
2522
|
-
HTTPStatus
|
|
2523
|
-
HTTPStatus
|
|
2524
|
-
HTTPStatus
|
|
2525
|
-
HTTPStatus
|
|
2526
|
-
HTTPStatus
|
|
2527
|
-
HTTPStatus
|
|
2528
|
-
HTTPStatus
|
|
2529
|
-
HTTPStatus
|
|
2530
|
-
HTTPStatus
|
|
2531
|
-
HTTPStatus
|
|
2532
|
-
HTTPStatus
|
|
2533
|
-
HTTPStatus
|
|
2534
|
-
HTTPStatus
|
|
2535
|
-
HTTPStatus
|
|
2536
|
-
HTTPStatus
|
|
2537
|
-
HTTPStatus
|
|
2538
|
-
HTTPStatus
|
|
2539
|
-
HTTPStatus
|
|
2540
|
-
HTTPStatus
|
|
2541
|
-
HTTPStatus
|
|
2542
|
-
HTTPStatus
|
|
2543
|
-
HTTPStatus
|
|
2544
|
-
HTTPStatus
|
|
2545
|
-
HTTPStatus
|
|
2546
|
-
HTTPStatus
|
|
2547
|
-
HTTPStatus
|
|
2548
|
-
HTTPStatus
|
|
2549
|
-
HTTPStatus
|
|
2550
|
-
HTTPStatus
|
|
2551
|
-
HTTPStatus
|
|
2552
|
-
HTTPStatus
|
|
2553
|
-
HTTPStatus
|
|
2554
|
-
HTTPStatus
|
|
2555
|
-
HTTPStatus
|
|
2556
|
-
HTTPStatus
|
|
2557
|
-
HTTPStatus
|
|
2558
|
-
HTTPStatus
|
|
2559
|
-
HTTPStatus
|
|
2560
|
-
HTTPStatus
|
|
2561
|
-
return HTTPStatus
|
|
2634
|
+
let HTTPStatus = /* @__PURE__ */ function(HTTPStatus) {
|
|
2635
|
+
HTTPStatus[HTTPStatus["CONTINUE"] = 100] = "CONTINUE";
|
|
2636
|
+
HTTPStatus[HTTPStatus["SWITCHING_PROTOCOLS"] = 101] = "SWITCHING_PROTOCOLS";
|
|
2637
|
+
HTTPStatus[HTTPStatus["PROCESSING"] = 102] = "PROCESSING";
|
|
2638
|
+
HTTPStatus[HTTPStatus["OK"] = 200] = "OK";
|
|
2639
|
+
HTTPStatus[HTTPStatus["CREATED"] = 201] = "CREATED";
|
|
2640
|
+
HTTPStatus[HTTPStatus["ACCEPTED"] = 202] = "ACCEPTED";
|
|
2641
|
+
HTTPStatus[HTTPStatus["NON_AUTHORITATIVE_INFORMATION"] = 203] = "NON_AUTHORITATIVE_INFORMATION";
|
|
2642
|
+
HTTPStatus[HTTPStatus["NO_CONTENT"] = 204] = "NO_CONTENT";
|
|
2643
|
+
HTTPStatus[HTTPStatus["RESET_CONTENT"] = 205] = "RESET_CONTENT";
|
|
2644
|
+
HTTPStatus[HTTPStatus["PARTIAL_CONTENT"] = 206] = "PARTIAL_CONTENT";
|
|
2645
|
+
HTTPStatus[HTTPStatus["MULTI_STATUS"] = 207] = "MULTI_STATUS";
|
|
2646
|
+
HTTPStatus[HTTPStatus["ALREADY_REPORTED"] = 208] = "ALREADY_REPORTED";
|
|
2647
|
+
HTTPStatus[HTTPStatus["IM_USED"] = 226] = "IM_USED";
|
|
2648
|
+
HTTPStatus[HTTPStatus["MULTIPLE_CHOICES"] = 300] = "MULTIPLE_CHOICES";
|
|
2649
|
+
HTTPStatus[HTTPStatus["MOVED_PERMANENTLY"] = 301] = "MOVED_PERMANENTLY";
|
|
2650
|
+
HTTPStatus[HTTPStatus["FOUND"] = 302] = "FOUND";
|
|
2651
|
+
HTTPStatus[HTTPStatus["SEE_OTHER"] = 303] = "SEE_OTHER";
|
|
2652
|
+
HTTPStatus[HTTPStatus["NOT_MODIFIED"] = 304] = "NOT_MODIFIED";
|
|
2653
|
+
HTTPStatus[HTTPStatus["USE_PROXY"] = 305] = "USE_PROXY";
|
|
2654
|
+
HTTPStatus[HTTPStatus["TEMPORARY_REDIRECT"] = 307] = "TEMPORARY_REDIRECT";
|
|
2655
|
+
HTTPStatus[HTTPStatus["PERMANENT_REDIRECT"] = 308] = "PERMANENT_REDIRECT";
|
|
2656
|
+
HTTPStatus[HTTPStatus["BAD_REQUEST"] = 400] = "BAD_REQUEST";
|
|
2657
|
+
HTTPStatus[HTTPStatus["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
|
|
2658
|
+
HTTPStatus[HTTPStatus["PAYMENT_REQUIRED"] = 402] = "PAYMENT_REQUIRED";
|
|
2659
|
+
HTTPStatus[HTTPStatus["FORBIDDEN"] = 403] = "FORBIDDEN";
|
|
2660
|
+
HTTPStatus[HTTPStatus["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
2661
|
+
HTTPStatus[HTTPStatus["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
|
|
2662
|
+
HTTPStatus[HTTPStatus["NOT_ACCEPTABLE"] = 406] = "NOT_ACCEPTABLE";
|
|
2663
|
+
HTTPStatus[HTTPStatus["PROXY_AUTHENTICATION_REQUIRED"] = 407] = "PROXY_AUTHENTICATION_REQUIRED";
|
|
2664
|
+
HTTPStatus[HTTPStatus["REQUEST_TIMEOUT"] = 408] = "REQUEST_TIMEOUT";
|
|
2665
|
+
HTTPStatus[HTTPStatus["CONFLICT"] = 409] = "CONFLICT";
|
|
2666
|
+
HTTPStatus[HTTPStatus["GONE"] = 410] = "GONE";
|
|
2667
|
+
HTTPStatus[HTTPStatus["LENGTH_REQUIRED"] = 411] = "LENGTH_REQUIRED";
|
|
2668
|
+
HTTPStatus[HTTPStatus["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
|
|
2669
|
+
HTTPStatus[HTTPStatus["PAYLOAD_TOO_LARGE"] = 413] = "PAYLOAD_TOO_LARGE";
|
|
2670
|
+
HTTPStatus[HTTPStatus["URI_TOO_LONG"] = 414] = "URI_TOO_LONG";
|
|
2671
|
+
HTTPStatus[HTTPStatus["UNSUPPORTED_MEDIA_TYPE"] = 415] = "UNSUPPORTED_MEDIA_TYPE";
|
|
2672
|
+
HTTPStatus[HTTPStatus["RANGE_NOT_SATISFIABLE"] = 416] = "RANGE_NOT_SATISFIABLE";
|
|
2673
|
+
HTTPStatus[HTTPStatus["EXPECTATION_FAILED"] = 417] = "EXPECTATION_FAILED";
|
|
2674
|
+
HTTPStatus[HTTPStatus["I_AM_A_TEAPOT"] = 418] = "I_AM_A_TEAPOT";
|
|
2675
|
+
HTTPStatus[HTTPStatus["MISDIRECTED_REQUEST"] = 421] = "MISDIRECTED_REQUEST";
|
|
2676
|
+
HTTPStatus[HTTPStatus["UNPROCESSABLE_ENTITY"] = 422] = "UNPROCESSABLE_ENTITY";
|
|
2677
|
+
HTTPStatus[HTTPStatus["LOCKED"] = 423] = "LOCKED";
|
|
2678
|
+
HTTPStatus[HTTPStatus["FAILED_DEPENDENCY"] = 424] = "FAILED_DEPENDENCY";
|
|
2679
|
+
HTTPStatus[HTTPStatus["TOO_EARLY"] = 425] = "TOO_EARLY";
|
|
2680
|
+
HTTPStatus[HTTPStatus["UPGRADE_REQUIRED"] = 426] = "UPGRADE_REQUIRED";
|
|
2681
|
+
HTTPStatus[HTTPStatus["PRECONDITION_REQUIRED"] = 428] = "PRECONDITION_REQUIRED";
|
|
2682
|
+
HTTPStatus[HTTPStatus["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
|
|
2683
|
+
HTTPStatus[HTTPStatus["REQUEST_HEADER_FIELDS_TOO_LARGE"] = 431] = "REQUEST_HEADER_FIELDS_TOO_LARGE";
|
|
2684
|
+
HTTPStatus[HTTPStatus["UNAVAILABLE_FOR_LEGAL_REASONS"] = 451] = "UNAVAILABLE_FOR_LEGAL_REASONS";
|
|
2685
|
+
HTTPStatus[HTTPStatus["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
|
|
2686
|
+
HTTPStatus[HTTPStatus["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
|
|
2687
|
+
HTTPStatus[HTTPStatus["BAD_GATEWAY"] = 502] = "BAD_GATEWAY";
|
|
2688
|
+
HTTPStatus[HTTPStatus["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
|
|
2689
|
+
HTTPStatus[HTTPStatus["GATEWAY_TIMEOUT"] = 504] = "GATEWAY_TIMEOUT";
|
|
2690
|
+
HTTPStatus[HTTPStatus["HTTP_VERSION_NOT_SUPPORTED"] = 505] = "HTTP_VERSION_NOT_SUPPORTED";
|
|
2691
|
+
HTTPStatus[HTTPStatus["VARIANT_ALSO_NEGOTIATES"] = 506] = "VARIANT_ALSO_NEGOTIATES";
|
|
2692
|
+
HTTPStatus[HTTPStatus["INSUFFICIENT_STORAGE"] = 507] = "INSUFFICIENT_STORAGE";
|
|
2693
|
+
HTTPStatus[HTTPStatus["LOOP_DETECTED"] = 508] = "LOOP_DETECTED";
|
|
2694
|
+
HTTPStatus[HTTPStatus["NOT_EXTENDED"] = 510] = "NOT_EXTENDED";
|
|
2695
|
+
HTTPStatus[HTTPStatus["NETWORK_AUTHENTICATION_REQUIRED"] = 511] = "NETWORK_AUTHENTICATION_REQUIRED";
|
|
2696
|
+
return HTTPStatus;
|
|
2562
2697
|
}({});
|
|
2563
2698
|
|
|
2564
2699
|
//#endregion
|
|
@@ -2825,7 +2960,7 @@ var UnauthorizedError = class UnauthorizedError extends HttpError {
|
|
|
2825
2960
|
* Hypertext Transfer Protocol (HTTP) response status codes.
|
|
2826
2961
|
* @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}
|
|
2827
2962
|
*/
|
|
2828
|
-
let HttpStatusCode = /* @__PURE__ */ function(HttpStatusCode
|
|
2963
|
+
let HttpStatusCode = /* @__PURE__ */ function(HttpStatusCode) {
|
|
2829
2964
|
/**
|
|
2830
2965
|
* The server has received the request headers and the client should proceed to send the request body
|
|
2831
2966
|
* (in the case of a request for which a body needs to be sent; for example, a POST request).
|
|
@@ -2834,79 +2969,79 @@ let HttpStatusCode = /* @__PURE__ */ function(HttpStatusCode$1) {
|
|
|
2834
2969
|
* and receive a 100 Continue status code in response before sending the body. The response 417 Expectation Failed indicates
|
|
2835
2970
|
* the request should not be continued.
|
|
2836
2971
|
*/
|
|
2837
|
-
HttpStatusCode
|
|
2972
|
+
HttpStatusCode[HttpStatusCode["CONTINUE"] = 100] = "CONTINUE";
|
|
2838
2973
|
/**
|
|
2839
2974
|
* The requester has asked the server to switch protocols and the server has agreed to do so.
|
|
2840
2975
|
*/
|
|
2841
|
-
HttpStatusCode
|
|
2976
|
+
HttpStatusCode[HttpStatusCode["SWITCHING_PROTOCOLS"] = 101] = "SWITCHING_PROTOCOLS";
|
|
2842
2977
|
/**
|
|
2843
2978
|
* A WebDAV request may contain many sub-requests involving file operations, requiring a long time to complete the request.
|
|
2844
2979
|
* This code indicates that the server has received and is processing the request, but no response is available yet.
|
|
2845
2980
|
* This prevents the client from timing out and assuming the request was lost.
|
|
2846
2981
|
*/
|
|
2847
|
-
HttpStatusCode
|
|
2982
|
+
HttpStatusCode[HttpStatusCode["PROCESSING"] = 102] = "PROCESSING";
|
|
2848
2983
|
/**
|
|
2849
2984
|
* Standard response for successful HTTP requests.
|
|
2850
2985
|
* The actual response will depend on the request method used.
|
|
2851
2986
|
* In a GET request, the response will contain an entity corresponding to the requested resource.
|
|
2852
2987
|
* In a POST request, the response will contain an entity describing or containing the result of the action.
|
|
2853
2988
|
*/
|
|
2854
|
-
HttpStatusCode
|
|
2989
|
+
HttpStatusCode[HttpStatusCode["OK"] = 200] = "OK";
|
|
2855
2990
|
/**
|
|
2856
2991
|
* The request has been fulfilled, resulting in the creation of a new resource.
|
|
2857
2992
|
*/
|
|
2858
|
-
HttpStatusCode
|
|
2993
|
+
HttpStatusCode[HttpStatusCode["CREATED"] = 201] = "CREATED";
|
|
2859
2994
|
/**
|
|
2860
2995
|
* The request has been accepted for processing, but the processing has not been completed.
|
|
2861
2996
|
* The request might or might not be eventually acted upon, and may be disallowed when processing occurs.
|
|
2862
2997
|
*/
|
|
2863
|
-
HttpStatusCode
|
|
2998
|
+
HttpStatusCode[HttpStatusCode["ACCEPTED"] = 202] = "ACCEPTED";
|
|
2864
2999
|
/**
|
|
2865
3000
|
* SINCE HTTP/1.1
|
|
2866
3001
|
* The server is a transforming proxy that received a 200 OK from its origin,
|
|
2867
3002
|
* but is returning a modified version of the origin's response.
|
|
2868
3003
|
*/
|
|
2869
|
-
HttpStatusCode
|
|
3004
|
+
HttpStatusCode[HttpStatusCode["NON_AUTHORITATIVE_INFORMATION"] = 203] = "NON_AUTHORITATIVE_INFORMATION";
|
|
2870
3005
|
/**
|
|
2871
3006
|
* The server successfully processed the request and is not returning any content.
|
|
2872
3007
|
*/
|
|
2873
|
-
HttpStatusCode
|
|
3008
|
+
HttpStatusCode[HttpStatusCode["NO_CONTENT"] = 204] = "NO_CONTENT";
|
|
2874
3009
|
/**
|
|
2875
3010
|
* The server successfully processed the request, but is not returning any content.
|
|
2876
3011
|
* Unlike a 204 response, this response requires that the requester reset the document view.
|
|
2877
3012
|
*/
|
|
2878
|
-
HttpStatusCode
|
|
3013
|
+
HttpStatusCode[HttpStatusCode["RESET_CONTENT"] = 205] = "RESET_CONTENT";
|
|
2879
3014
|
/**
|
|
2880
3015
|
* The server is delivering only part of the resource (byte serving) due to a range header sent by the client.
|
|
2881
3016
|
* The range header is used by HTTP clients to enable resuming of interrupted downloads,
|
|
2882
3017
|
* or split a download into multiple simultaneous streams.
|
|
2883
3018
|
*/
|
|
2884
|
-
HttpStatusCode
|
|
3019
|
+
HttpStatusCode[HttpStatusCode["PARTIAL_CONTENT"] = 206] = "PARTIAL_CONTENT";
|
|
2885
3020
|
/**
|
|
2886
3021
|
* The message body that follows is an XML message and can contain a number of separate response codes,
|
|
2887
3022
|
* depending on how many sub-requests were made.
|
|
2888
3023
|
*/
|
|
2889
|
-
HttpStatusCode
|
|
3024
|
+
HttpStatusCode[HttpStatusCode["MULTI_STATUS"] = 207] = "MULTI_STATUS";
|
|
2890
3025
|
/**
|
|
2891
3026
|
* The members of a DAV binding have already been enumerated in a preceding part of the (multistatus) response,
|
|
2892
3027
|
* and are not being included again.
|
|
2893
3028
|
*/
|
|
2894
|
-
HttpStatusCode
|
|
3029
|
+
HttpStatusCode[HttpStatusCode["ALREADY_REPORTED"] = 208] = "ALREADY_REPORTED";
|
|
2895
3030
|
/**
|
|
2896
3031
|
* The server has fulfilled a request for the resource,
|
|
2897
3032
|
* and the response is a representation of the result of one or more instance-manipulations applied to the current instance.
|
|
2898
3033
|
*/
|
|
2899
|
-
HttpStatusCode
|
|
3034
|
+
HttpStatusCode[HttpStatusCode["IM_USED"] = 226] = "IM_USED";
|
|
2900
3035
|
/**
|
|
2901
3036
|
* Indicates multiple options for the resource from which the client may choose (via agent-driven content negotiation).
|
|
2902
3037
|
* For example, this code could be used to present multiple video format options,
|
|
2903
3038
|
* to list files with different filename extensions, or to suggest word-sense disambiguation.
|
|
2904
3039
|
*/
|
|
2905
|
-
HttpStatusCode
|
|
3040
|
+
HttpStatusCode[HttpStatusCode["MULTIPLE_CHOICES"] = 300] = "MULTIPLE_CHOICES";
|
|
2906
3041
|
/**
|
|
2907
3042
|
* This and all future requests should be directed to the given URI.
|
|
2908
3043
|
*/
|
|
2909
|
-
HttpStatusCode
|
|
3044
|
+
HttpStatusCode[HttpStatusCode["MOVED_PERMANENTLY"] = 301] = "MOVED_PERMANENTLY";
|
|
2910
3045
|
/**
|
|
2911
3046
|
* This is an example of industry practice contradicting the standard.
|
|
2912
3047
|
* The HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect
|
|
@@ -2915,31 +3050,31 @@ let HttpStatusCode = /* @__PURE__ */ function(HttpStatusCode$1) {
|
|
|
2915
3050
|
* to distinguish between the two behaviours. However, some Web applications and frameworks
|
|
2916
3051
|
* use the 302 status code as if it were the 303.
|
|
2917
3052
|
*/
|
|
2918
|
-
HttpStatusCode
|
|
3053
|
+
HttpStatusCode[HttpStatusCode["FOUND"] = 302] = "FOUND";
|
|
2919
3054
|
/**
|
|
2920
3055
|
* SINCE HTTP/1.1
|
|
2921
3056
|
* The response to the request can be found under another URI using a GET method.
|
|
2922
3057
|
* When received in response to a POST (or PUT/DELETE), the client should presume that
|
|
2923
3058
|
* the server has received the data and should issue a redirect with a separate GET message.
|
|
2924
3059
|
*/
|
|
2925
|
-
HttpStatusCode
|
|
3060
|
+
HttpStatusCode[HttpStatusCode["SEE_OTHER"] = 303] = "SEE_OTHER";
|
|
2926
3061
|
/**
|
|
2927
3062
|
* Indicates that the resource has not been modified since the version specified by the request headers
|
|
2928
3063
|
* If-Modified-Since or If-None-Match.
|
|
2929
3064
|
* In such case, there is no need to retransmit the resource since the client still has a previously-downloaded copy.
|
|
2930
3065
|
*/
|
|
2931
|
-
HttpStatusCode
|
|
3066
|
+
HttpStatusCode[HttpStatusCode["NOT_MODIFIED"] = 304] = "NOT_MODIFIED";
|
|
2932
3067
|
/**
|
|
2933
3068
|
* SINCE HTTP/1.1
|
|
2934
3069
|
* The requested resource is available only through a proxy, the address for which is provided in the response.
|
|
2935
3070
|
* Many HTTP clients (such as Mozilla and Internet Explorer) do not correctly handle responses with this status code,
|
|
2936
3071
|
* primarily for security reasons.
|
|
2937
3072
|
*/
|
|
2938
|
-
HttpStatusCode
|
|
3073
|
+
HttpStatusCode[HttpStatusCode["USE_PROXY"] = 305] = "USE_PROXY";
|
|
2939
3074
|
/**
|
|
2940
3075
|
* No longer used. Originally meant "Subsequent requests should use the specified proxy."
|
|
2941
3076
|
*/
|
|
2942
|
-
HttpStatusCode
|
|
3077
|
+
HttpStatusCode[HttpStatusCode["SWITCH_PROXY"] = 306] = "SWITCH_PROXY";
|
|
2943
3078
|
/**
|
|
2944
3079
|
* SINCE HTTP/1.1
|
|
2945
3080
|
* In this case, the request should be repeated with another URI; however, future requests should still use the original URI.
|
|
@@ -2947,67 +3082,67 @@ let HttpStatusCode = /* @__PURE__ */ function(HttpStatusCode$1) {
|
|
|
2947
3082
|
* the original request.
|
|
2948
3083
|
* For example, a POST request should be repeated using another POST request.
|
|
2949
3084
|
*/
|
|
2950
|
-
HttpStatusCode
|
|
3085
|
+
HttpStatusCode[HttpStatusCode["TEMPORARY_REDIRECT"] = 307] = "TEMPORARY_REDIRECT";
|
|
2951
3086
|
/**
|
|
2952
3087
|
* The request and all future requests should be repeated using another URI.
|
|
2953
3088
|
* 307 and 308 parallel the behaviors of 302 and 301, but do not allow the HTTP method to change.
|
|
2954
3089
|
* So, for example, submitting a form to a permanently redirected resource may continue smoothly.
|
|
2955
3090
|
*/
|
|
2956
|
-
HttpStatusCode
|
|
3091
|
+
HttpStatusCode[HttpStatusCode["PERMANENT_REDIRECT"] = 308] = "PERMANENT_REDIRECT";
|
|
2957
3092
|
/**
|
|
2958
3093
|
* The server cannot or will not process the request due to an apparent client error
|
|
2959
3094
|
* (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).
|
|
2960
3095
|
*/
|
|
2961
|
-
HttpStatusCode
|
|
3096
|
+
HttpStatusCode[HttpStatusCode["BAD_REQUEST"] = 400] = "BAD_REQUEST";
|
|
2962
3097
|
/**
|
|
2963
3098
|
* Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet
|
|
2964
3099
|
* been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the
|
|
2965
3100
|
* requested resource. See Basic access authentication and Digest access authentication. 401 semantically means
|
|
2966
3101
|
* "unauthenticated",i.e. the user does not have the necessary credentials.
|
|
2967
3102
|
*/
|
|
2968
|
-
HttpStatusCode
|
|
3103
|
+
HttpStatusCode[HttpStatusCode["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
|
|
2969
3104
|
/**
|
|
2970
3105
|
* Reserved for future use. The original intention was that this code might be used as part of some form of digital
|
|
2971
3106
|
* cash or micro payment scheme, but that has not happened, and this code is not usually used.
|
|
2972
3107
|
* Google Developers API uses this status if a particular developer has exceeded the daily limit on requests.
|
|
2973
3108
|
*/
|
|
2974
|
-
HttpStatusCode
|
|
3109
|
+
HttpStatusCode[HttpStatusCode["PAYMENT_REQUIRED"] = 402] = "PAYMENT_REQUIRED";
|
|
2975
3110
|
/**
|
|
2976
3111
|
* The request was valid, but the server is refusing action.
|
|
2977
3112
|
* The user might not have the necessary permissions for a resource.
|
|
2978
3113
|
*/
|
|
2979
|
-
HttpStatusCode
|
|
3114
|
+
HttpStatusCode[HttpStatusCode["FORBIDDEN"] = 403] = "FORBIDDEN";
|
|
2980
3115
|
/**
|
|
2981
3116
|
* The requested resource could not be found but may be available in the future.
|
|
2982
3117
|
* Subsequent requests by the client are permissible.
|
|
2983
3118
|
*/
|
|
2984
|
-
HttpStatusCode
|
|
3119
|
+
HttpStatusCode[HttpStatusCode["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
2985
3120
|
/**
|
|
2986
3121
|
* A request method is not supported for the requested resource;
|
|
2987
3122
|
* for example, a GET request on a form that requires data to be presented via POST, or a PUT request on a read-only resource.
|
|
2988
3123
|
*/
|
|
2989
|
-
HttpStatusCode
|
|
3124
|
+
HttpStatusCode[HttpStatusCode["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
|
|
2990
3125
|
/**
|
|
2991
3126
|
* The requested resource is capable of generating only content not acceptable according to the Accept
|
|
2992
3127
|
* headers sent in the request.
|
|
2993
3128
|
*/
|
|
2994
|
-
HttpStatusCode
|
|
3129
|
+
HttpStatusCode[HttpStatusCode["NOT_ACCEPTABLE"] = 406] = "NOT_ACCEPTABLE";
|
|
2995
3130
|
/**
|
|
2996
3131
|
* The client must first authenticate itself with the proxy.
|
|
2997
3132
|
*/
|
|
2998
|
-
HttpStatusCode
|
|
3133
|
+
HttpStatusCode[HttpStatusCode["PROXY_AUTHENTICATION_REQUIRED"] = 407] = "PROXY_AUTHENTICATION_REQUIRED";
|
|
2999
3134
|
/**
|
|
3000
3135
|
* The server timed out waiting for the request.
|
|
3001
3136
|
* According to HTTP specifications:
|
|
3002
3137
|
* "The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat
|
|
3003
3138
|
* the request without modifications at any later time."
|
|
3004
3139
|
*/
|
|
3005
|
-
HttpStatusCode
|
|
3140
|
+
HttpStatusCode[HttpStatusCode["REQUEST_TIMEOUT"] = 408] = "REQUEST_TIMEOUT";
|
|
3006
3141
|
/**
|
|
3007
3142
|
* Indicates that the request could not be processed because of conflict in the request,
|
|
3008
3143
|
* such as an edit conflict between multiple simultaneous updates.
|
|
3009
3144
|
*/
|
|
3010
|
-
HttpStatusCode
|
|
3145
|
+
HttpStatusCode[HttpStatusCode["CONFLICT"] = 409] = "CONFLICT";
|
|
3011
3146
|
/**
|
|
3012
3147
|
* Indicates that the resource requested is no longer available and will not be available again.
|
|
3013
3148
|
* This should be used when a resource has been intentionally removed and the resource should be purged.
|
|
@@ -3015,139 +3150,139 @@ let HttpStatusCode = /* @__PURE__ */ function(HttpStatusCode$1) {
|
|
|
3015
3150
|
* Clients such as search engines should remove the resource from their indices.
|
|
3016
3151
|
* Most use cases do not require clients and search engines to purge the resource, and a "404 Not Found" may be used instead.
|
|
3017
3152
|
*/
|
|
3018
|
-
HttpStatusCode
|
|
3153
|
+
HttpStatusCode[HttpStatusCode["GONE"] = 410] = "GONE";
|
|
3019
3154
|
/**
|
|
3020
3155
|
* The request did not specify the length of its content, which is required by the requested resource.
|
|
3021
3156
|
*/
|
|
3022
|
-
HttpStatusCode
|
|
3157
|
+
HttpStatusCode[HttpStatusCode["LENGTH_REQUIRED"] = 411] = "LENGTH_REQUIRED";
|
|
3023
3158
|
/**
|
|
3024
3159
|
* The server does not meet one of the preconditions that the requester put on the request.
|
|
3025
3160
|
*/
|
|
3026
|
-
HttpStatusCode
|
|
3161
|
+
HttpStatusCode[HttpStatusCode["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
|
|
3027
3162
|
/**
|
|
3028
3163
|
* The request is larger than the server is willing or able to process. Previously called "Request Entity Too Large".
|
|
3029
3164
|
*/
|
|
3030
|
-
HttpStatusCode
|
|
3165
|
+
HttpStatusCode[HttpStatusCode["PAYLOAD_TOO_LARGE"] = 413] = "PAYLOAD_TOO_LARGE";
|
|
3031
3166
|
/**
|
|
3032
3167
|
* The URI provided was too long for the server to process. Often the result of too much data being encoded
|
|
3033
3168
|
* as a query-string of a GET request,
|
|
3034
3169
|
* in which case it should be converted to a POST request.
|
|
3035
3170
|
* Called "Request-URI Too Long" previously.
|
|
3036
3171
|
*/
|
|
3037
|
-
HttpStatusCode
|
|
3172
|
+
HttpStatusCode[HttpStatusCode["URI_TOO_LONG"] = 414] = "URI_TOO_LONG";
|
|
3038
3173
|
/**
|
|
3039
3174
|
* The request entity has a media type which the server or resource does not support.
|
|
3040
3175
|
* For example, the client uploads an image as image/svg+xml, but the server requires that images use a different format.
|
|
3041
3176
|
*/
|
|
3042
|
-
HttpStatusCode
|
|
3177
|
+
HttpStatusCode[HttpStatusCode["UNSUPPORTED_MEDIA_TYPE"] = 415] = "UNSUPPORTED_MEDIA_TYPE";
|
|
3043
3178
|
/**
|
|
3044
3179
|
* The client has asked for a portion of the file (byte serving), but the server cannot supply that portion.
|
|
3045
3180
|
* For example, if the client asked for a part of the file that lies beyond the end of the file.
|
|
3046
3181
|
* Called "Requested Range Not Satisfiable" previously.
|
|
3047
3182
|
*/
|
|
3048
|
-
HttpStatusCode
|
|
3183
|
+
HttpStatusCode[HttpStatusCode["RANGE_NOT_SATISFIABLE"] = 416] = "RANGE_NOT_SATISFIABLE";
|
|
3049
3184
|
/**
|
|
3050
3185
|
* The server cannot meet the requirements of the Expect request-header field.
|
|
3051
3186
|
*/
|
|
3052
|
-
HttpStatusCode
|
|
3187
|
+
HttpStatusCode[HttpStatusCode["EXPECTATION_FAILED"] = 417] = "EXPECTATION_FAILED";
|
|
3053
3188
|
/**
|
|
3054
3189
|
* This code was defined in 1998 as one of the traditional IETF April Fools' jokes, in RFC 2324,
|
|
3055
3190
|
* Hyper Text Coffee Pot Control Protocol,
|
|
3056
3191
|
* and is not expected to be implemented by actual HTTP servers. The RFC specifies this code should be returned by
|
|
3057
3192
|
* teapots requested to brew coffee. This HTTP status is used as an Easter egg in some websites, including Google.com.
|
|
3058
3193
|
*/
|
|
3059
|
-
HttpStatusCode
|
|
3194
|
+
HttpStatusCode[HttpStatusCode["I_AM_A_TEAPOT"] = 418] = "I_AM_A_TEAPOT";
|
|
3060
3195
|
/**
|
|
3061
3196
|
* The request was directed at a server that is not able to produce a response (for example because a connection reuse).
|
|
3062
3197
|
*/
|
|
3063
|
-
HttpStatusCode
|
|
3198
|
+
HttpStatusCode[HttpStatusCode["MISDIRECTED_REQUEST"] = 421] = "MISDIRECTED_REQUEST";
|
|
3064
3199
|
/**
|
|
3065
3200
|
* The request was well-formed but was unable to be followed due to semantic errors.
|
|
3066
3201
|
*/
|
|
3067
|
-
HttpStatusCode
|
|
3202
|
+
HttpStatusCode[HttpStatusCode["UNPROCESSABLE_ENTITY"] = 422] = "UNPROCESSABLE_ENTITY";
|
|
3068
3203
|
/**
|
|
3069
3204
|
* The resource that is being accessed is locked.
|
|
3070
3205
|
*/
|
|
3071
|
-
HttpStatusCode
|
|
3206
|
+
HttpStatusCode[HttpStatusCode["LOCKED"] = 423] = "LOCKED";
|
|
3072
3207
|
/**
|
|
3073
3208
|
* The request failed due to failure of a previous request (e.g., a PROPPATCH).
|
|
3074
3209
|
*/
|
|
3075
|
-
HttpStatusCode
|
|
3210
|
+
HttpStatusCode[HttpStatusCode["FAILED_DEPENDENCY"] = 424] = "FAILED_DEPENDENCY";
|
|
3076
3211
|
/**
|
|
3077
3212
|
* The client should switch to a different protocol such as TLS/1.0, given in the Upgrade header field.
|
|
3078
3213
|
*/
|
|
3079
|
-
HttpStatusCode
|
|
3214
|
+
HttpStatusCode[HttpStatusCode["UPGRADE_REQUIRED"] = 426] = "UPGRADE_REQUIRED";
|
|
3080
3215
|
/**
|
|
3081
3216
|
* The origin server requires the request to be conditional.
|
|
3082
3217
|
* Intended to prevent "the 'lost update' problem, where a client
|
|
3083
3218
|
* GETs a resource's state, modifies it, and PUTs it back to the server,
|
|
3084
3219
|
* when meanwhile a third party has modified the state on the server, leading to a conflict."
|
|
3085
3220
|
*/
|
|
3086
|
-
HttpStatusCode
|
|
3221
|
+
HttpStatusCode[HttpStatusCode["PRECONDITION_REQUIRED"] = 428] = "PRECONDITION_REQUIRED";
|
|
3087
3222
|
/**
|
|
3088
3223
|
* The user has sent too many requests in a given amount of time. Intended for use with rate-limiting schemes.
|
|
3089
3224
|
*/
|
|
3090
|
-
HttpStatusCode
|
|
3225
|
+
HttpStatusCode[HttpStatusCode["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
|
|
3091
3226
|
/**
|
|
3092
3227
|
* The server is unwilling to process the request because either an individual header field,
|
|
3093
3228
|
* or all the header fields collectively, are too large.
|
|
3094
3229
|
*/
|
|
3095
|
-
HttpStatusCode
|
|
3230
|
+
HttpStatusCode[HttpStatusCode["REQUEST_HEADER_FIELDS_TOO_LARGE"] = 431] = "REQUEST_HEADER_FIELDS_TOO_LARGE";
|
|
3096
3231
|
/**
|
|
3097
3232
|
* A server operator has received a legal demand to deny access to a resource or to a set of resources
|
|
3098
3233
|
* that includes the requested resource. The code 451 was chosen as a reference to the novel Fahrenheit 451.
|
|
3099
3234
|
*/
|
|
3100
|
-
HttpStatusCode
|
|
3235
|
+
HttpStatusCode[HttpStatusCode["UNAVAILABLE_FOR_LEGAL_REASONS"] = 451] = "UNAVAILABLE_FOR_LEGAL_REASONS";
|
|
3101
3236
|
/**
|
|
3102
3237
|
* A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.
|
|
3103
3238
|
*/
|
|
3104
|
-
HttpStatusCode
|
|
3239
|
+
HttpStatusCode[HttpStatusCode["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
|
|
3105
3240
|
/**
|
|
3106
3241
|
* The server either does not recognize the request method, or it lacks the ability to fulfill the request.
|
|
3107
3242
|
* Usually this implies future availability (e.g., a new feature of a web-service API).
|
|
3108
3243
|
*/
|
|
3109
|
-
HttpStatusCode
|
|
3244
|
+
HttpStatusCode[HttpStatusCode["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
|
|
3110
3245
|
/**
|
|
3111
3246
|
* The server was acting as a gateway or proxy and received an invalid response from the upstream server.
|
|
3112
3247
|
*/
|
|
3113
|
-
HttpStatusCode
|
|
3248
|
+
HttpStatusCode[HttpStatusCode["BAD_GATEWAY"] = 502] = "BAD_GATEWAY";
|
|
3114
3249
|
/**
|
|
3115
3250
|
* The server is currently unavailable (because it is overloaded or down for maintenance).
|
|
3116
3251
|
* Generally, this is a temporary state.
|
|
3117
3252
|
*/
|
|
3118
|
-
HttpStatusCode
|
|
3253
|
+
HttpStatusCode[HttpStatusCode["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
|
|
3119
3254
|
/**
|
|
3120
3255
|
* The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
|
|
3121
3256
|
*/
|
|
3122
|
-
HttpStatusCode
|
|
3257
|
+
HttpStatusCode[HttpStatusCode["GATEWAY_TIMEOUT"] = 504] = "GATEWAY_TIMEOUT";
|
|
3123
3258
|
/**
|
|
3124
3259
|
* The server does not support the HTTP protocol version used in the request
|
|
3125
3260
|
*/
|
|
3126
|
-
HttpStatusCode
|
|
3261
|
+
HttpStatusCode[HttpStatusCode["HTTP_VERSION_NOT_SUPPORTED"] = 505] = "HTTP_VERSION_NOT_SUPPORTED";
|
|
3127
3262
|
/**
|
|
3128
3263
|
* Transparent content negotiation for the request results in a circular reference.
|
|
3129
3264
|
*/
|
|
3130
|
-
HttpStatusCode
|
|
3265
|
+
HttpStatusCode[HttpStatusCode["VARIANT_ALSO_NEGOTIATES"] = 506] = "VARIANT_ALSO_NEGOTIATES";
|
|
3131
3266
|
/**
|
|
3132
3267
|
* The server is unable to store the representation needed to complete the request.
|
|
3133
3268
|
*/
|
|
3134
|
-
HttpStatusCode
|
|
3269
|
+
HttpStatusCode[HttpStatusCode["INSUFFICIENT_STORAGE"] = 507] = "INSUFFICIENT_STORAGE";
|
|
3135
3270
|
/**
|
|
3136
3271
|
* The server detected an infinite loop while processing the request.
|
|
3137
3272
|
*/
|
|
3138
|
-
HttpStatusCode
|
|
3273
|
+
HttpStatusCode[HttpStatusCode["LOOP_DETECTED"] = 508] = "LOOP_DETECTED";
|
|
3139
3274
|
/**
|
|
3140
3275
|
* Further extensions to the request are required for the server to fulfill it.
|
|
3141
3276
|
*/
|
|
3142
|
-
HttpStatusCode
|
|
3277
|
+
HttpStatusCode[HttpStatusCode["NOT_EXTENDED"] = 510] = "NOT_EXTENDED";
|
|
3143
3278
|
/**
|
|
3144
3279
|
* The client needs to authenticate to gain network access.
|
|
3145
3280
|
* Intended for use by intercepting proxies used to control access to the network (e.g., "captive portals" used
|
|
3146
3281
|
* to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot).
|
|
3147
3282
|
*/
|
|
3148
|
-
HttpStatusCode
|
|
3149
|
-
return HttpStatusCode
|
|
3283
|
+
HttpStatusCode[HttpStatusCode["NETWORK_AUTHENTICATION_REQUIRED"] = 511] = "NETWORK_AUTHENTICATION_REQUIRED";
|
|
3284
|
+
return HttpStatusCode;
|
|
3150
3285
|
}({});
|
|
3151
3286
|
|
|
3152
3287
|
//#endregion
|
|
3153
|
-
export { App, BadRequestError, BaseMiddleware, BasePlugin, Body, Connect, Controller, Delete, ErrorHandlerProvider, FastResponse, ForbiddenError, Get, GlobalMiddlewareRegistry, HTTPStatus, Head, Header, Headers$1 as Headers, HooksService, HttpError, HttpServer, HttpStatusCode, InternalServerError, Listen, MetadataResolver, MethodNotAllowedError, Middleware, MultipartFormData, NotAcceptableError, NotFoundError, Options, Param, Patch, Post, Put, QueryParam, QueryParams, Redirect, Request, RequestContext, Response$1 as Response, Router, RuntimeConfig, SetHeader, StandardSchemaValidationProvider, Status, Trace, UnauthorizedError, ValidationProvider, createApp, createMetadataCtx, createMetadataMethod, defineConfig, initializeMetadata, initializeMetadataMethod, loadVercubeConfig };
|
|
3288
|
+
export { App, BadRequestError, BaseMiddleware, BasePlugin, Body, Connect, Controller, DANGEROUS_PROPERTIES, Delete, ErrorHandlerProvider, FastResponse, ForbiddenError, Get, GlobalMiddlewareRegistry, HTTPStatus, Head, Header, Headers$1 as Headers, HooksService, HttpError, HttpServer, HttpStatusCode, InternalServerError, Listen, MetadataResolver, MethodNotAllowedError, Middleware, MultipartFormData, NotAcceptableError, NotFoundError, Options, Param, Patch, Post, Put, QueryParam, QueryParams, Redirect, Request, RequestContext, Response$1 as Response, Router, RuntimeConfig, SetHeader, StandardSchemaValidationProvider, Status, Trace, UnauthorizedError, ValidationProvider, createApp, createMetadataCtx, createMetadataMethod, defineConfig, initializeMetadata, initializeMetadataMethod, isSafeProperty, loadVercubeConfig, safeAssign, safeJsonParse, sanitizeObject, secureReviver };
|