@nestia/core 11.0.0-dev.20260305 → 11.0.0-dev.20260312

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 (49) hide show
  1. package/lib/programmers/TypedBodyProgrammer.js +2 -2
  2. package/lib/programmers/TypedBodyProgrammer.js.map +1 -1
  3. package/lib/programmers/TypedQueryBodyProgrammer.js +2 -1
  4. package/lib/programmers/TypedQueryBodyProgrammer.js.map +1 -1
  5. package/lib/programmers/TypedQueryProgrammer.js +2 -1
  6. package/lib/programmers/TypedQueryProgrammer.js.map +1 -1
  7. package/lib/programmers/TypedQueryRouteProgrammer.js +2 -1
  8. package/lib/programmers/TypedQueryRouteProgrammer.js.map +1 -1
  9. package/lib/programmers/TypedRouteProgrammer.js +2 -2
  10. package/lib/programmers/TypedRouteProgrammer.js.map +1 -1
  11. package/package.json +8 -8
  12. package/src/decorators/DynamicModule.ts +44 -44
  13. package/src/decorators/PlainBody.ts +76 -76
  14. package/src/decorators/SwaggerExample.ts +100 -100
  15. package/src/decorators/TypedBody.ts +57 -57
  16. package/src/decorators/TypedException.ts +147 -147
  17. package/src/decorators/TypedHeaders.ts +66 -66
  18. package/src/decorators/TypedParam.ts +77 -77
  19. package/src/decorators/TypedQuery.ts +234 -234
  20. package/src/decorators/WebSocketRoute.ts +242 -242
  21. package/src/decorators/internal/EncryptedConstant.ts +2 -2
  22. package/src/decorators/internal/IWebSocketRouteReflect.ts +23 -23
  23. package/src/decorators/internal/NoTransformConfigureError.ts +2 -2
  24. package/src/decorators/internal/get_path_and_querify.ts +94 -94
  25. package/src/decorators/internal/get_path_and_stringify.ts +110 -110
  26. package/src/decorators/internal/get_text_body.ts +16 -16
  27. package/src/decorators/internal/is_request_body_undefined.ts +12 -12
  28. package/src/decorators/internal/load_controller.ts +45 -45
  29. package/src/decorators/internal/route_error.ts +43 -43
  30. package/src/decorators/internal/validate_request_body.ts +64 -64
  31. package/src/decorators/internal/validate_request_form_data.ts +67 -67
  32. package/src/decorators/internal/validate_request_headers.ts +76 -76
  33. package/src/decorators/internal/validate_request_query.ts +64 -64
  34. package/src/index.ts +5 -5
  35. package/src/options/IRequestBodyValidator.ts +20 -20
  36. package/src/options/IRequestFormDataProps.ts +27 -27
  37. package/src/options/IRequestHeadersValidator.ts +22 -22
  38. package/src/options/IRequestQueryValidator.ts +20 -20
  39. package/src/options/IResponseBodyQuerifier.ts +25 -25
  40. package/src/options/IResponseBodyStringifier.ts +30 -30
  41. package/src/transformers/NodeTransformer.ts +23 -23
  42. package/src/transformers/ParameterTransformer.ts +57 -57
  43. package/src/typings/Creator.ts +3 -3
  44. package/src/typings/get-function-location.d.ts +7 -7
  45. package/src/utils/ArrayUtil.ts +7 -7
  46. package/src/utils/ExceptionManager.ts +115 -115
  47. package/src/utils/Singleton.ts +16 -16
  48. package/src/utils/SourceFinder.ts +54 -54
  49. package/src/utils/VersioningStrategy.ts +27 -27
@@ -1,54 +1,54 @@
1
- import fs from "fs";
2
- import { glob } from "glob";
3
- import path from "path";
4
-
5
- export namespace SourceFinder {
6
- export const find = async (props: IProps): Promise<string[]> => {
7
- const dict: Set<string> = new Set();
8
-
9
- await emplace(props.filter)(props.include)((str) => dict.add(str));
10
- if (props.exclude?.length)
11
- await emplace(props.filter)(props.exclude)((str) => dict.delete(str));
12
-
13
- return [...dict];
14
- };
15
-
16
- const emplace =
17
- (filter: (file: string) => boolean) =>
18
- (input: string[]) =>
19
- async (closure: (location: string) => void): Promise<void> => {
20
- for (const pattern of input) {
21
- for (const file of await _Glob(path.resolve(pattern))) {
22
- const stats: fs.Stats = await fs.promises.stat(file);
23
- if (stats.isDirectory() === true)
24
- await iterate(filter)(closure)(file);
25
- else if (stats.isFile() && filter(file)) closure(file);
26
- }
27
- }
28
- };
29
-
30
- const iterate =
31
- (filter: (location: string) => boolean) =>
32
- (closure: (location: string) => void) =>
33
- async (location: string): Promise<void> => {
34
- const directory: string[] = await fs.promises.readdir(location);
35
- for (const file of directory) {
36
- const next: string = path.resolve(`${location}/${file}`);
37
- const stats: fs.Stats = await fs.promises.stat(next);
38
-
39
- if (stats.isDirectory() === true) await iterate(filter)(closure)(next);
40
- else if (stats.isFile() && filter(next)) closure(next);
41
- }
42
- };
43
-
44
- const _Glob = async (pattern: string): Promise<string[]> => {
45
- const matches = await glob(pattern);
46
- return matches.map((str) => path.resolve(str));
47
- };
48
- }
49
-
50
- interface IProps {
51
- exclude?: string[];
52
- include: string[];
53
- filter: (location: string) => boolean;
54
- }
1
+ import fs from "fs";
2
+ import { glob } from "glob";
3
+ import path from "path";
4
+
5
+ export namespace SourceFinder {
6
+ export const find = async (props: IProps): Promise<string[]> => {
7
+ const dict: Set<string> = new Set();
8
+
9
+ await emplace(props.filter)(props.include)((str) => dict.add(str));
10
+ if (props.exclude?.length)
11
+ await emplace(props.filter)(props.exclude)((str) => dict.delete(str));
12
+
13
+ return [...dict];
14
+ };
15
+
16
+ const emplace =
17
+ (filter: (file: string) => boolean) =>
18
+ (input: string[]) =>
19
+ async (closure: (location: string) => void): Promise<void> => {
20
+ for (const pattern of input) {
21
+ for (const file of await _Glob(path.resolve(pattern))) {
22
+ const stats: fs.Stats = await fs.promises.stat(file);
23
+ if (stats.isDirectory() === true)
24
+ await iterate(filter)(closure)(file);
25
+ else if (stats.isFile() && filter(file)) closure(file);
26
+ }
27
+ }
28
+ };
29
+
30
+ const iterate =
31
+ (filter: (location: string) => boolean) =>
32
+ (closure: (location: string) => void) =>
33
+ async (location: string): Promise<void> => {
34
+ const directory: string[] = await fs.promises.readdir(location);
35
+ for (const file of directory) {
36
+ const next: string = path.resolve(`${location}/${file}`);
37
+ const stats: fs.Stats = await fs.promises.stat(next);
38
+
39
+ if (stats.isDirectory() === true) await iterate(filter)(closure)(next);
40
+ else if (stats.isFile() && filter(next)) closure(next);
41
+ }
42
+ };
43
+
44
+ const _Glob = async (pattern: string): Promise<string[]> => {
45
+ const matches = await glob(pattern);
46
+ return matches.map((str) => path.resolve(str));
47
+ };
48
+ }
49
+
50
+ interface IProps {
51
+ exclude?: string[];
52
+ include: string[];
53
+ filter: (location: string) => boolean;
54
+ }
@@ -1,27 +1,27 @@
1
- import { VERSION_NEUTRAL, VersionValue } from "@nestjs/common/interfaces";
2
-
3
- export namespace VersioningStrategy {
4
- export interface IConfig {
5
- prefix: string;
6
- defaultVersion?: VersionValue;
7
- }
8
-
9
- export const cast = (
10
- value: VersionValue | undefined,
11
- ): Array<string | typeof VERSION_NEUTRAL> =>
12
- value === undefined ? [] : Array.isArray(value) ? value : [value];
13
-
14
- export const merge =
15
- (config: IConfig | undefined) =>
16
- (values: Array<string | typeof VERSION_NEUTRAL>): string[] => {
17
- if (config === undefined) return [""];
18
- const set: Set<string | typeof VERSION_NEUTRAL> = new Set(values);
19
- const array: Array<string | typeof VERSION_NEUTRAL> =
20
- set.size === 0 ? cast(config.defaultVersion) : Array.from(set);
21
- return !!array?.length
22
- ? array.map((x) =>
23
- typeof x === "symbol" ? "" : `${config.prefix}${x}`,
24
- )
25
- : [];
26
- };
27
- }
1
+ import { VERSION_NEUTRAL, VersionValue } from "@nestjs/common/interfaces";
2
+
3
+ export namespace VersioningStrategy {
4
+ export interface IConfig {
5
+ prefix: string;
6
+ defaultVersion?: VersionValue;
7
+ }
8
+
9
+ export const cast = (
10
+ value: VersionValue | undefined,
11
+ ): Array<string | typeof VERSION_NEUTRAL> =>
12
+ value === undefined ? [] : Array.isArray(value) ? value : [value];
13
+
14
+ export const merge =
15
+ (config: IConfig | undefined) =>
16
+ (values: Array<string | typeof VERSION_NEUTRAL>): string[] => {
17
+ if (config === undefined) return [""];
18
+ const set: Set<string | typeof VERSION_NEUTRAL> = new Set(values);
19
+ const array: Array<string | typeof VERSION_NEUTRAL> =
20
+ set.size === 0 ? cast(config.defaultVersion) : Array.from(set);
21
+ return !!array?.length
22
+ ? array.map((x) =>
23
+ typeof x === "symbol" ? "" : `${config.prefix}${x}`,
24
+ )
25
+ : [];
26
+ };
27
+ }