openapi-ts-request 0.4.2 → 0.4.4

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 CHANGED
@@ -20,8 +20,10 @@
20
20
  ## 使用
21
21
 
22
22
  ```bash
23
+ # npm
23
24
  npm i openapi-ts-request --save-dev
24
25
 
26
+ # pnpm
25
27
  pnpm i openapi-ts-request -D
26
28
  ```
27
29
 
@@ -103,8 +105,14 @@ npm run openapi
103
105
 
104
106
  ### NPX
105
107
 
106
- ```
107
- npx openapi-ts-request openapi -i ./openapi.json -o ./apis
108
+ ```bash
109
+ # npm
110
+ npx --package=openapi-ts-request -- openapi -i ./openapi.json -o ./apis
111
+ npx --package=openapi-ts-request -- openapi -i https://petstore3.swagger.io/api/v3/openapi.json -o ./apis
112
+
113
+ # pnpm
114
+ pnpm --package=openapi-ts-request@latest dlx openapi -i ./openapi.json -o ./apis
115
+ pnpm --package=openapi-ts-request@latest dlx openapi -i https://petstore3.swagger.io/api/v3/openapi.json -o ./apis
108
116
  ```
109
117
 
110
118
  ### CLI
@@ -25,8 +25,11 @@ const params = commander_1.program
25
25
  .parse(process.argv)
26
26
  .opts();
27
27
  function getPath(path) {
28
- const cwd = process.cwd();
29
- return (0, path_1.join)(cwd, path);
28
+ const isUrl = path.startsWith('http');
29
+ if (isUrl) {
30
+ return path;
31
+ }
32
+ return (0, path_1.join)(process.cwd(), path);
30
33
  }
31
34
  function run() {
32
35
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openapi-ts-request",
3
- "version": "0.4.2",
3
+ "version": "0.4.4",
4
4
  "description": "Swagger2/OpenAPI3 to TypeScript, request client, request mock service, enum, type field label, JSON Schemas",
5
5
  "repository": {
6
6
  "type": "git",