typia 9.0.1 → 9.1.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/lib/functional.js +19 -27
- package/lib/functional.js.map +1 -1
- package/lib/functional.mjs +20 -27
- package/lib/http.js +27 -32
- package/lib/http.js.map +1 -1
- package/lib/http.mjs +28 -32
- package/lib/json.d.mts +66 -4
- package/lib/json.d.ts +66 -4
- package/lib/json.js +23 -21
- package/lib/json.js.map +1 -1
- package/lib/json.mjs +24 -22
- package/lib/llm.js +4 -9
- package/lib/llm.js.map +1 -1
- package/lib/llm.mjs +5 -9
- package/lib/misc.js +27 -23
- package/lib/misc.js.map +1 -1
- package/lib/misc.mjs +28 -23
- package/lib/module.d.mts +1 -0
- package/lib/module.d.ts +1 -0
- package/lib/module.js +20 -24
- package/lib/module.js.map +1 -1
- package/lib/module.mjs +19 -24
- package/lib/notations.js +25 -30
- package/lib/notations.js.map +1 -1
- package/lib/notations.mjs +26 -30
- package/lib/programmers/json/JsonSchemaProgrammer.d.mts +9 -0
- package/lib/programmers/json/JsonSchemaProgrammer.d.ts +9 -0
- package/lib/programmers/json/JsonSchemaProgrammer.js +20 -0
- package/lib/programmers/json/JsonSchemaProgrammer.js.map +1 -0
- package/lib/programmers/json/JsonSchemaProgrammer.mjs +20 -0
- package/lib/programmers/json/JsonSchemaProgrammer.mjs.map +1 -0
- package/lib/programmers/json/JsonSchemasProgrammer.js +1 -1
- package/lib/programmers/json/JsonSchemasProgrammer.js.map +1 -1
- package/lib/programmers/json/JsonSchemasProgrammer.mjs +1 -1
- package/lib/protobuf.js +18 -23
- package/lib/protobuf.js.map +1 -1
- package/lib/protobuf.mjs +19 -23
- package/lib/reflect.js +3 -8
- package/lib/reflect.js.map +1 -1
- package/lib/reflect.mjs +4 -8
- package/lib/schemas/json/IJsonSchemaUnit.d.mts +26 -0
- package/lib/schemas/json/IJsonSchemaUnit.d.ts +26 -0
- package/lib/schemas/json/IJsonSchemaUnit.js +3 -0
- package/lib/schemas/json/IJsonSchemaUnit.js.map +1 -0
- package/lib/schemas/json/IJsonSchemaUnit.mjs +2 -0
- package/lib/schemas/json/IJsonSchemaUnit.mjs.map +1 -0
- package/lib/transformers/CallExpressionTransformer.js +2 -2
- package/lib/transformers/CallExpressionTransformer.js.map +1 -1
- package/lib/transformers/CallExpressionTransformer.mjs +2 -2
- package/lib/transformers/NoTransformConfigurationError.d.mts +1 -0
- package/lib/transformers/NoTransformConfigurationError.d.ts +1 -0
- package/lib/transformers/NoTransformConfigurationError.js +20 -0
- package/lib/transformers/NoTransformConfigurationError.js.map +1 -0
- package/lib/transformers/NoTransformConfigurationError.mjs +19 -0
- package/lib/transformers/NoTransformConfigurationError.mjs.map +1 -0
- package/lib/transformers/features/json/JsonSchemaTransformer.d.mts +5 -0
- package/lib/transformers/features/json/JsonSchemaTransformer.d.ts +5 -0
- package/lib/transformers/features/json/JsonSchemaTransformer.js +108 -0
- package/lib/transformers/features/json/JsonSchemaTransformer.js.map +1 -0
- package/lib/transformers/features/json/JsonSchemaTransformer.mjs +104 -0
- package/lib/transformers/features/json/JsonSchemaTransformer.mjs.map +1 -0
- package/lib/transformers/features/json/JsonSchemasTransformer.js +9 -9
- package/lib/transformers/features/json/JsonSchemasTransformer.js.map +1 -1
- package/lib/transformers/features/json/JsonSchemasTransformer.mjs +9 -9
- package/package.json +1 -1
- package/src/functional.ts +20 -30
- package/src/http.ts +28 -35
- package/src/json.ts +73 -73
- package/src/llm.ts +5 -12
- package/src/misc.ts +19 -26
- package/src/module.ts +21 -27
- package/src/notations.ts +26 -33
- package/src/programmers/json/JsonSchemaProgrammer.ts +26 -0
- package/src/programmers/json/JsonSchemasProgrammer.ts +1 -1
- package/src/protobuf.ts +19 -26
- package/src/reflect.ts +4 -11
- package/src/schemas/json/IJsonSchemaUnit.ts +32 -0
- package/src/transformers/CallExpressionTransformer.ts +2 -2
- package/src/transformers/NoTransformConfigurationError.ts +18 -0
- package/src/transformers/features/json/JsonSchemaTransformer.ts +135 -0
- package/src/transformers/features/json/JsonSchemasTransformer.ts +9 -9
package/src/misc.ts
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
==============================================================
|
|
8
8
|
LITERALS
|
|
9
9
|
----------------------------------------------------------- */
|
|
10
|
+
import { NoTransformConfigurationError } from "./transformers/NoTransformConfigurationError";
|
|
11
|
+
|
|
10
12
|
import { Atomic } from "./typings/Atomic";
|
|
11
13
|
|
|
12
14
|
import { IValidation } from "./IValidation";
|
|
@@ -51,7 +53,7 @@ export function literals<T extends Atomic.Type | null>(): T[];
|
|
|
51
53
|
* @internal
|
|
52
54
|
*/
|
|
53
55
|
export function literals(): never {
|
|
54
|
-
|
|
56
|
+
NoTransformConfigurationError("misc.literals");
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
/* -----------------------------------------------------------
|
|
@@ -81,7 +83,7 @@ export function clone<T>(input: T): Resolved<T>;
|
|
|
81
83
|
* @internal
|
|
82
84
|
*/
|
|
83
85
|
export function clone(): never {
|
|
84
|
-
|
|
86
|
+
NoTransformConfigurationError("misc.clone");
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
/**
|
|
@@ -134,7 +136,7 @@ export function assertClone<T>(
|
|
|
134
136
|
* @internal
|
|
135
137
|
*/
|
|
136
138
|
export function assertClone(): never {
|
|
137
|
-
|
|
139
|
+
NoTransformConfigurationError("misc.assertClone");
|
|
138
140
|
}
|
|
139
141
|
|
|
140
142
|
/**
|
|
@@ -179,7 +181,7 @@ export function isClone<T>(input: unknown): Resolved<T> | null;
|
|
|
179
181
|
* @internal
|
|
180
182
|
*/
|
|
181
183
|
export function isClone(): never {
|
|
182
|
-
|
|
184
|
+
NoTransformConfigurationError("misc.isClone");
|
|
183
185
|
}
|
|
184
186
|
|
|
185
187
|
/**
|
|
@@ -222,7 +224,7 @@ export function validateClone<T>(input: unknown): IValidation<Resolved<T>>;
|
|
|
222
224
|
* @internal
|
|
223
225
|
*/
|
|
224
226
|
export function validateClone(): never {
|
|
225
|
-
|
|
227
|
+
NoTransformConfigurationError("misc.validateClone");
|
|
226
228
|
}
|
|
227
229
|
|
|
228
230
|
/* -----------------------------------------------------------
|
|
@@ -255,7 +257,7 @@ export function prune<T extends object>(input: T): void;
|
|
|
255
257
|
* @internal
|
|
256
258
|
*/
|
|
257
259
|
export function prune(): never {
|
|
258
|
-
|
|
260
|
+
NoTransformConfigurationError("misc.prune");
|
|
259
261
|
}
|
|
260
262
|
|
|
261
263
|
/**
|
|
@@ -308,7 +310,7 @@ export function assertPrune<T>(
|
|
|
308
310
|
* @internal
|
|
309
311
|
*/
|
|
310
312
|
export function assertPrune(): unknown {
|
|
311
|
-
|
|
313
|
+
NoTransformConfigurationError("misc.assertPrune");
|
|
312
314
|
}
|
|
313
315
|
|
|
314
316
|
/**
|
|
@@ -353,7 +355,7 @@ export function isPrune<T>(input: unknown): input is T;
|
|
|
353
355
|
* @internal
|
|
354
356
|
*/
|
|
355
357
|
export function isPrune(): never {
|
|
356
|
-
|
|
358
|
+
NoTransformConfigurationError("misc.isPrune");
|
|
357
359
|
}
|
|
358
360
|
|
|
359
361
|
/**
|
|
@@ -400,7 +402,7 @@ export function validatePrune<T>(input: unknown): IValidation<T>;
|
|
|
400
402
|
* @internal
|
|
401
403
|
*/
|
|
402
404
|
export function validatePrune<T>(): IValidation<T> {
|
|
403
|
-
|
|
405
|
+
NoTransformConfigurationError("misc.validatePrune");
|
|
404
406
|
}
|
|
405
407
|
|
|
406
408
|
/* -----------------------------------------------------------
|
|
@@ -431,7 +433,7 @@ export function createClone<T>(): (input: T) => Resolved<T>;
|
|
|
431
433
|
* @internal
|
|
432
434
|
*/
|
|
433
435
|
export function createClone(): never {
|
|
434
|
-
|
|
436
|
+
NoTransformConfigurationError("misc.createClone");
|
|
435
437
|
}
|
|
436
438
|
|
|
437
439
|
/**
|
|
@@ -465,7 +467,7 @@ export function createAssertClone<T>(
|
|
|
465
467
|
* @internal
|
|
466
468
|
*/
|
|
467
469
|
export function createAssertClone(): never {
|
|
468
|
-
|
|
470
|
+
NoTransformConfigurationError("misc.createAssertClone");
|
|
469
471
|
}
|
|
470
472
|
|
|
471
473
|
/**
|
|
@@ -493,7 +495,7 @@ export function createIsClone<T>(): (input: unknown) => Resolved<T> | null;
|
|
|
493
495
|
* @internal
|
|
494
496
|
*/
|
|
495
497
|
export function createIsClone(): never {
|
|
496
|
-
|
|
498
|
+
NoTransformConfigurationError("misc.createIsClone");
|
|
497
499
|
}
|
|
498
500
|
|
|
499
501
|
/**
|
|
@@ -523,7 +525,7 @@ export function createValidateClone<T>(): (
|
|
|
523
525
|
* @internal
|
|
524
526
|
*/
|
|
525
527
|
export function createValidateClone(): never {
|
|
526
|
-
|
|
528
|
+
NoTransformConfigurationError("misc.createValidateClone");
|
|
527
529
|
}
|
|
528
530
|
|
|
529
531
|
/**
|
|
@@ -551,7 +553,7 @@ export function createPrune<T extends object>(): (input: T) => void;
|
|
|
551
553
|
* @internal
|
|
552
554
|
*/
|
|
553
555
|
export function createPrune<T extends object>(): (input: T) => void {
|
|
554
|
-
|
|
556
|
+
NoTransformConfigurationError("misc.createPrune");
|
|
555
557
|
}
|
|
556
558
|
|
|
557
559
|
/**
|
|
@@ -585,7 +587,7 @@ export function createAssertPrune<T extends object>(
|
|
|
585
587
|
* @internal
|
|
586
588
|
*/
|
|
587
589
|
export function createAssertPrune<T extends object>(): (input: T) => T {
|
|
588
|
-
|
|
590
|
+
NoTransformConfigurationError("misc.createAssertPrune");
|
|
589
591
|
}
|
|
590
592
|
|
|
591
593
|
/**
|
|
@@ -613,7 +615,7 @@ export function createIsPrune<T extends object>(): (input: T) => input is T;
|
|
|
613
615
|
* @internal
|
|
614
616
|
*/
|
|
615
617
|
export function createIsPrune<T extends object>(): (input: T) => input is T {
|
|
616
|
-
|
|
618
|
+
NoTransformConfigurationError("misc.createIsPrune");
|
|
617
619
|
}
|
|
618
620
|
|
|
619
621
|
/**
|
|
@@ -645,14 +647,5 @@ export function createValidatePrune<T extends object>(): (
|
|
|
645
647
|
export function createValidatePrune<T extends object>(): (
|
|
646
648
|
input: T,
|
|
647
649
|
) => IValidation<T> {
|
|
648
|
-
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
/**
|
|
652
|
-
* @internal
|
|
653
|
-
*/
|
|
654
|
-
function halt(name: string): never {
|
|
655
|
-
throw new Error(
|
|
656
|
-
`Error on typia.misc.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
|
|
657
|
-
);
|
|
650
|
+
NoTransformConfigurationError("misc.createValidatePrune");
|
|
658
651
|
}
|
package/src/module.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NoTransformConfigurationError } from "./transformers/NoTransformConfigurationError";
|
|
2
|
+
|
|
1
3
|
import { AssertionGuard } from "./AssertionGuard";
|
|
2
4
|
import { IRandomGenerator } from "./IRandomGenerator";
|
|
3
5
|
import { IValidation } from "./IValidation";
|
|
@@ -17,6 +19,7 @@ export * as tags from "./tags";
|
|
|
17
19
|
export * from "./schemas/metadata/IJsDocTagInfo";
|
|
18
20
|
export * from "./schemas/json/IJsonApplication";
|
|
19
21
|
export * from "./schemas/json/IJsonSchemaCollection";
|
|
22
|
+
export * from "./schemas/json/IJsonSchemaUnit";
|
|
20
23
|
export * from "./AssertionGuard";
|
|
21
24
|
export * from "./IRandomGenerator";
|
|
22
25
|
export * from "./IValidation";
|
|
@@ -92,7 +95,7 @@ export function assert<T>(
|
|
|
92
95
|
* @internal
|
|
93
96
|
*/
|
|
94
97
|
export function assert(): never {
|
|
95
|
-
|
|
98
|
+
NoTransformConfigurationError("assert");
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
/**
|
|
@@ -159,7 +162,7 @@ export function assertGuard<T>(
|
|
|
159
162
|
* @internal
|
|
160
163
|
*/
|
|
161
164
|
export function assertGuard(): never {
|
|
162
|
-
|
|
165
|
+
NoTransformConfigurationError("assertGuard");
|
|
163
166
|
}
|
|
164
167
|
|
|
165
168
|
/**
|
|
@@ -215,7 +218,7 @@ export function is<T>(input: unknown): input is T;
|
|
|
215
218
|
* @internal
|
|
216
219
|
*/
|
|
217
220
|
export function is(): never {
|
|
218
|
-
|
|
221
|
+
NoTransformConfigurationError("is");
|
|
219
222
|
}
|
|
220
223
|
|
|
221
224
|
/**
|
|
@@ -272,7 +275,7 @@ export function validate<T>(input: unknown): IValidation<T>;
|
|
|
272
275
|
* @internal
|
|
273
276
|
*/
|
|
274
277
|
export function validate(): never {
|
|
275
|
-
|
|
278
|
+
NoTransformConfigurationError("validate");
|
|
276
279
|
}
|
|
277
280
|
|
|
278
281
|
/* -----------------------------------------------------------
|
|
@@ -340,7 +343,7 @@ export function assertEquals<T>(
|
|
|
340
343
|
* @internal
|
|
341
344
|
*/
|
|
342
345
|
export function assertEquals(): never {
|
|
343
|
-
|
|
346
|
+
NoTransformConfigurationError("assertEquals");
|
|
344
347
|
}
|
|
345
348
|
|
|
346
349
|
/**
|
|
@@ -413,7 +416,7 @@ export function assertGuardEquals<T>(
|
|
|
413
416
|
* @internal
|
|
414
417
|
*/
|
|
415
418
|
export function assertGuardEquals(): never {
|
|
416
|
-
|
|
419
|
+
NoTransformConfigurationError("assertGuardEquals");
|
|
417
420
|
}
|
|
418
421
|
|
|
419
422
|
/**
|
|
@@ -470,7 +473,7 @@ export function equals<T>(input: unknown): input is T;
|
|
|
470
473
|
* @internal
|
|
471
474
|
*/
|
|
472
475
|
export function equals(): never {
|
|
473
|
-
|
|
476
|
+
NoTransformConfigurationError("equals");
|
|
474
477
|
}
|
|
475
478
|
|
|
476
479
|
/**
|
|
@@ -529,7 +532,7 @@ export function validateEquals<T>(input: unknown): IValidation<T>;
|
|
|
529
532
|
* @internal
|
|
530
533
|
*/
|
|
531
534
|
export function validateEquals(): never {
|
|
532
|
-
|
|
535
|
+
NoTransformConfigurationError("validateEquals");
|
|
533
536
|
}
|
|
534
537
|
|
|
535
538
|
/* -----------------------------------------------------------
|
|
@@ -577,7 +580,7 @@ export function random<T>(generator?: Partial<IRandomGenerator>): Resolved<T>;
|
|
|
577
580
|
* @internal
|
|
578
581
|
*/
|
|
579
582
|
export function random(): never {
|
|
580
|
-
|
|
583
|
+
NoTransformConfigurationError("random");
|
|
581
584
|
}
|
|
582
585
|
|
|
583
586
|
/* -----------------------------------------------------------
|
|
@@ -614,7 +617,7 @@ export function createAssert<T>(
|
|
|
614
617
|
* @internal
|
|
615
618
|
*/
|
|
616
619
|
export function createAssert<T>(): (input: unknown) => T {
|
|
617
|
-
|
|
620
|
+
NoTransformConfigurationError("createAssert");
|
|
618
621
|
}
|
|
619
622
|
|
|
620
623
|
/**
|
|
@@ -678,7 +681,7 @@ export function createAssertGuard<T>(
|
|
|
678
681
|
* @internal
|
|
679
682
|
*/
|
|
680
683
|
export function createAssertGuard<T>(): (input: unknown) => AssertionGuard<T> {
|
|
681
|
-
|
|
684
|
+
NoTransformConfigurationError("createAssertGuard");
|
|
682
685
|
}
|
|
683
686
|
|
|
684
687
|
/**
|
|
@@ -706,7 +709,7 @@ export function createIs<T>(): (input: unknown) => input is T;
|
|
|
706
709
|
* @internal
|
|
707
710
|
*/
|
|
708
711
|
export function createIs<T>(): (input: unknown) => input is T {
|
|
709
|
-
|
|
712
|
+
NoTransformConfigurationError("createIs");
|
|
710
713
|
}
|
|
711
714
|
|
|
712
715
|
/**
|
|
@@ -734,7 +737,7 @@ export function createValidate<T>(): (input: unknown) => IValidation<T>;
|
|
|
734
737
|
* @internal
|
|
735
738
|
*/
|
|
736
739
|
export function createValidate(): (input: unknown) => IValidation {
|
|
737
|
-
|
|
740
|
+
NoTransformConfigurationError("createValidate");
|
|
738
741
|
}
|
|
739
742
|
|
|
740
743
|
/**
|
|
@@ -768,7 +771,7 @@ export function createAssertEquals<T>(
|
|
|
768
771
|
* @internal
|
|
769
772
|
*/
|
|
770
773
|
export function createAssertEquals<T>(): (input: unknown) => T {
|
|
771
|
-
|
|
774
|
+
NoTransformConfigurationError("createAssertEquals");
|
|
772
775
|
}
|
|
773
776
|
|
|
774
777
|
/**
|
|
@@ -834,7 +837,7 @@ export function createAssertGuardEquals<T>(
|
|
|
834
837
|
export function createAssertGuardEquals<T>(): (
|
|
835
838
|
input: unknown,
|
|
836
839
|
) => AssertionGuard<T> {
|
|
837
|
-
|
|
840
|
+
NoTransformConfigurationError("createAssertGuardEquals");
|
|
838
841
|
}
|
|
839
842
|
|
|
840
843
|
/**
|
|
@@ -862,7 +865,7 @@ export function createEquals<T>(): (input: unknown) => input is T;
|
|
|
862
865
|
* @internal
|
|
863
866
|
*/
|
|
864
867
|
export function createEquals<T>(): (input: unknown) => input is T {
|
|
865
|
-
|
|
868
|
+
NoTransformConfigurationError("createEquals");
|
|
866
869
|
}
|
|
867
870
|
|
|
868
871
|
/**
|
|
@@ -890,7 +893,7 @@ export function createValidateEquals<T>(): (input: unknown) => IValidation<T>;
|
|
|
890
893
|
* @internal
|
|
891
894
|
*/
|
|
892
895
|
export function createValidateEquals(): (input: unknown) => IValidation {
|
|
893
|
-
|
|
896
|
+
NoTransformConfigurationError("createValidateEquals");
|
|
894
897
|
}
|
|
895
898
|
|
|
896
899
|
/**
|
|
@@ -922,14 +925,5 @@ export function createRandom<T>(
|
|
|
922
925
|
* @internal
|
|
923
926
|
*/
|
|
924
927
|
export function createRandom(): never {
|
|
925
|
-
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
/**
|
|
929
|
-
* @internal
|
|
930
|
-
*/
|
|
931
|
-
function halt(name: string): never {
|
|
932
|
-
throw new Error(
|
|
933
|
-
`Error on typia.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
|
|
934
|
-
);
|
|
928
|
+
NoTransformConfigurationError("createRandom");
|
|
935
929
|
}
|
package/src/notations.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NoTransformConfigurationError } from "./transformers/NoTransformConfigurationError";
|
|
2
|
+
|
|
1
3
|
import { CamelCase } from "./CamelCase";
|
|
2
4
|
import { IValidation } from "./IValidation";
|
|
3
5
|
import { PascalCase } from "./PascalCase";
|
|
@@ -38,7 +40,7 @@ export function camel<T>(input: T): CamelCase<T>;
|
|
|
38
40
|
* @internal
|
|
39
41
|
*/
|
|
40
42
|
export function camel(): never {
|
|
41
|
-
return
|
|
43
|
+
return NoTransformConfigurationError("notations.camel");
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
/**
|
|
@@ -81,7 +83,7 @@ export function assertCamel<T>(
|
|
|
81
83
|
* @internal
|
|
82
84
|
*/
|
|
83
85
|
export function assertCamel(): never {
|
|
84
|
-
return
|
|
86
|
+
return NoTransformConfigurationError("notations.assertCamel");
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
/**
|
|
@@ -116,7 +118,7 @@ export function isCamel<T>(input: unknown): CamelCase<T> | null;
|
|
|
116
118
|
* @internal
|
|
117
119
|
*/
|
|
118
120
|
export function isCamel(): never {
|
|
119
|
-
return
|
|
121
|
+
return NoTransformConfigurationError("notations.isCamel");
|
|
120
122
|
}
|
|
121
123
|
|
|
122
124
|
/**
|
|
@@ -155,7 +157,7 @@ export function validateCamel<T>(input: unknown): IValidation<CamelCase<T>>;
|
|
|
155
157
|
* @internal
|
|
156
158
|
*/
|
|
157
159
|
export function validateCamel(): never {
|
|
158
|
-
return
|
|
160
|
+
return NoTransformConfigurationError("notations.validateCamel");
|
|
159
161
|
}
|
|
160
162
|
|
|
161
163
|
/* -----------------------------------------------------------
|
|
@@ -186,7 +188,7 @@ export function pascal<T>(input: T): PascalCase<T>;
|
|
|
186
188
|
* @internal
|
|
187
189
|
*/
|
|
188
190
|
export function pascal(): never {
|
|
189
|
-
return
|
|
191
|
+
return NoTransformConfigurationError("notations.pascal");
|
|
190
192
|
}
|
|
191
193
|
|
|
192
194
|
/**
|
|
@@ -229,7 +231,7 @@ export function assertPascal<T>(
|
|
|
229
231
|
* @internal
|
|
230
232
|
*/
|
|
231
233
|
export function assertPascal(): never {
|
|
232
|
-
return
|
|
234
|
+
return NoTransformConfigurationError("notations.assertPascal");
|
|
233
235
|
}
|
|
234
236
|
|
|
235
237
|
/**
|
|
@@ -264,7 +266,7 @@ export function isPascal<T>(input: unknown): PascalCase<T> | null;
|
|
|
264
266
|
* @internal
|
|
265
267
|
*/
|
|
266
268
|
export function isPascal(): never {
|
|
267
|
-
return
|
|
269
|
+
return NoTransformConfigurationError("notations.isPascal");
|
|
268
270
|
}
|
|
269
271
|
|
|
270
272
|
/**
|
|
@@ -303,7 +305,7 @@ export function validatePascal<T>(input: unknown): IValidation<PascalCase<T>>;
|
|
|
303
305
|
* @internal
|
|
304
306
|
*/
|
|
305
307
|
export function validatePascal(): never {
|
|
306
|
-
return
|
|
308
|
+
return NoTransformConfigurationError("notations.validatePascal");
|
|
307
309
|
}
|
|
308
310
|
|
|
309
311
|
/* -----------------------------------------------------------
|
|
@@ -334,7 +336,7 @@ export function snake<T>(input: T): SnakeCase<T>;
|
|
|
334
336
|
* @internal
|
|
335
337
|
*/
|
|
336
338
|
export function snake(): never {
|
|
337
|
-
return
|
|
339
|
+
return NoTransformConfigurationError("notations.snake");
|
|
338
340
|
}
|
|
339
341
|
|
|
340
342
|
/**
|
|
@@ -377,7 +379,7 @@ export function assertSnake<T>(
|
|
|
377
379
|
* @internal
|
|
378
380
|
*/
|
|
379
381
|
export function assertSnake(): never {
|
|
380
|
-
return
|
|
382
|
+
return NoTransformConfigurationError("notations.assertSnake");
|
|
381
383
|
}
|
|
382
384
|
|
|
383
385
|
/**
|
|
@@ -412,7 +414,7 @@ export function isSnake<T>(input: unknown): SnakeCase<T> | null;
|
|
|
412
414
|
* @internal
|
|
413
415
|
*/
|
|
414
416
|
export function isSnake(): never {
|
|
415
|
-
return
|
|
417
|
+
return NoTransformConfigurationError("notations.isSnake");
|
|
416
418
|
}
|
|
417
419
|
|
|
418
420
|
/**
|
|
@@ -451,7 +453,7 @@ export function validateSnake<T>(input: unknown): IValidation<SnakeCase<T>>;
|
|
|
451
453
|
* @internal
|
|
452
454
|
*/
|
|
453
455
|
export function validateSnake(): never {
|
|
454
|
-
return
|
|
456
|
+
return NoTransformConfigurationError("notations.validateSnake");
|
|
455
457
|
}
|
|
456
458
|
|
|
457
459
|
/* -----------------------------------------------------------
|
|
@@ -482,7 +484,7 @@ export function createCamel<T>(): (input: T) => CamelCase<T>;
|
|
|
482
484
|
* @internal
|
|
483
485
|
*/
|
|
484
486
|
export function createCamel(): never {
|
|
485
|
-
|
|
487
|
+
NoTransformConfigurationError("notations.createCamel");
|
|
486
488
|
}
|
|
487
489
|
|
|
488
490
|
/**
|
|
@@ -516,7 +518,7 @@ export function createAssertCamel<T>(
|
|
|
516
518
|
* @internal
|
|
517
519
|
*/
|
|
518
520
|
export function createAssertCamel(): never {
|
|
519
|
-
|
|
521
|
+
NoTransformConfigurationError("notations.createAssertCamel");
|
|
520
522
|
}
|
|
521
523
|
|
|
522
524
|
/**
|
|
@@ -544,7 +546,7 @@ export function createIsCamel<T>(): (input: T) => CamelCase<T> | null;
|
|
|
544
546
|
* @internal
|
|
545
547
|
*/
|
|
546
548
|
export function createIsCamel(): never {
|
|
547
|
-
|
|
549
|
+
NoTransformConfigurationError("notations.createIsCamel");
|
|
548
550
|
}
|
|
549
551
|
|
|
550
552
|
/**
|
|
@@ -574,7 +576,7 @@ export function createValidateCamel<T>(): (
|
|
|
574
576
|
* @internal
|
|
575
577
|
*/
|
|
576
578
|
export function createValidateCamel(): never {
|
|
577
|
-
|
|
579
|
+
NoTransformConfigurationError("notations.createValidateCamel");
|
|
578
580
|
}
|
|
579
581
|
|
|
580
582
|
/**
|
|
@@ -602,7 +604,7 @@ export function createPascal<T>(): (input: T) => PascalCase<T>;
|
|
|
602
604
|
* @internal
|
|
603
605
|
*/
|
|
604
606
|
export function createPascal(): never {
|
|
605
|
-
|
|
607
|
+
NoTransformConfigurationError("notations.createPascal");
|
|
606
608
|
}
|
|
607
609
|
|
|
608
610
|
/**
|
|
@@ -636,7 +638,7 @@ export function createAssertPascal<T>(
|
|
|
636
638
|
* @internal
|
|
637
639
|
*/
|
|
638
640
|
export function createAssertPascal(): never {
|
|
639
|
-
|
|
641
|
+
NoTransformConfigurationError("notations.createAssertPascal");
|
|
640
642
|
}
|
|
641
643
|
|
|
642
644
|
/**
|
|
@@ -664,7 +666,7 @@ export function createIsPascal<T>(): (input: T) => PascalCase<T> | null;
|
|
|
664
666
|
* @internal
|
|
665
667
|
*/
|
|
666
668
|
export function createIsPascal(): never {
|
|
667
|
-
|
|
669
|
+
NoTransformConfigurationError("notations.createIsPascal");
|
|
668
670
|
}
|
|
669
671
|
|
|
670
672
|
/**
|
|
@@ -694,7 +696,7 @@ export function createValidatePascal<T>(): (
|
|
|
694
696
|
* @internal
|
|
695
697
|
*/
|
|
696
698
|
export function createValidatePascal(): never {
|
|
697
|
-
|
|
699
|
+
NoTransformConfigurationError("notations.createValidatePascal");
|
|
698
700
|
}
|
|
699
701
|
|
|
700
702
|
/**
|
|
@@ -722,7 +724,7 @@ export function createSnake<T>(): (input: T) => SnakeCase<T>;
|
|
|
722
724
|
* @internal
|
|
723
725
|
*/
|
|
724
726
|
export function createSnake(): never {
|
|
725
|
-
|
|
727
|
+
NoTransformConfigurationError("notations.createSnake");
|
|
726
728
|
}
|
|
727
729
|
|
|
728
730
|
/**
|
|
@@ -756,7 +758,7 @@ export function createAssertSnake<T>(
|
|
|
756
758
|
* @internal
|
|
757
759
|
*/
|
|
758
760
|
export function createAssertSnake(): never {
|
|
759
|
-
|
|
761
|
+
NoTransformConfigurationError("notations.createAssertSnake");
|
|
760
762
|
}
|
|
761
763
|
|
|
762
764
|
/**
|
|
@@ -784,7 +786,7 @@ export function createIsSnake<T>(): (input: T) => SnakeCase<T> | null;
|
|
|
784
786
|
* @internal
|
|
785
787
|
*/
|
|
786
788
|
export function createIsSnake(): never {
|
|
787
|
-
|
|
789
|
+
NoTransformConfigurationError("notations.createIsSnake");
|
|
788
790
|
}
|
|
789
791
|
|
|
790
792
|
/**
|
|
@@ -814,14 +816,5 @@ export function createValidateSnake<T>(): (
|
|
|
814
816
|
* @internal
|
|
815
817
|
*/
|
|
816
818
|
export function createValidateSnake(): never {
|
|
817
|
-
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
/**
|
|
821
|
-
* @internal
|
|
822
|
-
*/
|
|
823
|
-
function halt(name: string): never {
|
|
824
|
-
throw new Error(
|
|
825
|
-
`Error on typia.notations.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`,
|
|
826
|
-
);
|
|
819
|
+
NoTransformConfigurationError("notations.createValidateSnake");
|
|
827
820
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { OpenApi } from "@samchon/openapi";
|
|
2
|
+
|
|
3
|
+
import { IJsonSchemaUnit } from "../../schemas/json/IJsonSchemaUnit";
|
|
4
|
+
import { Metadata } from "../../schemas/metadata/Metadata";
|
|
5
|
+
|
|
6
|
+
import { JsonSchemasProgrammer } from "./JsonSchemasProgrammer";
|
|
7
|
+
|
|
8
|
+
export namespace JsonSchemaProgrammer {
|
|
9
|
+
export const validate = (metadata: Metadata): string[] =>
|
|
10
|
+
JsonSchemasProgrammer.validate(metadata);
|
|
11
|
+
|
|
12
|
+
export const write = <Version extends "3.0" | "3.1">(props: {
|
|
13
|
+
version: Version;
|
|
14
|
+
metadata: Metadata;
|
|
15
|
+
}): IJsonSchemaUnit<Version> => {
|
|
16
|
+
const collection = JsonSchemasProgrammer.write({
|
|
17
|
+
version: props.version,
|
|
18
|
+
metadatas: [props.metadata],
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
version: collection.version as "3.1",
|
|
22
|
+
components: collection.components as OpenApi.IComponents,
|
|
23
|
+
schema: collection.schemas[0] as OpenApi.IJsonSchema,
|
|
24
|
+
} as IJsonSchemaUnit<Version>;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -81,7 +81,7 @@ export namespace JsonSchemasProgrammer {
|
|
|
81
81
|
const schema: OpenApi.IJsonSchema | null = generator(meta);
|
|
82
82
|
if (schema === null)
|
|
83
83
|
throw new TransformerError({
|
|
84
|
-
code: "typia.json.
|
|
84
|
+
code: "typia.json.schemas",
|
|
85
85
|
message: `invalid type on argument - (${meta.getName()}, ${i})`,
|
|
86
86
|
});
|
|
87
87
|
return schema;
|