sera-2 1.6.2__py3-none-any.whl → 1.6.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.
@@ -5,7 +5,6 @@ from typing import Any, Callable
|
|
5
5
|
from codegen.models import AST, PredefinedFn, Program, expr, stmt
|
6
6
|
from codegen.models.var import DeferredVar
|
7
7
|
from loguru import logger
|
8
|
-
|
9
8
|
from sera.misc import (
|
10
9
|
assert_isinstance,
|
11
10
|
assert_not_null,
|
@@ -723,9 +722,10 @@ def make_typescript_data_model(schema: Schema, target_pkg: Package):
|
|
723
722
|
prop_defs: list[tuple[expr.Expr, expr.Expr]] = []
|
724
723
|
|
725
724
|
for prop in cls.properties.values():
|
726
|
-
|
727
|
-
|
728
|
-
|
725
|
+
# we must include private properties that are needed during upsert for our forms.
|
726
|
+
# if prop.data.is_private:
|
727
|
+
# # skip private fields as this is for APIs exchange
|
728
|
+
# continue
|
729
729
|
propname = to_camel_case(prop.name)
|
730
730
|
tsprop = {}
|
731
731
|
|
@@ -821,11 +821,24 @@ def make_typescript_data_model(schema: Schema, target_pkg: Package):
|
|
821
821
|
)
|
822
822
|
|
823
823
|
program.import_("sera-db.Schema", True)
|
824
|
-
program.import_(
|
824
|
+
program.import_(
|
825
|
+
f"@.models.{pkg.dir.name}.Draft{cls.name}.Draft{cls.name}", True
|
826
|
+
)
|
825
827
|
program.root(
|
826
828
|
stmt.LineBreak(),
|
827
829
|
stmt.TypescriptStatement(
|
828
|
-
f"export
|
830
|
+
f"export type {cls.name}Properties = "
|
831
|
+
+ " | ".join(
|
832
|
+
[
|
833
|
+
expr.ExprConstant(to_camel_case(prop.name)).to_typescript()
|
834
|
+
for prop in cls.properties.values()
|
835
|
+
]
|
836
|
+
)
|
837
|
+
+ ";"
|
838
|
+
),
|
839
|
+
stmt.LineBreak(),
|
840
|
+
stmt.TypescriptStatement(
|
841
|
+
f"export const {cls.name}Schema: Schema<Draft{cls.name}, {cls.name}Properties> = "
|
829
842
|
+ PredefinedFn.dict(
|
830
843
|
[
|
831
844
|
(expr.ExprIdent("properties"), PredefinedFn.dict(prop_defs)),
|
@@ -10,7 +10,7 @@ sera/make/make_app.py,sha256=n9NtW73O3s_5Q31VHIRmnd-jEIcpDO7ksAsOdovde2s,5999
|
|
10
10
|
sera/make/make_python_api.py,sha256=RuJUm9z-4plBEtjobeOPr12o27OT-0tSeXI4ZlM3IY0,29433
|
11
11
|
sera/make/make_python_model.py,sha256=xf4revAwVWEnF6QhxbbqPyUGgXOOB--Gu3jPxsESg0Y,36593
|
12
12
|
sera/make/make_python_services.py,sha256=RsinYZdfkrTlTn9CT50VgqGs9w6IZawsJx-KEmqfnEY,2062
|
13
|
-
sera/make/make_typescript_model.py,sha256=
|
13
|
+
sera/make/make_typescript_model.py,sha256=rm_QUGSSmGeXAvFcTeJ4qeq1dFog2DERZ0Mo1r1Yak0,37553
|
14
14
|
sera/misc/__init__.py,sha256=Dh4uDq0D4N53h3zhvmwfa5a0TPVRSUvLzb0hkFuPirk,411
|
15
15
|
sera/misc/_formatter.py,sha256=aCGYL08l8f3aLODHxSocxBBwkRYEo3K1QzCDEn3suj0,1685
|
16
16
|
sera/misc/_utils.py,sha256=V5g4oLGHOhUCR75Kkcn1w01pAvGvaepK-T8Z3pIgHjI,1450
|
@@ -27,6 +27,6 @@ sera/models/_parse.py,sha256=sJYfQtwek96ltpgxExG4xUbiLnU3qvNYhTP1CeyXGjs,9746
|
|
27
27
|
sera/models/_property.py,sha256=CmEmgOShtSyNFq05YW3tGupwCIVRzPMKudXWld8utPk,5530
|
28
28
|
sera/models/_schema.py,sha256=r-Gqg9Lb_wR3UrbNvfXXgt_qs5bts0t2Ve7aquuF_OI,1155
|
29
29
|
sera/typing.py,sha256=Q4QMfbtfrCjC9tFfsZPhsAnbNX4lm4NHQ9lmjNXYdV0,772
|
30
|
-
sera_2-1.6.
|
31
|
-
sera_2-1.6.
|
32
|
-
sera_2-1.6.
|
30
|
+
sera_2-1.6.3.dist-info/METADATA,sha256=BBwuS2iLs2Ubc7WnJa6Q8sOR4Fz8aqXx9iTkLd3PO4M,856
|
31
|
+
sera_2-1.6.3.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
32
|
+
sera_2-1.6.3.dist-info/RECORD,,
|
File without changes
|