@map-colonies/openapi-helpers 1.2.0 → 2.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 +8 -8
- package/dist/common/types.d.ts +0 -1
- package/dist/generator/generateTypes.d.mts +0 -1
- package/dist/generator/generateTypes.mjs +4 -1
- package/dist/generator/generateTypes.mjs.map +1 -1
- package/dist/requestSender/requestSender.d.ts +24 -3
- package/dist/requestSender/requestSender.js +34 -9
- package/dist/requestSender/requestSender.js.map +1 -1
- package/dist/requestSender/types.d.ts +12 -1
- package/dist/typedRequestHandler/typedRequestHandler.d.ts +31 -1
- package/package.json +22 -17
- package/dist/common/types.d.ts.map +0 -1
- package/dist/generator/generateTypes.d.mts.map +0 -1
- package/dist/requestSender/requestSender.d.ts.map +0 -1
- package/dist/requestSender/types.d.ts.map +0 -1
- package/dist/typedRequestHandler/typedRequestHandler.d.ts.map +0 -1
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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"
|
package/dist/common/types.d.ts
CHANGED
|
@@ -8,12 +8,15 @@ const { values: { format: shouldFormat, 'add-typed-request-handler': addTypedReq
|
|
|
8
8
|
args: process.argv.slice(ARGS_SLICE),
|
|
9
9
|
options: {
|
|
10
10
|
format: { type: 'boolean', alias: 'f' },
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
12
11
|
'add-typed-request-handler': { type: 'boolean', alias: 't' },
|
|
13
12
|
},
|
|
14
13
|
allowPositionals: true,
|
|
15
14
|
});
|
|
16
15
|
const [openapiPath, destinationPath] = positionals;
|
|
16
|
+
if (openapiPath === undefined || destinationPath === undefined) {
|
|
17
|
+
console.error('Usage: generateTypes <openapiPath> <destinationPath>');
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
17
20
|
const ESLINT_DISABLE = '/* eslint-disable */\n';
|
|
18
21
|
const typedRequestHandlerImport = "import type { TypedRequestHandlers as ImportedTypedRequestHandlers } from '@map-colonies/openapi-helpers/typedRequestHandler';\n";
|
|
19
22
|
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,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EAAE,eAAe,CAAC,GAAG,WAAW,CAAC;AAEnD,IAAI,WAAW,KAAK,SAAS,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;IAC/D,OAAO,CAAC,KAAK,CAAC,sDAAsD,CAAC,CAAC;IACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,cAAc,GAAG,wBAAwB,CAAC;AAEhD,MAAM,yBAAyB,GAC7B,kIAAkI,CAAC;AACrI,MAAM,0BAA0B,GAAG,uFAAuF,CAAC;AAE3H,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;AAE3F,IAAI,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;AAE/B,IAAI,sBAAsB,KAAK,IAAI,EAAE,CAAC;IACpC,OAAO,GAAG,yBAAyB,GAAG,OAAO,GAAG,0BAA0B,CAAC;AAC7E,CAAC;AAED,OAAO,GAAG,cAAc,GAAG,OAAO,CAAC;AAEnC,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;IAC1B,MAAM,eAAe,GAAG,MAAM,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAE9D,OAAO,GAAG,MAAM,MAAM,CAAC,OAAO,EAAE,EAAE,GAAG,eAAe,EAAE,MAAM,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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type express from 'express';
|
|
2
2
|
import { PathsTemplate, OperationsTemplate } from '../common/types';
|
|
3
|
-
import type { RequestSender } from './types';
|
|
3
|
+
import type { RequestSender, RequestSenderOptions } from './types';
|
|
4
4
|
export { RequestSender };
|
|
5
5
|
/**
|
|
6
6
|
* Creates a request sender object that can be used to send fake HTTP requests using supertest based on an OpenAPI specification.
|
|
@@ -10,7 +10,28 @@ export { RequestSender };
|
|
|
10
10
|
* @template Operations - The type representing the operations defined in the OpenAPI specification.
|
|
11
11
|
* @param {string} openapiFilePath - The file path to the OpenAPI specification file.
|
|
12
12
|
* @param {express.Application} app - The Express application instance.
|
|
13
|
+
* @param {RequestSenderOptions} [options] - Optional configuration options for the request sender.
|
|
13
14
|
* @returns {Promise<RequestSender<Paths, Operations>>} A promise that resolves to a RequestSender object.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import express from 'express';
|
|
19
|
+
* import { createRequestSender } from './requestSender';
|
|
20
|
+
* import type { paths, operations } from './openapi';
|
|
21
|
+
*
|
|
22
|
+
* const app = express();
|
|
23
|
+
* const openapiFilePath = './openapi3.yaml';
|
|
24
|
+
*
|
|
25
|
+
* const requestSender = await createRequestSender<paths, operations>(openapiFilePath, app);
|
|
26
|
+
*
|
|
27
|
+
* // Using operation name
|
|
28
|
+
* const response1 = await requestSender.getUsers();
|
|
29
|
+
*
|
|
30
|
+
* // Using path and method
|
|
31
|
+
* const response2 = await requestSender.sendRequest({
|
|
32
|
+
* method: 'get',
|
|
33
|
+
* path: '/simple-request'
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
14
36
|
*/
|
|
15
|
-
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
|
|
37
|
+
export declare function createRequestSender<Paths extends PathsTemplate = never, Operations extends OperationsTemplate = never>(openapiFilePath: Operations extends never ? never : string, app: express.Application, options?: RequestSenderOptions): Promise<RequestSender<Paths, Operations>>;
|
|
@@ -3,13 +3,16 @@ 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 =
|
|
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"));
|
|
10
|
-
function sendRequest(app, options) {
|
|
13
|
+
function sendRequest(app, options, internalOptions = {}) {
|
|
11
14
|
const method = options.method;
|
|
12
|
-
let actualPath = options.path;
|
|
15
|
+
let actualPath = (internalOptions.baseUrl ?? '') + options.path;
|
|
13
16
|
if ('pathParams' in options && options.pathParams !== undefined) {
|
|
14
17
|
actualPath = Object.entries(options.pathParams).reduce((acc, [key, value]) => acc.replace(`{${key}}`, value), actualPath);
|
|
15
18
|
}
|
|
@@ -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]
|
|
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}`);
|
|
@@ -72,23 +75,45 @@ function getOperationsPathAndMethod(openapi) {
|
|
|
72
75
|
* @template Operations - The type representing the operations defined in the OpenAPI specification.
|
|
73
76
|
* @param {string} openapiFilePath - The file path to the OpenAPI specification file.
|
|
74
77
|
* @param {express.Application} app - The Express application instance.
|
|
78
|
+
* @param {RequestSenderOptions} [options] - Optional configuration options for the request sender.
|
|
75
79
|
* @returns {Promise<RequestSender<Paths, Operations>>} A promise that resolves to a RequestSender object.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* import express from 'express';
|
|
84
|
+
* import { createRequestSender } from './requestSender';
|
|
85
|
+
* import type { paths, operations } from './openapi';
|
|
86
|
+
*
|
|
87
|
+
* const app = express();
|
|
88
|
+
* const openapiFilePath = './openapi3.yaml';
|
|
89
|
+
*
|
|
90
|
+
* const requestSender = await createRequestSender<paths, operations>(openapiFilePath, app);
|
|
91
|
+
*
|
|
92
|
+
* // Using operation name
|
|
93
|
+
* const response1 = await requestSender.getUsers();
|
|
94
|
+
*
|
|
95
|
+
* // Using path and method
|
|
96
|
+
* const response2 = await requestSender.sendRequest({
|
|
97
|
+
* method: 'get',
|
|
98
|
+
* path: '/simple-request'
|
|
99
|
+
* });
|
|
100
|
+
* ```
|
|
76
101
|
*/
|
|
77
|
-
async function createRequestSender(openapiFilePath, app) {
|
|
102
|
+
async function createRequestSender(openapiFilePath, app, options = {}) {
|
|
78
103
|
const fileContent = (0, node_fs_1.readFileSync)(openapiFilePath, 'utf-8');
|
|
79
104
|
const normalized = new oas_normalize_1.default(fileContent);
|
|
80
105
|
const derefed = await normalized.deref();
|
|
81
106
|
const operationsPathAndMethod = getOperationsPathAndMethod(derefed);
|
|
107
|
+
const baseOptions = options;
|
|
82
108
|
const returnObj = {
|
|
83
|
-
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
84
|
-
sendRequest: (options) => sendRequest(app, options),
|
|
109
|
+
// eslint-disable-next-line @typescript-eslint/promise-function-async, @typescript-eslint/explicit-function-return-type
|
|
110
|
+
sendRequest: (options) => sendRequest(app, options, baseOptions),
|
|
85
111
|
};
|
|
86
112
|
for (const [operation, { path, method }] of Object.entries(operationsPathAndMethod)) {
|
|
87
113
|
// @ts-expect-error as we iterate over all the operations, the operationId is always defined
|
|
88
114
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
89
|
-
returnObj[operation] = async (options) => sendRequest(app, { path, method: method, ...options });
|
|
115
|
+
returnObj[operation] = async (options) => sendRequest(app, { path, method: method, ...options }, baseOptions);
|
|
90
116
|
}
|
|
91
117
|
return returnObj;
|
|
92
118
|
}
|
|
93
|
-
exports.createRequestSender = createRequestSender;
|
|
94
119
|
//# sourceMappingURL=requestSender.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestSender.js","sourceRoot":"","sources":["../../src/requestSender/requestSender.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"requestSender.js","sourceRoot":"","sources":["../../src/requestSender/requestSender.ts"],"names":[],"mappings":";;;;;AAkIA,kDA0BC;AA5JD;;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,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,GAAG,EAAE,KAAe,CAAC,EAAE,UAAU,CAAC,CAAC;IACtI,CAAC;IAED,0BAA0B;IAC1B,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;IAED,IAAI,OAAO,GAAG,mBAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC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pF,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"}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import type { OmitProperties, OptionalKeys, Prettify, RequiredKeys } from 'ts-essentials';
|
|
2
2
|
import type * as supertest from 'supertest';
|
|
3
3
|
import type { AddIfNotNever, OperationsTemplate, PathsTemplate, PickWritable } from '../common/types';
|
|
4
|
+
/**
|
|
5
|
+
* Configuration options for the request sender.
|
|
6
|
+
*
|
|
7
|
+
* @interface RequestSenderOptions
|
|
8
|
+
*/
|
|
9
|
+
export interface RequestSenderOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Base URL to prepend to all request paths.
|
|
12
|
+
* @type {string}
|
|
13
|
+
*/
|
|
14
|
+
baseUrl?: string;
|
|
15
|
+
}
|
|
4
16
|
interface Headers {
|
|
5
17
|
headers?: Record<string, string>;
|
|
6
18
|
}
|
|
@@ -80,4 +92,3 @@ export type RequestSender<Paths extends PathsTemplate, Operations extends Operat
|
|
|
80
92
|
[operation in OperationsNames<Operations>]: RequiredKeys<RequestOptions<Operations[operation]>> extends OptionalKeys<RequestOptions<Operations[operation]>> ? OperationRequestOptional<Operations, operation> : OperationRequestRequired<Operations, operation>;
|
|
81
93
|
}>;
|
|
82
94
|
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.
|
|
3
|
+
"version": "2.1.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,28 @@
|
|
|
61
60
|
"supertest": "^7.0.0"
|
|
62
61
|
},
|
|
63
62
|
"devDependencies": {
|
|
64
|
-
"@commitlint/cli": "^
|
|
65
|
-
"@commitlint
|
|
66
|
-
"@map-colonies/eslint-config": "^
|
|
63
|
+
"@commitlint/cli": "^19.6.1",
|
|
64
|
+
"@map-colonies/commitlint-config": "^1.1.0",
|
|
65
|
+
"@map-colonies/eslint-config": "^6.0.0",
|
|
66
|
+
"@map-colonies/infra-copilot-instructions": "^1.0.0",
|
|
67
|
+
"@map-colonies/tsconfig": "^1.0.0",
|
|
68
|
+
"@swc/core": "^1.7.26",
|
|
69
|
+
"@swc/jest": "^0.2.36",
|
|
67
70
|
"@types/jest": "^29.5.12",
|
|
68
71
|
"@types/node": "^22.2.0",
|
|
69
72
|
"@types/supertest": "^6.0.2",
|
|
70
73
|
"body-parser": "^1.20.2",
|
|
71
|
-
"commitlint": "^
|
|
74
|
+
"commitlint": "^19.6.1",
|
|
72
75
|
"cz-conventional-changelog": "^3.3.0",
|
|
73
|
-
"eslint": "^
|
|
76
|
+
"eslint": "^9.22.0",
|
|
77
|
+
"eslint-plugin-jest": "^28.11.0",
|
|
74
78
|
"expect-type": "^0.19.0",
|
|
75
79
|
"express": "^4.17.1",
|
|
76
|
-
"husky": "^
|
|
80
|
+
"husky": "^9.1.7",
|
|
77
81
|
"jest": "^29.7.0",
|
|
78
82
|
"pretty-quick": "^4.0.0",
|
|
79
|
-
"
|
|
80
|
-
"
|
|
83
|
+
"rimraf": "^6.0.1",
|
|
84
|
+
"typedoc": "^0.27.6",
|
|
85
|
+
"typescript": "^5.7.3"
|
|
81
86
|
}
|
|
82
87
|
}
|
|
@@ -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,mBAAmB,CAAC,KAAK,SAAS,aAAa,GAAG,KAAK,EAAE,UAAU,SAAS,kBAAkB,GAAG,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