@eleva-io/erp-sdk 0.1.138 → 0.1.140

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 (249) hide show
  1. package/dist/cjs/errors/app_error.d.ts +18 -0
  2. package/dist/cjs/errors/app_error.d.ts.map +1 -0
  3. package/dist/cjs/errors/app_error.js +57 -0
  4. package/dist/cjs/errors/app_error.js.map +1 -0
  5. package/dist/cjs/errors/catalog.d.ts +218 -0
  6. package/dist/cjs/errors/catalog.d.ts.map +1 -0
  7. package/dist/cjs/errors/catalog.js +14 -0
  8. package/dist/cjs/errors/catalog.js.map +1 -0
  9. package/dist/cjs/errors/catalog_api.d.ts +21 -0
  10. package/dist/cjs/errors/catalog_api.d.ts.map +1 -0
  11. package/dist/cjs/errors/catalog_api.js +18 -0
  12. package/dist/cjs/errors/catalog_api.js.map +1 -0
  13. package/dist/cjs/errors/catalog_base.d.ts +204 -0
  14. package/dist/cjs/errors/catalog_base.d.ts.map +1 -0
  15. package/dist/cjs/errors/catalog_base.js +153 -0
  16. package/dist/cjs/errors/catalog_base.js.map +1 -0
  17. package/dist/cjs/errors/catalog_types.d.ts +12 -0
  18. package/dist/cjs/errors/catalog_types.d.ts.map +1 -0
  19. package/dist/cjs/errors/catalog_types.js +9 -0
  20. package/dist/cjs/errors/catalog_types.js.map +1 -0
  21. package/dist/cjs/errors/errors.d.ts +103 -0
  22. package/dist/cjs/errors/errors.d.ts.map +1 -0
  23. package/dist/cjs/errors/errors.js +151 -0
  24. package/dist/cjs/errors/errors.js.map +1 -0
  25. package/dist/cjs/errors/errors.spec.d.ts +2 -0
  26. package/dist/cjs/errors/errors.spec.d.ts.map +1 -0
  27. package/dist/cjs/errors/errors.spec.js +237 -0
  28. package/dist/cjs/errors/errors.spec.js.map +1 -0
  29. package/dist/cjs/errors/errors_remote.d.ts +28 -0
  30. package/dist/cjs/errors/errors_remote.d.ts.map +1 -0
  31. package/dist/cjs/errors/errors_remote.js +34 -0
  32. package/dist/cjs/errors/errors_remote.js.map +1 -0
  33. package/dist/cjs/errors/errors_remote.spec.d.ts +2 -0
  34. package/dist/cjs/errors/errors_remote.spec.d.ts.map +1 -0
  35. package/dist/cjs/errors/errors_remote.spec.js +132 -0
  36. package/dist/cjs/errors/errors_remote.spec.js.map +1 -0
  37. package/dist/cjs/errors/index.d.ts +5 -0
  38. package/dist/cjs/errors/index.d.ts.map +1 -0
  39. package/dist/cjs/errors/index.js +21 -0
  40. package/dist/cjs/errors/index.js.map +1 -0
  41. package/dist/cjs/index.d.ts +1 -0
  42. package/dist/cjs/index.d.ts.map +1 -1
  43. package/dist/cjs/index.js +1 -0
  44. package/dist/cjs/index.js.map +1 -1
  45. package/dist/cjs/modules/contacts/persons/api/persons.d.ts.map +1 -1
  46. package/dist/cjs/modules/contacts/persons/api/persons.js +3 -6
  47. package/dist/cjs/modules/contacts/persons/api/persons.js.map +1 -1
  48. package/dist/cjs/modules/global/bank-account/validations/bank_account/aba.d.ts.map +1 -1
  49. package/dist/cjs/modules/global/bank-account/validations/bank_account/aba.js +10 -49
  50. package/dist/cjs/modules/global/bank-account/validations/bank_account/aba.js.map +1 -1
  51. package/dist/cjs/modules/global/bank-account/validations/bank_account/clabe.d.ts.map +1 -1
  52. package/dist/cjs/modules/global/bank-account/validations/bank_account/clabe.js +7 -25
  53. package/dist/cjs/modules/global/bank-account/validations/bank_account/clabe.js.map +1 -1
  54. package/dist/cjs/modules/global/bank-account/validations/bank_account/iban.d.ts.map +1 -1
  55. package/dist/cjs/modules/global/bank-account/validations/bank_account/iban.js +7 -25
  56. package/dist/cjs/modules/global/bank-account/validations/bank_account/iban.js.map +1 -1
  57. package/dist/cjs/modules/global/bank-account/validations/bank_account/swift.d.ts.map +1 -1
  58. package/dist/cjs/modules/global/bank-account/validations/bank_account/swift.js +14 -68
  59. package/dist/cjs/modules/global/bank-account/validations/bank_account/swift.js.map +1 -1
  60. package/dist/cjs/modules/global/validations/payment_method.d.ts.map +1 -1
  61. package/dist/cjs/modules/global/validations/payment_method.js +21 -17
  62. package/dist/cjs/modules/global/validations/payment_method.js.map +1 -1
  63. package/dist/cjs/modules/global/validations/payment_method.spec.js +45 -87
  64. package/dist/cjs/modules/global/validations/payment_method.spec.js.map +1 -1
  65. package/dist/cjs/modules/horizontal/bulk_messaging/api/bulk_messages.d.ts.map +1 -1
  66. package/dist/cjs/modules/horizontal/bulk_messaging/api/bulk_messages.js +9 -24
  67. package/dist/cjs/modules/horizontal/bulk_messaging/api/bulk_messages.js.map +1 -1
  68. package/dist/cjs/modules/horizontal/communities/api/blocks.d.ts.map +1 -1
  69. package/dist/cjs/modules/horizontal/communities/api/blocks.js +2 -3
  70. package/dist/cjs/modules/horizontal/communities/api/blocks.js.map +1 -1
  71. package/dist/cjs/modules/horizontal/communities/api/common_area.d.ts.map +1 -1
  72. package/dist/cjs/modules/horizontal/communities/api/common_area.js +2 -3
  73. package/dist/cjs/modules/horizontal/communities/api/common_area.js.map +1 -1
  74. package/dist/cjs/modules/horizontal/communities/api/communities.d.ts.map +1 -1
  75. package/dist/cjs/modules/horizontal/communities/api/communities.js +15 -42
  76. package/dist/cjs/modules/horizontal/communities/api/communities.js.map +1 -1
  77. package/dist/cjs/modules/horizontal/communities/api/properties.d.ts.map +1 -1
  78. package/dist/cjs/modules/horizontal/communities/api/properties.js +3 -6
  79. package/dist/cjs/modules/horizontal/communities/api/properties.js.map +1 -1
  80. package/dist/cjs/modules/horizontal/communities/api/receipts.d.ts.map +1 -1
  81. package/dist/cjs/modules/horizontal/communities/api/receipts.js +4 -4
  82. package/dist/cjs/modules/horizontal/communities/api/receipts.js.map +1 -1
  83. package/dist/cjs/modules/horizontal/communities/api/route_trackings/routes.d.ts.map +1 -1
  84. package/dist/cjs/modules/horizontal/communities/api/route_trackings/routes.js +3 -6
  85. package/dist/cjs/modules/horizontal/communities/api/route_trackings/routes.js.map +1 -1
  86. package/dist/cjs/modules/horizontal/communities/types/route_tracking.d.ts +4 -2
  87. package/dist/cjs/modules/horizontal/communities/types/route_tracking.d.ts.map +1 -1
  88. package/dist/cjs/modules/horizontal/communities/types/route_tracking.js +3 -1
  89. package/dist/cjs/modules/horizontal/communities/types/route_tracking.js.map +1 -1
  90. package/dist/cjs/modules/horizontal/meeting_agendas/api/meeting_agendas.d.ts.map +1 -1
  91. package/dist/cjs/modules/horizontal/meeting_agendas/api/meeting_agendas.js +2 -3
  92. package/dist/cjs/modules/horizontal/meeting_agendas/api/meeting_agendas.js.map +1 -1
  93. package/dist/cjs/modules/horizontal/meetings/api/meetings.d.ts.map +1 -1
  94. package/dist/cjs/modules/horizontal/meetings/api/meetings.js +41 -63
  95. package/dist/cjs/modules/horizontal/meetings/api/meetings.js.map +1 -1
  96. package/dist/cjs/modules/ticketing/tasks/api/resources.d.ts.map +1 -1
  97. package/dist/cjs/modules/ticketing/tasks/api/resources.js +4 -9
  98. package/dist/cjs/modules/ticketing/tasks/api/resources.js.map +1 -1
  99. package/dist/cjs/modules/ticketing/tasks/api/tasks.d.ts.map +1 -1
  100. package/dist/cjs/modules/ticketing/tasks/api/tasks.js +6 -15
  101. package/dist/cjs/modules/ticketing/tasks/api/tasks.js.map +1 -1
  102. package/dist/cjs/types.d.ts +2 -0
  103. package/dist/cjs/types.d.ts.map +1 -1
  104. package/dist/cjs/types.js +1 -0
  105. package/dist/cjs/types.js.map +1 -1
  106. package/dist/cjs/utils/crud.d.ts +1 -1
  107. package/dist/cjs/utils/crud.d.ts.map +1 -1
  108. package/dist/cjs/utils/crud.js +8 -8
  109. package/dist/cjs/utils/crud.js.map +1 -1
  110. package/dist/cjs/utils/errors.d.ts +7 -0
  111. package/dist/cjs/utils/errors.d.ts.map +1 -1
  112. package/dist/cjs/utils/errors.js +6 -0
  113. package/dist/cjs/utils/errors.js.map +1 -1
  114. package/dist/cjs/utils/guards.d.ts +2 -0
  115. package/dist/cjs/utils/guards.d.ts.map +1 -0
  116. package/dist/cjs/utils/guards.js +10 -0
  117. package/dist/cjs/utils/guards.js.map +1 -0
  118. package/dist/cjs/utils/http.d.ts.map +1 -1
  119. package/dist/cjs/utils/http.js +12 -17
  120. package/dist/cjs/utils/http.js.map +1 -1
  121. package/dist/cjs/utils/index.d.ts +1 -0
  122. package/dist/cjs/utils/index.d.ts.map +1 -1
  123. package/dist/cjs/utils/index.js +1 -0
  124. package/dist/cjs/utils/index.js.map +1 -1
  125. package/dist/esm/errors/app_error.d.ts +18 -0
  126. package/dist/esm/errors/app_error.d.ts.map +1 -0
  127. package/dist/esm/errors/app_error.js +53 -0
  128. package/dist/esm/errors/app_error.js.map +1 -0
  129. package/dist/esm/errors/catalog.d.ts +218 -0
  130. package/dist/esm/errors/catalog.d.ts.map +1 -0
  131. package/dist/esm/errors/catalog.js +11 -0
  132. package/dist/esm/errors/catalog.js.map +1 -0
  133. package/dist/esm/errors/catalog_api.d.ts +21 -0
  134. package/dist/esm/errors/catalog_api.d.ts.map +1 -0
  135. package/dist/esm/errors/catalog_api.js +15 -0
  136. package/dist/esm/errors/catalog_api.js.map +1 -0
  137. package/dist/esm/errors/catalog_base.d.ts +204 -0
  138. package/dist/esm/errors/catalog_base.d.ts.map +1 -0
  139. package/dist/esm/errors/catalog_base.js +150 -0
  140. package/dist/esm/errors/catalog_base.js.map +1 -0
  141. package/dist/esm/errors/catalog_types.d.ts +12 -0
  142. package/dist/esm/errors/catalog_types.d.ts.map +1 -0
  143. package/dist/esm/errors/catalog_types.js +6 -0
  144. package/dist/esm/errors/catalog_types.js.map +1 -0
  145. package/dist/esm/errors/errors.d.ts +103 -0
  146. package/dist/esm/errors/errors.d.ts.map +1 -0
  147. package/dist/esm/errors/errors.js +147 -0
  148. package/dist/esm/errors/errors.js.map +1 -0
  149. package/dist/esm/errors/errors.spec.d.ts +2 -0
  150. package/dist/esm/errors/errors.spec.d.ts.map +1 -0
  151. package/dist/esm/errors/errors.spec.js +235 -0
  152. package/dist/esm/errors/errors.spec.js.map +1 -0
  153. package/dist/esm/errors/errors_remote.d.ts +28 -0
  154. package/dist/esm/errors/errors_remote.d.ts.map +1 -0
  155. package/dist/esm/errors/errors_remote.js +30 -0
  156. package/dist/esm/errors/errors_remote.js.map +1 -0
  157. package/dist/esm/errors/errors_remote.spec.d.ts +2 -0
  158. package/dist/esm/errors/errors_remote.spec.d.ts.map +1 -0
  159. package/dist/esm/errors/errors_remote.spec.js +130 -0
  160. package/dist/esm/errors/errors_remote.spec.js.map +1 -0
  161. package/dist/esm/errors/index.d.ts +5 -0
  162. package/dist/esm/errors/index.d.ts.map +1 -0
  163. package/dist/esm/errors/index.js +5 -0
  164. package/dist/esm/errors/index.js.map +1 -0
  165. package/dist/esm/index.d.ts +1 -0
  166. package/dist/esm/index.d.ts.map +1 -1
  167. package/dist/esm/index.js +1 -0
  168. package/dist/esm/index.js.map +1 -1
  169. package/dist/esm/modules/contacts/persons/api/persons.d.ts.map +1 -1
  170. package/dist/esm/modules/contacts/persons/api/persons.js +3 -6
  171. package/dist/esm/modules/contacts/persons/api/persons.js.map +1 -1
  172. package/dist/esm/modules/global/bank-account/validations/bank_account/aba.d.ts.map +1 -1
  173. package/dist/esm/modules/global/bank-account/validations/bank_account/aba.js +10 -49
  174. package/dist/esm/modules/global/bank-account/validations/bank_account/aba.js.map +1 -1
  175. package/dist/esm/modules/global/bank-account/validations/bank_account/clabe.d.ts.map +1 -1
  176. package/dist/esm/modules/global/bank-account/validations/bank_account/clabe.js +7 -25
  177. package/dist/esm/modules/global/bank-account/validations/bank_account/clabe.js.map +1 -1
  178. package/dist/esm/modules/global/bank-account/validations/bank_account/iban.d.ts.map +1 -1
  179. package/dist/esm/modules/global/bank-account/validations/bank_account/iban.js +7 -25
  180. package/dist/esm/modules/global/bank-account/validations/bank_account/iban.js.map +1 -1
  181. package/dist/esm/modules/global/bank-account/validations/bank_account/swift.d.ts.map +1 -1
  182. package/dist/esm/modules/global/bank-account/validations/bank_account/swift.js +14 -68
  183. package/dist/esm/modules/global/bank-account/validations/bank_account/swift.js.map +1 -1
  184. package/dist/esm/modules/global/validations/payment_method.d.ts.map +1 -1
  185. package/dist/esm/modules/global/validations/payment_method.js +21 -17
  186. package/dist/esm/modules/global/validations/payment_method.js.map +1 -1
  187. package/dist/esm/modules/global/validations/payment_method.spec.js +45 -87
  188. package/dist/esm/modules/global/validations/payment_method.spec.js.map +1 -1
  189. package/dist/esm/modules/horizontal/bulk_messaging/api/bulk_messages.d.ts.map +1 -1
  190. package/dist/esm/modules/horizontal/bulk_messaging/api/bulk_messages.js +9 -24
  191. package/dist/esm/modules/horizontal/bulk_messaging/api/bulk_messages.js.map +1 -1
  192. package/dist/esm/modules/horizontal/communities/api/blocks.d.ts.map +1 -1
  193. package/dist/esm/modules/horizontal/communities/api/blocks.js +2 -3
  194. package/dist/esm/modules/horizontal/communities/api/blocks.js.map +1 -1
  195. package/dist/esm/modules/horizontal/communities/api/common_area.d.ts.map +1 -1
  196. package/dist/esm/modules/horizontal/communities/api/common_area.js +2 -3
  197. package/dist/esm/modules/horizontal/communities/api/common_area.js.map +1 -1
  198. package/dist/esm/modules/horizontal/communities/api/communities.d.ts.map +1 -1
  199. package/dist/esm/modules/horizontal/communities/api/communities.js +15 -42
  200. package/dist/esm/modules/horizontal/communities/api/communities.js.map +1 -1
  201. package/dist/esm/modules/horizontal/communities/api/properties.d.ts.map +1 -1
  202. package/dist/esm/modules/horizontal/communities/api/properties.js +3 -6
  203. package/dist/esm/modules/horizontal/communities/api/properties.js.map +1 -1
  204. package/dist/esm/modules/horizontal/communities/api/receipts.d.ts.map +1 -1
  205. package/dist/esm/modules/horizontal/communities/api/receipts.js +4 -4
  206. package/dist/esm/modules/horizontal/communities/api/receipts.js.map +1 -1
  207. package/dist/esm/modules/horizontal/communities/api/route_trackings/routes.d.ts.map +1 -1
  208. package/dist/esm/modules/horizontal/communities/api/route_trackings/routes.js +3 -6
  209. package/dist/esm/modules/horizontal/communities/api/route_trackings/routes.js.map +1 -1
  210. package/dist/esm/modules/horizontal/communities/types/route_tracking.d.ts +4 -2
  211. package/dist/esm/modules/horizontal/communities/types/route_tracking.d.ts.map +1 -1
  212. package/dist/esm/modules/horizontal/communities/types/route_tracking.js +3 -1
  213. package/dist/esm/modules/horizontal/communities/types/route_tracking.js.map +1 -1
  214. package/dist/esm/modules/horizontal/meeting_agendas/api/meeting_agendas.d.ts.map +1 -1
  215. package/dist/esm/modules/horizontal/meeting_agendas/api/meeting_agendas.js +2 -3
  216. package/dist/esm/modules/horizontal/meeting_agendas/api/meeting_agendas.js.map +1 -1
  217. package/dist/esm/modules/horizontal/meetings/api/meetings.d.ts.map +1 -1
  218. package/dist/esm/modules/horizontal/meetings/api/meetings.js +41 -63
  219. package/dist/esm/modules/horizontal/meetings/api/meetings.js.map +1 -1
  220. package/dist/esm/modules/ticketing/tasks/api/resources.d.ts.map +1 -1
  221. package/dist/esm/modules/ticketing/tasks/api/resources.js +4 -9
  222. package/dist/esm/modules/ticketing/tasks/api/resources.js.map +1 -1
  223. package/dist/esm/modules/ticketing/tasks/api/tasks.d.ts.map +1 -1
  224. package/dist/esm/modules/ticketing/tasks/api/tasks.js +6 -15
  225. package/dist/esm/modules/ticketing/tasks/api/tasks.js.map +1 -1
  226. package/dist/esm/types.d.ts +2 -0
  227. package/dist/esm/types.d.ts.map +1 -1
  228. package/dist/esm/types.js +1 -0
  229. package/dist/esm/types.js.map +1 -1
  230. package/dist/esm/utils/crud.d.ts +1 -1
  231. package/dist/esm/utils/crud.d.ts.map +1 -1
  232. package/dist/esm/utils/crud.js +8 -8
  233. package/dist/esm/utils/crud.js.map +1 -1
  234. package/dist/esm/utils/errors.d.ts +7 -0
  235. package/dist/esm/utils/errors.d.ts.map +1 -1
  236. package/dist/esm/utils/errors.js +6 -0
  237. package/dist/esm/utils/errors.js.map +1 -1
  238. package/dist/esm/utils/guards.d.ts +2 -0
  239. package/dist/esm/utils/guards.d.ts.map +1 -0
  240. package/dist/esm/utils/guards.js +7 -0
  241. package/dist/esm/utils/guards.js.map +1 -0
  242. package/dist/esm/utils/http.d.ts.map +1 -1
  243. package/dist/esm/utils/http.js +12 -17
  244. package/dist/esm/utils/http.js.map +1 -1
  245. package/dist/esm/utils/index.d.ts +1 -0
  246. package/dist/esm/utils/index.d.ts.map +1 -1
  247. package/dist/esm/utils/index.js +1 -0
  248. package/dist/esm/utils/index.js.map +1 -1
  249. package/package.json +3 -2
@@ -0,0 +1,18 @@
1
+ import { type ErrorCode, type ErrorDetails } from './catalog';
2
+ export declare class AppError<C extends ErrorCode> extends Error {
3
+ readonly code: C;
4
+ readonly kind: 'domain' | 'system';
5
+ readonly status: number;
6
+ readonly details: ErrorDetails<C>;
7
+ constructor(code: C, details: ErrorDetails<C>, message?: string);
8
+ is<T extends ErrorCode>(code: T): this is AppError<T>;
9
+ toJSON(): {
10
+ code: C;
11
+ kind: "domain" | "system";
12
+ status: number;
13
+ message: string;
14
+ details: ErrorDetails<C>;
15
+ };
16
+ static fromResponse(body: unknown): AppError<ErrorCode>;
17
+ }
18
+ //# sourceMappingURL=app_error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app_error.d.ts","sourceRoot":"","sources":["../../../src/errors/app_error.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAA;AAUtE,qBAAa,QAAQ,CAAC,CAAC,SAAS,SAAS,CAAE,SAAQ,KAAK;IACtD,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;IAChB,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAA;gBAErB,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM;IAiB/D,EAAE,CAAC,CAAC,SAAS,SAAS,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC;IAIrD,MAAM;;;;;;;IAUN,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC,SAAS,CAAC;CAUxD"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppError = void 0;
4
+ const zod_1 = require("zod");
5
+ const catalog_1 = require("./catalog");
6
+ const responseSchema = zod_1.z.object({
7
+ code: zod_1.z.string(),
8
+ kind: zod_1.z.enum(['domain', 'system']),
9
+ status: zod_1.z.number(),
10
+ message: zod_1.z.string(),
11
+ details: zod_1.z.unknown().optional(),
12
+ });
13
+ class AppError extends Error {
14
+ code;
15
+ kind;
16
+ status;
17
+ details;
18
+ constructor(code, details, message) {
19
+ const entry = catalog_1.CATALOG[code];
20
+ const defaultMessage = typeof entry.message === 'function'
21
+ ? entry.message(details)
22
+ : entry.message;
23
+ super(message ?? defaultMessage);
24
+ this.name = 'AppError';
25
+ this.code = code;
26
+ this.kind = entry.kind;
27
+ this.status = entry.status;
28
+ this.details = entry.details.parse(details);
29
+ if (Error.captureStackTrace) {
30
+ Error.captureStackTrace(this, this.constructor);
31
+ }
32
+ }
33
+ is(code) {
34
+ return this.code === code;
35
+ }
36
+ toJSON() {
37
+ return {
38
+ code: this.code,
39
+ kind: this.kind,
40
+ status: this.status,
41
+ message: this.message,
42
+ details: this.details,
43
+ };
44
+ }
45
+ static fromResponse(body) {
46
+ const parsed = responseSchema.parse(body);
47
+ if (!(parsed.code in catalog_1.CATALOG)) {
48
+ throw new Error(`Unknown error code: ${parsed.code}`);
49
+ }
50
+ const code = parsed.code;
51
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
52
+ const details = catalog_1.CATALOG[code].details.parse(parsed.details ?? {});
53
+ return new AppError(code, details, parsed.message);
54
+ }
55
+ }
56
+ exports.AppError = AppError;
57
+ //# sourceMappingURL=app_error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app_error.js","sourceRoot":"","sources":["../../../src/errors/app_error.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,uCAAsE;AAEtE,MAAM,cAAc,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAClC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAA;AAEF,MAAa,QAA8B,SAAQ,KAAK;IAC7C,IAAI,CAAG;IACP,IAAI,CAAqB;IACzB,MAAM,CAAQ;IACd,OAAO,CAAiB;IAEjC,YAAY,IAAO,EAAE,OAAwB,EAAE,OAAgB;QAC7D,MAAM,KAAK,GAAG,iBAAO,CAAC,IAAI,CAAC,CAAA;QAC3B,MAAM,cAAc,GAClB,OAAO,KAAK,CAAC,OAAO,KAAK,UAAU;YACjC,CAAC,CAAE,KAAK,CAAC,OAA0C,CAAC,OAAO,CAAC;YAC5D,CAAC,CAAC,KAAK,CAAC,OAAO,CAAA;QACnB,KAAK,CAAC,OAAO,IAAI,cAAc,CAAC,CAAA;QAChC,IAAI,CAAC,IAAI,GAAG,UAAU,CAAA;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAA;QACtB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAA;QAC1B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAoB,CAAA;QAC9D,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;QACjD,CAAC;IACH,CAAC;IAED,EAAE,CAAsB,IAAO;QAC7B,OAAQ,IAAI,CAAC,IAAe,KAAM,IAAe,CAAA;IACnD,CAAC;IAED,MAAM;QACJ,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAA;IACH,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,IAAa;QAC/B,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACzC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,iBAAO,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,uBAAuB,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;QACvD,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAiB,CAAA;QACrC,8DAA8D;QAC9D,MAAM,OAAO,GAAG,iBAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAQ,CAAA;QACxE,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;IACpD,CAAC;CACF;AA/CD,4BA+CC"}
@@ -0,0 +1,218 @@
1
+ import { API_ERROR_CODES, APIErrorDetails } from './catalog_api';
2
+ import { BASE_ERROR_CODES, BaseErrorDetails } from './catalog_base';
3
+ export declare const ERROR_CODES: {
4
+ FORBIDDEN_CONTACT: API_ERROR_CODES.FORBIDDEN_CONTACT;
5
+ VALIDATION: BASE_ERROR_CODES.VALIDATION;
6
+ BAD_REQUEST: BASE_ERROR_CODES.BAD_REQUEST;
7
+ AUTHENTICATION: BASE_ERROR_CODES.AUTHENTICATION;
8
+ UNAUTHORIZED: BASE_ERROR_CODES.UNAUTHORIZED;
9
+ NOT_FOUND: BASE_ERROR_CODES.NOT_FOUND;
10
+ NOT_ACCEPTABLE: BASE_ERROR_CODES.NOT_ACCEPTABLE;
11
+ CONFLICT: BASE_ERROR_CODES.CONFLICT;
12
+ GONE: BASE_ERROR_CODES.GONE;
13
+ UNPROCESSABLE_ENTITY: BASE_ERROR_CODES.UNPROCESSABLE_ENTITY;
14
+ MANDATORY_FIELD: BASE_ERROR_CODES.MANDATORY_FIELD;
15
+ INTERNAL_SERVER_ERROR: BASE_ERROR_CODES.INTERNAL_SERVER_ERROR;
16
+ SERVICE_UNAVAILABLE: BASE_ERROR_CODES.SERVICE_UNAVAILABLE;
17
+ };
18
+ export type ErrorCode = keyof typeof ERROR_CODES;
19
+ export type ErrorDetails<C extends ErrorCode> = BaseErrorDetails<C extends BASE_ERROR_CODES ? C : never> | APIErrorDetails<C extends API_ERROR_CODES ? C : never>;
20
+ export declare const ERRORS_CATALOG: {
21
+ FORBIDDEN_CONTACT: {
22
+ kind: import("./catalog_types").ErrorKind.DOMAIN;
23
+ status: number;
24
+ details: import("zod").ZodObject<{
25
+ contactId: import("zod").ZodString;
26
+ }, "strip", import("zod").ZodTypeAny, {
27
+ contactId: string;
28
+ }, {
29
+ contactId: string;
30
+ }>;
31
+ message: string;
32
+ };
33
+ VALIDATION: {
34
+ kind: import("./catalog_types").ErrorKind.DOMAIN;
35
+ status: number;
36
+ details: import("zod").ZodObject<{
37
+ errors: import("zod").ZodArray<import("zod").ZodObject<{
38
+ validation: import("zod").ZodString;
39
+ code: import("zod").ZodString;
40
+ message: import("zod").ZodString;
41
+ path: import("zod").ZodArray<import("zod").ZodString, "many">;
42
+ }, "strip", import("zod").ZodTypeAny, {
43
+ code: string;
44
+ message: string;
45
+ path: string[];
46
+ validation: string;
47
+ }, {
48
+ code: string;
49
+ message: string;
50
+ path: string[];
51
+ validation: string;
52
+ }>, "many">;
53
+ }, "strip", import("zod").ZodTypeAny, {
54
+ errors: {
55
+ code: string;
56
+ message: string;
57
+ path: string[];
58
+ validation: string;
59
+ }[];
60
+ }, {
61
+ errors: {
62
+ code: string;
63
+ message: string;
64
+ path: string[];
65
+ validation: string;
66
+ }[];
67
+ }>;
68
+ message: string;
69
+ };
70
+ BAD_REQUEST: {
71
+ kind: import("./catalog_types").ErrorKind.DOMAIN;
72
+ status: number;
73
+ details: import("zod").ZodObject<{
74
+ field: import("zod").ZodOptional<import("zod").ZodString>;
75
+ reason: import("zod").ZodOptional<import("zod").ZodString>;
76
+ }, "strip", import("zod").ZodTypeAny, {
77
+ field?: string | undefined;
78
+ reason?: string | undefined;
79
+ }, {
80
+ field?: string | undefined;
81
+ reason?: string | undefined;
82
+ }>;
83
+ message: string;
84
+ };
85
+ AUTHENTICATION: {
86
+ kind: import("./catalog_types").ErrorKind.DOMAIN;
87
+ status: number;
88
+ details: import("zod").ZodObject<{
89
+ reason: import("zod").ZodOptional<import("zod").ZodString>;
90
+ }, "strip", import("zod").ZodTypeAny, {
91
+ reason?: string | undefined;
92
+ }, {
93
+ reason?: string | undefined;
94
+ }>;
95
+ message: string;
96
+ };
97
+ UNAUTHORIZED: {
98
+ kind: import("./catalog_types").ErrorKind.DOMAIN;
99
+ status: number;
100
+ details: import("zod").ZodObject<{
101
+ requiredScope: import("zod").ZodOptional<import("zod").ZodString>;
102
+ resource: import("zod").ZodOptional<import("zod").ZodString>;
103
+ }, "strip", import("zod").ZodTypeAny, {
104
+ requiredScope?: string | undefined;
105
+ resource?: string | undefined;
106
+ }, {
107
+ requiredScope?: string | undefined;
108
+ resource?: string | undefined;
109
+ }>;
110
+ message: string;
111
+ };
112
+ NOT_FOUND: {
113
+ kind: import("./catalog_types").ErrorKind.DOMAIN;
114
+ status: number;
115
+ details: import("zod").ZodObject<{
116
+ entity: import("zod").ZodOptional<import("zod").ZodString>;
117
+ }, "strip", import("zod").ZodTypeAny, {
118
+ entity?: string | undefined;
119
+ }, {
120
+ entity?: string | undefined;
121
+ }>;
122
+ message: string;
123
+ };
124
+ NOT_ACCEPTABLE: {
125
+ kind: import("./catalog_types").ErrorKind.DOMAIN;
126
+ status: number;
127
+ details: import("zod").ZodObject<{
128
+ acceptedTypes: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString, "many">>;
129
+ }, "strip", import("zod").ZodTypeAny, {
130
+ acceptedTypes?: string[] | undefined;
131
+ }, {
132
+ acceptedTypes?: string[] | undefined;
133
+ }>;
134
+ message: string;
135
+ };
136
+ CONFLICT: {
137
+ kind: import("./catalog_types").ErrorKind.DOMAIN;
138
+ status: number;
139
+ details: import("zod").ZodArray<import("zod").ZodObject<{
140
+ key: import("zod").ZodString;
141
+ value: import("zod").ZodString;
142
+ cause: import("zod").ZodString;
143
+ }, "strip", import("zod").ZodTypeAny, {
144
+ value: string;
145
+ key: string;
146
+ cause: string;
147
+ }, {
148
+ value: string;
149
+ key: string;
150
+ cause: string;
151
+ }>, "many">;
152
+ message: string;
153
+ };
154
+ GONE: {
155
+ kind: import("./catalog_types").ErrorKind.DOMAIN;
156
+ status: number;
157
+ details: import("zod").ZodObject<{
158
+ since: import("zod").ZodOptional<import("zod").ZodString>;
159
+ }, "strip", import("zod").ZodTypeAny, {
160
+ since?: string | undefined;
161
+ }, {
162
+ since?: string | undefined;
163
+ }>;
164
+ message: string;
165
+ };
166
+ UNPROCESSABLE_ENTITY: {
167
+ kind: import("./catalog_types").ErrorKind.DOMAIN;
168
+ status: number;
169
+ details: import("zod").ZodObject<{
170
+ field: import("zod").ZodOptional<import("zod").ZodString>;
171
+ reason: import("zod").ZodOptional<import("zod").ZodString>;
172
+ }, "strip", import("zod").ZodTypeAny, {
173
+ field?: string | undefined;
174
+ reason?: string | undefined;
175
+ }, {
176
+ field?: string | undefined;
177
+ reason?: string | undefined;
178
+ }>;
179
+ message: string;
180
+ };
181
+ MANDATORY_FIELD: {
182
+ kind: import("./catalog_types").ErrorKind.DOMAIN;
183
+ status: number;
184
+ details: import("zod").ZodObject<{
185
+ field: import("zod").ZodString;
186
+ }, "strip", import("zod").ZodTypeAny, {
187
+ field: string;
188
+ }, {
189
+ field: string;
190
+ }>;
191
+ message: string;
192
+ };
193
+ INTERNAL_SERVER_ERROR: {
194
+ kind: import("./catalog_types").ErrorKind.SYSTEM;
195
+ status: number;
196
+ details: import("zod").ZodObject<{
197
+ reason: import("zod").ZodOptional<import("zod").ZodString>;
198
+ }, "strip", import("zod").ZodTypeAny, {
199
+ reason?: string | undefined;
200
+ }, {
201
+ reason?: string | undefined;
202
+ }>;
203
+ message: string;
204
+ };
205
+ SERVICE_UNAVAILABLE: {
206
+ kind: import("./catalog_types").ErrorKind.SYSTEM;
207
+ status: number;
208
+ details: import("zod").ZodObject<{
209
+ retryAfter: import("zod").ZodOptional<import("zod").ZodNumber>;
210
+ }, "strip", import("zod").ZodTypeAny, {
211
+ retryAfter?: number | undefined;
212
+ }, {
213
+ retryAfter?: number | undefined;
214
+ }>;
215
+ message: string;
216
+ };
217
+ };
218
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/errors/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAsB,eAAe,EAAE,MAAM,eAAe,CAAA;AACpF,OAAO,EAAE,gBAAgB,EAAuB,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGxF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;CAGvB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,WAAW,CAAA;AAEhD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,SAAS,IACxC,gBAAgB,CAAC,CAAC,SAAS,gBAAgB,GAAG,CAAC,GAAG,KAAK,CAAC,GACxD,eAAe,CAAC,CAAC,SAAS,eAAe,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA;AAE1D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGqB,CAAA"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ERRORS_CATALOG = exports.ERROR_CODES = void 0;
4
+ const catalog_api_1 = require("./catalog_api");
5
+ const catalog_base_1 = require("./catalog_base");
6
+ exports.ERROR_CODES = {
7
+ ...catalog_base_1.BASE_ERROR_CODES,
8
+ ...catalog_api_1.API_ERROR_CODES,
9
+ };
10
+ exports.ERRORS_CATALOG = {
11
+ ...catalog_base_1.BASE_ERRORS_CATALOG,
12
+ ...catalog_api_1.API_ERRORS_CATALOG,
13
+ };
14
+ //# sourceMappingURL=catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../../src/errors/catalog.ts"],"names":[],"mappings":";;;AAAA,+CAAoF;AACpF,iDAAwF;AAG3E,QAAA,WAAW,GAAG;IACzB,GAAG,+BAAgB;IACnB,GAAG,6BAAe;CACnB,CAAA;AAQY,QAAA,cAAc,GAAG;IAC5B,GAAG,kCAAmB;IACtB,GAAG,gCAAkB;CACyB,CAAA"}
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ import { ErrorKind } from './catalog_types';
3
+ export declare enum API_ERROR_CODES {
4
+ FORBIDDEN_CONTACT = "FORBIDDEN_CONTACT"
5
+ }
6
+ export declare const API_ERRORS_CATALOG: {
7
+ FORBIDDEN_CONTACT: {
8
+ kind: ErrorKind.DOMAIN;
9
+ status: number;
10
+ details: z.ZodObject<{
11
+ contactId: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ contactId: string;
14
+ }, {
15
+ contactId: string;
16
+ }>;
17
+ message: string;
18
+ };
19
+ };
20
+ export type APIErrorDetails<C extends API_ERROR_CODES> = z.infer<(typeof API_ERRORS_CATALOG)[C]['details']>;
21
+ //# sourceMappingURL=catalog_api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog_api.d.ts","sourceRoot":"","sources":["../../../src/errors/catalog_api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAqB,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE9D,oBAAY,eAAe;IACzB,iBAAiB,sBAAsB;CACxC;AAED,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;CAOuB,CAAA;AAEtD,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,eAAe,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.API_ERRORS_CATALOG = exports.API_ERROR_CODES = void 0;
4
+ const zod_1 = require("zod");
5
+ const catalog_types_1 = require("./catalog_types");
6
+ var API_ERROR_CODES;
7
+ (function (API_ERROR_CODES) {
8
+ API_ERROR_CODES["FORBIDDEN_CONTACT"] = "FORBIDDEN_CONTACT";
9
+ })(API_ERROR_CODES || (exports.API_ERROR_CODES = API_ERROR_CODES = {}));
10
+ exports.API_ERRORS_CATALOG = {
11
+ [API_ERROR_CODES.FORBIDDEN_CONTACT]: {
12
+ kind: catalog_types_1.ErrorKind.DOMAIN,
13
+ status: 403,
14
+ details: zod_1.z.object({ contactId: zod_1.z.string() }),
15
+ message: 'You are not authorized to access this contact person',
16
+ },
17
+ };
18
+ //# sourceMappingURL=catalog_api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog_api.js","sourceRoot":"","sources":["../../../src/errors/catalog_api.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AACvB,mDAA8D;AAE9D,IAAY,eAEX;AAFD,WAAY,eAAe;IACzB,0DAAuC,CAAA;AACzC,CAAC,EAFW,eAAe,+BAAf,eAAe,QAE1B;AAEY,QAAA,kBAAkB,GAAG;IAChC,CAAC,eAAe,CAAC,iBAAiB,CAAC,EAAE;QACnC,IAAI,EAAE,yBAAS,CAAC,MAAM;QACtB,MAAM,EAAE,GAAG;QACX,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC;QAC5C,OAAO,EAAE,sDAAsD;KAChE;CACmD,CAAA"}
@@ -0,0 +1,204 @@
1
+ import { z } from 'zod';
2
+ import { ErrorKind } from './catalog_types';
3
+ export declare enum BASE_ERROR_CODES {
4
+ VALIDATION = "VALIDATION",
5
+ BAD_REQUEST = "BAD_REQUEST",
6
+ AUTHENTICATION = "AUTHENTICATION",
7
+ UNAUTHORIZED = "UNAUTHORIZED",
8
+ NOT_FOUND = "NOT_FOUND",
9
+ NOT_ACCEPTABLE = "NOT_ACCEPTABLE",
10
+ CONFLICT = "CONFLICT",
11
+ GONE = "GONE",
12
+ UNPROCESSABLE_ENTITY = "UNPROCESSABLE_ENTITY",
13
+ MANDATORY_FIELD = "MANDATORY_FIELD",
14
+ INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR",
15
+ SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE"
16
+ }
17
+ export declare const BASE_ERRORS_CATALOG: {
18
+ VALIDATION: {
19
+ kind: ErrorKind.DOMAIN;
20
+ status: number;
21
+ details: z.ZodObject<{
22
+ errors: z.ZodArray<z.ZodObject<{
23
+ validation: z.ZodString;
24
+ code: z.ZodString;
25
+ message: z.ZodString;
26
+ path: z.ZodArray<z.ZodString, "many">;
27
+ }, "strip", z.ZodTypeAny, {
28
+ code: string;
29
+ message: string;
30
+ path: string[];
31
+ validation: string;
32
+ }, {
33
+ code: string;
34
+ message: string;
35
+ path: string[];
36
+ validation: string;
37
+ }>, "many">;
38
+ }, "strip", z.ZodTypeAny, {
39
+ errors: {
40
+ code: string;
41
+ message: string;
42
+ path: string[];
43
+ validation: string;
44
+ }[];
45
+ }, {
46
+ errors: {
47
+ code: string;
48
+ message: string;
49
+ path: string[];
50
+ validation: string;
51
+ }[];
52
+ }>;
53
+ message: string;
54
+ };
55
+ BAD_REQUEST: {
56
+ kind: ErrorKind.DOMAIN;
57
+ status: number;
58
+ details: z.ZodObject<{
59
+ field: z.ZodOptional<z.ZodString>;
60
+ reason: z.ZodOptional<z.ZodString>;
61
+ }, "strip", z.ZodTypeAny, {
62
+ field?: string | undefined;
63
+ reason?: string | undefined;
64
+ }, {
65
+ field?: string | undefined;
66
+ reason?: string | undefined;
67
+ }>;
68
+ message: string;
69
+ };
70
+ AUTHENTICATION: {
71
+ kind: ErrorKind.DOMAIN;
72
+ status: number;
73
+ details: z.ZodObject<{
74
+ reason: z.ZodOptional<z.ZodString>;
75
+ }, "strip", z.ZodTypeAny, {
76
+ reason?: string | undefined;
77
+ }, {
78
+ reason?: string | undefined;
79
+ }>;
80
+ message: string;
81
+ };
82
+ UNAUTHORIZED: {
83
+ kind: ErrorKind.DOMAIN;
84
+ status: number;
85
+ details: z.ZodObject<{
86
+ requiredScope: z.ZodOptional<z.ZodString>;
87
+ resource: z.ZodOptional<z.ZodString>;
88
+ }, "strip", z.ZodTypeAny, {
89
+ requiredScope?: string | undefined;
90
+ resource?: string | undefined;
91
+ }, {
92
+ requiredScope?: string | undefined;
93
+ resource?: string | undefined;
94
+ }>;
95
+ message: string;
96
+ };
97
+ NOT_FOUND: {
98
+ kind: ErrorKind.DOMAIN;
99
+ status: number;
100
+ details: z.ZodObject<{
101
+ entity: z.ZodOptional<z.ZodString>;
102
+ }, "strip", z.ZodTypeAny, {
103
+ entity?: string | undefined;
104
+ }, {
105
+ entity?: string | undefined;
106
+ }>;
107
+ message: string;
108
+ };
109
+ NOT_ACCEPTABLE: {
110
+ kind: ErrorKind.DOMAIN;
111
+ status: number;
112
+ details: z.ZodObject<{
113
+ acceptedTypes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
114
+ }, "strip", z.ZodTypeAny, {
115
+ acceptedTypes?: string[] | undefined;
116
+ }, {
117
+ acceptedTypes?: string[] | undefined;
118
+ }>;
119
+ message: string;
120
+ };
121
+ CONFLICT: {
122
+ kind: ErrorKind.DOMAIN;
123
+ status: number;
124
+ details: z.ZodArray<z.ZodObject<{
125
+ key: z.ZodString;
126
+ value: z.ZodString;
127
+ cause: z.ZodString;
128
+ }, "strip", z.ZodTypeAny, {
129
+ value: string;
130
+ key: string;
131
+ cause: string;
132
+ }, {
133
+ value: string;
134
+ key: string;
135
+ cause: string;
136
+ }>, "many">;
137
+ message: string;
138
+ };
139
+ GONE: {
140
+ kind: ErrorKind.DOMAIN;
141
+ status: number;
142
+ details: z.ZodObject<{
143
+ since: z.ZodOptional<z.ZodString>;
144
+ }, "strip", z.ZodTypeAny, {
145
+ since?: string | undefined;
146
+ }, {
147
+ since?: string | undefined;
148
+ }>;
149
+ message: string;
150
+ };
151
+ UNPROCESSABLE_ENTITY: {
152
+ kind: ErrorKind.DOMAIN;
153
+ status: number;
154
+ details: z.ZodObject<{
155
+ field: z.ZodOptional<z.ZodString>;
156
+ reason: z.ZodOptional<z.ZodString>;
157
+ }, "strip", z.ZodTypeAny, {
158
+ field?: string | undefined;
159
+ reason?: string | undefined;
160
+ }, {
161
+ field?: string | undefined;
162
+ reason?: string | undefined;
163
+ }>;
164
+ message: string;
165
+ };
166
+ MANDATORY_FIELD: {
167
+ kind: ErrorKind.DOMAIN;
168
+ status: number;
169
+ details: z.ZodObject<{
170
+ field: z.ZodString;
171
+ }, "strip", z.ZodTypeAny, {
172
+ field: string;
173
+ }, {
174
+ field: string;
175
+ }>;
176
+ message: string;
177
+ };
178
+ INTERNAL_SERVER_ERROR: {
179
+ kind: ErrorKind.SYSTEM;
180
+ status: number;
181
+ details: z.ZodObject<{
182
+ reason: z.ZodOptional<z.ZodString>;
183
+ }, "strip", z.ZodTypeAny, {
184
+ reason?: string | undefined;
185
+ }, {
186
+ reason?: string | undefined;
187
+ }>;
188
+ message: string;
189
+ };
190
+ SERVICE_UNAVAILABLE: {
191
+ kind: ErrorKind.SYSTEM;
192
+ status: number;
193
+ details: z.ZodObject<{
194
+ retryAfter: z.ZodOptional<z.ZodNumber>;
195
+ }, "strip", z.ZodTypeAny, {
196
+ retryAfter?: number | undefined;
197
+ }, {
198
+ retryAfter?: number | undefined;
199
+ }>;
200
+ message: string;
201
+ };
202
+ };
203
+ export type BaseErrorDetails<C extends BASE_ERROR_CODES> = z.infer<(typeof BASE_ERRORS_CATALOG)[C]['details']>;
204
+ //# sourceMappingURL=catalog_base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog_base.d.ts","sourceRoot":"","sources":["../../../src/errors/catalog_base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAqB,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE9D,oBAAY,gBAAgB;IAE1B,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,cAAc,mBAAmB;IACjC,YAAY,iBAAiB;IAC7B,SAAS,cAAc;IACvB,cAAc,mBAAmB;IACjC,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,oBAAoB,yBAAyB;IAC7C,eAAe,oBAAoB;IAGnC,qBAAqB,0BAA0B;IAC/C,mBAAmB,wBAAwB;CAC5C;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkIuB,CAAA;AAEvD,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,gBAAgB,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA"}