@origins-digital/zod-openapi-utils 2.2.5 → 2.3.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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=zod.exception.contract.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zod.exception.contract.spec.d.ts","sourceRoot":"","sources":["../../src/openapi/zod.exception.contract.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const common_1 = require("@nestjs/common");
4
+ const error_utils_1 = require("@origins-digital/error-utils");
5
+ const zod_1 = require("zod");
6
+ const zod_exception_1 = require("./zod.exception");
7
+ // The defect this covers lived in the gap between the two packages: each side
8
+ // was self-consistent while they disagreed about where the issues were stored.
9
+ // Per-package specs cannot catch that, so this one pushes a real ZodException
10
+ // through the real ErrorFilter and asserts the JSON a caller receives.
11
+ // The dependency only goes this way: error-utils must not know about schemas.
12
+ const schema = zod_1.z.object({
13
+ liveSource: zod_1.z.string(),
14
+ audioDescriptions: zod_1.z.array(zod_1.z.object({ language: zod_1.z.string() })),
15
+ });
16
+ const render = (payload) => {
17
+ const result = schema.safeParse(payload);
18
+ if (result.success) {
19
+ throw new Error('Test fixture must produce a validation failure');
20
+ }
21
+ const res = {
22
+ locals: {},
23
+ body: undefined,
24
+ statusCode: undefined,
25
+ status(code) {
26
+ res.statusCode = code;
27
+ return res;
28
+ },
29
+ json(body) {
30
+ res.body = body;
31
+ },
32
+ };
33
+ const host = {
34
+ switchToHttp: () => ({ getResponse: () => res }),
35
+ };
36
+ new error_utils_1.ErrorFilter().catch(new zod_exception_1.ZodException(result.error), host);
37
+ return res;
38
+ };
39
+ describe('ZodException rendered by ErrorFilter', () => {
40
+ const appEnv = process.env.APP_ENV;
41
+ beforeEach(() => {
42
+ delete process.env.APP_ENV;
43
+ });
44
+ afterAll(() => {
45
+ if (appEnv === undefined) {
46
+ delete process.env.APP_ENV;
47
+ }
48
+ else {
49
+ process.env.APP_ENV = appEnv;
50
+ }
51
+ });
52
+ it('should answer 400 with the failing field named', () => {
53
+ const res = render({ audioDescriptions: [] });
54
+ expect(res.statusCode).toBe(common_1.HttpStatus.BAD_REQUEST);
55
+ expect(res.body).toEqual({
56
+ statusCode: common_1.HttpStatus.BAD_REQUEST,
57
+ type: 'ZodValidationException',
58
+ message: 'Validation failed',
59
+ errors: [
60
+ expect.objectContaining({
61
+ code: 'invalid_type',
62
+ path: ['liveSource'],
63
+ }),
64
+ ],
65
+ });
66
+ });
67
+ it('should survive the serialization the client actually receives', () => {
68
+ const res = render({ audioDescriptions: [{ language: 42 }] });
69
+ const body = JSON.parse(JSON.stringify(res.body));
70
+ expect(body.statusCode).toBe(common_1.HttpStatus.BAD_REQUEST);
71
+ expect(body.errors.map((issue) => issue.path)).toEqual(expect.arrayContaining([
72
+ ['liveSource'],
73
+ ['audioDescriptions', 0, 'language'],
74
+ ]));
75
+ });
76
+ it('should hand the exception to the logger with its stack', () => {
77
+ // LoggerMiddleware reads res.locals.error.stack.
78
+ const res = render({});
79
+ expect(res.locals.error.stack).toEqual(expect.any(String));
80
+ });
81
+ it('should hide the stack outside a local environment', () => {
82
+ expect(render({})).not.toHaveProperty('body.stack');
83
+ });
84
+ it('should expose the stack when APP_ENV is local', () => {
85
+ process.env.APP_ENV = 'local';
86
+ expect(render({}).body.stack).toEqual(expect.any(String));
87
+ });
88
+ });
89
+ //# sourceMappingURL=zod.exception.contract.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zod.exception.contract.spec.js","sourceRoot":"","sources":["../../src/openapi/zod.exception.contract.spec.ts"],"names":[],"mappings":";;AAAA,2CAA2D;AAC3D,8DAA2D;AAC3D,6BAAwB;AACxB,mDAA+C;AAE/C,8EAA8E;AAC9E,+EAA+E;AAC/E,8EAA8E;AAC9E,uEAAuE;AACvE,8EAA8E;AAC9E,MAAM,MAAM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AAI,CAAC,CAAC,CAAC,OAAO,CACzE,MAAM,CAAC,eAAe,CAAC;YACrB,CAAC,YAAY,CAAC;YACd,CAAC,mBAAmB,EAAE,CAAC,EAAE,UAAU,CAAC;SACrC,CAAC,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wDAAwD,EAAE,GAAG,EAAE;QAChE,iDAAiD;QACjD,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;QAEvB,MAAM,CAAE,GAAG,CAAC,MAAM,CAAC,KAAe,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,OAAO,CAAC;QAE9B,MAAM,CAAE,MAAM,CAAC,EAAE,CAAC,CAAC,IAA0B,CAAC,KAAK,CAAC,CAAC,OAAO,CAC1D,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CACnB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,5 +1,6 @@
1
+ import { HttpException } from '@nestjs/common';
1
2
  import { z } from 'zod';
2
- export declare class ZodException extends Error {
3
+ export declare class ZodException extends HttpException {
3
4
  readonly errors: z.ZodError;
4
5
  constructor(errors: z.ZodError, message?: string);
5
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"zod.exception.d.ts","sourceRoot":"","sources":["../../src/openapi/zod.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,qBAAa,YAAa,SAAQ,KAAK;aAEnB,MAAM,EAAE,CAAC,CAAC,QAAQ;gBAAlB,MAAM,EAAE,CAAC,CAAC,QAAQ,EAClC,OAAO,CAAC,EAAE,MAAM;CAKnB"}
1
+ {"version":3,"file":"zod.exception.d.ts","sourceRoot":"","sources":["../../src/openapi/zod.exception.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAc,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,qBAAa,YAAa,SAAQ,aAAa;aAE3B,MAAM,EAAE,CAAC,CAAC,QAAQ;gBAAlB,MAAM,EAAE,CAAC,CAAC,QAAQ,EAClC,OAAO,CAAC,EAAE,MAAM;CAkBnB"}
@@ -1,11 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ZodException = void 0;
4
- class ZodException extends Error {
4
+ const common_1 = require("@nestjs/common");
5
+ const DEFAULT_MESSAGE = 'Validation failed';
6
+ // In zod 4, `ZodError.message` is `JSON.stringify(issues, null, 2)`. Most
7
+ // callers pass it through as `new ZodException(error, error.message)`, which
8
+ // would put the whole issue list into `message` as an escaped blob, duplicating
9
+ // `errors` and filling the field that log pipelines surface first.
10
+ const describe = (errors, message) => !message || message === errors.message ? DEFAULT_MESSAGE : message;
11
+ class ZodException extends common_1.HttpException {
5
12
  constructor(errors, message) {
6
- super(message || 'Validation failed');
13
+ // The body is what ErrorFilter renders: it reads `response.errors` for the
14
+ // detail and `response.message` for the message. `errors.issues` is passed
15
+ // rather than the ZodError itself, whose own serialization flattens the
16
+ // issues into a string.
17
+ super({
18
+ statusCode: common_1.HttpStatus.BAD_REQUEST,
19
+ message: describe(errors, message),
20
+ errors: errors.issues,
21
+ }, common_1.HttpStatus.BAD_REQUEST);
7
22
  this.errors = errors;
8
- this.name = 'ZodException';
23
+ // Pins the `type` field of the response to the name nestjs-zod already
24
+ // produces in the services that use it.
25
+ this.name = 'ZodValidationException';
9
26
  }
10
27
  }
11
28
  exports.ZodException = ZodException;
@@ -1 +1 @@
1
- {"version":3,"file":"zod.exception.js","sourceRoot":"","sources":["../../src/openapi/zod.exception.ts"],"names":[],"mappings":";;;AAEA,MAAa,YAAa,SAAQ,KAAK;IACrC,YACkB,MAAkB,EAClC,OAAgB;QAEhB,KAAK,CAAC,OAAO,IAAI,mBAAmB,CAAC,CAAC;QAHtB,WAAM,GAAN,MAAM,CAAY;QAIlC,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AARD,oCAQC"}
1
+ {"version":3,"file":"zod.exception.js","sourceRoot":"","sources":["../../src/openapi/zod.exception.ts"],"names":[],"mappings":";;;AAAA,2CAA2D;AAG3D,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAE5C,0EAA0E;AAC1E,6EAA6E;AAC7E,gFAAgF;AAChF,mEAAmE;AACnE,MAAM,QAAQ,GAAG,CAAC,MAAkB,EAAE,OAAgB,EAAU,EAAE,CAChE,CAAC,OAAO,IAAI,OAAO,KAAK,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC;AAErE,MAAa,YAAa,SAAQ,sBAAa;IAC7C,YACkB,MAAkB,EAClC,OAAgB;QAEhB,2EAA2E;QAC3E,2EAA2E;QAC3E,wEAAwE;QACxE,wBAAwB;QACxB,KAAK,CACH;YACE,UAAU,EAAE,mBAAU,CAAC,WAAW;YAClC,OAAO,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;YAClC,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,EACD,mBAAU,CAAC,WAAW,CACvB,CAAC;QAdc,WAAM,GAAN,MAAM,CAAY;QAelC,uEAAuE;QACvE,wCAAwC;QACxC,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF;AArBD,oCAqBC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=zod.exception.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zod.exception.spec.d.ts","sourceRoot":"","sources":["../../src/openapi/zod.exception.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const common_1 = require("@nestjs/common");
4
+ const zod_1 = require("zod");
5
+ const zod_exception_1 = require("./zod.exception");
6
+ const schema = zod_1.z.object({
7
+ liveSource: zod_1.z.string(),
8
+ audioDescriptions: zod_1.z.array(zod_1.z.object({ language: zod_1.z.string() })),
9
+ });
10
+ const zodErrorFrom = (payload) => {
11
+ const result = schema.safeParse(payload);
12
+ if (result.success) {
13
+ throw new Error('Test fixture must produce a validation failure');
14
+ }
15
+ return result.error;
16
+ };
17
+ describe('ZodException', () => {
18
+ it('should be an HttpException answering 400', () => {
19
+ const exception = new zod_exception_1.ZodException(zodErrorFrom({}));
20
+ expect(exception).toBeInstanceOf(common_1.HttpException);
21
+ expect(exception.getStatus()).toBe(common_1.HttpStatus.BAD_REQUEST);
22
+ });
23
+ it('should pin the wire type to ZodValidationException', () => {
24
+ // Aligns with the shape nestjs-zod already produces in other services.
25
+ expect(new zod_exception_1.ZodException(zodErrorFrom({})).name).toBe('ZodValidationException');
26
+ });
27
+ it('should carry the issues in the response body', () => {
28
+ const error = zodErrorFrom({ liveSource: 'rtmp://example' });
29
+ expect(new zod_exception_1.ZodException(error).getResponse()).toEqual({
30
+ statusCode: common_1.HttpStatus.BAD_REQUEST,
31
+ message: 'Validation failed',
32
+ errors: error.issues,
33
+ });
34
+ });
35
+ it('should survive JSON serialization with its issues intact', () => {
36
+ // Serializing the ZodError itself flattens the issues into a message
37
+ // string, which is what made the original defect invisible.
38
+ const body = JSON.parse(JSON.stringify(new zod_exception_1.ZodException(zodErrorFrom({})).getResponse()));
39
+ expect(body.errors).toEqual(expect.arrayContaining([
40
+ expect.objectContaining({ path: ['liveSource'] }),
41
+ ]));
42
+ });
43
+ it('should default the message and expose it on the exception', () => {
44
+ const exception = new zod_exception_1.ZodException(zodErrorFrom({}));
45
+ expect(exception.message).toBe('Validation failed');
46
+ });
47
+ it('should use the caller message when it says something', () => {
48
+ const error = zodErrorFrom({});
49
+ const exception = new zod_exception_1.ZodException(error, 'Video payload rejected');
50
+ expect(exception.message).toBe('Video payload rejected');
51
+ expect(exception.getResponse()).toEqual({
52
+ statusCode: common_1.HttpStatus.BAD_REQUEST,
53
+ message: 'Video payload rejected',
54
+ errors: error.issues,
55
+ });
56
+ });
57
+ it('should not echo the serialized issues into the message', () => {
58
+ // `new ZodException(e, e.message)` is the dominant call shape in the
59
+ // services, and in zod 4 `ZodError.message` is the JSON of the issues.
60
+ const error = zodErrorFrom({});
61
+ const exception = new zod_exception_1.ZodException(error, error.message);
62
+ expect(error.message).toBe(JSON.stringify(error.issues, null, 2));
63
+ expect(exception.message).toBe('Validation failed');
64
+ expect(exception.getResponse()).toEqual({
65
+ statusCode: common_1.HttpStatus.BAD_REQUEST,
66
+ message: 'Validation failed',
67
+ errors: error.issues,
68
+ });
69
+ });
70
+ it('should stay catchable by its class identity', () => {
71
+ // The sibling services only ever assert rejects.toThrow(ZodException);
72
+ // extending HttpException must not break that.
73
+ const error = zodErrorFrom({});
74
+ expect(() => {
75
+ throw new zod_exception_1.ZodException(error);
76
+ }).toThrow(zod_exception_1.ZodException);
77
+ });
78
+ it('should keep exposing errors as an own property', () => {
79
+ const error = zodErrorFrom({});
80
+ expect(new zod_exception_1.ZodException(error).errors).toBe(error);
81
+ });
82
+ it('should report every issue, including nested paths', () => {
83
+ const error = zodErrorFrom({ audioDescriptions: [{ language: 42 }] });
84
+ const { errors } = new zod_exception_1.ZodException(error).getResponse();
85
+ expect(errors.length).toBeGreaterThan(1);
86
+ expect(errors).toEqual(expect.arrayContaining([
87
+ expect.objectContaining({ path: ['liveSource'] }),
88
+ expect.objectContaining({ path: ['audioDescriptions', 0, 'language'] }),
89
+ ]));
90
+ });
91
+ });
92
+ //# sourceMappingURL=zod.exception.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zod.exception.spec.js","sourceRoot":"","sources":["../../src/openapi/zod.exception.spec.ts"],"names":[],"mappings":";;AAAA,2CAA2D;AAC3D,6BAAwB;AACxB,mDAA+C;AAE/C,MAAM,MAAM,GAAG,OAAC,CAAC,MAAM,CAAC;IACtB,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;IACtB,iBAAiB,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;CAC/D,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,CAAC,OAAgB,EAAc,EAAE;IACpD,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACzC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,MAAM,CAAC,KAAK,CAAC;AACtB,CAAC,CAAC;AAEF,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,SAAS,GAAG,IAAI,4BAAY,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC;QAErD,MAAM,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,sBAAa,CAAC,CAAC;QAChD,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAU,CAAC,WAAW,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE,GAAG,EAAE;QAC5D,uEAAuE;QACvE,MAAM,CAAC,IAAI,4BAAY,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAClD,wBAAwB,CACzB,CAAC;I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EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,KAAK,GAAG,YAAY,CAAC,EAAE,CAAC,CAAC;QAE/B,MAAM,CAAC,IAAI,4BAAY,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,KAAK,GAAG,YAAY,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;QACtE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,4BAAY,CAAC,KAAK,CAAC,CAAC,WAAW,EAErD,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QACzC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CACpB,MAAM,CAAC,eAAe,CAAC;YACrB,MAAM,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC;YACjD,MAAM,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,CAAC,mBAAmB,EAAE,CAAC,EAAE,UAAU,CAAC,EAAE,CAAC;SACxE,CAAC,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@origins-digital/zod-openapi-utils",
3
- "version": "2.2.5",
3
+ "version": "2.3.0",
4
4
  "description": "Origins Zod OpenAPI Utils",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.d.ts",
@@ -32,12 +32,14 @@
32
32
  "webpack": "^5.88.1"
33
33
  },
34
34
  "peerDependencies": {
35
+ "@nestjs/common": ">=11.0.0",
35
36
  "zod": ">=4.1.11"
36
37
  },
37
38
  "devDependencies": {
38
39
  "@commitlint/cli": "^17.6.6",
39
40
  "@commitlint/config-conventional": "^17.6.6",
40
41
  "@faker-js/faker": "^8.3.1",
42
+ "@origins-digital/error-utils": "^2.1.4",
41
43
  "@types/node": "^20.3.1",
42
44
  "commitizen": "^4.3.0",
43
45
  "conventional-recommended-bump": "^11.2.0",
@@ -66,6 +68,9 @@
66
68
  "transform": {
67
69
  "^.+\\.(t|j)s$": "ts-jest"
68
70
  },
71
+ "moduleNameMapper": {
72
+ "^@origins-digital/error-utils$": "<rootDir>/../../error/src"
73
+ },
69
74
  "collectCoverageFrom": [
70
75
  "**/*.(t|j)s"
71
76
  ],