@map-colonies/openapi-helpers 1.2.0 → 2.0.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
@@ -1,5 +1,5 @@
1
1
  # openapi-helpers
2
- This package contains scripts, types and functions to help you work with openapi.
2
+ This package contains scripts, types and functions to help you work with OpenAPI.
3
3
 
4
4
 
5
5
  ## Installation
@@ -10,7 +10,7 @@ npm install --save-dev @map-colonies/openapi-helpers supertest prettier openapi-
10
10
  ```
11
11
 
12
12
  ## types-generator
13
- The package contains a script that wraps the `openapi-typescript` package and generates types for the openapi schema. The script also formats the generated types using `prettier`.
13
+ The package contains a script that wraps the `openapi-typescript` package and generates types for the OpenAPI schema. The script also formats the generated types using `prettier`.
14
14
 
15
15
  The command structure is as follows:
16
16
  ```bash
@@ -27,7 +27,7 @@ npx @map-colonies/openapi-helpers ./openapi3.yaml ./src/openapi.d.ts --format --
27
27
  - `--add-typed-request-handler` - add the `TypedRequestHandler` type to the generated types.
28
28
 
29
29
  ## TypedRequestHandler
30
- The package contains a wrapper for the `express` types package that provides autocomplete for all the request Handlers to the API based on the openapi. The TypedRequestHandler is initialized with the the typed generated by `openapi-typescript`, and is configured based on operation name or method and path.
30
+ The package contains a wrapper for the `express` types package that provides autocomplete for all the request handlers to the API based on the OpenAPI schema. The TypedRequestHandler is initialized with the types generated by `openapi-typescript`, and is configured based on operation name or method and path.
31
31
 
32
32
  ### Usage
33
33
  ```typescript
@@ -39,7 +39,7 @@ import type { paths, operations } from './src/openapi.d.ts';
39
39
  type MyHandlers = TypedRequestHandlers<paths, operations>;
40
40
 
41
41
  export class Controller {
42
- // Define the handler for the operation based method and path
42
+ // Define the handler for the operation based on method and path
43
43
  public getResource: MyHandlers['GET /resource'] = (req, res) => {
44
44
  res.status(httpStatus.OK).json({id: 1, description: 'description', name: 'name'});
45
45
  };
@@ -53,7 +53,7 @@ export class Controller {
53
53
  ```
54
54
 
55
55
  ## RequestSender
56
- The package contains a wrapper for the `supertest` package that provides autocomplete for all the requests to the API based on the openapi. The requestSender is initialized with the server's base url and the openapi schema and the types exported by `openapi-typescript`.
56
+ The package contains a wrapper for the `supertest` package that provides autocomplete for all the requests to the API based on the OpenAPI schema. The RequestSender is initialized with the server's base URL and the OpenAPI schema and the types exported by `openapi-typescript`.
57
57
 
58
58
  ```typescript
59
59
  import { RequestSender } from '@map-colonies/openapi-helpers/requestSender';
@@ -62,7 +62,7 @@ import type { paths, operations } from './src/openapi.d.ts';
62
62
  const requestSender = await createRequestSender<paths, operations>('path/to/openapi3.yaml', expressApp);
63
63
  ```
64
64
 
65
- The requestSender object contains all the paths and operations defined in the openapi schema. For example, to send a request to the `getUsers` operation with the `/users` path and with the `GET` method, you can use the following code:
65
+ The requestSender object contains all the paths and operations defined in the OpenAPI schema. For example, to send a request to the `getUsers` operation with the `/users` path and with the `GET` method, you can use the following code:
66
66
 
67
67
  ```typescript
68
68
  const response = await requestSender.getUsers();
@@ -75,10 +75,10 @@ const response = await requestSender.sendRequest({
75
75
  });
76
76
  ```
77
77
 
78
- 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.
78
+ 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.
79
79
 
80
80
 
81
81
  > [!IMPORTANT]
82
- > For the package function properly, you need to make sure that the following values are configured in your `tsconfig.json` or `jsconfig.json` files under compilerOptions:
82
+ > 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:
83
83
  > - module: "NodeNext"
84
84
  > - moduleResolution: "NodeNext"
@@ -13,4 +13,3 @@ export type PathsTemplate = Record<string, {
13
13
  } & {
14
14
  [key in Methods]?: OperationsTemplate;
15
15
  }>;
16
- //# sourceMappingURL=types.d.ts.map
@@ -1,3 +1,2 @@
1
1
  #!/usr/bin/env node
2
2
  export {};
3
- //# sourceMappingURL=generateTypes.d.mts.map
@@ -14,6 +14,10 @@ const { values: { format: shouldFormat, 'add-typed-request-handler': addTypedReq
14
14
  allowPositionals: true,
15
15
  });
16
16
  const [openapiPath, destinationPath] = positionals;
17
+ if (openapiPath === undefined || destinationPath === undefined) {
18
+ console.error('Usage: generateTypes <openapiPath> <destinationPath>');
19
+ process.exit(1);
20
+ }
17
21
  const ESLINT_DISABLE = '/* eslint-disable */\n';
18
22
  const typedRequestHandlerImport = "import type { TypedRequestHandlers as ImportedTypedRequestHandlers } from '@map-colonies/openapi-helpers/typedRequestHandler';\n";
19
23
  const exportTypedRequestHandlers = 'export type TypedRequestHandlers = ImportedTypedRequestHandlers<paths, operations>;\n';
@@ -1 +1 @@
1
- {"version":3,"file":"generateTypes.mjs","sourceRoot":"","sources":["../../src/generator/generateTypes.mts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,SAAS,EAAE,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,UAAU,GAAG,CAAC,CAAC;AAErB,MAAM,EACJ,MAAM,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,EACrF,WAAW,GACZ,GAAG,SAAS,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;IACpC,OAAO,EAAE;QACP,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;QACvC,gEAAgE;QAChE,2BAA2B,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;KAC7D;IACD,gBAAgB,EAAE,IAAI;CACvB,CAAC,CAAC;AAEH,MAAM,CAAC,WAAW,EAAE,eAAe,CAAC,GAAG,WAAW,CAAC;AAEnD,MAAM,cAAc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M,EAAE,YAAY,EAAE,CAAC,CAAC;AAChF,CAAC;AAED,MAAM,EAAE,CAAC,SAAS,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;AAE7C,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC"}
@@ -11,6 +11,26 @@ export { RequestSender };
11
11
  * @param {string} openapiFilePath - The file path to the OpenAPI specification file.
12
12
  * @param {express.Application} app - The Express application instance.
13
13
  * @returns {Promise<RequestSender<Paths, Operations>>} A promise that resolves to a RequestSender object.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * import express from 'express';
18
+ * import { createRequestSender } from './requestSender';
19
+ * import type { paths, operations } from './openapi';
20
+ *
21
+ * const app = express();
22
+ * const openapiFilePath = './openapi3.yaml';
23
+ *
24
+ * const requestSender = await createRequestSender<paths, operations>(openapiFilePath, app);
25
+ *
26
+ * // Using operation name
27
+ * const response1 = await requestSender.getUsers();
28
+ *
29
+ * // Using path and method
30
+ * const response2 = await requestSender.sendRequest({
31
+ * method: 'get',
32
+ * path: '/simple-request'
33
+ * });
34
+ * ```
14
35
  */
15
36
  export declare function createRequestSender<Paths extends PathsTemplate = never, Operations extends OperationsTemplate = never>(openapiFilePath: Operations extends never ? never : string, app: express.Application): Promise<RequestSender<Paths, Operations>>;
16
- //# sourceMappingURL=requestSender.d.ts.map
@@ -3,7 +3,10 @@ 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.createRequestSender = void 0;
6
+ exports.createRequestSender = createRequestSender;
7
+ /**
8
+ * @module requestSender
9
+ */
7
10
  const node_fs_1 = require("node:fs");
8
11
  const supertest_1 = __importDefault(require("supertest"));
9
12
  const oas_normalize_1 = __importDefault(require("oas-normalize"));
@@ -48,7 +51,7 @@ function getOperationsPathAndMethod(openapi) {
48
51
  const pathObject = pathValue;
49
52
  for (const method of methods) {
50
53
  if (pathObject[method] !== undefined) {
51
- const operationId = pathObject[method]?.operationId;
54
+ const operationId = pathObject[method].operationId;
52
55
  /* istanbul ignore next */
53
56
  if (operationId === undefined) {
54
57
  throw new Error(`OperationId is not defined for ${method} method on ${path}`);
@@ -73,6 +76,27 @@ function getOperationsPathAndMethod(openapi) {
73
76
  * @param {string} openapiFilePath - The file path to the OpenAPI specification file.
74
77
  * @param {express.Application} app - The Express application instance.
75
78
  * @returns {Promise<RequestSender<Paths, Operations>>} A promise that resolves to a RequestSender object.
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * import express from 'express';
83
+ * import { createRequestSender } from './requestSender';
84
+ * import type { paths, operations } from './openapi';
85
+ *
86
+ * const app = express();
87
+ * const openapiFilePath = './openapi3.yaml';
88
+ *
89
+ * const requestSender = await createRequestSender<paths, operations>(openapiFilePath, app);
90
+ *
91
+ * // Using operation name
92
+ * const response1 = await requestSender.getUsers();
93
+ *
94
+ * // Using path and method
95
+ * const response2 = await requestSender.sendRequest({
96
+ * method: 'get',
97
+ * path: '/simple-request'
98
+ * });
99
+ * ```
76
100
  */
77
101
  async function createRequestSender(openapiFilePath, app) {
78
102
  const fileContent = (0, node_fs_1.readFileSync)(openapiFilePath, 'utf-8');
@@ -90,5 +114,4 @@ async function createRequestSender(openapiFilePath, app) {
90
114
  }
91
115
  return returnObj;
92
116
  }
93
- exports.createRequestSender = createRequestSender;
94
117
  //# sourceMappingURL=requestSender.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"requestSender.js","sourceRoot":"","sources":["../../src/requestSender/requestSender.ts"],"names":[],"mappings":";;;;;;AAAA,qCAAuC;AACvC,0DAAkC;AAElC,kEAAyC;AAMzC,SAAS,WAAW,CAIlB,GAAwB,EAAE,OAAgD;IAC1E,MAAM,MAAM,GAAG,OAAO,CAAC,MAAiB,CAAC;IACzC,IAAI,UAAU,GAAG,OAAO,CAAC,IAAc,CAAC;IAExC,IAAI,YAAY,IAAI,OAAO,IAAI,OAAO,CAAC,UAAU,KAAK,SAA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M,uBAAuB,GAAG,0BAA0B,CAAC,OAAO,CAAC,CAAC;IAEpE,MAAM,SAAS,GAAG;QAChB,qEAAqE;QACrE,WAAW,EAAE,CACX,OAAgD,EAChD,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC;KAC/B,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,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,SAA6C,CAAC;AACvD,CAAC"}
@@ -80,4 +80,3 @@ export type RequestSender<Paths extends PathsTemplate, Operations extends Operat
80
80
  [operation in OperationsNames<Operations>]: RequiredKeys<RequestOptions<Operations[operation]>> extends OptionalKeys<RequestOptions<Operations[operation]>> ? OperationRequestOptional<Operations, operation> : OperationRequestRequired<Operations, operation>;
81
81
  }>;
82
82
  export {};
83
- //# sourceMappingURL=types.d.ts.map
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @module typedRequestHandler
3
+ */
1
4
  import type { RequestHandler } from 'express';
2
5
  import type { OptionalKeys } from 'ts-essentials';
3
6
  import type { ResponseObjectToFlat } from '../requestSender/types';
@@ -34,6 +37,33 @@ type AllPathsAndMethodsUnion<Paths extends PathsTemplate> = {
34
37
  type PathHandlers<Paths extends PathsTemplate> = {
35
38
  [T in AllPathsAndMethodsUnion<Paths> as `${Uppercase<string & T['method']>} ${string & T['path']}`]: GenericRequestHandler<T['operation']>;
36
39
  };
40
+ /**
41
+ * Represents a collection of request handlers that are typed based on the provided
42
+ * `Paths` and `Operations` templates generated from the openapi. This type combines both operation-specific
43
+ * handlers and path-specific handlers.
44
+ *
45
+ * @template Paths - A template that defines the structure of the paths.
46
+ * @template Operations - A template that defines the structure of the operations.
47
+ *
48
+ * @example
49
+ * ```typescript
50
+ * import type { TypedRequestHandlers } from './typedRequestHandler';
51
+ * import type { Paths, Operations } from './types';
52
+ * import express from 'express';
53
+ *
54
+ * const handlers: TypedRequestHandlers<Paths, Operations> = {
55
+ * 'GET /example': (req, res) => {
56
+ * res.send({ message: 'Example GET handler' });
57
+ * },
58
+ * exampleOperation: (req, res) => {
59
+ * res.send({ message: 'Example operation handler' });
60
+ * },
61
+ * };
62
+ *
63
+ * const app = express();
64
+ * app.get('/example', handlers['GET /example']);
65
+ * app.post('/exampleOperation', handlers.exampleOperation);
66
+ * ```
67
+ */
37
68
  export type TypedRequestHandlers<Paths extends PathsTemplate, Operations extends OperationsTemplate> = OperationHandlers<Operations> & PathHandlers<Paths>;
38
69
  export {};
39
- //# sourceMappingURL=typedRequestHandler.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@map-colonies/openapi-helpers",
3
- "version": "1.2.0",
3
+ "version": "2.0.0",
4
4
  "description": "A package that provides utilities for working with openapi files",
5
5
  "exports": {
6
6
  "./requestSender": {
@@ -20,12 +20,14 @@
20
20
  "prelint": "npm run format",
21
21
  "lint": "eslint .",
22
22
  "lint:fix": "eslint --fix .",
23
- "test": "jest --config=./tests/configurations/jest.config.js",
23
+ "test": "tsc --project tsconfig.test.json && jest --config=./tests/configurations/jest.config.js",
24
24
  "prebuild": "npm run clean",
25
25
  "build": "tsc --project tsconfig.build.json",
26
26
  "generate:test:types": "npm run build && node dist/generator/generateTypes.mjs tests/openapi3.yaml tests/types.d.ts",
27
27
  "clean": "rimraf dist",
28
- "prepublish": "npm run build"
28
+ "prepublish": "npm run build",
29
+ "prepare": "husky",
30
+ "docs": "typedoc"
29
31
  },
30
32
  "repository": {
31
33
  "type": "git",
@@ -36,18 +38,15 @@
36
38
  "bugs": {
37
39
  "url": "https://github.com/MapColonies/openapi-helpers/issues"
38
40
  },
39
- "husky": {
40
- "hooks": {
41
- "pre-commit": "pretty-quick --staged",
42
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
43
- }
44
- },
45
41
  "files": [
46
42
  "dist/**/*"
47
43
  ],
48
44
  "publishConfig": {
49
45
  "access": "public"
50
46
  },
47
+ "engines": {
48
+ "node": ">=20"
49
+ },
51
50
  "homepage": "https://github.com/MapColonies/openapi-helpers#readme",
52
51
  "dependencies": {
53
52
  "oas-normalize": "^11.1.1",
@@ -61,22 +60,26 @@
61
60
  "supertest": "^7.0.0"
62
61
  },
63
62
  "devDependencies": {
64
- "@commitlint/cli": "^11.0.0",
65
- "@commitlint/config-conventional": "^11.0.0",
63
+ "@commitlint/cli": "^19.6.1",
66
64
  "@map-colonies/eslint-config": "^4.0.0",
67
65
  "@types/jest": "^29.5.12",
68
66
  "@types/node": "^22.2.0",
69
67
  "@types/supertest": "^6.0.2",
70
68
  "body-parser": "^1.20.2",
71
- "commitlint": "^11.0.0",
69
+ "commitlint": "^19.6.1",
72
70
  "cz-conventional-changelog": "^3.3.0",
73
71
  "eslint": "^8.56.0",
74
72
  "expect-type": "^0.19.0",
75
73
  "express": "^4.17.1",
76
- "husky": "^4.3.5",
74
+ "husky": "^9.1.7",
77
75
  "jest": "^29.7.0",
78
76
  "pretty-quick": "^4.0.0",
79
- "ts-jest": "^29.1.5",
80
- "typescript": "^5.4.5"
77
+ "typescript": "^5.7.3",
78
+ "@map-colonies/tsconfig": "^1.0.0",
79
+ "@map-colonies/infra-copilot-instructions": "^1.0.0",
80
+ "@map-colonies/commitlint-config": "^1.1.0",
81
+ "typedoc": "^0.27.6",
82
+ "@swc/core": "^1.7.26",
83
+ "@swc/jest": "^0.2.36"
81
84
  }
82
85
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/common/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,MAAM,aAAa,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAClE,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,WAAW,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AAEpF,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAEjG,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG,MAAM,CAChC,MAAM,EACN;IACE,UAAU,EAAE;QACV,KAAK,CAAC,EAAE,GAAG,CAAC;QACZ,MAAM,CAAC,EAAE,GAAG,CAAC;QACb,IAAI,CAAC,EAAE,GAAG,CAAC;QACX,MAAM,CAAC,EAAE,GAAG,CAAC;KACd,CAAC;CACH,GAAG;KACD,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,kBAAkB;CACtC,CACF,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateTypes.d.mts","sourceRoot":"","sources":["../../src/generator/generateTypes.mts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"requestSender.d.ts","sourceRoot":"","sources":["../../src/requestSender/requestSender.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAInC,OAAO,EAAE,aAAa,EAAW,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,KAAK,EAAuD,aAAa,EAAiB,MAAM,SAAS,CAAC;AAkFjH,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB;;;;;;;;;GASG;AACH,wBAAsB,mBAA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