maleo-identity 0.1.20__tar.gz → 0.1.45__tar.gz
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.
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/PKG-INFO +10 -9
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/maleo_identity.egg-info/PKG-INFO +10 -9
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/maleo_identity.egg-info/SOURCES.txt +1 -2
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/maleo_identity.egg-info/requires.txt +9 -8
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/pyproject.toml +10 -9
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/constants/api_key.py +1 -1
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/constants/organization.py +1 -1
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/constants/organization_registration_code.py +1 -1
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/constants/organization_relation.py +1 -1
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/constants/patient.py +1 -1
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/constants/user.py +1 -1
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/constants/user_medical_role.py +1 -1
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/constants/user_organization_role.py +1 -1
- maleo_identity-0.1.45/src/constants/user_profile.py +26 -0
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/constants/user_system_role.py +2 -2
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/enums/api_key.py +1 -1
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/enums/organization.py +1 -1
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/enums/organization_registration_code.py +1 -1
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/enums/organization_relation.py +14 -1
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/enums/patient.py +1 -1
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/enums/user.py +16 -1
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/enums/user_medical_role.py +14 -1
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/enums/user_organization_role.py +14 -1
- maleo_identity-0.1.45/src/enums/user_profile.py +31 -0
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/enums/user_system_role.py +14 -1
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/mixins/api_key.py +24 -6
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/mixins/common.py +2 -2
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/mixins/organization.py +3 -3
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/mixins/organization_registration_code.py +40 -6
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/mixins/organization_relation.py +17 -9
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/mixins/patient.py +8 -8
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/mixins/user.py +9 -3
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/mixins/user_medical_role.py +16 -8
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/mixins/user_organization_role.py +16 -8
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/mixins/user_profile.py +22 -3
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/mixins/user_system_role.py +16 -8
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/schemas/api_key.py +25 -11
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/schemas/common.py +29 -51
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/schemas/organization.py +11 -11
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/schemas/organization_registration_code.py +13 -12
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/schemas/organization_relation.py +86 -26
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/schemas/patient.py +35 -15
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/schemas/user.py +53 -19
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/schemas/user_medical_role.py +59 -21
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/schemas/user_organization_role.py +61 -21
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/schemas/user_profile.py +50 -27
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/schemas/user_system_role.py +46 -21
- maleo_identity-0.1.45/src/types/api_key.py +8 -0
- maleo_identity-0.1.45/src/types/organization.py +4 -0
- maleo_identity-0.1.45/src/types/organization_registration_code.py +4 -0
- maleo_identity-0.1.45/src/types/organization_relation.py +7 -0
- maleo_identity-0.1.45/src/types/user.py +4 -0
- maleo_identity-0.1.45/src/types/user_medical_role.py +8 -0
- maleo_identity-0.1.45/src/types/user_organization_role.py +8 -0
- maleo_identity-0.1.45/src/types/user_profile.py +4 -0
- maleo_identity-0.1.45/src/types/user_system_role.py +8 -0
- maleo_identity-0.1.20/src/constants/user_profile.py +0 -11
- maleo_identity-0.1.20/src/enums/user_profile.py +0 -17
- maleo_identity-0.1.20/src/types/api_key.py +0 -7
- maleo_identity-0.1.20/src/types/organization.py +0 -4
- maleo_identity-0.1.20/src/types/organization_registration_code.py +0 -4
- maleo_identity-0.1.20/src/types/organization_relation.py +0 -7
- maleo_identity-0.1.20/src/types/user.py +0 -4
- maleo_identity-0.1.20/src/types/user_medical_role.py +0 -7
- maleo_identity-0.1.20/src/types/user_organization_role.py +0 -7
- maleo_identity-0.1.20/src/types/user_profile.py +0 -4
- maleo_identity-0.1.20/src/types/user_system_role.py +0 -7
- maleo_identity-0.1.20/src/utils/user.py +0 -32
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/LICENSE +0 -0
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/README.md +0 -0
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/maleo_identity.egg-info/dependency_links.txt +0 -0
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/maleo_identity.egg-info/top_level.txt +0 -0
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/setup.cfg +0 -0
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/__init__.py +0 -0
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/constants/__init__.py +0 -0
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/enums/__init__.py +0 -0
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/mixins/__init__.py +0 -0
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/schemas/__init__.py +0 -0
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/types/__init__.py +0 -0
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/types/patient.py +0 -0
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/utils/__init__.py +0 -0
- {maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/utils/organization.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maleo-identity
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.45
|
|
4
4
|
Summary: MaleoIdentity service package
|
|
5
5
|
Author-email: Agra Bima Yuda <agra@nexmedis.com>
|
|
6
6
|
License: Proprietary
|
|
@@ -41,14 +41,15 @@ Requires-Dist: identify>=2.6.15
|
|
|
41
41
|
Requires-Dist: idna>=3.11
|
|
42
42
|
Requires-Dist: importlib_metadata>=8.7.0
|
|
43
43
|
Requires-Dist: iniconfig>=2.1.0
|
|
44
|
-
Requires-Dist: maleo-
|
|
45
|
-
Requires-Dist: maleo-
|
|
46
|
-
Requires-Dist: maleo-logging>=0.0.50
|
|
47
|
-
Requires-Dist: maleo-metadata>=0.7.50
|
|
48
|
-
Requires-Dist: maleo-schemas>=0.7.50
|
|
49
|
-
Requires-Dist: maleo-types>=0.0.50
|
|
50
|
-
Requires-Dist: maleo-utils>=0.0.50
|
|
44
|
+
Requires-Dist: maleo-enums>=0.0.81
|
|
45
|
+
Requires-Dist: maleo-metadata>=0.7.75
|
|
51
46
|
Requires-Dist: mypy_extensions>=1.1.0
|
|
47
|
+
Requires-Dist: nexo-crypto>=0.0.4
|
|
48
|
+
Requires-Dist: nexo-enums>=0.0.4
|
|
49
|
+
Requires-Dist: nexo-logging>=0.0.4
|
|
50
|
+
Requires-Dist: nexo-schemas>=0.0.4
|
|
51
|
+
Requires-Dist: nexo-types>=0.0.4
|
|
52
|
+
Requires-Dist: nexo-utils>=0.0.4
|
|
52
53
|
Requires-Dist: nodeenv>=1.9.1
|
|
53
54
|
Requires-Dist: opentelemetry-api>=1.37.0
|
|
54
55
|
Requires-Dist: opentelemetry-sdk>=1.37.0
|
|
@@ -72,7 +73,7 @@ Requires-Dist: PyJWT>=2.10.1
|
|
|
72
73
|
Requires-Dist: pytest>=8.4.2
|
|
73
74
|
Requires-Dist: python-dotenv>=1.1.1
|
|
74
75
|
Requires-Dist: pytokens>=0.1.10
|
|
75
|
-
Requires-Dist: PyYAML>=6.0.
|
|
76
|
+
Requires-Dist: PyYAML>=6.0.2
|
|
76
77
|
Requires-Dist: requests>=2.32.5
|
|
77
78
|
Requires-Dist: rsa>=4.9.1
|
|
78
79
|
Requires-Dist: sniffio>=1.3.1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maleo-identity
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.45
|
|
4
4
|
Summary: MaleoIdentity service package
|
|
5
5
|
Author-email: Agra Bima Yuda <agra@nexmedis.com>
|
|
6
6
|
License: Proprietary
|
|
@@ -41,14 +41,15 @@ Requires-Dist: identify>=2.6.15
|
|
|
41
41
|
Requires-Dist: idna>=3.11
|
|
42
42
|
Requires-Dist: importlib_metadata>=8.7.0
|
|
43
43
|
Requires-Dist: iniconfig>=2.1.0
|
|
44
|
-
Requires-Dist: maleo-
|
|
45
|
-
Requires-Dist: maleo-
|
|
46
|
-
Requires-Dist: maleo-logging>=0.0.50
|
|
47
|
-
Requires-Dist: maleo-metadata>=0.7.50
|
|
48
|
-
Requires-Dist: maleo-schemas>=0.7.50
|
|
49
|
-
Requires-Dist: maleo-types>=0.0.50
|
|
50
|
-
Requires-Dist: maleo-utils>=0.0.50
|
|
44
|
+
Requires-Dist: maleo-enums>=0.0.81
|
|
45
|
+
Requires-Dist: maleo-metadata>=0.7.75
|
|
51
46
|
Requires-Dist: mypy_extensions>=1.1.0
|
|
47
|
+
Requires-Dist: nexo-crypto>=0.0.4
|
|
48
|
+
Requires-Dist: nexo-enums>=0.0.4
|
|
49
|
+
Requires-Dist: nexo-logging>=0.0.4
|
|
50
|
+
Requires-Dist: nexo-schemas>=0.0.4
|
|
51
|
+
Requires-Dist: nexo-types>=0.0.4
|
|
52
|
+
Requires-Dist: nexo-utils>=0.0.4
|
|
52
53
|
Requires-Dist: nodeenv>=1.9.1
|
|
53
54
|
Requires-Dist: opentelemetry-api>=1.37.0
|
|
54
55
|
Requires-Dist: opentelemetry-sdk>=1.37.0
|
|
@@ -72,7 +73,7 @@ Requires-Dist: PyJWT>=2.10.1
|
|
|
72
73
|
Requires-Dist: pytest>=8.4.2
|
|
73
74
|
Requires-Dist: python-dotenv>=1.1.1
|
|
74
75
|
Requires-Dist: pytokens>=0.1.10
|
|
75
|
-
Requires-Dist: PyYAML>=6.0.
|
|
76
|
+
Requires-Dist: PyYAML>=6.0.2
|
|
76
77
|
Requires-Dist: requests>=2.32.5
|
|
77
78
|
Requires-Dist: rsa>=4.9.1
|
|
78
79
|
Requires-Dist: sniffio>=1.3.1
|
|
@@ -32,14 +32,15 @@ identify>=2.6.15
|
|
|
32
32
|
idna>=3.11
|
|
33
33
|
importlib_metadata>=8.7.0
|
|
34
34
|
iniconfig>=2.1.0
|
|
35
|
-
maleo-
|
|
36
|
-
maleo-
|
|
37
|
-
maleo-logging>=0.0.50
|
|
38
|
-
maleo-metadata>=0.7.50
|
|
39
|
-
maleo-schemas>=0.7.50
|
|
40
|
-
maleo-types>=0.0.50
|
|
41
|
-
maleo-utils>=0.0.50
|
|
35
|
+
maleo-enums>=0.0.81
|
|
36
|
+
maleo-metadata>=0.7.75
|
|
42
37
|
mypy_extensions>=1.1.0
|
|
38
|
+
nexo-crypto>=0.0.4
|
|
39
|
+
nexo-enums>=0.0.4
|
|
40
|
+
nexo-logging>=0.0.4
|
|
41
|
+
nexo-schemas>=0.0.4
|
|
42
|
+
nexo-types>=0.0.4
|
|
43
|
+
nexo-utils>=0.0.4
|
|
43
44
|
nodeenv>=1.9.1
|
|
44
45
|
opentelemetry-api>=1.37.0
|
|
45
46
|
opentelemetry-sdk>=1.37.0
|
|
@@ -63,7 +64,7 @@ PyJWT>=2.10.1
|
|
|
63
64
|
pytest>=8.4.2
|
|
64
65
|
python-dotenv>=1.1.1
|
|
65
66
|
pytokens>=0.1.10
|
|
66
|
-
PyYAML>=6.0.
|
|
67
|
+
PyYAML>=6.0.2
|
|
67
68
|
requests>=2.32.5
|
|
68
69
|
rsa>=4.9.1
|
|
69
70
|
sniffio>=1.3.1
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "maleo-identity"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.45"
|
|
8
8
|
description = "MaleoIdentity service package"
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "Agra Bima Yuda", email = "agra@nexmedis.com" }
|
|
@@ -47,14 +47,15 @@ dependencies = [
|
|
|
47
47
|
"idna>=3.11",
|
|
48
48
|
"importlib_metadata>=8.7.0",
|
|
49
49
|
"iniconfig>=2.1.0",
|
|
50
|
-
"maleo-
|
|
51
|
-
"maleo-
|
|
52
|
-
"maleo-logging>=0.0.50",
|
|
53
|
-
"maleo-metadata>=0.7.50",
|
|
54
|
-
"maleo-schemas>=0.7.50",
|
|
55
|
-
"maleo-types>=0.0.50",
|
|
56
|
-
"maleo-utils>=0.0.50",
|
|
50
|
+
"maleo-enums>=0.0.81",
|
|
51
|
+
"maleo-metadata>=0.7.75",
|
|
57
52
|
"mypy_extensions>=1.1.0",
|
|
53
|
+
"nexo-crypto>=0.0.4",
|
|
54
|
+
"nexo-enums>=0.0.4",
|
|
55
|
+
"nexo-logging>=0.0.4",
|
|
56
|
+
"nexo-schemas>=0.0.4",
|
|
57
|
+
"nexo-types>=0.0.4",
|
|
58
|
+
"nexo-utils>=0.0.4",
|
|
58
59
|
"nodeenv>=1.9.1",
|
|
59
60
|
"opentelemetry-api>=1.37.0",
|
|
60
61
|
"opentelemetry-sdk>=1.37.0",
|
|
@@ -78,7 +79,7 @@ dependencies = [
|
|
|
78
79
|
"pytest>=8.4.2",
|
|
79
80
|
"python-dotenv>=1.1.1",
|
|
80
81
|
"pytokens>=0.1.10",
|
|
81
|
-
"PyYAML>=6.0.
|
|
82
|
+
"PyYAML>=6.0.2",
|
|
82
83
|
"requests>=2.32.5",
|
|
83
84
|
"rsa>=4.9.1",
|
|
84
85
|
"sniffio>=1.3.1",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from nexo.schemas.resource import Resource, ResourceIdentifier
|
|
2
|
+
from nexo.types.string import SeqOfStrs
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
USER_PROFILE_RESOURCE = Resource(
|
|
6
|
+
identifiers=[
|
|
7
|
+
ResourceIdentifier(
|
|
8
|
+
key="user_profile", name="User Profile", slug="user-profiles"
|
|
9
|
+
)
|
|
10
|
+
],
|
|
11
|
+
details=None,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
VALID_EXTENSIONS: SeqOfStrs = (
|
|
16
|
+
".jpeg",
|
|
17
|
+
".jpg",
|
|
18
|
+
".png",
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
VALID_MIME_TYPES: SeqOfStrs = (
|
|
23
|
+
"image/jpeg",
|
|
24
|
+
"image/jpg",
|
|
25
|
+
"image/png",
|
|
26
|
+
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from enum import StrEnum
|
|
2
|
-
from
|
|
2
|
+
from nexo.types.string import ListOfStrs, ManyStrs
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
class IdentifierType(StrEnum):
|
|
@@ -20,3 +20,16 @@ class IdentifierType(StrEnum):
|
|
|
20
20
|
elif self is IdentifierType.COMPOSITE:
|
|
21
21
|
return ("source_id", "target_id", "relation")
|
|
22
22
|
raise ValueError(f"Unknown column(s) for identifier type: {self}")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ExpandableField(StrEnum):
|
|
26
|
+
ORGANIZATION_TYPE = "organization_type"
|
|
27
|
+
|
|
28
|
+
@classmethod
|
|
29
|
+
def choices(cls) -> ListOfStrs:
|
|
30
|
+
return [e.value for e in cls]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
OptExpandableField = ExpandableField | None
|
|
34
|
+
ListOfExpandableFields = list[ExpandableField]
|
|
35
|
+
OptListOfExpandableFields = ListOfExpandableFields | None
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from enum import StrEnum
|
|
2
|
-
from
|
|
2
|
+
from nexo.types.string import ListOfStrs
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
class Granularity(StrEnum):
|
|
@@ -24,3 +24,18 @@ class IdentifierType(StrEnum):
|
|
|
24
24
|
@property
|
|
25
25
|
def column(self) -> str:
|
|
26
26
|
return self.value
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class ExpandableField(StrEnum):
|
|
30
|
+
USER_TYPE = "user_type"
|
|
31
|
+
BLOOD_TYPE = "blood_type"
|
|
32
|
+
GENDER = "gender"
|
|
33
|
+
|
|
34
|
+
@classmethod
|
|
35
|
+
def choices(cls) -> ListOfStrs:
|
|
36
|
+
return [e.value for e in cls]
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
OptExpandableField = ExpandableField | None
|
|
40
|
+
ListOfExpandableFields = list[ExpandableField]
|
|
41
|
+
OptListOfExpandableFields = ListOfExpandableFields | None
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from enum import StrEnum
|
|
2
|
-
from
|
|
2
|
+
from nexo.types.string import ListOfStrs, ManyStrs
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
class IdentifierType(StrEnum):
|
|
@@ -20,3 +20,16 @@ class IdentifierType(StrEnum):
|
|
|
20
20
|
elif self is IdentifierType.COMPOSITE:
|
|
21
21
|
return ("user_id", "organization_id", "medical_role")
|
|
22
22
|
raise ValueError(f"Unknown column(s) for identifier type: {self}")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ExpandableField(StrEnum):
|
|
26
|
+
MEDICAL_ROLE = "medical_role"
|
|
27
|
+
|
|
28
|
+
@classmethod
|
|
29
|
+
def choices(cls) -> ListOfStrs:
|
|
30
|
+
return [e.value for e in cls]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
OptExpandableField = ExpandableField | None
|
|
34
|
+
ListOfExpandableFields = list[ExpandableField]
|
|
35
|
+
OptListOfExpandableFields = ListOfExpandableFields | None
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from enum import StrEnum
|
|
2
|
-
from
|
|
2
|
+
from nexo.types.string import ListOfStrs, ManyStrs
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
class IdentifierType(StrEnum):
|
|
@@ -20,3 +20,16 @@ class IdentifierType(StrEnum):
|
|
|
20
20
|
elif self is IdentifierType.COMPOSITE:
|
|
21
21
|
return ("user_id", "organization_id", "organization_role")
|
|
22
22
|
raise ValueError(f"Unknown column(s) for identifier type: {self}")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ExpandableField(StrEnum):
|
|
26
|
+
ORGANIZATION_ROLE = "organization_role"
|
|
27
|
+
|
|
28
|
+
@classmethod
|
|
29
|
+
def choices(cls) -> ListOfStrs:
|
|
30
|
+
return [e.value for e in cls]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
OptExpandableField = ExpandableField | None
|
|
34
|
+
ListOfExpandableFields = list[ExpandableField]
|
|
35
|
+
OptListOfExpandableFields = ListOfExpandableFields | None
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from enum import StrEnum
|
|
2
|
+
from nexo.types.string import ListOfStrs
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class IdentifierType(StrEnum):
|
|
6
|
+
ID = "id"
|
|
7
|
+
UUID = "uuid"
|
|
8
|
+
USER_ID = "user_id"
|
|
9
|
+
ID_CARD = "id_card"
|
|
10
|
+
|
|
11
|
+
@classmethod
|
|
12
|
+
def choices(cls) -> ListOfStrs:
|
|
13
|
+
return [e.value for e in cls]
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def column(self) -> str:
|
|
17
|
+
return self.value
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class ExpandableField(StrEnum):
|
|
21
|
+
GENDER = "gender"
|
|
22
|
+
BLOOD_TYPE = "blood_type"
|
|
23
|
+
|
|
24
|
+
@classmethod
|
|
25
|
+
def choices(cls) -> ListOfStrs:
|
|
26
|
+
return [e.value for e in cls]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
OptExpandableField = ExpandableField | None
|
|
30
|
+
ListOfExpandableFields = list[ExpandableField]
|
|
31
|
+
OptListOfExpandableFields = ListOfExpandableFields | None
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from enum import StrEnum
|
|
2
|
-
from
|
|
2
|
+
from nexo.types.string import ListOfStrs, ManyStrs
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
class IdentifierType(StrEnum):
|
|
@@ -20,3 +20,16 @@ class IdentifierType(StrEnum):
|
|
|
20
20
|
elif self is IdentifierType.COMPOSITE:
|
|
21
21
|
return ("user_id", "system_role")
|
|
22
22
|
raise ValueError(f"Unknown column(s) for identifier type: {self}")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class ExpandableField(StrEnum):
|
|
26
|
+
SYSTEM_ROLE = "system_role"
|
|
27
|
+
|
|
28
|
+
@classmethod
|
|
29
|
+
def choices(cls) -> ListOfStrs:
|
|
30
|
+
return [e.value for e in cls]
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
OptExpandableField = ExpandableField | None
|
|
34
|
+
ListOfExpandableFields = list[ExpandableField]
|
|
35
|
+
OptListOfExpandableFields = ListOfExpandableFields | None
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
from pydantic import BaseModel, Field
|
|
2
2
|
from typing import Annotated, Literal, TypeGuard
|
|
3
3
|
from uuid import UUID
|
|
4
|
-
from
|
|
5
|
-
from
|
|
6
|
-
from
|
|
4
|
+
from nexo.schemas.mixins.identity import Identifier
|
|
5
|
+
from nexo.types.any import ManyAny
|
|
6
|
+
from nexo.types.string import ManyStrs
|
|
7
7
|
from ..enums.api_key import IdentifierType
|
|
8
|
-
from ..types.api_key import
|
|
8
|
+
from ..types.api_key import CompositeIdentifierType, IdentifierValueType
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class APIKey(BaseModel):
|
|
@@ -34,20 +34,30 @@ class UUIDAPIKeyIdentifier(Identifier[Literal[IdentifierType.UUID], UUID]):
|
|
|
34
34
|
] = IdentifierType.UUID
|
|
35
35
|
|
|
36
36
|
|
|
37
|
+
class APIKeyAPIKeyIdentifier(Identifier[Literal[IdentifierType.API_KEY], str]):
|
|
38
|
+
type: Annotated[
|
|
39
|
+
Literal[IdentifierType.API_KEY],
|
|
40
|
+
Field(IdentifierType.API_KEY, description="Identifier's type"),
|
|
41
|
+
] = IdentifierType.API_KEY
|
|
42
|
+
|
|
43
|
+
|
|
37
44
|
class CompositeAPIKeyIdentifier(
|
|
38
|
-
Identifier[Literal[IdentifierType.COMPOSITE],
|
|
45
|
+
Identifier[Literal[IdentifierType.COMPOSITE], CompositeIdentifierType]
|
|
39
46
|
):
|
|
40
47
|
type: Annotated[
|
|
41
48
|
Literal[IdentifierType.COMPOSITE],
|
|
42
49
|
Field(IdentifierType.COMPOSITE, description="Identifier's type"),
|
|
43
50
|
] = IdentifierType.COMPOSITE
|
|
44
|
-
value: Annotated[
|
|
51
|
+
value: Annotated[
|
|
52
|
+
CompositeIdentifierType, Field(..., description="Identifier's value")
|
|
53
|
+
]
|
|
45
54
|
|
|
46
55
|
|
|
47
56
|
AnyAPIKeyIdentifier = (
|
|
48
57
|
APIKeyIdentifier
|
|
49
58
|
| IdAPIKeyIdentifier
|
|
50
59
|
| UUIDAPIKeyIdentifier
|
|
60
|
+
| APIKeyAPIKeyIdentifier
|
|
51
61
|
| CompositeAPIKeyIdentifier
|
|
52
62
|
)
|
|
53
63
|
|
|
@@ -58,6 +68,14 @@ def is_id_identifier(
|
|
|
58
68
|
return identifier.type is IdentifierType.ID and isinstance(identifier.value, int)
|
|
59
69
|
|
|
60
70
|
|
|
71
|
+
def is_api_key_identifier(
|
|
72
|
+
identifier: AnyAPIKeyIdentifier,
|
|
73
|
+
) -> TypeGuard[APIKeyAPIKeyIdentifier]:
|
|
74
|
+
return identifier.type is IdentifierType.API_KEY and isinstance(
|
|
75
|
+
identifier.value, str
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
|
|
61
79
|
def is_uuid_identifier(
|
|
62
80
|
identifier: AnyAPIKeyIdentifier,
|
|
63
81
|
) -> TypeGuard[UUIDAPIKeyIdentifier]:
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
from pydantic import Field
|
|
2
2
|
from typing import Annotated, Generic
|
|
3
|
-
from
|
|
3
|
+
from nexo.schemas.mixins.identity import (
|
|
4
4
|
IdCard as BaseIdCard,
|
|
5
5
|
FullName as BaseFullName,
|
|
6
6
|
BirthPlace as BaseBirthPlace,
|
|
7
7
|
PlaceOfBirth as BasePlaceOfBirth,
|
|
8
8
|
)
|
|
9
|
-
from
|
|
9
|
+
from nexo.types.string import OptStrT
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class IdCard(BaseIdCard[OptStrT], Generic[OptStrT]):
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
from pydantic import BaseModel, Field
|
|
2
2
|
from typing import Annotated, Generic, Literal, TypeGuard
|
|
3
3
|
from uuid import UUID
|
|
4
|
-
from
|
|
5
|
-
from
|
|
6
|
-
from
|
|
4
|
+
from nexo.schemas.mixins.identity import Identifier, Key as BaseKey, Name as BaseName
|
|
5
|
+
from nexo.types.string import OptStrT
|
|
6
|
+
from nexo.types.uuid import OptUUIDT
|
|
7
7
|
from ..enums.organization import IdentifierType
|
|
8
8
|
from ..types.organization import IdentifierValueType
|
|
9
9
|
|
{maleo_identity-0.1.20 → maleo_identity-0.1.45}/src/mixins/organization_registration_code.py
RENAMED
|
@@ -1,15 +1,49 @@
|
|
|
1
|
-
from pydantic import BaseModel, Field
|
|
2
|
-
from typing import Annotated, Generic, Literal, TypeGuard
|
|
1
|
+
from pydantic import BaseModel, Field, model_validator
|
|
2
|
+
from typing import Annotated, Generic, Literal, Self, TypeGuard
|
|
3
3
|
from uuid import UUID
|
|
4
|
-
from
|
|
5
|
-
from
|
|
6
|
-
from
|
|
4
|
+
from nexo.schemas.mixins.identity import Identifier
|
|
5
|
+
from nexo.types.integer import OptIntT
|
|
6
|
+
from nexo.types.misc import OptIntOrStr
|
|
7
|
+
from nexo.types.string import OptStrT
|
|
7
8
|
from ..enums.organization_registration_code import IdentifierType
|
|
8
9
|
from ..types.organization_registration_code import IdentifierValueType
|
|
9
10
|
|
|
10
11
|
|
|
12
|
+
class CodeOrLength(BaseModel):
|
|
13
|
+
code_or_length: Annotated[
|
|
14
|
+
OptIntOrStr,
|
|
15
|
+
Field(
|
|
16
|
+
None,
|
|
17
|
+
description=(
|
|
18
|
+
"Code (str) or length (int). "
|
|
19
|
+
"If code is given, the length must be between 6 and 36 inclusive. "
|
|
20
|
+
"If length is given, the value must be between 6 and 36 inclusive. "
|
|
21
|
+
"Will generate random 6 char string if omitted"
|
|
22
|
+
),
|
|
23
|
+
),
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
@model_validator(mode="after")
|
|
27
|
+
def validate_code_or_length(self) -> Self:
|
|
28
|
+
code_or_length = self.code_or_length
|
|
29
|
+
if code_or_length is None:
|
|
30
|
+
return self
|
|
31
|
+
print(code_or_length)
|
|
32
|
+
if isinstance(code_or_length, int):
|
|
33
|
+
length = code_or_length
|
|
34
|
+
elif isinstance(code_or_length, str):
|
|
35
|
+
length = len(code_or_length)
|
|
36
|
+
else:
|
|
37
|
+
raise ValueError("Code or Length must be either int or str")
|
|
38
|
+
if length < 6 or length > 36:
|
|
39
|
+
raise ValueError("Code or Length must be between 6 and 36 inclusive")
|
|
40
|
+
return self
|
|
41
|
+
|
|
42
|
+
|
|
11
43
|
class Code(BaseModel, Generic[OptStrT]):
|
|
12
|
-
code: Annotated[
|
|
44
|
+
code: Annotated[
|
|
45
|
+
OptStrT, Field(..., description="Code", min_length=6, max_length=36)
|
|
46
|
+
]
|
|
13
47
|
|
|
14
48
|
|
|
15
49
|
class MaxUses(BaseModel, Generic[OptIntT]):
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
from pydantic import BaseModel, Field
|
|
2
2
|
from typing import Annotated, Generic, Literal, TypeGuard
|
|
3
3
|
from uuid import UUID
|
|
4
|
-
from
|
|
5
|
-
from
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from ..enums.organization_relation import IdentifierType
|
|
10
|
-
from ..types.organization_relation import
|
|
4
|
+
from nexo.schemas.mixins.identity import Identifier
|
|
5
|
+
from nexo.types.any import ManyAny
|
|
6
|
+
from nexo.types.boolean import OptBoolT
|
|
7
|
+
from nexo.types.misc import OptListOfAnyOrStrToAnyDict
|
|
8
|
+
from nexo.types.string import ManyStrs
|
|
9
|
+
from ..enums.organization_relation import IdentifierType, OptListOfExpandableFields
|
|
10
|
+
from ..types.organization_relation import CompositeIdentifierType, IdentifierValueType
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class IsBidirectional(BaseModel, Generic[OptBoolT]):
|
|
@@ -18,6 +18,12 @@ class Meta(BaseModel):
|
|
|
18
18
|
meta: Annotated[OptListOfAnyOrStrToAnyDict, Field(None, description="Meta")] = None
|
|
19
19
|
|
|
20
20
|
|
|
21
|
+
class Expand(BaseModel):
|
|
22
|
+
expand: Annotated[
|
|
23
|
+
OptListOfExpandableFields, Field(None, description="Expanded field(s)")
|
|
24
|
+
] = None
|
|
25
|
+
|
|
26
|
+
|
|
21
27
|
class OrganizationRelationIdentifier(Identifier[IdentifierType, IdentifierValueType]):
|
|
22
28
|
@property
|
|
23
29
|
def columns_and_values(self) -> tuple[ManyStrs, ManyAny]:
|
|
@@ -43,13 +49,15 @@ class UUIDOrganizationRelationIdentifier(
|
|
|
43
49
|
|
|
44
50
|
|
|
45
51
|
class CompositeOrganizationRelationIdentifier(
|
|
46
|
-
Identifier[Literal[IdentifierType.COMPOSITE],
|
|
52
|
+
Identifier[Literal[IdentifierType.COMPOSITE], CompositeIdentifierType]
|
|
47
53
|
):
|
|
48
54
|
type: Annotated[
|
|
49
55
|
Literal[IdentifierType.COMPOSITE],
|
|
50
56
|
Field(IdentifierType.COMPOSITE, description="Identifier's type"),
|
|
51
57
|
] = IdentifierType.COMPOSITE
|
|
52
|
-
value: Annotated[
|
|
58
|
+
value: Annotated[
|
|
59
|
+
CompositeIdentifierType, Field(..., description="Identifier's value")
|
|
60
|
+
]
|
|
53
61
|
|
|
54
62
|
|
|
55
63
|
AnyOrganizationRelationIdentifier = (
|