sera-2 1.7.2__py3-none-any.whl → 1.7.3__py3-none-any.whl
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.
@@ -506,6 +506,26 @@ def make_typescript_data_model(schema: Schema, target_pkg: Package):
|
|
506
506
|
)
|
507
507
|
)
|
508
508
|
|
509
|
+
# TODO: fix me!
|
510
|
+
prop_validators.append(
|
511
|
+
(
|
512
|
+
expr.ExprIdent(propname),
|
513
|
+
expr.ExprFuncCall(
|
514
|
+
expr.ExprIdent("getValidator"),
|
515
|
+
[
|
516
|
+
PredefinedFn.list(
|
517
|
+
[
|
518
|
+
expr.ExprConstant(
|
519
|
+
constraint.get_typescript_constraint()
|
520
|
+
)
|
521
|
+
for constraint in prop.data.constraints
|
522
|
+
]
|
523
|
+
),
|
524
|
+
],
|
525
|
+
),
|
526
|
+
)
|
527
|
+
)
|
528
|
+
|
509
529
|
prop_defs.append(stmt.DefClassVarStatement(propname, tstype.type))
|
510
530
|
prop_constructor_assigns.append(
|
511
531
|
stmt.AssignStatement(
|
@@ -570,10 +590,6 @@ def make_typescript_data_model(schema: Schema, target_pkg: Package):
|
|
570
590
|
lambda ast10: ast10.class_(draft_clsname)(
|
571
591
|
*prop_defs,
|
572
592
|
stmt.LineBreak(),
|
573
|
-
stmt.DefClassVarStatement(
|
574
|
-
"validators", type=None, value=validators, is_static=True
|
575
|
-
),
|
576
|
-
stmt.LineBreak(),
|
577
593
|
lambda ast10: ast10.func(
|
578
594
|
"constructor",
|
579
595
|
[
|
@@ -658,6 +674,12 @@ def make_typescript_data_model(schema: Schema, target_pkg: Package):
|
|
658
674
|
),
|
659
675
|
),
|
660
676
|
),
|
677
|
+
stmt.LineBreak(),
|
678
|
+
stmt.TypescriptStatement(
|
679
|
+
f"export const draft{cls.name}Validators = "
|
680
|
+
+ validators.to_typescript()
|
681
|
+
+ ";"
|
682
|
+
),
|
661
683
|
)
|
662
684
|
|
663
685
|
pkg.module("Draft" + cls.name).write(program)
|
@@ -904,6 +926,9 @@ def make_typescript_data_model(schema: Schema, target_pkg: Package):
|
|
904
926
|
program.import_(
|
905
927
|
f"@.models.{pkg.dir.name}.Draft{cls.name}.Draft{cls.name}", True
|
906
928
|
)
|
929
|
+
program.import_(
|
930
|
+
f"@.models.{pkg.dir.name}.Draft{cls.name}.draft{cls.name}Validators", True
|
931
|
+
)
|
907
932
|
program.root(
|
908
933
|
stmt.LineBreak(),
|
909
934
|
stmt.TypescriptStatement(
|
@@ -995,6 +1020,10 @@ def make_typescript_data_model(schema: Schema, target_pkg: Package):
|
|
995
1020
|
+ "}"
|
996
1021
|
),
|
997
1022
|
),
|
1023
|
+
(
|
1024
|
+
expr.ExprIdent("validators"),
|
1025
|
+
expr.ExprIdent(f"draft{cls.name}Validators"),
|
1026
|
+
),
|
998
1027
|
]
|
999
1028
|
+ (
|
1000
1029
|
[
|
@@ -12,7 +12,7 @@ sera/make/make_app.py,sha256=n9NtW73O3s_5Q31VHIRmnd-jEIcpDO7ksAsOdovde2s,5999
|
|
12
12
|
sera/make/make_python_api.py,sha256=RuJUm9z-4plBEtjobeOPr12o27OT-0tSeXI4ZlM3IY0,29433
|
13
13
|
sera/make/make_python_model.py,sha256=xf4revAwVWEnF6QhxbbqPyUGgXOOB--Gu3jPxsESg0Y,36593
|
14
14
|
sera/make/make_python_services.py,sha256=RsinYZdfkrTlTn9CT50VgqGs9w6IZawsJx-KEmqfnEY,2062
|
15
|
-
sera/make/make_typescript_model.py,sha256=
|
15
|
+
sera/make/make_typescript_model.py,sha256=E7HT3cmPnhw2HUdtWLOc3pz4EpvHW9EaMjHS_s1gvL4,48011
|
16
16
|
sera/misc/__init__.py,sha256=Dh4uDq0D4N53h3zhvmwfa5a0TPVRSUvLzb0hkFuPirk,411
|
17
17
|
sera/misc/_formatter.py,sha256=aCGYL08l8f3aLODHxSocxBBwkRYEo3K1QzCDEn3suj0,1685
|
18
18
|
sera/misc/_utils.py,sha256=V5g4oLGHOhUCR75Kkcn1w01pAvGvaepK-T8Z3pIgHjI,1450
|
@@ -29,6 +29,6 @@ sera/models/_parse.py,sha256=sJYfQtwek96ltpgxExG4xUbiLnU3qvNYhTP1CeyXGjs,9746
|
|
29
29
|
sera/models/_property.py,sha256=CmEmgOShtSyNFq05YW3tGupwCIVRzPMKudXWld8utPk,5530
|
30
30
|
sera/models/_schema.py,sha256=r-Gqg9Lb_wR3UrbNvfXXgt_qs5bts0t2Ve7aquuF_OI,1155
|
31
31
|
sera/typing.py,sha256=Q4QMfbtfrCjC9tFfsZPhsAnbNX4lm4NHQ9lmjNXYdV0,772
|
32
|
-
sera_2-1.7.
|
33
|
-
sera_2-1.7.
|
34
|
-
sera_2-1.7.
|
32
|
+
sera_2-1.7.3.dist-info/METADATA,sha256=5HVujlhHjtBZxvO3R-6jbu2uYCjybYB9kAknXeSx4AY,856
|
33
|
+
sera_2-1.7.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
34
|
+
sera_2-1.7.3.dist-info/RECORD,,
|
File without changes
|