@tsed/cli-generate-http-client 6.6.3 → 7.0.0-alpha.2
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.
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { CliFs, Command, constant, inject, Type } from "@tsed/cli-core";
|
|
1
|
+
import { join, resolve } from "node:path";
|
|
2
|
+
import { CliFs, command, constant, inject, Type } from "@tsed/cli-core";
|
|
4
3
|
import { isString } from "@tsed/core";
|
|
5
4
|
import { InjectorService } from "@tsed/di";
|
|
6
5
|
import { camelCase } from "change-case";
|
|
7
6
|
import { generateApi } from "swagger-typescript-api";
|
|
8
|
-
|
|
7
|
+
export class GenerateHttpClientCmd {
|
|
9
8
|
constructor() {
|
|
10
9
|
this.fs = inject(CliFs);
|
|
11
10
|
this.serverModule = constant("server");
|
|
@@ -120,36 +119,33 @@ let GenerateHttpClientCmd = class GenerateHttpClientCmd {
|
|
|
120
119
|
raw.operationId = name;
|
|
121
120
|
return routeNameInfo;
|
|
122
121
|
}
|
|
123
|
-
}
|
|
124
|
-
GenerateHttpClientCmd
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
description: "Path to generate files"
|
|
151
|
-
}
|
|
122
|
+
}
|
|
123
|
+
command(GenerateHttpClientCmd, {
|
|
124
|
+
name: "generate-http-client",
|
|
125
|
+
description: "Generate the client API from swagger spec",
|
|
126
|
+
options: {
|
|
127
|
+
"-s, --suffix <suffix>": {
|
|
128
|
+
required: false,
|
|
129
|
+
type: String,
|
|
130
|
+
defaultValue: "Model",
|
|
131
|
+
description: "The suffix applied on model"
|
|
132
|
+
},
|
|
133
|
+
"-t, --type <type>": {
|
|
134
|
+
required: false,
|
|
135
|
+
type: String,
|
|
136
|
+
defaultValue: "axios",
|
|
137
|
+
description: "The client type by the Http client (axios or fetch)"
|
|
138
|
+
},
|
|
139
|
+
"-n, --name <name>": {
|
|
140
|
+
required: false,
|
|
141
|
+
type: String,
|
|
142
|
+
defaultValue: "ApiClient",
|
|
143
|
+
description: "The class name of the generated client"
|
|
144
|
+
},
|
|
145
|
+
"-o, --output <output>": {
|
|
146
|
+
required: true,
|
|
147
|
+
type: String,
|
|
148
|
+
description: "Path to generate files"
|
|
152
149
|
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export { GenerateHttpClientCmd };
|
|
150
|
+
}
|
|
151
|
+
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/cli-generate-http-client",
|
|
3
3
|
"description": "Ts.ED CLI plugin. Export a command that generate an HTTP Client (axios or fetch) from your Ts.ED controllers and OS3 spec.",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "7.0.0-alpha.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/esm/index.js",
|
|
7
7
|
"source": "./src/index.ts",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"tslib": "2.7.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@tsed/cli": "
|
|
30
|
-
"@tsed/cli-core": "
|
|
31
|
-
"@tsed/typescript": "
|
|
29
|
+
"@tsed/cli": "7.0.0-alpha.2",
|
|
30
|
+
"@tsed/cli-core": "7.0.0-alpha.2",
|
|
31
|
+
"@tsed/typescript": "7.0.0-alpha.2",
|
|
32
32
|
"cross-env": "7.0.3",
|
|
33
33
|
"swagger-typescript-api": "^13.0.22",
|
|
34
34
|
"typescript": "5.6.2",
|
|
@@ -53,5 +53,8 @@
|
|
|
53
53
|
},
|
|
54
54
|
"homepage": "https://github.com/tsedio/tsed-cli/tree/master/packages/cli-generate-http-client",
|
|
55
55
|
"author": "Romain Lenzotti",
|
|
56
|
-
"license": "MIT"
|
|
56
|
+
"license": "MIT",
|
|
57
|
+
"publishConfig": {
|
|
58
|
+
"tag": "alpha"
|
|
59
|
+
}
|
|
57
60
|
}
|