@arkyn/server 3.0.1-beta.20 → 3.0.1-beta.201

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.
Files changed (244) hide show
  1. package/README.md +425 -69
  2. package/dist/{api/arkynLogRequest.d.ts → http/api/_logRequest.d.ts} +22 -19
  3. package/dist/{api/arkynLogRequest.d.ts.map → http/api/_logRequest.d.ts.map} +1 -1
  4. package/dist/http/api/_makeRequest.d.ts +61 -0
  5. package/dist/http/api/_makeRequest.d.ts.map +1 -0
  6. package/dist/http/api/deleteRequest.d.ts +17 -0
  7. package/dist/http/api/deleteRequest.d.ts.map +1 -0
  8. package/dist/http/api/getRequest.d.ts +16 -0
  9. package/dist/http/api/getRequest.d.ts.map +1 -0
  10. package/dist/http/api/patchRequest.d.ts +17 -0
  11. package/dist/http/api/patchRequest.d.ts.map +1 -0
  12. package/dist/http/api/postRequest.d.ts +17 -0
  13. package/dist/http/api/postRequest.d.ts.map +1 -0
  14. package/dist/http/api/putRequest.d.ts +17 -0
  15. package/dist/http/api/putRequest.d.ts.map +1 -0
  16. package/dist/http/badResponses/_badResponse.d.ts +25 -0
  17. package/dist/http/badResponses/_badResponse.d.ts.map +1 -0
  18. package/dist/http/badResponses/badGateway.d.ts +14 -24
  19. package/dist/http/badResponses/badGateway.d.ts.map +1 -1
  20. package/dist/http/badResponses/badRequest.d.ts +12 -24
  21. package/dist/http/badResponses/badRequest.d.ts.map +1 -1
  22. package/dist/http/badResponses/conflict.d.ts +12 -24
  23. package/dist/http/badResponses/conflict.d.ts.map +1 -1
  24. package/dist/http/badResponses/forbidden.d.ts +12 -24
  25. package/dist/http/badResponses/forbidden.d.ts.map +1 -1
  26. package/dist/http/badResponses/notFound.d.ts +12 -24
  27. package/dist/http/badResponses/notFound.d.ts.map +1 -1
  28. package/dist/http/badResponses/notImplemented.d.ts +12 -24
  29. package/dist/http/badResponses/notImplemented.d.ts.map +1 -1
  30. package/dist/http/badResponses/serverError.d.ts +12 -24
  31. package/dist/http/badResponses/serverError.d.ts.map +1 -1
  32. package/dist/http/badResponses/unauthorized.d.ts +12 -24
  33. package/dist/http/badResponses/unauthorized.d.ts.map +1 -1
  34. package/dist/http/badResponses/unprocessableEntity.d.ts +25 -34
  35. package/dist/http/badResponses/unprocessableEntity.d.ts.map +1 -1
  36. package/dist/http/successResponses/_successResponse.d.ts +36 -0
  37. package/dist/http/successResponses/_successResponse.d.ts.map +1 -0
  38. package/dist/http/successResponses/created.d.ts +12 -26
  39. package/dist/http/successResponses/created.d.ts.map +1 -1
  40. package/dist/http/successResponses/found.d.ts +12 -29
  41. package/dist/http/successResponses/found.d.ts.map +1 -1
  42. package/dist/http/successResponses/noContent.d.ts +12 -17
  43. package/dist/http/successResponses/noContent.d.ts.map +1 -1
  44. package/dist/http/successResponses/success.d.ts +12 -26
  45. package/dist/http/successResponses/success.d.ts.map +1 -1
  46. package/dist/http/successResponses/updated.d.ts +13 -26
  47. package/dist/http/successResponses/updated.d.ts.map +1 -1
  48. package/dist/index.d.ts +19 -10
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +1067 -28
  51. package/dist/modules/http/api/_logRequest.js +56 -0
  52. package/dist/modules/http/api/_makeRequest.js +70 -0
  53. package/dist/modules/http/api/deleteRequest.js +13 -0
  54. package/dist/modules/http/api/getRequest.js +12 -0
  55. package/dist/modules/http/api/patchRequest.js +13 -0
  56. package/dist/modules/http/api/postRequest.js +13 -0
  57. package/dist/modules/http/api/putRequest.js +13 -0
  58. package/dist/modules/http/badResponses/_badResponse.js +63 -0
  59. package/dist/modules/http/badResponses/badGateway.js +24 -0
  60. package/dist/modules/http/badResponses/badRequest.js +24 -0
  61. package/dist/modules/http/badResponses/conflict.js +24 -0
  62. package/dist/modules/http/badResponses/forbidden.js +24 -0
  63. package/dist/modules/http/badResponses/notFound.js +24 -0
  64. package/dist/modules/http/badResponses/notImplemented.js +24 -0
  65. package/dist/modules/http/badResponses/serverError.js +24 -0
  66. package/dist/modules/http/badResponses/unauthorized.js +24 -0
  67. package/dist/modules/http/badResponses/unprocessableEntity.js +28 -0
  68. package/dist/modules/http/successResponses/_successResponse.js +62 -0
  69. package/dist/modules/http/successResponses/created.js +24 -0
  70. package/dist/modules/http/successResponses/found.js +24 -0
  71. package/dist/modules/http/successResponses/noContent.js +17 -0
  72. package/dist/modules/http/successResponses/success.js +24 -0
  73. package/dist/modules/http/successResponses/updated.js +24 -0
  74. package/dist/modules/index.js +34 -0
  75. package/dist/modules/services/apiService.js +109 -0
  76. package/dist/modules/services/debugService.js +36 -0
  77. package/dist/modules/services/logMapperService.js +31 -0
  78. package/dist/modules/services/logService.js +21 -0
  79. package/dist/modules/utilities/decodeRequestBody.js +20 -0
  80. package/dist/modules/utilities/decodeRequestErrorMessage.js +6 -0
  81. package/dist/modules/utilities/errorHandler.js +39 -0
  82. package/dist/modules/utilities/flushDebugLogs.js +16 -0
  83. package/dist/modules/utilities/formAsyncParse.js +14 -0
  84. package/dist/modules/utilities/formParse.js +14 -0
  85. package/dist/modules/utilities/getScopedParams.js +9 -0
  86. package/dist/modules/utilities/schemaValidator.js +55 -0
  87. package/dist/modules/validations/validateCep.js +9 -0
  88. package/dist/modules/validations/validateCnpj.js +54 -0
  89. package/dist/modules/validations/validateCpf.js +27 -0
  90. package/dist/modules/validations/validateDate.js +26 -0
  91. package/dist/modules/validations/validateEmail.js +54 -0
  92. package/dist/modules/validations/validatePassword.js +12 -0
  93. package/dist/modules/validations/validatePhone.js +10 -0
  94. package/dist/modules/validations/validateRg.js +8 -0
  95. package/dist/services/apiService.d.ts +83 -0
  96. package/dist/services/apiService.d.ts.map +1 -0
  97. package/dist/services/debugService.d.ts +37 -0
  98. package/dist/services/debugService.d.ts.map +1 -0
  99. package/dist/services/logMapperService.d.ts +86 -0
  100. package/dist/services/logMapperService.d.ts.map +1 -0
  101. package/dist/services/logService.d.ts +33 -0
  102. package/dist/services/logService.d.ts.map +1 -0
  103. package/dist/utilities/decodeRequestBody.d.ts +18 -0
  104. package/dist/utilities/decodeRequestBody.d.ts.map +1 -0
  105. package/dist/utilities/decodeRequestErrorMessage.d.ts +19 -0
  106. package/dist/utilities/decodeRequestErrorMessage.d.ts.map +1 -0
  107. package/dist/utilities/errorHandler.d.ts +25 -0
  108. package/dist/utilities/errorHandler.d.ts.map +1 -0
  109. package/dist/utilities/flushDebugLogs.d.ts +24 -0
  110. package/dist/utilities/flushDebugLogs.d.ts.map +1 -0
  111. package/dist/utilities/formAsyncParse.d.ts +38 -0
  112. package/dist/utilities/formAsyncParse.d.ts.map +1 -0
  113. package/dist/utilities/formParse.d.ts +38 -0
  114. package/dist/utilities/formParse.d.ts.map +1 -0
  115. package/dist/utilities/getScopedParams.d.ts +19 -0
  116. package/dist/utilities/getScopedParams.d.ts.map +1 -0
  117. package/dist/utilities/schemaValidator.d.ts +75 -0
  118. package/dist/utilities/schemaValidator.d.ts.map +1 -0
  119. package/dist/validations/validateCep.d.ts +19 -0
  120. package/dist/validations/validateCep.d.ts.map +1 -0
  121. package/dist/validations/validateCnpj.d.ts +21 -0
  122. package/dist/validations/validateCnpj.d.ts.map +1 -0
  123. package/dist/validations/validateCpf.d.ts +16 -0
  124. package/dist/validations/validateCpf.d.ts.map +1 -0
  125. package/dist/validations/validateDate.d.ts +23 -0
  126. package/dist/validations/validateDate.d.ts.map +1 -0
  127. package/dist/validations/validateEmail.d.ts +21 -0
  128. package/dist/validations/validateEmail.d.ts.map +1 -0
  129. package/dist/validations/validatePassword.d.ts +20 -0
  130. package/dist/validations/validatePassword.d.ts.map +1 -0
  131. package/dist/validations/validatePhone.d.ts +16 -0
  132. package/dist/validations/validatePhone.d.ts.map +1 -0
  133. package/dist/validations/validateRg.d.ts +21 -0
  134. package/dist/validations/validateRg.d.ts.map +1 -0
  135. package/package.json +222 -15
  136. package/dist/api/arkynLogRequest.js +0 -82
  137. package/dist/api/deleteRequest.d.ts +0 -13
  138. package/dist/api/deleteRequest.d.ts.map +0 -1
  139. package/dist/api/deleteRequest.js +0 -14
  140. package/dist/api/getRequest.d.ts +0 -12
  141. package/dist/api/getRequest.d.ts.map +0 -1
  142. package/dist/api/getRequest.js +0 -13
  143. package/dist/api/makeRequest.d.ts +0 -38
  144. package/dist/api/makeRequest.d.ts.map +0 -1
  145. package/dist/api/makeRequest.js +0 -103
  146. package/dist/api/patchRequest.d.ts +0 -13
  147. package/dist/api/patchRequest.d.ts.map +0 -1
  148. package/dist/api/patchRequest.js +0 -14
  149. package/dist/api/postRequest.d.ts +0 -13
  150. package/dist/api/postRequest.d.ts.map +0 -1
  151. package/dist/api/postRequest.js +0 -14
  152. package/dist/api/putRequest.d.ts +0 -13
  153. package/dist/api/putRequest.d.ts.map +0 -1
  154. package/dist/api/putRequest.js +0 -14
  155. package/dist/config/apiInstance.d.ts +0 -80
  156. package/dist/config/apiInstance.d.ts.map +0 -1
  157. package/dist/config/apiInstance.js +0 -111
  158. package/dist/config/arkynLogInstance.d.ts +0 -44
  159. package/dist/config/arkynLogInstance.d.ts.map +0 -1
  160. package/dist/config/arkynLogInstance.js +0 -49
  161. package/dist/http/badResponses/badGateway.js +0 -52
  162. package/dist/http/badResponses/badRequest.js +0 -52
  163. package/dist/http/badResponses/conflict.js +0 -52
  164. package/dist/http/badResponses/forbidden.js +0 -52
  165. package/dist/http/badResponses/notFound.js +0 -52
  166. package/dist/http/badResponses/notImplemented.js +0 -52
  167. package/dist/http/badResponses/serverError.js +0 -52
  168. package/dist/http/badResponses/unauthorized.js +0 -52
  169. package/dist/http/badResponses/unprocessableEntity.js +0 -60
  170. package/dist/http/successResponses/created.js +0 -54
  171. package/dist/http/successResponses/found.js +0 -57
  172. package/dist/http/successResponses/noContent.js +0 -35
  173. package/dist/http/successResponses/success.js +0 -54
  174. package/dist/http/successResponses/updated.js +0 -54
  175. package/dist/mapper/arkynLogRequestMapper.d.ts +0 -30
  176. package/dist/mapper/arkynLogRequestMapper.d.ts.map +0 -1
  177. package/dist/mapper/arkynLogRequestMapper.js +0 -44
  178. package/dist/services/decodeErrorMessageFromRequest.d.ts +0 -17
  179. package/dist/services/decodeErrorMessageFromRequest.d.ts.map +0 -1
  180. package/dist/services/decodeErrorMessageFromRequest.js +0 -30
  181. package/dist/services/decodeRequestBody.d.ts +0 -17
  182. package/dist/services/decodeRequestBody.d.ts.map +0 -1
  183. package/dist/services/decodeRequestBody.js +0 -38
  184. package/dist/services/errorHandler.d.ts +0 -44
  185. package/dist/services/errorHandler.d.ts.map +0 -1
  186. package/dist/services/errorHandler.js +0 -93
  187. package/dist/services/formParse.d.ts +0 -59
  188. package/dist/services/formParse.d.ts.map +0 -1
  189. package/dist/services/formParse.js +0 -59
  190. package/dist/services/getCaller.d.ts +0 -17
  191. package/dist/services/getCaller.d.ts.map +0 -1
  192. package/dist/services/getCaller.js +0 -65
  193. package/dist/services/getScopedParams.d.ts +0 -28
  194. package/dist/services/getScopedParams.d.ts.map +0 -1
  195. package/dist/services/getScopedParams.js +0 -34
  196. package/dist/services/httpDebug.d.ts +0 -35
  197. package/dist/services/httpDebug.d.ts.map +0 -1
  198. package/dist/services/httpDebug.js +0 -52
  199. package/dist/services/measureRouteExecution.d.ts +0 -3
  200. package/dist/services/measureRouteExecution.d.ts.map +0 -1
  201. package/dist/services/measureRouteExecution.js +0 -24
  202. package/dist/services/schemaValidator.d.ts +0 -13
  203. package/dist/services/schemaValidator.d.ts.map +0 -1
  204. package/dist/services/schemaValidator.js +0 -51
  205. package/dist/types/ApiResponseDTO.d.ts +0 -17
  206. package/dist/types/ApiResponseDTO.d.ts.map +0 -1
  207. package/dist/types/ApiResponseDTO.js +0 -1
  208. package/src/api/arkynLogRequest.ts +0 -118
  209. package/src/api/deleteRequest.ts +0 -22
  210. package/src/api/getRequest.ts +0 -20
  211. package/src/api/makeRequest.ts +0 -118
  212. package/src/api/patchRequest.ts +0 -22
  213. package/src/api/postRequest.ts +0 -22
  214. package/src/api/putRequest.ts +0 -22
  215. package/src/config/apiInstance.ts +0 -148
  216. package/src/config/arkynLogInstance.ts +0 -70
  217. package/src/http/badResponses/badGateway.ts +0 -63
  218. package/src/http/badResponses/badRequest.ts +0 -63
  219. package/src/http/badResponses/conflict.ts +0 -63
  220. package/src/http/badResponses/forbidden.ts +0 -63
  221. package/src/http/badResponses/notFound.ts +0 -63
  222. package/src/http/badResponses/notImplemented.ts +0 -63
  223. package/src/http/badResponses/serverError.ts +0 -63
  224. package/src/http/badResponses/unauthorized.ts +0 -63
  225. package/src/http/badResponses/unprocessableEntity.ts +0 -79
  226. package/src/http/successResponses/created.ts +0 -64
  227. package/src/http/successResponses/found.ts +0 -67
  228. package/src/http/successResponses/noContent.ts +0 -42
  229. package/src/http/successResponses/success.ts +0 -64
  230. package/src/http/successResponses/updated.ts +0 -64
  231. package/src/index.ts +0 -31
  232. package/src/mapper/arkynLogRequestMapper.ts +0 -73
  233. package/src/services/decodeErrorMessageFromRequest.ts +0 -36
  234. package/src/services/decodeRequestBody.ts +0 -43
  235. package/src/services/errorHandler.ts +0 -99
  236. package/src/services/formParse.ts +0 -86
  237. package/src/services/getCaller.ts +0 -82
  238. package/src/services/getScopedParams.ts +0 -43
  239. package/src/services/httpDebug.ts +0 -61
  240. package/src/services/measureRouteExecution.ts +0 -31
  241. package/src/services/schemaValidator.ts +0 -66
  242. package/src/types/ApiResponseDTO.ts +0 -19
  243. package/tsconfig.json +0 -21
  244. package/vitest.config.ts +0 -5
@@ -0,0 +1,17 @@
1
+ import { type ApiResponseDTO } from "./_makeRequest";
2
+ type InputProps = {
3
+ url: string;
4
+ urlParams?: Record<string, string>;
5
+ headers?: HeadersInit;
6
+ body?: any;
7
+ };
8
+ /**
9
+ * Sends a DELETE request to the specified URL with optional headers and body.
10
+ *
11
+ * @template T - The expected type of the response data.
12
+ * @param {InputProps} input - The options for the DELETE request, including URL, URL parameters, headers, and body.
13
+ * @returns {Promise<ApiResponseDTO<T>>} A promise that resolves to the API response.
14
+ */
15
+ declare function deleteRequest<T = any>(input: InputProps): Promise<ApiResponseDTO<T>>;
16
+ export { deleteRequest };
17
+ //# sourceMappingURL=deleteRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deleteRequest.d.ts","sourceRoot":"","sources":["../../../src/http/api/deleteRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAe,MAAM,gBAAgB,CAAC;AAElE,KAAK,UAAU,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB,IAAI,CAAC,EAAE,GAAG,CAAC;CACX,CAAC;AAEF;;;;;;GAMG;AAGH,iBAAe,aAAa,CAAC,CAAC,GAAG,GAAG,EACnC,KAAK,EAAE,UAAU,GACf,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAQ5B;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { type ApiResponseDTO } from "./_makeRequest";
2
+ type InputProps = {
3
+ url: string;
4
+ urlParams?: Record<string, string>;
5
+ headers?: HeadersInit;
6
+ };
7
+ /**
8
+ * Sends a GET request to the specified URL with optional headers.
9
+ *
10
+ * @template T - The expected type of the response data.
11
+ * @param {InputProps} input - The options for the GET request, including URL, URL parameters, and headers.
12
+ * @returns {Promise<ApiResponseDTO<T>>} A promise that resolves to the API response.
13
+ */
14
+ declare function getRequest<T = any>(input: InputProps): Promise<ApiResponseDTO<T>>;
15
+ export { getRequest };
16
+ //# sourceMappingURL=getRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRequest.d.ts","sourceRoot":"","sources":["../../../src/http/api/getRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAe,MAAM,gBAAgB,CAAC;AAElE,KAAK,UAAU,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF;;;;;;GAMG;AAGH,iBAAe,UAAU,CAAC,CAAC,GAAG,GAAG,EAChC,KAAK,EAAE,UAAU,GACf,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAO5B;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type ApiResponseDTO } from "./_makeRequest";
2
+ type InputProps = {
3
+ url: string;
4
+ urlParams?: Record<string, string>;
5
+ headers?: HeadersInit;
6
+ body?: any;
7
+ };
8
+ /**
9
+ * Sends a PATCH request to the specified URL with optional headers and body.
10
+ *
11
+ * @template T - The expected type of the response data.
12
+ * @param {InputProps} input - The options for the PATCH request, including URL, URL parameters, headers, and body.
13
+ * @returns {Promise<ApiResponseDTO<T>>} A promise that resolves to the API response.
14
+ */
15
+ declare function patchRequest<T = any>(input: InputProps): Promise<ApiResponseDTO<T>>;
16
+ export { patchRequest };
17
+ //# sourceMappingURL=patchRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patchRequest.d.ts","sourceRoot":"","sources":["../../../src/http/api/patchRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAe,MAAM,gBAAgB,CAAC;AAElE,KAAK,UAAU,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB,IAAI,CAAC,EAAE,GAAG,CAAC;CACX,CAAC;AAEF;;;;;;GAMG;AAGH,iBAAe,YAAY,CAAC,CAAC,GAAG,GAAG,EAClC,KAAK,EAAE,UAAU,GACf,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAQ5B;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type ApiResponseDTO } from "./_makeRequest";
2
+ type InputProps = {
3
+ url: string;
4
+ urlParams?: Record<string, string>;
5
+ headers?: HeadersInit;
6
+ body?: any;
7
+ };
8
+ /**
9
+ * Sends a POST request to the specified URL with optional headers and body.
10
+ *
11
+ * @template T - The expected type of the response data.
12
+ * @param {InputProps} input - The options for the POST request, including URL, URL parameters, headers, and body.
13
+ * @returns {Promise<ApiResponseDTO<T>>} A promise that resolves to the API response.
14
+ */
15
+ declare function postRequest<T = any>(input: InputProps): Promise<ApiResponseDTO<T>>;
16
+ export { postRequest };
17
+ //# sourceMappingURL=postRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postRequest.d.ts","sourceRoot":"","sources":["../../../src/http/api/postRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAe,MAAM,gBAAgB,CAAC;AAElE,KAAK,UAAU,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB,IAAI,CAAC,EAAE,GAAG,CAAC;CACX,CAAC;AAEF;;;;;;GAMG;AAGH,iBAAe,WAAW,CAAC,CAAC,GAAG,GAAG,EACjC,KAAK,EAAE,UAAU,GACf,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAQ5B;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type ApiResponseDTO } from "./_makeRequest";
2
+ type InputProps = {
3
+ url: string;
4
+ urlParams?: Record<string, string>;
5
+ headers?: HeadersInit;
6
+ body?: any;
7
+ };
8
+ /**
9
+ * Sends a PUT request to the specified URL with optional headers and body.
10
+ *
11
+ * @template T - The expected type of the response data.
12
+ * @param {InputProps} input - The options for the PUT request, including URL, URL parameters, headers, and body.
13
+ * @returns {Promise<ApiResponseDTO<T>>} A promise that resolves to the API response.
14
+ */
15
+ declare function putRequest<T = any>(input: InputProps): Promise<ApiResponseDTO<T>>;
16
+ export { putRequest };
17
+ //# sourceMappingURL=putRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"putRequest.d.ts","sourceRoot":"","sources":["../../../src/http/api/putRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAe,MAAM,gBAAgB,CAAC;AAElE,KAAK,UAAU,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB,IAAI,CAAC,EAAE,GAAG,CAAC;CACX,CAAC;AAEF;;;;;;GAMG;AAGH,iBAAe,UAAU,CAAC,CAAC,GAAG,GAAG,EAChC,KAAK,EAAE,UAAU,GACf,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAQ5B;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,25 @@
1
+ declare class BadResponse {
2
+ private _cause?;
3
+ private _name;
4
+ private _status;
5
+ private _statusText;
6
+ private _debugColor;
7
+ get cause(): any;
8
+ set cause(value: any);
9
+ get name(): string;
10
+ set name(value: string);
11
+ get status(): number;
12
+ set status(value: number);
13
+ get statusText(): string;
14
+ set statusText(value: string);
15
+ get debugColor(): "green" | "yellow" | "cyan" | "red";
16
+ set debugColor(value: "green" | "yellow" | "cyan" | "red");
17
+ onDebug(): void;
18
+ makeBody(): {
19
+ name: string;
20
+ message: string;
21
+ cause: any;
22
+ };
23
+ }
24
+ export { BadResponse };
25
+ //# sourceMappingURL=_badResponse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_badResponse.d.ts","sourceRoot":"","sources":["../../../src/http/badResponses/_badResponse.ts"],"names":[],"mappings":"AAKA,cAAM,WAAW;IAEhB,OAAO,CAAC,MAAM,CAAC,CAAM;IACrB,OAAO,CAAC,KAAK,CAAyB;IACtC,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,WAAW,CAA8C;IAGjE,IAAI,KAAK,IAAI,GAAG,CAEf;IAGD,IAAI,KAAK,CAAC,KAAK,EAAE,GAAG,EAEnB;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAErB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,EAEvB;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,IAAI,UAAU,CAAC,KAAK,EAAE,MAAM,EAE3B;IAED,IAAI,UAAU,IAAI,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAEpD;IAED,IAAI,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,EAGxD;IAED,OAAO;IAeP,QAAQ;;;;;CAOR;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1,33 +1,23 @@
1
+ import { BadResponse } from "./_badResponse";
1
2
  /**
2
- * Represents an HTTP error response with a status code of 502 (Bad Gateway).
3
- * This class is used to standardize the structure of a "Bad Gateway" error response,
4
- * including the response body, headers, status, and status text.
3
+ * HTTP 502 Bad Gateway the upstream server returned an invalid or unexpected response.
4
+ *
5
+ * Throw inside a server action/loader and catch with `errorHandler`, or call `.toJson()` directly.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * throw new BadGateway("Payment gateway unavailable");
10
+ * ```
5
11
  */
6
- declare class BadGateway {
7
- body: any;
8
- cause?: any;
9
- status: number;
10
- statusText: string;
12
+ declare class BadGateway extends BadResponse {
11
13
  /**
12
- * Creates an instance of the `BadGateway` class.
13
- *
14
- * @param message - A descriptive message explaining the cause of the error.
15
- * @param cause - Optional additional information about the cause of the error.
14
+ * @param message - Error description sent in the response body and logged for debugging.
15
+ * @param cause - Optional extra context (serialized to JSON in the response).
16
16
  */
17
17
  constructor(message: string, cause?: any);
18
- /**
19
- * Converts the `BadGateway` instance into a `Response` object with a JSON body.
20
- * This method ensures the response has the appropriate headers, status, and status text.
21
- *
22
- * @returns A `Response` object with the serialized JSON body and response metadata.
23
- */
18
+ /** Converts to a `Response` with `Content-Type: application/json` header. */
24
19
  toResponse(): Response;
25
- /**
26
- * Converts the `BadGateway` instance into a `Response` object using the `Response.json` method.
27
- * This method is an alternative to `toResponse` for generating JSON error responses.
28
- *
29
- * @returns A `Response` object with the JSON body and response metadata.
30
- */
20
+ /** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */
31
21
  toJson(): Response;
32
22
  }
33
23
  export { BadGateway };
@@ -1 +1 @@
1
- {"version":3,"file":"badGateway.d.ts","sourceRoot":"","sources":["../../../src/http/badResponses/badGateway.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,cAAM,UAAU;IACd,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,MAAM,EAAE,MAAM,CAAO;IACrB,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;gBAES,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAOxC;;;;;OAKG;IAEH,UAAU,IAAI,QAAQ;IAUtB;;;;;OAKG;IAEH,MAAM,IAAI,QAAQ;CAQnB;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"badGateway.d.ts","sourceRoot":"","sources":["../../../src/http/badResponses/badGateway.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;;;;;GASG;AACH,cAAM,UAAW,SAAQ,WAAW;IACnC;;;OAGG;gBAES,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAWxC,6EAA6E;IAC7E,UAAU,IAAI,QAAQ;IAUtB,uFAAuF;IACvF,MAAM,IAAI,QAAQ;CAQlB;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1,33 +1,21 @@
1
+ import { BadResponse } from "./_badResponse";
1
2
  /**
2
- * Represents an HTTP error response with a status code of 400 (Bad Request).
3
- * This class is used to standardize the structure of a "Bad Request" error response,
4
- * including the response body, headers, status, and status text.
3
+ * HTTP 400 Bad Request the request is malformed or contains invalid data.
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * throw new BadRequest("Invalid request body");
8
+ * ```
5
9
  */
6
- declare class BadRequest {
7
- body: any;
8
- cause?: any;
9
- status: number;
10
- statusText: string;
10
+ declare class BadRequest extends BadResponse {
11
11
  /**
12
- * Creates an instance of the `BadRequest` class.
13
- *
14
- * @param message - A descriptive message explaining the cause of the error.
15
- * @param cause - Optional additional information about the cause of the error.
12
+ * @param message - Error description.
13
+ * @param cause - Optional extra context (serialized to JSON).
16
14
  */
17
15
  constructor(message: string, cause?: any);
18
- /**
19
- * Converts the `BadRequest` instance into a `Response` object with a JSON body.
20
- * This method ensures the response has the appropriate headers, status, and status text.
21
- *
22
- * @returns A `Response` object with the serialized JSON body and response metadata.
23
- */
16
+ /** Converts to a `Response` with `Content-Type: application/json` header. */
24
17
  toResponse(): Response;
25
- /**
26
- * Converts the `BadRequest` instance into a `Response` object using the `Response.json` method.
27
- * This method is an alternative to `toResponse` for generating JSON error responses.
28
- *
29
- * @returns A `Response` object with the JSON body and response metadata.
30
- */
18
+ /** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */
31
19
  toJson(): Response;
32
20
  }
33
21
  export { BadRequest };
@@ -1 +1 @@
1
- {"version":3,"file":"badRequest.d.ts","sourceRoot":"","sources":["../../../src/http/badResponses/badRequest.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,cAAM,UAAU;IACd,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,MAAM,EAAE,MAAM,CAAO;IACrB,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;gBAES,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAOxC;;;;;OAKG;IAEH,UAAU,IAAI,QAAQ;IAUtB;;;;;OAKG;IAEH,MAAM,IAAI,QAAQ;CAQnB;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"badRequest.d.ts","sourceRoot":"","sources":["../../../src/http/badResponses/badRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;;;GAOG;AACH,cAAM,UAAW,SAAQ,WAAW;IACnC;;;OAGG;gBAES,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAWxC,6EAA6E;IAC7E,UAAU,IAAI,QAAQ;IAUtB,uFAAuF;IACvF,MAAM,IAAI,QAAQ;CAQlB;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1,33 +1,21 @@
1
+ import { BadResponse } from "./_badResponse";
1
2
  /**
2
- * Represents an HTTP error response with a status code of 409 (Conflict).
3
- * This class is used to standardize the structure of a "Conflict" error response,
4
- * including the response body, headers, status, and status text.
3
+ * HTTP 409 Conflict the request conflicts with the current state of the server (e.g. duplicate record).
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * throw new Conflict("Email already in use");
8
+ * ```
5
9
  */
6
- declare class Conflict {
7
- body: any;
8
- cause?: any;
9
- status: number;
10
- statusText: string;
10
+ declare class Conflict extends BadResponse {
11
11
  /**
12
- * Creates an instance of the `Conflict` class.
13
- *
14
- * @param message - A descriptive message explaining the cause of the conflict.
15
- * @param cause - Optional additional information about the cause of the conflict.
12
+ * @param message - Error description.
13
+ * @param cause - Optional extra context (serialized to JSON).
16
14
  */
17
15
  constructor(message: string, cause?: any);
18
- /**
19
- * Converts the `Conflict` instance into a `Response` object with a JSON body.
20
- * This method ensures the response has the appropriate headers, status, and status text.
21
- *
22
- * @returns A `Response` object with the serialized JSON body and response metadata.
23
- */
16
+ /** Converts to a `Response` with `Content-Type: application/json` header. */
24
17
  toResponse(): Response;
25
- /**
26
- * Converts the `Conflict` instance into a `Response` object using the `Response.json` method.
27
- * This method is an alternative to `toResponse` for generating JSON error responses.
28
- *
29
- * @returns A `Response` object with the JSON body and response metadata.
30
- */
18
+ /** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */
31
19
  toJson(): Response;
32
20
  }
33
21
  export { Conflict };
@@ -1 +1 @@
1
- {"version":3,"file":"conflict.d.ts","sourceRoot":"","sources":["../../../src/http/badResponses/conflict.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,cAAM,QAAQ;IACZ,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,MAAM,EAAE,MAAM,CAAO;IACrB,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;gBAES,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAOxC;;;;;OAKG;IAEH,UAAU,IAAI,QAAQ;IAUtB;;;;;OAKG;IAEH,MAAM,IAAI,QAAQ;CAQnB;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"conflict.d.ts","sourceRoot":"","sources":["../../../src/http/badResponses/conflict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;;;GAOG;AACH,cAAM,QAAS,SAAQ,WAAW;IACjC;;;OAGG;gBAES,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAYxC,6EAA6E;IAC7E,UAAU,IAAI,QAAQ;IAUtB,uFAAuF;IACvF,MAAM,IAAI,QAAQ;CAQlB;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,33 +1,21 @@
1
+ import { BadResponse } from "./_badResponse";
1
2
  /**
2
- * Represents an HTTP error response with a status code of 403 (Forbidden).
3
- * This class is used to standardize the structure of a "Forbidden" error response,
4
- * including the response body, headers, status, and status text.
3
+ * HTTP 403 Forbidden authenticated but not authorized to access this resource.
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * throw new Forbidden("You don't have permission to delete this resource");
8
+ * ```
5
9
  */
6
- declare class Forbidden {
7
- body: any;
8
- cause?: any;
9
- status: number;
10
- statusText: string;
10
+ declare class Forbidden extends BadResponse {
11
11
  /**
12
- * Creates an instance of the `Forbidden` class.
13
- *
14
- * @param message - A descriptive message explaining why access is forbidden.
15
- * @param cause - Optional additional information about the cause of the error.
12
+ * @param message - Error description.
13
+ * @param cause - Optional extra context (serialized to JSON).
16
14
  */
17
15
  constructor(message: string, cause?: any);
18
- /**
19
- * Converts the `Forbidden` instance into a `Response` object with a JSON body.
20
- * This method ensures the response has the appropriate headers, status, and status text.
21
- *
22
- * @returns A `Response` object with the serialized JSON body and response metadata.
23
- */
16
+ /** Converts to a `Response` with `Content-Type: application/json` header. */
24
17
  toResponse(): Response;
25
- /**
26
- * Converts the `Forbidden` instance into a `Response` object using the `Response.json` method.
27
- * This method is an alternative to `toResponse` for generating JSON error responses.
28
- *
29
- * @returns A `Response` object with the JSON body and response metadata.
30
- */
18
+ /** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */
31
19
  toJson(): Response;
32
20
  }
33
21
  export { Forbidden };
@@ -1 +1 @@
1
- {"version":3,"file":"forbidden.d.ts","sourceRoot":"","sources":["../../../src/http/badResponses/forbidden.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,cAAM,SAAS;IACb,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,MAAM,EAAE,MAAM,CAAO;IACrB,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;gBAES,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAOxC;;;;;OAKG;IAEH,UAAU,IAAI,QAAQ;IAUtB;;;;;OAKG;IAEH,MAAM,IAAI,QAAQ;CAQnB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"forbidden.d.ts","sourceRoot":"","sources":["../../../src/http/badResponses/forbidden.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;;;GAOG;AACH,cAAM,SAAU,SAAQ,WAAW;IAClC;;;OAGG;gBAES,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAWxC,6EAA6E;IAC7E,UAAU,IAAI,QAAQ;IAUtB,uFAAuF;IACvF,MAAM,IAAI,QAAQ;CAQlB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1,33 +1,21 @@
1
+ import { BadResponse } from "./_badResponse";
1
2
  /**
2
- * Represents an HTTP error response with a status code of 404 (Not Found).
3
- * This class is used to standardize the structure of a "Not Found" error response,
4
- * including the response body, headers, status, and status text.
3
+ * HTTP 404 Not Found the requested resource does not exist.
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * throw new NotFound("Product not found");
8
+ * ```
5
9
  */
6
- declare class NotFound {
7
- body: any;
8
- cause?: any;
9
- status: number;
10
- statusText: string;
10
+ declare class NotFound extends BadResponse {
11
11
  /**
12
- * Creates an instance of the `NotFound` class.
13
- *
14
- * @param message - A descriptive message explaining the reason the resource was not found.
15
- * @param cause - Optional additional information about the cause of the error.
12
+ * @param message - Error description.
13
+ * @param cause - Optional extra context (serialized to JSON).
16
14
  */
17
15
  constructor(message: string, cause?: any);
18
- /**
19
- * Converts the `NotFound` instance into a `Response` object with a JSON body.
20
- * This method ensures the response has the appropriate headers, status, and status text.
21
- *
22
- * @returns A `Response` object with the serialized JSON body and response metadata.
23
- */
16
+ /** Converts to a `Response` with `Content-Type: application/json` header. */
24
17
  toResponse(): Response;
25
- /**
26
- * Converts the `NotFound` instance into a `Response` object using the `Response.json` method.
27
- * This method is an alternative to `toResponse` for generating JSON error responses.
28
- *
29
- * @returns A `Response` object with the JSON body and response metadata.
30
- */
18
+ /** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */
31
19
  toJson(): Response;
32
20
  }
33
21
  export { NotFound };
@@ -1 +1 @@
1
- {"version":3,"file":"notFound.d.ts","sourceRoot":"","sources":["../../../src/http/badResponses/notFound.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,cAAM,QAAQ;IACZ,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,MAAM,EAAE,MAAM,CAAO;IACrB,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;gBAES,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAOxC;;;;;OAKG;IAEH,UAAU,IAAI,QAAQ;IAUtB;;;;;OAKG;IAEH,MAAM,IAAI,QAAQ;CAQnB;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"notFound.d.ts","sourceRoot":"","sources":["../../../src/http/badResponses/notFound.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;;;GAOG;AACH,cAAM,QAAS,SAAQ,WAAW;IACjC;;;OAGG;gBAES,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAWxC,6EAA6E;IAC7E,UAAU,IAAI,QAAQ;IAUtB,uFAAuF;IACvF,MAAM,IAAI,QAAQ;CAQlB;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,33 +1,21 @@
1
+ import { BadResponse } from "./_badResponse";
1
2
  /**
2
- * Represents an HTTP error response with a status code of 501 (Not Implemented).
3
- * This class is used to standardize the structure of a "Not Implemented" error response,
4
- * including the response body, headers, status, and status text.
3
+ * HTTP 501 Not Implemented the server does not support the functionality required to fulfill the request.
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * throw new NotImplemented("Webhook delivery is not yet implemented");
8
+ * ```
5
9
  */
6
- declare class NotImplemented {
7
- body: any;
8
- cause?: any;
9
- status: number;
10
- statusText: string;
10
+ declare class NotImplemented extends BadResponse {
11
11
  /**
12
- * Creates an instance of the `NotImplemented` class.
13
- *
14
- * @param message - A descriptive message explaining why the functionality is not implemented.
15
- * @param cause - Optional additional information about the cause of the error.
12
+ * @param message - Error description.
13
+ * @param cause - Optional extra context (serialized to JSON).
16
14
  */
17
15
  constructor(message: string, cause?: any);
18
- /**
19
- * Converts the `NotImplemented` instance into a `Response` object with a JSON body.
20
- * This method ensures the response has the appropriate headers, status, and status text.
21
- *
22
- * @returns A `Response` object with the serialized JSON body and response metadata.
23
- */
16
+ /** Converts to a `Response` with `Content-Type: application/json` header. */
24
17
  toResponse(): Response;
25
- /**
26
- * Converts the `NotImplemented` instance into a `Response` object using the `Response.json` method.
27
- * This method is an alternative to `toResponse` for generating JSON error responses.
28
- *
29
- * @returns A `Response` object with the JSON body and response metadata.
30
- */
18
+ /** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */
31
19
  toJson(): Response;
32
20
  }
33
21
  export { NotImplemented };
@@ -1 +1 @@
1
- {"version":3,"file":"notImplemented.d.ts","sourceRoot":"","sources":["../../../src/http/badResponses/notImplemented.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,cAAM,cAAc;IAClB,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,MAAM,EAAE,MAAM,CAAO;IACrB,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;gBAES,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAOxC;;;;;OAKG;IAEH,UAAU,IAAI,QAAQ;IAUtB;;;;;OAKG;IAEH,MAAM,IAAI,QAAQ;CAQnB;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"notImplemented.d.ts","sourceRoot":"","sources":["../../../src/http/badResponses/notImplemented.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;;;GAOG;AACH,cAAM,cAAe,SAAQ,WAAW;IACvC;;;OAGG;gBAES,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAWxC,6EAA6E;IAC7E,UAAU,IAAI,QAAQ;IAUtB,uFAAuF;IACvF,MAAM,IAAI,QAAQ;CAQlB;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1,33 +1,21 @@
1
+ import { BadResponse } from "./_badResponse";
1
2
  /**
2
- * Represents an HTTP error response with a status code of 500 (Internal Server Error).
3
- * This class is used to standardize the structure of a "Server Error" response,
4
- * including the response body, headers, status, and status text.
3
+ * HTTP 500 Internal Server Error an unexpected condition prevented the server from fulfilling the request.
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * throw new ServerError("Failed to connect to the database");
8
+ * ```
5
9
  */
6
- declare class ServerError {
7
- body: any;
8
- cause?: any;
9
- status: number;
10
- statusText: string;
10
+ declare class ServerError extends BadResponse {
11
11
  /**
12
- * Creates an instance of the `ServerError` class.
13
- *
14
- * @param message - A descriptive message explaining the cause of the server error.
15
- * @param cause - Optional additional information about the cause of the error.
12
+ * @param message - Error description.
13
+ * @param cause - Optional extra context (serialized to JSON).
16
14
  */
17
15
  constructor(message: string, cause?: any);
18
- /**
19
- * Converts the `ServerError` instance into a `Response` object with a JSON body.
20
- * This method ensures the response has the appropriate headers, status, and status text.
21
- *
22
- * @returns A `Response` object with the serialized JSON body and response metadata.
23
- */
16
+ /** Converts to a `Response` with `Content-Type: application/json` header. */
24
17
  toResponse(): Response;
25
- /**
26
- * Converts the `ServerError` instance into a `Response` object using the `Response.json` method.
27
- * This method is an alternative to `toResponse` for generating JSON error responses.
28
- *
29
- * @returns A `Response` object with the JSON body and response metadata.
30
- */
18
+ /** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */
31
19
  toJson(): Response;
32
20
  }
33
21
  export { ServerError };
@@ -1 +1 @@
1
- {"version":3,"file":"serverError.d.ts","sourceRoot":"","sources":["../../../src/http/badResponses/serverError.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,cAAM,WAAW;IACf,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,MAAM,EAAE,MAAM,CAAO;IACrB,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;gBAES,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAOxC;;;;;OAKG;IAEH,UAAU,IAAI,QAAQ;IAUtB;;;;;OAKG;IAEH,MAAM,IAAI,QAAQ;CAQnB;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"serverError.d.ts","sourceRoot":"","sources":["../../../src/http/badResponses/serverError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;;;GAOG;AACH,cAAM,WAAY,SAAQ,WAAW;IACpC;;;OAGG;gBAES,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAWxC,6EAA6E;IAC7E,UAAU,IAAI,QAAQ;IAUtB,uFAAuF;IACvF,MAAM,IAAI,QAAQ;CAQlB;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1,33 +1,21 @@
1
+ import { BadResponse } from "./_badResponse";
1
2
  /**
2
- * Represents an HTTP error response with a status code of 401 (Unauthorized).
3
- * This class is used to standardize the structure of an "Unauthorized" error response,
4
- * including the response body, headers, status, and status text.
3
+ * HTTP 401 Unauthorized the request lacks valid authentication credentials.
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * throw new Unauthorized("Invalid or expired token");
8
+ * ```
5
9
  */
6
- declare class Unauthorized {
7
- body: any;
8
- cause?: any;
9
- status: number;
10
- statusText: string;
10
+ declare class Unauthorized extends BadResponse {
11
11
  /**
12
- * Creates an instance of the `Unauthorized` class.
13
- *
14
- * @param message - A descriptive message explaining why the request is unauthorized.
15
- * @param cause - Optional additional information about the cause of the error.
12
+ * @param message - Error description.
13
+ * @param cause - Optional extra context (serialized to JSON).
16
14
  */
17
15
  constructor(message: string, cause?: any);
18
- /**
19
- * Converts the `Unauthorized` instance into a `Response` object with a JSON body.
20
- * This method ensures the response has the appropriate headers, status, and status text.
21
- *
22
- * @returns A `Response` object with the serialized JSON body and response metadata.
23
- */
16
+ /** Converts to a `Response` with `Content-Type: application/json` header. */
24
17
  toResponse(): Response;
25
- /**
26
- * Converts the `Unauthorized` instance into a `Response` object using the `Response.json` method.
27
- * This method is an alternative to `toResponse` for generating JSON error responses.
28
- *
29
- * @returns A `Response` object with the JSON body and response metadata.
30
- */
18
+ /** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */
31
19
  toJson(): Response;
32
20
  }
33
21
  export { Unauthorized };
@@ -1 +1 @@
1
- {"version":3,"file":"unauthorized.d.ts","sourceRoot":"","sources":["../../../src/http/badResponses/unauthorized.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,cAAM,YAAY;IAChB,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,MAAM,EAAE,MAAM,CAAO;IACrB,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;gBAES,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAOxC;;;;;OAKG;IAEH,UAAU,IAAI,QAAQ;IAUtB;;;;;OAKG;IAEH,MAAM,IAAI,QAAQ;CAQnB;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"unauthorized.d.ts","sourceRoot":"","sources":["../../../src/http/badResponses/unauthorized.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;;;GAOG;AACH,cAAM,YAAa,SAAQ,WAAW;IACrC;;;OAGG;gBAES,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG;IAYxC,6EAA6E;IAC7E,UAAU,IAAI,QAAQ;IAUtB,uFAAuF;IACvF,MAAM,IAAI,QAAQ;CAQlB;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}