@tsed/cli-generate-http-client 6.0.0-beta.1 → 6.0.0-beta.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,16 @@
|
|
|
1
|
-
import { __decorate
|
|
2
|
-
import { CliFs, Command,
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { CliFs, Command, constant, inject, Type } from "@tsed/cli-core";
|
|
3
3
|
import { isString } from "@tsed/core";
|
|
4
|
-
import {
|
|
4
|
+
import { InjectorService } from "@tsed/di";
|
|
5
5
|
import { camelCase } from "change-case";
|
|
6
6
|
import path, { join, resolve } from "path";
|
|
7
7
|
import { generateApi } from "swagger-typescript-api";
|
|
8
8
|
let GenerateHttpClientCmd = class GenerateHttpClientCmd {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.fs = inject(CliFs);
|
|
11
|
+
this.serverModule = constant("server");
|
|
12
|
+
this.options = constant("httpClient", { hooks: {} });
|
|
13
|
+
}
|
|
9
14
|
$mapContext($ctx) {
|
|
10
15
|
return { ...$ctx, output: resolve(join(process.cwd(), $ctx.output)) };
|
|
11
16
|
}
|
|
@@ -109,22 +114,6 @@ let GenerateHttpClientCmd = class GenerateHttpClientCmd {
|
|
|
109
114
|
return routeNameInfo;
|
|
110
115
|
}
|
|
111
116
|
};
|
|
112
|
-
__decorate([
|
|
113
|
-
Inject(),
|
|
114
|
-
__metadata("design:type", InjectorService)
|
|
115
|
-
], GenerateHttpClientCmd.prototype, "injector", void 0);
|
|
116
|
-
__decorate([
|
|
117
|
-
Inject(),
|
|
118
|
-
__metadata("design:type", CliFs)
|
|
119
|
-
], GenerateHttpClientCmd.prototype, "fs", void 0);
|
|
120
|
-
__decorate([
|
|
121
|
-
Constant("server"),
|
|
122
|
-
__metadata("design:type", Type)
|
|
123
|
-
], GenerateHttpClientCmd.prototype, "serverModule", void 0);
|
|
124
|
-
__decorate([
|
|
125
|
-
Constant("httpClient", { hooks: {} }),
|
|
126
|
-
__metadata("design:type", Object)
|
|
127
|
-
], GenerateHttpClientCmd.prototype, "options", void 0);
|
|
128
117
|
GenerateHttpClientCmd = __decorate([
|
|
129
118
|
Command({
|
|
130
119
|
name: "generate-http-client",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CliFs, type CommandProvider, Type } from "@tsed/cli-core";
|
|
2
|
-
import { InjectorService } from "@tsed/di";
|
|
3
2
|
import { type Hooks, type RawRouteInfo, type RouteNameInfo } from "swagger-typescript-api";
|
|
4
3
|
export interface GenerateHttpClientCtx {
|
|
5
4
|
output: string;
|
|
@@ -12,9 +11,8 @@ export interface GenerateHttpClientOpts {
|
|
|
12
11
|
transformOperationId?(operationId: string, routeNameInfo: RouteNameInfo, raw: RawRouteInfo): string;
|
|
13
12
|
}
|
|
14
13
|
export declare class GenerateHttpClientCmd implements CommandProvider {
|
|
15
|
-
injector: InjectorService;
|
|
16
14
|
protected fs: CliFs;
|
|
17
|
-
protected serverModule: Type<any
|
|
15
|
+
protected serverModule: Type<any> | undefined;
|
|
18
16
|
protected options: Partial<GenerateHttpClientOpts>;
|
|
19
17
|
$mapContext($ctx: GenerateHttpClientCtx): {
|
|
20
18
|
output: string;
|
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": "6.0.0-beta.
|
|
4
|
+
"version": "6.0.0-beta.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/esm/index.js",
|
|
7
7
|
"source": "./src/index.ts",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"tslib": "2.7.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@tsed/cli": "6.0.0-beta.
|
|
29
|
-
"@tsed/cli-core": "6.0.0-beta.
|
|
30
|
-
"@tsed/typescript": "6.0.0-beta.
|
|
28
|
+
"@tsed/cli": "6.0.0-beta.2",
|
|
29
|
+
"@tsed/cli-core": "6.0.0-beta.2",
|
|
30
|
+
"@tsed/typescript": "6.0.0-beta.2",
|
|
31
31
|
"cross-env": "7.0.3",
|
|
32
32
|
"swagger-typescript-api": "^13.0.22",
|
|
33
33
|
"typescript": "5.6.2",
|