nestia 2.1.13 → 2.2.0-dev.20220625
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 +28 -29
- package/lib/IConfiguration.d.ts +5 -6
- package/lib/NestiaApplication.d.ts +0 -1
- package/lib/analyses/ControllerAnalyzer.d.ts +0 -1
- package/lib/analyses/GenericAnalyzer.d.ts +0 -1
- package/lib/analyses/ImportAnalyzer.d.ts +2 -3
- package/lib/analyses/ImportAnalyzer.js +3 -2
- package/lib/analyses/ReflectAnalyzer.d.ts +0 -1
- package/lib/analyses/SourceFinder.d.ts +0 -1
- package/lib/executable/internal/CompilerOptions.d.ts +0 -1
- package/lib/executable/internal/CompilerOptions.js +1 -1
- package/lib/executable/internal/NestiaCommand.d.ts +0 -1
- package/lib/executable/internal/NestiaConfig.d.ts +0 -1
- package/lib/executable/internal/NestiaConfig.js +572 -184
- package/lib/executable/internal/nestia.config.getter.d.ts +0 -1
- package/lib/executable/nestia.d.ts +0 -1
- package/lib/executable/nestia.js +1 -1
- package/lib/generates/FileGenerator.d.ts +0 -1
- package/lib/generates/FileGenerator.js +3 -5
- package/lib/generates/FunctionGenerator.d.ts +0 -1
- package/lib/generates/FunctionGenerator.js +7 -9
- package/lib/generates/SdkGenerator.d.ts +0 -1
- package/lib/generates/SwaggerGenerator.d.ts +0 -1
- package/lib/generates/SwaggerGenerator.js +38 -21
- package/lib/index.d.ts +0 -1
- package/lib/module.d.ts +0 -1
- package/lib/structures/IController.d.ts +0 -1
- package/lib/structures/IRoute.d.ts +3 -4
- package/lib/structures/ISwagger.d.ts +0 -1
- package/lib/structures/ITypeTuple.d.ts +5 -0
- package/lib/structures/{IMetadata.js → ITypeTuple.js} +1 -1
- package/lib/structures/MethodType.d.ts +0 -1
- package/lib/structures/ParamCategory.d.ts +0 -1
- package/lib/structures/TypeEntry.d.ts +0 -1
- package/lib/utils/ArrayUtil.d.ts +0 -1
- package/lib/utils/DirectoryUtil.d.ts +0 -1
- package/lib/utils/ImportDictionary.d.ts +0 -1
- package/lib/utils/MapUtil.d.ts +0 -1
- package/lib/utils/StringUtil.d.ts +0 -1
- package/package.json +4 -5
- package/lib/IConfiguration.d.ts.map +0 -1
- package/lib/NestiaApplication.d.ts.map +0 -1
- package/lib/analyses/ControllerAnalyzer.d.ts.map +0 -1
- package/lib/analyses/GenericAnalyzer.d.ts.map +0 -1
- package/lib/analyses/ImportAnalyzer.d.ts.map +0 -1
- package/lib/analyses/ReflectAnalyzer.d.ts.map +0 -1
- package/lib/analyses/SourceFinder.d.ts.map +0 -1
- package/lib/executable/internal/CompilerOptions.d.ts.map +0 -1
- package/lib/executable/internal/NestiaCommand.d.ts.map +0 -1
- package/lib/executable/internal/NestiaConfig.d.ts.map +0 -1
- package/lib/executable/internal/nestia.config.getter.d.ts.map +0 -1
- package/lib/executable/nestia.d.ts.map +0 -1
- package/lib/factories/TypeFactry.d.ts +0 -7
- package/lib/factories/TypeFactry.d.ts.map +0 -1
- package/lib/factories/TypeFactry.js +0 -81
- package/lib/generates/FileGenerator.d.ts.map +0 -1
- package/lib/generates/FunctionGenerator.d.ts.map +0 -1
- package/lib/generates/SdkGenerator.d.ts.map +0 -1
- package/lib/generates/SwaggerGenerator.d.ts.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/module.d.ts.map +0 -1
- package/lib/structures/IController.d.ts.map +0 -1
- package/lib/structures/IMetadata.d.ts +0 -21
- package/lib/structures/IMetadata.d.ts.map +0 -1
- package/lib/structures/IRoute.d.ts.map +0 -1
- package/lib/structures/ISwagger.d.ts.map +0 -1
- package/lib/structures/IType.d.ts +0 -6
- package/lib/structures/IType.d.ts.map +0 -1
- package/lib/structures/IType.js +0 -3
- package/lib/structures/MethodType.d.ts.map +0 -1
- package/lib/structures/ParamCategory.d.ts.map +0 -1
- package/lib/structures/TypeEntry.d.ts.map +0 -1
- package/lib/utils/ArrayUtil.d.ts.map +0 -1
- package/lib/utils/DirectoryUtil.d.ts.map +0 -1
- package/lib/utils/ImportDictionary.d.ts.map +0 -1
- package/lib/utils/MapUtil.d.ts.map +0 -1
- package/lib/utils/StringUtil.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -421,11 +421,11 @@ Look at the below code and feel how powerful `nestia` is. It should be stated th
|
|
|
421
421
|
- 2nd sub-type controller, [`ConsumerSaleQuestionsController`](https://github.com/samchon/nestia/tree/master/demo/generic/src/controllers/ConsumerSaleQuestionsController.ts)
|
|
422
422
|
- Union controller, [`ConsumerSaleEntireArticlesController`](https://github.com/samchon/nestia/tree/master/demo/union/src/controllers/ConsumerSaleEntireArticlesController.ts)
|
|
423
423
|
|
|
424
|
-
> [typescript-
|
|
424
|
+
> [typescript-json](https://github.com/samchon/typescript-json) can replace the class-validator with only one line.
|
|
425
425
|
>
|
|
426
426
|
> ```typescript
|
|
427
427
|
> import * as nest from "@nestjs/common";
|
|
428
|
-
> import {
|
|
428
|
+
> import { assert } from "typescript-json";
|
|
429
429
|
>
|
|
430
430
|
> @nest.Controller("consumers/:section/sales/:saleId/questions")
|
|
431
431
|
> export class SaleQuestionsController
|
|
@@ -436,7 +436,7 @@ Look at the below code and feel how powerful `nestia` is. It should be stated th
|
|
|
436
436
|
> {
|
|
437
437
|
> public constructor()
|
|
438
438
|
> {
|
|
439
|
-
> super(input =>
|
|
439
|
+
> super(input => assert(input));
|
|
440
440
|
> }
|
|
441
441
|
> }
|
|
442
442
|
> ```
|
|
@@ -543,7 +543,7 @@ Furthermore, there's not any problem even when a generic typed controller class
|
|
|
543
543
|
//================================================================
|
|
544
544
|
import { Fetcher, Primitive } from "nestia-fetcher";
|
|
545
545
|
import type { IConnection } from "nestia-fetcher";
|
|
546
|
-
import
|
|
546
|
+
import TSON from "typescript-json";
|
|
547
547
|
|
|
548
548
|
import type { ISaleReview } from "./../../../../structures/ISaleReview";
|
|
549
549
|
import type { ISaleInquiry } from "./../../../../structures/ISaleInquiry";
|
|
@@ -600,7 +600,7 @@ export namespace store
|
|
|
600
600
|
{
|
|
601
601
|
return `/consumers/${section}/sales/${saleId}/reviews`;
|
|
602
602
|
}
|
|
603
|
-
export const stringify =
|
|
603
|
+
export const stringify = (input: Input) => TSON.stringify(input);
|
|
604
604
|
}
|
|
605
605
|
|
|
606
606
|
/**
|
|
@@ -660,7 +660,7 @@ export namespace update
|
|
|
660
660
|
{
|
|
661
661
|
return `/consumers/${section}/sales/${saleId}/reviews/${id}`;
|
|
662
662
|
}
|
|
663
|
-
export const stringify =
|
|
663
|
+
export const stringify = (input: Input) => TSON.stringify(input);
|
|
664
664
|
}
|
|
665
665
|
```
|
|
666
666
|
|
|
@@ -730,31 +730,31 @@ The detailed options are listed up to the `IConfiguration` interface. You can ut
|
|
|
730
730
|
*/
|
|
731
731
|
export interface IConfiguration {
|
|
732
732
|
/**
|
|
733
|
-
* List of files or directories containing the
|
|
733
|
+
* List of files or directories containing the NestJS controller classes.
|
|
734
734
|
*/
|
|
735
735
|
input: string | string[] | IConfiguration.IInput;
|
|
736
736
|
|
|
737
737
|
/**
|
|
738
738
|
* Output directory that SDK would be placed in.
|
|
739
|
-
*
|
|
739
|
+
*
|
|
740
740
|
* If not configured, you can't build the SDK library.
|
|
741
741
|
*/
|
|
742
742
|
output?: string;
|
|
743
743
|
|
|
744
744
|
/**
|
|
745
745
|
* Compiler options for the TypeScript.
|
|
746
|
-
*
|
|
746
|
+
*
|
|
747
747
|
* If you've omitted this property or the assigned property cannot fully cover the
|
|
748
748
|
* `tsconfig.json`, the properties from the `tsconfig.json` would be assigned to here.
|
|
749
|
-
* Otherwise, this property has been configured and it's detailed values are different
|
|
750
|
-
* with the `tsconfig.json`, this property values would be
|
|
751
|
-
*
|
|
749
|
+
* Otherwise, this property has been configured and it's detailed values are different
|
|
750
|
+
* with the `tsconfig.json`, this property values would be used instead.
|
|
751
|
+
*
|
|
752
752
|
* ```typescript
|
|
753
753
|
* import ts from "typescript";
|
|
754
|
-
*
|
|
754
|
+
*
|
|
755
755
|
* const tsconfig: ts.TsConfig;
|
|
756
756
|
* const nestiaConfig: IConfiguration;
|
|
757
|
-
*
|
|
757
|
+
*
|
|
758
758
|
* const compilerOptions: ts.CompilerOptions = {
|
|
759
759
|
* ...tsconfig.compilerOptions,
|
|
760
760
|
* ...(nestiaConfig.compilerOptions || {})
|
|
@@ -765,39 +765,38 @@ export interface IConfiguration {
|
|
|
765
765
|
|
|
766
766
|
/**
|
|
767
767
|
* Whether to assert parameter types or not.
|
|
768
|
-
*
|
|
768
|
+
*
|
|
769
769
|
* If you configure this property to be `true`, all of the function parameters would be
|
|
770
|
-
* checked through the [typescript-
|
|
771
|
-
* option would make your SDK library slower, but would
|
|
772
|
-
*
|
|
770
|
+
* checked through the [typescript-json](https://github.com/samchon/typescript-json#runtime-type-checkers).
|
|
771
|
+
* This option would make your SDK library slower, but would enahcne the type safety even
|
|
772
|
+
* in the runtime level.
|
|
773
773
|
*/
|
|
774
774
|
assert?: boolean;
|
|
775
775
|
|
|
776
776
|
/**
|
|
777
777
|
* Whether to optimize JSON string conversion 2x faster or not.
|
|
778
|
-
*
|
|
778
|
+
*
|
|
779
779
|
* If you configure this property to be `true`, the SDK library would utilize the
|
|
780
|
-
* [typescript-json](https://github.com/samchon/typescript-json)
|
|
781
|
-
* conversion speed really be 2x faster.
|
|
780
|
+
* [typescript-json](https://github.com/samchon/typescript-json#fastest-json-string-converter)
|
|
781
|
+
* and the JSON string conversion speed really be 2x faster.
|
|
782
782
|
*/
|
|
783
783
|
json?: boolean;
|
|
784
784
|
|
|
785
785
|
/**
|
|
786
786
|
* Building `swagger.json` is also possible.
|
|
787
|
-
*
|
|
787
|
+
*
|
|
788
788
|
* If not specified, you can't build the `swagger.json`.
|
|
789
789
|
*/
|
|
790
790
|
swagger?: IConfiguration.ISwagger;
|
|
791
791
|
}
|
|
792
|
-
export namespace IConfiguration
|
|
793
|
-
{
|
|
792
|
+
export namespace IConfiguration {
|
|
794
793
|
/**
|
|
795
|
-
* List of files or directories to include or exclude to specifying the
|
|
794
|
+
* List of files or directories to include or exclude to specifying the NestJS
|
|
796
795
|
* controllers.
|
|
797
796
|
*/
|
|
798
797
|
export interface IInput {
|
|
799
798
|
/**
|
|
800
|
-
* List of files or directories containing the
|
|
799
|
+
* List of files or directories containing the NestJS controller classes.
|
|
801
800
|
*/
|
|
802
801
|
include: string[];
|
|
803
802
|
|
|
@@ -813,9 +812,9 @@ export namespace IConfiguration
|
|
|
813
812
|
export interface ISwagger {
|
|
814
813
|
/**
|
|
815
814
|
* Output path of the `swagger.json`.
|
|
816
|
-
*
|
|
817
|
-
* If you've configured only directory, the file name would be the `swagger.json`.
|
|
818
|
-
* Otherwise you've configured the full path with file name and extension, the
|
|
815
|
+
*
|
|
816
|
+
* If you've configured only directory, the file name would be the `swagger.json`.
|
|
817
|
+
* Otherwise you've configured the full path with file name and extension, the
|
|
819
818
|
* `swagger.json` file would be renamed to it.
|
|
820
819
|
*/
|
|
821
820
|
output: string;
|
package/lib/IConfiguration.d.ts
CHANGED
|
@@ -40,17 +40,17 @@ export interface IConfiguration {
|
|
|
40
40
|
* Whether to assert parameter types or not.
|
|
41
41
|
*
|
|
42
42
|
* If you configure this property to be `true`, all of the function parameters would be
|
|
43
|
-
* checked through the [typescript-
|
|
44
|
-
* option would make your SDK library slower, but would enahcne the type safety even
|
|
45
|
-
* the runtime level.
|
|
43
|
+
* checked through the [typescript-json](https://github.com/samchon/typescript-json#runtime-type-checkers).
|
|
44
|
+
* This option would make your SDK library slower, but would enahcne the type safety even
|
|
45
|
+
* in the runtime level.
|
|
46
46
|
*/
|
|
47
47
|
assert?: boolean;
|
|
48
48
|
/**
|
|
49
49
|
* Whether to optimize JSON string conversion 2x faster or not.
|
|
50
50
|
*
|
|
51
51
|
* If you configure this property to be `true`, the SDK library would utilize the
|
|
52
|
-
* [typescript-json](https://github.com/samchon/typescript-json)
|
|
53
|
-
* conversion speed really be 2x faster.
|
|
52
|
+
* [typescript-json](https://github.com/samchon/typescript-json#fastest-json-string-converter)
|
|
53
|
+
* and the JSON string conversion speed really be 2x faster.
|
|
54
54
|
*/
|
|
55
55
|
json?: boolean;
|
|
56
56
|
/**
|
|
@@ -89,4 +89,3 @@ export declare namespace IConfiguration {
|
|
|
89
89
|
output: string;
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
//# sourceMappingURL=IConfiguration.d.ts.map
|
|
@@ -2,13 +2,12 @@ import ts from "typescript";
|
|
|
2
2
|
import { HashMap } from "tstl/container/HashMap";
|
|
3
3
|
import { HashSet } from "tstl/container/HashSet";
|
|
4
4
|
import { GenericAnalyzer } from "./GenericAnalyzer";
|
|
5
|
-
import {
|
|
5
|
+
import { ITypeTuple } from "../structures/ITypeTuple";
|
|
6
6
|
export declare namespace ImportAnalyzer {
|
|
7
7
|
interface IOutput {
|
|
8
8
|
features: [string, string[]][];
|
|
9
9
|
alias: string;
|
|
10
10
|
}
|
|
11
11
|
type Dictionary = HashMap<string, HashSet<string>>;
|
|
12
|
-
function analyze(checker: ts.TypeChecker, genericDict: GenericAnalyzer.Dictionary, importDict: Dictionary, type: ts.Type):
|
|
12
|
+
function analyze(checker: ts.TypeChecker, genericDict: GenericAnalyzer.Dictionary, importDict: Dictionary, type: ts.Type): ITypeTuple;
|
|
13
13
|
}
|
|
14
|
-
//# sourceMappingURL=ImportAnalyzer.d.ts.map
|
|
@@ -9,9 +9,10 @@ var HashSet_1 = require("tstl/container/HashSet");
|
|
|
9
9
|
var ImportAnalyzer;
|
|
10
10
|
(function (ImportAnalyzer) {
|
|
11
11
|
function analyze(checker, genericDict, importDict, type) {
|
|
12
|
+
type = get_type(checker, type);
|
|
12
13
|
return {
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
type: type,
|
|
15
|
+
name: explore_escaped_name(checker, genericDict, importDict, type),
|
|
15
16
|
};
|
|
16
17
|
}
|
|
17
18
|
ImportAnalyzer.analyze = analyze;
|
|
@@ -90,7 +90,7 @@ var CompilerOptions;
|
|
|
90
90
|
};
|
|
91
91
|
if (assert === true)
|
|
92
92
|
emplace({
|
|
93
|
-
transform: "typescript-
|
|
93
|
+
transform: "typescript-json/lib/transform",
|
|
94
94
|
});
|
|
95
95
|
if (options.paths && Object.entries(options.paths).length !== 0)
|
|
96
96
|
emplace({ transform: "typescript-transform-paths" });
|