@rxap/workspace-open-api 16.0.2-dev.3 → 16.1.0-dev.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 +10 -0
- package/README.md +1 -1
- package/package.json +10 -10
- package/src/lib/load-open-api-config.js +11 -1
- package/src/lib/load-open-api-config.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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
|
+
# [16.1.0-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/workspace-open-api@16.0.2...@rxap/workspace-open-api@16.1.0-dev.0) (2024-04-18)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- support yaml files ([b8b7daa](https://gitlab.com/rxap/packages/commit/b8b7daae5571268f9043873c6d19d5c22b589beb))
|
|
11
|
+
|
|
12
|
+
## [16.0.2](https://gitlab.com/rxap/packages/compare/@rxap/workspace-open-api@16.0.2-dev.3...@rxap/workspace-open-api@16.0.2) (2024-04-17)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @rxap/workspace-open-api
|
|
15
|
+
|
|
6
16
|
## [16.0.2-dev.3](https://gitlab.com/rxap/packages/compare/@rxap/workspace-open-api@16.0.2-dev.2...@rxap/workspace-open-api@16.0.2-dev.3) (2024-04-09)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @rxap/workspace-open-api
|
package/README.md
CHANGED
|
@@ -17,5 +17,5 @@ yarn add @rxap/workspace-open-api
|
|
|
17
17
|
```
|
|
18
18
|
**Install peer dependencies:**
|
|
19
19
|
```bash
|
|
20
|
-
yarn add @angular-devkit/core@^16.2.13 @rxap/json-schema-to-typescript@^16.0.1
|
|
20
|
+
yarn add @angular-devkit/core@^16.2.13 @rxap/json-schema-to-typescript@^16.0.1 @rxap/utilities@^16.1.0 @rxap/workspace-utilities@^16.2.0 openapi-types@10.0.0 ts-morph@^18.0.0 tslib@2.6.2
|
|
21
21
|
```
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "16.0
|
|
2
|
+
"version": "16.1.0-dev.0",
|
|
3
3
|
"name": "@rxap/workspace-open-api",
|
|
4
4
|
"license": "GPL-3.0-or-later",
|
|
5
5
|
"dependencies": {
|
|
@@ -10,17 +10,17 @@
|
|
|
10
10
|
"process": "0.11.10",
|
|
11
11
|
"semver": "7.5.3",
|
|
12
12
|
"tslib": "2.6.2",
|
|
13
|
-
"yaml": "2.3.1"
|
|
13
|
+
"yaml": "^2.3.1"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
16
|
"@angular-devkit/core": "^16.2.13",
|
|
17
|
-
"@rxap/json-schema-to-typescript": "^16.0.1
|
|
18
|
-
"@rxap/utilities": "^16.1.0
|
|
19
|
-
"@rxap/workspace-utilities": "^16.
|
|
17
|
+
"@rxap/json-schema-to-typescript": "^16.0.1",
|
|
18
|
+
"@rxap/utilities": "^16.1.0",
|
|
19
|
+
"@rxap/workspace-utilities": "^16.2.0",
|
|
20
20
|
"openapi-types": "10.0.0",
|
|
21
21
|
"ts-morph": "^18.0.0",
|
|
22
22
|
"tslib": "2.6.2",
|
|
23
|
-
"@rxap/node-utilities": "1.2.0
|
|
23
|
+
"@rxap/node-utilities": "1.2.0"
|
|
24
24
|
},
|
|
25
25
|
"author": {
|
|
26
26
|
"name": "Merzough Münker",
|
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
"packageGroup": [
|
|
43
43
|
{
|
|
44
44
|
"package": "@rxap/json-schema-to-typescript",
|
|
45
|
-
"version": "16.0.1
|
|
45
|
+
"version": "16.0.1"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"package": "@rxap/utilities",
|
|
49
|
-
"version": "16.1.0
|
|
49
|
+
"version": "16.1.0"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
"package": "@rxap/workspace-utilities",
|
|
53
|
-
"version": "16.
|
|
53
|
+
"version": "16.2.0"
|
|
54
54
|
}
|
|
55
55
|
]
|
|
56
56
|
},
|
|
@@ -64,6 +64,6 @@
|
|
|
64
64
|
"directory": "packages/workspace/open-api"
|
|
65
65
|
},
|
|
66
66
|
"type": "commonjs",
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "0567aa3e911e0303de2c16d1b2d47aa626b0382b",
|
|
68
68
|
"main": "./src/index.js"
|
|
69
69
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LoadOpenApiConfig = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const workspace_utilities_1 = require("@rxap/workspace-utilities");
|
|
6
|
+
const yaml_1 = require("yaml");
|
|
6
7
|
const http_request_1 = require("./utilities/http-request");
|
|
7
8
|
const is_open_api_schema_from_path_1 = require("./utilities/is-open-api-schema-from-path");
|
|
8
9
|
function LoadOpenApiConfig(host, options) {
|
|
@@ -13,7 +14,16 @@ function LoadOpenApiConfig(host, options) {
|
|
|
13
14
|
throw new Error('Could not find openapi file.');
|
|
14
15
|
}
|
|
15
16
|
const treeAdapter = new workspace_utilities_1.TreeAdapter(host);
|
|
16
|
-
|
|
17
|
+
const content = treeAdapter.read(options.path, 'utf-8');
|
|
18
|
+
if (options.path.endsWith('.json')) {
|
|
19
|
+
openapi = JSON.parse(content);
|
|
20
|
+
}
|
|
21
|
+
else if (options.path.endsWith('.yaml') || options.path.endsWith('.yml')) {
|
|
22
|
+
openapi = (0, yaml_1.parse)(content);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
throw new Error(`Unsupported file extension: ${options.path}`);
|
|
26
|
+
}
|
|
17
27
|
}
|
|
18
28
|
else if (options.url) {
|
|
19
29
|
openapi = yield (0, http_request_1.HttpRequest)(options.url);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-open-api-config.js","sourceRoot":"","sources":["../../../../../../packages/workspace/open-api/src/lib/load-open-api-config.ts"],"names":[],"mappings":";;;;AAAA,mEAGmC;
|
|
1
|
+
{"version":3,"file":"load-open-api-config.js","sourceRoot":"","sources":["../../../../../../packages/workspace/open-api/src/lib/load-open-api-config.ts"],"names":[],"mappings":";;;;AAAA,mEAGmC;AAEnC,+BAA6B;AAE7B,2DAAuD;AACvD,2FAAmF;AAEnF,SAAsB,iBAAiB,CAAC,IAAc,EAAE,OAAsB;;QAC5E,IAAI,OAA2B,CAAC;QAChC,IAAI,IAAA,sDAAuB,EAAC,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,MAAM,WAAW,GAAG,IAAI,iCAAW,CAAC,IAAI,CAAC,CAAC;YAE1C,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAE,CAAC;YAEzD,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;gBAClC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;aAC/B;iBAAM,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;gBAC1E,OAAO,GAAG,IAAA,YAAK,EAAC,OAAO,CAAC,CAAC;aAC1B;iBAAM;gBACL,MAAM,IAAI,KAAK,CAAC,+BAA+B,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;aAChE;SAEF;aAAM,IAAI,OAAO,CAAC,GAAG,EAAE;YACtB,OAAO,GAAG,MAAM,IAAA,0BAAW,EAAqB,OAAO,CAAC,GAAG,CAAC,CAAC;SAC9D;aAAM;YACL,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;SAC3D;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;CAAA;AA1BD,8CA0BC"}
|