maleo-identity 0.0.84__py3-none-any.whl → 0.0.86__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.

Potentially problematic release.


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

@@ -1,4 +1,5 @@
1
1
  from typing import Callable, Dict
2
+ from uuid import UUID
2
3
  from maleo.soma.schemas.resource import Resource, ResourceIdentifier
3
4
  from maleo.identity.enums.user_profile import IdentifierType, ValidImageMimeType
4
5
  from maleo.identity.types.base.user_profile import IdentifierValueType
@@ -6,6 +7,8 @@ from maleo.identity.types.base.user_profile import IdentifierValueType
6
7
  IDENTIFIER_TYPE_VALUE_TYPE_MAP: Dict[
7
8
  IdentifierType, Callable[..., IdentifierValueType]
8
9
  ] = {
10
+ IdentifierType.ID: int,
11
+ IdentifierType.UUID: UUID,
9
12
  IdentifierType.USER_ID: int,
10
13
  IdentifierType.ID_CARD: str,
11
14
  }
@@ -2,6 +2,8 @@ from enum import StrEnum
2
2
 
3
3
 
4
4
  class IdentifierType(StrEnum):
5
+ ID = "id"
6
+ UUID = "uuid"
5
7
  USER_ID = "user_id"
6
8
  ID_CARD = "id_card"
7
9
 
@@ -13,5 +15,5 @@ class ValidImageMimeType(StrEnum):
13
15
 
14
16
 
15
17
  class ExpandableField(StrEnum):
16
- GENDER = "gender"
17
- BLOOD_TYPE = "blood_type"
18
+ GENDER = "gender_details"
19
+ BLOOD_TYPE = "blood_type_details"
@@ -1,3 +1,6 @@
1
+ from typing import List, Literal, Optional, overload
2
+ from uuid import UUID
3
+ from maleo.soma.constants import ALL_STATUSES
1
4
  from maleo.soma.mixins.general import OptionalParentId
2
5
  from maleo.soma.mixins.parameter import (
3
6
  IdentifierType as IdentifierTypeMixin,
@@ -7,8 +10,9 @@ from maleo.soma.schemas.parameter.general import (
7
10
  ReadSingleQueryParameterSchema,
8
11
  ReadSingleParameterSchema,
9
12
  )
13
+ from maleo.soma.types.base import ListOfDataStatuses
10
14
  from maleo.metadata.schemas.data.organization_type import SimpleOrganizationTypeMixin
11
- from maleo.identity.enums.organization import IdentifierType
15
+ from maleo.identity.enums.organization import IdentifierType, ExpandableField
12
16
  from maleo.identity.mixins.organization import Key, Name, Expand
13
17
  from maleo.identity.types.base.organization import IdentifierValueType
14
18
 
@@ -20,7 +24,52 @@ class ReadSingleQueryParameter(Expand, ReadSingleQueryParameterSchema):
20
24
  class ReadSingleParameter(
21
25
  Expand, ReadSingleParameterSchema[IdentifierType, IdentifierValueType]
22
26
  ):
23
- pass
27
+ @overload
28
+ @classmethod
29
+ def new(
30
+ cls,
31
+ identifier: Literal[IdentifierType.ID],
32
+ value: int,
33
+ statuses: ListOfDataStatuses = ALL_STATUSES,
34
+ use_cache: bool = True,
35
+ expand: Optional[List[ExpandableField]] = None,
36
+ ) -> "ReadSingleParameter": ...
37
+ @overload
38
+ @classmethod
39
+ def new(
40
+ cls,
41
+ identifier: Literal[IdentifierType.UUID],
42
+ value: UUID,
43
+ statuses: ListOfDataStatuses = ALL_STATUSES,
44
+ use_cache: bool = True,
45
+ expand: Optional[List[ExpandableField]] = None,
46
+ ) -> "ReadSingleParameter": ...
47
+ @overload
48
+ @classmethod
49
+ def new(
50
+ cls,
51
+ identifier: Literal[IdentifierType.KEY],
52
+ value: str,
53
+ statuses: ListOfDataStatuses = ALL_STATUSES,
54
+ use_cache: bool = True,
55
+ expand: Optional[List[ExpandableField]] = None,
56
+ ) -> "ReadSingleParameter": ...
57
+ @classmethod
58
+ def new(
59
+ cls,
60
+ identifier: IdentifierType,
61
+ value: IdentifierValueType,
62
+ statuses: ListOfDataStatuses = ALL_STATUSES,
63
+ use_cache: bool = True,
64
+ expand: Optional[List[ExpandableField]] = None,
65
+ ) -> "ReadSingleParameter":
66
+ return cls(
67
+ identifier=identifier,
68
+ value=value,
69
+ statuses=statuses,
70
+ use_cache=use_cache,
71
+ expand=expand,
72
+ )
24
73
 
25
74
 
26
75
  class CreateOrUpdateBody(Name, Key, OptionalParentId, SimpleOrganizationTypeMixin):
@@ -1,9 +1,13 @@
1
+ from typing import Literal, overload
2
+ from uuid import UUID
3
+ from maleo.soma.constants import ALL_STATUSES
1
4
  from maleo.soma.mixins.general import OrganizationId
2
5
  from maleo.soma.mixins.parameter import IdentifierTypeValue as IdentifierTypeValueMixin
3
6
  from maleo.soma.schemas.parameter.general import (
4
7
  ReadSingleParameterSchema,
5
8
  StatusUpdateQueryParameterSchema,
6
9
  )
10
+ from maleo.soma.types.base import ListOfDataStatuses
7
11
  from maleo.identity.enums.organization_registration_code import IdentifierType
8
12
  from maleo.identity.mixins.organization_registration_code import (
9
13
  MaxUses,
@@ -15,7 +19,35 @@ from maleo.identity.types.base.organization_registration_code import IdentifierV
15
19
  class ReadSingleParameter(
16
20
  ReadSingleParameterSchema[IdentifierType, IdentifierValueType]
17
21
  ):
18
- pass
22
+ @overload
23
+ @classmethod
24
+ def new(
25
+ cls,
26
+ identifier: Literal[IdentifierType.ID, IdentifierType.ORGANIZATION_ID],
27
+ value: int,
28
+ statuses: ListOfDataStatuses = ALL_STATUSES,
29
+ use_cache: bool = True,
30
+ ) -> "ReadSingleParameter": ...
31
+ @overload
32
+ @classmethod
33
+ def new(
34
+ cls,
35
+ identifier: Literal[IdentifierType.UUID, IdentifierType.CODE],
36
+ value: UUID,
37
+ statuses: ListOfDataStatuses = ALL_STATUSES,
38
+ use_cache: bool = True,
39
+ ) -> "ReadSingleParameter": ...
40
+ @classmethod
41
+ def new(
42
+ cls,
43
+ identifier: IdentifierType,
44
+ value: IdentifierValueType,
45
+ statuses: ListOfDataStatuses = ALL_STATUSES,
46
+ use_cache: bool = True,
47
+ ) -> "ReadSingleParameter":
48
+ return cls(
49
+ identifier=identifier, value=value, statuses=statuses, use_cache=use_cache
50
+ )
19
51
 
20
52
 
21
53
  class CreateParameter(
@@ -1,3 +1,6 @@
1
+ from typing import List, Literal, Optional, overload
2
+ from uuid import UUID
3
+ from maleo.soma.constants import ALL_STATUSES
1
4
  from maleo.soma.mixins.general import OptionalOrganizationId
2
5
  from maleo.soma.mixins.parameter import (
3
6
  IdentifierType as IdentifierTypeMixin,
@@ -7,10 +10,11 @@ from maleo.soma.schemas.parameter.general import (
7
10
  ReadSingleQueryParameterSchema,
8
11
  ReadSingleParameterSchema,
9
12
  )
13
+ from maleo.soma.types.base import ListOfDataStatuses
10
14
  from maleo.metadata.schemas.data.blood_type import OptionalSimpleBloodTypeMixin
11
15
  from maleo.metadata.schemas.data.gender import OptionalSimpleGenderMixin
12
16
  from maleo.metadata.schemas.data.user_type import SimpleUserTypeMixin
13
- from maleo.identity.enums.user import IdentifierType
17
+ from maleo.identity.enums.user import IdentifierType, ExpandableField
14
18
  from maleo.identity.mixins.user import (
15
19
  Username,
16
20
  Email,
@@ -43,7 +47,52 @@ class ReadSingleQueryParameter(Expand, ReadSingleQueryParameterSchema):
43
47
  class ReadSingleParameter(
44
48
  Expand, ReadSingleParameterSchema[IdentifierType, IdentifierValueType]
45
49
  ):
46
- pass
50
+ @overload
51
+ @classmethod
52
+ def new(
53
+ cls,
54
+ identifier: Literal[IdentifierType.ID],
55
+ value: int,
56
+ statuses: ListOfDataStatuses = ALL_STATUSES,
57
+ use_cache: bool = True,
58
+ expand: Optional[List[ExpandableField]] = None,
59
+ ) -> "ReadSingleParameter": ...
60
+ @overload
61
+ @classmethod
62
+ def new(
63
+ cls,
64
+ identifier: Literal[IdentifierType.UUID],
65
+ value: UUID,
66
+ statuses: ListOfDataStatuses = ALL_STATUSES,
67
+ use_cache: bool = True,
68
+ expand: Optional[List[ExpandableField]] = None,
69
+ ) -> "ReadSingleParameter": ...
70
+ @overload
71
+ @classmethod
72
+ def new(
73
+ cls,
74
+ identifier: Literal[IdentifierType.EMAIL, IdentifierType.USERNAME],
75
+ value: str,
76
+ statuses: ListOfDataStatuses = ALL_STATUSES,
77
+ use_cache: bool = True,
78
+ expand: Optional[List[ExpandableField]] = None,
79
+ ) -> "ReadSingleParameter": ...
80
+ @classmethod
81
+ def new(
82
+ cls,
83
+ identifier: IdentifierType,
84
+ value: IdentifierValueType,
85
+ statuses: ListOfDataStatuses = ALL_STATUSES,
86
+ use_cache: bool = True,
87
+ expand: Optional[List[ExpandableField]] = None,
88
+ ) -> "ReadSingleParameter":
89
+ return cls(
90
+ identifier=identifier,
91
+ value=value,
92
+ statuses=statuses,
93
+ use_cache=use_cache,
94
+ expand=expand,
95
+ )
47
96
 
48
97
 
49
98
  class ReadSinglePassword(
@@ -1,12 +1,16 @@
1
+ from typing import List, Literal, Optional, overload
2
+ from uuid import UUID
3
+ from maleo.soma.constants import ALL_STATUSES
1
4
  from maleo.soma.mixins.general import UserId
2
5
  from maleo.soma.mixins.parameter import IdentifierTypeValue as IdentifierTypeValueMixin
3
6
  from maleo.soma.schemas.parameter.general import (
4
7
  ReadSingleQueryParameterSchema,
5
8
  ReadSingleParameterSchema,
6
9
  )
10
+ from maleo.soma.types.base import ListOfDataStatuses
7
11
  from maleo.metadata.schemas.data.blood_type import OptionalSimpleBloodTypeMixin
8
12
  from maleo.metadata.schemas.data.gender import OptionalSimpleGenderMixin
9
- from maleo.identity.enums.user_profile import IdentifierType
13
+ from maleo.identity.enums.user_profile import IdentifierType, ExpandableField
10
14
  from maleo.identity.mixins.user_profile import (
11
15
  Expand,
12
16
  OptionalIdCard,
@@ -33,7 +37,52 @@ class ReadSingleQueryParameter(
33
37
  class ReadSingleParameter(
34
38
  Expand, ReadSingleParameterSchema[IdentifierType, IdentifierValueType]
35
39
  ):
36
- pass
40
+ @overload
41
+ @classmethod
42
+ def new(
43
+ cls,
44
+ identifier: Literal[IdentifierType.ID, IdentifierType.USER_ID],
45
+ value: int,
46
+ statuses: ListOfDataStatuses = ALL_STATUSES,
47
+ use_cache: bool = True,
48
+ expand: Optional[List[ExpandableField]] = None,
49
+ ) -> "ReadSingleParameter": ...
50
+ @overload
51
+ @classmethod
52
+ def new(
53
+ cls,
54
+ identifier: Literal[IdentifierType.UUID],
55
+ value: UUID,
56
+ statuses: ListOfDataStatuses = ALL_STATUSES,
57
+ use_cache: bool = True,
58
+ expand: Optional[List[ExpandableField]] = None,
59
+ ) -> "ReadSingleParameter": ...
60
+ @overload
61
+ @classmethod
62
+ def new(
63
+ cls,
64
+ identifier: Literal[IdentifierType.ID_CARD],
65
+ value: str,
66
+ statuses: ListOfDataStatuses = ALL_STATUSES,
67
+ use_cache: bool = True,
68
+ expand: Optional[List[ExpandableField]] = None,
69
+ ) -> "ReadSingleParameter": ...
70
+ @classmethod
71
+ def new(
72
+ cls,
73
+ identifier: IdentifierType,
74
+ value: IdentifierValueType,
75
+ statuses: ListOfDataStatuses = ALL_STATUSES,
76
+ use_cache: bool = True,
77
+ expand: Optional[List[ExpandableField]] = None,
78
+ ) -> "ReadSingleParameter":
79
+ return cls(
80
+ identifier=identifier,
81
+ value=value,
82
+ statuses=statuses,
83
+ use_cache=use_cache,
84
+ expand=expand,
85
+ )
37
86
 
38
87
 
39
88
  class CreateOrUpdateQuery(Expand):
@@ -1,4 +1,5 @@
1
1
  from typing import Union
2
+ from uuid import UUID
2
3
 
3
4
 
4
- IdentifierValueType = Union[int, str]
5
+ IdentifierValueType = Union[int, UUID, str]
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo-identity
3
- Version: 0.0.84
3
+ Version: 0.0.86
4
4
  Summary: MaleoIdentity service package
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
7
7
  Requires-Python: >=3.7
8
8
  Description-Content-Type: text/markdown
9
- Requires-Dist: maleo_soma>=0.1.85
10
- Requires-Dist: maleo_metadata>=0.2.41
9
+ Requires-Dist: maleo_soma>=0.1.90
10
+ Requires-Dist: maleo_metadata>=0.2.46
11
11
 
12
12
  # README #
13
13
 
@@ -18,7 +18,7 @@ maleo/identity/constants/organization_role.py,sha256=lDuPYcjEyug7NGWak5oKHsnCFIc
18
18
  maleo/identity/constants/user.py,sha256=cQ7ThRMaldczONTx-TUdeZqaQJegJ2zD4F_8Y3Eme7A,859
19
19
  maleo/identity/constants/user_organization.py,sha256=Ujh2ZQbrH2WryIdmLpKiuQAt7418vxbG4_DtHSlfTtY,2247
20
20
  maleo/identity/constants/user_organization_role.py,sha256=FhWRyJ6whVRPD7-SqfpCqJtMfh-oFsjTX2AUoxAeJpI,1719
21
- maleo/identity/constants/user_profile.py,sha256=HGqRx_PQQQYtGuAJtWQhtOvo1MaClgKFiD9XuH1fwCA,780
21
+ maleo/identity/constants/user_profile.py,sha256=DVl6dwUAWTMegQiwyvbC5l9Gb22s2otii9nNb1Elfqg,861
22
22
  maleo/identity/constants/user_system_role.py,sha256=ifHNZvvRbLoTc-bzL5_nCvobR0jwHsnSm6-UYq0QDzw,474
23
23
  maleo/identity/dtos/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  maleo/identity/dtos/configuration.py,sha256=gCsLhgmXjhsPCv0n80QHW7f4AlV1I-kbvZCuOW2c_Ss,473
@@ -34,7 +34,7 @@ maleo/identity/enums/organization_role.py,sha256=NQuFLyv-pHnMBNNDGPN_7EFz3vxvTNu
34
34
  maleo/identity/enums/user.py,sha256=UBLek1aJUPnZNyPMSaHKDPbtvvbbOursBGycr6g8ad8,385
35
35
  maleo/identity/enums/user_organization.py,sha256=q9weTEryo2OEy0XUVXwcjNX1TsdiT-ajXbIDcuqaRI8,440
36
36
  maleo/identity/enums/user_organization_role.py,sha256=eRKwJ1_FighU2iOdnvN_2ZUvRHHIA2DWn-0ip3Ls10I,494
37
- maleo/identity/enums/user_profile.py,sha256=2AR_m2nf3lksz0DSr-C-1gaWAYgYbpbou4ILyYsO4UM,297
37
+ maleo/identity/enums/user_profile.py,sha256=kUVOR3pqSuAPzyG4XoH0MmKkaez9XWGKS4qtzOtKWE4,345
38
38
  maleo/identity/enums/user_system_role.py,sha256=bmaHE6f1RoxavUhl1bR8_dL9KF_4DftohvOLHMvwg-g,91
39
39
  maleo/identity/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
40
  maleo/identity/mixins/organization.py,sha256=TWL7hIp7uvE5UD_3FpEXJvpJVhXki_yIHEoS552MsxQ,418
@@ -77,13 +77,13 @@ maleo/identity/schemas/parameter/client/user_organization_role.py,sha256=kg4JhC5
77
77
  maleo/identity/schemas/parameter/client/user_profile.py,sha256=ZI6FBHnHNY2kGLg10TDfyMfi7YdkcegpXIzHtbcUL-M,840
78
78
  maleo/identity/schemas/parameter/client/user_system_role.py,sha256=vwXBLB7cUVs9FpPy2hFurfNTrKTPZzvaIYYgy574Yik,1053
79
79
  maleo/identity/schemas/parameter/general/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
80
- maleo/identity/schemas/parameter/general/organization.py,sha256=sKsDbwo_hOQO_LSaQqkkalwswGsiOsOEOCDEOi9Hv9s,1118
81
- maleo/identity/schemas/parameter/general/organization_registration_code.py,sha256=GeZRzmmhSjxUuKrJvEew84Ri4UyWZcNTuLzDI7DjwZ4,1241
80
+ maleo/identity/schemas/parameter/general/organization.py,sha256=SuDfsojK67XsCXkSxgxKsXAX8TbydFSc_ruBI0E8njo,2679
81
+ maleo/identity/schemas/parameter/general/organization_registration_code.py,sha256=i5zgH04gtVLDjilIBCzummtxvpwywArLJ2jIMuCuEJ8,2287
82
82
  maleo/identity/schemas/parameter/general/organization_role.py,sha256=jxNZsLyI2F0v_dntw6XGKchL06RCCQP2LCdzQvvihG0,468
83
- maleo/identity/schemas/parameter/general/user.py,sha256=9r1xLT67q-TGrn_MsNld-VgQkOlDmcEJDT81-3Hb2ZQ,2155
83
+ maleo/identity/schemas/parameter/general/user.py,sha256=Z8Sy-8XEEal1rGModPMFHQ0QPGsmieOuZsSd73KmDDc,3743
84
84
  maleo/identity/schemas/parameter/general/user_organization.py,sha256=11xtngCkoBa-D3qHhsdfrZM6iWVAH6oPi-gbJDx3xvA,540
85
85
  maleo/identity/schemas/parameter/general/user_organization_role.py,sha256=nrgsblXxt-wQBgy4TUVAwD70b1zUsIboEPQQFKxGxDU,540
86
- maleo/identity/schemas/parameter/general/user_profile.py,sha256=okz-0lO3bF8X_lvSIit2Zp5WfZGbACRpzn0SysBYWVA,1556
86
+ maleo/identity/schemas/parameter/general/user_profile.py,sha256=keHf1Eiy-RqD9Ng7Yhi6_5h4eTZ9lxvg8TZVO8XZRi4,3145
87
87
  maleo/identity/schemas/parameter/general/user_system_role.py,sha256=bxIXMJhT05yBGWzItU00BYvZDXC0_oS2J4igmT4ePbA,654
88
88
  maleo/identity/schemas/parameter/service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
89
89
  maleo/identity/schemas/parameter/service/organization.py,sha256=VDBYtppFnqGaCB-To04OTESsI576IcOEP_n-S_pPHi4,1388
@@ -98,8 +98,8 @@ maleo/identity/types/base/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
98
98
  maleo/identity/types/base/organization.py,sha256=wLu9QcVDfiMke3-Smfs-LI3zV5QiMuCKkoa0CCRmh4s,93
99
99
  maleo/identity/types/base/organization_registration_code.py,sha256=V8cct7fTIO-OT7RoYuui__oblyIUzFdQWOwHfhflpUc,87
100
100
  maleo/identity/types/base/user.py,sha256=wLu9QcVDfiMke3-Smfs-LI3zV5QiMuCKkoa0CCRmh4s,93
101
- maleo/identity/types/base/user_profile.py,sha256=E81XLbjJ8szrnPRA09VILrr4at4mKWJLeGOfYWLnWPQ,65
102
- maleo_identity-0.0.84.dist-info/METADATA,sha256=cZoAyvxguEYKeoxUkVxnAcpXo5UvfmeGyomFvjdzR_Q,862
103
- maleo_identity-0.0.84.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
104
- maleo_identity-0.0.84.dist-info/top_level.txt,sha256=3Tpd1siVsfYoeI9FEOJNYnffx_shzZ3wsPpTvz5bljc,6
105
- maleo_identity-0.0.84.dist-info/RECORD,,
101
+ maleo/identity/types/base/user_profile.py,sha256=wLu9QcVDfiMke3-Smfs-LI3zV5QiMuCKkoa0CCRmh4s,93
102
+ maleo_identity-0.0.86.dist-info/METADATA,sha256=KUxk-c07skYKcHJXkFMSH1pYTcr-mjz8oCI6ahpPCKI,862
103
+ maleo_identity-0.0.86.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
104
+ maleo_identity-0.0.86.dist-info/top_level.txt,sha256=3Tpd1siVsfYoeI9FEOJNYnffx_shzZ3wsPpTvz5bljc,6
105
+ maleo_identity-0.0.86.dist-info/RECORD,,