@fishka/express 0.9.7 → 0.9.8

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.
@@ -36,7 +36,7 @@ export declare class HttpError extends Error {
36
36
  * @see {@link HTTP_FORBIDDEN}
37
37
  * @see {@link HTTP_UNAUTHORIZED}
38
38
  */
39
- export declare function assertHttp(condition: boolean, status: number, message: string): void;
39
+ export declare function assertHttp(condition: boolean, status: number, message: string): asserts condition;
40
40
  export interface ApiResponse<ResponseEntity = unknown> {
41
41
  /** Result of the call. A single entity for non-paginated ${by-id} requests or an array for list queries. */
42
42
  result: ResponseEntity;
@@ -80,95 +80,6 @@ export declare const HTTP_BAD_GATEWAY = 502;
80
80
  export declare const HTTP_SERVICE_UNAVAILABLE = 503;
81
81
  /** The server, while acting as a gateway or proxy, did not get a response in time from the upstream server (504) */
82
82
  export declare const HTTP_GATEWAY_TIMEOUT = 504;
83
- /**
84
- * An object containing common HTTP status codes.
85
- * These constants can be used to improve code readability and maintainability.
86
- * @deprecated Use individual HTTP_* constants for better tree-shaking
87
- */
88
- export declare const HttpStatusCode: {
89
- /** The request has succeeded (200) */
90
- OK: number;
91
- /** The request has been fulfilled, and a new resource is created (201) */
92
- CREATED: number;
93
- /** The request has been accepted for processing, but the processing is not yet complete (202) */
94
- ACCEPTED: number;
95
- /** The server successfully processed the request, and is not returning any content (204) */
96
- NO_CONTENT: number;
97
- /** The request has been successfully processed, but is returning no content (205) */
98
- RESET_CONTENT: number;
99
- /** The server is delivering only part of the resource due to a range header sent by the client (206) */
100
- PARTIAL_CONTENT: number;
101
- /** The IM used the server processed a request successfully, but the response is transformed (226) */
102
- IM_USED: number;
103
- /** The resource has been moved permanently to a new URL (301) */
104
- MOVED_PERMANENTLY: number;
105
- /** The resource is available at a different URL (302) */
106
- FOUND: number;
107
- /** The resource has not been modified since the last request (304) */
108
- NOT_MODIFIED: number;
109
- /** The server could not understand the request due to invalid syntax (400) */
110
- BAD_REQUEST: number;
111
- /** The client must authenticate itself to get the requested response (401) */
112
- UNAUTHORIZED: number;
113
- /** The client does not have access rights to the content (403) */
114
- FORBIDDEN: number;
115
- /** The server cannot find the requested resource (404) */
116
- NOT_FOUND: number;
117
- /** The request method is known by the server but is not supported by the target resource (405) */
118
- METHOD_NOT_ALLOWED: number;
119
- /** The client must authenticate using a proxy (407) */
120
- PROXY_AUTHENTICATION_REQUIRED: number;
121
- /** The server timed out waiting for the request (408) */
122
- REQUEST_TIMEOUT: number;
123
- /** The request conflicts with the current state of the server (409) */
124
- CONFLICT: number;
125
- /** The resource requested is no longer available and will not be available again (410) */
126
- GONE: number;
127
- /** The request does not meet the preconditions that the server requires (412) */
128
- PRECONDITION_FAILED: number;
129
- /** The client sent a request that is too large for the server to process (413) */
130
- PAYLOAD_TOO_LARGE: number;
131
- /** The URI requested by the client is too long for the server to process (414) */
132
- URI_TOO_LONG: number;
133
- /** The media format of the requested data is not supported by the server (415) */
134
- UNSUPPORTED_MEDIA_TYPE: number;
135
- /** The range specified by the client cannot be fulfilled (416) */
136
- RANGE_NOT_SATISFIABLE: number;
137
- /** The expectation given in the request header could not be met by the server (417) */
138
- EXPECTATION_FAILED: number;
139
- /** The server refuses to brew coffee because it is a teapot (418) - an Easter egg from RFC 2324 */
140
- IM_A_TEAPOT: number;
141
- /** The request was well-formed but was unable to be followed due to semantic errors (422) */
142
- UNPROCESSABLE_ENTITY: number;
143
- /** The resource that is being accessed is locked (423) */
144
- LOCKED: number;
145
- /** The resource requested is dependent on another resource that has failed (424) */
146
- FAILED_DEPENDENCY: number;
147
- /** The server is unwilling to risk processing a request that might be replayed (425) */
148
- TOO_EARLY: number;
149
- /** The client needs to upgrade its protocol (426) */
150
- UPGRADE_REQUIRED: number;
151
- /** The server requires the request to be conditional (428) */
152
- PRECONDITION_REQUIRED: number;
153
- /** The client has sent too many requests in a given amount of time (429) */
154
- TOO_MANY_REQUESTS: number;
155
- /** The request header fields are too large (431) */
156
- REQUEST_HEADER_FIELDS_TOO_LARGE: number;
157
- /** The client closed the connection with the server before the request was completed (444) */
158
- CONNECTION_CLOSED_WITHOUT_RESPONSE: number;
159
- /** The client requested an unavailable legal action (451) */
160
- UNAVAILABLE_FOR_LEGAL_REASONS: number;
161
- /** The server encountered an internal error and was unable to complete the request (500) */
162
- INTERNAL_SERVER_ERROR: number;
163
- /** The request method is not supported by the server and cannot be handled (501) */
164
- NOT_IMPLEMENTED: number;
165
- /** The server, while acting as a gateway or proxy, received an invalid response from the upstream server (502) */
166
- BAD_GATEWAY: number;
167
- /** The server is not ready to handle the request, typically due to temporary overload or maintenance (503) */
168
- SERVICE_UNAVAILABLE: number;
169
- /** The server, while acting as a gateway or proxy, did not get a response in time from the upstream server (504) */
170
- GATEWAY_TIMEOUT: number;
171
- };
172
83
  /**
173
84
  * Returns the reason phrase corresponding to the given HTTP status code.
174
85
  * This is useful for converting status codes into human-readable messages.
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
+ // noinspection JSUnusedGlobalSymbols
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getHttpStatusCodeReasonPhrase = exports.HttpStatusCode = exports.HTTP_GATEWAY_TIMEOUT = exports.HTTP_SERVICE_UNAVAILABLE = exports.HTTP_BAD_GATEWAY = exports.HTTP_NOT_IMPLEMENTED = exports.HTTP_INTERNAL_SERVER_ERROR = exports.HTTP_UNAVAILABLE_FOR_LEGAL_REASONS = exports.HTTP_CONNECTION_CLOSED_WITHOUT_RESPONSE = exports.HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = exports.HTTP_TOO_MANY_REQUESTS = exports.HTTP_PRECONDITION_REQUIRED = exports.HTTP_UPGRADE_REQUIRED = exports.HTTP_TOO_EARLY = exports.HTTP_FAILED_DEPENDENCY = exports.HTTP_LOCKED = exports.HTTP_UNPROCESSABLE_ENTITY = exports.HTTP_IM_A_TEAPOT = exports.HTTP_EXPECTATION_FAILED = exports.HTTP_RANGE_NOT_SATISFIABLE = exports.HTTP_UNSUPPORTED_MEDIA_TYPE = exports.HTTP_URI_TOO_LONG = exports.HTTP_PAYLOAD_TOO_LARGE = exports.HTTP_PRECONDITION_FAILED = exports.HTTP_GONE = exports.HTTP_CONFLICT = exports.HTTP_REQUEST_TIMEOUT = exports.HTTP_PROXY_AUTHENTICATION_REQUIRED = exports.HTTP_METHOD_NOT_ALLOWED = exports.HTTP_NOT_FOUND = exports.HTTP_FORBIDDEN = exports.HTTP_UNAUTHORIZED = exports.HTTP_BAD_REQUEST = exports.HTTP_NOT_MODIFIED = exports.HTTP_FOUND = exports.HTTP_MOVED_PERMANENTLY = exports.HTTP_IM_USED = exports.HTTP_PARTIAL_CONTENT = exports.HTTP_RESET_CONTENT = exports.HTTP_NO_CONTENT = exports.HTTP_ACCEPTED = exports.HTTP_CREATED = exports.HTTP_OK = void 0;
4
+ exports.getHttpStatusCodeReasonPhrase = exports.HTTP_GATEWAY_TIMEOUT = exports.HTTP_SERVICE_UNAVAILABLE = exports.HTTP_BAD_GATEWAY = exports.HTTP_NOT_IMPLEMENTED = exports.HTTP_INTERNAL_SERVER_ERROR = exports.HTTP_UNAVAILABLE_FOR_LEGAL_REASONS = exports.HTTP_CONNECTION_CLOSED_WITHOUT_RESPONSE = exports.HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = exports.HTTP_TOO_MANY_REQUESTS = exports.HTTP_PRECONDITION_REQUIRED = exports.HTTP_UPGRADE_REQUIRED = exports.HTTP_TOO_EARLY = exports.HTTP_FAILED_DEPENDENCY = exports.HTTP_LOCKED = exports.HTTP_UNPROCESSABLE_ENTITY = exports.HTTP_IM_A_TEAPOT = exports.HTTP_EXPECTATION_FAILED = exports.HTTP_RANGE_NOT_SATISFIABLE = exports.HTTP_UNSUPPORTED_MEDIA_TYPE = exports.HTTP_URI_TOO_LONG = exports.HTTP_PAYLOAD_TOO_LARGE = exports.HTTP_PRECONDITION_FAILED = exports.HTTP_GONE = exports.HTTP_CONFLICT = exports.HTTP_REQUEST_TIMEOUT = exports.HTTP_PROXY_AUTHENTICATION_REQUIRED = exports.HTTP_METHOD_NOT_ALLOWED = exports.HTTP_NOT_FOUND = exports.HTTP_FORBIDDEN = exports.HTTP_UNAUTHORIZED = exports.HTTP_BAD_REQUEST = exports.HTTP_NOT_MODIFIED = exports.HTTP_FOUND = exports.HTTP_MOVED_PERMANENTLY = exports.HTTP_IM_USED = exports.HTTP_PARTIAL_CONTENT = exports.HTTP_RESET_CONTENT = exports.HTTP_NO_CONTENT = exports.HTTP_ACCEPTED = exports.HTTP_CREATED = exports.HTTP_OK = void 0;
4
5
  /** The request has succeeded (200) */
5
6
  exports.HTTP_OK = 200;
6
7
  /** The request has been fulfilled, and a new resource is created (201) */
@@ -83,95 +84,6 @@ exports.HTTP_BAD_GATEWAY = 502;
83
84
  exports.HTTP_SERVICE_UNAVAILABLE = 503;
84
85
  /** The server, while acting as a gateway or proxy, did not get a response in time from the upstream server (504) */
85
86
  exports.HTTP_GATEWAY_TIMEOUT = 504;
86
- /**
87
- * An object containing common HTTP status codes.
88
- * These constants can be used to improve code readability and maintainability.
89
- * @deprecated Use individual HTTP_* constants for better tree-shaking
90
- */
91
- exports.HttpStatusCode = {
92
- /** The request has succeeded (200) */
93
- OK: exports.HTTP_OK,
94
- /** The request has been fulfilled, and a new resource is created (201) */
95
- CREATED: exports.HTTP_CREATED,
96
- /** The request has been accepted for processing, but the processing is not yet complete (202) */
97
- ACCEPTED: exports.HTTP_ACCEPTED,
98
- /** The server successfully processed the request, and is not returning any content (204) */
99
- NO_CONTENT: exports.HTTP_NO_CONTENT,
100
- /** The request has been successfully processed, but is returning no content (205) */
101
- RESET_CONTENT: exports.HTTP_RESET_CONTENT,
102
- /** The server is delivering only part of the resource due to a range header sent by the client (206) */
103
- PARTIAL_CONTENT: exports.HTTP_PARTIAL_CONTENT,
104
- /** The IM used the server processed a request successfully, but the response is transformed (226) */
105
- IM_USED: exports.HTTP_IM_USED,
106
- /** The resource has been moved permanently to a new URL (301) */
107
- MOVED_PERMANENTLY: exports.HTTP_MOVED_PERMANENTLY,
108
- /** The resource is available at a different URL (302) */
109
- FOUND: exports.HTTP_FOUND,
110
- /** The resource has not been modified since the last request (304) */
111
- NOT_MODIFIED: exports.HTTP_NOT_MODIFIED,
112
- /** The server could not understand the request due to invalid syntax (400) */
113
- BAD_REQUEST: exports.HTTP_BAD_REQUEST,
114
- /** The client must authenticate itself to get the requested response (401) */
115
- UNAUTHORIZED: exports.HTTP_UNAUTHORIZED,
116
- /** The client does not have access rights to the content (403) */
117
- FORBIDDEN: exports.HTTP_FORBIDDEN,
118
- /** The server cannot find the requested resource (404) */
119
- NOT_FOUND: exports.HTTP_NOT_FOUND,
120
- /** The request method is known by the server but is not supported by the target resource (405) */
121
- METHOD_NOT_ALLOWED: exports.HTTP_METHOD_NOT_ALLOWED,
122
- /** The client must authenticate using a proxy (407) */
123
- PROXY_AUTHENTICATION_REQUIRED: exports.HTTP_PROXY_AUTHENTICATION_REQUIRED,
124
- /** The server timed out waiting for the request (408) */
125
- REQUEST_TIMEOUT: exports.HTTP_REQUEST_TIMEOUT,
126
- /** The request conflicts with the current state of the server (409) */
127
- CONFLICT: exports.HTTP_CONFLICT,
128
- /** The resource requested is no longer available and will not be available again (410) */
129
- GONE: exports.HTTP_GONE,
130
- /** The request does not meet the preconditions that the server requires (412) */
131
- PRECONDITION_FAILED: exports.HTTP_PRECONDITION_FAILED,
132
- /** The client sent a request that is too large for the server to process (413) */
133
- PAYLOAD_TOO_LARGE: exports.HTTP_PAYLOAD_TOO_LARGE,
134
- /** The URI requested by the client is too long for the server to process (414) */
135
- URI_TOO_LONG: exports.HTTP_URI_TOO_LONG,
136
- /** The media format of the requested data is not supported by the server (415) */
137
- UNSUPPORTED_MEDIA_TYPE: exports.HTTP_UNSUPPORTED_MEDIA_TYPE,
138
- /** The range specified by the client cannot be fulfilled (416) */
139
- RANGE_NOT_SATISFIABLE: exports.HTTP_RANGE_NOT_SATISFIABLE,
140
- /** The expectation given in the request header could not be met by the server (417) */
141
- EXPECTATION_FAILED: exports.HTTP_EXPECTATION_FAILED,
142
- /** The server refuses to brew coffee because it is a teapot (418) - an Easter egg from RFC 2324 */
143
- IM_A_TEAPOT: exports.HTTP_IM_A_TEAPOT,
144
- /** The request was well-formed but was unable to be followed due to semantic errors (422) */
145
- UNPROCESSABLE_ENTITY: exports.HTTP_UNPROCESSABLE_ENTITY,
146
- /** The resource that is being accessed is locked (423) */
147
- LOCKED: exports.HTTP_LOCKED,
148
- /** The resource requested is dependent on another resource that has failed (424) */
149
- FAILED_DEPENDENCY: exports.HTTP_FAILED_DEPENDENCY,
150
- /** The server is unwilling to risk processing a request that might be replayed (425) */
151
- TOO_EARLY: exports.HTTP_TOO_EARLY,
152
- /** The client needs to upgrade its protocol (426) */
153
- UPGRADE_REQUIRED: exports.HTTP_UPGRADE_REQUIRED,
154
- /** The server requires the request to be conditional (428) */
155
- PRECONDITION_REQUIRED: exports.HTTP_PRECONDITION_REQUIRED,
156
- /** The client has sent too many requests in a given amount of time (429) */
157
- TOO_MANY_REQUESTS: exports.HTTP_TOO_MANY_REQUESTS,
158
- /** The request header fields are too large (431) */
159
- REQUEST_HEADER_FIELDS_TOO_LARGE: exports.HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE,
160
- /** The client closed the connection with the server before the request was completed (444) */
161
- CONNECTION_CLOSED_WITHOUT_RESPONSE: exports.HTTP_CONNECTION_CLOSED_WITHOUT_RESPONSE,
162
- /** The client requested an unavailable legal action (451) */
163
- UNAVAILABLE_FOR_LEGAL_REASONS: exports.HTTP_UNAVAILABLE_FOR_LEGAL_REASONS,
164
- /** The server encountered an internal error and was unable to complete the request (500) */
165
- INTERNAL_SERVER_ERROR: exports.HTTP_INTERNAL_SERVER_ERROR,
166
- /** The request method is not supported by the server and cannot be handled (501) */
167
- NOT_IMPLEMENTED: exports.HTTP_NOT_IMPLEMENTED,
168
- /** The server, while acting as a gateway or proxy, received an invalid response from the upstream server (502) */
169
- BAD_GATEWAY: exports.HTTP_BAD_GATEWAY,
170
- /** The server is not ready to handle the request, typically due to temporary overload or maintenance (503) */
171
- SERVICE_UNAVAILABLE: exports.HTTP_SERVICE_UNAVAILABLE,
172
- /** The server, while acting as a gateway or proxy, did not get a response in time from the upstream server (504) */
173
- GATEWAY_TIMEOUT: exports.HTTP_GATEWAY_TIMEOUT,
174
- };
175
87
  /**
176
88
  * Returns the reason phrase corresponding to the given HTTP status code.
177
89
  * This is useful for converting status codes into human-readable messages.
@@ -36,7 +36,7 @@ export declare class HttpError extends Error {
36
36
  * @see {@link HTTP_FORBIDDEN}
37
37
  * @see {@link HTTP_UNAUTHORIZED}
38
38
  */
39
- export declare function assertHttp(condition: boolean, status: number, message: string): void;
39
+ export declare function assertHttp(condition: boolean, status: number, message: string): asserts condition;
40
40
  export interface ApiResponse<ResponseEntity = unknown> {
41
41
  /** Result of the call. A single entity for non-paginated ${by-id} requests or an array for list queries. */
42
42
  result: ResponseEntity;
@@ -80,95 +80,6 @@ export declare const HTTP_BAD_GATEWAY = 502;
80
80
  export declare const HTTP_SERVICE_UNAVAILABLE = 503;
81
81
  /** The server, while acting as a gateway or proxy, did not get a response in time from the upstream server (504) */
82
82
  export declare const HTTP_GATEWAY_TIMEOUT = 504;
83
- /**
84
- * An object containing common HTTP status codes.
85
- * These constants can be used to improve code readability and maintainability.
86
- * @deprecated Use individual HTTP_* constants for better tree-shaking
87
- */
88
- export declare const HttpStatusCode: {
89
- /** The request has succeeded (200) */
90
- OK: number;
91
- /** The request has been fulfilled, and a new resource is created (201) */
92
- CREATED: number;
93
- /** The request has been accepted for processing, but the processing is not yet complete (202) */
94
- ACCEPTED: number;
95
- /** The server successfully processed the request, and is not returning any content (204) */
96
- NO_CONTENT: number;
97
- /** The request has been successfully processed, but is returning no content (205) */
98
- RESET_CONTENT: number;
99
- /** The server is delivering only part of the resource due to a range header sent by the client (206) */
100
- PARTIAL_CONTENT: number;
101
- /** The IM used the server processed a request successfully, but the response is transformed (226) */
102
- IM_USED: number;
103
- /** The resource has been moved permanently to a new URL (301) */
104
- MOVED_PERMANENTLY: number;
105
- /** The resource is available at a different URL (302) */
106
- FOUND: number;
107
- /** The resource has not been modified since the last request (304) */
108
- NOT_MODIFIED: number;
109
- /** The server could not understand the request due to invalid syntax (400) */
110
- BAD_REQUEST: number;
111
- /** The client must authenticate itself to get the requested response (401) */
112
- UNAUTHORIZED: number;
113
- /** The client does not have access rights to the content (403) */
114
- FORBIDDEN: number;
115
- /** The server cannot find the requested resource (404) */
116
- NOT_FOUND: number;
117
- /** The request method is known by the server but is not supported by the target resource (405) */
118
- METHOD_NOT_ALLOWED: number;
119
- /** The client must authenticate using a proxy (407) */
120
- PROXY_AUTHENTICATION_REQUIRED: number;
121
- /** The server timed out waiting for the request (408) */
122
- REQUEST_TIMEOUT: number;
123
- /** The request conflicts with the current state of the server (409) */
124
- CONFLICT: number;
125
- /** The resource requested is no longer available and will not be available again (410) */
126
- GONE: number;
127
- /** The request does not meet the preconditions that the server requires (412) */
128
- PRECONDITION_FAILED: number;
129
- /** The client sent a request that is too large for the server to process (413) */
130
- PAYLOAD_TOO_LARGE: number;
131
- /** The URI requested by the client is too long for the server to process (414) */
132
- URI_TOO_LONG: number;
133
- /** The media format of the requested data is not supported by the server (415) */
134
- UNSUPPORTED_MEDIA_TYPE: number;
135
- /** The range specified by the client cannot be fulfilled (416) */
136
- RANGE_NOT_SATISFIABLE: number;
137
- /** The expectation given in the request header could not be met by the server (417) */
138
- EXPECTATION_FAILED: number;
139
- /** The server refuses to brew coffee because it is a teapot (418) - an Easter egg from RFC 2324 */
140
- IM_A_TEAPOT: number;
141
- /** The request was well-formed but was unable to be followed due to semantic errors (422) */
142
- UNPROCESSABLE_ENTITY: number;
143
- /** The resource that is being accessed is locked (423) */
144
- LOCKED: number;
145
- /** The resource requested is dependent on another resource that has failed (424) */
146
- FAILED_DEPENDENCY: number;
147
- /** The server is unwilling to risk processing a request that might be replayed (425) */
148
- TOO_EARLY: number;
149
- /** The client needs to upgrade its protocol (426) */
150
- UPGRADE_REQUIRED: number;
151
- /** The server requires the request to be conditional (428) */
152
- PRECONDITION_REQUIRED: number;
153
- /** The client has sent too many requests in a given amount of time (429) */
154
- TOO_MANY_REQUESTS: number;
155
- /** The request header fields are too large (431) */
156
- REQUEST_HEADER_FIELDS_TOO_LARGE: number;
157
- /** The client closed the connection with the server before the request was completed (444) */
158
- CONNECTION_CLOSED_WITHOUT_RESPONSE: number;
159
- /** The client requested an unavailable legal action (451) */
160
- UNAVAILABLE_FOR_LEGAL_REASONS: number;
161
- /** The server encountered an internal error and was unable to complete the request (500) */
162
- INTERNAL_SERVER_ERROR: number;
163
- /** The request method is not supported by the server and cannot be handled (501) */
164
- NOT_IMPLEMENTED: number;
165
- /** The server, while acting as a gateway or proxy, received an invalid response from the upstream server (502) */
166
- BAD_GATEWAY: number;
167
- /** The server is not ready to handle the request, typically due to temporary overload or maintenance (503) */
168
- SERVICE_UNAVAILABLE: number;
169
- /** The server, while acting as a gateway or proxy, did not get a response in time from the upstream server (504) */
170
- GATEWAY_TIMEOUT: number;
171
- };
172
83
  /**
173
84
  * Returns the reason phrase corresponding to the given HTTP status code.
174
85
  * This is useful for converting status codes into human-readable messages.
@@ -1,3 +1,4 @@
1
+ // noinspection JSUnusedGlobalSymbols
1
2
  /** The request has succeeded (200) */
2
3
  export const HTTP_OK = 200;
3
4
  /** The request has been fulfilled, and a new resource is created (201) */
@@ -80,95 +81,6 @@ export const HTTP_BAD_GATEWAY = 502;
80
81
  export const HTTP_SERVICE_UNAVAILABLE = 503;
81
82
  /** The server, while acting as a gateway or proxy, did not get a response in time from the upstream server (504) */
82
83
  export const HTTP_GATEWAY_TIMEOUT = 504;
83
- /**
84
- * An object containing common HTTP status codes.
85
- * These constants can be used to improve code readability and maintainability.
86
- * @deprecated Use individual HTTP_* constants for better tree-shaking
87
- */
88
- export const HttpStatusCode = {
89
- /** The request has succeeded (200) */
90
- OK: HTTP_OK,
91
- /** The request has been fulfilled, and a new resource is created (201) */
92
- CREATED: HTTP_CREATED,
93
- /** The request has been accepted for processing, but the processing is not yet complete (202) */
94
- ACCEPTED: HTTP_ACCEPTED,
95
- /** The server successfully processed the request, and is not returning any content (204) */
96
- NO_CONTENT: HTTP_NO_CONTENT,
97
- /** The request has been successfully processed, but is returning no content (205) */
98
- RESET_CONTENT: HTTP_RESET_CONTENT,
99
- /** The server is delivering only part of the resource due to a range header sent by the client (206) */
100
- PARTIAL_CONTENT: HTTP_PARTIAL_CONTENT,
101
- /** The IM used the server processed a request successfully, but the response is transformed (226) */
102
- IM_USED: HTTP_IM_USED,
103
- /** The resource has been moved permanently to a new URL (301) */
104
- MOVED_PERMANENTLY: HTTP_MOVED_PERMANENTLY,
105
- /** The resource is available at a different URL (302) */
106
- FOUND: HTTP_FOUND,
107
- /** The resource has not been modified since the last request (304) */
108
- NOT_MODIFIED: HTTP_NOT_MODIFIED,
109
- /** The server could not understand the request due to invalid syntax (400) */
110
- BAD_REQUEST: HTTP_BAD_REQUEST,
111
- /** The client must authenticate itself to get the requested response (401) */
112
- UNAUTHORIZED: HTTP_UNAUTHORIZED,
113
- /** The client does not have access rights to the content (403) */
114
- FORBIDDEN: HTTP_FORBIDDEN,
115
- /** The server cannot find the requested resource (404) */
116
- NOT_FOUND: HTTP_NOT_FOUND,
117
- /** The request method is known by the server but is not supported by the target resource (405) */
118
- METHOD_NOT_ALLOWED: HTTP_METHOD_NOT_ALLOWED,
119
- /** The client must authenticate using a proxy (407) */
120
- PROXY_AUTHENTICATION_REQUIRED: HTTP_PROXY_AUTHENTICATION_REQUIRED,
121
- /** The server timed out waiting for the request (408) */
122
- REQUEST_TIMEOUT: HTTP_REQUEST_TIMEOUT,
123
- /** The request conflicts with the current state of the server (409) */
124
- CONFLICT: HTTP_CONFLICT,
125
- /** The resource requested is no longer available and will not be available again (410) */
126
- GONE: HTTP_GONE,
127
- /** The request does not meet the preconditions that the server requires (412) */
128
- PRECONDITION_FAILED: HTTP_PRECONDITION_FAILED,
129
- /** The client sent a request that is too large for the server to process (413) */
130
- PAYLOAD_TOO_LARGE: HTTP_PAYLOAD_TOO_LARGE,
131
- /** The URI requested by the client is too long for the server to process (414) */
132
- URI_TOO_LONG: HTTP_URI_TOO_LONG,
133
- /** The media format of the requested data is not supported by the server (415) */
134
- UNSUPPORTED_MEDIA_TYPE: HTTP_UNSUPPORTED_MEDIA_TYPE,
135
- /** The range specified by the client cannot be fulfilled (416) */
136
- RANGE_NOT_SATISFIABLE: HTTP_RANGE_NOT_SATISFIABLE,
137
- /** The expectation given in the request header could not be met by the server (417) */
138
- EXPECTATION_FAILED: HTTP_EXPECTATION_FAILED,
139
- /** The server refuses to brew coffee because it is a teapot (418) - an Easter egg from RFC 2324 */
140
- IM_A_TEAPOT: HTTP_IM_A_TEAPOT,
141
- /** The request was well-formed but was unable to be followed due to semantic errors (422) */
142
- UNPROCESSABLE_ENTITY: HTTP_UNPROCESSABLE_ENTITY,
143
- /** The resource that is being accessed is locked (423) */
144
- LOCKED: HTTP_LOCKED,
145
- /** The resource requested is dependent on another resource that has failed (424) */
146
- FAILED_DEPENDENCY: HTTP_FAILED_DEPENDENCY,
147
- /** The server is unwilling to risk processing a request that might be replayed (425) */
148
- TOO_EARLY: HTTP_TOO_EARLY,
149
- /** The client needs to upgrade its protocol (426) */
150
- UPGRADE_REQUIRED: HTTP_UPGRADE_REQUIRED,
151
- /** The server requires the request to be conditional (428) */
152
- PRECONDITION_REQUIRED: HTTP_PRECONDITION_REQUIRED,
153
- /** The client has sent too many requests in a given amount of time (429) */
154
- TOO_MANY_REQUESTS: HTTP_TOO_MANY_REQUESTS,
155
- /** The request header fields are too large (431) */
156
- REQUEST_HEADER_FIELDS_TOO_LARGE: HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE,
157
- /** The client closed the connection with the server before the request was completed (444) */
158
- CONNECTION_CLOSED_WITHOUT_RESPONSE: HTTP_CONNECTION_CLOSED_WITHOUT_RESPONSE,
159
- /** The client requested an unavailable legal action (451) */
160
- UNAVAILABLE_FOR_LEGAL_REASONS: HTTP_UNAVAILABLE_FOR_LEGAL_REASONS,
161
- /** The server encountered an internal error and was unable to complete the request (500) */
162
- INTERNAL_SERVER_ERROR: HTTP_INTERNAL_SERVER_ERROR,
163
- /** The request method is not supported by the server and cannot be handled (501) */
164
- NOT_IMPLEMENTED: HTTP_NOT_IMPLEMENTED,
165
- /** The server, while acting as a gateway or proxy, received an invalid response from the upstream server (502) */
166
- BAD_GATEWAY: HTTP_BAD_GATEWAY,
167
- /** The server is not ready to handle the request, typically due to temporary overload or maintenance (503) */
168
- SERVICE_UNAVAILABLE: HTTP_SERVICE_UNAVAILABLE,
169
- /** The server, while acting as a gateway or proxy, did not get a response in time from the upstream server (504) */
170
- GATEWAY_TIMEOUT: HTTP_GATEWAY_TIMEOUT,
171
- };
172
84
  /**
173
85
  * Returns the reason phrase corresponding to the given HTTP status code.
174
86
  * This is useful for converting status codes into human-readable messages.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fishka/express",
3
- "version": "0.9.7",
3
+ "version": "0.9.8",
4
4
  "description": "Express.js extension with built-in validation, and type safety",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",