@rexezuge/errors 1.2.0 → 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 (81) hide show
  1. package/dist/BadGatewayError.d.ts +1 -1
  2. package/dist/BadGatewayError.d.ts.map +1 -1
  3. package/dist/BadGatewayError.js +1 -12
  4. package/dist/BadGatewayError.js.map +7 -1
  5. package/dist/BadRequestError.d.ts +1 -1
  6. package/dist/BadRequestError.d.ts.map +1 -1
  7. package/dist/BadRequestError.js +1 -11
  8. package/dist/BadRequestError.js.map +7 -1
  9. package/dist/CATALOG.js +1 -92
  10. package/dist/CATALOG.js.map +7 -1
  11. package/dist/ConflictError.d.ts +1 -1
  12. package/dist/ConflictError.d.ts.map +1 -1
  13. package/dist/ConflictError.js +1 -12
  14. package/dist/ConflictError.js.map +7 -1
  15. package/dist/DatabaseError.d.ts +1 -1
  16. package/dist/DatabaseError.d.ts.map +1 -1
  17. package/dist/DatabaseError.js +1 -18
  18. package/dist/DatabaseError.js.map +7 -1
  19. package/dist/ErrorResponse.js +0 -2
  20. package/dist/ErrorResponse.js.map +7 -1
  21. package/dist/ForbiddenError.d.ts +1 -1
  22. package/dist/ForbiddenError.d.ts.map +1 -1
  23. package/dist/ForbiddenError.js +1 -11
  24. package/dist/ForbiddenError.js.map +7 -1
  25. package/dist/HttpServiceError.d.ts +3 -3
  26. package/dist/HttpServiceError.d.ts.map +1 -1
  27. package/dist/HttpServiceError.js +1 -16
  28. package/dist/HttpServiceError.js.map +7 -1
  29. package/dist/InternalServerError.d.ts +1 -1
  30. package/dist/InternalServerError.d.ts.map +1 -1
  31. package/dist/InternalServerError.js +1 -16
  32. package/dist/InternalServerError.js.map +7 -1
  33. package/dist/MethodNotAllowedError.d.ts +1 -1
  34. package/dist/MethodNotAllowedError.d.ts.map +1 -1
  35. package/dist/MethodNotAllowedError.js +1 -11
  36. package/dist/MethodNotAllowedError.js.map +7 -1
  37. package/dist/NotFoundError.d.ts +1 -1
  38. package/dist/NotFoundError.d.ts.map +1 -1
  39. package/dist/NotFoundError.js +1 -11
  40. package/dist/NotFoundError.js.map +7 -1
  41. package/dist/NotImplementedError.d.ts +1 -1
  42. package/dist/NotImplementedError.d.ts.map +1 -1
  43. package/dist/NotImplementedError.js +1 -11
  44. package/dist/NotImplementedError.js.map +7 -1
  45. package/dist/OutcomeError.d.ts +2 -2
  46. package/dist/OutcomeError.d.ts.map +1 -1
  47. package/dist/OutcomeError.js +1 -50
  48. package/dist/OutcomeError.js.map +7 -1
  49. package/dist/PayloadTooLargeError.d.ts +1 -1
  50. package/dist/PayloadTooLargeError.d.ts.map +1 -1
  51. package/dist/PayloadTooLargeError.js +1 -11
  52. package/dist/PayloadTooLargeError.js.map +7 -1
  53. package/dist/PreconditionFailedError.d.ts +1 -1
  54. package/dist/PreconditionFailedError.d.ts.map +1 -1
  55. package/dist/PreconditionFailedError.js +1 -12
  56. package/dist/PreconditionFailedError.js.map +7 -1
  57. package/dist/RateLimitedError.d.ts +1 -1
  58. package/dist/RateLimitedError.d.ts.map +1 -1
  59. package/dist/RateLimitedError.js +1 -12
  60. package/dist/RateLimitedError.js.map +7 -1
  61. package/dist/ServiceError.d.ts +22 -8
  62. package/dist/ServiceError.d.ts.map +1 -1
  63. package/dist/ServiceError.js +1 -84
  64. package/dist/ServiceError.js.map +7 -1
  65. package/dist/ServiceUnavailableError.d.ts +1 -1
  66. package/dist/ServiceUnavailableError.d.ts.map +1 -1
  67. package/dist/ServiceUnavailableError.js +1 -12
  68. package/dist/ServiceUnavailableError.js.map +7 -1
  69. package/dist/UnauthorizedError.d.ts +1 -1
  70. package/dist/UnauthorizedError.d.ts.map +1 -1
  71. package/dist/UnauthorizedError.js +1 -12
  72. package/dist/UnauthorizedError.js.map +7 -1
  73. package/dist/UnsupportedMediaTypeError.d.ts +1 -1
  74. package/dist/UnsupportedMediaTypeError.d.ts.map +1 -1
  75. package/dist/UnsupportedMediaTypeError.js +1 -11
  76. package/dist/UnsupportedMediaTypeError.js.map +7 -1
  77. package/dist/index.d.ts +22 -22
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +1 -20
  80. package/dist/index.js.map +7 -1
  81. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { HttpServiceError } from './HttpServiceError';
1
+ import { HttpServiceError } from './HttpServiceError.ts';
2
2
  /**
3
3
  * 502 — an upstream dependency answered invalidly. Pair with `retryable: true`
4
4
  * when the upstream is known to recover on its own.
@@ -1 +1 @@
1
- {"version":3,"file":"BadGatewayError.d.ts","sourceRoot":"","sources":["../src/BadGatewayError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,cAAM,eAAgB,SAAQ,gBAAgB,CAAC,YAAY,CAAC;gBAC9C,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"BadGatewayError.d.ts","sourceRoot":"","sources":["../src/BadGatewayError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;GAGG;AACH,cAAM,eAAgB,SAAQ,gBAAgB,CAAC,YAAY,CAAC;gBAC9C,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,12 +1 @@
1
- import { HttpServiceError } from './HttpServiceError';
2
- /**
3
- * 502 — an upstream dependency answered invalidly. Pair with `retryable: true`
4
- * when the upstream is known to recover on its own.
5
- */
6
- class BadGatewayError extends HttpServiceError {
7
- constructor(message) {
8
- super('BadGateway', message);
9
- }
10
- }
11
- export { BadGatewayError };
12
- //# sourceMappingURL=BadGatewayError.js.map
1
+ import{HttpServiceError as t}from"./HttpServiceError.js";class e extends t{constructor(r){super("BadGateway",r)}}export{e as BadGatewayError};
@@ -1 +1,7 @@
1
- {"version":3,"file":"BadGatewayError.js","sourceRoot":"","sources":["../src/BadGatewayError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,eAAgB,SAAQ,gBAA8B;IAC1D,YAAY,OAAgB;QAC1B,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;CACF;AAED,OAAO,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 502 — an upstream dependency answered invalidly. Pair with `retryable: true`\n * when the upstream is known to recover on its own.\n */\nclass BadGatewayError extends HttpServiceError<'BadGateway'> {\n constructor(message?: string) {\n super('BadGateway', message);\n }\n}\n\nexport { BadGatewayError };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/BadGatewayError.ts"],
4
+ "sourcesContent": ["import { HttpServiceError } from './HttpServiceError.ts';\n\n/**\n * 502 — an upstream dependency answered invalidly. Pair with `retryable: true`\n * when the upstream is known to recover on its own.\n */\nclass BadGatewayError extends HttpServiceError<'BadGateway'> {\n constructor(message?: string) {\n super('BadGateway', message);\n }\n}\n\nexport { BadGatewayError };\n"],
5
+ "mappings": "AAAA,OAAS,oBAAAA,MAAwB,wBAMjC,MAAMC,UAAwBD,CAA8B,CAC1D,YAAYE,EAAgB,CAC1B,MAAM,aAAcA,CAAO,CAC7B",
6
+ "names": ["HttpServiceError", "BadGatewayError", "message"]
7
+ }
@@ -1,4 +1,4 @@
1
- import { HttpServiceError } from './HttpServiceError';
1
+ import { HttpServiceError } from './HttpServiceError.ts';
2
2
  /**
3
3
  * 400 — malformed or missing input. Retrying without a change always fails.
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"BadRequestError.d.ts","sourceRoot":"","sources":["../src/BadRequestError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,cAAM,eAAgB,SAAQ,gBAAgB,CAAC,YAAY,CAAC;gBAC9C,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"BadRequestError.d.ts","sourceRoot":"","sources":["../src/BadRequestError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;GAEG;AACH,cAAM,eAAgB,SAAQ,gBAAgB,CAAC,YAAY,CAAC;gBAC9C,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,11 +1 @@
1
- import { HttpServiceError } from './HttpServiceError';
2
- /**
3
- * 400 — malformed or missing input. Retrying without a change always fails.
4
- */
5
- class BadRequestError extends HttpServiceError {
6
- constructor(message) {
7
- super('BadRequest', message);
8
- }
9
- }
10
- export { BadRequestError };
11
- //# sourceMappingURL=BadRequestError.js.map
1
+ import{HttpServiceError as e}from"./HttpServiceError.js";class t extends e{constructor(r){super("BadRequest",r)}}export{t as BadRequestError};
@@ -1 +1,7 @@
1
- {"version":3,"file":"BadRequestError.js","sourceRoot":"","sources":["../src/BadRequestError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,eAAgB,SAAQ,gBAA8B;IAC1D,YAAY,OAAgB;QAC1B,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;CACF;AAED,OAAO,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 400 — malformed or missing input. Retrying without a change always fails.\n */\nclass BadRequestError extends HttpServiceError<'BadRequest'> {\n constructor(message?: string) {\n super('BadRequest', message);\n }\n}\n\nexport { BadRequestError };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/BadRequestError.ts"],
4
+ "sourcesContent": ["import { HttpServiceError } from './HttpServiceError.ts';\n\n/**\n * 400 — malformed or missing input. Retrying without a change always fails.\n */\nclass BadRequestError extends HttpServiceError<'BadRequest'> {\n constructor(message?: string) {\n super('BadRequest', message);\n }\n}\n\nexport { BadRequestError };\n"],
5
+ "mappings": "AAAA,OAAS,oBAAAA,MAAwB,wBAKjC,MAAMC,UAAwBD,CAA8B,CAC1D,YAAYE,EAAgB,CAC1B,MAAM,aAAcA,CAAO,CAC7B",
6
+ "names": ["HttpServiceError", "BadRequestError", "message"]
7
+ }
package/dist/CATALOG.js CHANGED
@@ -1,92 +1 @@
1
- const CATALOG = {
2
- BadRequest: {
3
- status: 400,
4
- code: 'BAD_REQUEST',
5
- defaultMessage: 'The request could not be understood or was missing required parameters.',
6
- expose: true,
7
- },
8
- Unauthorized: {
9
- status: 401,
10
- code: 'UNAUTHORIZED',
11
- defaultMessage: 'Authentication is required and has failed or has not yet been provided.',
12
- expose: true,
13
- },
14
- Forbidden: {
15
- status: 403,
16
- code: 'FORBIDDEN',
17
- defaultMessage: 'You do not have permission to perform this action.',
18
- expose: true,
19
- },
20
- NotFound: {
21
- status: 404,
22
- code: 'NOT_FOUND',
23
- defaultMessage: 'The requested resource was not found.',
24
- expose: true,
25
- },
26
- MethodNotAllowed: {
27
- status: 405,
28
- code: 'METHOD_NOT_ALLOWED',
29
- defaultMessage: 'The requested method is not allowed for this resource.',
30
- expose: true,
31
- },
32
- Conflict: {
33
- // Distinct from `BadRequest` so callers can tell "invalid input" from
34
- // "that value is taken" — the latter never succeeds without a change.
35
- status: 409,
36
- code: 'CONFLICT',
37
- defaultMessage: 'The request conflicts with the current state of the resource.',
38
- expose: true,
39
- },
40
- PreconditionFailed: {
41
- status: 412,
42
- code: 'PRECONDITION_FAILED',
43
- defaultMessage: 'A precondition for this request failed.',
44
- expose: true,
45
- },
46
- PayloadTooLarge: {
47
- status: 413,
48
- code: 'PAYLOAD_TOO_LARGE',
49
- defaultMessage: 'The request payload is larger than the server is willing to process.',
50
- expose: true,
51
- },
52
- UnsupportedMediaType: {
53
- status: 415,
54
- code: 'UNSUPPORTED_MEDIA_TYPE',
55
- defaultMessage: 'The request payload format is not supported by this resource.',
56
- expose: true,
57
- },
58
- RateLimited: {
59
- status: 429,
60
- code: 'RATE_LIMITED',
61
- defaultMessage: 'Too many requests — slow down and retry later.',
62
- expose: true,
63
- },
64
- InternalServerError: {
65
- status: 500,
66
- code: 'INTERNAL_SERVER_ERROR',
67
- defaultMessage: 'The server encountered an internal error and was unable to complete your request.',
68
- expose: false,
69
- },
70
- NotImplemented: {
71
- status: 501,
72
- code: 'NOT_IMPLEMENTED',
73
- defaultMessage: 'The server does not support the functionality required to fulfil this request.',
74
- expose: false,
75
- },
76
- // Upstream dependency failures: 502 is the honest status here, and the
77
- // retryable marker (not the status) is what schedules a retry.
78
- BadGateway: {
79
- status: 502,
80
- code: 'BAD_GATEWAY',
81
- defaultMessage: 'The server received an invalid response from an upstream service.',
82
- expose: false,
83
- },
84
- ServiceUnavailable: {
85
- status: 503,
86
- code: 'SERVICE_UNAVAILABLE',
87
- defaultMessage: 'The server is currently unable to handle the request — retry after a delay.',
88
- expose: true,
89
- },
90
- };
91
- export { CATALOG };
92
- //# sourceMappingURL=CATALOG.js.map
1
+ const e={BadRequest:{status:400,code:"BAD_REQUEST",defaultMessage:"The request could not be understood or was missing required parameters.",expose:!0},Unauthorized:{status:401,code:"UNAUTHORIZED",defaultMessage:"Authentication is required and has failed or has not yet been provided.",expose:!0},Forbidden:{status:403,code:"FORBIDDEN",defaultMessage:"You do not have permission to perform this action.",expose:!0},NotFound:{status:404,code:"NOT_FOUND",defaultMessage:"The requested resource was not found.",expose:!0},MethodNotAllowed:{status:405,code:"METHOD_NOT_ALLOWED",defaultMessage:"The requested method is not allowed for this resource.",expose:!0},Conflict:{status:409,code:"CONFLICT",defaultMessage:"The request conflicts with the current state of the resource.",expose:!0},PreconditionFailed:{status:412,code:"PRECONDITION_FAILED",defaultMessage:"A precondition for this request failed.",expose:!0},PayloadTooLarge:{status:413,code:"PAYLOAD_TOO_LARGE",defaultMessage:"The request payload is larger than the server is willing to process.",expose:!0},UnsupportedMediaType:{status:415,code:"UNSUPPORTED_MEDIA_TYPE",defaultMessage:"The request payload format is not supported by this resource.",expose:!0},RateLimited:{status:429,code:"RATE_LIMITED",defaultMessage:"Too many requests \u2014 slow down and retry later.",expose:!0},InternalServerError:{status:500,code:"INTERNAL_SERVER_ERROR",defaultMessage:"The server encountered an internal error and was unable to complete your request.",expose:!1},NotImplemented:{status:501,code:"NOT_IMPLEMENTED",defaultMessage:"The server does not support the functionality required to fulfil this request.",expose:!1},BadGateway:{status:502,code:"BAD_GATEWAY",defaultMessage:"The server received an invalid response from an upstream service.",expose:!1},ServiceUnavailable:{status:503,code:"SERVICE_UNAVAILABLE",defaultMessage:"The server is currently unable to handle the request \u2014 retry after a delay.",expose:!0}};export{e as CATALOG};
@@ -1 +1,7 @@
1
- {"version":3,"file":"CATALOG.js","sourceRoot":"","sources":["../src/CATALOG.ts"],"names":[],"mappings":"AAmBA,MAAM,OAAO,GAAG;IACd,UAAU,EAAE;QACV,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,aAAa;QACnB,cAAc,EAAE,yEAAyE;QACzF,MAAM,EAAE,IAAI;KACb;IACD,YAAY,EAAE;QACZ,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,cAAc;QACpB,cAAc,EAAE,yEAAyE;QACzF,MAAM,EAAE,IAAI;KACb;IACD,SAAS,EAAE;QACT,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,WAAW;QACjB,cAAc,EAAE,oDAAoD;QACpE,MAAM,EAAE,IAAI;KACb;IACD,QAAQ,EAAE;QACR,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,WAAW;QACjB,cAAc,EAAE,uCAAuC;QACvD,MAAM,EAAE,IAAI;KACb;IACD,gBAAgB,EAAE;QAChB,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,oBAAoB;QAC1B,cAAc,EAAE,wDAAwD;QACxE,MAAM,EAAE,IAAI;KACb;IACD,QAAQ,EAAE;QACR,sEAAsE;QACtE,sEAAsE;QACtE,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,UAAU;QAChB,cAAc,EAAE,+DAA+D;QAC/E,MAAM,EAAE,IAAI;KACb;IACD,kBAAkB,EAAE;QAClB,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,qBAAqB;QAC3B,cAAc,EAAE,yCAAyC;QACzD,MAAM,EAAE,IAAI;KACb;IACD,eAAe,EAAE;QACf,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,mBAAmB;QACzB,cAAc,EAAE,sEAAsE;QACtF,MAAM,EAAE,IAAI;KACb;IACD,oBAAoB,EAAE;QACpB,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,wBAAwB;QAC9B,cAAc,EAAE,+DAA+D;QAC/E,MAAM,EAAE,IAAI;KACb;IACD,WAAW,EAAE;QACX,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,cAAc;QACpB,cAAc,EAAE,gDAAgD;QAChE,MAAM,EAAE,IAAI;KACb;IACD,mBAAmB,EAAE;QACnB,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,uBAAuB;QAC7B,cAAc,EAAE,mFAAmF;QACnG,MAAM,EAAE,KAAK;KACd;IACD,cAAc,EAAE;QACd,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,iBAAiB;QACvB,cAAc,EAAE,gFAAgF;QAChG,MAAM,EAAE,KAAK;KACd;IACD,uEAAuE;IACvE,+DAA+D;IAC/D,UAAU,EAAE;QACV,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,aAAa;QACnB,cAAc,EAAE,mEAAmE;QACnF,MAAM,EAAE,KAAK;KACd;IACD,kBAAkB,EAAE;QAClB,MAAM,EAAE,GAAG;QACX,IAAI,EAAE,qBAAqB;QAC3B,cAAc,EAAE,6EAA6E;QAC7F,MAAM,EAAE,IAAI;KACb;CACqD,CAAC;AAIzD,OAAO,EAAE,OAAO,EAAE,CAAC","sourcesContent":["/**\n * The single source of truth for HTTP-semantic errors.\n *\n * Eight repos carried this table as fourteen copy-pasted classes; the status,\n * machine code, and default message could drift per file. The catalog keeps all\n * three fields adjacent, so adding a status is one row, and a status can never\n * disagree with its code.\n *\n * `expose` marks whether the raw message may reach a client. Every 4xx is\n * trusted; every 5xx is not — a 5xx message is for operators, and\n * `toErrorResponse()` substitutes a generic one.\n */\ninterface HttpErrorDefinition {\n status: number;\n code: string;\n defaultMessage: string;\n expose: boolean;\n}\n\nconst CATALOG = {\n BadRequest: {\n status: 400,\n code: 'BAD_REQUEST',\n defaultMessage: 'The request could not be understood or was missing required parameters.',\n expose: true,\n },\n Unauthorized: {\n status: 401,\n code: 'UNAUTHORIZED',\n defaultMessage: 'Authentication is required and has failed or has not yet been provided.',\n expose: true,\n },\n Forbidden: {\n status: 403,\n code: 'FORBIDDEN',\n defaultMessage: 'You do not have permission to perform this action.',\n expose: true,\n },\n NotFound: {\n status: 404,\n code: 'NOT_FOUND',\n defaultMessage: 'The requested resource was not found.',\n expose: true,\n },\n MethodNotAllowed: {\n status: 405,\n code: 'METHOD_NOT_ALLOWED',\n defaultMessage: 'The requested method is not allowed for this resource.',\n expose: true,\n },\n Conflict: {\n // Distinct from `BadRequest` so callers can tell \"invalid input\" from\n // \"that value is taken\" — the latter never succeeds without a change.\n status: 409,\n code: 'CONFLICT',\n defaultMessage: 'The request conflicts with the current state of the resource.',\n expose: true,\n },\n PreconditionFailed: {\n status: 412,\n code: 'PRECONDITION_FAILED',\n defaultMessage: 'A precondition for this request failed.',\n expose: true,\n },\n PayloadTooLarge: {\n status: 413,\n code: 'PAYLOAD_TOO_LARGE',\n defaultMessage: 'The request payload is larger than the server is willing to process.',\n expose: true,\n },\n UnsupportedMediaType: {\n status: 415,\n code: 'UNSUPPORTED_MEDIA_TYPE',\n defaultMessage: 'The request payload format is not supported by this resource.',\n expose: true,\n },\n RateLimited: {\n status: 429,\n code: 'RATE_LIMITED',\n defaultMessage: 'Too many requests — slow down and retry later.',\n expose: true,\n },\n InternalServerError: {\n status: 500,\n code: 'INTERNAL_SERVER_ERROR',\n defaultMessage: 'The server encountered an internal error and was unable to complete your request.',\n expose: false,\n },\n NotImplemented: {\n status: 501,\n code: 'NOT_IMPLEMENTED',\n defaultMessage: 'The server does not support the functionality required to fulfil this request.',\n expose: false,\n },\n // Upstream dependency failures: 502 is the honest status here, and the\n // retryable marker (not the status) is what schedules a retry.\n BadGateway: {\n status: 502,\n code: 'BAD_GATEWAY',\n defaultMessage: 'The server received an invalid response from an upstream service.',\n expose: false,\n },\n ServiceUnavailable: {\n status: 503,\n code: 'SERVICE_UNAVAILABLE',\n defaultMessage: 'The server is currently unable to handle the request — retry after a delay.',\n expose: true,\n },\n} as const satisfies Record<string, HttpErrorDefinition>;\n\ntype HttpErrorType = keyof typeof CATALOG;\n\nexport { CATALOG };\nexport type { HttpErrorDefinition, HttpErrorType };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/CATALOG.ts"],
4
+ "sourcesContent": ["/**\n * The single source of truth for HTTP-semantic errors.\n *\n * Eight repos carried this table as fourteen copy-pasted classes; the status,\n * machine code, and default message could drift per file. The catalog keeps all\n * three fields adjacent, so adding a status is one row, and a status can never\n * disagree with its code.\n *\n * `expose` marks whether the raw message may reach a client. Every 4xx is\n * trusted; every 5xx is not — a 5xx message is for operators, and\n * `toErrorResponse()` substitutes a generic one.\n */\ninterface HttpErrorDefinition {\n status: number;\n code: string;\n defaultMessage: string;\n expose: boolean;\n}\n\nconst CATALOG = {\n BadRequest: {\n status: 400,\n code: 'BAD_REQUEST',\n defaultMessage: 'The request could not be understood or was missing required parameters.',\n expose: true,\n },\n Unauthorized: {\n status: 401,\n code: 'UNAUTHORIZED',\n defaultMessage: 'Authentication is required and has failed or has not yet been provided.',\n expose: true,\n },\n Forbidden: {\n status: 403,\n code: 'FORBIDDEN',\n defaultMessage: 'You do not have permission to perform this action.',\n expose: true,\n },\n NotFound: {\n status: 404,\n code: 'NOT_FOUND',\n defaultMessage: 'The requested resource was not found.',\n expose: true,\n },\n MethodNotAllowed: {\n status: 405,\n code: 'METHOD_NOT_ALLOWED',\n defaultMessage: 'The requested method is not allowed for this resource.',\n expose: true,\n },\n Conflict: {\n // Distinct from `BadRequest` so callers can tell \"invalid input\" from\n // \"that value is taken\" — the latter never succeeds without a change.\n status: 409,\n code: 'CONFLICT',\n defaultMessage: 'The request conflicts with the current state of the resource.',\n expose: true,\n },\n PreconditionFailed: {\n status: 412,\n code: 'PRECONDITION_FAILED',\n defaultMessage: 'A precondition for this request failed.',\n expose: true,\n },\n PayloadTooLarge: {\n status: 413,\n code: 'PAYLOAD_TOO_LARGE',\n defaultMessage: 'The request payload is larger than the server is willing to process.',\n expose: true,\n },\n UnsupportedMediaType: {\n status: 415,\n code: 'UNSUPPORTED_MEDIA_TYPE',\n defaultMessage: 'The request payload format is not supported by this resource.',\n expose: true,\n },\n RateLimited: {\n status: 429,\n code: 'RATE_LIMITED',\n defaultMessage: 'Too many requests — slow down and retry later.',\n expose: true,\n },\n InternalServerError: {\n status: 500,\n code: 'INTERNAL_SERVER_ERROR',\n defaultMessage: 'The server encountered an internal error and was unable to complete your request.',\n expose: false,\n },\n NotImplemented: {\n status: 501,\n code: 'NOT_IMPLEMENTED',\n defaultMessage: 'The server does not support the functionality required to fulfil this request.',\n expose: false,\n },\n // Upstream dependency failures: 502 is the honest status here, and the\n // retryable marker (not the status) is what schedules a retry.\n BadGateway: {\n status: 502,\n code: 'BAD_GATEWAY',\n defaultMessage: 'The server received an invalid response from an upstream service.',\n expose: false,\n },\n ServiceUnavailable: {\n status: 503,\n code: 'SERVICE_UNAVAILABLE',\n defaultMessage: 'The server is currently unable to handle the request — retry after a delay.',\n expose: true,\n },\n} as const satisfies Record<string, HttpErrorDefinition>;\n\ntype HttpErrorType = keyof typeof CATALOG;\n\nexport { CATALOG };\nexport type { HttpErrorDefinition, HttpErrorType };\n"],
5
+ "mappings": "AAmBA,MAAMA,EAAU,CACd,WAAY,CACV,OAAQ,IACR,KAAM,cACN,eAAgB,0EAChB,OAAQ,IAEV,aAAc,CACZ,OAAQ,IACR,KAAM,eACN,eAAgB,0EAChB,OAAQ,IAEV,UAAW,CACT,OAAQ,IACR,KAAM,YACN,eAAgB,qDAChB,OAAQ,IAEV,SAAU,CACR,OAAQ,IACR,KAAM,YACN,eAAgB,wCAChB,OAAQ,IAEV,iBAAkB,CAChB,OAAQ,IACR,KAAM,qBACN,eAAgB,yDAChB,OAAQ,IAEV,SAAU,CAGR,OAAQ,IACR,KAAM,WACN,eAAgB,gEAChB,OAAQ,IAEV,mBAAoB,CAClB,OAAQ,IACR,KAAM,sBACN,eAAgB,0CAChB,OAAQ,IAEV,gBAAiB,CACf,OAAQ,IACR,KAAM,oBACN,eAAgB,uEAChB,OAAQ,IAEV,qBAAsB,CACpB,OAAQ,IACR,KAAM,yBACN,eAAgB,gEAChB,OAAQ,IAEV,YAAa,CACX,OAAQ,IACR,KAAM,eACN,eAAgB,sDAChB,OAAQ,IAEV,oBAAqB,CACnB,OAAQ,IACR,KAAM,wBACN,eAAgB,oFAChB,OAAQ,IAEV,eAAgB,CACd,OAAQ,IACR,KAAM,kBACN,eAAgB,iFAChB,OAAQ,IAIV,WAAY,CACV,OAAQ,IACR,KAAM,cACN,eAAgB,oEAChB,OAAQ,IAEV,mBAAoB,CAClB,OAAQ,IACR,KAAM,sBACN,eAAgB,mFAChB,OAAQ",
6
+ "names": ["CATALOG"]
7
+ }
@@ -1,4 +1,4 @@
1
- import { HttpServiceError } from './HttpServiceError';
1
+ import { HttpServiceError } from './HttpServiceError.ts';
2
2
  /**
3
3
  * 409 — well-formed but the resource state forbids it: a taken email, a
4
4
  * duplicate name, a stale precondition. Not retryable without a change.
@@ -1 +1 @@
1
- {"version":3,"file":"ConflictError.d.ts","sourceRoot":"","sources":["../src/ConflictError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,cAAM,aAAc,SAAQ,gBAAgB,CAAC,UAAU,CAAC;gBAC1C,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"ConflictError.d.ts","sourceRoot":"","sources":["../src/ConflictError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;;GAGG;AACH,cAAM,aAAc,SAAQ,gBAAgB,CAAC,UAAU,CAAC;gBAC1C,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,12 +1 @@
1
- import { HttpServiceError } from './HttpServiceError';
2
- /**
3
- * 409 — well-formed but the resource state forbids it: a taken email, a
4
- * duplicate name, a stale precondition. Not retryable without a change.
5
- */
6
- class ConflictError extends HttpServiceError {
7
- constructor(message) {
8
- super('Conflict', message);
9
- }
10
- }
11
- export { ConflictError };
12
- //# sourceMappingURL=ConflictError.js.map
1
+ import{HttpServiceError as o}from"./HttpServiceError.js";class t extends o{constructor(r){super("Conflict",r)}}export{t as ConflictError};
@@ -1 +1,7 @@
1
- {"version":3,"file":"ConflictError.js","sourceRoot":"","sources":["../src/ConflictError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,aAAc,SAAQ,gBAA4B;IACtD,YAAY,OAAgB;QAC1B,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC;CACF;AAED,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 409 — well-formed but the resource state forbids it: a taken email, a\n * duplicate name, a stale precondition. Not retryable without a change.\n */\nclass ConflictError extends HttpServiceError<'Conflict'> {\n constructor(message?: string) {\n super('Conflict', message);\n }\n}\n\nexport { ConflictError };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/ConflictError.ts"],
4
+ "sourcesContent": ["import { HttpServiceError } from './HttpServiceError.ts';\n\n/**\n * 409 — well-formed but the resource state forbids it: a taken email, a\n * duplicate name, a stale precondition. Not retryable without a change.\n */\nclass ConflictError extends HttpServiceError<'Conflict'> {\n constructor(message?: string) {\n super('Conflict', message);\n }\n}\n\nexport { ConflictError };\n"],
5
+ "mappings": "AAAA,OAAS,oBAAAA,MAAwB,wBAMjC,MAAMC,UAAsBD,CAA4B,CACtD,YAAYE,EAAgB,CAC1B,MAAM,WAAYA,CAAO,CAC3B",
6
+ "names": ["HttpServiceError", "ConflictError", "message"]
7
+ }
@@ -1,4 +1,4 @@
1
- import { InternalServerError } from './InternalServerError';
1
+ import { InternalServerError } from './InternalServerError.ts';
2
2
  /**
3
3
  * 500 for data-layer failures.
4
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"DatabaseError.d.ts","sourceRoot":"","sources":["../src/DatabaseError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;;;GAOG;AACH,cAAM,aAAc,SAAQ,mBAAmB;gBACjC,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,GAAE,OAAe,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAKxF;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"DatabaseError.d.ts","sourceRoot":"","sources":["../src/DatabaseError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D;;;;;;;GAOG;AACH,cAAM,aAAc,SAAQ,mBAAmB;gBACjC,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,GAAE,OAAe,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAKxF;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,18 +1 @@
1
- import { InternalServerError } from './InternalServerError';
2
- /**
3
- * 500 for data-layer failures.
4
- *
5
- * Carries `retryable` because the difference between a transient D1 lock and a
6
- * constraint violation is invisible in the message — the caller's retry
7
- * decision (the DAO's) is encoded here as a flag instead of re-parsed at every
8
- * boundary.
9
- */
10
- class DatabaseError extends InternalServerError {
11
- constructor(message, retryable = false, options) {
12
- super(message ?? 'The system encountered an unexpected problem while accessing the database.', options);
13
- this.retryable = retryable;
14
- this.type = 'DatabaseError';
15
- }
16
- }
17
- export { DatabaseError };
18
- //# sourceMappingURL=DatabaseError.js.map
1
+ import{InternalServerError as a}from"./InternalServerError.js";class s extends a{constructor(e,r=!1,t){super(e??"The system encountered an unexpected problem while accessing the database.",t),this.retryable=r,this.type="DatabaseError"}}export{s as DatabaseError};
@@ -1 +1,7 @@
1
- {"version":3,"file":"DatabaseError.js","sourceRoot":"","sources":["../src/DatabaseError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;;;GAOG;AACH,MAAM,aAAc,SAAQ,mBAAmB;IAC7C,YAAY,OAAgB,EAAE,YAAqB,KAAK,EAAE,OAA6B;QACrF,KAAK,CAAC,OAAO,IAAI,4EAA4E,EAAE,OAAO,CAAC,CAAC;QACxG,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAED,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { InternalServerError } from './InternalServerError';\n\n/**\n * 500 for data-layer failures.\n *\n * Carries `retryable` because the difference between a transient D1 lock and a\n * constraint violation is invisible in the message — the caller's retry\n * decision (the DAO's) is encoded here as a flag instead of re-parsed at every\n * boundary.\n */\nclass DatabaseError extends InternalServerError {\n constructor(message?: string, retryable: boolean = false, options?: { cause?: unknown }) {\n super(message ?? 'The system encountered an unexpected problem while accessing the database.', options);\n this.retryable = retryable;\n this.type = 'DatabaseError';\n }\n}\n\nexport { DatabaseError };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/DatabaseError.ts"],
4
+ "sourcesContent": ["import { InternalServerError } from './InternalServerError.ts';\n\n/**\n * 500 for data-layer failures.\n *\n * Carries `retryable` because the difference between a transient D1 lock and a\n * constraint violation is invisible in the message — the caller's retry\n * decision (the DAO's) is encoded here as a flag instead of re-parsed at every\n * boundary.\n */\nclass DatabaseError extends InternalServerError {\n constructor(message?: string, retryable: boolean = false, options?: { cause?: unknown }) {\n super(message ?? 'The system encountered an unexpected problem while accessing the database.', options);\n this.retryable = retryable;\n this.type = 'DatabaseError';\n }\n}\n\nexport { DatabaseError };\n"],
5
+ "mappings": "AAAA,OAAS,uBAAAA,MAA2B,2BAUpC,MAAMC,UAAsBD,CAAmB,CAC7C,YAAYE,EAAkBC,EAAqB,GAAOC,EAA6B,CACrF,MAAMF,GAAW,6EAA8EE,CAAO,EACtG,KAAK,UAAYD,EACjB,KAAK,KAAO,eACd",
6
+ "names": ["InternalServerError", "DatabaseError", "message", "retryable", "options"]
7
+ }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ErrorResponse.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"ErrorResponse.js","sourceRoot":"","sources":["../src/ErrorResponse.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * The AWS-style error envelope: `{ \"Exception\": { \"Type\": \"...\", \"Message\": \"...\" } }`.\n *\n * Optional members tolerate foreign or truncated payloads during\n * deserialization; serializers always emit both fields. The envelope is the\n * family's established wire format — the kit's `toErrorResponse()` owns it so\n * per-app route layers stop hand-rolling it.\n */\ninterface ErrorResponse {\n Exception?: {\n Type?: string;\n Message?: string;\n };\n}\n\nexport type { ErrorResponse };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,4 +1,4 @@
1
- import { HttpServiceError } from './HttpServiceError';
1
+ import { HttpServiceError } from './HttpServiceError.ts';
2
2
  /**
3
3
  * 403 — the caller is authenticated but the action is not theirs to take.
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ForbiddenError.d.ts","sourceRoot":"","sources":["../src/ForbiddenError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,cAAM,cAAe,SAAQ,gBAAgB,CAAC,WAAW,CAAC;gBAC5C,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"ForbiddenError.d.ts","sourceRoot":"","sources":["../src/ForbiddenError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;GAEG;AACH,cAAM,cAAe,SAAQ,gBAAgB,CAAC,WAAW,CAAC;gBAC5C,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1,11 +1 @@
1
- import { HttpServiceError } from './HttpServiceError';
2
- /**
3
- * 403 — the caller is authenticated but the action is not theirs to take.
4
- */
5
- class ForbiddenError extends HttpServiceError {
6
- constructor(message) {
7
- super('Forbidden', message);
8
- }
9
- }
10
- export { ForbiddenError };
11
- //# sourceMappingURL=ForbiddenError.js.map
1
+ import{HttpServiceError as o}from"./HttpServiceError.js";class e extends o{constructor(r){super("Forbidden",r)}}export{e as ForbiddenError};
@@ -1 +1,7 @@
1
- {"version":3,"file":"ForbiddenError.js","sourceRoot":"","sources":["../src/ForbiddenError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,cAAe,SAAQ,gBAA6B;IACxD,YAAY,OAAgB;QAC1B,KAAK,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC;CACF;AAED,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 403 — the caller is authenticated but the action is not theirs to take.\n */\nclass ForbiddenError extends HttpServiceError<'Forbidden'> {\n constructor(message?: string) {\n super('Forbidden', message);\n }\n}\n\nexport { ForbiddenError };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/ForbiddenError.ts"],
4
+ "sourcesContent": ["import { HttpServiceError } from './HttpServiceError.ts';\n\n/**\n * 403 — the caller is authenticated but the action is not theirs to take.\n */\nclass ForbiddenError extends HttpServiceError<'Forbidden'> {\n constructor(message?: string) {\n super('Forbidden', message);\n }\n}\n\nexport { ForbiddenError };\n"],
5
+ "mappings": "AAAA,OAAS,oBAAAA,MAAwB,wBAKjC,MAAMC,UAAuBD,CAA6B,CACxD,YAAYE,EAAgB,CAC1B,MAAM,YAAaA,CAAO,CAC5B",
6
+ "names": ["HttpServiceError", "ForbiddenError", "message"]
7
+ }
@@ -1,6 +1,6 @@
1
- import type { HttpErrorType } from './CATALOG';
2
- import { ServiceError } from './ServiceError';
3
- import type { ServiceErrorOptions } from './ServiceError';
1
+ import type { HttpErrorType } from './CATALOG.ts';
2
+ import { ServiceError } from './ServiceError.ts';
3
+ import type { ServiceErrorOptions } from './ServiceError.ts';
4
4
  /**
5
5
  * A `ServiceError` with a fixed HTTP status and type from the catalog.
6
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"HttpServiceError.d.ts","sourceRoot":"","sources":["../src/HttpServiceError.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D;;;;;GAKG;AACH,uBAAe,gBAAgB,CAAC,KAAK,SAAS,aAAa,CAAE,SAAQ,YAAY;gBACnE,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB;CAI9E;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"HttpServiceError.d.ts","sourceRoot":"","sources":["../src/HttpServiceError.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;;;;GAKG;AACH,uBAAe,gBAAgB,CAAC,KAAK,SAAS,aAAa,CAAE,SAAQ,YAAY;gBACnE,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,mBAAmB;CAI9E;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,16 +1 @@
1
- import { CATALOG } from './CATALOG';
2
- import { ServiceError } from './ServiceError';
3
- /**
4
- * A `ServiceError` with a fixed HTTP status and type from the catalog.
5
- *
6
- * Concrete subclasses add nothing but a name, so they are one-liners:
7
- * `class NotFoundError extends HttpServiceError<'NotFound'> {}`.
8
- */
9
- class HttpServiceError extends ServiceError {
10
- constructor(errorType, message, options) {
11
- const definition = CATALOG[errorType];
12
- super(definition.status, errorType, message ?? definition.defaultMessage, options);
13
- }
14
- }
15
- export { HttpServiceError };
16
- //# sourceMappingURL=HttpServiceError.js.map
1
+ import{CATALOG as s}from"./CATALOG.js";import{ServiceError as i}from"./ServiceError.js";class c extends i{constructor(r,e,o){const t=s[r];super(t.status,r,e??t.defaultMessage,o)}}export{c as HttpServiceError};
@@ -1 +1,7 @@
1
- {"version":3,"file":"HttpServiceError.js","sourceRoot":"","sources":["../src/HttpServiceError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C;;;;;GAKG;AACH,MAAe,gBAA8C,SAAQ,YAAY;IAC/E,YAAY,SAAgB,EAAE,OAAgB,EAAE,OAA6B;QAC3E,MAAM,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QACtC,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,IAAI,UAAU,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACrF,CAAC;CACF;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["import { CATALOG } from './CATALOG';\nimport type { HttpErrorType } from './CATALOG';\nimport { ServiceError } from './ServiceError';\nimport type { ServiceErrorOptions } from './ServiceError';\n\n/**\n * A `ServiceError` with a fixed HTTP status and type from the catalog.\n *\n * Concrete subclasses add nothing but a name, so they are one-liners:\n * `class NotFoundError extends HttpServiceError<'NotFound'> {}`.\n */\nabstract class HttpServiceError<TType extends HttpErrorType> extends ServiceError {\n constructor(errorType: TType, message?: string, options?: ServiceErrorOptions) {\n const definition = CATALOG[errorType];\n super(definition.status, errorType, message ?? definition.defaultMessage, options);\n }\n}\n\nexport { HttpServiceError };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/HttpServiceError.ts"],
4
+ "sourcesContent": ["import { CATALOG } from './CATALOG.ts';\nimport type { HttpErrorType } from './CATALOG.ts';\nimport { ServiceError } from './ServiceError.ts';\nimport type { ServiceErrorOptions } from './ServiceError.ts';\n\n/**\n * A `ServiceError` with a fixed HTTP status and type from the catalog.\n *\n * Concrete subclasses add nothing but a name, so they are one-liners:\n * `class NotFoundError extends HttpServiceError<'NotFound'> {}`.\n */\nabstract class HttpServiceError<TType extends HttpErrorType> extends ServiceError {\n constructor(errorType: TType, message?: string, options?: ServiceErrorOptions) {\n const definition = CATALOG[errorType];\n super(definition.status, errorType, message ?? definition.defaultMessage, options);\n }\n}\n\nexport { HttpServiceError };\n"],
5
+ "mappings": "AAAA,OAAS,WAAAA,MAAe,eAExB,OAAS,gBAAAC,MAAoB,oBAS7B,MAAeC,UAAsDD,CAAY,CAC/E,YAAYE,EAAkBC,EAAkBC,EAA6B,CAC3E,MAAMC,EAAaN,EAAQG,CAAS,EACpC,MAAMG,EAAW,OAAQH,EAAWC,GAAWE,EAAW,eAAgBD,CAAO,CACnF",
6
+ "names": ["CATALOG", "ServiceError", "HttpServiceError", "errorType", "message", "options", "definition"]
7
+ }
@@ -1,4 +1,4 @@
1
- import { HttpServiceError } from './HttpServiceError';
1
+ import { HttpServiceError } from './HttpServiceError.ts';
2
2
  /**
3
3
  * 500 — the catch-all server fault.
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"InternalServerError.d.ts","sourceRoot":"","sources":["../src/InternalServerError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,cAAM,mBAAoB,SAAQ,gBAAgB,CAAC,qBAAqB,CAAC;gBAC3D,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAG5D;AAED;;;GAGG;AACH,QAAA,MAAM,0BAA0B,qBAA4B,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,CAAC"}
1
+ {"version":3,"file":"InternalServerError.d.ts","sourceRoot":"","sources":["../src/InternalServerError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;GAEG;AACH,cAAM,mBAAoB,SAAQ,gBAAgB,CAAC,qBAAqB,CAAC;gBAC3D,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CAG5D;AAED;;;GAGG;AACH,QAAA,MAAM,0BAA0B,qBAA4B,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,CAAC"}
@@ -1,16 +1 @@
1
- import { HttpServiceError } from './HttpServiceError';
2
- /**
3
- * 500 — the catch-all server fault.
4
- */
5
- class InternalServerError extends HttpServiceError {
6
- constructor(message, options) {
7
- super('InternalServerError', message, options);
8
- }
9
- }
10
- /**
11
- * The instance returned to callers when the real cause must not be disclosed:
12
- * same stable type, generic message, regardless of what failed.
13
- */
14
- const DefaultInternalServerError = new InternalServerError();
15
- export { InternalServerError, DefaultInternalServerError };
16
- //# sourceMappingURL=InternalServerError.js.map
1
+ import{HttpServiceError as n}from"./HttpServiceError.js";class r extends n{constructor(e,t){super("InternalServerError",e,t)}}const o=new r;export{o as DefaultInternalServerError,r as InternalServerError};
@@ -1 +1,7 @@
1
- {"version":3,"file":"InternalServerError.js","sourceRoot":"","sources":["../src/InternalServerError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,mBAAoB,SAAQ,gBAAuC;IACvE,YAAY,OAAgB,EAAE,OAA6B;QACzD,KAAK,CAAC,qBAAqB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,0BAA0B,GAAG,IAAI,mBAAmB,EAAE,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 500 — the catch-all server fault.\n */\nclass InternalServerError extends HttpServiceError<'InternalServerError'> {\n constructor(message?: string, options?: { cause?: unknown }) {\n super('InternalServerError', message, options);\n }\n}\n\n/**\n * The instance returned to callers when the real cause must not be disclosed:\n * same stable type, generic message, regardless of what failed.\n */\nconst DefaultInternalServerError = new InternalServerError();\n\nexport { InternalServerError, DefaultInternalServerError };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/InternalServerError.ts"],
4
+ "sourcesContent": ["import { HttpServiceError } from './HttpServiceError.ts';\n\n/**\n * 500 — the catch-all server fault.\n */\nclass InternalServerError extends HttpServiceError<'InternalServerError'> {\n constructor(message?: string, options?: { cause?: unknown }) {\n super('InternalServerError', message, options);\n }\n}\n\n/**\n * The instance returned to callers when the real cause must not be disclosed:\n * same stable type, generic message, regardless of what failed.\n */\nconst DefaultInternalServerError = new InternalServerError();\n\nexport { InternalServerError, DefaultInternalServerError };\n"],
5
+ "mappings": "AAAA,OAAS,oBAAAA,MAAwB,wBAKjC,MAAMC,UAA4BD,CAAuC,CACvE,YAAYE,EAAkBC,EAA6B,CACzD,MAAM,sBAAuBD,EAASC,CAAO,CAC/C,EAOF,MAAMC,EAA6B,IAAIH",
6
+ "names": ["HttpServiceError", "InternalServerError", "message", "options", "DefaultInternalServerError"]
7
+ }
@@ -1,4 +1,4 @@
1
- import { HttpServiceError } from './HttpServiceError';
1
+ import { HttpServiceError } from './HttpServiceError.ts';
2
2
  /**
3
3
  * 405 — the method exists but not on this path.
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"MethodNotAllowedError.d.ts","sourceRoot":"","sources":["../src/MethodNotAllowedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,cAAM,qBAAsB,SAAQ,gBAAgB,CAAC,kBAAkB,CAAC;gBAC1D,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"MethodNotAllowedError.d.ts","sourceRoot":"","sources":["../src/MethodNotAllowedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;GAEG;AACH,cAAM,qBAAsB,SAAQ,gBAAgB,CAAC,kBAAkB,CAAC;gBAC1D,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1,11 +1 @@
1
- import { HttpServiceError } from './HttpServiceError';
2
- /**
3
- * 405 — the method exists but not on this path.
4
- */
5
- class MethodNotAllowedError extends HttpServiceError {
6
- constructor(message) {
7
- super('MethodNotAllowed', message);
8
- }
9
- }
10
- export { MethodNotAllowedError };
11
- //# sourceMappingURL=MethodNotAllowedError.js.map
1
+ import{HttpServiceError as r}from"./HttpServiceError.js";class t extends r{constructor(o){super("MethodNotAllowed",o)}}export{t as MethodNotAllowedError};
@@ -1 +1,7 @@
1
- {"version":3,"file":"MethodNotAllowedError.js","sourceRoot":"","sources":["../src/MethodNotAllowedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,qBAAsB,SAAQ,gBAAoC;IACtE,YAAY,OAAgB;QAC1B,KAAK,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IACrC,CAAC;CACF;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 405 — the method exists but not on this path.\n */\nclass MethodNotAllowedError extends HttpServiceError<'MethodNotAllowed'> {\n constructor(message?: string) {\n super('MethodNotAllowed', message);\n }\n}\n\nexport { MethodNotAllowedError };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/MethodNotAllowedError.ts"],
4
+ "sourcesContent": ["import { HttpServiceError } from './HttpServiceError.ts';\n\n/**\n * 405 — the method exists but not on this path.\n */\nclass MethodNotAllowedError extends HttpServiceError<'MethodNotAllowed'> {\n constructor(message?: string) {\n super('MethodNotAllowed', message);\n }\n}\n\nexport { MethodNotAllowedError };\n"],
5
+ "mappings": "AAAA,OAAS,oBAAAA,MAAwB,wBAKjC,MAAMC,UAA8BD,CAAoC,CACtE,YAAYE,EAAgB,CAC1B,MAAM,mBAAoBA,CAAO,CACnC",
6
+ "names": ["HttpServiceError", "MethodNotAllowedError", "message"]
7
+ }
@@ -1,4 +1,4 @@
1
- import { HttpServiceError } from './HttpServiceError';
1
+ import { HttpServiceError } from './HttpServiceError.ts';
2
2
  /**
3
3
  * 404 — no such resource.
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"NotFoundError.d.ts","sourceRoot":"","sources":["../src/NotFoundError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,cAAM,aAAc,SAAQ,gBAAgB,CAAC,UAAU,CAAC;gBAC1C,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"NotFoundError.d.ts","sourceRoot":"","sources":["../src/NotFoundError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;GAEG;AACH,cAAM,aAAc,SAAQ,gBAAgB,CAAC,UAAU,CAAC;gBAC1C,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,11 +1 @@
1
- import { HttpServiceError } from './HttpServiceError';
2
- /**
3
- * 404 — no such resource.
4
- */
5
- class NotFoundError extends HttpServiceError {
6
- constructor(message) {
7
- super('NotFound', message);
8
- }
9
- }
10
- export { NotFoundError };
11
- //# sourceMappingURL=NotFoundError.js.map
1
+ import{HttpServiceError as o}from"./HttpServiceError.js";class t extends o{constructor(r){super("NotFound",r)}}export{t as NotFoundError};
@@ -1 +1,7 @@
1
- {"version":3,"file":"NotFoundError.js","sourceRoot":"","sources":["../src/NotFoundError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,aAAc,SAAQ,gBAA4B;IACtD,YAAY,OAAgB;QAC1B,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC7B,CAAC;CACF;AAED,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 404 — no such resource.\n */\nclass NotFoundError extends HttpServiceError<'NotFound'> {\n constructor(message?: string) {\n super('NotFound', message);\n }\n}\n\nexport { NotFoundError };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/NotFoundError.ts"],
4
+ "sourcesContent": ["import { HttpServiceError } from './HttpServiceError.ts';\n\n/**\n * 404 — no such resource.\n */\nclass NotFoundError extends HttpServiceError<'NotFound'> {\n constructor(message?: string) {\n super('NotFound', message);\n }\n}\n\nexport { NotFoundError };\n"],
5
+ "mappings": "AAAA,OAAS,oBAAAA,MAAwB,wBAKjC,MAAMC,UAAsBD,CAA4B,CACtD,YAAYE,EAAgB,CAC1B,MAAM,WAAYA,CAAO,CAC3B",
6
+ "names": ["HttpServiceError", "NotFoundError", "message"]
7
+ }
@@ -1,4 +1,4 @@
1
- import { HttpServiceError } from './HttpServiceError';
1
+ import { HttpServiceError } from './HttpServiceError.ts';
2
2
  /**
3
3
  * 501 — the functionality exists in the protocol but not on this deployment.
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"NotImplementedError.d.ts","sourceRoot":"","sources":["../src/NotImplementedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,cAAM,mBAAoB,SAAQ,gBAAgB,CAAC,gBAAgB,CAAC;gBACtD,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"NotImplementedError.d.ts","sourceRoot":"","sources":["../src/NotImplementedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD;;GAEG;AACH,cAAM,mBAAoB,SAAQ,gBAAgB,CAAC,gBAAgB,CAAC;gBACtD,OAAO,CAAC,EAAE,MAAM;CAG7B;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1,11 +1 @@
1
- import { HttpServiceError } from './HttpServiceError';
2
- /**
3
- * 501 — the functionality exists in the protocol but not on this deployment.
4
- */
5
- class NotImplementedError extends HttpServiceError {
6
- constructor(message) {
7
- super('NotImplemented', message);
8
- }
9
- }
10
- export { NotImplementedError };
11
- //# sourceMappingURL=NotImplementedError.js.map
1
+ import{HttpServiceError as e}from"./HttpServiceError.js";class t extends e{constructor(r){super("NotImplemented",r)}}export{t as NotImplementedError};
@@ -1 +1,7 @@
1
- {"version":3,"file":"NotImplementedError.js","sourceRoot":"","sources":["../src/NotImplementedError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;GAEG;AACH,MAAM,mBAAoB,SAAQ,gBAAkC;IAClE,YAAY,OAAgB;QAC1B,KAAK,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;CACF;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC","sourcesContent":["import { HttpServiceError } from './HttpServiceError';\n\n/**\n * 501 — the functionality exists in the protocol but not on this deployment.\n */\nclass NotImplementedError extends HttpServiceError<'NotImplemented'> {\n constructor(message?: string) {\n super('NotImplemented', message);\n }\n}\n\nexport { NotImplementedError };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/NotImplementedError.ts"],
4
+ "sourcesContent": ["import { HttpServiceError } from './HttpServiceError.ts';\n\n/**\n * 501 — the functionality exists in the protocol but not on this deployment.\n */\nclass NotImplementedError extends HttpServiceError<'NotImplemented'> {\n constructor(message?: string) {\n super('NotImplemented', message);\n }\n}\n\nexport { NotImplementedError };\n"],
5
+ "mappings": "AAAA,OAAS,oBAAAA,MAAwB,wBAKjC,MAAMC,UAA4BD,CAAkC,CAClE,YAAYE,EAAgB,CAC1B,MAAM,iBAAkBA,CAAO,CACjC",
6
+ "names": ["HttpServiceError", "NotImplementedError", "message"]
7
+ }
@@ -1,5 +1,5 @@
1
- import { ServiceError } from './ServiceError';
2
- import type { ServiceErrorOptions } from './ServiceError';
1
+ import { ServiceError } from './ServiceError.ts';
2
+ import type { ServiceErrorOptions } from './ServiceError.ts';
3
3
  /**
4
4
  * An error whose retryability is decided by the thrower, not deduced.
5
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"OutcomeError.d.ts","sourceRoot":"","sources":["../src/OutcomeError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D;;;;;;;;GAQG;AACH,cAAM,YAAa,SAAQ,YAAY;gBACzB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE;CAGnF;AAED;;;GAGG;AACH,cAAM,cAAe,SAAQ,YAAY;gBAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAM7C;AAED;;;;GAIG;AACH,cAAM,iBAAkB,SAAQ,YAAY;gBAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAM7C;AAED,cAAM,yBAA0B,SAAQ,cAAc;CAAG;AACzD,cAAM,4BAA6B,SAAQ,iBAAiB;CAAG;AAC/D,cAAM,yBAA0B,SAAQ,cAAc;CAAG;AACzD,cAAM,4BAA6B,SAAQ,iBAAiB;CAAG;AAE/D,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,yBAAyB,EACzB,YAAY,EACZ,4BAA4B,EAC5B,yBAAyB,EACzB,cAAc,GACf,CAAC"}
1
+ {"version":3,"file":"OutcomeError.d.ts","sourceRoot":"","sources":["../src/OutcomeError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;;;;;;;GAQG;AACH,cAAM,YAAa,SAAQ,YAAY;gBACzB,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE;CAGnF;AAED;;;GAGG;AACH,cAAM,cAAe,SAAQ,YAAY;gBAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAM7C;AAED;;;;GAIG;AACH,cAAM,iBAAkB,SAAQ,YAAY;gBAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAM7C;AAED,cAAM,yBAA0B,SAAQ,cAAc;CAAG;AACzD,cAAM,4BAA6B,SAAQ,iBAAiB;CAAG;AAC/D,cAAM,yBAA0B,SAAQ,cAAc;CAAG;AACzD,cAAM,4BAA6B,SAAQ,iBAAiB;CAAG;AAE/D,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,yBAAyB,EACzB,YAAY,EACZ,4BAA4B,EAC5B,yBAAyB,EACzB,cAAc,GACf,CAAC"}