@nestia/sdk 7.0.0-dev.20250607 → 7.0.0
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/LICENSE +21 -21
- package/README.md +92 -92
- package/assets/bundle/api/HttpError.ts +1 -1
- package/assets/bundle/api/IConnection.ts +1 -1
- package/assets/bundle/api/Primitive.ts +1 -1
- package/assets/bundle/api/Resolved.ts +1 -1
- package/assets/bundle/api/index.ts +4 -4
- package/assets/bundle/api/module.ts +6 -6
- package/assets/bundle/distribute/README.md +37 -37
- package/assets/bundle/distribute/package.json +28 -28
- package/assets/bundle/distribute/tsconfig.json +109 -109
- package/assets/bundle/e2e/index.ts +42 -42
- package/assets/config/nestia.config.ts +97 -97
- package/lib/executable/internal/NestiaConfigLoader.js +4 -4
- package/lib/executable/sdk.js +12 -12
- package/package.json +5 -5
- package/src/INestiaConfig.ts +269 -269
- package/src/NestiaSdkApplication.ts +307 -307
- package/src/NestiaSwaggerComposer.ts +138 -138
- package/src/analyses/AccessorAnalyzer.ts +67 -67
- package/src/analyses/ConfigAnalyzer.ts +155 -155
- package/src/analyses/ExceptionAnalyzer.ts +154 -154
- package/src/analyses/GenericAnalyzer.ts +49 -49
- package/src/analyses/ImportAnalyzer.ts +171 -171
- package/src/analyses/PathAnalyzer.ts +69 -69
- package/src/analyses/ReflectControllerAnalyzer.ts +105 -105
- package/src/analyses/ReflectHttpOperationAnalyzer.ts +183 -183
- package/src/analyses/ReflectHttpOperationExceptionAnalyzer.ts +71 -71
- package/src/analyses/ReflectHttpOperationParameterAnalyzer.ts +348 -348
- package/src/analyses/ReflectHttpOperationResponseAnalyzer.ts +127 -127
- package/src/analyses/ReflectMetadataAnalyzer.ts +44 -44
- package/src/analyses/ReflectWebSocketOperationAnalyzer.ts +172 -172
- package/src/analyses/SecurityAnalyzer.ts +25 -25
- package/src/analyses/TypedHttpRouteAnalyzer.ts +204 -204
- package/src/analyses/TypedWebSocketRouteAnalyzer.ts +33 -33
- package/src/decorators/OperationMetadata.ts +15 -15
- package/src/executable/internal/CommandParser.ts +15 -15
- package/src/executable/internal/NestiaConfigLoader.ts +78 -78
- package/src/executable/internal/NestiaSdkCommand.ts +103 -103
- package/src/executable/sdk.ts +75 -75
- package/src/generates/CloneGenerator.ts +66 -66
- package/src/generates/E2eGenerator.ts +32 -32
- package/src/generates/SdkGenerator.ts +160 -160
- package/src/generates/SwaggerGenerator.ts +284 -284
- package/src/generates/internal/E2eFileProgrammer.ts +205 -205
- package/src/generates/internal/FilePrinter.ts +53 -53
- package/src/generates/internal/ImportDictionary.ts +163 -163
- package/src/generates/internal/SdkAliasCollection.ts +255 -255
- package/src/generates/internal/SdkDistributionComposer.ts +103 -103
- package/src/generates/internal/SdkFileProgrammer.ts +116 -116
- package/src/generates/internal/SdkHttpCloneProgrammer.ts +124 -124
- package/src/generates/internal/SdkHttpCloneReferencer.ts +75 -75
- package/src/generates/internal/SdkHttpFunctionProgrammer.ts +276 -276
- package/src/generates/internal/SdkHttpNamespaceProgrammer.ts +500 -500
- package/src/generates/internal/SdkHttpParameterProgrammer.ts +178 -178
- package/src/generates/internal/SdkHttpRouteProgrammer.ts +107 -107
- package/src/generates/internal/SdkHttpSimulationProgrammer.ts +340 -340
- package/src/generates/internal/SdkImportWizard.ts +55 -55
- package/src/generates/internal/SdkRouteDirectory.ts +18 -18
- package/src/generates/internal/SdkTypeProgrammer.ts +384 -384
- package/src/generates/internal/SdkTypeTagProgrammer.ts +102 -102
- package/src/generates/internal/SdkWebSocketNamespaceProgrammer.ts +366 -366
- package/src/generates/internal/SdkWebSocketParameterProgrammer.ts +87 -87
- package/src/generates/internal/SdkWebSocketRouteProgrammer.ts +279 -279
- package/src/generates/internal/SwaggerDescriptionComposer.ts +64 -64
- package/src/generates/internal/SwaggerOperationComposer.ts +119 -119
- package/src/generates/internal/SwaggerOperationParameterComposer.ts +177 -177
- package/src/generates/internal/SwaggerOperationResponseComposer.ts +110 -110
- package/src/index.ts +4 -4
- package/src/module.ts +3 -3
- package/src/structures/INestiaProject.ts +13 -13
- package/src/structures/INestiaSdkInput.ts +20 -20
- package/src/structures/IReflectApplication.ts +8 -8
- package/src/structures/IReflectController.ts +15 -15
- package/src/structures/IReflectHttpOperation.ts +26 -26
- package/src/structures/IReflectHttpOperationException.ts +19 -19
- package/src/structures/IReflectHttpOperationParameter.ts +81 -81
- package/src/structures/IReflectHttpOperationSuccess.ts +22 -22
- package/src/structures/IReflectOperationError.ts +26 -26
- package/src/structures/IReflectType.ts +4 -4
- package/src/structures/IReflectTypeImport.ts +4 -4
- package/src/structures/IReflectWebSocketOperation.ts +17 -17
- package/src/structures/IReflectWebSocketOperationParameter.ts +38 -38
- package/src/structures/ITypedApplication.ts +11 -11
- package/src/structures/ITypedHttpRoute.ts +41 -41
- package/src/structures/ITypedHttpRouteException.ts +15 -15
- package/src/structures/ITypedHttpRouteParameter.ts +41 -41
- package/src/structures/ITypedHttpRouteSuccess.ts +22 -22
- package/src/structures/ITypedWebSocketRoute.ts +24 -24
- package/src/structures/ITypedWebSocketRouteParameter.ts +3 -3
- package/src/structures/MethodType.ts +5 -5
- package/src/structures/ParamCategory.ts +1 -1
- package/src/structures/TypeEntry.ts +22 -22
- package/src/transform.ts +9 -9
- package/src/transformers/IOperationMetadata.ts +44 -44
- package/src/transformers/ISdkOperationTransformerContext.ts +8 -8
- package/src/transformers/SdkOperationProgrammer.ts +209 -209
- package/src/transformers/SdkOperationTransformer.ts +253 -253
- package/src/transformers/TextPlainValidator.ts +17 -17
- package/src/typings/get-function-location.d.ts +7 -7
- package/src/utils/ArrayUtil.ts +26 -26
- package/src/utils/FileRetriever.ts +22 -22
- package/src/utils/MapUtil.ts +14 -14
- package/src/utils/MetadataUtil.ts +26 -26
- package/src/utils/PathUtil.ts +10 -10
- package/src/utils/SourceFinder.ts +66 -66
- package/src/utils/StringUtil.ts +17 -17
- package/src/utils/StripEnums.ts +5 -5
- package/src/utils/VersioningStrategy.ts +28 -28
- package/src/validators/HttpHeadersValidator.ts +34 -34
- package/src/validators/HttpQueryValidator.ts +34 -34
|
@@ -1,109 +1,109 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
4
|
-
|
|
5
|
-
/* Projects */
|
|
6
|
-
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
7
|
-
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
-
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
|
9
|
-
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
10
|
-
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
-
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
|
-
|
|
13
|
-
/* Language and Environment */
|
|
14
|
-
"target": "ES5", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
15
|
-
"lib": [
|
|
16
|
-
"DOM",
|
|
17
|
-
"ES2015"
|
|
18
|
-
], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
19
|
-
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
20
|
-
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
|
21
|
-
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
22
|
-
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
23
|
-
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
24
|
-
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
25
|
-
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
26
|
-
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
27
|
-
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
28
|
-
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
29
|
-
|
|
30
|
-
/* Modules */
|
|
31
|
-
"module": "commonjs", /* Specify what module code is generated. */
|
|
32
|
-
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
33
|
-
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
34
|
-
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
35
|
-
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
36
|
-
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
37
|
-
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
38
|
-
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
39
|
-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
40
|
-
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
41
|
-
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
42
|
-
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
43
|
-
|
|
44
|
-
/* JavaScript Support */
|
|
45
|
-
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
46
|
-
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
47
|
-
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
48
|
-
|
|
49
|
-
/* Emit */
|
|
50
|
-
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
51
|
-
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
52
|
-
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
53
|
-
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
54
|
-
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
55
|
-
"outDir": "./lib", /* Specify an output folder for all emitted files. */
|
|
56
|
-
// "removeComments": true, /* Disable emitting comments. */
|
|
57
|
-
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
58
|
-
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
59
|
-
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
|
60
|
-
"downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
61
|
-
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
62
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
63
|
-
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
64
|
-
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
65
|
-
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
66
|
-
"newLine": "lf", /* Set the newline character for emitting files. */
|
|
67
|
-
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
68
|
-
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
69
|
-
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
70
|
-
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
71
|
-
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
72
|
-
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
73
|
-
|
|
74
|
-
/* Interop Constraints */
|
|
75
|
-
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
76
|
-
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
77
|
-
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
|
78
|
-
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
79
|
-
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
80
|
-
|
|
81
|
-
/* Type Checking */
|
|
82
|
-
"strict": true, /* Enable all strict type-checking options. */
|
|
83
|
-
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
84
|
-
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
85
|
-
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
86
|
-
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
87
|
-
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
88
|
-
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
89
|
-
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
90
|
-
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
91
|
-
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
92
|
-
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
93
|
-
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
94
|
-
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
95
|
-
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
96
|
-
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
97
|
-
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
98
|
-
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
99
|
-
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
100
|
-
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
101
|
-
|
|
102
|
-
/* Completeness */
|
|
103
|
-
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
104
|
-
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
|
|
105
|
-
},
|
|
106
|
-
"include": [
|
|
107
|
-
"${output}"
|
|
108
|
-
]
|
|
109
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
4
|
+
|
|
5
|
+
/* Projects */
|
|
6
|
+
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
7
|
+
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
+
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
|
9
|
+
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
10
|
+
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
+
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
|
+
|
|
13
|
+
/* Language and Environment */
|
|
14
|
+
"target": "ES5", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
15
|
+
"lib": [
|
|
16
|
+
"DOM",
|
|
17
|
+
"ES2015"
|
|
18
|
+
], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
19
|
+
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
20
|
+
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
|
21
|
+
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
22
|
+
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
23
|
+
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
24
|
+
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
25
|
+
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
26
|
+
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
27
|
+
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
28
|
+
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
29
|
+
|
|
30
|
+
/* Modules */
|
|
31
|
+
"module": "commonjs", /* Specify what module code is generated. */
|
|
32
|
+
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
33
|
+
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
34
|
+
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
35
|
+
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
36
|
+
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
37
|
+
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
38
|
+
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
39
|
+
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
40
|
+
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
41
|
+
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
42
|
+
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
43
|
+
|
|
44
|
+
/* JavaScript Support */
|
|
45
|
+
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
46
|
+
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
47
|
+
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
48
|
+
|
|
49
|
+
/* Emit */
|
|
50
|
+
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
51
|
+
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
52
|
+
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
53
|
+
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
54
|
+
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
55
|
+
"outDir": "./lib", /* Specify an output folder for all emitted files. */
|
|
56
|
+
// "removeComments": true, /* Disable emitting comments. */
|
|
57
|
+
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
58
|
+
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
59
|
+
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
|
60
|
+
"downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
61
|
+
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
62
|
+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
63
|
+
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
64
|
+
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
65
|
+
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
66
|
+
"newLine": "lf", /* Set the newline character for emitting files. */
|
|
67
|
+
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
68
|
+
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
69
|
+
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
70
|
+
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
71
|
+
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
72
|
+
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
73
|
+
|
|
74
|
+
/* Interop Constraints */
|
|
75
|
+
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
76
|
+
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
77
|
+
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
|
78
|
+
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
79
|
+
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
80
|
+
|
|
81
|
+
/* Type Checking */
|
|
82
|
+
"strict": true, /* Enable all strict type-checking options. */
|
|
83
|
+
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
84
|
+
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
85
|
+
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
86
|
+
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
87
|
+
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
88
|
+
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
89
|
+
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
90
|
+
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
91
|
+
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
92
|
+
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
93
|
+
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
94
|
+
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
95
|
+
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
96
|
+
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
97
|
+
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
98
|
+
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
99
|
+
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
100
|
+
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
101
|
+
|
|
102
|
+
/* Completeness */
|
|
103
|
+
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
104
|
+
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
|
|
105
|
+
},
|
|
106
|
+
"include": [
|
|
107
|
+
"${output}"
|
|
108
|
+
]
|
|
109
|
+
}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import core from "@nestia/core";
|
|
2
|
-
import { DynamicExecutor } from "@nestia/e2e";
|
|
3
|
-
|
|
4
|
-
import { INestApplication } from "@nestjs/common";
|
|
5
|
-
import { NestFactory } from "@nestjs/core";
|
|
6
|
-
|
|
7
|
-
async function main(): Promise<void> {
|
|
8
|
-
const server: INestApplication = await NestFactory.create(
|
|
9
|
-
await core.DynamicModule.mount(
|
|
10
|
-
${input},
|
|
11
|
-
),
|
|
12
|
-
);
|
|
13
|
-
await server.listen(37_000);
|
|
14
|
-
|
|
15
|
-
const report: DynamicExecutor.IReport = await DynamicExecutor.validate({
|
|
16
|
-
extension: __filename.substring(__filename.length - 2),
|
|
17
|
-
prefix: "test",
|
|
18
|
-
parameters: () => [
|
|
19
|
-
{
|
|
20
|
-
host: "http://127.0.0.1:37000",
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
})(`${__dirname}/features`);
|
|
24
|
-
await server.close();
|
|
25
|
-
|
|
26
|
-
const exceptions: Error[] = report.executions
|
|
27
|
-
.filter((exec) => exec.error !== null)
|
|
28
|
-
.map((exec) => exec.error!);
|
|
29
|
-
if (exceptions.length === 0) {
|
|
30
|
-
console.log("Success");
|
|
31
|
-
console.log("Elapsed time", report.time.toLocaleString(), `ms`);
|
|
32
|
-
} else {
|
|
33
|
-
for (const exp of exceptions) console.log(exp);
|
|
34
|
-
console.log("Failed");
|
|
35
|
-
console.log("Elapsed time", report.time.toLocaleString(), `ms`);
|
|
36
|
-
process.exit(-1);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
main().catch((exp) => {
|
|
40
|
-
console.log(exp);
|
|
41
|
-
process.exit(-1);
|
|
42
|
-
});
|
|
1
|
+
import core from "@nestia/core";
|
|
2
|
+
import { DynamicExecutor } from "@nestia/e2e";
|
|
3
|
+
|
|
4
|
+
import { INestApplication } from "@nestjs/common";
|
|
5
|
+
import { NestFactory } from "@nestjs/core";
|
|
6
|
+
|
|
7
|
+
async function main(): Promise<void> {
|
|
8
|
+
const server: INestApplication = await NestFactory.create(
|
|
9
|
+
await core.DynamicModule.mount(
|
|
10
|
+
${input},
|
|
11
|
+
),
|
|
12
|
+
);
|
|
13
|
+
await server.listen(37_000);
|
|
14
|
+
|
|
15
|
+
const report: DynamicExecutor.IReport = await DynamicExecutor.validate({
|
|
16
|
+
extension: __filename.substring(__filename.length - 2),
|
|
17
|
+
prefix: "test",
|
|
18
|
+
parameters: () => [
|
|
19
|
+
{
|
|
20
|
+
host: "http://127.0.0.1:37000",
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
})(`${__dirname}/features`);
|
|
24
|
+
await server.close();
|
|
25
|
+
|
|
26
|
+
const exceptions: Error[] = report.executions
|
|
27
|
+
.filter((exec) => exec.error !== null)
|
|
28
|
+
.map((exec) => exec.error!);
|
|
29
|
+
if (exceptions.length === 0) {
|
|
30
|
+
console.log("Success");
|
|
31
|
+
console.log("Elapsed time", report.time.toLocaleString(), `ms`);
|
|
32
|
+
} else {
|
|
33
|
+
for (const exp of exceptions) console.log(exp);
|
|
34
|
+
console.log("Failed");
|
|
35
|
+
console.log("Elapsed time", report.time.toLocaleString(), `ms`);
|
|
36
|
+
process.exit(-1);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
main().catch((exp) => {
|
|
40
|
+
console.log(exp);
|
|
41
|
+
process.exit(-1);
|
|
42
|
+
});
|
|
@@ -1,97 +1,97 @@
|
|
|
1
|
-
import { INestiaConfig } from "@nestia/sdk";
|
|
2
|
-
import { Module } from "@nestjs/common";
|
|
3
|
-
import { NestFactory } from "@nestjs/core";
|
|
4
|
-
|
|
5
|
-
// import { FastifyAdapter } from "@nestjs/platform-fastify";
|
|
6
|
-
|
|
7
|
-
export const NESTIA_CONFIG: INestiaConfig = {
|
|
8
|
-
/**
|
|
9
|
-
* Accessor of controller classes.
|
|
10
|
-
*
|
|
11
|
-
* You can specify it within two ways.
|
|
12
|
-
*
|
|
13
|
-
* - Asynchronous function returning `INestApplication` instance
|
|
14
|
-
* - Specify the path or directory of controller class files
|
|
15
|
-
*/
|
|
16
|
-
// input: "src/controllers",
|
|
17
|
-
// input: "src/**/*.controller.ts",
|
|
18
|
-
input: async () => {
|
|
19
|
-
// change this to your own module
|
|
20
|
-
@Module({
|
|
21
|
-
controllers: [],
|
|
22
|
-
})
|
|
23
|
-
class MyModule {}
|
|
24
|
-
const app = await NestFactory.create(MyModule);
|
|
25
|
-
// const app = await NestFactory.create(YourModule, new FastifyAdapter());
|
|
26
|
-
// app.setGlobalPrefix("api");
|
|
27
|
-
// app.enableVersioning({
|
|
28
|
-
// type: VersioningType.URI,
|
|
29
|
-
// prefix: "v",
|
|
30
|
-
// })
|
|
31
|
-
return app;
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Building `swagger.json` is also possible.
|
|
36
|
-
*
|
|
37
|
-
* If not specified, you can't build the `swagger.json`.
|
|
38
|
-
*/
|
|
39
|
-
swagger: {
|
|
40
|
-
/**
|
|
41
|
-
* Output path of the `swagger.json`.
|
|
42
|
-
*
|
|
43
|
-
* If you've configured only directory, the file name would be the `swagger.json`.
|
|
44
|
-
* Otherwise you've configured the full path with file name and extension, the
|
|
45
|
-
* `swagger.json` file would be renamed to it.
|
|
46
|
-
*/
|
|
47
|
-
output: "dist/swagger.json",
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Output directory that SDK would be placed in.
|
|
52
|
-
*
|
|
53
|
-
* If not configured, you can't build the SDK library.
|
|
54
|
-
*/
|
|
55
|
-
output: "src/api",
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Target directory that SDK distribution files would be placed in.
|
|
59
|
-
*
|
|
60
|
-
* If you configure this property and runs `npx nestia sdk` command,
|
|
61
|
-
* distribution environments for the SDK library would be generated.
|
|
62
|
-
*
|
|
63
|
-
* After the SDK library generation, move to the `distribute` directory,
|
|
64
|
-
* and runs `npm publish` command, then you can share SDK library with
|
|
65
|
-
* other client (frontend) developers.
|
|
66
|
-
*/
|
|
67
|
-
// distribute: "packages/api",
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Whether to use propagation mode or not.
|
|
71
|
-
*
|
|
72
|
-
* If being configured, interaction functions of the SDK library would
|
|
73
|
-
* perform the propagation mode. The propagation mode means that never
|
|
74
|
-
* throwing exception even when status code is not 200 (or 201), but just
|
|
75
|
-
* returning the {@link IPropagation} typed instance, which can specify its body
|
|
76
|
-
* type through discriminated union determined by status code.
|
|
77
|
-
*
|
|
78
|
-
* @default false
|
|
79
|
-
*/
|
|
80
|
-
// propagate: true,
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Allow simulation mode.
|
|
84
|
-
*
|
|
85
|
-
* If you configure this property to be `true`, the SDK library would be contain
|
|
86
|
-
* simulation mode. In the simulation mode, the SDK library would not communicate
|
|
87
|
-
* with the real backend server, but just returns random mock-up data
|
|
88
|
-
* with requestion data validation.
|
|
89
|
-
*
|
|
90
|
-
* For reference, random mock-up data would be generated by `typia.random<T>()`
|
|
91
|
-
* function.
|
|
92
|
-
*
|
|
93
|
-
* @default false
|
|
94
|
-
*/
|
|
95
|
-
// simulate: true,
|
|
96
|
-
};
|
|
97
|
-
export default NESTIA_CONFIG;
|
|
1
|
+
import { INestiaConfig } from "@nestia/sdk";
|
|
2
|
+
import { Module } from "@nestjs/common";
|
|
3
|
+
import { NestFactory } from "@nestjs/core";
|
|
4
|
+
|
|
5
|
+
// import { FastifyAdapter } from "@nestjs/platform-fastify";
|
|
6
|
+
|
|
7
|
+
export const NESTIA_CONFIG: INestiaConfig = {
|
|
8
|
+
/**
|
|
9
|
+
* Accessor of controller classes.
|
|
10
|
+
*
|
|
11
|
+
* You can specify it within two ways.
|
|
12
|
+
*
|
|
13
|
+
* - Asynchronous function returning `INestApplication` instance
|
|
14
|
+
* - Specify the path or directory of controller class files
|
|
15
|
+
*/
|
|
16
|
+
// input: "src/controllers",
|
|
17
|
+
// input: "src/**/*.controller.ts",
|
|
18
|
+
input: async () => {
|
|
19
|
+
// change this to your own module
|
|
20
|
+
@Module({
|
|
21
|
+
controllers: [],
|
|
22
|
+
})
|
|
23
|
+
class MyModule {}
|
|
24
|
+
const app = await NestFactory.create(MyModule);
|
|
25
|
+
// const app = await NestFactory.create(YourModule, new FastifyAdapter());
|
|
26
|
+
// app.setGlobalPrefix("api");
|
|
27
|
+
// app.enableVersioning({
|
|
28
|
+
// type: VersioningType.URI,
|
|
29
|
+
// prefix: "v",
|
|
30
|
+
// })
|
|
31
|
+
return app;
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Building `swagger.json` is also possible.
|
|
36
|
+
*
|
|
37
|
+
* If not specified, you can't build the `swagger.json`.
|
|
38
|
+
*/
|
|
39
|
+
swagger: {
|
|
40
|
+
/**
|
|
41
|
+
* Output path of the `swagger.json`.
|
|
42
|
+
*
|
|
43
|
+
* If you've configured only directory, the file name would be the `swagger.json`.
|
|
44
|
+
* Otherwise you've configured the full path with file name and extension, the
|
|
45
|
+
* `swagger.json` file would be renamed to it.
|
|
46
|
+
*/
|
|
47
|
+
output: "dist/swagger.json",
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Output directory that SDK would be placed in.
|
|
52
|
+
*
|
|
53
|
+
* If not configured, you can't build the SDK library.
|
|
54
|
+
*/
|
|
55
|
+
output: "src/api",
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Target directory that SDK distribution files would be placed in.
|
|
59
|
+
*
|
|
60
|
+
* If you configure this property and runs `npx nestia sdk` command,
|
|
61
|
+
* distribution environments for the SDK library would be generated.
|
|
62
|
+
*
|
|
63
|
+
* After the SDK library generation, move to the `distribute` directory,
|
|
64
|
+
* and runs `npm publish` command, then you can share SDK library with
|
|
65
|
+
* other client (frontend) developers.
|
|
66
|
+
*/
|
|
67
|
+
// distribute: "packages/api",
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Whether to use propagation mode or not.
|
|
71
|
+
*
|
|
72
|
+
* If being configured, interaction functions of the SDK library would
|
|
73
|
+
* perform the propagation mode. The propagation mode means that never
|
|
74
|
+
* throwing exception even when status code is not 200 (or 201), but just
|
|
75
|
+
* returning the {@link IPropagation} typed instance, which can specify its body
|
|
76
|
+
* type through discriminated union determined by status code.
|
|
77
|
+
*
|
|
78
|
+
* @default false
|
|
79
|
+
*/
|
|
80
|
+
// propagate: true,
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Allow simulation mode.
|
|
84
|
+
*
|
|
85
|
+
* If you configure this property to be `true`, the SDK library would be contain
|
|
86
|
+
* simulation mode. In the simulation mode, the SDK library would not communicate
|
|
87
|
+
* with the real backend server, but just returns random mock-up data
|
|
88
|
+
* with requestion data validation.
|
|
89
|
+
*
|
|
90
|
+
* For reference, random mock-up data would be generated by `typia.random<T>()`
|
|
91
|
+
* function.
|
|
92
|
+
*
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
// simulate: true,
|
|
96
|
+
};
|
|
97
|
+
export default NESTIA_CONFIG;
|
|
@@ -76,22 +76,22 @@ var NestiaConfigLoader;
|
|
|
76
76
|
if (false === __is(input)) {
|
|
77
77
|
_errorFactory = errorFactory;
|
|
78
78
|
((input, _path, _exceptionable = true) => (Array.isArray(input) || __typia_transform__assertGuard._assertGuard(true, {
|
|
79
|
-
method: "typia\
|
|
79
|
+
method: "typia\n .assert",
|
|
80
80
|
path: _path + "",
|
|
81
81
|
expected: "Array<object>",
|
|
82
82
|
value: input
|
|
83
83
|
}, _errorFactory)) && input.every((elem, _index2) => ("object" === typeof elem && null !== elem && false === Array.isArray(elem) || __typia_transform__assertGuard._assertGuard(true, {
|
|
84
|
-
method: "typia\
|
|
84
|
+
method: "typia\n .assert",
|
|
85
85
|
path: _path + "[" + _index2 + "]",
|
|
86
86
|
expected: "object",
|
|
87
87
|
value: elem
|
|
88
88
|
}, _errorFactory)) && _ao0(elem, _path + "[" + _index2 + "]", true) || __typia_transform__assertGuard._assertGuard(true, {
|
|
89
|
-
method: "typia\
|
|
89
|
+
method: "typia\n .assert",
|
|
90
90
|
path: _path + "[" + _index2 + "]",
|
|
91
91
|
expected: "object",
|
|
92
92
|
value: elem
|
|
93
93
|
}, _errorFactory)) || __typia_transform__assertGuard._assertGuard(true, {
|
|
94
|
-
method: "typia\
|
|
94
|
+
method: "typia\n .assert",
|
|
95
95
|
path: _path + "",
|
|
96
96
|
expected: "Array<object>",
|
|
97
97
|
value: input
|
package/lib/executable/sdk.js
CHANGED
|
@@ -50,18 +50,18 @@ const child_process_1 = __importDefault(require("child_process"));
|
|
|
50
50
|
const fs_1 = __importDefault(require("fs"));
|
|
51
51
|
const process_1 = __importDefault(require("process"));
|
|
52
52
|
const CommandParser_1 = require("./internal/CommandParser");
|
|
53
|
-
const USAGE = `Wrong command has been detected. Use like below:
|
|
54
|
-
|
|
55
|
-
npx @nestia/sdk [command] [options?]
|
|
56
|
-
|
|
57
|
-
1. npx @nestia/sdk dependencies --manager (npm|pnpm|yarn)
|
|
58
|
-
- npx @nestia/sdk dependencies
|
|
59
|
-
- npx @nestia/sdk dependencies --manager pnpm
|
|
60
|
-
2. npx @nestia/sdk init
|
|
61
|
-
3. npx @nestia/sdk sdk --config? [config file] --project? [project file]
|
|
62
|
-
4. npx @nestia/sdk swagger --config? [config file] --project? [project file]
|
|
63
|
-
5. npx @nestia/sdk e2e --config? [config file] --project? [project file]
|
|
64
|
-
6. npx @nestia/sdk generate --config? [config file] --project? [project file]
|
|
53
|
+
const USAGE = `Wrong command has been detected. Use like below:
|
|
54
|
+
|
|
55
|
+
npx @nestia/sdk [command] [options?]
|
|
56
|
+
|
|
57
|
+
1. npx @nestia/sdk dependencies --manager (npm|pnpm|yarn)
|
|
58
|
+
- npx @nestia/sdk dependencies
|
|
59
|
+
- npx @nestia/sdk dependencies --manager pnpm
|
|
60
|
+
2. npx @nestia/sdk init
|
|
61
|
+
3. npx @nestia/sdk sdk --config? [config file] --project? [project file]
|
|
62
|
+
4. npx @nestia/sdk swagger --config? [config file] --project? [project file]
|
|
63
|
+
5. npx @nestia/sdk e2e --config? [config file] --project? [project file]
|
|
64
|
+
6. npx @nestia/sdk generate --config? [config file] --project? [project file]
|
|
65
65
|
`;
|
|
66
66
|
function halt(desc) {
|
|
67
67
|
console.error(desc);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestia/sdk",
|
|
3
|
-
"version": "7.0.0
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Nestia SDK and Swagger generator",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://nestia.io",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@nestia/core": "^7.0.0
|
|
36
|
-
"@nestia/fetcher": "^7.0.0
|
|
35
|
+
"@nestia/core": "^7.0.0",
|
|
36
|
+
"@nestia/fetcher": "^7.0.0",
|
|
37
37
|
"@samchon/openapi": "^4.3.3",
|
|
38
38
|
"cli": "^1.0.1",
|
|
39
39
|
"get-function-location": "^2.0.0",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"typia": "^9.3.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@nestia/core": ">=7.0.0
|
|
51
|
-
"@nestia/fetcher": ">=7.0.0
|
|
50
|
+
"@nestia/core": ">=7.0.0",
|
|
51
|
+
"@nestia/fetcher": ">=7.0.0",
|
|
52
52
|
"@nestjs/common": ">=7.0.1",
|
|
53
53
|
"@nestjs/core": ">=7.0.1",
|
|
54
54
|
"reflect-metadata": ">=0.1.12",
|