@rxap/schematics-open-api 13.0.0-next.5 → 13.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/CHANGELOG.md +2 -5
- package/package.json +2 -2
- package/src/index.js +29 -26
- package/src/index.js.map +1 -1
- package/src/lib/clear-operation.js +7 -3
- package/src/lib/clear-operation.js.map +1 -1
- package/src/lib/config.js +10 -7
- package/src/lib/config.js.map +1 -1
- package/src/lib/generate-components.js +10 -6
- package/src/lib/generate-components.js.map +1 -1
- package/src/lib/generate-index-exports.js +7 -3
- package/src/lib/generate-index-exports.js.map +1 -1
- package/src/lib/generate-operation.js +23 -19
- package/src/lib/generate-operation.js.map +1 -1
- package/src/lib/generate-parameters.js +16 -12
- package/src/lib/generate-parameters.js.map +1 -1
- package/src/lib/generate-request-body.js +14 -10
- package/src/lib/generate-request-body.js.map +1 -1
- package/src/lib/generate-response.js +14 -10
- package/src/lib/generate-response.js.map +1 -1
- package/src/lib/load-open-api-config.js +11 -7
- package/src/lib/load-open-api-config.js.map +1 -1
- package/src/lib/types.js +9 -3
- package/src/lib/types.js.map +1 -1
- package/src/lib/utilities/any-schema-object.js +5 -1
- package/src/lib/utilities/any-schema-object.js.map +1 -1
- package/src/lib/utilities/get-parameter-type.js +8 -4
- package/src/lib/utilities/get-parameter-type.js.map +1 -1
- package/src/lib/utilities/get-reqeust-body.js +10 -6
- package/src/lib/utilities/get-reqeust-body.js.map +1 -1
- package/src/lib/utilities/get-request-body-type.js +12 -8
- package/src/lib/utilities/get-request-body-type.js.map +1 -1
- package/src/lib/utilities/get-response-type.js +12 -8
- package/src/lib/utilities/get-response-type.js.map +1 -1
- package/src/lib/utilities/get-response.js +7 -3
- package/src/lib/utilities/get-response.js.map +1 -1
- package/src/lib/utilities/has-operation-paramters.js +5 -1
- package/src/lib/utilities/has-operation-paramters.js.map +1 -1
- package/src/lib/utilities/has-operation-request-body.js +5 -1
- package/src/lib/utilities/has-operation-request-body.js.map +1 -1
- package/src/lib/utilities/http-request.js +7 -3
- package/src/lib/utilities/http-request.js.map +1 -1
- package/src/lib/utilities/ignore-operation.js +5 -1
- package/src/lib/utilities/ignore-operation.js.map +1 -1
- package/src/lib/utilities/is-collection-response.js +11 -7
- package/src/lib/utilities/is-collection-response.js.map +1 -1
- package/src/lib/utilities/is-http-method.js +5 -1
- package/src/lib/utilities/is-http-method.js.map +1 -1
- package/src/lib/utilities/is-open-api-schema-from-path.js +5 -1
- package/src/lib/utilities/is-open-api-schema-from-path.js.map +1 -1
- package/src/lib/utilities/is-operation-object.js +5 -1
- package/src/lib/utilities/is-operation-object.js.map +1 -1
- package/src/lib/utilities/is-reference-object.js +5 -1
- package/src/lib/utilities/is-reference-object.js.map +1 -1
- package/src/lib/utilities/is-without-parameters.js +5 -1
- package/src/lib/utilities/is-without-parameters.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,12 +3,9 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
# [13.0.0
|
|
6
|
+
# [13.0.0](https://gitlab.com/rxap/packages/compare/@rxap/schematics-open-api@13.0.0-next.4...@rxap/schematics-open-api@13.0.0) (2022-09-11)
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
### Bug Fixes
|
|
10
|
-
|
|
11
|
-
* support node16 module resolution ([f8975a1](https://gitlab.com/rxap/packages/commit/f8975a160b07276e72db3f6745c207ac4b4632f4))
|
|
8
|
+
**Note:** Version bump only for package @rxap/schematics-open-api
|
|
12
9
|
|
|
13
10
|
|
|
14
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxap/schematics-open-api",
|
|
3
|
-
"version": "13.0.0
|
|
3
|
+
"version": "13.0.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"tslib": "^2.3.1",
|
|
6
6
|
"semver": "^7.3.5"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@rxap/json-schema-to-typescript": "^13.0.0-next.1",
|
|
42
|
-
"@rxap/schematics-utilities": "^13.0.0
|
|
42
|
+
"@rxap/schematics-utilities": "^13.0.0",
|
|
43
43
|
"openapi-types": "^10.0.0",
|
|
44
44
|
"ts-morph": "^13.0.3"
|
|
45
45
|
},
|
package/src/index.js
CHANGED
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./lib/clear-operation"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./lib/config"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./lib/generate-components"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./lib/generate-operation"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./lib/generate-parameters"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./lib/generate-request-body"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./lib/generate-index-exports"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./lib/generate-response"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./lib/load-open-api-config"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./lib/types"), exports);
|
|
11
14
|
// region utilities
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
tslib_1.__exportStar(require("./lib/utilities/any-schema-object"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./lib/utilities/get-parameter-type"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./lib/utilities/get-reqeust-body"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./lib/utilities/get-request-body-type"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./lib/utilities/get-response"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./lib/utilities/get-response-type"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./lib/utilities/has-operation-paramters"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("./lib/utilities/has-operation-request-body"), exports);
|
|
23
|
+
tslib_1.__exportStar(require("./lib/utilities/http-request"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("./lib/utilities/ignore-operation"), exports);
|
|
25
|
+
tslib_1.__exportStar(require("./lib/utilities/is-collection-response"), exports);
|
|
26
|
+
tslib_1.__exportStar(require("./lib/utilities/is-http-method"), exports);
|
|
27
|
+
tslib_1.__exportStar(require("./lib/utilities/is-open-api-schema-from-path"), exports);
|
|
28
|
+
tslib_1.__exportStar(require("./lib/utilities/is-reference-object"), exports);
|
|
29
|
+
tslib_1.__exportStar(require("./lib/utilities/is-without-parameters"), exports);
|
|
30
|
+
tslib_1.__exportStar(require("./lib/utilities/is-operation-object"), exports);
|
|
28
31
|
// endregion
|
|
29
32
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/open-api/src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/open-api/src/index.ts"],"names":[],"mappings":";;;AAAA,gEAAsC;AACtC,uDAA6B;AAC7B,oEAA0C;AAC1C,mEAAyC;AACzC,oEAA0C;AAC1C,sEAA4C;AAC5C,uEAA6C;AAC7C,kEAAwC;AACxC,qEAA2C;AAC3C,sDAA4B;AAE5B,mBAAmB;AAEnB,4EAAkD;AAClD,6EAAmD;AACnD,2EAAiD;AACjD,gFAAsD;AACtD,uEAA6C;AAC7C,4EAAkD;AAClD,kFAAwD;AACxD,qFAA2D;AAC3D,uEAA6C;AAC7C,2EAAiD;AACjD,iFAAuD;AACvD,yEAA+C;AAC/C,uFAA6D;AAC7D,8EAAoD;AACpD,gFAAsD;AACtD,8EAAoD;AAEpD,YAAY"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClearOperation = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
function ClearOperation(pathList, basePath = '') {
|
|
3
6
|
return tree => {
|
|
4
7
|
console.debug(`clear operation for base path '${basePath}' with pathList '${pathList}'`);
|
|
5
8
|
for (const path of pathList) {
|
|
6
|
-
const fullPath = join(basePath, path);
|
|
9
|
+
const fullPath = path_1.join(basePath, path);
|
|
7
10
|
if (tree.exists(fullPath)) {
|
|
8
11
|
tree.delete(fullPath);
|
|
9
12
|
}
|
|
@@ -13,4 +16,5 @@ export function ClearOperation(pathList, basePath = '') {
|
|
|
13
16
|
}
|
|
14
17
|
};
|
|
15
18
|
}
|
|
19
|
+
exports.ClearOperation = ClearOperation;
|
|
16
20
|
//# sourceMappingURL=clear-operation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clear-operation.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/clear-operation.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"clear-operation.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/clear-operation.ts"],"names":[],"mappings":";;;AACA,+BAA4B;AAE5B,SAAgB,cAAc,CAC5B,QAAkB,EAClB,WAAmB,EAAE;IAErB,OAAO,IAAI,CAAC,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC,kCAAkC,QAAQ,oBAAoB,QAAQ,GAAG,CAAC,CAAC;QACzF,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE;YAC3B,MAAM,QAAQ,GAAG,WAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YACtC,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;gBACzB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;aACvB;iBAAM;gBACL,OAAO,CAAC,KAAK,CAAC,SAAS,QAAQ,oBAAoB,CAAC,CAAC;aACtD;SACF;IACH,CAAC,CAAC;AACJ,CAAC;AAfD,wCAeC"}
|
package/src/lib/config.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.REQUEST_BODY_BASE_PATH = exports.REQUEST_BODY_FILE_SUFFIX = exports.RESPONSE_FILE_SUFFIX = exports.RESPONSE_BASE_PATH = exports.PARAMETER_FILE_SUFFIX = exports.PARAMETER_BASE_PATH = exports.COMPONENTS_BASE_PATH = void 0;
|
|
4
|
+
exports.COMPONENTS_BASE_PATH = 'components';
|
|
5
|
+
exports.PARAMETER_BASE_PATH = 'parameters';
|
|
6
|
+
exports.PARAMETER_FILE_SUFFIX = 'parameter';
|
|
7
|
+
exports.RESPONSE_BASE_PATH = 'responses';
|
|
8
|
+
exports.RESPONSE_FILE_SUFFIX = 'response';
|
|
9
|
+
exports.REQUEST_BODY_FILE_SUFFIX = 'request-body';
|
|
10
|
+
exports.REQUEST_BODY_BASE_PATH = 'request-bodies';
|
|
8
11
|
//# sourceMappingURL=config.js.map
|
package/src/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/config.ts"],"names":[],"mappings":";;;AAAa,QAAA,oBAAoB,GAAG,YAAY,CAAC;AAEpC,QAAA,mBAAmB,GAAK,YAAY,CAAC;AACrC,QAAA,qBAAqB,GAAG,WAAW,CAAC;AAEpC,QAAA,kBAAkB,GAAK,WAAW,CAAC;AACnC,QAAA,oBAAoB,GAAG,UAAU,CAAC;AAElC,QAAA,wBAAwB,GAAG,cAAc,CAAC;AAC1C,QAAA,sBAAsB,GAAK,gBAAgB,CAAC"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenerateComponents = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const json_schema_to_typescript_1 = require("@rxap/json-schema-to-typescript");
|
|
6
|
+
const config_1 = require("./config");
|
|
7
|
+
function GenerateComponents(components, project) {
|
|
8
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
6
9
|
if (components.schemas) {
|
|
7
10
|
for (const [name, schema] of Object.entries(components.schemas)) {
|
|
8
|
-
const generator = new TypescriptInterfaceGenerator(Object.assign(Object.assign({}, schema), { components }), { basePath: COMPONENTS_BASE_PATH }, project);
|
|
11
|
+
const generator = new json_schema_to_typescript_1.TypescriptInterfaceGenerator(Object.assign(Object.assign({}, schema), { components }), { basePath: config_1.COMPONENTS_BASE_PATH }, project);
|
|
9
12
|
console.debug(`Generate component interface for: ${name}`);
|
|
10
13
|
try {
|
|
11
14
|
yield generator.build(name);
|
|
@@ -17,4 +20,5 @@ export function GenerateComponents(components, project) {
|
|
|
17
20
|
}
|
|
18
21
|
});
|
|
19
22
|
}
|
|
23
|
+
exports.GenerateComponents = GenerateComponents;
|
|
20
24
|
//# sourceMappingURL=generate-components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-components.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/generate-components.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-components.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/generate-components.ts"],"names":[],"mappings":";;;;AAEA,+EAA+E;AAC/E,qCAAgD;AAEhD,SAAsB,kBAAkB,CACtC,UAAsC,EACtC,OAAgB;;QAGhB,IAAI,UAAU,CAAC,OAAO,EAAE;YACtB,KAAK,MAAM,CAAE,IAAI,EAAE,MAAM,CAAE,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;gBAEjE,MAAM,SAAS,GAAG,IAAI,wDAA4B,iCAC3C,MAAM,KAAE,UAAU,KACvB,EAAE,QAAQ,EAAE,6BAAoB,EAAE,EAClC,OAAO,CACR,CAAC;gBAEF,OAAO,CAAC,KAAK,CAAC,qCAAqC,IAAI,EAAE,CAAC,CAAC;gBAE3D,IAAI;oBAEF,MAAM,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;iBAE7B;gBAAC,OAAO,KAAK,EAAE;oBACd,OAAO,CAAC,KAAK,CAAC,8CAA8C,IAAI,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;iBACpF;aAEF;SACF;IAEH,CAAC;CAAA;AA3BD,gDA2BC"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenerateIndexExports = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
function GenerateIndexExports(project) {
|
|
3
6
|
const exports = [];
|
|
4
7
|
for (let sourceFile of project.getSourceFiles()) {
|
|
5
8
|
sourceFile.getDirectoryPath();
|
|
6
|
-
exports.push(`export * from '.${join('/lib', sourceFile.getDirectoryPath(), sourceFile.getBaseNameWithoutExtension())}';`);
|
|
9
|
+
exports.push(`export * from '.${path_1.join('/lib', sourceFile.getDirectoryPath(), sourceFile.getBaseNameWithoutExtension())}';`);
|
|
7
10
|
}
|
|
8
11
|
return exports.join('\n');
|
|
9
12
|
}
|
|
13
|
+
exports.GenerateIndexExports = GenerateIndexExports;
|
|
10
14
|
//# sourceMappingURL=generate-index-exports.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-index-exports.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/generate-index-exports.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"generate-index-exports.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/generate-index-exports.ts"],"names":[],"mappings":";;;AACA,+BAA4B;AAE5B,SAAgB,oBAAoB,CAAC,OAAgB;IAEnD,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,KAAK,IAAI,UAAU,IAAI,OAAO,CAAC,cAAc,EAAE,EAAE;QAE/C,UAAU,CAAC,gBAAgB,EAAE,CAAC;QAE9B,OAAO,CAAC,IAAI,CAAC,mBAAmB,WAAI,CAAC,MAAM,EAAE,UAAU,CAAC,gBAAgB,EAAE,EAAE,UAAU,CAAC,2BAA2B,EAAE,CAAC,IAAI,CAAC,CAAC;KAE5H;IAED,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAE5B,CAAC;AAdD,oDAcC"}
|
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenerateOperation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const is_http_method_1 = require("./utilities/is-http-method");
|
|
6
|
+
const ignore_operation_1 = require("./utilities/ignore-operation");
|
|
7
|
+
const is_operation_object_1 = require("./utilities/is-operation-object");
|
|
8
|
+
const types_1 = require("./types");
|
|
9
|
+
const generate_parameters_1 = require("./generate-parameters");
|
|
10
|
+
const generate_request_body_1 = require("./generate-request-body");
|
|
11
|
+
const generate_response_1 = require("./generate-response");
|
|
12
|
+
const generate_components_1 = require("./generate-components");
|
|
13
|
+
function GenerateOperation(openapi, project, options, generatorFunctionList) {
|
|
11
14
|
var _a, _b;
|
|
12
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
13
16
|
const components = (_b = (_a = openapi.components) !== null && _a !== void 0 ? _a : openapi.definitions) !== null && _b !== void 0 ? _b : {};
|
|
14
|
-
yield GenerateComponents(components, project);
|
|
17
|
+
yield generate_components_1.GenerateComponents(components, project);
|
|
15
18
|
for (const [path, methods] of Object.entries(openapi.paths)) {
|
|
16
19
|
if (methods) {
|
|
17
|
-
for (const method of Object.keys(methods).filter(IsHttpMethod)) {
|
|
20
|
+
for (const method of Object.keys(methods).filter(is_http_method_1.IsHttpMethod)) {
|
|
18
21
|
const operation = methods[method];
|
|
19
|
-
if (IsOperationObject(operation)) {
|
|
20
|
-
if (IgnoreOperation(['hidden'])(operation)) {
|
|
22
|
+
if (is_operation_object_1.IsOperationObject(operation)) {
|
|
23
|
+
if (ignore_operation_1.IgnoreOperation(['hidden'])(operation)) {
|
|
21
24
|
console.log(`Ignore operation '${operation.operationId}'`);
|
|
22
25
|
}
|
|
23
26
|
else {
|
|
24
|
-
if (HasOperationId(operation)) {
|
|
25
|
-
yield GenerateParameters(operation, project, components);
|
|
26
|
-
yield GenerateRequestBody(operation, project, components);
|
|
27
|
-
yield GenerateResponse(operation, project, components);
|
|
27
|
+
if (types_1.HasOperationId(operation)) {
|
|
28
|
+
yield generate_parameters_1.GenerateParameters(operation, project, components);
|
|
29
|
+
yield generate_request_body_1.GenerateRequestBody(operation, project, components);
|
|
30
|
+
yield generate_response_1.GenerateResponse(operation, project, components);
|
|
28
31
|
for (const generatorFunction of generatorFunctionList) {
|
|
29
32
|
try {
|
|
30
33
|
const parameters = Object.assign(Object.assign({}, operation), { components,
|
|
@@ -49,4 +52,5 @@ export function GenerateOperation(openapi, project, options, generatorFunctionLi
|
|
|
49
52
|
}
|
|
50
53
|
});
|
|
51
54
|
}
|
|
55
|
+
exports.GenerateOperation = GenerateOperation;
|
|
52
56
|
//# sourceMappingURL=generate-operation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-operation.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/generate-operation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-operation.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/generate-operation.ts"],"names":[],"mappings":";;;;AACA,+DAA0D;AAC1D,mEAA+D;AAC/D,yEAAoE;AAEpE,mCAKiB;AACjB,+DAA2D;AAC3D,mEAA8D;AAC9D,2DAAuD;AACvD,+DAA2D;AAE3D,SAAsB,iBAAiB,CACrC,OAA2B,EAC3B,OAAgB,EAChB,OAAgB,EAChB,qBAAmD;;;QAEnD,MAAM,UAAU,GAA+B,MAAA,MAAC,OAAe,CAAC,UAAU,mCAAK,OAAe,CAAC,WAAW,mCAAI,EAAE,CAAC;QAEjH,MAAM,wCAAkB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAE9C,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YAE3D,IAAI,OAAO,EAAE;gBAEX,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,6BAAY,CAAC,EAAE;oBAE9D,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;oBAElC,IAAI,uCAAiB,CAAC,SAAS,CAAC,EAAE;wBAEhC,IAAI,kCAAe,CAAC,CAAE,QAAQ,CAAE,CAAC,CAAC,SAAS,CAAC,EAAE;4BAE5C,OAAO,CAAC,GAAG,CAAC,qBAAqB,SAAS,CAAC,WAAW,GAAG,CAAC,CAAC;yBAE5D;6BAAM;4BAEL,IAAI,sBAAc,CAAC,SAAS,CAAC,EAAE;gCAE7B,MAAM,wCAAkB,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;gCACzD,MAAM,2CAAmB,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;gCAC1D,MAAM,oCAAgB,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;gCAEvD,KAAK,MAAM,iBAAiB,IAAI,qBAAqB,EAAE;oCAErD,IAAI;wCACF,MAAM,UAAU,mCACX,SAAS,KACZ,UAAU;4CACV,MAAM;4CACN,IAAI;4CACJ,OAAO;4CACP,OAAO,GACR,CAAA;wCACD,MAAM,iBAAiB,CAAC,UAAU,CAAC,CAAC;qCACrC;oCAAC,OAAO,CAAC,EAAE;wCACV,OAAO,CAAC,KAAK,CAAC,uBAAuB,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,IAAI,oBAAoB,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC;qCAC1G;iCAEF;6BAEF;iCAAM;gCACL,OAAO,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;6BAC3D;yBAEF;qBAEF;iBAEF;aAEF;SAEF;;CACF;AA/DD,8CA+DC"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenerateParameters = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const is_reference_object_1 = require("./utilities/is-reference-object");
|
|
6
|
+
const config_1 = require("./config");
|
|
7
|
+
const json_schema_to_typescript_1 = require("@rxap/json-schema-to-typescript");
|
|
8
|
+
function GenerateParameters(operation, project, components) {
|
|
6
9
|
var _a;
|
|
7
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
10
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
8
11
|
if (operation.parameters && operation.parameters.length && operation.operationId) {
|
|
9
12
|
const operationId = operation.operationId;
|
|
10
13
|
const properties = {};
|
|
11
14
|
const required = [];
|
|
12
|
-
const parameters = operation.parameters.filter(param => !IsReferenceObject(param) && param.in !== 'header');
|
|
13
|
-
for (const parameter of operation.parameters.filter(param => IsReferenceObject(param))) {
|
|
14
|
-
if (IsReferenceObject(parameter)) {
|
|
15
|
+
const parameters = operation.parameters.filter(param => !is_reference_object_1.IsReferenceObject(param) && param.in !== 'header');
|
|
16
|
+
for (const parameter of operation.parameters.filter(param => is_reference_object_1.IsReferenceObject(param))) {
|
|
17
|
+
if (is_reference_object_1.IsReferenceObject(parameter)) {
|
|
15
18
|
const ref = parameter.$ref;
|
|
16
19
|
const segments = ref.split('/');
|
|
17
20
|
const hashTag = segments.shift();
|
|
@@ -34,11 +37,11 @@ export function GenerateParameters(operation, project, components) {
|
|
|
34
37
|
parameters.push(component[name]);
|
|
35
38
|
}
|
|
36
39
|
}
|
|
37
|
-
if (parameters.some(parameter => IsReferenceObject(parameter))) {
|
|
40
|
+
if (parameters.some(parameter => is_reference_object_1.IsReferenceObject(parameter))) {
|
|
38
41
|
throw new Error('Reference object are not supported in the parameter definition!');
|
|
39
42
|
}
|
|
40
43
|
for (const parameter of parameters) {
|
|
41
|
-
if (IsReferenceObject(parameter)) {
|
|
44
|
+
if (is_reference_object_1.IsReferenceObject(parameter)) {
|
|
42
45
|
throw new Error('FATAL: Reference object are not supported in the parameter definition!');
|
|
43
46
|
}
|
|
44
47
|
properties[parameter.name] = (_a = parameter.schema) !== null && _a !== void 0 ? _a : { type: 'any' };
|
|
@@ -51,7 +54,7 @@ export function GenerateParameters(operation, project, components) {
|
|
|
51
54
|
properties: properties,
|
|
52
55
|
required
|
|
53
56
|
};
|
|
54
|
-
const generator = new TypescriptInterfaceGenerator(Object.assign(Object.assign({}, parametersSchema), { components }), { suffix: PARAMETER_FILE_SUFFIX, basePath: PARAMETER_BASE_PATH }, project);
|
|
57
|
+
const generator = new json_schema_to_typescript_1.TypescriptInterfaceGenerator(Object.assign(Object.assign({}, parametersSchema), { components }), { suffix: config_1.PARAMETER_FILE_SUFFIX, basePath: config_1.PARAMETER_BASE_PATH }, project);
|
|
55
58
|
console.debug(`Generate parameter interface for: ${operationId}`);
|
|
56
59
|
try {
|
|
57
60
|
yield generator.build(operationId);
|
|
@@ -62,4 +65,5 @@ export function GenerateParameters(operation, project, components) {
|
|
|
62
65
|
}
|
|
63
66
|
});
|
|
64
67
|
}
|
|
68
|
+
exports.GenerateParameters = GenerateParameters;
|
|
65
69
|
//# sourceMappingURL=generate-parameters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-parameters.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/generate-parameters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-parameters.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/generate-parameters.ts"],"names":[],"mappings":";;;;AAAA,yEAAoE;AACpE,qCAAsE;AAEtE,+EAA+E;AAI/E,SAAsB,kBAAkB,CACtC,SAAoC,EACpC,OAAgB,EAChB,UAAsC;;;QAGtC,IAAI,SAAS,CAAC,UAAU,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,IAAI,SAAS,CAAC,WAAW,EAAE;YAEhF,MAAM,WAAW,GAAG,SAAS,CAAC,WAAW,CAAC;YAE1C,MAAM,UAAU,GAAyF,EAAE,CAAC;YAC5G,MAAM,QAAQ,GAA2F,EAAE,CAAC;YAE5G,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,uCAAiB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC;YAE5G,KAAK,MAAM,SAAS,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,uCAAiB,CAAC,KAAK,CAAC,CAAC,EAAE;gBACtF,IAAI,uCAAiB,CAAC,SAAS,CAAC,EAAE;oBAChC,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC;oBAC3B,MAAM,QAAQ,GAAa,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;oBAC1C,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC;oBACjC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC;oBAC3C,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC;oBAC/B,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC;oBAC9B,IAAI,OAAO,KAAK,GAAG,EAAE;wBACnB,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,GAAG,CAAC,CAAC;qBAChD;oBACD,IAAI,iBAAiB,KAAK,YAAY,EAAE;wBACtC,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,GAAG,CAAC,CAAC;qBAChD;oBACD,IAAI,CAAC,KAAK,IAAI,CAAE,UAAkB,CAAC,KAAK,CAAC,EAAE;wBACzC,MAAM,IAAI,KAAK,CAAC,UAAU,KAAK,uDAAuD,GAAG,EAAE,CAAC,CAAC;qBAC9F;oBACD,MAAM,SAAS,GAAI,UAAkB,CAAC,KAAK,CAAC,CAAC;oBAC7C,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;wBAC7B,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,eAAe,KAAK,cAAc,GAAG,EAAE,CAAC,CAAC;qBACjF;oBACD,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;iBAClC;aACF;YAED,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,uCAAiB,CAAC,SAAS,CAAC,CAAC,EAAE;gBAC9D,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;aACpF;YAED,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;gBAElC,IAAI,uCAAiB,CAAC,SAAS,CAAC,EAAE;oBAChC,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;iBAC3F;gBAED,UAAU,CAAE,SAAS,CAAC,IAAI,CAAE,GAAG,MAAA,SAAS,CAAC,MAAM,mCAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;gBAEnE,IAAI,SAAS,CAAC,QAAQ,EAAE;oBACtB,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;iBAC/B;aAEF;YAED,MAAM,gBAAgB,GAA2B;gBAC/C,IAAI,EAAQ,QAAQ;gBACpB,UAAU,EAAE,UAAiB;gBAC7B,QAAQ;aACT,CAAC;YAEF,MAAM,SAAS,GAAG,IAAI,wDAA4B,iCAC3C,gBAAgB,KAAE,UAAU,KACjC,EAAE,MAAM,EAAE,8BAAqB,EAAE,QAAQ,EAAE,4BAAmB,EAAE,EAChE,OAAO,CACR,CAAC;YAEF,OAAO,CAAC,KAAK,CAAC,qCAAqC,WAAW,EAAE,CAAC,CAAC;YAElE,IAAI;gBAEF,MAAM,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;aAEpC;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,CAAC,KAAK,CAAC,+CAA+C,WAAW,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;aAC5F;SAEF;;CAEF;AAlFD,gDAkFC"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenerateRequestBody = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const json_schema_to_typescript_1 = require("@rxap/json-schema-to-typescript");
|
|
6
|
+
const any_schema_object_1 = require("./utilities/any-schema-object");
|
|
7
|
+
const config_1 = require("./config");
|
|
8
|
+
const get_reqeust_body_1 = require("./utilities/get-reqeust-body");
|
|
9
|
+
function GenerateRequestBody(operation, project, components) {
|
|
10
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
+
const requestBodySchema = get_reqeust_body_1.GetRequestBody(operation);
|
|
12
|
+
if (!any_schema_object_1.IsAnySchemaObject(requestBodySchema) && operation.operationId) {
|
|
10
13
|
const operationId = operation.operationId;
|
|
11
|
-
const generator = new TypescriptInterfaceGenerator(Object.assign(Object.assign({}, requestBodySchema), { components }), { suffix: REQUEST_BODY_FILE_SUFFIX, basePath: REQUEST_BODY_BASE_PATH }, project);
|
|
14
|
+
const generator = new json_schema_to_typescript_1.TypescriptInterfaceGenerator(Object.assign(Object.assign({}, requestBodySchema), { components }), { suffix: config_1.REQUEST_BODY_FILE_SUFFIX, basePath: config_1.REQUEST_BODY_BASE_PATH }, project);
|
|
12
15
|
console.debug(`Generate request body interface for: ${operationId}`);
|
|
13
16
|
try {
|
|
14
17
|
yield generator.build(operationId);
|
|
@@ -19,4 +22,5 @@ export function GenerateRequestBody(operation, project, components) {
|
|
|
19
22
|
}
|
|
20
23
|
});
|
|
21
24
|
}
|
|
25
|
+
exports.GenerateRequestBody = GenerateRequestBody;
|
|
22
26
|
//# sourceMappingURL=generate-request-body.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-request-body.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/generate-request-body.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-request-body.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/generate-request-body.ts"],"names":[],"mappings":";;;;AACA,+EAA+E;AAC/E,qEAAkE;AAClE,qCAA4E;AAE5E,mEAA8D;AAE9D,SAAsB,mBAAmB,CACvC,SAAoC,EACpC,OAAgB,EAChB,UAAsC;;QAGtC,MAAM,iBAAiB,GAAG,iCAAc,CAAC,SAAS,CAAC,CAAC;QAEpD,IAAI,CAAC,qCAAiB,CAAC,iBAAiB,CAAC,IAAI,SAAS,CAAC,WAAW,EAAE;YAClE,MAAM,WAAW,GAAG,SAAS,CAAC,WAAW,CAAC;YAE1C,MAAM,SAAS,GAAG,IAAI,wDAA4B,iCAC3C,iBAAiB,KAAE,UAAU,KAClC,EAAE,MAAM,EAAE,iCAAwB,EAAE,QAAQ,EAAE,+BAAsB,EAAE,EACtE,OAAO,CACR,CAAC;YAEF,OAAO,CAAC,KAAK,CAAC,wCAAwC,WAAW,EAAE,CAAC,CAAC;YAErE,IAAI;gBAEF,MAAM,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;aAEpC;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,CAAC,KAAK,CAAC,kDAAkD,WAAW,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;aAC/F;SAEF;IAEH,CAAC;CAAA;AA7BD,kDA6BC"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenerateResponse = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const json_schema_to_typescript_1 = require("@rxap/json-schema-to-typescript");
|
|
6
|
+
const config_1 = require("./config");
|
|
7
|
+
const any_schema_object_1 = require("./utilities/any-schema-object");
|
|
8
|
+
const get_response_1 = require("./utilities/get-response");
|
|
9
|
+
function GenerateResponse(operation, project, components) {
|
|
10
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
+
const response = get_response_1.GetResponse(operation);
|
|
12
|
+
if (!any_schema_object_1.IsAnySchemaObject(response) && operation.operationId) {
|
|
10
13
|
const operationId = operation.operationId;
|
|
11
|
-
const generator = new TypescriptInterfaceGenerator(Object.assign(Object.assign({}, response), { components }), { suffix: RESPONSE_FILE_SUFFIX, basePath: RESPONSE_BASE_PATH }, project);
|
|
14
|
+
const generator = new json_schema_to_typescript_1.TypescriptInterfaceGenerator(Object.assign(Object.assign({}, response), { components }), { suffix: config_1.RESPONSE_FILE_SUFFIX, basePath: config_1.RESPONSE_BASE_PATH }, project);
|
|
12
15
|
console.debug(`Generate response interface for: ${operationId}`);
|
|
13
16
|
try {
|
|
14
17
|
yield generator.build(operationId);
|
|
@@ -19,4 +22,5 @@ export function GenerateResponse(operation, project, components) {
|
|
|
19
22
|
}
|
|
20
23
|
});
|
|
21
24
|
}
|
|
25
|
+
exports.GenerateResponse = GenerateResponse;
|
|
22
26
|
//# sourceMappingURL=generate-response.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-response.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/generate-response.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-response.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/generate-response.ts"],"names":[],"mappings":";;;;AACA,+EAA+E;AAE/E,qCAAoE;AACpE,qEAAkE;AAClE,2DAAuD;AAEvD,SAAsB,gBAAgB,CACpC,SAAoC,EACpC,OAAgB,EAChB,UAAsC;;QAGtC,MAAM,QAAQ,GAAG,0BAAW,CAAC,SAAS,CAAC,CAAC;QAExC,IAAI,CAAC,qCAAiB,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC,WAAW,EAAE;YACzD,MAAM,WAAW,GAAG,SAAS,CAAC,WAAW,CAAC;YAE1C,MAAM,SAAS,GAAG,IAAI,wDAA4B,iCAC3C,QAAQ,KAAE,UAAU,KACzB,EAAE,MAAM,EAAE,6BAAoB,EAAE,QAAQ,EAAE,2BAAkB,EAAE,EAC9D,OAAO,CACR,CAAC;YAEF,OAAO,CAAC,KAAK,CAAC,oCAAoC,WAAW,EAAE,CAAC,CAAC;YAEjE,IAAI;gBAEF,MAAM,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;aAEpC;YAAC,OAAO,KAAK,EAAE;gBACd,OAAO,CAAC,KAAK,CAAC,8CAA8C,WAAW,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;aAC3F;SAEF;IAEH,CAAC;CAAA;AA7BD,4CA6BC"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoadOpenApiConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const is_open_api_schema_from_path_1 = require("./utilities/is-open-api-schema-from-path");
|
|
6
|
+
const http_request_1 = require("./utilities/http-request");
|
|
7
|
+
function LoadOpenApiConfig(host, options) {
|
|
8
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
6
9
|
let openapi;
|
|
7
|
-
if (IsOpenApiSchemaFromPath(options)) {
|
|
10
|
+
if (is_open_api_schema_from_path_1.IsOpenApiSchemaFromPath(options)) {
|
|
8
11
|
if (!host.exists(options.path)) {
|
|
9
12
|
throw new Error('Could not find openapi file.');
|
|
10
13
|
}
|
|
11
14
|
openapi = JSON.parse(host.read(options.path).toString('utf-8'));
|
|
12
15
|
}
|
|
13
16
|
else if (options.url) {
|
|
14
|
-
openapi = yield HttpRequest(options.url);
|
|
17
|
+
openapi = yield http_request_1.HttpRequest(options.url);
|
|
15
18
|
}
|
|
16
19
|
else {
|
|
17
20
|
throw new Error('Either the path or url must be defined');
|
|
@@ -19,4 +22,5 @@ export function LoadOpenApiConfig(host, options) {
|
|
|
19
22
|
return openapi;
|
|
20
23
|
});
|
|
21
24
|
}
|
|
25
|
+
exports.LoadOpenApiConfig = LoadOpenApiConfig;
|
|
22
26
|
//# sourceMappingURL=load-open-api-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-open-api-config.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/load-open-api-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"load-open-api-config.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/load-open-api-config.ts"],"names":[],"mappings":";;;;AAAA,2FAAmF;AACnF,2DAAuD;AAKvD,SAAsB,iBAAiB,CAAC,IAAU,EAAE,OAAsB;;QACxE,IAAI,OAA2B,CAAC;QAChC,IAAI,sDAAuB,CAAC,OAAO,CAAC,EAAE;YAEpC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBAC9B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;aACjD;YAED,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;SAElE;aAAM,IAAI,OAAO,CAAC,GAAG,EAAE;YAEtB,OAAO,GAAG,MAAM,0BAAW,CAAqB,OAAO,CAAC,GAAG,CAAC,CAAC;SAE9D;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;SAC3D;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CAAA;AAlBD,8CAkBC"}
|
package/src/lib/types.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AssertWithOperationId = exports.HasOperationId = exports.GenerateParameterToOperationObjectWithMetadata = void 0;
|
|
4
|
+
function GenerateParameterToOperationObjectWithMetadata(parameter) {
|
|
2
5
|
const blacklist = ['project', 'options', 'components'];
|
|
3
6
|
const copy = {};
|
|
4
7
|
for (const key of Object.keys(parameter).filter(k => !blacklist.includes(k))) {
|
|
@@ -6,12 +9,15 @@ export function GenerateParameterToOperationObjectWithMetadata(parameter) {
|
|
|
6
9
|
}
|
|
7
10
|
return copy;
|
|
8
11
|
}
|
|
9
|
-
|
|
12
|
+
exports.GenerateParameterToOperationObjectWithMetadata = GenerateParameterToOperationObjectWithMetadata;
|
|
13
|
+
function HasOperationId(operation) {
|
|
10
14
|
return !!operation.operationId;
|
|
11
15
|
}
|
|
12
|
-
|
|
16
|
+
exports.HasOperationId = HasOperationId;
|
|
17
|
+
function AssertWithOperationId(operation) {
|
|
13
18
|
if (!HasOperationId(operation)) {
|
|
14
19
|
throw new Error('Ensure all operation have a operation id.');
|
|
15
20
|
}
|
|
16
21
|
}
|
|
22
|
+
exports.AssertWithOperationId = AssertWithOperationId;
|
|
17
23
|
//# sourceMappingURL=types.js.map
|
package/src/lib/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/types.ts"],"names":[],"mappings":"AAkBA,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../libs/open-api/src/lib/types.ts"],"names":[],"mappings":";;;AAkBA,SAAgB,8CAA8C,CAAC,SAA4B;IACzF,MAAM,SAAS,GAAG,CAAC,SAAS,EAAC,SAAS,EAAC,YAAY,CAAC,CAAC;IACrD,MAAM,IAAI,GAAQ,EAAE,CAAC;IACrB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE;QAC5E,IAAI,CAAC,GAAG,CAAC,GAAI,SAAiB,CAAC,GAAG,CAAC,CAAC;KACrC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAPD,wGAOC;AAED,SAAgB,cAAc,CAAC,SAAoC;IACjE,OAAO,CAAC,CAAC,SAAS,CAAC,WAAW,CAAA;AAChC,CAAC;AAFD,wCAEC;AAED,SAAgB,qBAAqB,CAAC,SAAoC;IACxE,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE;QAC9B,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAA;KAC7D;AACH,CAAC;AAJD,sDAIC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IsAnySchemaObject = void 0;
|
|
4
|
+
function IsAnySchemaObject(obj) {
|
|
2
5
|
return obj && obj.hasOwnProperty('type') && obj.type === 'any';
|
|
3
6
|
}
|
|
7
|
+
exports.IsAnySchemaObject = IsAnySchemaObject;
|
|
4
8
|
//# sourceMappingURL=any-schema-object.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"any-schema-object.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/any-schema-object.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"any-schema-object.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/any-schema-object.ts"],"names":[],"mappings":";;;AAIA,SAAgB,iBAAiB,CAAC,GAAQ;IACxC,OAAO,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC;AACjE,CAAC;AAFD,8CAEC"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetParameterType = void 0;
|
|
4
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
5
|
+
const config_1 = require("../config");
|
|
6
|
+
function GetParameterType(operation) {
|
|
4
7
|
let parameterType = 'void';
|
|
5
8
|
if (operation.parameters && operation.parameters.length && operation.operationId) {
|
|
6
|
-
parameterType = classify([operation.operationId, PARAMETER_FILE_SUFFIX].join('-'));
|
|
9
|
+
parameterType = schematics_utilities_1.classify([operation.operationId, config_1.PARAMETER_FILE_SUFFIX].join('-'));
|
|
7
10
|
}
|
|
8
11
|
return parameterType;
|
|
9
12
|
}
|
|
13
|
+
exports.GetParameterType = GetParameterType;
|
|
10
14
|
//# sourceMappingURL=get-parameter-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-parameter-type.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/get-parameter-type.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"get-parameter-type.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/get-parameter-type.ts"],"names":[],"mappings":";;;AACA,qEAAsD;AAEtD,sCAAkD;AAGlD,SAAgB,gBAAgB,CAAC,SAAoC;IAEnE,IAAI,aAAa,GAAG,MAAM,CAAC;IAE3B,IAAI,SAAS,CAAC,UAAU,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,IAAI,SAAS,CAAC,WAAW,EAAE;QAChF,aAAa,GAAG,+BAAQ,CAAC,CAAE,SAAS,CAAC,WAAW,EAAE,8BAAqB,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;KACtF;IAED,OAAO,aAAa,CAAC;AAEvB,CAAC;AAVD,4CAUC"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetRequestBody = void 0;
|
|
4
|
+
const is_reference_object_1 = require("./is-reference-object");
|
|
5
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
6
|
+
function GetRequestBody(operation) {
|
|
4
7
|
if (operation.requestBody) {
|
|
5
|
-
if (IsReferenceObject(operation.requestBody)) {
|
|
8
|
+
if (is_reference_object_1.IsReferenceObject(operation.requestBody)) {
|
|
6
9
|
throw new Error('Reference object are not supported in operation requestBody!');
|
|
7
10
|
}
|
|
8
11
|
const requestBodies = operation.requestBody.content;
|
|
9
|
-
if (IsRecord(requestBodies)) {
|
|
10
|
-
if (IsReferenceObject(requestBodies)) {
|
|
12
|
+
if (schematics_utilities_1.IsRecord(requestBodies)) {
|
|
13
|
+
if (is_reference_object_1.IsReferenceObject(requestBodies)) {
|
|
11
14
|
console.warn('Reference object are not supported in operation requestBody!');
|
|
12
15
|
}
|
|
13
16
|
else {
|
|
@@ -22,4 +25,5 @@ export function GetRequestBody(operation) {
|
|
|
22
25
|
}
|
|
23
26
|
return null;
|
|
24
27
|
}
|
|
28
|
+
exports.GetRequestBody = GetRequestBody;
|
|
25
29
|
//# sourceMappingURL=get-reqeust-body.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-reqeust-body.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/get-reqeust-body.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"get-reqeust-body.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/get-reqeust-body.ts"],"names":[],"mappings":";;;AAEA,+DAA0D;AAC1D,qEAAsD;AAEtD,SAAgB,cAAc,CAAC,SAAoC;IAEjE,IAAI,SAAS,CAAC,WAAW,EAAE;QAEzB,IAAI,uCAAiB,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE;YAC5C,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;SACjF;QAED,MAAM,aAAa,GAA0D,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC;QAE3G,IAAI,+BAAQ,CAAC,aAAa,CAAC,EAAE;YAE3B,IAAI,uCAAiB,CAAC,aAAa,CAAC,EAAE;gBACpC,OAAO,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;aAC9E;iBAAM;gBACL,IAAI,aAAa,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE;oBACpD,MAAM,MAAM,GAAG,aAAa,CAAE,kBAAkB,CAAE,CAAC,MAAM,CAAC;oBAC1D,IAAI,MAAM,EAAE;wBACV,OAAO,MAAM,CAAC;qBACf;iBACF;aACF;SAEF;KAEF;IAED,OAAO,IAAI,CAAC;AAEd,CAAC;AA7BD,wCA6BC"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetRequestBodyType = void 0;
|
|
4
|
+
const get_reqeust_body_1 = require("./get-reqeust-body");
|
|
5
|
+
const any_schema_object_1 = require("./any-schema-object");
|
|
6
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
7
|
+
const config_1 = require("../config");
|
|
8
|
+
function GetRequestBodyType(operation) {
|
|
6
9
|
let requestBodyType = 'void';
|
|
7
10
|
if (operation.operationId) {
|
|
8
|
-
const requestBody = GetRequestBody(operation);
|
|
11
|
+
const requestBody = get_reqeust_body_1.GetRequestBody(operation);
|
|
9
12
|
if (requestBody === null) {
|
|
10
13
|
requestBodyType = 'void';
|
|
11
14
|
}
|
|
12
|
-
else if (!IsAnySchemaObject(requestBody)) {
|
|
13
|
-
requestBodyType = classify([operation.operationId, REQUEST_BODY_FILE_SUFFIX].join('-'));
|
|
15
|
+
else if (!any_schema_object_1.IsAnySchemaObject(requestBody)) {
|
|
16
|
+
requestBodyType = schematics_utilities_1.classify([operation.operationId, config_1.REQUEST_BODY_FILE_SUFFIX].join('-'));
|
|
14
17
|
}
|
|
15
18
|
else {
|
|
16
19
|
requestBodyType = 'any';
|
|
@@ -18,4 +21,5 @@ export function GetRequestBodyType(operation) {
|
|
|
18
21
|
}
|
|
19
22
|
return requestBodyType;
|
|
20
23
|
}
|
|
24
|
+
exports.GetRequestBodyType = GetRequestBodyType;
|
|
21
25
|
//# sourceMappingURL=get-request-body-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-request-body-type.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/get-request-body-type.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"get-request-body-type.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/get-request-body-type.ts"],"names":[],"mappings":";;;AAAA,yDAAoD;AACpD,2DAAwD;AACxD,qEAAsD;AACtD,sCAAqD;AAGrD,SAAgB,kBAAkB,CAAC,SAAiC;IAElE,IAAI,eAAe,GAAG,MAAM,CAAC;IAE7B,IAAI,SAAS,CAAC,WAAW,EAAE;QAEzB,MAAM,WAAW,GAAG,iCAAc,CAAC,SAAS,CAAC,CAAC;QAE9C,IAAI,WAAW,KAAK,IAAI,EAAE;YACxB,eAAe,GAAG,MAAM,CAAC;SAC1B;aAAM,IAAI,CAAC,qCAAiB,CAAC,WAAW,CAAC,EAAE;YAC1C,eAAe,GAAG,+BAAQ,CAAC,CAAE,SAAS,CAAC,WAAW,EAAE,iCAAwB,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;SAC3F;aAAM;YACL,eAAe,GAAG,KAAK,CAAC;SACzB;KAEF;IAED,OAAO,eAAe,CAAC;AAEzB,CAAC;AApBD,gDAoBC"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetResponseType = void 0;
|
|
4
|
+
const config_1 = require("../config");
|
|
5
|
+
const any_schema_object_1 = require("./any-schema-object");
|
|
6
|
+
const get_response_1 = require("./get-response");
|
|
7
|
+
const schematics_utilities_1 = require("@rxap/schematics-utilities");
|
|
8
|
+
function GetResponseType(operation) {
|
|
6
9
|
let responseType = 'any';
|
|
7
10
|
if (operation.operationId) {
|
|
8
|
-
const response = GetResponse(operation);
|
|
11
|
+
const response = get_response_1.GetResponse(operation);
|
|
9
12
|
// only generate the response interface if the type is not any
|
|
10
|
-
if (!IsAnySchemaObject(response)) {
|
|
11
|
-
responseType = classify([operation.operationId, RESPONSE_FILE_SUFFIX].join('-'));
|
|
13
|
+
if (!any_schema_object_1.IsAnySchemaObject(response)) {
|
|
14
|
+
responseType = schematics_utilities_1.classify([operation.operationId, config_1.RESPONSE_FILE_SUFFIX].join('-'));
|
|
12
15
|
}
|
|
13
16
|
else {
|
|
14
17
|
responseType = 'void';
|
|
@@ -16,4 +19,5 @@ export function GetResponseType(operation) {
|
|
|
16
19
|
}
|
|
17
20
|
return responseType;
|
|
18
21
|
}
|
|
22
|
+
exports.GetResponseType = GetResponseType;
|
|
19
23
|
//# sourceMappingURL=get-response-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-response-type.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/get-response-type.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"get-response-type.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/get-response-type.ts"],"names":[],"mappings":";;;AACA,sCAAiD;AACjD,2DAAwD;AACxD,iDAA6C;AAC7C,qEAAsD;AAEtD,SAAgB,eAAe,CAAC,SAAoC;IAElE,IAAI,YAAY,GAAG,KAAK,CAAC;IAEzB,IAAI,SAAS,CAAC,WAAW,EAAE;QAEzB,MAAM,QAAQ,GAAG,0BAAW,CAAC,SAAS,CAAC,CAAC;QAExC,8DAA8D;QAC9D,IAAI,CAAC,qCAAiB,CAAC,QAAQ,CAAC,EAAE;YAChC,YAAY,GAAG,+BAAQ,CAAC,CAAE,SAAS,CAAC,WAAW,EAAE,6BAAoB,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;SACpF;aAAM;YACL,YAAY,GAAG,MAAM,CAAC;SACvB;KAEF;IAED,OAAO,YAAY,CAAC;AAEtB,CAAC;AAnBD,0CAmBC"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetResponse = void 0;
|
|
4
|
+
const is_reference_object_1 = require("./is-reference-object");
|
|
5
|
+
function GetResponse(operation) {
|
|
3
6
|
if (operation.responses) {
|
|
4
7
|
// tslint:disable:no-unnecessary-initializer
|
|
5
8
|
let response = undefined;
|
|
@@ -13,7 +16,7 @@ export function GetResponse(operation) {
|
|
|
13
16
|
response = operation.responses['201'];
|
|
14
17
|
}
|
|
15
18
|
if (response) {
|
|
16
|
-
if (IsReferenceObject(response)) {
|
|
19
|
+
if (is_reference_object_1.IsReferenceObject(response)) {
|
|
17
20
|
console.warn('Reference object are not supported in operation responses!');
|
|
18
21
|
}
|
|
19
22
|
else {
|
|
@@ -30,4 +33,5 @@ export function GetResponse(operation) {
|
|
|
30
33
|
type: 'any'
|
|
31
34
|
};
|
|
32
35
|
}
|
|
36
|
+
exports.GetResponse = GetResponse;
|
|
33
37
|
//# sourceMappingURL=get-response.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-response.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/get-response.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"get-response.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/get-response.ts"],"names":[],"mappings":";;;AAEA,+DAA0D;AAE1D,SAAgB,WAAW,CAAC,SAAoC;IAE9D,IAAI,SAAS,CAAC,SAAS,EAAE;QAEvB,4CAA4C;QAC5C,IAAI,QAAQ,GAAqE,SAAS,CAAC;QAE3F,IAAI,SAAS,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE;YACjD,QAAQ,GAAG,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC;SACxC;aAAM,IAAI,SAAS,CAAC,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE;YACpD,QAAQ,GAAG,SAAS,CAAC,SAAS,CAAE,KAAK,CAAE,CAAC;SACzC;aAAM,IAAI,SAAS,CAAC,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE;YACpD,QAAQ,GAAG,SAAS,CAAC,SAAS,CAAE,KAAK,CAAE,CAAC;SACzC;QAED,IAAI,QAAQ,EAAE;YAEZ,IAAI,uCAAiB,CAAC,QAAQ,CAAC,EAAE;gBAC/B,OAAO,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;aAC5E;iBAAM;gBACL,IAAI,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE;oBAC3E,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAE,kBAAkB,CAAE,CAAC,MAAM,CAAC;oBAC7D,IAAI,MAAM,EAAE;wBACV,OAAO,MAAM,CAAC;qBACf;iBACF;aACF;SAEF;KAEF;IAED,OAAO;QACL,IAAI,EAAE,KAAK;KACZ,CAAC;AAEJ,CAAC;AApCD,kCAoCC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HasOperationParameters = void 0;
|
|
4
|
+
function HasOperationParameters(operation) {
|
|
2
5
|
return Array.isArray(operation.parameters) && operation.parameters.length !== 0;
|
|
3
6
|
}
|
|
7
|
+
exports.HasOperationParameters = HasOperationParameters;
|
|
4
8
|
//# sourceMappingURL=has-operation-paramters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"has-operation-paramters.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/has-operation-paramters.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"has-operation-paramters.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/has-operation-paramters.ts"],"names":[],"mappings":";;;AAIA,SAAgB,sBAAsB,CAAC,SAAoC;IACzE,OAAO,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC;AAClF,CAAC;AAFD,wDAEC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HasOperationRequestBody = void 0;
|
|
4
|
+
function HasOperationRequestBody(operation) {
|
|
2
5
|
return !!operation.requestBody;
|
|
3
6
|
}
|
|
7
|
+
exports.HasOperationRequestBody = HasOperationRequestBody;
|
|
4
8
|
//# sourceMappingURL=has-operation-request-body.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"has-operation-request-body.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/has-operation-request-body.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"has-operation-request-body.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/has-operation-request-body.ts"],"names":[],"mappings":";;;AAIA,SAAgB,uBAAuB,CAAC,SAAoC;IAC1E,OAAO,CAAC,CAAC,SAAS,CAAC,WAAW,CAAA;AAChC,CAAC;AAFD,0DAEC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HttpRequest = void 0;
|
|
4
|
+
const http = require("http");
|
|
5
|
+
const https = require("https");
|
|
6
|
+
function HttpRequest(url) {
|
|
4
7
|
function callback(resolve, reject) {
|
|
5
8
|
return function (res) {
|
|
6
9
|
const { statusCode } = res;
|
|
@@ -48,4 +51,5 @@ export function HttpRequest(url) {
|
|
|
48
51
|
});
|
|
49
52
|
}
|
|
50
53
|
}
|
|
54
|
+
exports.HttpRequest = HttpRequest;
|
|
51
55
|
//# sourceMappingURL=http-request.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-request.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/http-request.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"http-request.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/http-request.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,+BAA+B;AAE/B,SAAgB,WAAW,CAAI,GAAW;IAExC,SAAS,QAAQ,CAAC,OAA6B,EAAE,MAA4B;QAE3E,OAAO,UAAS,GAAyB;YAEvC,MAAM,EAAE,UAAU,EAAE,GAAG,GAAG,CAAC;YAC3B,MAAM,WAAW,GAAM,GAAG,CAAC,OAAO,CAAE,cAAc,CAAE,CAAC;YAErD,IAAI,KAAK,CAAC;YACV,wDAAwD;YACxD,oCAAoC;YACpC,IAAI,UAAU,KAAK,GAAG,EAAE;gBACtB,KAAK,GAAG,IAAI,KAAK,CAAC,mBAAmB;oBACnC,gBAAgB,UAAU,EAAE,CAAC,CAAC;aACjC;iBAAM,IAAI,WAAW,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;gBACjE,KAAK,GAAG,IAAI,KAAK,CAAC,yBAAyB;oBACzC,0CAA0C,WAAW,EAAE,CAAC,CAAC;aAC5D;YACD,IAAI,KAAK,EAAE;gBACT,0CAA0C;gBAC1C,GAAG,CAAC,MAAM,EAAE,CAAC;gBACb,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC7B,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBACtB,OAAO;aACR;YAED,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACxB,IAAI,OAAO,GAAG,EAAE,CAAC;YACjB,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,GAAG,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACjD,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;gBACjB,IAAI;oBACF,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;iBAC9B;gBAAC,OAAO,CAAC,EAAE;oBACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;oBACzB,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;iBACnB;YACH,CAAC,CAAC,CAAC;QAEL,CAAC,CAAC;IAEJ,CAAC;IAED,IAAI,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;QACvB,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACxC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAChF,CAAC,CAAC,CAAC;KACJ;SAAM;QACL,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACxC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAC/E,CAAC,CAAC,CAAC;KACJ;AAEH,CAAC;AArDD,kCAqDC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IgnoreOperation = void 0;
|
|
4
|
+
function IgnoreOperation(tags = []) {
|
|
2
5
|
return operation => {
|
|
3
6
|
var _a;
|
|
4
7
|
if ((_a = operation === null || operation === void 0 ? void 0 : operation.tags) === null || _a === void 0 ? void 0 : _a.length) {
|
|
@@ -7,4 +10,5 @@ export function IgnoreOperation(tags = []) {
|
|
|
7
10
|
return false;
|
|
8
11
|
};
|
|
9
12
|
}
|
|
13
|
+
exports.IgnoreOperation = IgnoreOperation;
|
|
10
14
|
//# sourceMappingURL=ignore-operation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignore-operation.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/ignore-operation.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"ignore-operation.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/ignore-operation.ts"],"names":[],"mappings":";;;AAEA,SAAgB,eAAe,CAAC,OAAiB,EAAE;IACjD,OAAO,SAAS,CAAC,EAAE;;QAEjB,IAAI,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,0CAAE,MAAM,EAAE;YAC3B,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;SACvD;QAED,OAAO,KAAK,CAAC;IAEf,CAAC,CAAC;AACJ,CAAC;AAVD,0CAUC"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IsCollectionResponse = void 0;
|
|
4
|
+
const get_response_1 = require("./get-response");
|
|
5
|
+
const any_schema_object_1 = require("./any-schema-object");
|
|
6
|
+
const is_reference_object_1 = require("./is-reference-object");
|
|
7
|
+
function IsCollectionResponse(operation) {
|
|
8
|
+
const response = get_response_1.GetResponse(operation);
|
|
9
|
+
if (!any_schema_object_1.IsAnySchemaObject(response)) {
|
|
10
|
+
if (!is_reference_object_1.IsReferenceObject(response)) {
|
|
8
11
|
return response.type === 'array';
|
|
9
12
|
}
|
|
10
13
|
}
|
|
11
14
|
return false;
|
|
12
15
|
}
|
|
16
|
+
exports.IsCollectionResponse = IsCollectionResponse;
|
|
13
17
|
//# sourceMappingURL=is-collection-response.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-collection-response.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/is-collection-response.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"is-collection-response.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/is-collection-response.ts"],"names":[],"mappings":";;;AAAA,iDAEwB;AAExB,2DAAwD;AACxD,+DAA0D;AAE1D,SAAgB,oBAAoB,CAAC,SAAoC;IAEvE,MAAM,QAAQ,GAAG,0BAAW,CAAC,SAAS,CAAC,CAAC;IAExC,IAAI,CAAC,qCAAiB,CAAC,QAAQ,CAAC,EAAE;QAChC,IAAI,CAAC,uCAAiB,CAAC,QAAQ,CAAC,EAAE;YAChC,OAAO,QAAQ,CAAC,IAAI,KAAK,OAAO,CAAC;SAClC;KACF;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAXD,oDAWC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IsHttpMethod = void 0;
|
|
4
|
+
function IsHttpMethod(method) {
|
|
2
5
|
return ['get', 'put', 'post', 'delete', 'patch'].includes(method);
|
|
3
6
|
}
|
|
7
|
+
exports.IsHttpMethod = IsHttpMethod;
|
|
4
8
|
//# sourceMappingURL=is-http-method.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-http-method.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/is-http-method.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"is-http-method.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/is-http-method.ts"],"names":[],"mappings":";;;AAAA,SAAgB,YAAY,CAAC,MAAc;IACzC,OAAO,CAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACtE,CAAC;AAFD,oCAEC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IsOpenApiSchemaFromPath = void 0;
|
|
4
|
+
function IsOpenApiSchemaFromPath(options) {
|
|
2
5
|
return options && options.hasOwnProperty('path');
|
|
3
6
|
}
|
|
7
|
+
exports.IsOpenApiSchemaFromPath = IsOpenApiSchemaFromPath;
|
|
4
8
|
//# sourceMappingURL=is-open-api-schema-from-path.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-open-api-schema-from-path.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/is-open-api-schema-from-path.ts"],"names":[],"mappings":"AAKA,
|
|
1
|
+
{"version":3,"file":"is-open-api-schema-from-path.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/is-open-api-schema-from-path.ts"],"names":[],"mappings":";;;AAKA,SAAgB,uBAAuB,CAAC,OAAsB;IAC5D,OAAO,OAAO,IAAI,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;AACnD,CAAC;AAFD,0DAEC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IsOperationObject = void 0;
|
|
4
|
+
function IsOperationObject(obj) {
|
|
2
5
|
return obj && obj.hasOwnProperty('operationId');
|
|
3
6
|
}
|
|
7
|
+
exports.IsOperationObject = IsOperationObject;
|
|
4
8
|
//# sourceMappingURL=is-operation-object.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-operation-object.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/is-operation-object.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"is-operation-object.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/is-operation-object.ts"],"names":[],"mappings":";;;AAEA,SAAgB,iBAAiB,CAAC,GAAQ;IACxC,OAAO,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;AAClD,CAAC;AAFD,8CAEC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IsReferenceObject = void 0;
|
|
4
|
+
function IsReferenceObject(obj) {
|
|
2
5
|
return !!obj && obj.hasOwnProperty('$ref');
|
|
3
6
|
}
|
|
7
|
+
exports.IsReferenceObject = IsReferenceObject;
|
|
4
8
|
//# sourceMappingURL=is-reference-object.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-reference-object.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/is-reference-object.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"is-reference-object.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/is-reference-object.ts"],"names":[],"mappings":";;;AAEA,SAAgB,iBAAiB,CAAC,GAAS;IACzC,OAAO,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;AAC7C,CAAC;AAFD,8CAEC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IsWithoutParameters = void 0;
|
|
4
|
+
function IsWithoutParameters(operation) {
|
|
2
5
|
return !operation.parameters || !operation.parameters.length;
|
|
3
6
|
}
|
|
7
|
+
exports.IsWithoutParameters = IsWithoutParameters;
|
|
4
8
|
//# sourceMappingURL=is-without-parameters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-without-parameters.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/is-without-parameters.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"is-without-parameters.js","sourceRoot":"","sources":["../../../../../../libs/open-api/src/lib/utilities/is-without-parameters.ts"],"names":[],"mappings":";;;AAIA,SAAgB,mBAAmB,CAAC,SAAoC;IACtE,OAAO,CAAC,SAAS,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC;AAC/D,CAAC;AAFD,kDAEC"}
|