maleo-identity 0.1.11__tar.gz → 0.1.12__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.

Potentially problematic release.


This version of maleo-identity might be problematic. Click here for more details.

Files changed (77) hide show
  1. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/PKG-INFO +1 -1
  2. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/maleo_identity.egg-info/PKG-INFO +1 -1
  3. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/pyproject.toml +1 -1
  4. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/constants/user_system_role.py +4 -0
  5. maleo_identity-0.1.12/src/enums/api_key.py +25 -0
  6. maleo_identity-0.1.12/src/enums/organization_relation.py +22 -0
  7. maleo_identity-0.1.12/src/enums/user_medical_role.py +22 -0
  8. maleo_identity-0.1.12/src/enums/user_organization_role.py +22 -0
  9. maleo_identity-0.1.12/src/enums/user_system_role.py +22 -0
  10. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/mixins/api_key.py +6 -1
  11. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/mixins/organization_relation.py +6 -1
  12. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/mixins/user_medical_role.py +6 -1
  13. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/mixins/user_organization_role.py +6 -1
  14. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/mixins/user_system_role.py +6 -1
  15. maleo_identity-0.1.11/src/enums/api_key.py +0 -13
  16. maleo_identity-0.1.11/src/enums/organization_relation.py +0 -12
  17. maleo_identity-0.1.11/src/enums/user_medical_role.py +0 -12
  18. maleo_identity-0.1.11/src/enums/user_organization_role.py +0 -12
  19. maleo_identity-0.1.11/src/enums/user_system_role.py +0 -12
  20. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/LICENSE +0 -0
  21. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/README.md +0 -0
  22. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/maleo_identity.egg-info/SOURCES.txt +0 -0
  23. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/maleo_identity.egg-info/dependency_links.txt +0 -0
  24. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/maleo_identity.egg-info/requires.txt +0 -0
  25. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/maleo_identity.egg-info/top_level.txt +0 -0
  26. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/setup.cfg +0 -0
  27. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/__init__.py +0 -0
  28. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/constants/__init__.py +0 -0
  29. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/constants/api_key.py +0 -0
  30. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/constants/organization.py +0 -0
  31. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/constants/organization_registration_code.py +0 -0
  32. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/constants/organization_relation.py +0 -0
  33. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/constants/patient.py +0 -0
  34. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/constants/user.py +0 -0
  35. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/constants/user_medical_role.py +0 -0
  36. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/constants/user_organization_role.py +0 -0
  37. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/constants/user_profile.py +0 -0
  38. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/enums/__init__.py +0 -0
  39. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/enums/organization.py +0 -0
  40. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/enums/organization_registration_code.py +0 -0
  41. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/enums/patient.py +0 -0
  42. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/enums/user.py +0 -0
  43. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/enums/user_profile.py +0 -0
  44. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/mixins/__init__.py +0 -0
  45. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/mixins/common.py +0 -0
  46. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/mixins/organization.py +0 -0
  47. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/mixins/organization_registration_code.py +0 -0
  48. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/mixins/patient.py +0 -0
  49. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/mixins/user.py +0 -0
  50. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/mixins/user_profile.py +0 -0
  51. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/models.py +0 -0
  52. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/schemas/__init__.py +0 -0
  53. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/schemas/api_key.py +0 -0
  54. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/schemas/common.py +0 -0
  55. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/schemas/organization.py +0 -0
  56. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/schemas/organization_registration_code.py +0 -0
  57. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/schemas/organization_relation.py +0 -0
  58. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/schemas/patient.py +0 -0
  59. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/schemas/user.py +0 -0
  60. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/schemas/user_medical_role.py +0 -0
  61. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/schemas/user_organization_role.py +0 -0
  62. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/schemas/user_profile.py +0 -0
  63. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/schemas/user_system_role.py +0 -0
  64. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/types/__init__.py +0 -0
  65. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/types/api_key.py +0 -0
  66. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/types/organization.py +0 -0
  67. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/types/organization_registration_code.py +0 -0
  68. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/types/organization_relation.py +0 -0
  69. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/types/patient.py +0 -0
  70. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/types/user.py +0 -0
  71. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/types/user_medical_role.py +0 -0
  72. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/types/user_organization_role.py +0 -0
  73. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/types/user_profile.py +0 -0
  74. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/types/user_system_role.py +0 -0
  75. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/utils/__init__.py +0 -0
  76. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/utils/organization.py +0 -0
  77. {maleo_identity-0.1.11 → maleo_identity-0.1.12}/src/utils/user.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo-identity
3
- Version: 0.1.11
3
+ Version: 0.1.12
4
4
  Summary: MaleoIdentity service package
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: Proprietary
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo-identity
3
- Version: 0.1.11
3
+ Version: 0.1.12
4
4
  Summary: MaleoIdentity service package
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: Proprietary
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "maleo-identity"
7
- version = "0.1.11"
7
+ version = "0.1.12"
8
8
  description = "MaleoIdentity service package"
9
9
  authors = [
10
10
  { name = "Agra Bima Yuda", email = "agra@nexmedis.com" }
@@ -1,4 +1,5 @@
1
1
  from maleo.schemas.resource import Resource, ResourceIdentifier
2
+ from maleo.types.string import DoubleStrs
2
3
 
3
4
 
4
5
  USER_SYSTEM_ROLE_RESOURCE = Resource(
@@ -11,3 +12,6 @@ USER_SYSTEM_ROLE_RESOURCE = Resource(
11
12
  ],
12
13
  details=None,
13
14
  )
15
+
16
+
17
+ COMPOSITE_COLUMS: DoubleStrs = ("user_id", "system_role")
@@ -0,0 +1,25 @@
1
+ from enum import StrEnum
2
+ from maleo.types.string import ListOfStrs, ManyStrs
3
+
4
+
5
+ class IdentifierType(StrEnum):
6
+ ID = "id"
7
+ UUID = "uuid"
8
+ API_KEY = "api_key"
9
+ COMPOSITE = "composite"
10
+
11
+ @classmethod
12
+ def choices(cls) -> ListOfStrs:
13
+ return [e.value for e in cls]
14
+
15
+ @property
16
+ def columns(self) -> ManyStrs:
17
+ if self is IdentifierType.ID:
18
+ return ("id",)
19
+ elif self is IdentifierType.UUID:
20
+ return ("uuid",)
21
+ elif self is IdentifierType.API_KEY:
22
+ return ("api_key",)
23
+ elif self is IdentifierType.COMPOSITE:
24
+ return ("user_id", "organization_id")
25
+ raise ValueError(f"Unknown column(s) for identifier type: {self}")
@@ -0,0 +1,22 @@
1
+ from enum import StrEnum
2
+ from maleo.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 ("source_id", "target_id", "relation")
22
+ raise ValueError(f"Unknown column(s) for identifier type: {self}")
@@ -0,0 +1,22 @@
1
+ from enum import StrEnum
2
+ from maleo.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", "medical_role")
22
+ raise ValueError(f"Unknown column(s) for identifier type: {self}")
@@ -0,0 +1,22 @@
1
+ from enum import StrEnum
2
+ from maleo.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", "organization_role")
22
+ raise ValueError(f"Unknown column(s) for identifier type: {self}")
@@ -0,0 +1,22 @@
1
+ from enum import StrEnum
2
+ from maleo.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", "system_role")
22
+ raise ValueError(f"Unknown column(s) for identifier type: {self}")
@@ -2,6 +2,8 @@ from pydantic import BaseModel, Field
2
2
  from typing import Annotated, Literal, TypeGuard
3
3
  from uuid import UUID
4
4
  from maleo.schemas.mixins.identity import Identifier
5
+ from maleo.types.any import ManyAny
6
+ from maleo.types.string import ManyStrs
5
7
  from ..enums.api_key import IdentifierType
6
8
  from ..types.api_key import CompositeIdentifier, IdentifierValueType
7
9
 
@@ -11,7 +13,10 @@ class APIKey(BaseModel):
11
13
 
12
14
 
13
15
  class APIKeyIdentifier(Identifier[IdentifierType, IdentifierValueType]):
14
- pass
16
+ @property
17
+ def columns_and_values(self) -> tuple[ManyStrs, ManyAny]:
18
+ values = self.value if isinstance(self.value, tuple) else (self.value,)
19
+ return self.type.columns, values
15
20
 
16
21
 
17
22
  class IdAPIKeyIdentifier(Identifier[Literal[IdentifierType.ID], int]):
@@ -2,8 +2,10 @@ from pydantic import BaseModel, Field
2
2
  from typing import Annotated, Generic, Literal, TypeGuard
3
3
  from uuid import UUID
4
4
  from maleo.schemas.mixins.identity import Identifier
5
+ from maleo.types.any import ManyAny
5
6
  from maleo.types.boolean import OptBoolT
6
7
  from maleo.types.misc import OptListOfAnyOrStrToAnyDict
8
+ from maleo.types.string import ManyStrs
7
9
  from ..enums.organization_relation import IdentifierType
8
10
  from ..types.organization_relation import CompositeIdentifier, IdentifierValueType
9
11
 
@@ -17,7 +19,10 @@ class Meta(BaseModel):
17
19
 
18
20
 
19
21
  class OrganizationRelationIdentifier(Identifier[IdentifierType, IdentifierValueType]):
20
- pass
22
+ @property
23
+ def columns_and_values(self) -> tuple[ManyStrs, ManyAny]:
24
+ values = self.value if isinstance(self.value, tuple) else (self.value,)
25
+ return self.type.columns, values
21
26
 
22
27
 
23
28
  class IdOrganizationRelationIdentifier(Identifier[Literal[IdentifierType.ID], int]):
@@ -2,12 +2,17 @@ from pydantic import Field
2
2
  from typing import Annotated, Literal, TypeGuard
3
3
  from uuid import UUID
4
4
  from maleo.schemas.mixins.identity import Identifier
5
+ from maleo.types.any import ManyAny
6
+ from maleo.types.string import ManyStrs
5
7
  from ..enums.user_medical_role import IdentifierType
6
8
  from ..types.user_medical_role import CompositeIdentifier, IdentifierValueType
7
9
 
8
10
 
9
11
  class UserMedicalRoleIdentifier(Identifier[IdentifierType, IdentifierValueType]):
10
- pass
12
+ @property
13
+ def columns_and_values(self) -> tuple[ManyStrs, ManyAny]:
14
+ values = self.value if isinstance(self.value, tuple) else (self.value,)
15
+ return self.type.columns, values
11
16
 
12
17
 
13
18
  class IdUserMedicalRoleIdentifier(Identifier[Literal[IdentifierType.ID], int]):
@@ -2,12 +2,17 @@ from pydantic import Field
2
2
  from typing import Annotated, Literal, TypeGuard
3
3
  from uuid import UUID
4
4
  from maleo.schemas.mixins.identity import Identifier
5
+ from maleo.types.any import ManyAny
6
+ from maleo.types.string import ManyStrs
5
7
  from ..enums.user_organization_role import IdentifierType
6
8
  from ..types.user_organization_role import CompositeIdentifier, IdentifierValueType
7
9
 
8
10
 
9
11
  class UserOrganizationRoleIdentifier(Identifier[IdentifierType, IdentifierValueType]):
10
- pass
12
+ @property
13
+ def columns_and_values(self) -> tuple[ManyStrs, ManyAny]:
14
+ values = self.value if isinstance(self.value, tuple) else (self.value,)
15
+ return self.type.columns, values
11
16
 
12
17
 
13
18
  class IdUserOrganizationRoleIdentifier(Identifier[Literal[IdentifierType.ID], int]):
@@ -2,12 +2,17 @@ from pydantic import Field
2
2
  from typing import Annotated, Literal, TypeGuard
3
3
  from uuid import UUID
4
4
  from maleo.schemas.mixins.identity import Identifier
5
+ from maleo.types.any import ManyAny
6
+ from maleo.types.string import ManyStrs
5
7
  from ..enums.user_system_role import IdentifierType
6
8
  from ..types.user_system_role import CompositeIdentifier, IdentifierValueType
7
9
 
8
10
 
9
11
  class UserSystemRoleIdentifier(Identifier[IdentifierType, IdentifierValueType]):
10
- pass
12
+ @property
13
+ def columns_and_values(self) -> tuple[ManyStrs, ManyAny]:
14
+ values = self.value if isinstance(self.value, tuple) else (self.value,)
15
+ return self.type.columns, values
11
16
 
12
17
 
13
18
  class IdUserSystemRoleIdentifier(Identifier[Literal[IdentifierType.ID], int]):
@@ -1,13 +0,0 @@
1
- from enum import StrEnum
2
- from maleo.types.string import ListOfStrs
3
-
4
-
5
- class IdentifierType(StrEnum):
6
- ID = "id"
7
- UUID = "uuid"
8
- API_KEY = "api_key"
9
- COMPOSITE = "composite"
10
-
11
- @classmethod
12
- def choices(cls) -> ListOfStrs:
13
- return [e.value for e in cls]
@@ -1,12 +0,0 @@
1
- from enum import StrEnum
2
- from maleo.types.string import ListOfStrs
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]
@@ -1,12 +0,0 @@
1
- from enum import StrEnum
2
- from maleo.types.string import ListOfStrs
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]
@@ -1,12 +0,0 @@
1
- from enum import StrEnum
2
- from maleo.types.string import ListOfStrs
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]
@@ -1,12 +0,0 @@
1
- from enum import StrEnum
2
- from maleo.types.string import ListOfStrs
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]
File without changes