typia 5.1.3 → 5.1.4

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 (66) hide show
  1. package/lib/executable/TypiaSetupWizard.js +1 -19
  2. package/lib/executable/TypiaSetupWizard.js.map +1 -1
  3. package/package.json +1 -1
  4. package/src/executable/TypiaSetupWizard.ts +1 -16
  5. package/src/factories/MetadataCollection.ts +277 -277
  6. package/src/factories/MetadataFactory.ts +238 -238
  7. package/src/factories/MetadataTypeTagFactory.ts +325 -325
  8. package/src/factories/internal/metadata/emend_metadata_atomics.ts +41 -41
  9. package/src/factories/internal/metadata/iterate_metadata_intersection.ts +259 -259
  10. package/src/functional/$HeadersReader.ts +28 -28
  11. package/src/functional/$ParameterReader.ts +31 -31
  12. package/src/functional/$QueryReader.ts +56 -56
  13. package/src/functional/Namespace.ts +142 -142
  14. package/src/http.ts +1149 -1149
  15. package/src/json.ts +648 -648
  16. package/src/misc.ts +651 -651
  17. package/src/module.ts +657 -657
  18. package/src/programmers/helpers/HttpMetadataUtil.ts +21 -21
  19. package/src/programmers/http/HttpAssertHeadersProgrammer.ts +77 -77
  20. package/src/programmers/http/HttpAssertQueryProgrammer.ts +77 -77
  21. package/src/programmers/http/HttpHeadersProgrammer.ts +339 -339
  22. package/src/programmers/http/HttpIsHeadersProgrammer.ts +87 -87
  23. package/src/programmers/http/HttpIsQueryProgrammer.ts +87 -87
  24. package/src/programmers/http/HttpParameterProgrammer.ts +104 -104
  25. package/src/programmers/http/HttpQueryProgrammer.ts +273 -273
  26. package/src/programmers/http/HttpValidateHeadersProgrammer.ts +77 -77
  27. package/src/programmers/http/HttpValidateQueryProgrammer.ts +77 -77
  28. package/src/programmers/internal/application_boolean.ts +30 -30
  29. package/src/programmers/internal/application_number.ts +90 -90
  30. package/src/programmers/internal/application_schema.ts +180 -180
  31. package/src/programmers/internal/application_string.ts +54 -54
  32. package/src/programmers/internal/check_array_length.ts +44 -44
  33. package/src/programmers/internal/check_bigint.ts +48 -48
  34. package/src/programmers/internal/check_number.ts +108 -108
  35. package/src/programmers/internal/check_string.ts +48 -48
  36. package/src/programmers/protobuf/ProtobufEncodeProgrammer.ts +882 -882
  37. package/src/protobuf.ts +887 -887
  38. package/src/schemas/json/IJsonComponents.ts +34 -34
  39. package/src/schemas/json/IJsonSchema.ts +112 -112
  40. package/src/schemas/metadata/IMetadataConstant.ts +25 -25
  41. package/src/schemas/metadata/IMetadataTypeTag.ts +8 -8
  42. package/src/schemas/metadata/Metadata.ts +686 -686
  43. package/src/tags/Default.ts +15 -15
  44. package/src/tags/Format.ts +30 -30
  45. package/src/tags/Pattern.ts +9 -9
  46. package/src/tags/TagBase.ts +68 -68
  47. package/src/tags/index.ts +14 -14
  48. package/src/transformers/CallExpressionTransformer.ts +289 -289
  49. package/src/transformers/features/http/CreateHttpAssertHeadersTransformer.ts +12 -12
  50. package/src/transformers/features/http/CreateHttpAssertQueryTransformer.ts +12 -12
  51. package/src/transformers/features/http/CreateHttpHeadersTransformer.ts +9 -9
  52. package/src/transformers/features/http/CreateHttpIsHeadersTransformer.ts +9 -9
  53. package/src/transformers/features/http/CreateHttpIsQueryTransformer.ts +9 -9
  54. package/src/transformers/features/http/CreateHttpParameterTransformer.ts +9 -9
  55. package/src/transformers/features/http/CreateHttpQueryTransformer.ts +9 -9
  56. package/src/transformers/features/http/CreateHttpValidateHeadersTransformer.ts +12 -12
  57. package/src/transformers/features/http/CreateHttpValidateQueryTransformer.ts +12 -12
  58. package/src/transformers/features/http/HttpAssertHeadersTransformer.ts +10 -10
  59. package/src/transformers/features/http/HttpAssertQueryTransformer.ts +10 -10
  60. package/src/transformers/features/http/HttpHeadersTransformer.ts +9 -9
  61. package/src/transformers/features/http/HttpIsHeadersTransformer.ts +9 -9
  62. package/src/transformers/features/http/HttpIsQueryTransformer.ts +9 -9
  63. package/src/transformers/features/http/HttpParameterTransformer.ts +9 -9
  64. package/src/transformers/features/http/HttpQueryTransformer.ts +9 -9
  65. package/src/transformers/features/http/HttpValidateHeadersTransformer.ts +10 -10
  66. package/src/transformers/features/http/HttpValidateQueryTransformer.ts +10 -10
@@ -1,15 +1,15 @@
1
- import { TagBase } from "./TagBase";
2
-
3
- export type Default<Value extends boolean | bigint | number | string> =
4
- TagBase<{
5
- target: Value extends boolean
6
- ? "boolean"
7
- : Value extends bigint
8
- ? "bigint"
9
- : Value extends number
10
- ? "number"
11
- : "string";
12
- kind: "default";
13
- value: Value;
14
- exclusive: true;
15
- }>;
1
+ import { TagBase } from "./TagBase";
2
+
3
+ export type Default<Value extends boolean | bigint | number | string> =
4
+ TagBase<{
5
+ target: Value extends boolean
6
+ ? "boolean"
7
+ : Value extends bigint
8
+ ? "bigint"
9
+ : Value extends number
10
+ ? "number"
11
+ : "string";
12
+ kind: "default";
13
+ value: Value;
14
+ exclusive: true;
15
+ }>;
@@ -1,30 +1,30 @@
1
- import { TagBase } from "./TagBase";
2
-
3
- export type Format<
4
- Value extends
5
- | "email"
6
- | "uuid"
7
- | "ipv4"
8
- | "ipv6"
9
- | "url"
10
- | "date"
11
- | "date-time",
12
- > = TagBase<{
13
- target: "string";
14
- kind: "format";
15
- value: Value;
16
- validate: Value extends "email"
17
- ? `/^(([^<>()[\\]\\.,;:\\s@\\"]+(\\.[^<>()[\\]\\.,;:\\s@\\"]+)*)|(\\".+\\"))@(([^<>()[\\]\\.,;:\\s@\\"]+\\.)+[^<>()[\\]\\.,;:\\s@\\"]{2,})$/i.test($input)`
18
- : Value extends "uuid"
19
- ? `/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i.test($input)`
20
- : Value extends "ipv4"
21
- ? `/^(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test($input)`
22
- : Value extends "ipv6"
23
- ? `/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/.test($input)`
24
- : Value extends "url"
25
- ? `/^[a-zA-Z0-9]+:\\/\\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test($input)`
26
- : Value extends "date"
27
- ? `/^(\\d{4})-(\\d{2})-(\\d{2})$/.test($input)`
28
- : `!isNaN(new Date($input).getTime())`;
29
- exclusive: ["format", "pattern"];
30
- }>;
1
+ import { TagBase } from "./TagBase";
2
+
3
+ export type Format<
4
+ Value extends
5
+ | "email"
6
+ | "uuid"
7
+ | "ipv4"
8
+ | "ipv6"
9
+ | "url"
10
+ | "date"
11
+ | "date-time",
12
+ > = TagBase<{
13
+ target: "string";
14
+ kind: "format";
15
+ value: Value;
16
+ validate: Value extends "email"
17
+ ? `/^(([^<>()[\\]\\.,;:\\s@\\"]+(\\.[^<>()[\\]\\.,;:\\s@\\"]+)*)|(\\".+\\"))@(([^<>()[\\]\\.,;:\\s@\\"]+\\.)+[^<>()[\\]\\.,;:\\s@\\"]{2,})$/i.test($input)`
18
+ : Value extends "uuid"
19
+ ? `/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i.test($input)`
20
+ : Value extends "ipv4"
21
+ ? `/^(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test($input)`
22
+ : Value extends "ipv6"
23
+ ? `/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/.test($input)`
24
+ : Value extends "url"
25
+ ? `/^[a-zA-Z0-9]+:\\/\\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test($input)`
26
+ : Value extends "date"
27
+ ? `/^(\\d{4})-(\\d{2})-(\\d{2})$/.test($input)`
28
+ : `!isNaN(new Date($input).getTime())`;
29
+ exclusive: ["format", "pattern"];
30
+ }>;
@@ -1,9 +1,9 @@
1
- import { TagBase } from "./TagBase";
2
-
3
- export type Pattern<Value extends string> = TagBase<{
4
- target: "string";
5
- kind: "pattern";
6
- value: Value;
7
- validate: `/${Value}/.test($input)`;
8
- exclusive: ["format", "pattern"];
9
- }>;
1
+ import { TagBase } from "./TagBase";
2
+
3
+ export type Pattern<Value extends string> = TagBase<{
4
+ target: "string";
5
+ kind: "pattern";
6
+ value: Value;
7
+ validate: `/${Value}/.test($input)`;
8
+ exclusive: ["format", "pattern"];
9
+ }>;
@@ -1,68 +1,68 @@
1
- export type TagBase<Props extends TagBase.IProps<any, any, any, any, any>> = {
2
- /**
3
- * This is a dummy property for compilation.
4
- *
5
- * It does not mean anything in runtime.
6
- */
7
- "typia.tag"?: Props;
8
- };
9
- export namespace TagBase {
10
- export interface IProps<
11
- Target extends "boolean" | "bigint" | "number" | "string" | "array",
12
- Kind extends string,
13
- Value extends boolean | bigint | number | string | undefined,
14
- Validate extends
15
- | string
16
- | {
17
- [key in Target]?: string;
18
- },
19
- Exclusive extends boolean | string[],
20
- > {
21
- /**
22
- * Target type.
23
- *
24
- * If user tries to adapt this tag to a different type, it would be a compile
25
- * error.
26
- *
27
- * For example, you've configured target type as `string`, but user adapted it
28
- * onto a `number` type (`number & YourCustomTag<Value>`), then it would be
29
- * blocked by TypeScript compiler.
30
- */
31
- target: Target;
32
-
33
- /**
34
- * What kind of tag is this?
35
- */
36
- kind: Kind;
37
-
38
- /**
39
- * Value to be configured by user.
40
- */
41
- value: Value;
42
-
43
- /**
44
- * Validation script.
45
- *
46
- * This script would be inserted into the generated validation function.
47
- * In here script, target variable name must be `$input`. The variable name
48
- * `$input` would be transformed to the suitable when compilation.
49
- *
50
- * Also, If you've take a mistake on this script, compile error would be
51
- * occured. So, define it with confidence. Compiler will block all your
52
- * mistakes.
53
- */
54
- validate?: Validate;
55
-
56
- /**
57
- * Exclusive option.
58
- *
59
- * If this property configured as `true`, same {@link kind} tag cannot be
60
- * duplicated in the target type. Otherwise, if you've configured this
61
- * property as string array, all of the {@link kind} value assigned
62
- * tags cannot be compatible in the target type.
63
- *
64
- * @default false
65
- */
66
- exclusive?: Exclusive | string[];
67
- }
68
- }
1
+ export type TagBase<Props extends TagBase.IProps<any, any, any, any, any>> = {
2
+ /**
3
+ * This is a dummy property for compilation.
4
+ *
5
+ * It does not mean anything in runtime.
6
+ */
7
+ "typia.tag"?: Props;
8
+ };
9
+ export namespace TagBase {
10
+ export interface IProps<
11
+ Target extends "boolean" | "bigint" | "number" | "string" | "array",
12
+ Kind extends string,
13
+ Value extends boolean | bigint | number | string | undefined,
14
+ Validate extends
15
+ | string
16
+ | {
17
+ [key in Target]?: string;
18
+ },
19
+ Exclusive extends boolean | string[],
20
+ > {
21
+ /**
22
+ * Target type.
23
+ *
24
+ * If user tries to adapt this tag to a different type, it would be a compile
25
+ * error.
26
+ *
27
+ * For example, you've configured target type as `string`, but user adapted it
28
+ * onto a `number` type (`number & YourCustomTag<Value>`), then it would be
29
+ * blocked by TypeScript compiler.
30
+ */
31
+ target: Target;
32
+
33
+ /**
34
+ * What kind of tag is this?
35
+ */
36
+ kind: Kind;
37
+
38
+ /**
39
+ * Value to be configured by user.
40
+ */
41
+ value: Value;
42
+
43
+ /**
44
+ * Validation script.
45
+ *
46
+ * This script would be inserted into the generated validation function.
47
+ * In here script, target variable name must be `$input`. The variable name
48
+ * `$input` would be transformed to the suitable when compilation.
49
+ *
50
+ * Also, If you've take a mistake on this script, compile error would be
51
+ * occured. So, define it with confidence. Compiler will block all your
52
+ * mistakes.
53
+ */
54
+ validate?: Validate;
55
+
56
+ /**
57
+ * Exclusive option.
58
+ *
59
+ * If this property configured as `true`, same {@link kind} tag cannot be
60
+ * duplicated in the target type. Otherwise, if you've configured this
61
+ * property as string array, all of the {@link kind} value assigned
62
+ * tags cannot be compatible in the target type.
63
+ *
64
+ * @default false
65
+ */
66
+ exclusive?: Exclusive | string[];
67
+ }
68
+ }
package/src/tags/index.ts CHANGED
@@ -1,14 +1,14 @@
1
- export * from "./Default";
2
- export * from "./ExclusiveMaximum";
3
- export * from "./ExclusiveMinimum";
4
- export * from "./Format";
5
- export * from "./Maximum";
6
- export * from "./MaxItems";
7
- export * from "./MaxLength";
8
- export * from "./Minimum";
9
- export * from "./MinItems";
10
- export * from "./MinLength";
11
- export * from "./MultipleOf";
12
- export * from "./Pattern";
13
- export * from "./TagBase";
14
- export * from "./Type";
1
+ export * from "./Default";
2
+ export * from "./ExclusiveMaximum";
3
+ export * from "./ExclusiveMinimum";
4
+ export * from "./Format";
5
+ export * from "./Maximum";
6
+ export * from "./MaxItems";
7
+ export * from "./MaxLength";
8
+ export * from "./Minimum";
9
+ export * from "./MinItems";
10
+ export * from "./MinLength";
11
+ export * from "./MultipleOf";
12
+ export * from "./Pattern";
13
+ export * from "./TagBase";
14
+ export * from "./Type";