@map-colonies/openapi-helpers 5.0.0 → 5.1.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.
package/README.md CHANGED
@@ -187,6 +187,87 @@ const response = await requestSender.sendRequest({
187
187
 
188
188
  The package supports all the operations defined in the OpenAPI schema, either by operation name, or by using the `sendRequest` function with the method, path and parameters.
189
189
 
190
+ ### Response Status Assertion
191
+
192
+ The `expectResponseStatusFactory` provides TypeScript type narrowing for response status assertions in tests. This utility creates an assertion function that narrows the response type based on the expected status code, giving you full type safety when working with different response types.
193
+
194
+ #### Usage
195
+
196
+ ```typescript
197
+ import { expectResponseStatusFactory } from '@map-colonies/openapi-helpers/requestSender';
198
+ import type { ExpectResponseStatus } from '@map-colonies/openapi-helpers/requestSender';
199
+ import { describe, it, expect } from 'vitest';
200
+
201
+ // Create the assertion function with the exported type
202
+ const expectResponseStatus: ExpectResponseStatus = expectResponseStatusFactory(expect);
203
+
204
+ it('should return user data on success', async () => {
205
+ const response = await requestSender.getUser({ pathParams: { id: '123' } });
206
+
207
+ // Assert the status and narrow the type
208
+ expectResponseStatus(response, 200);
209
+
210
+ // TypeScript now knows response is the 200 response type
211
+ // You can safely access response.body with full autocomplete
212
+ console.log(response.body.id);
213
+ console.log(response.body.name);
214
+ });
215
+
216
+ it('should handle error responses', async () => {
217
+ const response = await requestSender.getUser({ pathParams: { id: 'invalid' } });
218
+
219
+ if (response.status === 404) {
220
+ expectResponseStatus(response, 404);
221
+ // TypeScript knows this is a 404 response
222
+ console.log(response.body.error);
223
+ }
224
+ });
225
+ ```
226
+
227
+ > [!TIP]
228
+ > **Avoiding TS2775 Error**: When using `expectResponseStatusFactory`, you must provide an explicit type annotation using the exported `ExpectResponseStatus` type as shown above. This is required by TypeScript's strict mode for assertion functions.
229
+
230
+ #### Reusable Setup
231
+
232
+ To avoid repeating the setup in every test file, create a shared test utility:
233
+
234
+ ```typescript
235
+ // test/utils/assertions.ts
236
+ import { expectResponseStatusFactory } from '@map-colonies/openapi-helpers/requestSender';
237
+ import type { ExpectResponseStatus } from '@map-colonies/openapi-helpers/requestSender';
238
+ import { expect } from 'vitest';
239
+
240
+ export const expectResponseStatus: ExpectResponseStatus = expectResponseStatusFactory(expect);
241
+ ```
242
+
243
+ Then import and use it in your tests:
244
+
245
+ ```typescript
246
+ // test/api.spec.ts
247
+ import { expectResponseStatus } from './utils/assertions';
248
+
249
+ it('should work', async () => {
250
+ const response = await requestSender.getUser({ pathParams: { id: '123' } });
251
+ expectResponseStatus(response, 200);
252
+ // TypeScript knows the exact response type
253
+ });
254
+ ```
255
+
256
+ #### How it works
257
+
258
+ The `expectResponseStatusFactory` takes an expect function (from your test framework) and returns a function that:
259
+ 1. Asserts that the response status matches the expected status
260
+ 2. Narrows the TypeScript type of the response to only include the matching status code
261
+
262
+ This is particularly useful when working with OpenAPI-generated types that have multiple possible response types (e.g., 200 success, 404 not found, 500 error). After calling `expectResponseStatus`, TypeScript will know exactly which response type you're working with.
263
+
264
+ #### Benefits
265
+
266
+ - **Type Safety**: Full TypeScript support with automatic type narrowing
267
+ - **Autocomplete**: Get accurate autocomplete for response body based on the status code
268
+ - **Test Clarity**: Combine assertion and type narrowing in a single function call
269
+ - **Prevents Errors**: Catch type mismatches at compile time instead of runtime
270
+
190
271
 
191
272
  > [!IMPORTANT]
192
273
  > For the package to function properly, you need to make sure that the following values are configured in your `tsconfig.json` or `jsconfig.json` files under compilerOptions:
@@ -0,0 +1,38 @@
1
+ type Status = number | string;
2
+ interface Response {
3
+ status: Status;
4
+ }
5
+ interface Expect {
6
+ (actual: unknown): {
7
+ toBe: (expected: unknown) => void;
8
+ };
9
+ }
10
+ /**
11
+ * Type for the assertion function returned by expectResponseStatusFactory
12
+ * @public
13
+ */
14
+ export type ExpectResponseStatus = <TResponse extends Response, TStatus extends TResponse['status']>(res: TResponse, expectedStatus: TStatus) => asserts res is Extract<TResponse, {
15
+ status: TStatus;
16
+ }>;
17
+ /**
18
+ * Creates a function to assert that the response status matches the expected status
19
+ * It forces TypeScript to narrow the response type based on the expected status
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * import { expectResponseStatusFactory } from '@map-colonies/openapi-helpers/requestSender';
24
+ * import type { ExpectResponseStatus } from '@map-colonies/openapi-helpers/requestSender';
25
+ * import { expect } from 'vitest';
26
+ *
27
+ * const expectResponseStatus: ExpectResponseStatus = expectResponseStatusFactory(expect);
28
+ *
29
+ * // Now use it in tests
30
+ * const response = await requestSender.getUser({ pathParams: { id: '123' } });
31
+ * expectResponseStatus(response, 200);
32
+ * // TypeScript now knows response is the 200 response type
33
+ * ```
34
+ * @public
35
+ */
36
+ export declare function expectResponseStatusFactory(expect: Expect): ExpectResponseStatus;
37
+ export {};
38
+ //# sourceMappingURL=expect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../src/requestSender/expect.ts"],"names":[],"mappings":"AAAA,KAAK,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9B,UAAU,QAAQ;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,MAAM;IACd,CAAC,MAAM,EAAE,OAAO,GAAG;QACjB,IAAI,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;KACnC,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,SAAS,SAAS,QAAQ,EAAE,OAAO,SAAS,SAAS,CAAC,QAAQ,CAAC,EACjG,GAAG,EAAE,SAAS,EACd,cAAc,EAAE,OAAO,KACpB,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,SAAS,EAAE;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAE5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,CAIhF"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.expectResponseStatusFactory = expectResponseStatusFactory;
4
+ /**
5
+ * Creates a function to assert that the response status matches the expected status
6
+ * It forces TypeScript to narrow the response type based on the expected status
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { expectResponseStatusFactory } from '@map-colonies/openapi-helpers/requestSender';
11
+ * import type { ExpectResponseStatus } from '@map-colonies/openapi-helpers/requestSender';
12
+ * import { expect } from 'vitest';
13
+ *
14
+ * const expectResponseStatus: ExpectResponseStatus = expectResponseStatusFactory(expect);
15
+ *
16
+ * // Now use it in tests
17
+ * const response = await requestSender.getUser({ pathParams: { id: '123' } });
18
+ * expectResponseStatus(response, 200);
19
+ * // TypeScript now knows response is the 200 response type
20
+ * ```
21
+ * @public
22
+ */
23
+ function expectResponseStatusFactory(expect) {
24
+ return (res, expectedStatus) => {
25
+ expect(res.status).toBe(expectedStatus);
26
+ };
27
+ }
28
+ //# sourceMappingURL=expect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expect.js","sourceRoot":"","sources":["../../src/requestSender/expect.ts"],"names":[],"mappings":";;AAwCA,kEAIC;AAvBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,2BAA2B,CAAC,MAAc;IACxD,OAAO,CAAC,GAAG,EAAE,cAAc,EAAE,EAAE;QAC7B,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC1C,CAAC,CAAC;AACJ,CAAC"}
@@ -1,7 +1,9 @@
1
1
  import type express from 'express';
2
2
  import { PathsTemplate, OperationsTemplate } from '../common/types';
3
+ import { expectResponseStatusFactory } from './expect';
4
+ import type { ExpectResponseStatus } from './expect';
3
5
  import type { RequestSender, RequestSenderOptions } from './types';
4
- export { RequestSender };
6
+ export { RequestSender, expectResponseStatusFactory, ExpectResponseStatus };
5
7
  /**
6
8
  * Creates a request sender object that can be used to send fake HTTP requests using supertest based on an OpenAPI specification.
7
9
  * The openapi types should be generated using the openapi-typescript package.
@@ -1 +1 @@
1
- {"version":3,"file":"requestSender.d.ts","sourceRoot":"","sources":["../../src/requestSender/requestSender.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAInC,OAAO,EAAE,aAAa,EAAW,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,KAAK,EAAuD,aAAa,EAAiB,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAsFvI,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,SAAS,aAAa,GAAG,KAAK,EAAE,UAAU,SAAS,kBAAkB,GAAG,KAAK,EAC1H,eAAe,EAAE,UAAU,SAAS,KAAK,GAAG,KAAK,GAAG,MAAM,EAC1D,GAAG,EAAE,OAAO,CAAC,WAAW,EACxB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAsB3C"}
1
+ {"version":3,"file":"requestSender.d.ts","sourceRoot":"","sources":["../../src/requestSender/requestSender.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAInC,OAAO,EAAE,aAAa,EAAW,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAuD,aAAa,EAAiB,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAsFvI,OAAO,EAAE,aAAa,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,SAAS,aAAa,GAAG,KAAK,EAAE,UAAU,SAAS,kBAAkB,GAAG,KAAK,EAC1H,eAAe,EAAE,UAAU,SAAS,KAAK,GAAG,KAAK,GAAG,MAAM,EAC1D,GAAG,EAAE,OAAO,CAAC,WAAW,EACxB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAsB3C"}
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.expectResponseStatusFactory = void 0;
6
7
  exports.createRequestSender = createRequestSender;
7
8
  /**
8
9
  * @module requestSender
@@ -10,6 +11,8 @@ exports.createRequestSender = createRequestSender;
10
11
  const node_fs_1 = require("node:fs");
11
12
  const supertest_1 = __importDefault(require("supertest"));
12
13
  const oas_normalize_1 = __importDefault(require("oas-normalize"));
14
+ const expect_1 = require("./expect");
15
+ Object.defineProperty(exports, "expectResponseStatusFactory", { enumerable: true, get: function () { return expect_1.expectResponseStatusFactory; } });
13
16
  function sendRequest(app, options, internalOptions = {}) {
14
17
  const method = options.method;
15
18
  let actualPath = (internalOptions.baseUrl ?? '') + options.path;
@@ -1 +1 @@
1
- {"version":3,"file":"requestSender.js","sourceRoot":"","sources":["../../src/requestSender/requestSender.ts"],"names":[],"mappings":";;;;;AAmIA,kDA0BC;AA7JD;;GAEG;AACH,qCAAuC;AACvC,0DAAkC;AAElC,kEAAyC;AAMzC,SAAS,WAAW,CAKlB,GAAwB,EACxB,OAAgD,EAChD,kBAAwC,EAAE;IAE1C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAiB,CAAC;IACzC,IAAI,UAAU,GAAG,CAAC,eAAe,CAAC,OAAO,IAAI,EAAE,CAAC,GAAI,OAAO,CAAC,IAAe,CAAC;IAE5E,IAAI,YAAY,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QAChE,UAAU,GA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;IAElC,MAAM,WAAW,GAAG,IAAA,sBAAY,EAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IAC3D,MAAM,UAAU,GAAG,IAAI,uBAAY,CAAC,WAAW,CAAC,CAAC;IACjD,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,CAAC;IACzC,MAAM,uBAAuB,GAAG,0BAA0B,CAAC,OAAO,CAAC,CAAC;IACpE,MAAM,WAAW,GAAG,OAAO,CAAC;IAE5B,MAAM,SAAS,GAAG;QAChB,uHAAuH;QACvH,WAAW,EAAE,CACX,OAAgD,EAChD,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,WAAW,CAAC;KAC5C,CAAC;IAEF,KAAK,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,EAAE,CAAC;QACpF,4FAA4F;QAC5F,4EAA4E;QAC5E,SAAS,CAAC,SAAS,CAAC,GAAG,KAAK,EAAE,OAA+D,EAAE,EAAE,CAC/F,WAAW,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAe,EAAE,GAAG,OAAO,EAAE,EAAE,WAAW,CAAC,CAAC;IACjF,CAAC;IAED,OAAO,SAA6C,CAAC;AACvD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@map-colonies/openapi-helpers",
3
- "version": "5.0.0",
3
+ "version": "5.1.0",
4
4
  "description": "A package that provides utilities for working with openapi files",
5
5
  "type": "commonjs",
6
6
  "exports": {
@@ -29,15 +29,15 @@
29
29
  "node": ">=24"
30
30
  },
31
31
  "dependencies": {
32
- "@apidevtools/json-schema-ref-parser": "^14.1.1",
32
+ "@apidevtools/json-schema-ref-parser": "^15.0.0",
33
33
  "@commander-js/extra-typings": "^14.0.0",
34
34
  "change-case": "^5.4.4",
35
35
  "commander": "^14.0.0",
36
36
  "oas-normalize": "^15.0.0",
37
- "ora": "^8.2.0",
37
+ "ora": "^9.0.0",
38
38
  "ts-essentials": "^10.1.1",
39
39
  "yaml": "^2.8.0",
40
- "@map-colonies/read-pkg": "^1.0.0"
40
+ "@map-colonies/read-pkg": "^2.0.0"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@types/express": "^4.17.21",
@@ -46,18 +46,18 @@
46
46
  "supertest": "^7.0.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@types/supertest": "6.0.2",
50
- "@types/node": "24.0.0",
49
+ "@types/supertest": "6.0.3",
50
+ "@types/node": "24.10.9",
51
51
  "@types/body-parser": "1.19.6",
52
52
  "openapi-types": "12.1.3",
53
- "body-parser": "2.2.1",
53
+ "body-parser": "2.2.2",
54
54
  "eslint": "^9.39.1",
55
55
  "express": "5.2.1",
56
56
  "rimraf": "^6.1.2",
57
57
  "typescript": "5.9.3",
58
58
  "vitest": "^4.0.15",
59
59
  "@microsoft/api-extractor": "^7.55.2",
60
- "@map-colonies/eslint-config": "^7.0.0",
60
+ "@map-colonies/eslint-config": "^7.1.0",
61
61
  "@map-colonies/tsconfig": "^2.0.0",
62
62
  "vitest-config": "^0.0.0"
63
63
  },