maleo-identity 0.1.37__tar.gz → 0.1.60__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.
Files changed (83) hide show
  1. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/PKG-INFO +10 -9
  2. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/maleo_identity.egg-info/PKG-INFO +10 -9
  3. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/maleo_identity.egg-info/SOURCES.txt +6 -4
  4. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/maleo_identity.egg-info/requires.txt +9 -8
  5. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/pyproject.toml +11 -13
  6. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/constants/api_key.py +1 -1
  7. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/constants/organization.py +1 -1
  8. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/constants/organization_registration_code.py +1 -1
  9. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/constants/organization_relation.py +1 -1
  10. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/constants/patient.py +1 -1
  11. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/constants/user.py +1 -1
  12. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/constants/user_medical_role.py +1 -1
  13. maleo_identity-0.1.60/src/constants/user_organization.py +13 -0
  14. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/constants/user_organization_role.py +1 -1
  15. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/constants/user_profile.py +2 -2
  16. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/constants/user_system_role.py +2 -2
  17. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/enums/api_key.py +1 -1
  18. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/enums/organization.py +14 -10
  19. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/enums/organization_registration_code.py +1 -1
  20. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/enums/organization_relation.py +1 -1
  21. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/enums/patient.py +1 -1
  22. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/enums/user.py +16 -1
  23. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/enums/user_medical_role.py +14 -1
  24. maleo_identity-0.1.60/src/enums/user_organization.py +40 -0
  25. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/enums/user_organization_role.py +14 -1
  26. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/enums/user_profile.py +1 -1
  27. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/enums/user_system_role.py +1 -1
  28. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/mixins/api_key.py +19 -3
  29. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/mixins/common.py +2 -2
  30. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/mixins/organization.py +10 -4
  31. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/mixins/organization_registration_code.py +4 -4
  32. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/mixins/organization_relation.py +5 -5
  33. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/mixins/patient.py +2 -2
  34. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/mixins/user.py +9 -3
  35. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/mixins/user_medical_role.py +11 -5
  36. maleo_identity-0.1.60/src/mixins/user_organization.py +76 -0
  37. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/mixins/user_organization_role.py +11 -5
  38. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/mixins/user_profile.py +2 -2
  39. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/mixins/user_system_role.py +3 -3
  40. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/schemas/api_key.py +22 -8
  41. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/schemas/common.py +20 -83
  42. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/schemas/organization.py +59 -25
  43. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/schemas/organization_registration_code.py +11 -11
  44. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/schemas/organization_relation.py +14 -14
  45. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/schemas/patient.py +12 -12
  46. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/schemas/user.py +110 -22
  47. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/schemas/user_medical_role.py +66 -16
  48. maleo_identity-0.1.60/src/schemas/user_organization.py +334 -0
  49. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/schemas/user_organization_role.py +68 -16
  50. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/schemas/user_profile.py +12 -12
  51. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/schemas/user_system_role.py +10 -10
  52. maleo_identity-0.1.60/src/types/api_key.py +8 -0
  53. maleo_identity-0.1.60/src/types/organization.py +4 -0
  54. maleo_identity-0.1.60/src/types/organization_registration_code.py +4 -0
  55. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/types/organization_relation.py +1 -1
  56. maleo_identity-0.1.60/src/types/user.py +4 -0
  57. maleo_identity-0.1.60/src/types/user_medical_role.py +8 -0
  58. maleo_identity-0.1.60/src/types/user_organization.py +7 -0
  59. maleo_identity-0.1.60/src/types/user_organization_role.py +8 -0
  60. maleo_identity-0.1.60/src/types/user_profile.py +4 -0
  61. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/types/user_system_role.py +1 -1
  62. maleo_identity-0.1.37/src/types/api_key.py +0 -7
  63. maleo_identity-0.1.37/src/types/organization.py +0 -4
  64. maleo_identity-0.1.37/src/types/organization_registration_code.py +0 -4
  65. maleo_identity-0.1.37/src/types/user.py +0 -4
  66. maleo_identity-0.1.37/src/types/user_medical_role.py +0 -7
  67. maleo_identity-0.1.37/src/types/user_organization_role.py +0 -7
  68. maleo_identity-0.1.37/src/types/user_profile.py +0 -4
  69. maleo_identity-0.1.37/src/utils/__init__.py +0 -0
  70. maleo_identity-0.1.37/src/utils/organization.py +0 -32
  71. maleo_identity-0.1.37/src/utils/user.py +0 -32
  72. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/LICENSE +0 -0
  73. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/README.md +0 -0
  74. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/maleo_identity.egg-info/dependency_links.txt +0 -0
  75. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/maleo_identity.egg-info/top_level.txt +0 -0
  76. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/setup.cfg +0 -0
  77. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/__init__.py +0 -0
  78. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/constants/__init__.py +0 -0
  79. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/enums/__init__.py +0 -0
  80. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/mixins/__init__.py +0 -0
  81. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/schemas/__init__.py +0 -0
  82. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/types/__init__.py +0 -0
  83. {maleo_identity-0.1.37 → maleo_identity-0.1.60}/src/types/patient.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo-identity
3
- Version: 0.1.37
3
+ Version: 0.1.60
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-crypto>=0.0.50
45
- Requires-Dist: maleo-enums>=0.0.50
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.85
45
+ Requires-Dist: maleo-metadata>=0.7.89
51
46
  Requires-Dist: mypy_extensions>=1.1.0
47
+ Requires-Dist: nexo-crypto>=0.0.5
48
+ Requires-Dist: nexo-enums>=0.0.5
49
+ Requires-Dist: nexo-logging>=0.0.5
50
+ Requires-Dist: nexo-schemas>=0.0.9
51
+ Requires-Dist: nexo-types>=0.0.5
52
+ Requires-Dist: nexo-utils>=0.0.5
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.3
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.37
3
+ Version: 0.1.60
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-crypto>=0.0.50
45
- Requires-Dist: maleo-enums>=0.0.50
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.85
45
+ Requires-Dist: maleo-metadata>=0.7.89
51
46
  Requires-Dist: mypy_extensions>=1.1.0
47
+ Requires-Dist: nexo-crypto>=0.0.5
48
+ Requires-Dist: nexo-enums>=0.0.5
49
+ Requires-Dist: nexo-logging>=0.0.5
50
+ Requires-Dist: nexo-schemas>=0.0.9
51
+ Requires-Dist: nexo-types>=0.0.5
52
+ Requires-Dist: nexo-utils>=0.0.5
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.3
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
@@ -15,6 +15,7 @@ src/constants/organization_relation.py
15
15
  src/constants/patient.py
16
16
  src/constants/user.py
17
17
  src/constants/user_medical_role.py
18
+ src/constants/user_organization.py
18
19
  src/constants/user_organization_role.py
19
20
  src/constants/user_profile.py
20
21
  src/constants/user_system_role.py
@@ -26,6 +27,7 @@ src/enums/organization_relation.py
26
27
  src/enums/patient.py
27
28
  src/enums/user.py
28
29
  src/enums/user_medical_role.py
30
+ src/enums/user_organization.py
29
31
  src/enums/user_organization_role.py
30
32
  src/enums/user_profile.py
31
33
  src/enums/user_system_role.py
@@ -38,6 +40,7 @@ src/mixins/organization_relation.py
38
40
  src/mixins/patient.py
39
41
  src/mixins/user.py
40
42
  src/mixins/user_medical_role.py
43
+ src/mixins/user_organization.py
41
44
  src/mixins/user_organization_role.py
42
45
  src/mixins/user_profile.py
43
46
  src/mixins/user_system_role.py
@@ -50,6 +53,7 @@ src/schemas/organization_relation.py
50
53
  src/schemas/patient.py
51
54
  src/schemas/user.py
52
55
  src/schemas/user_medical_role.py
56
+ src/schemas/user_organization.py
53
57
  src/schemas/user_organization_role.py
54
58
  src/schemas/user_profile.py
55
59
  src/schemas/user_system_role.py
@@ -61,9 +65,7 @@ src/types/organization_relation.py
61
65
  src/types/patient.py
62
66
  src/types/user.py
63
67
  src/types/user_medical_role.py
68
+ src/types/user_organization.py
64
69
  src/types/user_organization_role.py
65
70
  src/types/user_profile.py
66
- src/types/user_system_role.py
67
- src/utils/__init__.py
68
- src/utils/organization.py
69
- src/utils/user.py
71
+ src/types/user_system_role.py
@@ -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-crypto>=0.0.50
36
- maleo-enums>=0.0.50
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.85
36
+ maleo-metadata>=0.7.89
42
37
  mypy_extensions>=1.1.0
38
+ nexo-crypto>=0.0.5
39
+ nexo-enums>=0.0.5
40
+ nexo-logging>=0.0.5
41
+ nexo-schemas>=0.0.9
42
+ nexo-types>=0.0.5
43
+ nexo-utils>=0.0.5
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.3
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.37"
7
+ version = "0.1.60"
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-crypto>=0.0.50",
51
- "maleo-enums>=0.0.50",
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.85",
51
+ "maleo-metadata>=0.7.89",
57
52
  "mypy_extensions>=1.1.0",
53
+ "nexo-crypto>=0.0.5",
54
+ "nexo-enums>=0.0.5",
55
+ "nexo-logging>=0.0.5",
56
+ "nexo-schemas>=0.0.9",
57
+ "nexo-types>=0.0.5",
58
+ "nexo-utils>=0.0.5",
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.3",
82
+ "PyYAML>=6.0.2",
82
83
  "requests>=2.32.5",
83
84
  "rsa>=4.9.1",
84
85
  "sniffio>=1.3.1",
@@ -102,7 +103,6 @@ packages = [
102
103
  "maleo.identity.mixins",
103
104
  "maleo.identity.schemas",
104
105
  "maleo.identity.types",
105
- "maleo.identity.utils",
106
106
  ]
107
107
 
108
108
  [tool.setuptools.package-data]
@@ -112,7 +112,6 @@ packages = [
112
112
  "maleo.identity.mixins" = ["*.json", "*.yaml"]
113
113
  "maleo.identity.schemas" = ["*.json", "*.yaml"]
114
114
  "maleo.identity.types" = ["*.json", "*.yaml"]
115
- "maleo.identity.utils" = ["*.json", "*.yaml"]
116
115
 
117
116
  [tool.setuptools.package-dir]
118
117
  "maleo.identity" = "src"
@@ -120,5 +119,4 @@ packages = [
120
119
  "maleo.identity.enums" = "src/enums"
121
120
  "maleo.identity.mixins" = "src/mixins"
122
121
  "maleo.identity.schemas" = "src/schemas"
123
- "maleo.identity.types" = "src/types"
124
- "maleo.identity.utils" = "src/utils"
122
+ "maleo.identity.types" = "src/types"
@@ -1,4 +1,4 @@
1
- from maleo.schemas.resource import Resource, ResourceIdentifier
1
+ from nexo.schemas.resource import Resource, ResourceIdentifier
2
2
 
3
3
 
4
4
  API_KEY_RESOURCE = Resource(
@@ -1,4 +1,4 @@
1
- from maleo.schemas.resource import Resource, ResourceIdentifier
1
+ from nexo.schemas.resource import Resource, ResourceIdentifier
2
2
 
3
3
 
4
4
  ORGANIZATION_RESOURCE = Resource(
@@ -1,4 +1,4 @@
1
- from maleo.schemas.resource import Resource, ResourceIdentifier
1
+ from nexo.schemas.resource import Resource, ResourceIdentifier
2
2
 
3
3
 
4
4
  ORGANIZATION_REGISTRATION_CODE_RESOURCE = Resource(
@@ -1,4 +1,4 @@
1
- from maleo.schemas.resource import Resource, ResourceIdentifier
1
+ from nexo.schemas.resource import Resource, ResourceIdentifier
2
2
 
3
3
 
4
4
  ORGANIZATION_RELATION_RESOURCE = Resource(
@@ -1,4 +1,4 @@
1
- from maleo.schemas.resource import Resource, ResourceIdentifier
1
+ from nexo.schemas.resource import Resource, ResourceIdentifier
2
2
 
3
3
 
4
4
  PATIENT_RESOURCE = Resource(
@@ -1,4 +1,4 @@
1
- from maleo.schemas.resource import Resource, ResourceIdentifier
1
+ from nexo.schemas.resource import Resource, ResourceIdentifier
2
2
 
3
3
 
4
4
  USER_RESOURCE = Resource(
@@ -1,4 +1,4 @@
1
- from maleo.schemas.resource import Resource, ResourceIdentifier
1
+ from nexo.schemas.resource import Resource, ResourceIdentifier
2
2
 
3
3
 
4
4
  USER_MEDICAL_ROLE_RESOURCE = Resource(
@@ -0,0 +1,13 @@
1
+ from nexo.schemas.resource import Resource, ResourceIdentifier
2
+
3
+
4
+ USER_ORGANIZATION_RESOURCE = Resource(
5
+ identifiers=[
6
+ ResourceIdentifier(
7
+ key="user_organization",
8
+ name="User Organization",
9
+ slug="user-organizations",
10
+ )
11
+ ],
12
+ details=None,
13
+ )
@@ -1,4 +1,4 @@
1
- from maleo.schemas.resource import Resource, ResourceIdentifier
1
+ from nexo.schemas.resource import Resource, ResourceIdentifier
2
2
 
3
3
 
4
4
  USER_ORGANIZATION_ROLE_RESOURCE = Resource(
@@ -1,5 +1,5 @@
1
- from maleo.schemas.resource import Resource, ResourceIdentifier
2
- from maleo.types.string import SeqOfStrs
1
+ from nexo.schemas.resource import Resource, ResourceIdentifier
2
+ from nexo.types.string import SeqOfStrs
3
3
 
4
4
 
5
5
  USER_PROFILE_RESOURCE = Resource(
@@ -1,5 +1,5 @@
1
- from maleo.schemas.resource import Resource, ResourceIdentifier
2
- from maleo.types.string import DoubleStrs
1
+ from nexo.schemas.resource import Resource, ResourceIdentifier
2
+ from nexo.types.string import DoubleStrs
3
3
 
4
4
 
5
5
  USER_SYSTEM_ROLE_RESOURCE = Resource(
@@ -1,5 +1,5 @@
1
1
  from enum import StrEnum
2
- from maleo.types.string import ListOfStrs, ManyStrs
2
+ from nexo.types.string import ListOfStrs, ManyStrs
3
3
 
4
4
 
5
5
  class IdentifierType(StrEnum):
@@ -1,14 +1,5 @@
1
1
  from enum import StrEnum
2
- from maleo.types.string import ListOfStrs
3
-
4
-
5
- class Granularity(StrEnum):
6
- STANDARD = "standard"
7
- FULL = "full"
8
-
9
- @classmethod
10
- def choices(cls) -> ListOfStrs:
11
- return [e.value for e in cls]
2
+ from nexo.types.string import ListOfStrs
12
3
 
13
4
 
14
5
  class IdentifierType(StrEnum):
@@ -23,3 +14,16 @@ class IdentifierType(StrEnum):
23
14
  @property
24
15
  def column(self) -> str:
25
16
  return self.value
17
+
18
+
19
+ class ExpandableField(StrEnum):
20
+ ORGANIZATION_TYPE = "organization_type"
21
+
22
+ @classmethod
23
+ def choices(cls) -> ListOfStrs:
24
+ return [e.value for e in cls]
25
+
26
+
27
+ OptExpandableField = ExpandableField | None
28
+ ListOfExpandableFields = list[ExpandableField]
29
+ OptListOfExpandableFields = ListOfExpandableFields | None
@@ -1,5 +1,5 @@
1
1
  from enum import StrEnum
2
- from maleo.types.string import ListOfStrs
2
+ from nexo.types.string import ListOfStrs
3
3
 
4
4
 
5
5
  class IdentifierType(StrEnum):
@@ -1,5 +1,5 @@
1
1
  from enum import StrEnum
2
- from maleo.types.string import ListOfStrs, ManyStrs
2
+ from nexo.types.string import ListOfStrs, ManyStrs
3
3
 
4
4
 
5
5
  class IdentifierType(StrEnum):
@@ -1,5 +1,5 @@
1
1
  from enum import StrEnum
2
- from maleo.types.string import ListOfStrs
2
+ from nexo.types.string import ListOfStrs
3
3
 
4
4
 
5
5
  class IdentifierType(StrEnum):
@@ -1,5 +1,5 @@
1
1
  from enum import StrEnum
2
- from maleo.types.string import ListOfStrs
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 maleo.types.string import ListOfStrs, ManyStrs
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
@@ -0,0 +1,40 @@
1
+ from enum import StrEnum
2
+ from nexo.types.string import ListOfStrs, ManyStrs
3
+
4
+
5
+ class IdentifierType(StrEnum):
6
+ ID = "id"
7
+ UUID = "uuid"
8
+ COMPOSITE = "composite"
9
+
10
+ @classmethod
11
+ def choices(cls) -> ListOfStrs:
12
+ return [e.value for e in cls]
13
+
14
+ @property
15
+ def columns(self) -> ManyStrs:
16
+ if self is IdentifierType.ID:
17
+ return ("id",)
18
+ elif self is IdentifierType.UUID:
19
+ return ("uuid",)
20
+ elif self is IdentifierType.COMPOSITE:
21
+ return ("user_id", "organization_id")
22
+ raise ValueError(f"Unknown column(s) for identifier type: {self}")
23
+
24
+
25
+ class ExpandableField(StrEnum):
26
+ USER_TYPE = "user_type"
27
+ BLOOD_TYPE = "blood_type"
28
+ GENDER = "gender"
29
+ ORGANIZATION_TYPE = "organization_type"
30
+ ORGANIZATION_ROLE = "organization_role"
31
+ MEDICAL_ROLE = "medical_role"
32
+
33
+ @classmethod
34
+ def choices(cls) -> ListOfStrs:
35
+ return [e.value for e in cls]
36
+
37
+
38
+ OptExpandableField = ExpandableField | None
39
+ ListOfExpandableFields = list[ExpandableField]
40
+ OptListOfExpandableFields = ListOfExpandableFields | None
@@ -1,5 +1,5 @@
1
1
  from enum import StrEnum
2
- from maleo.types.string import ListOfStrs, ManyStrs
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
@@ -1,5 +1,5 @@
1
1
  from enum import StrEnum
2
- from maleo.types.string import ListOfStrs
2
+ from nexo.types.string import ListOfStrs
3
3
 
4
4
 
5
5
  class IdentifierType(StrEnum):
@@ -1,5 +1,5 @@
1
1
  from enum import StrEnum
2
- from maleo.types.string import ListOfStrs, ManyStrs
2
+ from nexo.types.string import ListOfStrs, ManyStrs
3
3
 
4
4
 
5
5
  class IdentifierType(StrEnum):
@@ -1,9 +1,9 @@
1
1
  from pydantic import BaseModel, Field
2
2
  from typing import Annotated, Literal, TypeGuard
3
3
  from uuid import UUID
4
- from maleo.schemas.mixins.identity import Identifier
5
- from maleo.types.any import ManyAny
6
- from maleo.types.string import ManyStrs
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
8
  from ..types.api_key import CompositeIdentifierType, IdentifierValueType
9
9
 
@@ -34,6 +34,13 @@ 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
45
  Identifier[Literal[IdentifierType.COMPOSITE], CompositeIdentifierType]
39
46
  ):
@@ -50,6 +57,7 @@ AnyAPIKeyIdentifier = (
50
57
  APIKeyIdentifier
51
58
  | IdAPIKeyIdentifier
52
59
  | UUIDAPIKeyIdentifier
60
+ | APIKeyAPIKeyIdentifier
53
61
  | CompositeAPIKeyIdentifier
54
62
  )
55
63
 
@@ -60,6 +68,14 @@ def is_id_identifier(
60
68
  return identifier.type is IdentifierType.ID and isinstance(identifier.value, int)
61
69
 
62
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
+
63
79
  def is_uuid_identifier(
64
80
  identifier: AnyAPIKeyIdentifier,
65
81
  ) -> TypeGuard[UUIDAPIKeyIdentifier]:
@@ -1,12 +1,12 @@
1
1
  from pydantic import Field
2
2
  from typing import Annotated, Generic
3
- from maleo.schemas.mixins.identity import (
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 maleo.types.string import OptStrT
9
+ from nexo.types.string import OptStrT
10
10
 
11
11
 
12
12
  class IdCard(BaseIdCard[OptStrT], Generic[OptStrT]):
@@ -1,10 +1,10 @@
1
1
  from pydantic import BaseModel, Field
2
2
  from typing import Annotated, Generic, Literal, TypeGuard
3
3
  from uuid import UUID
4
- from maleo.schemas.mixins.identity import Identifier, Key as BaseKey, Name as BaseName
5
- from maleo.types.string import OptStrT
6
- from maleo.types.uuid import OptUUIDT
7
- from ..enums.organization import IdentifierType
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
+ from ..enums.organization import IdentifierType, OptListOfExpandableFields
8
8
  from ..types.organization import IdentifierValueType
9
9
 
10
10
 
@@ -20,6 +20,12 @@ class Secret(BaseModel, Generic[OptUUIDT]):
20
20
  secret: Annotated[OptUUIDT, Field(..., description="Secret")]
21
21
 
22
22
 
23
+ class Expand(BaseModel):
24
+ expand: Annotated[
25
+ OptListOfExpandableFields, Field(None, description="Expanded field(s)")
26
+ ] = None
27
+
28
+
23
29
  class OrganizationIdentifier(Identifier[IdentifierType, IdentifierValueType]):
24
30
  @property
25
31
  def column_and_value(self) -> tuple[str, IdentifierValueType]:
@@ -1,10 +1,10 @@
1
1
  from pydantic import BaseModel, Field, model_validator
2
2
  from typing import Annotated, Generic, Literal, Self, TypeGuard
3
3
  from uuid import UUID
4
- from maleo.schemas.mixins.identity import Identifier
5
- from maleo.types.integer import OptIntT
6
- from maleo.types.misc import OptIntOrStr
7
- from maleo.types.string import OptStrT
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
8
8
  from ..enums.organization_registration_code import IdentifierType
9
9
  from ..types.organization_registration_code import IdentifierValueType
10
10
 
@@ -1,11 +1,11 @@
1
1
  from pydantic import BaseModel, Field
2
2
  from typing import Annotated, Generic, Literal, TypeGuard
3
3
  from uuid import UUID
4
- from maleo.schemas.mixins.identity import Identifier
5
- from maleo.types.any import ManyAny
6
- from maleo.types.boolean import OptBoolT
7
- from maleo.types.misc import OptListOfAnyOrStrToAnyDict
8
- from maleo.types.string import ManyStrs
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
9
  from ..enums.organization_relation import IdentifierType, OptListOfExpandableFields
10
10
  from ..types.organization_relation import CompositeIdentifierType, IdentifierValueType
11
11
 
@@ -1,8 +1,8 @@
1
1
  from pydantic import BaseModel, Field, model_validator
2
2
  from typing import Annotated, Generic, Literal, Self, TypeGuard
3
3
  from uuid import UUID
4
- from maleo.schemas.mixins.identity import Identifier, Passport as BasePassport
5
- from maleo.types.string import OptStr, OptStrT
4
+ from nexo.schemas.mixins.identity import Identifier, Passport as BasePassport
5
+ from nexo.types.string import OptStr, OptStrT
6
6
  from ..enums.patient import IdentifierType, OptListOfExpandableFields
7
7
  from ..types.patient import IdentifierValueType
8
8
  from .common import IdCard