yapi-apifox-to-typescript 4.2.3 → 5.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/lib/cjs/ApifoxToYApiData.js +312 -588
- package/lib/cjs/Generator.js +513 -1171
- package/lib/cjs/SwaggerToYApiServer.js +125 -336
- package/lib/cjs/_virtual/_rolldown/runtime.js +23 -0
- package/lib/cjs/cli.js +171 -280
- package/lib/cjs/helpers.js +125 -209
- package/lib/cjs/index.js +15 -19
- package/lib/cjs/mini-ut.js +220 -0
- package/lib/cjs/swaggerJsonToYApiData.js +268 -482
- package/lib/cjs/types.js +93 -93
- package/lib/cjs/utils.js +364 -769
- package/lib/esm/ApifoxToYApiData.d.ts +49 -0
- package/lib/esm/ApifoxToYApiData.js +310 -572
- package/lib/esm/Generator.d.ts +53 -0
- package/lib/esm/Generator.js +509 -1146
- package/lib/esm/SwaggerToYApiServer.d.ts +23 -0
- package/lib/esm/SwaggerToYApiServer.js +119 -317
- package/lib/esm/_virtual/_rolldown/runtime.js +7 -0
- package/lib/esm/cli.d.ts +4 -0
- package/lib/esm/cli.js +162 -251
- package/lib/esm/helpers.d.ts +49 -0
- package/lib/esm/helpers.js +125 -198
- package/lib/esm/index.d.ts +2 -897
- package/lib/esm/index.js +3 -2
- package/lib/esm/mini-ut.d.ts +105 -0
- package/lib/esm/mini-ut.js +198 -0
- package/lib/esm/swaggerJsonToYApiData.d.ts +6 -0
- package/lib/esm/swaggerJsonToYApiData.js +265 -469
- package/lib/esm/types.d.ts +695 -0
- package/lib/esm/types.js +87 -73
- package/lib/esm/utils.d.ts +95 -0
- package/lib/esm/utils.js +350 -720
- package/package.json +49 -59
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yapi-apifox-to-typescript",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "根据 YApi 或 Apifox 的接口定义生成 TypeScript/JavaScript 的接口类型及其请求函数代码。",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yapi",
|
|
@@ -33,76 +33,66 @@
|
|
|
33
33
|
"lib"
|
|
34
34
|
],
|
|
35
35
|
"scripts": {
|
|
36
|
-
"build": "
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"testApi": "ts-node -T src/cli.ts"
|
|
43
|
-
},
|
|
44
|
-
"husky": {
|
|
45
|
-
"hooks": {
|
|
46
|
-
"pre-commit": "lint-staged"
|
|
47
|
-
}
|
|
36
|
+
"build": "vite build --mode esm && vite build --mode cjs",
|
|
37
|
+
"release": "commit-and-tag-version -a && npm run build && git push --follow-tags origin master && npm publish",
|
|
38
|
+
"releaseMajor": "commit-and-tag-version -a --release-as major && npm run build && git push --follow-tags origin master && npm publish",
|
|
39
|
+
"releaseBeta": "commit-and-tag-version -a --release-as patch --prerelease beta && npm run build && git push --follow-tags origin master && npm publish --tag next",
|
|
40
|
+
"testApi": "ts-node src/cli.ts",
|
|
41
|
+
"prepare": "husky"
|
|
48
42
|
},
|
|
49
43
|
"lint-staged": {
|
|
50
|
-
"*.{css,less,scss,sass,html,htm,vue,yml,yaml,json,md}":
|
|
51
|
-
"prettier --write"
|
|
52
|
-
],
|
|
44
|
+
"*.{css,less,scss,sass,html,htm,vue,yml,yaml,json,md}": "prettier --write",
|
|
53
45
|
"*.{js,jsx,ts,tsx}": [
|
|
54
46
|
"eslint --fix",
|
|
55
47
|
"prettier --write"
|
|
56
48
|
]
|
|
57
49
|
},
|
|
58
50
|
"dependencies": {
|
|
59
|
-
"@
|
|
60
|
-
"
|
|
61
|
-
"change-case": "^
|
|
62
|
-
"consola": "^
|
|
63
|
-
"dayjs": "^1.
|
|
64
|
-
"form-data": "^
|
|
65
|
-
"fs-extra": "^
|
|
66
|
-
"get-port": "^
|
|
67
|
-
"json-schema-to-typescript": "^
|
|
68
|
-
"json5": "^2.
|
|
69
|
-
"node-fetch": "^2",
|
|
70
|
-
"ora": "^
|
|
71
|
-
"prettier": "^
|
|
72
|
-
"prompts": "^2.
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"swagger-client": "3.18.4",
|
|
51
|
+
"@types/json-schema": "^7.0.15",
|
|
52
|
+
"axios": "^1.20.0",
|
|
53
|
+
"change-case": "^5.4.4",
|
|
54
|
+
"consola": "^3.4.2",
|
|
55
|
+
"dayjs": "^1.11.23",
|
|
56
|
+
"form-data": "^4.0.6",
|
|
57
|
+
"fs-extra": "^11.4.1",
|
|
58
|
+
"get-port": "^7.2.0",
|
|
59
|
+
"json-schema-to-typescript": "^16.0.0",
|
|
60
|
+
"json5": "^2.2.3",
|
|
61
|
+
"node-fetch": "^3.3.2",
|
|
62
|
+
"ora": "^9.4.1",
|
|
63
|
+
"prettier": "^3.9.9",
|
|
64
|
+
"prompts": "^2.4.2",
|
|
65
|
+
"signal-exit": "^4.1.0",
|
|
66
|
+
"swagger-client": "^3.38.2",
|
|
76
67
|
"to-json-schema": "^0.2.5",
|
|
77
|
-
"ts-node": "^
|
|
78
|
-
"typescript": "^
|
|
79
|
-
"
|
|
80
|
-
"yargs": "^16.2.0"
|
|
68
|
+
"ts-node": "^10.9.2",
|
|
69
|
+
"typescript": "^5.9.3",
|
|
70
|
+
"yargs": "^18.2.0"
|
|
81
71
|
},
|
|
82
72
|
"devDependencies": {
|
|
83
|
-
"@types/fs-extra": "^
|
|
84
|
-
"@types/
|
|
85
|
-
"@types/node": "^
|
|
86
|
-
"@types/
|
|
87
|
-
"@types/
|
|
88
|
-
"@types/
|
|
89
|
-
"@types/
|
|
90
|
-
"@
|
|
91
|
-
"@
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"standard-version": "^9.3.2",
|
|
102
|
-
"typedoc": "^0.14.2",
|
|
103
|
-
"typescript-snapshots-plugin": "^1.7.0"
|
|
73
|
+
"@types/fs-extra": "^11.0.4",
|
|
74
|
+
"@types/node": "^22.20.5",
|
|
75
|
+
"@types/node-fetch": "^2.6.13",
|
|
76
|
+
"@types/prompts": "^2.4.9",
|
|
77
|
+
"@types/swagger-schema-official": "^2.0.25",
|
|
78
|
+
"@types/to-json-schema": "^0.2.4",
|
|
79
|
+
"@types/yargs": "^17.0.35",
|
|
80
|
+
"@typescript-eslint/eslint-plugin": "^8.71.1",
|
|
81
|
+
"@typescript-eslint/parser": "^8.71.1",
|
|
82
|
+
"commit-and-tag-version": "^13.2.1",
|
|
83
|
+
"eslint": "^10.12.0",
|
|
84
|
+
"eslint-config-prettier": "^10.1.8",
|
|
85
|
+
"globals": "^16.5.0",
|
|
86
|
+
"husky": "^9.1.7",
|
|
87
|
+
"lint-staged": "^17.6.0",
|
|
88
|
+
"openapi-types": "^12.1.3",
|
|
89
|
+
"vite": "^8.3.3",
|
|
90
|
+
"vite-plugin-dts": "^5.1.2"
|
|
104
91
|
},
|
|
105
92
|
"engines": {
|
|
106
|
-
"node": ">=
|
|
93
|
+
"node": ">=22.12.0"
|
|
94
|
+
},
|
|
95
|
+
"publishConfig": {
|
|
96
|
+
"registry": "https://registry.npmjs.org/"
|
|
107
97
|
}
|
|
108
98
|
}
|