@nestia/sdk 11.0.0-dev.20260312 → 11.0.0-dev.20260313

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 (58) hide show
  1. package/assets/bundle/distribute/package.json +1 -1
  2. package/lib/INestiaConfig.d.ts +2 -2
  3. package/lib/NestiaSwaggerComposer.d.ts +1 -2
  4. package/lib/NestiaSwaggerComposer.js +6 -2
  5. package/lib/NestiaSwaggerComposer.js.map +1 -1
  6. package/lib/executable/internal/NestiaConfigLoader.js +8 -63
  7. package/lib/executable/internal/NestiaConfigLoader.js.map +1 -1
  8. package/lib/executable/sdk.js +12 -12
  9. package/lib/generates/SwaggerGenerator.js +6 -5
  10. package/lib/generates/SwaggerGenerator.js.map +1 -1
  11. package/package.json +8 -8
  12. package/src/analyses/ConfigAnalyzer.ts +155 -155
  13. package/src/analyses/ExceptionAnalyzer.ts +154 -154
  14. package/src/analyses/GenericAnalyzer.ts +49 -49
  15. package/src/analyses/PathAnalyzer.ts +69 -69
  16. package/src/analyses/ReflectControllerAnalyzer.ts +105 -105
  17. package/src/analyses/ReflectMetadataAnalyzer.ts +44 -44
  18. package/src/analyses/ReflectWebSocketOperationAnalyzer.ts +172 -172
  19. package/src/analyses/SecurityAnalyzer.ts +25 -25
  20. package/src/analyses/TypedWebSocketRouteAnalyzer.ts +33 -33
  21. package/src/decorators/OperationMetadata.ts +15 -15
  22. package/src/executable/internal/CommandParser.ts +15 -15
  23. package/src/executable/sdk.ts +75 -75
  24. package/src/generates/CloneGenerator.ts +66 -66
  25. package/src/generates/E2eGenerator.ts +32 -32
  26. package/src/generates/SdkGenerator.ts +160 -160
  27. package/src/generates/internal/SdkDistributionComposer.ts +103 -103
  28. package/src/generates/internal/SdkHttpParameterProgrammer.ts +178 -178
  29. package/src/generates/internal/SdkRouteDirectory.ts +18 -18
  30. package/src/generates/internal/SdkWebSocketParameterProgrammer.ts +87 -87
  31. package/src/generates/internal/SwaggerDescriptionComposer.ts +64 -64
  32. package/src/index.ts +4 -4
  33. package/src/structures/INestiaProject.ts +13 -13
  34. package/src/structures/INestiaSdkInput.ts +20 -20
  35. package/src/structures/IReflectApplication.ts +8 -8
  36. package/src/structures/IReflectController.ts +15 -15
  37. package/src/structures/IReflectHttpOperation.ts +26 -26
  38. package/src/structures/IReflectImport.ts +6 -6
  39. package/src/structures/IReflectOperationError.ts +26 -26
  40. package/src/structures/IReflectType.ts +4 -4
  41. package/src/structures/IReflectWebSocketOperation.ts +17 -17
  42. package/src/structures/IReflectWebSocketOperationParameter.ts +36 -36
  43. package/src/structures/ITypedHttpRoute.ts +41 -41
  44. package/src/structures/ITypedWebSocketRoute.ts +24 -24
  45. package/src/structures/ITypedWebSocketRouteParameter.ts +3 -3
  46. package/src/structures/MethodType.ts +5 -5
  47. package/src/structures/ParamCategory.ts +1 -1
  48. package/src/structures/TypeEntry.ts +22 -22
  49. package/src/transform.ts +9 -9
  50. package/src/typings/get-function-location.d.ts +7 -7
  51. package/src/utils/ArrayUtil.ts +26 -26
  52. package/src/utils/FileRetriever.ts +22 -22
  53. package/src/utils/MapUtil.ts +14 -14
  54. package/src/utils/PathUtil.ts +10 -10
  55. package/src/utils/SourceFinder.ts +63 -63
  56. package/src/utils/StringUtil.ts +17 -17
  57. package/src/utils/StripEnums.ts +5 -5
  58. package/src/utils/VersioningStrategy.ts +28 -28
@@ -1,64 +1,64 @@
1
- import { IJsDocTagInfo } from "typia";
2
-
3
- export namespace SwaggerDescriptionComposer {
4
- export const compose = <Kind extends "summary" | "title">(props: {
5
- description: string | null;
6
- jsDocTags: IJsDocTagInfo[];
7
- kind: Kind;
8
- }): Kind extends "summary"
9
- ? { summary?: string; description?: string }
10
- : { title?: string; description?: string } => {
11
- const title: string | undefined = (() => {
12
- const [explicit] = getJsDocTexts({
13
- jsDocTags: props.jsDocTags,
14
- name: props.kind,
15
- });
16
- if (explicit?.length) return explicit;
17
- else if (!props.description?.length) return undefined;
18
-
19
- const index: number = props.description.indexOf("\n");
20
- const top: string = (
21
- index === -1 ? props.description : props.description.substring(0, index)
22
- ).trim();
23
- return top.endsWith(".") ? top.substring(0, top.length - 1) : undefined;
24
- })();
25
- return {
26
- [props.kind]: title,
27
- description: props.description?.length ? props.description : undefined,
28
- } as any;
29
- };
30
-
31
- export const descriptionFromJsDocTag = (props: {
32
- jsDocTags: IJsDocTagInfo[];
33
- tag: string;
34
- parameter?: string;
35
- }): string | undefined => {
36
- const parametric: (elem: IJsDocTagInfo) => boolean = props.parameter
37
- ? (tag) =>
38
- tag.text!.find(
39
- (elem) =>
40
- elem.kind === "parameterName" && elem.text === props.parameter,
41
- ) !== undefined
42
- : () => true;
43
- const tag: IJsDocTagInfo | undefined = props.jsDocTags.find(
44
- (tag) => tag.name === props.tag && tag.text && parametric(tag),
45
- );
46
- return tag && tag.text
47
- ? tag.text.find((elem) => elem.kind === "text")?.text
48
- : undefined;
49
- };
50
-
51
- export const getJsDocTexts = (props: {
52
- jsDocTags: IJsDocTagInfo[];
53
- name: string;
54
- }): string[] =>
55
- props.jsDocTags
56
- .filter(
57
- (tag) =>
58
- tag.name === props.name &&
59
- tag.text &&
60
- tag.text.find((elem) => elem.kind === "text" && elem.text.length) !==
61
- undefined,
62
- )
63
- .map((tag) => tag.text!.find((elem) => elem.kind === "text")!.text);
64
- }
1
+ import { IJsDocTagInfo } from "typia";
2
+
3
+ export namespace SwaggerDescriptionComposer {
4
+ export const compose = <Kind extends "summary" | "title">(props: {
5
+ description: string | null;
6
+ jsDocTags: IJsDocTagInfo[];
7
+ kind: Kind;
8
+ }): Kind extends "summary"
9
+ ? { summary?: string; description?: string }
10
+ : { title?: string; description?: string } => {
11
+ const title: string | undefined = (() => {
12
+ const [explicit] = getJsDocTexts({
13
+ jsDocTags: props.jsDocTags,
14
+ name: props.kind,
15
+ });
16
+ if (explicit?.length) return explicit;
17
+ else if (!props.description?.length) return undefined;
18
+
19
+ const index: number = props.description.indexOf("\n");
20
+ const top: string = (
21
+ index === -1 ? props.description : props.description.substring(0, index)
22
+ ).trim();
23
+ return top.endsWith(".") ? top.substring(0, top.length - 1) : undefined;
24
+ })();
25
+ return {
26
+ [props.kind]: title,
27
+ description: props.description?.length ? props.description : undefined,
28
+ } as any;
29
+ };
30
+
31
+ export const descriptionFromJsDocTag = (props: {
32
+ jsDocTags: IJsDocTagInfo[];
33
+ tag: string;
34
+ parameter?: string;
35
+ }): string | undefined => {
36
+ const parametric: (elem: IJsDocTagInfo) => boolean = props.parameter
37
+ ? (tag) =>
38
+ tag.text!.find(
39
+ (elem) =>
40
+ elem.kind === "parameterName" && elem.text === props.parameter,
41
+ ) !== undefined
42
+ : () => true;
43
+ const tag: IJsDocTagInfo | undefined = props.jsDocTags.find(
44
+ (tag) => tag.name === props.tag && tag.text && parametric(tag),
45
+ );
46
+ return tag && tag.text
47
+ ? tag.text.find((elem) => elem.kind === "text")?.text
48
+ : undefined;
49
+ };
50
+
51
+ export const getJsDocTexts = (props: {
52
+ jsDocTags: IJsDocTagInfo[];
53
+ name: string;
54
+ }): string[] =>
55
+ props.jsDocTags
56
+ .filter(
57
+ (tag) =>
58
+ tag.name === props.name &&
59
+ tag.text &&
60
+ tag.text.find((elem) => elem.kind === "text" && elem.text.length) !==
61
+ undefined,
62
+ )
63
+ .map((tag) => tag.text!.find((elem) => elem.kind === "text")!.text);
64
+ }
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as nestia from "./module";
2
-
3
- export * from "./module";
4
- export default nestia;
1
+ import * as nestia from "./module";
2
+
3
+ export * from "./module";
4
+ export default nestia;
@@ -1,13 +1,13 @@
1
- import ts from "typescript";
2
-
3
- import { INestiaConfig } from "../INestiaConfig";
4
- import { INestiaSdkInput } from "./INestiaSdkInput";
5
- import { IReflectOperationError } from "./IReflectOperationError";
6
-
7
- export interface INestiaProject {
8
- config: INestiaConfig;
9
- input: INestiaSdkInput;
10
- checker: ts.TypeChecker;
11
- errors: IReflectOperationError[];
12
- warnings: IReflectOperationError[];
13
- }
1
+ import ts from "typescript";
2
+
3
+ import { INestiaConfig } from "../INestiaConfig";
4
+ import { INestiaSdkInput } from "./INestiaSdkInput";
5
+ import { IReflectOperationError } from "./IReflectOperationError";
6
+
7
+ export interface INestiaProject {
8
+ config: INestiaConfig;
9
+ input: INestiaSdkInput;
10
+ checker: ts.TypeChecker;
11
+ errors: IReflectOperationError[];
12
+ warnings: IReflectOperationError[];
13
+ }
@@ -1,20 +1,20 @@
1
- import { RouteInfo, VersionValue } from "@nestjs/common/interfaces";
2
-
3
- export interface INestiaSdkInput {
4
- controllers: INestiaSdkInput.IController[];
5
- globalPrefix?: {
6
- prefix: string;
7
- exclude?: Array<string | RouteInfo>;
8
- };
9
- versioning?: {
10
- prefix: string;
11
- defaultVersion?: VersionValue;
12
- };
13
- }
14
- export namespace INestiaSdkInput {
15
- export interface IController {
16
- class: Function;
17
- location: string;
18
- prefixes: string[];
19
- }
20
- }
1
+ import { RouteInfo, VersionValue } from "@nestjs/common/interfaces";
2
+
3
+ export interface INestiaSdkInput {
4
+ controllers: INestiaSdkInput.IController[];
5
+ globalPrefix?: {
6
+ prefix: string;
7
+ exclude?: Array<string | RouteInfo>;
8
+ };
9
+ versioning?: {
10
+ prefix: string;
11
+ defaultVersion?: VersionValue;
12
+ };
13
+ }
14
+ export namespace INestiaSdkInput {
15
+ export interface IController {
16
+ class: Function;
17
+ location: string;
18
+ prefixes: string[];
19
+ }
20
+ }
@@ -1,8 +1,8 @@
1
- import { INestApplication } from "@nestjs/common";
2
-
3
- import { IReflectController } from "./IReflectController";
4
-
5
- export interface IReflectApplication {
6
- application: INestApplication;
7
- controllers: IReflectController[];
8
- }
1
+ import { INestApplication } from "@nestjs/common";
2
+
3
+ import { IReflectController } from "./IReflectController";
4
+
5
+ export interface IReflectApplication {
6
+ application: INestApplication;
7
+ controllers: IReflectController[];
8
+ }
@@ -1,15 +1,15 @@
1
- import type { VERSION_NEUTRAL } from "@nestjs/common/interfaces";
2
-
3
- import { IReflectHttpOperation } from "./IReflectHttpOperation";
4
- import { IReflectWebSocketOperation } from "./IReflectWebSocketOperation";
5
-
6
- export interface IReflectController {
7
- class: Function;
8
- prefixes: string[];
9
- paths: string[];
10
- file: string;
11
- versions: Array<string | typeof VERSION_NEUTRAL> | undefined;
12
- operations: Array<IReflectHttpOperation | IReflectWebSocketOperation>;
13
- security: Record<string, string[]>[];
14
- tags: string[];
15
- }
1
+ import type { VERSION_NEUTRAL } from "@nestjs/common/interfaces";
2
+
3
+ import { IReflectHttpOperation } from "./IReflectHttpOperation";
4
+ import { IReflectWebSocketOperation } from "./IReflectWebSocketOperation";
5
+
6
+ export interface IReflectController {
7
+ class: Function;
8
+ prefixes: string[];
9
+ paths: string[];
10
+ file: string;
11
+ versions: Array<string | typeof VERSION_NEUTRAL> | undefined;
12
+ operations: Array<IReflectHttpOperation | IReflectWebSocketOperation>;
13
+ security: Record<string, string[]>[];
14
+ tags: string[];
15
+ }
@@ -1,26 +1,26 @@
1
- import { VERSION_NEUTRAL } from "@nestjs/common/interfaces";
2
- import { IJsDocTagInfo } from "typia";
3
-
4
- import { IReflectHttpOperationException } from "./IReflectHttpOperationException";
5
- import { IReflectHttpOperationParameter } from "./IReflectHttpOperationParameter";
6
- import { IReflectHttpOperationSuccess } from "./IReflectHttpOperationSuccess";
7
- import { IReflectImport } from "./IReflectImport";
8
-
9
- export interface IReflectHttpOperation {
10
- protocol: "http";
11
- function: Function;
12
- name: string;
13
- method: string;
14
- paths: string[];
15
- versions: Array<string | typeof VERSION_NEUTRAL> | undefined;
16
- parameters: IReflectHttpOperationParameter[];
17
- success: IReflectHttpOperationSuccess;
18
- exceptions: Record<string, IReflectHttpOperationException>;
19
- security: Record<string, string[]>[];
20
- tags: string[];
21
- imports: IReflectImport[];
22
- operationId: string | undefined;
23
- description: string | null;
24
- jsDocTags: IJsDocTagInfo[];
25
- extensions?: Record<string, any>;
26
- }
1
+ import { VERSION_NEUTRAL } from "@nestjs/common/interfaces";
2
+ import { IJsDocTagInfo } from "typia";
3
+
4
+ import { IReflectHttpOperationException } from "./IReflectHttpOperationException";
5
+ import { IReflectHttpOperationParameter } from "./IReflectHttpOperationParameter";
6
+ import { IReflectHttpOperationSuccess } from "./IReflectHttpOperationSuccess";
7
+ import { IReflectImport } from "./IReflectImport";
8
+
9
+ export interface IReflectHttpOperation {
10
+ protocol: "http";
11
+ function: Function;
12
+ name: string;
13
+ method: string;
14
+ paths: string[];
15
+ versions: Array<string | typeof VERSION_NEUTRAL> | undefined;
16
+ parameters: IReflectHttpOperationParameter[];
17
+ success: IReflectHttpOperationSuccess;
18
+ exceptions: Record<string, IReflectHttpOperationException>;
19
+ security: Record<string, string[]>[];
20
+ tags: string[];
21
+ imports: IReflectImport[];
22
+ operationId: string | undefined;
23
+ description: string | null;
24
+ jsDocTags: IJsDocTagInfo[];
25
+ extensions?: Record<string, any>;
26
+ }
@@ -1,6 +1,6 @@
1
- export interface IReflectImport {
2
- file: string;
3
- asterisk: string | null;
4
- default: string | null;
5
- elements: string[];
6
- }
1
+ export interface IReflectImport {
2
+ file: string;
3
+ asterisk: string | null;
4
+ default: string | null;
5
+ elements: string[];
6
+ }
@@ -1,26 +1,26 @@
1
- import { IComparable } from "tstl";
2
-
3
- import { IOperationMetadata } from "../transformers/IOperationMetadata";
4
-
5
- export interface IReflectOperationError {
6
- file: string;
7
- class: string;
8
- function: string | null;
9
- from: string | null;
10
- contents: Array<string | IOperationMetadata.IError>;
11
- }
12
- export namespace IReflectOperationError {
13
- export class Key implements Pick<IComparable<Key>, "less"> {
14
- public constructor(public readonly error: IReflectOperationError) {}
15
-
16
- public less(obj: Key): boolean {
17
- if (this.error.file !== obj.error.file)
18
- return this.error.file < obj.error.file;
19
- else if (this.error.class !== obj.error.class)
20
- return this.error.class < obj.error.class;
21
- else if (this.error.function !== obj.error.function)
22
- return (this.error.function ?? "") < (obj.error.function ?? "");
23
- return (this.error.from ?? "") < (obj.error.from ?? "");
24
- }
25
- }
26
- }
1
+ import { IComparable } from "tstl";
2
+
3
+ import { IOperationMetadata } from "../transformers/IOperationMetadata";
4
+
5
+ export interface IReflectOperationError {
6
+ file: string;
7
+ class: string;
8
+ function: string | null;
9
+ from: string | null;
10
+ contents: Array<string | IOperationMetadata.IError>;
11
+ }
12
+ export namespace IReflectOperationError {
13
+ export class Key implements Pick<IComparable<Key>, "less"> {
14
+ public constructor(public readonly error: IReflectOperationError) {}
15
+
16
+ public less(obj: Key): boolean {
17
+ if (this.error.file !== obj.error.file)
18
+ return this.error.file < obj.error.file;
19
+ else if (this.error.class !== obj.error.class)
20
+ return this.error.class < obj.error.class;
21
+ else if (this.error.function !== obj.error.function)
22
+ return (this.error.function ?? "") < (obj.error.function ?? "");
23
+ return (this.error.from ?? "") < (obj.error.from ?? "");
24
+ }
25
+ }
26
+ }
@@ -1,4 +1,4 @@
1
- export interface IReflectType {
2
- name: string;
3
- typeArguments?: IReflectType[];
4
- }
1
+ export interface IReflectType {
2
+ name: string;
3
+ typeArguments?: IReflectType[];
4
+ }
@@ -1,17 +1,17 @@
1
- import { VERSION_NEUTRAL } from "@nestjs/common";
2
- import ts from "typescript";
3
-
4
- import { IReflectImport } from "./IReflectImport";
5
- import { IReflectWebSocketOperationParameter } from "./IReflectWebSocketOperationParameter";
6
-
7
- export interface IReflectWebSocketOperation {
8
- protocol: "websocket";
9
- name: string;
10
- paths: string[];
11
- function: Function;
12
- versions: Array<string | typeof VERSION_NEUTRAL> | undefined;
13
- parameters: IReflectWebSocketOperationParameter[];
14
- imports: IReflectImport[];
15
- description: string | null;
16
- jsDocTags: ts.JSDocTagInfo[];
17
- }
1
+ import { VERSION_NEUTRAL } from "@nestjs/common";
2
+ import ts from "typescript";
3
+
4
+ import { IReflectImport } from "./IReflectImport";
5
+ import { IReflectWebSocketOperationParameter } from "./IReflectWebSocketOperationParameter";
6
+
7
+ export interface IReflectWebSocketOperation {
8
+ protocol: "websocket";
9
+ name: string;
10
+ paths: string[];
11
+ function: Function;
12
+ versions: Array<string | typeof VERSION_NEUTRAL> | undefined;
13
+ parameters: IReflectWebSocketOperationParameter[];
14
+ imports: IReflectImport[];
15
+ description: string | null;
16
+ jsDocTags: ts.JSDocTagInfo[];
17
+ }
@@ -1,36 +1,36 @@
1
- import { IJsDocTagInfo } from "typia";
2
-
3
- import { IReflectImport } from "./IReflectImport";
4
- import { IReflectType } from "./IReflectType";
5
-
6
- export type IReflectWebSocketOperationParameter =
7
- | IReflectWebSocketOperationParameter.IAcceptor
8
- | IReflectWebSocketOperationParameter.IDriver
9
- | IReflectWebSocketOperationParameter.IHeader
10
- | IReflectWebSocketOperationParameter.IParam
11
- | IReflectWebSocketOperationParameter.IQuery;
12
- export namespace IReflectWebSocketOperationParameter {
13
- export type IAcceptor = IBase<"acceptor">;
14
- export type IDriver = IBase<"driver">;
15
- export type IHeader = IBase<"header">;
16
- export type IQuery = IBase<"query">;
17
- export interface IParam extends IBase<"param"> {
18
- field: string;
19
- }
20
- interface IBase<Category extends string> {
21
- category: Category;
22
- name: string;
23
- index: number;
24
- type: IReflectType;
25
- imports: IReflectImport[];
26
- description: string | null;
27
- jsDocTags: IJsDocTagInfo[];
28
- }
29
-
30
- /** @internal */
31
- export interface IPreconfigured {
32
- category: "acceptor" | "driver" | "header" | "param" | "query";
33
- index: number;
34
- field?: string;
35
- }
36
- }
1
+ import { IJsDocTagInfo } from "typia";
2
+
3
+ import { IReflectImport } from "./IReflectImport";
4
+ import { IReflectType } from "./IReflectType";
5
+
6
+ export type IReflectWebSocketOperationParameter =
7
+ | IReflectWebSocketOperationParameter.IAcceptor
8
+ | IReflectWebSocketOperationParameter.IDriver
9
+ | IReflectWebSocketOperationParameter.IHeader
10
+ | IReflectWebSocketOperationParameter.IParam
11
+ | IReflectWebSocketOperationParameter.IQuery;
12
+ export namespace IReflectWebSocketOperationParameter {
13
+ export type IAcceptor = IBase<"acceptor">;
14
+ export type IDriver = IBase<"driver">;
15
+ export type IHeader = IBase<"header">;
16
+ export type IQuery = IBase<"query">;
17
+ export interface IParam extends IBase<"param"> {
18
+ field: string;
19
+ }
20
+ interface IBase<Category extends string> {
21
+ category: Category;
22
+ name: string;
23
+ index: number;
24
+ type: IReflectType;
25
+ imports: IReflectImport[];
26
+ description: string | null;
27
+ jsDocTags: IJsDocTagInfo[];
28
+ }
29
+
30
+ /** @internal */
31
+ export interface IPreconfigured {
32
+ category: "acceptor" | "driver" | "header" | "param" | "query";
33
+ index: number;
34
+ field?: string;
35
+ }
36
+ }
@@ -1,41 +1,41 @@
1
- import { IJsDocTagInfo } from "typia";
2
-
3
- import { IReflectController } from "./IReflectController";
4
- import { IReflectImport } from "./IReflectImport";
5
- import { ITypedHttpRouteException } from "./ITypedHttpRouteException";
6
- import { ITypedHttpRouteParameter } from "./ITypedHttpRouteParameter";
7
- import { ITypedHttpRouteSuccess } from "./ITypedHttpRouteSuccess";
8
-
9
- export interface ITypedHttpRoute {
10
- protocol: "http";
11
- function: Function;
12
- controller: IReflectController;
13
- name: string;
14
- method: string;
15
- path: string;
16
- accessor: string[];
17
-
18
- // PARAMETERS
19
- pathParameters: ITypedHttpRouteParameter.IPath[];
20
- queryParameters: ITypedHttpRouteParameter.IQuery[];
21
- headerParameters: ITypedHttpRouteParameter.IHeaders[];
22
- queryObject: ITypedHttpRouteParameter.IQuery | null;
23
- headerObject: ITypedHttpRouteParameter.IHeaders | null;
24
- body: ITypedHttpRouteParameter.IBody | null;
25
-
26
- // RESPONSES
27
- success: ITypedHttpRouteSuccess;
28
- exceptions: Record<
29
- number | "2XX" | "3XX" | "4XX" | "5XX",
30
- ITypedHttpRouteException
31
- >;
32
-
33
- // ADDITIONAL INFORMATION
34
- security: Record<string, string[]>[];
35
- tags: string[];
36
- imports: IReflectImport[];
37
- description: string | null;
38
- jsDocTags: IJsDocTagInfo[];
39
- operationId: string | undefined;
40
- extensions?: Record<string, any>;
41
- }
1
+ import { IJsDocTagInfo } from "typia";
2
+
3
+ import { IReflectController } from "./IReflectController";
4
+ import { IReflectImport } from "./IReflectImport";
5
+ import { ITypedHttpRouteException } from "./ITypedHttpRouteException";
6
+ import { ITypedHttpRouteParameter } from "./ITypedHttpRouteParameter";
7
+ import { ITypedHttpRouteSuccess } from "./ITypedHttpRouteSuccess";
8
+
9
+ export interface ITypedHttpRoute {
10
+ protocol: "http";
11
+ function: Function;
12
+ controller: IReflectController;
13
+ name: string;
14
+ method: string;
15
+ path: string;
16
+ accessor: string[];
17
+
18
+ // PARAMETERS
19
+ pathParameters: ITypedHttpRouteParameter.IPath[];
20
+ queryParameters: ITypedHttpRouteParameter.IQuery[];
21
+ headerParameters: ITypedHttpRouteParameter.IHeaders[];
22
+ queryObject: ITypedHttpRouteParameter.IQuery | null;
23
+ headerObject: ITypedHttpRouteParameter.IHeaders | null;
24
+ body: ITypedHttpRouteParameter.IBody | null;
25
+
26
+ // RESPONSES
27
+ success: ITypedHttpRouteSuccess;
28
+ exceptions: Record<
29
+ number | "2XX" | "3XX" | "4XX" | "5XX",
30
+ ITypedHttpRouteException
31
+ >;
32
+
33
+ // ADDITIONAL INFORMATION
34
+ security: Record<string, string[]>[];
35
+ tags: string[];
36
+ imports: IReflectImport[];
37
+ description: string | null;
38
+ jsDocTags: IJsDocTagInfo[];
39
+ operationId: string | undefined;
40
+ extensions?: Record<string, any>;
41
+ }
@@ -1,24 +1,24 @@
1
- import { VERSION_NEUTRAL } from "@nestjs/common";
2
- import ts from "typescript";
3
-
4
- import { IReflectController } from "./IReflectController";
5
- import { IReflectImport } from "./IReflectImport";
6
- import { ITypedWebSocketRouteParameter } from "./ITypedWebSocketRouteParameter";
7
-
8
- export interface ITypedWebSocketRoute {
9
- protocol: "websocket";
10
- controller: IReflectController;
11
- name: string;
12
- path: string;
13
- accessor: string[];
14
- function: Function;
15
- versions: Array<string | typeof VERSION_NEUTRAL> | undefined;
16
- acceptor: ITypedWebSocketRouteParameter.IAcceptor;
17
- header: ITypedWebSocketRouteParameter.IHeader | null;
18
- pathParameters: ITypedWebSocketRouteParameter.IParam[];
19
- query: ITypedWebSocketRouteParameter.IQuery | null;
20
- driver: ITypedWebSocketRouteParameter.IDriver | null;
21
- imports: IReflectImport[];
22
- description: string | null;
23
- jsDocTags: ts.JSDocTagInfo[];
24
- }
1
+ import { VERSION_NEUTRAL } from "@nestjs/common";
2
+ import ts from "typescript";
3
+
4
+ import { IReflectController } from "./IReflectController";
5
+ import { IReflectImport } from "./IReflectImport";
6
+ import { ITypedWebSocketRouteParameter } from "./ITypedWebSocketRouteParameter";
7
+
8
+ export interface ITypedWebSocketRoute {
9
+ protocol: "websocket";
10
+ controller: IReflectController;
11
+ name: string;
12
+ path: string;
13
+ accessor: string[];
14
+ function: Function;
15
+ versions: Array<string | typeof VERSION_NEUTRAL> | undefined;
16
+ acceptor: ITypedWebSocketRouteParameter.IAcceptor;
17
+ header: ITypedWebSocketRouteParameter.IHeader | null;
18
+ pathParameters: ITypedWebSocketRouteParameter.IParam[];
19
+ query: ITypedWebSocketRouteParameter.IQuery | null;
20
+ driver: ITypedWebSocketRouteParameter.IDriver | null;
21
+ imports: IReflectImport[];
22
+ description: string | null;
23
+ jsDocTags: ts.JSDocTagInfo[];
24
+ }
@@ -1,3 +1,3 @@
1
- import { IReflectWebSocketOperationParameter } from "./IReflectWebSocketOperationParameter";
2
-
3
- export import ITypedWebSocketRouteParameter = IReflectWebSocketOperationParameter;
1
+ import { IReflectWebSocketOperationParameter } from "./IReflectWebSocketOperationParameter";
2
+
3
+ export import ITypedWebSocketRouteParameter = IReflectWebSocketOperationParameter;
@@ -1,5 +1,5 @@
1
- export type MethodType = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
2
-
3
- export namespace MethodType {
4
- export const VALUES: MethodType[] = ["GET", "POST", "PUT", "PATCH", "DELETE"];
5
- }
1
+ export type MethodType = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
2
+
3
+ export namespace MethodType {
4
+ export const VALUES: MethodType[] = ["GET", "POST", "PUT", "PATCH", "DELETE"];
5
+ }
@@ -1 +1 @@
1
- export type ParamCategory = "param" | "query" | "body" | "rawBody" | "headers";
1
+ export type ParamCategory = "param" | "query" | "body" | "rawBody" | "headers";