@arkyn/server 2.0.1-beta.8 → 2.0.1

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/LICENSE.txt +24 -0
  2. package/README.md +116 -0
  3. package/dist/api/__test__/deleteRequest.spec.d.ts +2 -0
  4. package/dist/api/__test__/deleteRequest.spec.d.ts.map +1 -0
  5. package/dist/api/__test__/deleteRequest.spec.js +84 -0
  6. package/dist/api/__test__/getRequest.spec.d.ts +2 -0
  7. package/dist/api/__test__/getRequest.spec.d.ts.map +1 -0
  8. package/dist/api/__test__/getRequest.spec.js +62 -0
  9. package/dist/api/__test__/inboxFlowRequest.spec.d.ts +2 -0
  10. package/dist/api/__test__/inboxFlowRequest.spec.d.ts.map +1 -0
  11. package/dist/api/__test__/inboxFlowRequest.spec.js +96 -0
  12. package/dist/api/__test__/makeRequest.spec.d.ts +2 -0
  13. package/dist/api/__test__/makeRequest.spec.d.ts.map +1 -0
  14. package/dist/api/__test__/makeRequest.spec.js +80 -0
  15. package/dist/api/__test__/patchRequest.spec.d.ts +2 -0
  16. package/dist/api/__test__/patchRequest.spec.d.ts.map +1 -0
  17. package/dist/api/__test__/patchRequest.spec.js +84 -0
  18. package/dist/api/__test__/postRequest.spec.d.ts +2 -0
  19. package/dist/api/__test__/postRequest.spec.d.ts.map +1 -0
  20. package/dist/api/__test__/postRequest.spec.js +84 -0
  21. package/dist/api/__test__/putRequest.spec.d.ts +2 -0
  22. package/dist/api/__test__/putRequest.spec.d.ts.map +1 -0
  23. package/dist/api/__test__/putRequest.spec.js +84 -0
  24. package/dist/api/deleteRequest.d.ts +13 -0
  25. package/dist/api/deleteRequest.d.ts.map +1 -0
  26. package/dist/api/deleteRequest.js +14 -0
  27. package/dist/api/getRequest.d.ts +12 -0
  28. package/dist/api/getRequest.d.ts.map +1 -0
  29. package/dist/api/getRequest.js +13 -0
  30. package/dist/api/inboxFlowRequest.d.ts +40 -0
  31. package/dist/api/inboxFlowRequest.d.ts.map +1 -0
  32. package/dist/api/inboxFlowRequest.js +63 -0
  33. package/dist/api/makeRequest.d.ts +38 -0
  34. package/dist/api/makeRequest.d.ts.map +1 -0
  35. package/dist/api/makeRequest.js +103 -0
  36. package/dist/api/patchRequest.d.ts +13 -0
  37. package/dist/api/patchRequest.d.ts.map +1 -0
  38. package/dist/api/patchRequest.js +14 -0
  39. package/dist/api/postRequest.d.ts +13 -0
  40. package/dist/api/postRequest.d.ts.map +1 -0
  41. package/dist/api/postRequest.js +14 -0
  42. package/dist/api/putRequest.d.ts +13 -0
  43. package/dist/api/putRequest.d.ts.map +1 -0
  44. package/dist/api/putRequest.js +14 -0
  45. package/dist/config/__test__/apiInstance.spec.d.ts +2 -0
  46. package/dist/config/__test__/apiInstance.spec.d.ts.map +1 -0
  47. package/dist/config/__test__/apiInstance.spec.js +86 -0
  48. package/dist/config/__test__/inboxFlowInstance.spec.d.ts +2 -0
  49. package/dist/config/__test__/inboxFlowInstance.spec.d.ts.map +1 -0
  50. package/dist/config/__test__/inboxFlowInstance.spec.js +48 -0
  51. package/dist/config/apiInstance.d.ts +80 -0
  52. package/dist/config/apiInstance.d.ts.map +1 -0
  53. package/dist/config/apiInstance.js +111 -0
  54. package/dist/config/inboxFlowInstance.d.ts +44 -0
  55. package/dist/config/inboxFlowInstance.d.ts.map +1 -0
  56. package/dist/config/inboxFlowInstance.js +46 -0
  57. package/dist/http/badResponses/__test__/badGateway.spec.d.ts +2 -0
  58. package/dist/http/badResponses/__test__/badGateway.spec.d.ts.map +1 -0
  59. package/dist/http/badResponses/__test__/badGateway.spec.js +42 -0
  60. package/dist/http/badResponses/__test__/badRequest.spec.d.ts +2 -0
  61. package/dist/http/badResponses/__test__/badRequest.spec.d.ts.map +1 -0
  62. package/dist/http/badResponses/__test__/badRequest.spec.js +40 -0
  63. package/dist/http/badResponses/__test__/conflict.spec.d.ts +2 -0
  64. package/dist/http/badResponses/__test__/conflict.spec.d.ts.map +1 -0
  65. package/dist/http/badResponses/__test__/conflict.spec.js +40 -0
  66. package/dist/http/badResponses/__test__/forbidden.spec.d.ts +2 -0
  67. package/dist/http/badResponses/__test__/forbidden.spec.d.ts.map +1 -0
  68. package/dist/http/badResponses/__test__/forbidden.spec.js +40 -0
  69. package/dist/http/badResponses/__test__/notFound.spec.d.ts +2 -0
  70. package/dist/http/badResponses/__test__/notFound.spec.d.ts.map +1 -0
  71. package/dist/http/badResponses/__test__/notFound.spec.js +40 -0
  72. package/dist/http/badResponses/__test__/notImplemented.spec.d.ts +2 -0
  73. package/dist/http/badResponses/__test__/notImplemented.spec.d.ts.map +1 -0
  74. package/dist/http/badResponses/__test__/notImplemented.spec.js +40 -0
  75. package/dist/http/badResponses/__test__/serverError.spec.d.ts +2 -0
  76. package/dist/http/badResponses/__test__/serverError.spec.d.ts.map +1 -0
  77. package/dist/http/badResponses/__test__/serverError.spec.js +40 -0
  78. package/dist/http/badResponses/__test__/unauthorized.spec.d.ts +2 -0
  79. package/dist/http/badResponses/__test__/unauthorized.spec.d.ts.map +1 -0
  80. package/dist/http/badResponses/__test__/unauthorized.spec.js +40 -0
  81. package/dist/http/badResponses/__test__/unprocessableEntity.spec.d.ts +2 -0
  82. package/dist/http/badResponses/__test__/unprocessableEntity.spec.d.ts.map +1 -0
  83. package/dist/http/badResponses/__test__/unprocessableEntity.spec.js +66 -0
  84. package/dist/http/badResponses/badGateway.d.ts +23 -0
  85. package/dist/http/badResponses/badGateway.d.ts.map +1 -1
  86. package/dist/http/badResponses/badGateway.js +24 -1
  87. package/dist/http/badResponses/badRequest.d.ts +23 -0
  88. package/dist/http/badResponses/badRequest.d.ts.map +1 -1
  89. package/dist/http/badResponses/badRequest.js +24 -1
  90. package/dist/http/badResponses/conflict.d.ts +23 -0
  91. package/dist/http/badResponses/conflict.d.ts.map +1 -1
  92. package/dist/http/badResponses/conflict.js +24 -1
  93. package/dist/http/badResponses/forbidden.d.ts +23 -0
  94. package/dist/http/badResponses/forbidden.d.ts.map +1 -1
  95. package/dist/http/badResponses/forbidden.js +25 -2
  96. package/dist/http/badResponses/notFound.d.ts +23 -0
  97. package/dist/http/badResponses/notFound.d.ts.map +1 -1
  98. package/dist/http/badResponses/notFound.js +24 -1
  99. package/dist/http/badResponses/notImplemented.d.ts +23 -0
  100. package/dist/http/badResponses/notImplemented.d.ts.map +1 -1
  101. package/dist/http/badResponses/notImplemented.js +24 -1
  102. package/dist/http/badResponses/serverError.d.ts +23 -0
  103. package/dist/http/badResponses/serverError.d.ts.map +1 -1
  104. package/dist/http/badResponses/serverError.js +24 -1
  105. package/dist/http/badResponses/unauthorized.d.ts +23 -0
  106. package/dist/http/badResponses/unauthorized.d.ts.map +1 -1
  107. package/dist/http/badResponses/unauthorized.js +24 -1
  108. package/dist/http/badResponses/unprocessableEntity.d.ts +28 -1
  109. package/dist/http/badResponses/unprocessableEntity.d.ts.map +1 -1
  110. package/dist/http/badResponses/unprocessableEntity.js +30 -3
  111. package/dist/http/successResponses/__test__/created.spec.d.ts +2 -0
  112. package/dist/http/successResponses/__test__/created.spec.d.ts.map +1 -0
  113. package/dist/http/successResponses/__test__/created.spec.js +57 -0
  114. package/dist/http/successResponses/__test__/found.spec.d.ts +2 -0
  115. package/dist/http/successResponses/__test__/found.spec.d.ts.map +1 -0
  116. package/dist/http/successResponses/__test__/found.spec.js +57 -0
  117. package/dist/http/successResponses/__test__/noContent.spec.d.ts +2 -0
  118. package/dist/http/successResponses/__test__/noContent.spec.d.ts.map +1 -0
  119. package/dist/http/successResponses/__test__/noContent.spec.js +40 -0
  120. package/dist/http/successResponses/__test__/success.spec.d.ts +2 -0
  121. package/dist/http/successResponses/__test__/success.spec.d.ts.map +1 -0
  122. package/dist/http/successResponses/__test__/success.spec.js +60 -0
  123. package/dist/http/successResponses/__test__/updated.spec.d.ts +2 -0
  124. package/dist/http/successResponses/__test__/updated.spec.d.ts.map +1 -0
  125. package/dist/http/successResponses/__test__/updated.spec.js +60 -0
  126. package/dist/http/successResponses/created.d.ts +25 -0
  127. package/dist/http/successResponses/created.d.ts.map +1 -1
  128. package/dist/http/successResponses/created.js +25 -0
  129. package/dist/http/successResponses/found.d.ts +28 -0
  130. package/dist/http/successResponses/found.d.ts.map +1 -1
  131. package/dist/http/successResponses/found.js +28 -0
  132. package/dist/http/successResponses/noContent.d.ts +16 -1
  133. package/dist/http/successResponses/noContent.d.ts.map +1 -1
  134. package/dist/http/successResponses/noContent.js +16 -8
  135. package/dist/http/successResponses/success.d.ts +25 -0
  136. package/dist/http/successResponses/success.d.ts.map +1 -1
  137. package/dist/http/successResponses/success.js +25 -0
  138. package/dist/http/successResponses/updated.d.ts +25 -0
  139. package/dist/http/successResponses/updated.d.ts.map +1 -1
  140. package/dist/http/successResponses/updated.js +25 -0
  141. package/dist/index.d.ts +6 -0
  142. package/dist/index.d.ts.map +1 -1
  143. package/dist/index.js +10 -0
  144. package/dist/services/__test__/decodeRequestBody.spec.d.ts +2 -0
  145. package/dist/services/__test__/decodeRequestBody.spec.d.ts.map +1 -0
  146. package/dist/services/__test__/decodeRequestBody.spec.js +39 -0
  147. package/dist/services/__test__/errorHandler.spec.d.ts +2 -0
  148. package/dist/services/__test__/errorHandler.spec.d.ts.map +1 -0
  149. package/dist/services/__test__/errorHandler.spec.js +115 -0
  150. package/dist/services/__test__/formParse.spec.d.ts +2 -0
  151. package/dist/services/__test__/formParse.spec.d.ts.map +1 -0
  152. package/dist/services/__test__/formParse.spec.js +78 -0
  153. package/dist/services/__test__/getCaller.spec.d.ts +2 -0
  154. package/dist/services/__test__/getCaller.spec.d.ts.map +1 -0
  155. package/dist/services/__test__/getCaller.spec.js +60 -0
  156. package/dist/services/__test__/getScopedParams.spec.d.ts +2 -0
  157. package/dist/services/__test__/getScopedParams.spec.d.ts.map +1 -0
  158. package/dist/services/__test__/getScopedParams.spec.js +51 -0
  159. package/dist/services/__test__/schemaValidator.spec.d.ts +2 -0
  160. package/dist/services/__test__/schemaValidator.spec.d.ts.map +1 -0
  161. package/dist/services/__test__/schemaValidator.spec.js +89 -0
  162. package/dist/services/decodeErrorMessageFromRequest.d.ts +17 -0
  163. package/dist/services/decodeErrorMessageFromRequest.d.ts.map +1 -0
  164. package/dist/services/decodeErrorMessageFromRequest.js +30 -0
  165. package/dist/services/decodeRequestBody.d.ts.map +1 -1
  166. package/dist/services/decodeRequestBody.js +12 -16
  167. package/dist/services/errorHandler.d.ts +42 -1
  168. package/dist/services/errorHandler.d.ts.map +1 -1
  169. package/dist/services/errorHandler.js +42 -0
  170. package/dist/services/formParse.d.ts.map +1 -1
  171. package/dist/services/formParse.js +4 -2
  172. package/dist/services/getCaller.d.ts +17 -0
  173. package/dist/services/getCaller.d.ts.map +1 -0
  174. package/dist/services/getCaller.js +45 -0
  175. package/dist/services/httpDebug.d.ts +35 -0
  176. package/dist/services/httpDebug.d.ts.map +1 -0
  177. package/dist/services/httpDebug.js +56 -0
  178. package/dist/services/schemaValidator.d.ts +13 -0
  179. package/dist/services/schemaValidator.d.ts.map +1 -0
  180. package/dist/services/schemaValidator.js +51 -0
  181. package/package.json +13 -6
  182. package/src/api/__test__/deleteRequest.spec.ts +107 -0
  183. package/src/api/__test__/getRequest.spec.ts +76 -0
  184. package/src/api/__test__/inboxFlowRequest.spec.ts +125 -0
  185. package/src/api/__test__/makeRequest.spec.ts +121 -0
  186. package/src/api/__test__/patchRequest.spec.ts +125 -0
  187. package/src/api/__test__/postRequest.spec.ts +125 -0
  188. package/src/api/__test__/putRequest.spec.ts +125 -0
  189. package/src/api/deleteRequest.ts +22 -0
  190. package/src/api/getRequest.ts +20 -0
  191. package/src/api/inboxFlowRequest.ts +76 -0
  192. package/src/api/makeRequest.ts +117 -0
  193. package/src/api/patchRequest.ts +22 -0
  194. package/src/api/postRequest.ts +22 -0
  195. package/src/api/putRequest.ts +22 -0
  196. package/src/config/__test__/apiInstance.spec.ts +129 -0
  197. package/src/config/__test__/inboxFlowInstance.spec.ts +61 -0
  198. package/src/config/apiInstance.ts +148 -0
  199. package/src/config/inboxFlowInstance.ts +65 -0
  200. package/src/http/badResponses/__test__/badGateway.spec.ts +50 -0
  201. package/src/http/badResponses/__test__/badRequest.spec.ts +50 -0
  202. package/src/http/badResponses/__test__/conflict.spec.ts +50 -0
  203. package/src/http/badResponses/__test__/forbidden.spec.ts +50 -0
  204. package/src/http/badResponses/__test__/notFound.spec.ts +50 -0
  205. package/src/http/badResponses/__test__/notImplemented.spec.ts +50 -0
  206. package/src/http/badResponses/__test__/serverError.spec.ts +50 -0
  207. package/src/http/badResponses/__test__/unauthorized.spec.ts +50 -0
  208. package/src/http/badResponses/__test__/unprocessableEntity.spec.ts +76 -0
  209. package/src/http/badResponses/badGateway.ts +29 -2
  210. package/src/http/badResponses/badRequest.ts +29 -2
  211. package/src/http/badResponses/conflict.ts +29 -2
  212. package/src/http/badResponses/forbidden.ts +30 -3
  213. package/src/http/badResponses/notFound.ts +29 -2
  214. package/src/http/badResponses/notImplemented.ts +29 -2
  215. package/src/http/badResponses/serverError.ts +29 -2
  216. package/src/http/badResponses/unauthorized.ts +29 -2
  217. package/src/http/badResponses/unprocessableEntity.ts +33 -2
  218. package/src/http/successResponses/__test__/created.spec.ts +65 -0
  219. package/src/http/successResponses/__test__/found.spec.ts +65 -0
  220. package/src/http/successResponses/__test__/noContent.spec.ts +49 -0
  221. package/src/http/successResponses/__test__/success.spec.ts +68 -0
  222. package/src/http/successResponses/__test__/updated.spec.ts +68 -0
  223. package/src/http/successResponses/created.ts +31 -2
  224. package/src/http/successResponses/found.ts +32 -0
  225. package/src/http/successResponses/noContent.ts +20 -11
  226. package/src/http/successResponses/success.ts +31 -2
  227. package/src/http/successResponses/updated.ts +31 -2
  228. package/src/index.ts +9 -1
  229. package/src/services/__test__/decodeRequestBody.spec.ts +51 -0
  230. package/src/services/__test__/errorHandler.spec.ts +133 -0
  231. package/src/services/__test__/formParse.spec.ts +96 -0
  232. package/src/services/__test__/getCaller.spec.ts +78 -0
  233. package/src/services/__test__/getScopedParams.spec.ts +68 -0
  234. package/src/services/__test__/schemaValidator.spec.ts +106 -0
  235. package/src/services/decodeErrorMessageFromRequest.ts +36 -0
  236. package/src/services/decodeRequestBody.ts +11 -15
  237. package/src/services/errorHandler.ts +45 -1
  238. package/src/services/formParse.ts +4 -5
  239. package/src/services/getCaller.ts +39 -21
  240. package/src/services/httpDebug.ts +46 -5
  241. package/vitest.config.ts +5 -0
  242. package/dist/http/httpDebug.d.ts +0 -3
  243. package/dist/http/httpDebug.d.ts.map +0 -1
  244. package/dist/http/httpDebug.js +0 -15
@@ -0,0 +1,60 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { Success } from "../success";
3
+ describe("Success", () => {
4
+ it("should create a response with default values", () => {
5
+ const body = { message: "Success" };
6
+ const success = new Success(body);
7
+ const response = success.toResponse();
8
+ expect(response.status).toBe(200);
9
+ expect(response.statusText).toBe("OK");
10
+ expect(response.headers.get("Content-Type")).toBe("application/json");
11
+ return response.json().then((data) => {
12
+ expect(data).toEqual(body);
13
+ });
14
+ });
15
+ it("should create a response with custom values", () => {
16
+ const body = { message: "Custom Success" };
17
+ const init = {
18
+ headers: { "X-Custom-Header": "CustomValue" },
19
+ status: 201,
20
+ statusText: "Created",
21
+ };
22
+ const success = new Success(body, init);
23
+ const response = success.toResponse();
24
+ expect(response.status).toBe(201);
25
+ expect(response.statusText).toBe("Created");
26
+ expect(response.headers.get("Content-Type")).toBe("application/json");
27
+ expect(response.headers.get("X-Custom-Header")).toBe("CustomValue");
28
+ return response.json().then((data) => {
29
+ expect(data).toEqual(body);
30
+ });
31
+ });
32
+ it("should create a JSON response with default values using toJson", () => {
33
+ const body = { message: "Success" };
34
+ const success = new Success(body);
35
+ const response = success.toJson();
36
+ expect(response.status).toBe(200);
37
+ expect(response.statusText).toBe("OK");
38
+ expect(response.headers.get("Content-Type")).toBe("application/json");
39
+ return response.json().then((data) => {
40
+ expect(data).toEqual(body);
41
+ });
42
+ });
43
+ it("should create a JSON response with custom values using toJson", () => {
44
+ const body = { message: "Custom Success" };
45
+ const init = {
46
+ headers: { "X-Custom-Header": "CustomValue" },
47
+ status: 201,
48
+ statusText: "Created",
49
+ };
50
+ const success = new Success(body, init);
51
+ const response = success.toJson();
52
+ expect(response.status).toBe(201);
53
+ expect(response.statusText).toBe("Created");
54
+ expect(response.headers.get("Content-Type")).toBe("application/json");
55
+ expect(response.headers.get("X-Custom-Header")).toBe("CustomValue");
56
+ return response.json().then((data) => {
57
+ expect(data).toEqual(body);
58
+ });
59
+ });
60
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=updated.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updated.spec.d.ts","sourceRoot":"","sources":["../../../../src/http/successResponses/__test__/updated.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,60 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { Updated } from "../updated";
3
+ describe("Updated", () => {
4
+ it("should create a response with default values", () => {
5
+ const body = { message: "Resource updated" };
6
+ const updated = new Updated(body);
7
+ const response = updated.toResponse();
8
+ expect(response.status).toBe(200);
9
+ expect(response.statusText).toBe("Resource updated successfully");
10
+ expect(response.headers.get("Content-Type")).toBe("application/json");
11
+ return response.json().then((data) => {
12
+ expect(data).toEqual(body);
13
+ });
14
+ });
15
+ it("should create a response with custom values", () => {
16
+ const body = { message: "Custom update" };
17
+ const init = {
18
+ headers: { "X-Custom-Header": "CustomValue" },
19
+ status: 202,
20
+ statusText: "Accepted",
21
+ };
22
+ const updated = new Updated(body, init);
23
+ const response = updated.toResponse();
24
+ expect(response.status).toBe(202);
25
+ expect(response.statusText).toBe("Accepted");
26
+ expect(response.headers.get("Content-Type")).toBe("application/json");
27
+ expect(response.headers.get("X-Custom-Header")).toBe("CustomValue");
28
+ return response.json().then((data) => {
29
+ expect(data).toEqual(body);
30
+ });
31
+ });
32
+ it("should create a JSON response with default values using toJson", () => {
33
+ const body = { message: "Resource updated" };
34
+ const updated = new Updated(body);
35
+ const response = updated.toJson();
36
+ expect(response.status).toBe(200);
37
+ expect(response.statusText).toBe("Resource updated successfully");
38
+ expect(response.headers.get("Content-Type")).toBe("application/json");
39
+ return response.json().then((data) => {
40
+ expect(data).toEqual(body);
41
+ });
42
+ });
43
+ it("should create a JSON response with custom values using toJson", () => {
44
+ const body = { message: "Custom update" };
45
+ const init = {
46
+ headers: { "X-Custom-Header": "CustomValue" },
47
+ status: 202,
48
+ statusText: "Accepted",
49
+ };
50
+ const updated = new Updated(body, init);
51
+ const response = updated.toJson();
52
+ expect(response.status).toBe(202);
53
+ expect(response.statusText).toBe("Accepted");
54
+ expect(response.headers.get("Content-Type")).toBe("application/json");
55
+ expect(response.headers.get("X-Custom-Header")).toBe("CustomValue");
56
+ return response.json().then((data) => {
57
+ expect(data).toEqual(body);
58
+ });
59
+ });
60
+ });
@@ -1,10 +1,35 @@
1
+ /**
2
+ * Represents a successful HTTP response with a status code of 201 (Created).
3
+ * This class is used to standardize the structure of a "Created" response,
4
+ * including the response body, headers, status, and status text.
5
+ *
6
+ * @template T - The type of the response body.
7
+ */
1
8
  declare class Created<T> {
2
9
  body: T;
3
10
  headers: ResponseInit["headers"];
4
11
  status: number;
5
12
  statusText: string;
13
+ /**
14
+ * Creates an instance of the `Created` class.
15
+ *
16
+ * @param body - The response body to be included in the HTTP response.
17
+ * @param init - Optional initialization object for customizing headers, status, and status text.
18
+ */
6
19
  constructor(body: T, init?: ResponseInit);
20
+ /**
21
+ * Converts the `Created` instance into a `Response` object with a JSON body.
22
+ * This method ensures the response has the appropriate headers, status, and status text.
23
+ *
24
+ * @returns A `Response` object with the serialized JSON body and response metadata.
25
+ */
7
26
  toResponse(): Response;
27
+ /**
28
+ * Converts the `Created` instance into a `Response` object using the `Response.json` method.
29
+ * This method is an alternative to `toResponse` for generating JSON responses.
30
+ *
31
+ * @returns A `Response` object with the JSON body and response metadata.
32
+ */
8
33
  toJson(): Response;
9
34
  }
10
35
  export { Created };
@@ -1 +1 @@
1
- {"version":3,"file":"created.d.ts","sourceRoot":"","sources":["../../../src/http/successResponses/created.ts"],"names":[],"mappings":"AAAA,cAAM,OAAO,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;gBAEP,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,YAAY;IAOxC,UAAU;IAUV,MAAM;CASP;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"created.d.ts","sourceRoot":"","sources":["../../../src/http/successResponses/created.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAM,OAAO,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;gBAES,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,YAAY;IAOxC;;;;;OAKG;IAEH,UAAU,IAAI,QAAQ;IAUtB;;;;;OAKG;IAEH,MAAM,IAAI,QAAQ;CASnB;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -1,14 +1,33 @@
1
+ /**
2
+ * Represents a successful HTTP response with a status code of 201 (Created).
3
+ * This class is used to standardize the structure of a "Created" response,
4
+ * including the response body, headers, status, and status text.
5
+ *
6
+ * @template T - The type of the response body.
7
+ */
1
8
  class Created {
2
9
  body;
3
10
  headers;
4
11
  status;
5
12
  statusText;
13
+ /**
14
+ * Creates an instance of the `Created` class.
15
+ *
16
+ * @param body - The response body to be included in the HTTP response.
17
+ * @param init - Optional initialization object for customizing headers, status, and status text.
18
+ */
6
19
  constructor(body, init) {
7
20
  this.body = body;
8
21
  this.headers = init?.headers || {};
9
22
  this.status = init?.status || 201;
10
23
  this.statusText = init?.statusText || "Resource created successfully";
11
24
  }
25
+ /**
26
+ * Converts the `Created` instance into a `Response` object with a JSON body.
27
+ * This method ensures the response has the appropriate headers, status, and status text.
28
+ *
29
+ * @returns A `Response` object with the serialized JSON body and response metadata.
30
+ */
12
31
  toResponse() {
13
32
  const responseInit = {
14
33
  headers: { "Content-Type": "application/json", ...this.headers },
@@ -17,6 +36,12 @@ class Created {
17
36
  };
18
37
  return new Response(JSON.stringify(this.body), responseInit);
19
38
  }
39
+ /**
40
+ * Converts the `Created` instance into a `Response` object using the `Response.json` method.
41
+ * This method is an alternative to `toResponse` for generating JSON responses.
42
+ *
43
+ * @returns A `Response` object with the JSON body and response metadata.
44
+ */
20
45
  toJson() {
21
46
  const responseInit = {
22
47
  headers: this.headers,
@@ -1,10 +1,38 @@
1
+ /**
2
+ * Represents an HTTP 302 Found response.
3
+ * This class is used to create a standardized HTTP response with a status of 302 (Found),
4
+ * including optional headers and a response body.
5
+ *
6
+ * @template T - The type of the response body.
7
+ */
1
8
  declare class Found<T> {
2
9
  body: T;
3
10
  headers: ResponseInit["headers"];
4
11
  status: number;
5
12
  statusText: string;
13
+ /**
14
+ * Creates an instance of the `Found` class.
15
+ *
16
+ * @param body - The body of the response.
17
+ * @param init - Optional initialization object to set headers, status, and statusText.
18
+ * - `headers`: Additional headers to include in the response.
19
+ * - `status`: HTTP status code (default is 302).
20
+ * - `statusText`: HTTP status text (default is "Found").
21
+ */
6
22
  constructor(body: T, init?: ResponseInit);
23
+ /**
24
+ * Converts the `Found` instance into a `Response` object.
25
+ * This method serializes the response body as JSON and includes the appropriate headers.
26
+ *
27
+ * @returns A `Response` object with the serialized JSON body and the specified headers, status, and statusText.
28
+ */
7
29
  toResponse(): Response;
30
+ /**
31
+ * Converts the `Found` instance into a JSON response using `Response.json`.
32
+ * This method is an alternative to `toResponse` for creating JSON responses.
33
+ *
34
+ * @returns A `Response` object with the JSON body and the specified headers, status, and statusText.
35
+ */
8
36
  toJson(): Response;
9
37
  }
10
38
  export { Found };
@@ -1 +1 @@
1
- {"version":3,"file":"found.d.ts","sourceRoot":"","sources":["../../../src/http/successResponses/found.ts"],"names":[],"mappings":"AAAA,cAAM,KAAK,CAAC,CAAC;IACX,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;gBAEP,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,YAAY;IAOxC,UAAU;IAUV,MAAM;CASP;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"found.d.ts","sourceRoot":"","sources":["../../../src/http/successResponses/found.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAM,KAAK,CAAC,CAAC;IACX,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;;;OAQG;gBAES,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,YAAY;IAOxC;;;;;OAKG;IAEH,UAAU;IAUV;;;;;OAKG;IAEH,MAAM;CASP;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -1,14 +1,36 @@
1
+ /**
2
+ * Represents an HTTP 302 Found response.
3
+ * This class is used to create a standardized HTTP response with a status of 302 (Found),
4
+ * including optional headers and a response body.
5
+ *
6
+ * @template T - The type of the response body.
7
+ */
1
8
  class Found {
2
9
  body;
3
10
  headers;
4
11
  status;
5
12
  statusText;
13
+ /**
14
+ * Creates an instance of the `Found` class.
15
+ *
16
+ * @param body - The body of the response.
17
+ * @param init - Optional initialization object to set headers, status, and statusText.
18
+ * - `headers`: Additional headers to include in the response.
19
+ * - `status`: HTTP status code (default is 302).
20
+ * - `statusText`: HTTP status text (default is "Found").
21
+ */
6
22
  constructor(body, init) {
7
23
  this.body = body;
8
24
  this.headers = init?.headers || {};
9
25
  this.status = init?.status || 302;
10
26
  this.statusText = init?.statusText || "Found";
11
27
  }
28
+ /**
29
+ * Converts the `Found` instance into a `Response` object.
30
+ * This method serializes the response body as JSON and includes the appropriate headers.
31
+ *
32
+ * @returns A `Response` object with the serialized JSON body and the specified headers, status, and statusText.
33
+ */
12
34
  toResponse() {
13
35
  const responseInit = {
14
36
  headers: { "Content-Type": "application/json", ...this.headers },
@@ -17,6 +39,12 @@ class Found {
17
39
  };
18
40
  return new Response(JSON.stringify(this.body), responseInit);
19
41
  }
42
+ /**
43
+ * Converts the `Found` instance into a JSON response using `Response.json`.
44
+ * This method is an alternative to `toResponse` for creating JSON responses.
45
+ *
46
+ * @returns A `Response` object with the JSON body and the specified headers, status, and statusText.
47
+ */
20
48
  toJson() {
21
49
  const responseInit = {
22
50
  headers: this.headers,
@@ -1,10 +1,25 @@
1
+ /**
2
+ * Represents a successful HTTP response with a status code of 204 (No Content).
3
+ * This class is used to standardize the structure of a "No Content" response,
4
+ * including headers, status, and status text.
5
+ */
1
6
  declare class NoContent {
2
7
  headers: ResponseInit["headers"];
3
8
  status: number;
4
9
  statusText: string;
10
+ /**
11
+ * Creates an instance of the `NoContent` class.
12
+ *
13
+ * @param init - Optional initialization object for customizing headers, status, and status text.
14
+ */
5
15
  constructor(init?: ResponseInit);
16
+ /**
17
+ * Converts the `NoContent` instance into a `Response` object.
18
+ * This method ensures the response has the appropriate headers, status, and status text.
19
+ *
20
+ * @returns A `Response` object with no body and response metadata.
21
+ */
6
22
  toResponse(): Response;
7
- toJson(): Response;
8
23
  }
9
24
  export { NoContent };
10
25
  //# sourceMappingURL=noContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"noContent.d.ts","sourceRoot":"","sources":["../../../src/http/successResponses/noContent.ts"],"names":[],"mappings":"AAAA,cAAM,SAAS;IACb,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;gBAEP,IAAI,CAAC,EAAE,YAAY;IAM/B,UAAU;IAUV,MAAM;CASP;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"noContent.d.ts","sourceRoot":"","sources":["../../../src/http/successResponses/noContent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAM,SAAS;IACb,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;gBAES,IAAI,CAAC,EAAE,YAAY;IAM/B;;;;;OAKG;IAEH,UAAU,IAAI,QAAQ;CASvB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1,12 +1,28 @@
1
+ /**
2
+ * Represents a successful HTTP response with a status code of 204 (No Content).
3
+ * This class is used to standardize the structure of a "No Content" response,
4
+ * including headers, status, and status text.
5
+ */
1
6
  class NoContent {
2
7
  headers;
3
8
  status;
4
9
  statusText;
10
+ /**
11
+ * Creates an instance of the `NoContent` class.
12
+ *
13
+ * @param init - Optional initialization object for customizing headers, status, and status text.
14
+ */
5
15
  constructor(init) {
6
16
  this.headers = init?.headers || {};
7
17
  this.status = init?.status || 204;
8
18
  this.statusText = init?.statusText ?? "No content";
9
19
  }
20
+ /**
21
+ * Converts the `NoContent` instance into a `Response` object.
22
+ * This method ensures the response has the appropriate headers, status, and status text.
23
+ *
24
+ * @returns A `Response` object with no body and response metadata.
25
+ */
10
26
  toResponse() {
11
27
  const responseInit = {
12
28
  headers: this.headers,
@@ -15,13 +31,5 @@ class NoContent {
15
31
  };
16
32
  return new Response(null, responseInit);
17
33
  }
18
- toJson() {
19
- const responseInit = {
20
- headers: this.headers,
21
- status: this.status,
22
- statusText: this.statusText,
23
- };
24
- return Response.json(null, responseInit);
25
- }
26
34
  }
27
35
  export { NoContent };
@@ -1,10 +1,35 @@
1
+ /**
2
+ * Represents a successful HTTP response with a status code of 200 (OK).
3
+ * This class is used to standardize the structure of a "Success" response,
4
+ * including the response body, headers, status, and status text.
5
+ *
6
+ * @template T - The type of the response body.
7
+ */
1
8
  declare class Success<T> {
2
9
  body: T;
3
10
  headers: ResponseInit["headers"];
4
11
  status: number;
5
12
  statusText: string;
13
+ /**
14
+ * Creates an instance of the `Success` class.
15
+ *
16
+ * @param body - The response body to be included in the HTTP response.
17
+ * @param init - Optional initialization object for customizing headers, status, and status text.
18
+ */
6
19
  constructor(body: T, init?: ResponseInit);
20
+ /**
21
+ * Converts the `Success` instance into a `Response` object with a JSON body.
22
+ * This method ensures the response has the appropriate headers, status, and status text.
23
+ *
24
+ * @returns A `Response` object with the serialized JSON body and response metadata.
25
+ */
7
26
  toResponse(): Response;
27
+ /**
28
+ * Converts the `Success` instance into a `Response` object using the `Response.json` method.
29
+ * This method is an alternative to `toResponse` for generating JSON responses.
30
+ *
31
+ * @returns A `Response` object with the JSON body and response metadata.
32
+ */
8
33
  toJson(): Response;
9
34
  }
10
35
  export { Success };
@@ -1 +1 @@
1
- {"version":3,"file":"success.d.ts","sourceRoot":"","sources":["../../../src/http/successResponses/success.ts"],"names":[],"mappings":"AAAA,cAAM,OAAO,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;gBAEP,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,YAAY;IAOxC,UAAU;IAUV,MAAM;CASP;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"success.d.ts","sourceRoot":"","sources":["../../../src/http/successResponses/success.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAM,OAAO,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;gBAES,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,YAAY;IAOxC;;;;;OAKG;IAEH,UAAU,IAAI,QAAQ;IAUtB;;;;;OAKG;IAEH,MAAM,IAAI,QAAQ;CASnB;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -1,14 +1,33 @@
1
+ /**
2
+ * Represents a successful HTTP response with a status code of 200 (OK).
3
+ * This class is used to standardize the structure of a "Success" response,
4
+ * including the response body, headers, status, and status text.
5
+ *
6
+ * @template T - The type of the response body.
7
+ */
1
8
  class Success {
2
9
  body;
3
10
  headers;
4
11
  status;
5
12
  statusText;
13
+ /**
14
+ * Creates an instance of the `Success` class.
15
+ *
16
+ * @param body - The response body to be included in the HTTP response.
17
+ * @param init - Optional initialization object for customizing headers, status, and status text.
18
+ */
6
19
  constructor(body, init) {
7
20
  this.body = body;
8
21
  this.headers = init?.headers || {};
9
22
  this.status = init?.status || 200;
10
23
  this.statusText = init?.statusText ?? "OK";
11
24
  }
25
+ /**
26
+ * Converts the `Success` instance into a `Response` object with a JSON body.
27
+ * This method ensures the response has the appropriate headers, status, and status text.
28
+ *
29
+ * @returns A `Response` object with the serialized JSON body and response metadata.
30
+ */
12
31
  toResponse() {
13
32
  const responseInit = {
14
33
  headers: { "Content-Type": "application/json", ...this.headers },
@@ -17,6 +36,12 @@ class Success {
17
36
  };
18
37
  return new Response(JSON.stringify(this.body), responseInit);
19
38
  }
39
+ /**
40
+ * Converts the `Success` instance into a `Response` object using the `Response.json` method.
41
+ * This method is an alternative to `toResponse` for generating JSON responses.
42
+ *
43
+ * @returns A `Response` object with the JSON body and response metadata.
44
+ */
20
45
  toJson() {
21
46
  const responseInit = {
22
47
  headers: this.headers,
@@ -1,10 +1,35 @@
1
+ /**
2
+ * Represents a successful HTTP response with a status code of 200 (OK) or other custom status codes.
3
+ * This class is used to standardize the structure of an "Updated" response,
4
+ * including the response body, headers, status, and status text.
5
+ *
6
+ * @template T - The type of the response body.
7
+ */
1
8
  declare class Updated<T> {
2
9
  body: T;
3
10
  headers: ResponseInit["headers"];
4
11
  status: number;
5
12
  statusText: string;
13
+ /**
14
+ * Creates an instance of the `Updated` class.
15
+ *
16
+ * @param body - The response body to be included in the HTTP response.
17
+ * @param init - Optional initialization object for customizing headers, status, and status text.
18
+ */
6
19
  constructor(body: T, init?: ResponseInit);
20
+ /**
21
+ * Converts the `Updated` instance into a `Response` object with a JSON body.
22
+ * This method ensures the response has the appropriate headers, status, and status text.
23
+ *
24
+ * @returns A `Response` object with the serialized JSON body and response metadata.
25
+ */
7
26
  toResponse(): Response;
27
+ /**
28
+ * Converts the `Updated` instance into a `Response` object using the `Response.json` method.
29
+ * This method is an alternative to `toResponse` for generating JSON responses.
30
+ *
31
+ * @returns A `Response` object with the JSON body and response metadata.
32
+ */
8
33
  toJson(): Response;
9
34
  }
10
35
  export { Updated };
@@ -1 +1 @@
1
- {"version":3,"file":"updated.d.ts","sourceRoot":"","sources":["../../../src/http/successResponses/updated.ts"],"names":[],"mappings":"AAAA,cAAM,OAAO,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;gBAEP,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,YAAY;IAOxC,UAAU;IAUV,MAAM;CASP;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"updated.d.ts","sourceRoot":"","sources":["../../../src/http/successResponses/updated.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAM,OAAO,CAAC,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;OAKG;gBAES,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,YAAY;IAOxC;;;;;OAKG;IAEH,UAAU,IAAI,QAAQ;IAUtB;;;;;OAKG;IAEH,MAAM,IAAI,QAAQ;CASnB;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -1,14 +1,33 @@
1
+ /**
2
+ * Represents a successful HTTP response with a status code of 200 (OK) or other custom status codes.
3
+ * This class is used to standardize the structure of an "Updated" response,
4
+ * including the response body, headers, status, and status text.
5
+ *
6
+ * @template T - The type of the response body.
7
+ */
1
8
  class Updated {
2
9
  body;
3
10
  headers;
4
11
  status;
5
12
  statusText;
13
+ /**
14
+ * Creates an instance of the `Updated` class.
15
+ *
16
+ * @param body - The response body to be included in the HTTP response.
17
+ * @param init - Optional initialization object for customizing headers, status, and status text.
18
+ */
6
19
  constructor(body, init) {
7
20
  this.body = body;
8
21
  this.headers = init?.headers || {};
9
22
  this.status = init?.status || 200;
10
23
  this.statusText = init?.statusText || "Resource updated successfully";
11
24
  }
25
+ /**
26
+ * Converts the `Updated` instance into a `Response` object with a JSON body.
27
+ * This method ensures the response has the appropriate headers, status, and status text.
28
+ *
29
+ * @returns A `Response` object with the serialized JSON body and response metadata.
30
+ */
12
31
  toResponse() {
13
32
  const responseInit = {
14
33
  headers: { "Content-Type": "application/json", ...this.headers },
@@ -17,6 +36,12 @@ class Updated {
17
36
  };
18
37
  return new Response(JSON.stringify(this.body), responseInit);
19
38
  }
39
+ /**
40
+ * Converts the `Updated` instance into a `Response` object using the `Response.json` method.
41
+ * This method is an alternative to `toResponse` for generating JSON responses.
42
+ *
43
+ * @returns A `Response` object with the JSON body and response metadata.
44
+ */
20
45
  toJson() {
21
46
  const responseInit = {
22
47
  headers: this.headers,
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export { ApiInstance } from "./config/apiInstance";
2
+ export { InboxFlowInstance } from "./config/inboxFlowInstance";
1
3
  export { BadGateway } from "./http/badResponses/badGateway";
2
4
  export { BadRequest } from "./http/badResponses/badRequest";
3
5
  export { Conflict } from "./http/badResponses/conflict";
@@ -12,9 +14,13 @@ export { Found } from "./http/successResponses/found";
12
14
  export { NoContent } from "./http/successResponses/noContent";
13
15
  export { Success } from "./http/successResponses/success";
14
16
  export { Updated } from "./http/successResponses/updated";
17
+ export { decodeErrorMessageFromRequest } from "./services/decodeErrorMessageFromRequest";
15
18
  export { decodeRequestBody } from "./services/decodeRequestBody";
16
19
  export { errorHandler } from "./services/errorHandler";
17
20
  export { formParse } from "./services/formParse";
21
+ export { getCaller } from "./services/getCaller";
18
22
  export { getScopedParams } from "./services/getScopedParams";
23
+ export { httpDebug } from "./services/httpDebug";
24
+ export { SchemaValidator } from "./services/schemaValidator";
19
25
  export { sendFileToS3 } from "./services/sendFileToS3";
20
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAE9E,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAG/D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAG9E,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAG1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,7 @@
1
+ // config
2
+ export { ApiInstance } from "./config/apiInstance";
3
+ export { InboxFlowInstance } from "./config/inboxFlowInstance";
4
+ // http bad responses
1
5
  export { BadGateway } from "./http/badResponses/badGateway";
2
6
  export { BadRequest } from "./http/badResponses/badRequest";
3
7
  export { Conflict } from "./http/badResponses/conflict";
@@ -7,13 +11,19 @@ export { NotImplemented } from "./http/badResponses/notImplemented";
7
11
  export { ServerError } from "./http/badResponses/serverError";
8
12
  export { Unauthorized } from "./http/badResponses/unauthorized";
9
13
  export { UnprocessableEntity } from "./http/badResponses/unprocessableEntity";
14
+ // http success responses
10
15
  export { Created } from "./http/successResponses/created";
11
16
  export { Found } from "./http/successResponses/found";
12
17
  export { NoContent } from "./http/successResponses/noContent";
13
18
  export { Success } from "./http/successResponses/success";
14
19
  export { Updated } from "./http/successResponses/updated";
20
+ // services
21
+ export { decodeErrorMessageFromRequest } from "./services/decodeErrorMessageFromRequest";
15
22
  export { decodeRequestBody } from "./services/decodeRequestBody";
16
23
  export { errorHandler } from "./services/errorHandler";
17
24
  export { formParse } from "./services/formParse";
25
+ export { getCaller } from "./services/getCaller";
18
26
  export { getScopedParams } from "./services/getScopedParams";
27
+ export { httpDebug } from "./services/httpDebug";
28
+ export { SchemaValidator } from "./services/schemaValidator";
19
29
  export { sendFileToS3 } from "./services/sendFileToS3";
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=decodeRequestBody.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decodeRequestBody.spec.d.ts","sourceRoot":"","sources":["../../../src/services/__test__/decodeRequestBody.spec.ts"],"names":[],"mappings":""}