nestia 2.0.11 → 2.0.13
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 +18 -3
- package/lib/IConfiguration.d.ts +54 -0
- package/lib/IConfiguration.d.ts.map +1 -0
- package/{bin → lib}/IConfiguration.js +0 -0
- package/{bin → lib}/NestiaApplication.d.ts +0 -0
- package/{bin → lib}/NestiaApplication.d.ts.map +0 -0
- package/{bin → lib}/NestiaApplication.js +0 -0
- package/{bin → lib}/analyses/ControllerAnalyzer.d.ts +0 -0
- package/{bin → lib}/analyses/ControllerAnalyzer.d.ts.map +0 -0
- package/{bin → lib}/analyses/ControllerAnalyzer.js +0 -0
- package/{bin → lib}/analyses/GenericAnalyzer.d.ts +0 -0
- package/{bin → lib}/analyses/GenericAnalyzer.d.ts.map +0 -0
- package/{bin → lib}/analyses/GenericAnalyzer.js +0 -0
- package/{bin → lib}/analyses/ImportAnalyzer.d.ts +0 -0
- package/{bin → lib}/analyses/ImportAnalyzer.d.ts.map +0 -0
- package/{bin → lib}/analyses/ImportAnalyzer.js +0 -0
- package/{bin → lib}/analyses/ReflectAnalyzer.d.ts +0 -0
- package/{bin → lib}/analyses/ReflectAnalyzer.d.ts.map +0 -0
- package/{bin → lib}/analyses/ReflectAnalyzer.js +0 -0
- package/{bin → lib}/analyses/SourceFinder.d.ts +0 -0
- package/{bin → lib}/analyses/SourceFinder.d.ts.map +0 -0
- package/{bin → lib}/analyses/SourceFinder.js +0 -0
- package/{bin → lib}/executable/internal/CompilerOptions.d.ts +0 -0
- package/{bin → lib}/executable/internal/CompilerOptions.d.ts.map +0 -0
- package/{bin → lib}/executable/internal/CompilerOptions.js +0 -0
- package/{bin → lib}/executable/internal/NestiaConfig.d.ts +0 -0
- package/{bin → lib}/executable/internal/NestiaConfig.d.ts.map +1 -1
- package/{bin → lib}/executable/internal/NestiaConfig.js +12 -2
- package/{bin → lib}/executable/internal/NestiaSdkCli.d.ts +0 -0
- package/{bin → lib}/executable/internal/NestiaSdkCli.d.ts.map +0 -0
- package/{bin → lib}/executable/internal/NestiaSdkCli.js +0 -0
- package/{bin → lib}/executable/internal/nestia.config.getter.d.ts +0 -0
- package/{bin → lib}/executable/internal/nestia.config.getter.d.ts.map +0 -0
- package/{bin → lib}/executable/internal/nestia.config.getter.js +0 -0
- package/{bin → lib}/executable/nestia.d.ts +0 -0
- package/{bin → lib}/executable/nestia.d.ts.map +0 -0
- package/{bin → lib}/executable/nestia.js +0 -0
- package/{bin → lib}/generates/FileGenerator.d.ts +0 -0
- package/{bin → lib}/generates/FileGenerator.d.ts.map +0 -0
- package/{bin → lib}/generates/FileGenerator.js +0 -0
- package/{bin → lib}/generates/FunctionGenerator.d.ts +0 -0
- package/{bin → lib}/generates/FunctionGenerator.d.ts.map +0 -0
- package/{bin → lib}/generates/FunctionGenerator.js +1 -1
- package/{bin → lib}/generates/SdkGenerator.d.ts +0 -0
- package/{bin → lib}/generates/SdkGenerator.d.ts.map +0 -0
- package/{bin → lib}/generates/SdkGenerator.js +0 -0
- package/{bin → lib}/index.d.ts +0 -0
- package/{bin → lib}/index.d.ts.map +0 -0
- package/{bin → lib}/index.js +0 -0
- package/{bin → lib}/module.d.ts +0 -0
- package/{bin → lib}/module.d.ts.map +0 -0
- package/{bin → lib}/module.js +0 -0
- package/{bin → lib}/structures/IController.d.ts +0 -0
- package/{bin → lib}/structures/IController.d.ts.map +0 -0
- package/{bin → lib}/structures/IController.js +0 -0
- package/{bin → lib}/structures/IRoute.d.ts +0 -0
- package/{bin → lib}/structures/IRoute.d.ts.map +0 -0
- package/{bin → lib}/structures/IRoute.js +0 -0
- package/{bin → lib}/structures/MethodType.d.ts +0 -0
- package/{bin → lib}/structures/MethodType.d.ts.map +0 -0
- package/{bin → lib}/structures/MethodType.js +0 -0
- package/{bin → lib}/structures/ParamCategory.d.ts +0 -0
- package/{bin → lib}/structures/ParamCategory.d.ts.map +0 -0
- package/{bin → lib}/structures/ParamCategory.js +0 -0
- package/{bin → lib}/utils/ArrayUtil.d.ts +0 -0
- package/{bin → lib}/utils/ArrayUtil.d.ts.map +0 -0
- package/{bin → lib}/utils/ArrayUtil.js +0 -0
- package/{bin → lib}/utils/DirectoryUtil.d.ts +0 -0
- package/{bin → lib}/utils/DirectoryUtil.d.ts.map +0 -0
- package/{bin → lib}/utils/DirectoryUtil.js +0 -0
- package/{bin → lib}/utils/ImportDictionary.d.ts +0 -0
- package/{bin → lib}/utils/ImportDictionary.d.ts.map +0 -0
- package/{bin → lib}/utils/ImportDictionary.js +0 -0
- package/{bin → lib}/utils/StringUtil.d.ts +0 -0
- package/{bin → lib}/utils/StringUtil.d.ts.map +0 -0
- package/{bin → lib}/utils/StringUtil.js +0 -0
- package/{bin → lib}/utils/stripJsonComments.d.ts +0 -0
- package/{bin → lib}/utils/stripJsonComments.d.ts.map +0 -0
- package/{bin → lib}/utils/stripJsonComments.js +0 -0
- package/package.json +5 -5
- package/bin/IConfiguration.d.ts +0 -15
- package/bin/IConfiguration.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -102,19 +102,27 @@ The `npx nestia install` command installs those dependencies with `package.json`
|
|
|
102
102
|
## Advanced
|
|
103
103
|
### `nestia.config.ts`
|
|
104
104
|
```typescript
|
|
105
|
+
/**
|
|
106
|
+
* Definition for the `nestia.config.ts` file.
|
|
107
|
+
*
|
|
108
|
+
* @author Samchon
|
|
109
|
+
*/
|
|
105
110
|
export interface IConfiguration
|
|
106
111
|
{
|
|
107
112
|
/**
|
|
108
113
|
* Whether to assert parameter types or not.
|
|
114
|
+
*
|
|
115
|
+
* If you configure this option to be `true`, all of the function parameters would be
|
|
116
|
+
* checked through the [typescript-is](https://github.com/woutervh-/typescript-is).
|
|
109
117
|
*/
|
|
110
118
|
assert?: boolean;
|
|
111
119
|
|
|
112
120
|
/**
|
|
113
|
-
* Whether to optimize JSON string conversion or not.
|
|
121
|
+
* Whether to optimize JSON string conversion 2x faster or not.
|
|
114
122
|
*
|
|
115
123
|
* If you configure this option to be `true`, the SDK library would utilize the
|
|
116
124
|
* [typescript-json](https://github.com/samchon/typescript-json) and the JSON string
|
|
117
|
-
* conversion speed really be
|
|
125
|
+
* conversion speed really be 2x faster.
|
|
118
126
|
*/
|
|
119
127
|
json?: boolean;
|
|
120
128
|
|
|
@@ -137,6 +145,10 @@ export interface IConfiguration
|
|
|
137
145
|
}
|
|
138
146
|
export namespace IConfiguration
|
|
139
147
|
{
|
|
148
|
+
/**
|
|
149
|
+
* List of files or directories to include or exclude to specifying the NestJS
|
|
150
|
+
* controllers.
|
|
151
|
+
*/
|
|
140
152
|
export interface IInput
|
|
141
153
|
{
|
|
142
154
|
/**
|
|
@@ -157,11 +169,14 @@ Instead of specifying `input` and `output` directories using the cli options, yo
|
|
|
157
169
|
Write below content as the `nestia.config.ts` file and place it onto the root directory of your backend project. After the configuration, you can generate the SDK only with the `npx nestia sdk` command, without any directory specification.
|
|
158
170
|
|
|
159
171
|
```typescript
|
|
160
|
-
|
|
172
|
+
import type nestia from "nestia";
|
|
173
|
+
|
|
174
|
+
const config: nestia.IConfiguration = {
|
|
161
175
|
input: "src/controllers",
|
|
162
176
|
output: "src/api",
|
|
163
177
|
assert: false
|
|
164
178
|
};
|
|
179
|
+
export default config;
|
|
165
180
|
```
|
|
166
181
|
|
|
167
182
|
> Alternative options for the regular NestJS project:
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as tsc from "typescript";
|
|
2
|
+
/**
|
|
3
|
+
* Definition for the `nestia.config.ts` file.
|
|
4
|
+
*
|
|
5
|
+
* @author Samchon
|
|
6
|
+
*/
|
|
7
|
+
export interface IConfiguration {
|
|
8
|
+
/**
|
|
9
|
+
* List of files or directories containing the NestJS controller classes.
|
|
10
|
+
*/
|
|
11
|
+
input: string | string[] | IConfiguration.IInput;
|
|
12
|
+
/**
|
|
13
|
+
* Output directory that SDK would be placed in.
|
|
14
|
+
*/
|
|
15
|
+
output: string;
|
|
16
|
+
/**
|
|
17
|
+
* Compiler options for the TypeScript.
|
|
18
|
+
*
|
|
19
|
+
* If omitted, the configuration would follow the `tsconfig.json`.
|
|
20
|
+
*/
|
|
21
|
+
compilerOptions?: tsc.CompilerOptions;
|
|
22
|
+
/**
|
|
23
|
+
* Whether to assert parameter types or not.
|
|
24
|
+
*
|
|
25
|
+
* If you configure this option to be `true`, all of the function parameters would be
|
|
26
|
+
* checked through the [typescript-is](https://github.com/woutervh-/typescript-is).
|
|
27
|
+
*/
|
|
28
|
+
assert?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether to optimize JSON string conversion 2x faster or not.
|
|
31
|
+
*
|
|
32
|
+
* If you configure this option to be `true`, the SDK library would utilize the
|
|
33
|
+
* [typescript-json](https://github.com/samchon/typescript-json) and the JSON string
|
|
34
|
+
* conversion speed really be 2x faster.
|
|
35
|
+
*/
|
|
36
|
+
json?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare namespace IConfiguration {
|
|
39
|
+
/**
|
|
40
|
+
* List of files or directories to include or exclude to specifying the NestJS
|
|
41
|
+
* controllers.
|
|
42
|
+
*/
|
|
43
|
+
interface IInput {
|
|
44
|
+
/**
|
|
45
|
+
* List of files or directories containing the NestJS controller classes.
|
|
46
|
+
*/
|
|
47
|
+
include: string[];
|
|
48
|
+
/**
|
|
49
|
+
* List of files or directories to be excluded.
|
|
50
|
+
*/
|
|
51
|
+
exclude?: string[];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=IConfiguration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IConfiguration.d.ts","sourceRoot":"","sources":["../src/IConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,YAAY,CAAC;AAElC;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAE3B;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC;IAEjD;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,eAAe,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC;IAEtC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AACD,yBAAiB,cAAc,CAC/B;IACI;;;OAGG;IACH,UAAiB,MAAM;QAEnB;;WAEG;QACH,OAAO,EAAE,MAAM,EAAE,CAAC;QAElB;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACtB;CACJ"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestiaConfig.d.ts","sourceRoot":"","sources":["../../../src/executable/internal/NestiaConfig.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,yBAAiB,YAAY,CAC7B;IACI,SAAgB,GAAG,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAGpD;
|
|
1
|
+
{"version":3,"file":"NestiaConfig.d.ts","sourceRoot":"","sources":["../../../src/executable/internal/NestiaConfig.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,yBAAiB,YAAY,CAC7B;IACI,SAAgB,GAAG,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAGpD;CAuCJ"}
|
|
@@ -186,7 +186,7 @@ var NestiaConfig;
|
|
|
186
186
|
return config;
|
|
187
187
|
}
|
|
188
188
|
var singleton = new Singleton_1.Singleton(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
189
|
-
var config;
|
|
189
|
+
var config, trial;
|
|
190
190
|
return __generator(this, function (_a) {
|
|
191
191
|
switch (_a.label) {
|
|
192
192
|
case 0:
|
|
@@ -201,7 +201,17 @@ var NestiaConfig;
|
|
|
201
201
|
return [4 /*yield*/, Promise.resolve().then(function () { return __importStar(require(path.resolve("nestia.config.ts"))); })];
|
|
202
202
|
case 1:
|
|
203
203
|
config = _a.sent();
|
|
204
|
-
|
|
204
|
+
try {
|
|
205
|
+
return [2 /*return*/, assert(nestia_fetcher_1.Primitive.clone(config))];
|
|
206
|
+
}
|
|
207
|
+
catch (exp) {
|
|
208
|
+
trial = config;
|
|
209
|
+
if (trial.default && typeof trial.default === "object")
|
|
210
|
+
return [2 /*return*/, assert(nestia_fetcher_1.Primitive.clone(trial.default))];
|
|
211
|
+
else
|
|
212
|
+
throw exp;
|
|
213
|
+
}
|
|
214
|
+
return [2 /*return*/];
|
|
205
215
|
}
|
|
206
216
|
});
|
|
207
217
|
}); });
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -206,7 +206,7 @@ var FunctionGenerator;
|
|
|
206
206
|
+ " }\n"
|
|
207
207
|
+
|
|
208
208
|
(config.json === true && (route.method === "POST" || route.method === "PUT" || route.method === "PATCH")
|
|
209
|
-
? " export const stringify = createStringifier<Input>()
|
|
209
|
+
? " export const stringify = createStringifier<Input>();\n"
|
|
210
210
|
: "")
|
|
211
211
|
+ "}";
|
|
212
212
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/{bin → lib}/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
package/{bin → lib}/index.js
RENAMED
|
File without changes
|
package/{bin → lib}/module.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
package/{bin → lib}/module.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nestia",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
4
4
|
"description": "Automatic SDK and Document generator for the NestJS",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"bin": {
|
|
8
|
-
"nestia": "./
|
|
8
|
+
"nestia": "./lib/executable/nestia.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "rimraf
|
|
11
|
+
"build": "rimraf lib && ttsc",
|
|
12
12
|
"dev": "npm run build -- --watch",
|
|
13
|
-
"test": "node
|
|
13
|
+
"test": "node lib/test"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"ttypescript": "^1.5.13",
|
|
43
43
|
"typescript": "^4.6.3",
|
|
44
44
|
"typescript-is": "^0.19.0",
|
|
45
|
-
"typescript-json": "^2.0.
|
|
45
|
+
"typescript-json": "^2.0.2",
|
|
46
46
|
"typescript-transform-paths": "^3.3.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
package/bin/IConfiguration.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as tsc from "typescript";
|
|
2
|
-
export interface IConfiguration {
|
|
3
|
-
input: string | string[] | IConfiguration.IInput;
|
|
4
|
-
output: string;
|
|
5
|
-
compilerOptions?: tsc.CompilerOptions;
|
|
6
|
-
assert?: boolean;
|
|
7
|
-
json?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare namespace IConfiguration {
|
|
10
|
-
interface IInput {
|
|
11
|
-
include: string[];
|
|
12
|
-
exclude?: string[];
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=IConfiguration.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IConfiguration.d.ts","sourceRoot":"","sources":["../src/IConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,YAAY,CAAC;AAElC,MAAM,WAAW,cAAc;IAE3B,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC;IACtC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AACD,yBAAiB,cAAc,CAC/B;IACI,UAAiB,MAAM;QAEnB,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACtB;CACJ"}
|