@automatons/tools 1.0.103 → 1.0.106
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/package.json +17 -18
- package/utils/fetch.d.ts +1 -1
- package/utils/fetch.d.ts.map +1 -1
- package/utils/fetch.js +3 -3
- package/utils/fetch.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automatons/tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.106",
|
|
4
4
|
"repository": "git@github.com:openapi-automatons/tools.git",
|
|
5
5
|
"author": "tanmen <yt.prog@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,36 +19,35 @@
|
|
|
19
19
|
"postversion": "cp package.json ../package.json"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"fs-extra": "^10.0
|
|
23
|
-
"
|
|
24
|
-
"
|
|
22
|
+
"fs-extra": "^10.1.0",
|
|
23
|
+
"got": "^11.8.5",
|
|
24
|
+
"js-yaml": "^4.1.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@commitlint/cli": "^
|
|
28
|
-
"@commitlint/config-conventional": "^
|
|
27
|
+
"@commitlint/cli": "^17.0.2",
|
|
28
|
+
"@commitlint/config-conventional": "^17.0.2",
|
|
29
29
|
"@semantic-release/changelog": "^6.0.1",
|
|
30
30
|
"@semantic-release/git": "^10.0.1",
|
|
31
31
|
"@semantic-release/npm": "^9.0.1",
|
|
32
|
-
"@types/eslint": "^8.4.
|
|
32
|
+
"@types/eslint": "^8.4.2",
|
|
33
33
|
"@types/fs-extra": "^9.0.13",
|
|
34
|
-
"@types/jest": "^27.
|
|
34
|
+
"@types/jest": "^27.5.0",
|
|
35
35
|
"@types/js-yaml": "^4.0.5",
|
|
36
|
-
"@types/node": "^17.0.
|
|
37
|
-
"@types/node-fetch": "^2.6.1",
|
|
36
|
+
"@types/node": "^17.0.38",
|
|
38
37
|
"@types/semantic-release": "^17.2.3",
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
40
|
-
"@typescript-eslint/parser": "^5.
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^5.27.0",
|
|
39
|
+
"@typescript-eslint/parser": "^5.27.0",
|
|
41
40
|
"depcheck": "^1.4.3",
|
|
42
|
-
"eslint": "^8.
|
|
41
|
+
"eslint": "^8.16.0",
|
|
43
42
|
"eslint-config-google": "^0.14.0",
|
|
44
|
-
"husky": "^
|
|
43
|
+
"husky": "^8.0.1",
|
|
45
44
|
"jest": "^26.0.1",
|
|
46
|
-
"lint-staged": "^
|
|
45
|
+
"lint-staged": "^13.0.0",
|
|
47
46
|
"semantic-release": "^19.0.2",
|
|
48
47
|
"ts-jest": "^26.0.0",
|
|
49
|
-
"typescript": "^4.
|
|
50
|
-
"typesync": "^0.9.
|
|
51
|
-
"yarn-deduplicate": "^
|
|
48
|
+
"typescript": "^4.7.2",
|
|
49
|
+
"typesync": "^0.9.1",
|
|
50
|
+
"yarn-deduplicate": "^5.0.0"
|
|
52
51
|
},
|
|
53
52
|
"publishConfig": {
|
|
54
53
|
"access": "public"
|
package/utils/fetch.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Openapi } from '../types';
|
|
2
|
-
export declare const fetch: <T extends Object = Openapi>(url: string, openapiPath?: string
|
|
2
|
+
export declare const fetch: <T extends Object = Openapi>(url: string, openapiPath?: string) => Promise<T>;
|
|
3
3
|
//# sourceMappingURL=fetch.d.ts.map
|
package/utils/fetch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/utils/fetch.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAGjC,eAAO,MAAM,KAAK,oCAA2C,MAAM,
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/utils/fetch.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAGjC,eAAO,MAAM,KAAK,oCAA2C,MAAM,gBAAgB,MAAM,eAQjC,CAAC"}
|
package/utils/fetch.js
CHANGED
|
@@ -6,15 +6,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.fetch = void 0;
|
|
7
7
|
const fs_extra_1 = require("fs-extra");
|
|
8
8
|
const js_yaml_1 = require("js-yaml");
|
|
9
|
-
const
|
|
9
|
+
const got_1 = __importDefault(require("got"));
|
|
10
10
|
const path_1 = require("path");
|
|
11
11
|
const url_1 = require("url");
|
|
12
12
|
const url_2 = require("./url");
|
|
13
13
|
const fetch = async (url, openapiPath) => parse(await ((0, url_2.isUrl)(url) ?
|
|
14
|
-
await (0,
|
|
14
|
+
await (0, got_1.default)(url).text() :
|
|
15
15
|
openapiPath ?
|
|
16
16
|
(0, url_2.isUrl)(openapiPath) ?
|
|
17
|
-
await (0,
|
|
17
|
+
await (0, got_1.default)(urlJoin(openapiPath, url)).text() :
|
|
18
18
|
(0, fs_extra_1.readFile)((0, path_1.resolve)((0, path_1.extname)(openapiPath) ?
|
|
19
19
|
(0, path_1.dirname)(openapiPath) : openapiPath, url), { encoding: 'utf-8' }) :
|
|
20
20
|
(0, fs_extra_1.readFile)((0, path_1.resolve)(url), { encoding: 'utf-8' })), url);
|
package/utils/fetch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src/utils/fetch.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAkC;AAClC,qCAA6B;AAC7B,
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../src/utils/fetch.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAkC;AAClC,qCAA6B;AAC7B,8CAAsB;AACtB,+BAA+C;AAC/C,6BAAsC;A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