@zudojs/errors 1.3.2 → 1.4.0

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 (417) hide show
  1. package/dist/base/core/baseError.core.d.ts +6 -1
  2. package/dist/base/core/baseError.core.js +6 -1
  3. package/dist/base/core/baseError.serialize.d.ts +0 -1
  4. package/dist/base/core/baseError.serialize.js +0 -1
  5. package/dist/base/core/errorCause.redact.d.ts +0 -1
  6. package/dist/base/core/errorCause.redact.js +0 -1
  7. package/dist/base/core/errorMetadata.core.d.ts +0 -1
  8. package/dist/base/core/errorMetadata.core.js +0 -1
  9. package/dist/base/core/errorMetadata.type.d.ts +0 -1
  10. package/dist/base/core/errorMetadata.type.js +0 -1
  11. package/dist/base/core/index.d.ts +0 -1
  12. package/dist/base/core/index.js +0 -1
  13. package/dist/base/index.d.ts +0 -1
  14. package/dist/base/index.js +0 -1
  15. package/dist/base/types/baseError.type.d.ts +6 -1
  16. package/dist/base/types/baseError.type.js +0 -1
  17. package/dist/base/types/errorCategory.enum.d.ts +0 -1
  18. package/dist/base/types/errorCategory.enum.js +0 -1
  19. package/dist/base/types/errorCategory.helpers.d.ts +0 -1
  20. package/dist/base/types/errorCategory.helpers.js +0 -1
  21. package/dist/base/types/errorCategory.type.d.ts +0 -1
  22. package/dist/base/types/errorCategory.type.js +0 -1
  23. package/dist/base/types/errorCode.type.d.ts +0 -1
  24. package/dist/base/types/errorCode.type.js +0 -1
  25. package/dist/base/types/errorSeverity.type.d.ts +0 -1
  26. package/dist/base/types/errorSeverity.type.js +0 -1
  27. package/dist/base/types/index.d.ts +0 -1
  28. package/dist/base/types/index.js +0 -1
  29. package/dist/base/utils/baseError.utils.d.ts +0 -1
  30. package/dist/base/utils/baseError.utils.js +0 -1
  31. package/dist/base/utils/index.d.ts +0 -1
  32. package/dist/base/utils/index.js +0 -1
  33. package/dist/domain/access/authError.base.d.ts +0 -1
  34. package/dist/domain/access/authError.base.js +0 -1
  35. package/dist/domain/access/authentication.error.d.ts +0 -1
  36. package/dist/domain/access/authentication.error.js +0 -1
  37. package/dist/domain/access/authorization.error.d.ts +0 -1
  38. package/dist/domain/access/authorization.error.js +0 -1
  39. package/dist/domain/access/index.d.ts +0 -1
  40. package/dist/domain/access/index.js +0 -1
  41. package/dist/domain/access/oauthError.base.d.ts +0 -1
  42. package/dist/domain/access/oauthError.base.js +0 -1
  43. package/dist/domain/access/rateLimit.error.d.ts +0 -1
  44. package/dist/domain/access/rateLimit.error.js +0 -1
  45. package/dist/domain/api/api.error.d.ts +0 -1
  46. package/dist/domain/api/api.error.js +0 -1
  47. package/dist/domain/api/apiError.base.d.ts +0 -1
  48. package/dist/domain/api/apiError.base.js +0 -1
  49. package/dist/domain/api/apiError.lifecycle.d.ts +0 -1
  50. package/dist/domain/api/apiError.lifecycle.js +0 -1
  51. package/dist/domain/api/apiError.routing.d.ts +0 -1
  52. package/dist/domain/api/apiError.routing.js +0 -1
  53. package/dist/domain/api/index.d.ts +0 -1
  54. package/dist/domain/api/index.js +0 -1
  55. package/dist/domain/app/application.error.d.ts +0 -1
  56. package/dist/domain/app/application.error.js +0 -1
  57. package/dist/domain/app/configuration.error.d.ts +0 -1
  58. package/dist/domain/app/configuration.error.js +0 -1
  59. package/dist/domain/app/domain.error.d.ts +0 -1
  60. package/dist/domain/app/domain.error.js +0 -1
  61. package/dist/domain/app/index.d.ts +0 -1
  62. package/dist/domain/app/index.js +0 -1
  63. package/dist/domain/app/lifecycle.error.d.ts +0 -1
  64. package/dist/domain/app/lifecycle.error.js +0 -1
  65. package/dist/domain/app/lifecycleError.base.d.ts +0 -1
  66. package/dist/domain/app/lifecycleError.base.js +0 -1
  67. package/dist/domain/app/lifecycleError.types.d.ts +0 -1
  68. package/dist/domain/app/lifecycleError.types.js +0 -1
  69. package/dist/domain/app/module.error.d.ts +0 -1
  70. package/dist/domain/app/module.error.js +0 -1
  71. package/dist/domain/app/moduleError.base.d.ts +0 -1
  72. package/dist/domain/app/moduleError.base.js +0 -1
  73. package/dist/domain/app/moduleError.types.d.ts +0 -1
  74. package/dist/domain/app/moduleError.types.js +0 -1
  75. package/dist/domain/body/bodyParser.error.d.ts +0 -1
  76. package/dist/domain/body/bodyParser.error.js +0 -1
  77. package/dist/domain/body/httpBody.error.d.ts +0 -1
  78. package/dist/domain/body/httpBody.error.js +0 -1
  79. package/dist/domain/body/httpBodyError.base.d.ts +0 -1
  80. package/dist/domain/body/httpBodyError.base.js +0 -1
  81. package/dist/domain/body/httpBodyError.types.d.ts +0 -1
  82. package/dist/domain/body/httpBodyError.types.js +0 -1
  83. package/dist/domain/body/httpFormData.error.d.ts +0 -1
  84. package/dist/domain/body/httpFormData.error.js +0 -1
  85. package/dist/domain/body/index.d.ts +0 -1
  86. package/dist/domain/body/index.js +0 -1
  87. package/dist/domain/body/multipart.error.d.ts +0 -1
  88. package/dist/domain/body/multipart.error.js +0 -1
  89. package/dist/domain/cli/cliError.base.d.ts +0 -1
  90. package/dist/domain/cli/cliError.base.js +0 -1
  91. package/dist/domain/cli/index.d.ts +0 -1
  92. package/dist/domain/cli/index.js +0 -1
  93. package/dist/domain/constant/constantError.base.d.ts +0 -1
  94. package/dist/domain/constant/constantError.base.js +0 -1
  95. package/dist/domain/constant/index.d.ts +0 -1
  96. package/dist/domain/constant/index.js +0 -1
  97. package/dist/domain/cqrs/cqrsError.base.d.ts +0 -1
  98. package/dist/domain/cqrs/cqrsError.base.js +0 -1
  99. package/dist/domain/cqrs/cqrsError.result.d.ts +0 -1
  100. package/dist/domain/cqrs/cqrsError.result.js +0 -1
  101. package/dist/domain/cqrs/index.d.ts +0 -1
  102. package/dist/domain/cqrs/index.js +0 -1
  103. package/dist/domain/documentation/documentation.error.d.ts +0 -1
  104. package/dist/domain/documentation/documentation.error.js +0 -1
  105. package/dist/domain/documentation/documentationError.base.d.ts +0 -1
  106. package/dist/domain/documentation/documentationError.base.js +0 -1
  107. package/dist/domain/documentation/documentationError.types.d.ts +0 -1
  108. package/dist/domain/documentation/documentationError.types.js +0 -1
  109. package/dist/domain/documentation/index.d.ts +0 -1
  110. package/dist/domain/documentation/index.js +0 -1
  111. package/dist/domain/event/event.error.d.ts +0 -1
  112. package/dist/domain/event/event.error.js +0 -1
  113. package/dist/domain/event/eventError.base.d.ts +0 -1
  114. package/dist/domain/event/eventError.base.js +0 -1
  115. package/dist/domain/event/eventError.handler.d.ts +0 -1
  116. package/dist/domain/event/eventError.handler.js +0 -1
  117. package/dist/domain/event/eventError.lifecycle.d.ts +0 -1
  118. package/dist/domain/event/eventError.lifecycle.js +0 -1
  119. package/dist/domain/event/eventError.serialization.d.ts +0 -1
  120. package/dist/domain/event/eventError.serialization.js +0 -1
  121. package/dist/domain/event/index.d.ts +0 -1
  122. package/dist/domain/event/index.js +0 -1
  123. package/dist/domain/index.d.ts +0 -1
  124. package/dist/domain/index.js +0 -1
  125. package/dist/domain/message/index.d.ts +0 -1
  126. package/dist/domain/message/index.js +0 -1
  127. package/dist/domain/message/message.error.d.ts +0 -1
  128. package/dist/domain/message/message.error.js +0 -1
  129. package/dist/domain/message/messageError.base.d.ts +0 -1
  130. package/dist/domain/message/messageError.base.js +0 -1
  131. package/dist/domain/message/messageError.handler.d.ts +0 -1
  132. package/dist/domain/message/messageError.handler.js +0 -1
  133. package/dist/domain/message/messageError.lifecycle.d.ts +0 -1
  134. package/dist/domain/message/messageError.lifecycle.js +0 -1
  135. package/dist/domain/message/messageError.serialization.d.ts +0 -1
  136. package/dist/domain/message/messageError.serialization.js +0 -1
  137. package/dist/domain/message/messageError.validation.d.ts +0 -1
  138. package/dist/domain/message/messageError.validation.js +0 -1
  139. package/dist/domain/openapi/index.d.ts +0 -1
  140. package/dist/domain/openapi/index.js +0 -1
  141. package/dist/domain/openapi/openApiError.base.d.ts +0 -1
  142. package/dist/domain/openapi/openApiError.base.js +0 -1
  143. package/dist/domain/plugin/index.d.ts +0 -1
  144. package/dist/domain/plugin/index.js +0 -1
  145. package/dist/domain/plugin/plugin.error.d.ts +0 -1
  146. package/dist/domain/plugin/plugin.error.js +0 -1
  147. package/dist/domain/plugin/pluginError.base.d.ts +0 -1
  148. package/dist/domain/plugin/pluginError.base.js +0 -1
  149. package/dist/domain/plugin/pluginError.lifecycle.d.ts +0 -1
  150. package/dist/domain/plugin/pluginError.lifecycle.js +0 -1
  151. package/dist/domain/plugin/pluginError.runtime.d.ts +0 -1
  152. package/dist/domain/plugin/pluginError.runtime.js +0 -1
  153. package/dist/domain/queue/index.d.ts +0 -1
  154. package/dist/domain/queue/index.js +0 -1
  155. package/dist/domain/queue/queue.error.d.ts +0 -1
  156. package/dist/domain/queue/queue.error.js +0 -1
  157. package/dist/domain/queue/queueError.base.d.ts +0 -1
  158. package/dist/domain/queue/queueError.base.js +0 -1
  159. package/dist/domain/queue/queueError.job.d.ts +0 -1
  160. package/dist/domain/queue/queueError.job.js +0 -1
  161. package/dist/domain/queue/queueError.queue.d.ts +0 -1
  162. package/dist/domain/queue/queueError.queue.js +0 -1
  163. package/dist/domain/queue/queueError.worker.d.ts +0 -1
  164. package/dist/domain/queue/queueError.worker.js +0 -1
  165. package/dist/domain/rpc/index.d.ts +0 -1
  166. package/dist/domain/rpc/index.js +0 -1
  167. package/dist/domain/rpc/rpc.error.d.ts +0 -1
  168. package/dist/domain/rpc/rpc.error.js +0 -1
  169. package/dist/domain/rpc/rpcError.base.d.ts +0 -1
  170. package/dist/domain/rpc/rpcError.base.js +0 -1
  171. package/dist/domain/rpc/rpcError.protocol.d.ts +0 -1
  172. package/dist/domain/rpc/rpcError.protocol.js +0 -1
  173. package/dist/domain/rpc/rpcError.transport.d.ts +0 -1
  174. package/dist/domain/rpc/rpcError.transport.js +0 -1
  175. package/dist/domain/scheduler/index.d.ts +0 -1
  176. package/dist/domain/scheduler/index.js +0 -1
  177. package/dist/domain/scheduler/scheduler.error.d.ts +0 -1
  178. package/dist/domain/scheduler/scheduler.error.js +0 -1
  179. package/dist/domain/scheduler/schedulerError.base.d.ts +0 -1
  180. package/dist/domain/scheduler/schedulerError.base.js +0 -1
  181. package/dist/domain/scheduler/schedulerError.execution.d.ts +0 -1
  182. package/dist/domain/scheduler/schedulerError.execution.js +0 -1
  183. package/dist/domain/scheduler/schedulerError.schedule.d.ts +0 -1
  184. package/dist/domain/scheduler/schedulerError.schedule.js +0 -1
  185. package/dist/domain/schema/index.d.ts +0 -1
  186. package/dist/domain/schema/index.js +0 -1
  187. package/dist/domain/schema/schema.error.d.ts +0 -1
  188. package/dist/domain/schema/schema.error.js +0 -1
  189. package/dist/domain/schema/schemaError.base.d.ts +0 -1
  190. package/dist/domain/schema/schemaError.base.js +0 -1
  191. package/dist/domain/schema/schemaError.types.d.ts +0 -1
  192. package/dist/domain/schema/schemaError.types.js +0 -1
  193. package/dist/domain/serialization/index.d.ts +0 -1
  194. package/dist/domain/serialization/index.js +0 -1
  195. package/dist/domain/serialization/serialization.error.d.ts +0 -1
  196. package/dist/domain/serialization/serialization.error.js +0 -1
  197. package/dist/domain/serialization/serializationError.base.d.ts +0 -1
  198. package/dist/domain/serialization/serializationError.base.js +0 -1
  199. package/dist/domain/serialization/serializationError.limits.d.ts +0 -1
  200. package/dist/domain/serialization/serializationError.limits.js +0 -1
  201. package/dist/domain/serialization/serializationError.types.d.ts +0 -1
  202. package/dist/domain/serialization/serializationError.types.js +0 -1
  203. package/dist/domain/shared/domainError.helpers.d.ts +0 -1
  204. package/dist/domain/shared/domainError.helpers.js +0 -1
  205. package/dist/domain/state/conflict.error.d.ts +0 -1
  206. package/dist/domain/state/conflict.error.js +0 -1
  207. package/dist/domain/state/index.d.ts +0 -1
  208. package/dist/domain/state/index.js +0 -1
  209. package/dist/domain/state/notFound.error.d.ts +0 -1
  210. package/dist/domain/state/notFound.error.js +0 -1
  211. package/dist/domain/state/validation.error.d.ts +0 -1
  212. package/dist/domain/state/validation.error.js +0 -1
  213. package/dist/domain/state/validationError.base.d.ts +0 -1
  214. package/dist/domain/state/validationError.base.js +0 -1
  215. package/dist/domain/state/validationError.helpers.d.ts +0 -1
  216. package/dist/domain/state/validationError.helpers.js +0 -1
  217. package/dist/domain/transaction/index.d.ts +0 -1
  218. package/dist/domain/transaction/index.js +0 -1
  219. package/dist/domain/transaction/transactionError.base.d.ts +0 -1
  220. package/dist/domain/transaction/transactionError.base.js +0 -1
  221. package/dist/domain/transaction/transactionError.misc.d.ts +0 -1
  222. package/dist/domain/transaction/transactionError.misc.js +0 -1
  223. package/dist/domain/transaction/transactionError.types.d.ts +0 -1
  224. package/dist/domain/transaction/transactionError.types.js +0 -1
  225. package/dist/domain/traversal/index.d.ts +0 -1
  226. package/dist/domain/traversal/index.js +0 -1
  227. package/dist/domain/traversal/traversalLimit.error.d.ts +0 -1
  228. package/dist/domain/traversal/traversalLimit.error.js +0 -1
  229. package/dist/index.d.ts +0 -1
  230. package/dist/index.js +0 -1
  231. package/dist/infrastructure/adapter/adapter.error.d.ts +0 -1
  232. package/dist/infrastructure/adapter/adapter.error.js +0 -1
  233. package/dist/infrastructure/adapter/adapterError.base.d.ts +0 -1
  234. package/dist/infrastructure/adapter/adapterError.base.js +0 -1
  235. package/dist/infrastructure/adapter/adapterError.lifecycle.d.ts +0 -1
  236. package/dist/infrastructure/adapter/adapterError.lifecycle.js +0 -1
  237. package/dist/infrastructure/adapter/adapterError.operation.d.ts +0 -1
  238. package/dist/infrastructure/adapter/adapterError.operation.js +2 -3
  239. package/dist/infrastructure/adapter/index.d.ts +0 -1
  240. package/dist/infrastructure/adapter/index.js +0 -1
  241. package/dist/infrastructure/cache/cache.error.d.ts +0 -1
  242. package/dist/infrastructure/cache/cache.error.js +0 -1
  243. package/dist/infrastructure/cache/cacheError.base.d.ts +0 -1
  244. package/dist/infrastructure/cache/cacheError.base.js +0 -1
  245. package/dist/infrastructure/cache/cacheError.factory.d.ts +0 -1
  246. package/dist/infrastructure/cache/cacheError.factory.js +0 -1
  247. package/dist/infrastructure/cache/index.d.ts +0 -1
  248. package/dist/infrastructure/cache/index.js +0 -1
  249. package/dist/infrastructure/container/container.error.d.ts +0 -1
  250. package/dist/infrastructure/container/container.error.js +0 -1
  251. package/dist/infrastructure/container/containerError.base.d.ts +0 -1
  252. package/dist/infrastructure/container/containerError.base.js +0 -1
  253. package/dist/infrastructure/container/containerError.registration.d.ts +0 -1
  254. package/dist/infrastructure/container/containerError.registration.js +0 -1
  255. package/dist/infrastructure/container/index.d.ts +0 -1
  256. package/dist/infrastructure/container/index.js +0 -1
  257. package/dist/infrastructure/httpPipeline/httpMiddleware.error.d.ts +0 -1
  258. package/dist/infrastructure/httpPipeline/httpMiddleware.error.js +0 -1
  259. package/dist/infrastructure/httpPipeline/httpRequestGuard.error.d.ts +0 -1
  260. package/dist/infrastructure/httpPipeline/httpRequestGuard.error.js +0 -1
  261. package/dist/infrastructure/httpPipeline/index.d.ts +0 -1
  262. package/dist/infrastructure/httpPipeline/index.js +0 -1
  263. package/dist/infrastructure/index.d.ts +0 -1
  264. package/dist/infrastructure/index.js +0 -1
  265. package/dist/infrastructure/middleware/index.d.ts +0 -1
  266. package/dist/infrastructure/middleware/index.js +0 -1
  267. package/dist/infrastructure/middleware/middleware.error.d.ts +0 -1
  268. package/dist/infrastructure/middleware/middleware.error.js +3 -1
  269. package/dist/infrastructure/middleware/middlewareError.types.d.ts +8 -3
  270. package/dist/infrastructure/middleware/middlewareError.types.js +27 -4
  271. package/dist/infrastructure/network/http.error.d.ts +0 -1
  272. package/dist/infrastructure/network/http.error.js +0 -1
  273. package/dist/infrastructure/network/httpAdapter.error.d.ts +0 -1
  274. package/dist/infrastructure/network/httpAdapter.error.js +0 -1
  275. package/dist/infrastructure/network/httpClient.errors.d.ts +0 -1
  276. package/dist/infrastructure/network/httpClient.errors.js +0 -1
  277. package/dist/infrastructure/network/httpClientError.advanced.d.ts +0 -1
  278. package/dist/infrastructure/network/httpClientError.advanced.js +0 -1
  279. package/dist/infrastructure/network/httpClientError.base.d.ts +0 -1
  280. package/dist/infrastructure/network/httpClientError.base.js +0 -1
  281. package/dist/infrastructure/network/httpClientError.common.d.ts +0 -1
  282. package/dist/infrastructure/network/httpClientError.common.js +0 -1
  283. package/dist/infrastructure/network/httpClientError.error.d.ts +0 -1
  284. package/dist/infrastructure/network/httpClientError.error.js +0 -1
  285. package/dist/infrastructure/network/httpClientError.options.d.ts +0 -1
  286. package/dist/infrastructure/network/httpClientError.options.js +0 -1
  287. package/dist/infrastructure/network/httpClientError.specialized.d.ts +0 -1
  288. package/dist/infrastructure/network/httpClientError.specialized.js +0 -1
  289. package/dist/infrastructure/network/httpClientError.types.d.ts +0 -1
  290. package/dist/infrastructure/network/httpClientError.types.js +0 -1
  291. package/dist/infrastructure/network/httpError.base.d.ts +0 -1
  292. package/dist/infrastructure/network/httpError.base.js +0 -1
  293. package/dist/infrastructure/network/httpError.helpers.d.ts +0 -1
  294. package/dist/infrastructure/network/httpError.helpers.js +0 -1
  295. package/dist/infrastructure/network/httpResponse.error.d.ts +0 -1
  296. package/dist/infrastructure/network/httpResponse.error.js +0 -1
  297. package/dist/infrastructure/network/httpRouter.error.d.ts +0 -1
  298. package/dist/infrastructure/network/httpRouter.error.js +0 -1
  299. package/dist/infrastructure/network/httpRouterError.base.d.ts +0 -1
  300. package/dist/infrastructure/network/httpRouterError.base.js +0 -1
  301. package/dist/infrastructure/network/httpRouterError.types.d.ts +22 -2
  302. package/dist/infrastructure/network/httpRouterError.types.js +24 -4
  303. package/dist/infrastructure/network/httpServerError.error.d.ts +7 -1
  304. package/dist/infrastructure/network/httpServerError.error.js +8 -2
  305. package/dist/infrastructure/network/httpServerLifecycle.error.d.ts +0 -1
  306. package/dist/infrastructure/network/httpServerLifecycle.error.js +0 -1
  307. package/dist/infrastructure/network/httpServerLifecycleError.base.d.ts +0 -1
  308. package/dist/infrastructure/network/httpServerLifecycleError.base.js +0 -1
  309. package/dist/infrastructure/network/httpServerLifecycleError.types.d.ts +0 -1
  310. package/dist/infrastructure/network/httpServerLifecycleError.types.js +0 -1
  311. package/dist/infrastructure/network/httpStream.error.d.ts +0 -1
  312. package/dist/infrastructure/network/httpStream.error.js +0 -1
  313. package/dist/infrastructure/network/index.d.ts +0 -1
  314. package/dist/infrastructure/network/index.js +0 -1
  315. package/dist/infrastructure/network/network.error.d.ts +0 -1
  316. package/dist/infrastructure/network/network.error.js +0 -1
  317. package/dist/infrastructure/network/networkError.base.d.ts +0 -1
  318. package/dist/infrastructure/network/networkError.base.js +0 -1
  319. package/dist/infrastructure/network/networkError.factory.d.ts +0 -1
  320. package/dist/infrastructure/network/networkError.factory.js +0 -1
  321. package/dist/infrastructure/network/routePattern.error.d.ts +0 -1
  322. package/dist/infrastructure/network/routePattern.error.js +0 -1
  323. package/dist/infrastructure/network/timeout.error.d.ts +0 -1
  324. package/dist/infrastructure/network/timeout.error.js +0 -1
  325. package/dist/infrastructure/network/timeoutError.base.d.ts +0 -1
  326. package/dist/infrastructure/network/timeoutError.base.js +0 -1
  327. package/dist/infrastructure/network/timeoutError.factory.d.ts +0 -1
  328. package/dist/infrastructure/network/timeoutError.factory.js +0 -1
  329. package/dist/infrastructure/service/externalService.error.d.ts +0 -1
  330. package/dist/infrastructure/service/externalService.error.js +0 -1
  331. package/dist/infrastructure/service/externalServiceError.base.d.ts +9 -3
  332. package/dist/infrastructure/service/externalServiceError.base.js +20 -3
  333. package/dist/infrastructure/service/externalServiceError.factory.d.ts +0 -1
  334. package/dist/infrastructure/service/externalServiceError.factory.js +0 -1
  335. package/dist/infrastructure/service/index.d.ts +0 -1
  336. package/dist/infrastructure/service/index.js +0 -1
  337. package/dist/infrastructure/service/service.error.d.ts +0 -1
  338. package/dist/infrastructure/service/service.error.js +0 -1
  339. package/dist/infrastructure/service/serviceError.base.d.ts +0 -1
  340. package/dist/infrastructure/service/serviceError.base.js +0 -1
  341. package/dist/infrastructure/service/serviceError.factory.d.ts +0 -1
  342. package/dist/infrastructure/service/serviceError.factory.js +0 -1
  343. package/dist/infrastructure/storage/database.error.d.ts +0 -1
  344. package/dist/infrastructure/storage/database.error.js +0 -1
  345. package/dist/infrastructure/storage/databaseError.base.d.ts +0 -1
  346. package/dist/infrastructure/storage/databaseError.base.js +0 -1
  347. package/dist/infrastructure/storage/databaseError.factory.d.ts +0 -1
  348. package/dist/infrastructure/storage/databaseError.factory.js +0 -1
  349. package/dist/infrastructure/storage/index.d.ts +0 -1
  350. package/dist/infrastructure/storage/index.js +0 -1
  351. package/dist/infrastructure/storage/storage.error.d.ts +0 -1
  352. package/dist/infrastructure/storage/storage.error.js +0 -1
  353. package/dist/infrastructure/storage/storageError.base.d.ts +0 -1
  354. package/dist/infrastructure/storage/storageError.base.js +0 -1
  355. package/dist/infrastructure/storage/storageError.factory.d.ts +0 -1
  356. package/dist/infrastructure/storage/storageError.factory.js +0 -1
  357. package/dist/system/crypto.error.d.ts +0 -1
  358. package/dist/system/crypto.error.js +0 -1
  359. package/dist/system/cryptoError.base.d.ts +0 -1
  360. package/dist/system/cryptoError.base.js +0 -1
  361. package/dist/system/cryptoError.factory.d.ts +0 -1
  362. package/dist/system/cryptoError.factory.js +0 -1
  363. package/dist/system/index.d.ts +0 -1
  364. package/dist/system/index.js +0 -1
  365. package/dist/system/logging/index.d.ts +0 -1
  366. package/dist/system/logging/index.js +0 -1
  367. package/dist/system/logging/logging.error.d.ts +0 -1
  368. package/dist/system/logging/logging.error.js +0 -1
  369. package/dist/system/observability/index.d.ts +0 -1
  370. package/dist/system/observability/index.js +0 -1
  371. package/dist/system/observability/observabilityError.base.d.ts +0 -1
  372. package/dist/system/observability/observabilityError.base.js +0 -1
  373. package/dist/system/runtime.error.d.ts +0 -1
  374. package/dist/system/runtime.error.js +0 -1
  375. package/dist/system/runtimeError.base.d.ts +0 -1
  376. package/dist/system/runtimeError.base.js +0 -1
  377. package/dist/system/runtimeError.types.d.ts +0 -1
  378. package/dist/system/runtimeError.types.js +0 -1
  379. package/dist/system/system.error.d.ts +0 -1
  380. package/dist/system/system.error.js +0 -1
  381. package/dist/system/systemError.base.d.ts +0 -1
  382. package/dist/system/systemError.base.js +0 -1
  383. package/dist/system/systemError.factory.d.ts +0 -1
  384. package/dist/system/systemError.factory.js +0 -1
  385. package/dist/utils/errorHandler.core.d.ts +1 -1
  386. package/dist/utils/errorHandler.core.js +12 -12
  387. package/dist/utils/errorHandler.factory.d.ts +0 -1
  388. package/dist/utils/errorHandler.factory.js +0 -1
  389. package/dist/utils/errorHandler.types.d.ts +11 -4
  390. package/dist/utils/errorHandler.types.js +0 -1
  391. package/dist/utils/errorMapper.core.d.ts +0 -1
  392. package/dist/utils/errorMapper.core.js +0 -1
  393. package/dist/utils/errorMapper.mappers.d.ts +0 -1
  394. package/dist/utils/errorMapper.mappers.js +0 -1
  395. package/dist/utils/errorMapper.registry.d.ts +0 -1
  396. package/dist/utils/errorMapper.registry.js +0 -1
  397. package/dist/utils/errorMapper.types.d.ts +0 -1
  398. package/dist/utils/errorMapper.types.js +0 -1
  399. package/dist/utils/errorSerializer.core.d.ts +6 -4
  400. package/dist/utils/errorSerializer.core.js +17 -19
  401. package/dist/utils/errorSerializer.factory.d.ts +0 -1
  402. package/dist/utils/errorSerializer.factory.js +0 -1
  403. package/dist/utils/errorSerializer.public.d.ts +41 -0
  404. package/dist/utils/errorSerializer.public.js +54 -0
  405. package/dist/utils/errorSerializer.types.d.ts +19 -3
  406. package/dist/utils/errorSerializer.types.js +0 -1
  407. package/dist/utils/errorUtils.extraction.d.ts +0 -1
  408. package/dist/utils/errorUtils.extraction.js +0 -1
  409. package/dist/utils/errorUtils.helper.d.ts +0 -1
  410. package/dist/utils/errorUtils.helper.js +0 -1
  411. package/dist/utils/errorUtils.transform.d.ts +0 -1
  412. package/dist/utils/errorUtils.transform.js +0 -1
  413. package/dist/utils/errorUtils.typeCheck.d.ts +0 -1
  414. package/dist/utils/errorUtils.typeCheck.js +0 -1
  415. package/dist/utils/index.d.ts +0 -1
  416. package/dist/utils/index.js +0 -1
  417. package/package.json +1 -1
@@ -2,10 +2,11 @@
2
2
  * Converts errors into safe, predictable serialized structures.
3
3
  */
4
4
  import { BaseError } from "../base/core/baseError.core.js";
5
- import { pickErrorMetadata, redactErrorMetadata, } from "../base/core/errorMetadata.core.js";
5
+ import { redactErrorMetadata } from "../base/core/errorMetadata.core.js";
6
6
  import { isGenuineSerializedBaseError, MAX_CAUSE_DEPTH, toJSONWithFrame, } from "../base/core/baseError.serialize.js";
7
7
  import { redactCauseFields, redactCauseValue, } from "../base/core/errorCause.redact.js";
8
8
  import { normalizeUnknownError } from "./errorSerializer.factory.js";
9
+ import { selectPublicIssues, selectPublicMetadata, } from "./errorSerializer.public.js";
9
10
  export { createErrorSerializer, serializeError, serializePublicError, normalizeUnknownError, } from "./errorSerializer.factory.js";
10
11
  /** Converts errors into safe, predictable serialized structures. */
11
12
  export class ErrorSerializer {
@@ -16,6 +17,7 @@ export class ErrorSerializer {
16
17
  redactSensitiveData;
17
18
  sensitiveKeyPattern;
18
19
  publicMetadataKeys;
20
+ exposeMetadata;
19
21
  constructor(options = {}) {
20
22
  this.includeStack = options.includeStack ?? false;
21
23
  this.includeCause = options.includeCause ?? false;
@@ -24,6 +26,7 @@ export class ErrorSerializer {
24
26
  this.redactSensitiveData = options.redactSensitiveData ?? true;
25
27
  this.sensitiveKeyPattern = options.sensitiveKeyPattern;
26
28
  this.publicMetadataKeys = options.publicMetadataKeys;
29
+ this.exposeMetadata = options.exposeMetadata ?? false;
27
30
  }
28
31
  /**
29
32
  * Serializes an error for internal logging or monitoring.
@@ -39,18 +42,22 @@ export class ErrorSerializer {
39
42
  /**
40
43
  * Serializes an error for an untrusted API client.
41
44
  *
42
- * Never includes a stack or cause. Metadata is only included when the error
43
- * is exposable (or when `publicMetadataKeys` allow-lists specific keys) and
44
- * is always redacted.
45
+ * Never includes a stack or cause. Metadata is included only for keys
46
+ * allow-listed by `publicMetadataKeys`, or, with `exposeMetadata`, for
47
+ * errors with `expose: true`; either way it is redacted. The `issues` of an
48
+ * exposable validation or schema error are included with submitted values
49
+ * replaced by type descriptions.
45
50
  */
46
51
  serializePublic(error) {
47
52
  const metadata = this.publicMetadata(error);
53
+ const issues = selectPublicIssues(error);
48
54
  return {
49
55
  code: error.code,
50
56
  message: error.expose ? error.message : this.safeMessage,
51
57
  category: error.category,
52
58
  statusCode: error.statusCode,
53
59
  ...(metadata !== undefined ? { metadata } : {}),
60
+ ...(issues !== undefined ? { issues } : {}),
54
61
  };
55
62
  }
56
63
  /** Serializes an unknown thrown value. */
@@ -116,20 +123,12 @@ export class ErrorSerializer {
116
123
  publicMetadata(error) {
117
124
  if (!this.includeMetadata)
118
125
  return undefined;
119
- let metadata;
120
- if (this.publicMetadataKeys !== undefined) {
121
- metadata = pickErrorMetadata(error.metadata, this.publicMetadataKeys);
122
- }
123
- else if (error.expose) {
124
- metadata = error.metadata;
125
- }
126
- else {
127
- return undefined;
128
- }
129
- const redacted = this.redactSensitiveData
130
- ? this.redactMetadata(metadata)
131
- : metadata;
132
- return Object.keys(redacted).length > 0 ? redacted : undefined;
126
+ return selectPublicMetadata(error, {
127
+ publicMetadataKeys: this.publicMetadataKeys,
128
+ exposeMetadata: this.exposeMetadata,
129
+ redactSensitiveData: this.redactSensitiveData,
130
+ sensitiveKeyPattern: this.sensitiveKeyPattern,
131
+ });
133
132
  }
134
133
  /** Removes commonly sensitive metadata fields (recursively). */
135
134
  redactMetadata(metadata) {
@@ -138,4 +137,3 @@ export class ErrorSerializer {
138
137
  });
139
138
  }
140
139
  }
141
- //# sourceMappingURL=errorSerializer.core.js.map
@@ -13,4 +13,3 @@ export declare function serializeError(error: BaseError, options?: ErrorSerializ
13
13
  export declare function serializePublicError(error: BaseError, options?: ErrorSerializerOptions): PublicErrorResponse;
14
14
  /** Converts an unknown thrown value into a BaseError. */
15
15
  export declare function normalizeUnknownError(value: unknown): BaseError;
16
- //# sourceMappingURL=errorSerializer.factory.d.ts.map
@@ -19,4 +19,3 @@ export function serializePublicError(error, options = {}) {
19
19
  export function normalizeUnknownError(value) {
20
20
  return normalizeUnknownToBaseError(value);
21
21
  }
22
- //# sourceMappingURL=errorSerializer.factory.js.map
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Decides what an untrusted client may see of an error's metadata and
3
+ * issues. Shared by `ErrorSerializer.serializePublic` and
4
+ * `ErrorHandler.toPublicResult` so the two never disagree.
5
+ */
6
+ import type { BaseError } from "../base/core/baseError.core.js";
7
+ import type { ErrorMetadata } from "../base/core/errorMetadata.type.js";
8
+ /** The options that govern public metadata selection. */
9
+ export interface PublicMetadataPolicy {
10
+ /** Keys copied into the public output for every error. */
11
+ readonly publicMetadataKeys?: readonly string[];
12
+ /** Copy the whole (redacted) metadata of errors with `expose: true`. */
13
+ readonly exposeMetadata?: boolean;
14
+ /** Redact sensitive keys. Defaults to true. */
15
+ readonly redactSensitiveData?: boolean;
16
+ /** Pattern used to detect sensitive metadata keys. */
17
+ readonly sensitiveKeyPattern?: RegExp;
18
+ }
19
+ /**
20
+ * Metadata allowed in a public response, or `undefined` when there is none.
21
+ *
22
+ * `publicMetadataKeys` allow-lists specific keys for exposed and non-exposed
23
+ * errors alike. Without it, metadata is included only when `exposeMetadata`
24
+ * is set and the error is exposable. `expose: true` on its own reveals no
25
+ * metadata: it says the *message* is safe for a client, and errors routinely
26
+ * carry decline codes, upstream ids and internal state in the metadata of an
27
+ * exposed error. Until round 12 that metadata was published whenever
28
+ * `expose` was true.
29
+ */
30
+ export declare function selectPublicMetadata(error: BaseError, policy: PublicMetadataPolicy): Readonly<ErrorMetadata> | undefined;
31
+ /**
32
+ * The issue list of an exposable validation or schema error, or `undefined`.
33
+ *
34
+ * `ValidationError.issues` and `SchemaError.issues` are the part of a 400 a
35
+ * client actually needs, and the public serializer used to drop them. Any
36
+ * exposable error carrying an `issues` array qualifies, so errors from a
37
+ * second copy of this package are covered too. Submitted values inside the
38
+ * issues (`value`, `received`, `input`, `actual`) are replaced by a type
39
+ * description, exactly as the errors' own `toJSON()` does.
40
+ */
41
+ export declare function selectPublicIssues(error: BaseError): readonly unknown[] | undefined;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Decides what an untrusted client may see of an error's metadata and
3
+ * issues. Shared by `ErrorSerializer.serializePublic` and
4
+ * `ErrorHandler.toPublicResult` so the two never disagree.
5
+ */
6
+ import { pickErrorMetadata, redactErrorMetadata, } from "../base/core/errorMetadata.core.js";
7
+ import { redactIssueValues, toJsonSafeIssues, } from "../domain/shared/domainError.helpers.js";
8
+ /**
9
+ * Metadata allowed in a public response, or `undefined` when there is none.
10
+ *
11
+ * `publicMetadataKeys` allow-lists specific keys for exposed and non-exposed
12
+ * errors alike. Without it, metadata is included only when `exposeMetadata`
13
+ * is set and the error is exposable. `expose: true` on its own reveals no
14
+ * metadata: it says the *message* is safe for a client, and errors routinely
15
+ * carry decline codes, upstream ids and internal state in the metadata of an
16
+ * exposed error. Until round 12 that metadata was published whenever
17
+ * `expose` was true.
18
+ */
19
+ export function selectPublicMetadata(error, policy) {
20
+ let metadata;
21
+ if (policy.publicMetadataKeys !== undefined) {
22
+ metadata = pickErrorMetadata(error.metadata, policy.publicMetadataKeys);
23
+ }
24
+ else if (policy.exposeMetadata === true && error.expose) {
25
+ metadata = error.metadata;
26
+ }
27
+ else {
28
+ return undefined;
29
+ }
30
+ const visible = policy.redactSensitiveData === false
31
+ ? metadata
32
+ : redactErrorMetadata(metadata, {
33
+ sensitiveKeyPattern: policy.sensitiveKeyPattern,
34
+ });
35
+ return Object.keys(visible).length > 0 ? visible : undefined;
36
+ }
37
+ /**
38
+ * The issue list of an exposable validation or schema error, or `undefined`.
39
+ *
40
+ * `ValidationError.issues` and `SchemaError.issues` are the part of a 400 a
41
+ * client actually needs, and the public serializer used to drop them. Any
42
+ * exposable error carrying an `issues` array qualifies, so errors from a
43
+ * second copy of this package are covered too. Submitted values inside the
44
+ * issues (`value`, `received`, `input`, `actual`) are replaced by a type
45
+ * description, exactly as the errors' own `toJSON()` does.
46
+ */
47
+ export function selectPublicIssues(error) {
48
+ if (!error.expose)
49
+ return undefined;
50
+ const issues = error.issues;
51
+ if (!Array.isArray(issues) || issues.length === 0)
52
+ return undefined;
53
+ return redactIssueValues(toJsonSafeIssues(issues));
54
+ }
@@ -21,10 +21,21 @@ export interface ErrorSerializerOptions {
21
21
  * Metadata keys allowed in public output.
22
22
  *
23
23
  * When provided, only these keys are copied into `PublicErrorResponse.metadata`
24
- * (for exposed and non-exposed errors alike). When omitted, metadata is only
25
- * included for errors with `expose: true`, and never for non-exposed errors.
24
+ * (for exposed and non-exposed errors alike). This is the recommended way
25
+ * to publish metadata: name the keys a client may see.
26
26
  */
27
27
  readonly publicMetadataKeys?: readonly string[];
28
+ /**
29
+ * Copy the whole (redacted) metadata of errors with `expose: true` into
30
+ * `PublicErrorResponse.metadata`. Defaults to false.
31
+ *
32
+ * This was the behaviour before round 12 and is a data-exposure risk:
33
+ * `expose` says the message is safe for a client, not that everything put
34
+ * in `metadata` (decline codes, upstream ids, internal state) is. Prefer
35
+ * `publicMetadataKeys`; enable this only for errors whose metadata is
36
+ * written for clients. Ignored when `publicMetadataKeys` is set.
37
+ */
38
+ readonly exposeMetadata?: boolean;
28
39
  }
29
40
  /** Public error representation suitable for an API response. */
30
41
  export interface PublicErrorResponse {
@@ -33,8 +44,13 @@ export interface PublicErrorResponse {
33
44
  readonly category: ErrorCategory;
34
45
  readonly statusCode: number;
35
46
  readonly metadata?: Readonly<Record<string, unknown>>;
47
+ /**
48
+ * Validation or schema issues of an exposable error (`ValidationError`,
49
+ * `SchemaError` and any error carrying an `issues` array), with submitted
50
+ * values replaced by type descriptions. Absent for non-exposed errors.
51
+ */
52
+ readonly issues?: readonly unknown[];
36
53
  }
37
54
  /** Internal serialized error representation. */
38
55
  export interface InternalErrorResponse extends SerializedBaseError {
39
56
  }
40
- //# sourceMappingURL=errorSerializer.types.d.ts.map
@@ -2,4 +2,3 @@
2
2
  * Error serializer types and interfaces.
3
3
  */
4
4
  import { ErrorCategory } from "../base/types/errorCategory.type.js";
5
- //# sourceMappingURL=errorSerializer.types.js.map
@@ -14,4 +14,3 @@ export declare function getRootCause(value: unknown): unknown;
14
14
  export declare function getRootBaseError(value: unknown): BaseError | undefined;
15
15
  /** Extracts a plain object of useful error diagnostics. */
16
16
  export declare function getErrorDiagnostics(value: unknown): Record<string, unknown>;
17
- //# sourceMappingURL=errorUtils.extraction.d.ts.map
@@ -88,4 +88,3 @@ export function getErrorDiagnostics(value) {
88
88
  }
89
89
  return diagnostics;
90
90
  }
91
- //# sourceMappingURL=errorUtils.extraction.js.map
@@ -4,4 +4,3 @@
4
4
  export { isErrorLike, isOperationalError, isExposableError, isServerError, isClientError, hasErrorCategory, hasErrorSeverity, } from "./errorUtils.typeCheck.js";
5
5
  export { getErrorMessage, getErrorName, getErrorStack, getRootCause, getRootBaseError, getErrorDiagnostics, } from "./errorUtils.extraction.js";
6
6
  export { toError, withErrorContext, tryCatch, tryCatchAsync, normalizeToBaseError, } from "./errorUtils.transform.js";
7
- //# sourceMappingURL=errorUtils.helper.d.ts.map
@@ -4,4 +4,3 @@
4
4
  export { isErrorLike, isOperationalError, isExposableError, isServerError, isClientError, hasErrorCategory, hasErrorSeverity, } from "./errorUtils.typeCheck.js";
5
5
  export { getErrorMessage, getErrorName, getErrorStack, getRootCause, getRootBaseError, getErrorDiagnostics, } from "./errorUtils.extraction.js";
6
6
  export { toError, withErrorContext, tryCatch, tryCatchAsync, normalizeToBaseError, } from "./errorUtils.transform.js";
7
- //# sourceMappingURL=errorUtils.helper.js.map
@@ -24,4 +24,3 @@ export declare function tryCatchAsync<T>(operation: () => T | Promise<T>): Promi
24
24
  }>;
25
25
  /** Converts an unknown thrown value into a BaseError. */
26
26
  export declare function normalizeToBaseError(value: unknown): BaseError;
27
- //# sourceMappingURL=errorUtils.transform.d.ts.map
@@ -37,4 +37,3 @@ export async function tryCatchAsync(operation) {
37
37
  export function normalizeToBaseError(value) {
38
38
  return normalizeUnknownToBaseError(value);
39
39
  }
40
- //# sourceMappingURL=errorUtils.transform.js.map
@@ -21,4 +21,3 @@ export declare function isClientError(value: unknown): boolean;
21
21
  export declare function hasErrorCategory(value: unknown, category: ErrorCategory): boolean;
22
22
  /** Returns whether an error has a specific severity. */
23
23
  export declare function hasErrorSeverity(value: unknown, severity: ErrorSeverity): boolean;
24
- //# sourceMappingURL=errorUtils.typeCheck.d.ts.map
@@ -40,4 +40,3 @@ export function hasErrorCategory(value, category) {
40
40
  export function hasErrorSeverity(value, severity) {
41
41
  return isBaseError(value) && value.severity === severity;
42
42
  }
43
- //# sourceMappingURL=errorUtils.typeCheck.js.map
@@ -7,4 +7,3 @@ export * from "./errorHandler.core.js";
7
7
  export * from "./errorMapper.core.js";
8
8
  export * from "./errorSerializer.core.js";
9
9
  export * from "./errorUtils.helper.js";
10
- //# sourceMappingURL=index.d.ts.map
@@ -7,4 +7,3 @@ export * from "./errorHandler.core.js";
7
7
  export * from "./errorMapper.core.js";
8
8
  export * from "./errorSerializer.core.js";
9
9
  export * from "./errorUtils.helper.js";
10
- //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zudojs/errors",
3
- "version": "1.3.2",
3
+ "version": "1.4.0",
4
4
  "description": "Shared error base class, error codes, and error handling utilities for the Zudojs framework.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",