@nestia/sdk 0.2.0 → 1.0.1

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.
Files changed (38) hide show
  1. package/assets/config/nestia.config.ts +79 -70
  2. package/lib/INestiaConfig.d.ts +18 -14
  3. package/lib/executable/sdk.js +16 -16
  4. package/lib/generates/FunctionGenerator.js +9 -9
  5. package/lib/generates/FunctionGenerator.js.map +1 -1
  6. package/lib/generates/SwaggerGenerator.js +9 -9
  7. package/package.json +3 -3
  8. package/src/INestiaConfig.ts +124 -120
  9. package/src/NestiaSdkApplication.ts +183 -183
  10. package/src/analyses/ControllerAnalyzer.ts +203 -203
  11. package/src/analyses/GenericAnalyzer.ts +53 -53
  12. package/src/analyses/ImportAnalyzer.ts +143 -143
  13. package/src/analyses/PathAnalyzer.ts +58 -58
  14. package/src/analyses/ReflectAnalyzer.ts +279 -279
  15. package/src/analyses/SourceFinder.ts +59 -59
  16. package/src/executable/internal/CommandParser.ts +15 -15
  17. package/src/executable/internal/NestiaConfigCompilerOptions.ts +18 -18
  18. package/src/executable/internal/NestiaSdkCommand.ts +174 -174
  19. package/src/executable/internal/NestiaSdkConfig.ts +35 -35
  20. package/src/executable/internal/nestia.config.getter.ts +12 -12
  21. package/src/executable/sdk.ts +74 -74
  22. package/src/generates/FileGenerator.ts +156 -156
  23. package/src/generates/FunctionGenerator.ts +284 -287
  24. package/src/generates/SdkGenerator.ts +50 -50
  25. package/src/generates/SwaggerGenerator.ts +393 -393
  26. package/src/index.ts +3 -3
  27. package/src/module.ts +2 -2
  28. package/src/structures/IController.ts +27 -27
  29. package/src/structures/IRoute.ts +29 -29
  30. package/src/structures/ISwagger.ts +55 -55
  31. package/src/structures/ITypeTuple.ts +6 -6
  32. package/src/structures/MethodType.ts +11 -11
  33. package/src/structures/ParamCategory.ts +1 -1
  34. package/src/structures/TypeEntry.ts +22 -22
  35. package/src/utils/ArrayUtil.ts +26 -26
  36. package/src/utils/ImportDictionary.ts +56 -56
  37. package/src/utils/MapUtil.ts +14 -14
  38. package/src/utils/StripEnums.ts +10 -10
@@ -1,50 +1,50 @@
1
- import fs from "fs";
2
- import NodePath from "path";
3
- import ts from "typescript";
4
-
5
- import { INestiaConfig } from "../INestiaConfig";
6
- import { IRoute } from "../structures/IRoute";
7
- import { FileGenerator } from "./FileGenerator";
8
-
9
- export namespace SdkGenerator {
10
- export async function generate(
11
- _checker: ts.TypeChecker,
12
- config: INestiaConfig,
13
- routeList: IRoute[],
14
- ): Promise<void> {
15
- // PREPARE NEW DIRECTORIES
16
- try {
17
- await fs.promises.mkdir(config.output!);
18
- } catch {}
19
-
20
- // BUNDLING
21
- const bundle: string[] = await fs.promises.readdir(BUNDLE_PATH);
22
- for (const file of bundle) {
23
- const current: string = `${BUNDLE_PATH}/${file}`;
24
- const stats: fs.Stats = await fs.promises.stat(current);
25
-
26
- if (stats.isFile() === true) {
27
- const content: string = await fs.promises.readFile(
28
- current,
29
- "utf8",
30
- );
31
- await fs.promises.writeFile(
32
- `${config.output}/${file}`,
33
- content,
34
- "utf8",
35
- );
36
- }
37
- }
38
-
39
- // FUNCTIONAL
40
- await FileGenerator.generate(config, routeList);
41
- }
42
-
43
- export const BUNDLE_PATH = NodePath.join(
44
- __dirname,
45
- "..",
46
- "..",
47
- "assets",
48
- "bundle",
49
- );
50
- }
1
+ import fs from "fs";
2
+ import NodePath from "path";
3
+ import ts from "typescript";
4
+
5
+ import { INestiaConfig } from "../INestiaConfig";
6
+ import { IRoute } from "../structures/IRoute";
7
+ import { FileGenerator } from "./FileGenerator";
8
+
9
+ export namespace SdkGenerator {
10
+ export async function generate(
11
+ _checker: ts.TypeChecker,
12
+ config: INestiaConfig,
13
+ routeList: IRoute[],
14
+ ): Promise<void> {
15
+ // PREPARE NEW DIRECTORIES
16
+ try {
17
+ await fs.promises.mkdir(config.output!);
18
+ } catch {}
19
+
20
+ // BUNDLING
21
+ const bundle: string[] = await fs.promises.readdir(BUNDLE_PATH);
22
+ for (const file of bundle) {
23
+ const current: string = `${BUNDLE_PATH}/${file}`;
24
+ const stats: fs.Stats = await fs.promises.stat(current);
25
+
26
+ if (stats.isFile() === true) {
27
+ const content: string = await fs.promises.readFile(
28
+ current,
29
+ "utf8",
30
+ );
31
+ await fs.promises.writeFile(
32
+ `${config.output}/${file}`,
33
+ content,
34
+ "utf8",
35
+ );
36
+ }
37
+ }
38
+
39
+ // FUNCTIONAL
40
+ await FileGenerator.generate(config, routeList);
41
+ }
42
+
43
+ export const BUNDLE_PATH = NodePath.join(
44
+ __dirname,
45
+ "..",
46
+ "..",
47
+ "assets",
48
+ "bundle",
49
+ );
50
+ }