maleo-identity 0.1.27__py3-none-any.whl → 0.1.59__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.
- maleo/identity/constants/api_key.py +1 -1
- maleo/identity/constants/organization.py +1 -1
- maleo/identity/constants/organization_registration_code.py +1 -1
- maleo/identity/constants/organization_relation.py +1 -1
- maleo/identity/constants/patient.py +1 -1
- maleo/identity/constants/user.py +1 -1
- maleo/identity/constants/user_medical_role.py +1 -1
- maleo/identity/constants/user_organization.py +13 -0
- maleo/identity/constants/user_organization_role.py +1 -1
- maleo/identity/constants/user_profile.py +16 -1
- maleo/identity/constants/user_system_role.py +2 -2
- maleo/identity/enums/api_key.py +1 -1
- maleo/identity/enums/organization.py +14 -10
- maleo/identity/enums/organization_registration_code.py +1 -1
- maleo/identity/enums/organization_relation.py +14 -1
- maleo/identity/enums/patient.py +1 -1
- maleo/identity/enums/user.py +16 -1
- maleo/identity/enums/user_medical_role.py +14 -1
- maleo/identity/enums/user_organization.py +40 -0
- maleo/identity/enums/user_organization_role.py +14 -1
- maleo/identity/enums/user_profile.py +1 -1
- maleo/identity/enums/user_system_role.py +1 -1
- maleo/identity/mixins/api_key.py +19 -3
- maleo/identity/mixins/common.py +2 -2
- maleo/identity/mixins/organization.py +10 -4
- maleo/identity/mixins/organization_registration_code.py +4 -4
- maleo/identity/mixins/organization_relation.py +12 -6
- maleo/identity/mixins/patient.py +2 -2
- maleo/identity/mixins/user.py +9 -3
- maleo/identity/mixins/user_medical_role.py +11 -5
- maleo/identity/mixins/user_organization.py +76 -0
- maleo/identity/mixins/user_organization_role.py +11 -5
- maleo/identity/mixins/user_profile.py +3 -5
- maleo/identity/mixins/user_system_role.py +3 -3
- maleo/identity/schemas/api_key.py +22 -8
- maleo/identity/schemas/common.py +33 -77
- maleo/identity/schemas/organization.py +59 -25
- maleo/identity/schemas/organization_registration_code.py +11 -11
- maleo/identity/schemas/organization_relation.py +81 -21
- maleo/identity/schemas/patient.py +12 -12
- maleo/identity/schemas/user.py +104 -22
- maleo/identity/schemas/user_medical_role.py +66 -16
- maleo/identity/schemas/user_organization.py +334 -0
- maleo/identity/schemas/user_organization_role.py +68 -16
- maleo/identity/schemas/user_profile.py +15 -26
- maleo/identity/schemas/user_system_role.py +10 -10
- maleo/identity/types/api_key.py +3 -2
- maleo/identity/types/organization.py +1 -1
- maleo/identity/types/organization_registration_code.py +1 -1
- maleo/identity/types/organization_relation.py +3 -3
- maleo/identity/types/user.py +1 -1
- maleo/identity/types/user_medical_role.py +3 -2
- maleo/identity/types/user_organization.py +7 -0
- maleo/identity/types/user_organization_role.py +3 -2
- maleo/identity/types/user_profile.py +1 -1
- maleo/identity/types/user_system_role.py +1 -1
- {maleo_identity-0.1.27.dist-info → maleo_identity-0.1.59.dist-info}/METADATA +10 -9
- maleo_identity-0.1.59.dist-info/RECORD +68 -0
- maleo/identity/utils/__init__.py +0 -0
- maleo/identity/utils/organization.py +0 -32
- maleo/identity/utils/user.py +0 -32
- maleo_identity-0.1.27.dist-info/RECORD +0 -66
- {maleo_identity-0.1.27.dist-info → maleo_identity-0.1.59.dist-info}/WHEEL +0 -0
- {maleo_identity-0.1.27.dist-info → maleo_identity-0.1.59.dist-info}/licenses/LICENSE +0 -0
- {maleo_identity-0.1.27.dist-info → maleo_identity-0.1.59.dist-info}/top_level.txt +0 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
from pydantic import BaseModel, Field
|
|
2
2
|
from typing import Annotated, Generic, Literal, TypeVar, overload
|
|
3
3
|
from uuid import UUID
|
|
4
|
-
from
|
|
4
|
+
from nexo.enums.organization import (
|
|
5
5
|
OrganizationRole,
|
|
6
6
|
OptOrganizationRole,
|
|
7
7
|
FullOrganizationRoleMixin,
|
|
8
8
|
OptListOfOrganizationRoles,
|
|
9
9
|
FullOrganizationRolesMixin,
|
|
10
10
|
)
|
|
11
|
-
from
|
|
11
|
+
from nexo.enums.status import (
|
|
12
12
|
ListOfDataStatuses,
|
|
13
13
|
FULL_DATA_STATUSES,
|
|
14
14
|
)
|
|
15
|
-
from
|
|
16
|
-
from
|
|
15
|
+
from nexo.schemas.mixins.filter import convert as convert_filter
|
|
16
|
+
from nexo.schemas.mixins.identity import (
|
|
17
17
|
IdentifierMixin,
|
|
18
18
|
Ids,
|
|
19
19
|
UUIDs,
|
|
@@ -22,23 +22,41 @@ from maleo.schemas.mixins.identity import (
|
|
|
22
22
|
IntOrganizationId,
|
|
23
23
|
IntOrganizationIds,
|
|
24
24
|
)
|
|
25
|
-
from
|
|
26
|
-
from
|
|
27
|
-
from
|
|
25
|
+
from nexo.schemas.mixins.sort import convert as convert_sort
|
|
26
|
+
from nexo.schemas.operation.enums import ResourceOperationStatusUpdateType
|
|
27
|
+
from nexo.schemas.parameter import (
|
|
28
28
|
ReadSingleParameter as BaseReadSingleParameter,
|
|
29
29
|
ReadPaginatedMultipleParameter,
|
|
30
30
|
StatusUpdateParameter as BaseStatusUpdateParameter,
|
|
31
31
|
DeleteSingleParameter as BaseDeleteSingleParameter,
|
|
32
32
|
)
|
|
33
|
-
from
|
|
34
|
-
from
|
|
35
|
-
from
|
|
36
|
-
from ..enums.user_organization_role import IdentifierType
|
|
37
|
-
from ..mixins.user_organization_role import UserOrganizationRoleIdentifier
|
|
33
|
+
from nexo.types.dict import StrToAnyDict
|
|
34
|
+
from nexo.types.integer import OptInt, OptListOfInts
|
|
35
|
+
from nexo.types.uuid import OptListOfUUIDs
|
|
36
|
+
from ..enums.user_organization_role import IdentifierType, OptListOfExpandableFields
|
|
37
|
+
from ..mixins.user_organization_role import Expand, UserOrganizationRoleIdentifier
|
|
38
38
|
from ..types.user_organization_role import CompositeIdentifierType, IdentifierValueType
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
class
|
|
41
|
+
class BaseCreateData(FullOrganizationRoleMixin[OrganizationRole]):
|
|
42
|
+
pass
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class CreateFromOrganizationData(
|
|
46
|
+
FullOrganizationRoleMixin[OrganizationRole],
|
|
47
|
+
IntUserId[int],
|
|
48
|
+
):
|
|
49
|
+
pass
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class CreateFromUserData(
|
|
53
|
+
FullOrganizationRoleMixin[OrganizationRole],
|
|
54
|
+
IntOrganizationId[int],
|
|
55
|
+
):
|
|
56
|
+
pass
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class FullCreateData(
|
|
42
60
|
FullOrganizationRoleMixin[OrganizationRole],
|
|
43
61
|
IntOrganizationId[int],
|
|
44
62
|
IntUserId[int],
|
|
@@ -46,7 +64,15 @@ class CreateParameter(
|
|
|
46
64
|
pass
|
|
47
65
|
|
|
48
66
|
|
|
67
|
+
class CreateParameter(
|
|
68
|
+
Expand,
|
|
69
|
+
FullCreateData,
|
|
70
|
+
):
|
|
71
|
+
pass
|
|
72
|
+
|
|
73
|
+
|
|
49
74
|
class ReadMultipleParameter(
|
|
75
|
+
Expand,
|
|
50
76
|
ReadPaginatedMultipleParameter,
|
|
51
77
|
FullOrganizationRolesMixin[OptListOfOrganizationRoles],
|
|
52
78
|
IntOrganizationIds[OptListOfInts],
|
|
@@ -77,6 +103,7 @@ class ReadMultipleParameter(
|
|
|
77
103
|
"page",
|
|
78
104
|
"limit",
|
|
79
105
|
"use_cache",
|
|
106
|
+
"expand",
|
|
80
107
|
}
|
|
81
108
|
|
|
82
109
|
def to_query_params(self) -> StrToAnyDict:
|
|
@@ -89,15 +116,20 @@ class ReadMultipleParameter(
|
|
|
89
116
|
return params
|
|
90
117
|
|
|
91
118
|
|
|
92
|
-
class ReadSingleParameter(
|
|
119
|
+
class ReadSingleParameter(
|
|
120
|
+
Expand, BaseReadSingleParameter[UserOrganizationRoleIdentifier]
|
|
121
|
+
):
|
|
93
122
|
@classmethod
|
|
94
123
|
def from_identifier(
|
|
95
124
|
cls,
|
|
96
125
|
identifier: UserOrganizationRoleIdentifier,
|
|
97
126
|
statuses: ListOfDataStatuses = FULL_DATA_STATUSES,
|
|
98
127
|
use_cache: bool = True,
|
|
128
|
+
expand: OptListOfExpandableFields = None,
|
|
99
129
|
) -> "ReadSingleParameter":
|
|
100
|
-
return cls(
|
|
130
|
+
return cls(
|
|
131
|
+
identifier=identifier, statuses=statuses, use_cache=use_cache, expand=expand
|
|
132
|
+
)
|
|
101
133
|
|
|
102
134
|
@overload
|
|
103
135
|
@classmethod
|
|
@@ -107,6 +139,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserOrganizationRoleIdentifier
|
|
|
107
139
|
identifier_value: int,
|
|
108
140
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
109
141
|
use_cache: bool = True,
|
|
142
|
+
expand: OptListOfExpandableFields = None,
|
|
110
143
|
) -> "ReadSingleParameter": ...
|
|
111
144
|
@overload
|
|
112
145
|
@classmethod
|
|
@@ -116,6 +149,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserOrganizationRoleIdentifier
|
|
|
116
149
|
identifier_value: UUID,
|
|
117
150
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
118
151
|
use_cache: bool = True,
|
|
152
|
+
expand: OptListOfExpandableFields = None,
|
|
119
153
|
) -> "ReadSingleParameter": ...
|
|
120
154
|
@overload
|
|
121
155
|
@classmethod
|
|
@@ -125,6 +159,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserOrganizationRoleIdentifier
|
|
|
125
159
|
identifier_value: CompositeIdentifierType,
|
|
126
160
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
127
161
|
use_cache: bool = True,
|
|
162
|
+
expand: OptListOfExpandableFields = None,
|
|
128
163
|
) -> "ReadSingleParameter": ...
|
|
129
164
|
@overload
|
|
130
165
|
@classmethod
|
|
@@ -134,6 +169,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserOrganizationRoleIdentifier
|
|
|
134
169
|
identifier_value: IdentifierValueType,
|
|
135
170
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
136
171
|
use_cache: bool = True,
|
|
172
|
+
expand: OptListOfExpandableFields = None,
|
|
137
173
|
) -> "ReadSingleParameter": ...
|
|
138
174
|
@classmethod
|
|
139
175
|
def new(
|
|
@@ -142,6 +178,7 @@ class ReadSingleParameter(BaseReadSingleParameter[UserOrganizationRoleIdentifier
|
|
|
142
178
|
identifier_value: IdentifierValueType,
|
|
143
179
|
statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
|
|
144
180
|
use_cache: bool = True,
|
|
181
|
+
expand: OptListOfExpandableFields = None,
|
|
145
182
|
) -> "ReadSingleParameter":
|
|
146
183
|
return cls(
|
|
147
184
|
identifier=UserOrganizationRoleIdentifier(
|
|
@@ -150,11 +187,12 @@ class ReadSingleParameter(BaseReadSingleParameter[UserOrganizationRoleIdentifier
|
|
|
150
187
|
),
|
|
151
188
|
statuses=statuses,
|
|
152
189
|
use_cache=use_cache,
|
|
190
|
+
expand=expand,
|
|
153
191
|
)
|
|
154
192
|
|
|
155
193
|
def to_query_params(self) -> StrToAnyDict:
|
|
156
194
|
return self.model_dump(
|
|
157
|
-
mode="json", include={"statuses", "use_cache"}, exclude_none=True
|
|
195
|
+
mode="json", include={"statuses", "use_cache", "expand"}, exclude_none=True
|
|
158
196
|
)
|
|
159
197
|
|
|
160
198
|
|
|
@@ -182,6 +220,7 @@ class UpdateDataMixin(BaseModel, Generic[UpdateDataT]):
|
|
|
182
220
|
|
|
183
221
|
|
|
184
222
|
class UpdateParameter(
|
|
223
|
+
Expand,
|
|
185
224
|
UpdateDataMixin[UpdateDataT],
|
|
186
225
|
IdentifierMixin[UserOrganizationRoleIdentifier],
|
|
187
226
|
Generic[UpdateDataT],
|
|
@@ -193,6 +232,7 @@ class UpdateParameter(
|
|
|
193
232
|
identifier_type: Literal[IdentifierType.ID],
|
|
194
233
|
identifier_value: int,
|
|
195
234
|
data: UpdateDataT,
|
|
235
|
+
expand: OptListOfExpandableFields = None,
|
|
196
236
|
) -> "UpdateParameter": ...
|
|
197
237
|
@overload
|
|
198
238
|
@classmethod
|
|
@@ -201,6 +241,7 @@ class UpdateParameter(
|
|
|
201
241
|
identifier_type: Literal[IdentifierType.UUID],
|
|
202
242
|
identifier_value: UUID,
|
|
203
243
|
data: UpdateDataT,
|
|
244
|
+
expand: OptListOfExpandableFields = None,
|
|
204
245
|
) -> "UpdateParameter": ...
|
|
205
246
|
@overload
|
|
206
247
|
@classmethod
|
|
@@ -209,6 +250,7 @@ class UpdateParameter(
|
|
|
209
250
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
210
251
|
identifier_value: CompositeIdentifierType,
|
|
211
252
|
data: UpdateDataT,
|
|
253
|
+
expand: OptListOfExpandableFields = None,
|
|
212
254
|
) -> "UpdateParameter": ...
|
|
213
255
|
@overload
|
|
214
256
|
@classmethod
|
|
@@ -217,6 +259,7 @@ class UpdateParameter(
|
|
|
217
259
|
identifier_type: IdentifierType,
|
|
218
260
|
identifier_value: IdentifierValueType,
|
|
219
261
|
data: UpdateDataT,
|
|
262
|
+
expand: OptListOfExpandableFields = None,
|
|
220
263
|
) -> "UpdateParameter": ...
|
|
221
264
|
@classmethod
|
|
222
265
|
def new(
|
|
@@ -224,16 +267,19 @@ class UpdateParameter(
|
|
|
224
267
|
identifier_type: IdentifierType,
|
|
225
268
|
identifier_value: IdentifierValueType,
|
|
226
269
|
data: UpdateDataT,
|
|
270
|
+
expand: OptListOfExpandableFields = None,
|
|
227
271
|
) -> "UpdateParameter":
|
|
228
272
|
return cls(
|
|
229
273
|
identifier=UserOrganizationRoleIdentifier(
|
|
230
274
|
type=identifier_type, value=identifier_value
|
|
231
275
|
),
|
|
232
276
|
data=data,
|
|
277
|
+
expand=expand,
|
|
233
278
|
)
|
|
234
279
|
|
|
235
280
|
|
|
236
281
|
class StatusUpdateParameter(
|
|
282
|
+
Expand,
|
|
237
283
|
BaseStatusUpdateParameter[UserOrganizationRoleIdentifier],
|
|
238
284
|
):
|
|
239
285
|
@overload
|
|
@@ -243,6 +289,7 @@ class StatusUpdateParameter(
|
|
|
243
289
|
identifier_type: Literal[IdentifierType.ID],
|
|
244
290
|
identifier_value: int,
|
|
245
291
|
type: ResourceOperationStatusUpdateType,
|
|
292
|
+
expand: OptListOfExpandableFields = None,
|
|
246
293
|
) -> "StatusUpdateParameter": ...
|
|
247
294
|
@overload
|
|
248
295
|
@classmethod
|
|
@@ -251,6 +298,7 @@ class StatusUpdateParameter(
|
|
|
251
298
|
identifier_type: Literal[IdentifierType.UUID],
|
|
252
299
|
identifier_value: UUID,
|
|
253
300
|
type: ResourceOperationStatusUpdateType,
|
|
301
|
+
expand: OptListOfExpandableFields = None,
|
|
254
302
|
) -> "StatusUpdateParameter": ...
|
|
255
303
|
@overload
|
|
256
304
|
@classmethod
|
|
@@ -259,6 +307,7 @@ class StatusUpdateParameter(
|
|
|
259
307
|
identifier_type: Literal[IdentifierType.COMPOSITE],
|
|
260
308
|
identifier_value: CompositeIdentifierType,
|
|
261
309
|
type: ResourceOperationStatusUpdateType,
|
|
310
|
+
expand: OptListOfExpandableFields = None,
|
|
262
311
|
) -> "StatusUpdateParameter": ...
|
|
263
312
|
@overload
|
|
264
313
|
@classmethod
|
|
@@ -267,6 +316,7 @@ class StatusUpdateParameter(
|
|
|
267
316
|
identifier_type: IdentifierType,
|
|
268
317
|
identifier_value: IdentifierValueType,
|
|
269
318
|
type: ResourceOperationStatusUpdateType,
|
|
319
|
+
expand: OptListOfExpandableFields = None,
|
|
270
320
|
) -> "StatusUpdateParameter": ...
|
|
271
321
|
@classmethod
|
|
272
322
|
def new(
|
|
@@ -274,12 +324,14 @@ class StatusUpdateParameter(
|
|
|
274
324
|
identifier_type: IdentifierType,
|
|
275
325
|
identifier_value: IdentifierValueType,
|
|
276
326
|
type: ResourceOperationStatusUpdateType,
|
|
327
|
+
expand: OptListOfExpandableFields = None,
|
|
277
328
|
) -> "StatusUpdateParameter":
|
|
278
329
|
return cls(
|
|
279
330
|
identifier=UserOrganizationRoleIdentifier(
|
|
280
331
|
type=identifier_type, value=identifier_value
|
|
281
332
|
),
|
|
282
333
|
type=type,
|
|
334
|
+
expand=expand,
|
|
283
335
|
)
|
|
284
336
|
|
|
285
337
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from pydantic import BaseModel, Field
|
|
2
2
|
from typing import Annotated, Generic, Literal, TypeVar, overload
|
|
3
3
|
from uuid import UUID
|
|
4
|
-
from
|
|
4
|
+
from nexo.enums.identity import (
|
|
5
5
|
OptBloodType,
|
|
6
6
|
BloodTypeMixin,
|
|
7
7
|
OptListOfBloodTypes,
|
|
@@ -11,12 +11,12 @@ from maleo.enums.identity import (
|
|
|
11
11
|
OptListOfGenders,
|
|
12
12
|
GendersMixin,
|
|
13
13
|
)
|
|
14
|
-
from
|
|
14
|
+
from nexo.enums.status import (
|
|
15
15
|
ListOfDataStatuses,
|
|
16
16
|
FULL_DATA_STATUSES,
|
|
17
17
|
)
|
|
18
|
-
from
|
|
19
|
-
from
|
|
18
|
+
from nexo.schemas.mixins.filter import convert as convert_filter
|
|
19
|
+
from nexo.schemas.mixins.identity import (
|
|
20
20
|
IdentifierMixin,
|
|
21
21
|
Ids,
|
|
22
22
|
UUIDs,
|
|
@@ -24,23 +24,22 @@ from maleo.schemas.mixins.identity import (
|
|
|
24
24
|
IntUserIds,
|
|
25
25
|
BirthDate,
|
|
26
26
|
)
|
|
27
|
-
from
|
|
28
|
-
from
|
|
29
|
-
from
|
|
27
|
+
from nexo.schemas.mixins.sort import convert as convert_sort
|
|
28
|
+
from nexo.schemas.operation.enums import ResourceOperationStatusUpdateType
|
|
29
|
+
from nexo.schemas.parameter import (
|
|
30
30
|
ReadSingleParameter as BaseReadSingleParameter,
|
|
31
31
|
ReadPaginatedMultipleParameter,
|
|
32
32
|
StatusUpdateParameter as BaseStatusUpdateParameter,
|
|
33
33
|
DeleteSingleParameter as BaseDeleteSingleParameter,
|
|
34
34
|
)
|
|
35
|
-
from
|
|
36
|
-
from
|
|
37
|
-
from
|
|
38
|
-
from
|
|
39
|
-
from
|
|
35
|
+
from nexo.types.datetime import OptDate
|
|
36
|
+
from nexo.types.dict import StrToAnyDict
|
|
37
|
+
from nexo.types.integer import OptListOfInts
|
|
38
|
+
from nexo.types.string import OptStr
|
|
39
|
+
from nexo.types.uuid import OptListOfUUIDs
|
|
40
40
|
from ..enums.user_profile import IdentifierType, OptListOfExpandableFields
|
|
41
41
|
from ..mixins.common import (
|
|
42
42
|
IdCard,
|
|
43
|
-
FullName,
|
|
44
43
|
BirthPlace,
|
|
45
44
|
)
|
|
46
45
|
from ..mixins.user_profile import (
|
|
@@ -56,34 +55,24 @@ from ..mixins.user_profile import (
|
|
|
56
55
|
from ..types.user_profile import IdentifierValueType
|
|
57
56
|
|
|
58
57
|
|
|
59
|
-
class
|
|
58
|
+
class CreateParameter(
|
|
59
|
+
Expand,
|
|
60
60
|
AvatarMixin,
|
|
61
61
|
BloodTypeMixin[OptBloodType],
|
|
62
62
|
GenderMixin[OptGender],
|
|
63
63
|
BirthDate[OptDate],
|
|
64
64
|
BirthPlace[OptStr],
|
|
65
|
-
FullName[str],
|
|
66
65
|
EndingTitle[OptStr],
|
|
67
66
|
LastName[str],
|
|
68
67
|
MiddleName[OptStr],
|
|
69
68
|
FirstName[str],
|
|
70
69
|
LeadingTitle[OptStr],
|
|
71
70
|
IdCard[OptStr],
|
|
72
|
-
):
|
|
73
|
-
pass
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
class FullCreateData(
|
|
77
|
-
StandardCreateData,
|
|
78
71
|
IntUserId[int],
|
|
79
72
|
):
|
|
80
73
|
pass
|
|
81
74
|
|
|
82
75
|
|
|
83
|
-
class CreateParameter(Expand, FullCreateData):
|
|
84
|
-
pass
|
|
85
|
-
|
|
86
|
-
|
|
87
76
|
class ReadMultipleParameter(
|
|
88
77
|
Expand,
|
|
89
78
|
ReadPaginatedMultipleParameter,
|
|
@@ -201,7 +190,7 @@ class ReadSingleParameter(Expand, BaseReadSingleParameter[UserProfileIdentifier]
|
|
|
201
190
|
|
|
202
191
|
def to_query_params(self) -> StrToAnyDict:
|
|
203
192
|
return self.model_dump(
|
|
204
|
-
mode="json", include={"statuses", "use_cache"}, exclude_none=True
|
|
193
|
+
mode="json", include={"statuses", "use_cache", "expand"}, exclude_none=True
|
|
205
194
|
)
|
|
206
195
|
|
|
207
196
|
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
from pydantic import BaseModel, Field
|
|
2
2
|
from typing import Annotated, Generic, Literal, TypeVar, overload
|
|
3
3
|
from uuid import UUID
|
|
4
|
-
from
|
|
4
|
+
from nexo.enums.system import (
|
|
5
5
|
SystemRole,
|
|
6
6
|
OptSystemRole,
|
|
7
7
|
FullSystemRoleMixin,
|
|
8
8
|
OptListOfSystemRoles,
|
|
9
9
|
FullSystemRolesMixin,
|
|
10
10
|
)
|
|
11
|
-
from
|
|
11
|
+
from nexo.enums.status import (
|
|
12
12
|
ListOfDataStatuses,
|
|
13
13
|
FULL_DATA_STATUSES,
|
|
14
14
|
)
|
|
15
|
-
from
|
|
16
|
-
from
|
|
15
|
+
from nexo.schemas.mixins.filter import convert as convert_filter
|
|
16
|
+
from nexo.schemas.mixins.identity import (
|
|
17
17
|
IdentifierMixin,
|
|
18
18
|
Ids,
|
|
19
19
|
UUIDs,
|
|
20
20
|
IntUserId,
|
|
21
21
|
IntUserIds,
|
|
22
22
|
)
|
|
23
|
-
from
|
|
24
|
-
from
|
|
25
|
-
from
|
|
23
|
+
from nexo.schemas.mixins.sort import convert as convert_sort
|
|
24
|
+
from nexo.schemas.operation.enums import ResourceOperationStatusUpdateType
|
|
25
|
+
from nexo.schemas.parameter import (
|
|
26
26
|
ReadSingleParameter as BaseReadSingleParameter,
|
|
27
27
|
ReadPaginatedMultipleParameter,
|
|
28
28
|
StatusUpdateParameter as BaseStatusUpdateParameter,
|
|
29
29
|
DeleteSingleParameter as BaseDeleteSingleParameter,
|
|
30
30
|
)
|
|
31
|
-
from
|
|
32
|
-
from
|
|
33
|
-
from
|
|
31
|
+
from nexo.types.dict import StrToAnyDict
|
|
32
|
+
from nexo.types.integer import OptInt, OptListOfInts
|
|
33
|
+
from nexo.types.uuid import OptListOfUUIDs
|
|
34
34
|
from ..enums.user_system_role import IdentifierType, OptListOfExpandableFields
|
|
35
35
|
from ..mixins.user_system_role import Expand, UserSystemRoleIdentifier
|
|
36
36
|
from ..types.user_system_role import CompositeIdentifierType, IdentifierValueType
|
maleo/identity/types/api_key.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
from typing import Tuple
|
|
2
2
|
from uuid import UUID
|
|
3
|
-
from
|
|
3
|
+
from nexo.types.integer import OptInt
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
BasicIdentifierType = int | str | UUID
|
|
6
7
|
CompositeIdentifierType = Tuple[int, OptInt]
|
|
7
|
-
IdentifierValueType =
|
|
8
|
+
IdentifierValueType = BasicIdentifierType | CompositeIdentifierType
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from typing import Tuple
|
|
2
2
|
from uuid import UUID
|
|
3
|
-
from
|
|
4
|
-
|
|
3
|
+
from nexo.enums.organization import OrganizationRelation
|
|
5
4
|
|
|
5
|
+
BasicIdentifierType = int | UUID
|
|
6
6
|
CompositeIdentifierType = Tuple[int, int, OrganizationRelation]
|
|
7
|
-
IdentifierValueType =
|
|
7
|
+
IdentifierValueType = BasicIdentifierType | CompositeIdentifierType
|
maleo/identity/types/user.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
from typing import Tuple
|
|
2
2
|
from uuid import UUID
|
|
3
|
-
from
|
|
3
|
+
from nexo.enums.medical import MedicalRole
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
BasicIdentifierType = int | UUID
|
|
6
7
|
CompositeIdentifierType = Tuple[int, int, MedicalRole]
|
|
7
|
-
IdentifierValueType =
|
|
8
|
+
IdentifierValueType = BasicIdentifierType | CompositeIdentifierType
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
from typing import Tuple
|
|
2
2
|
from uuid import UUID
|
|
3
|
-
from
|
|
3
|
+
from nexo.enums.organization import OrganizationRole
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
BasicIdentifierType = int | UUID
|
|
6
7
|
CompositeIdentifierType = Tuple[int, int, OrganizationRole]
|
|
7
|
-
IdentifierValueType =
|
|
8
|
+
IdentifierValueType = BasicIdentifierType | CompositeIdentifierType
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: maleo-identity
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.59
|
|
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.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.
|
|
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
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
maleo/identity/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
maleo/identity/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
maleo/identity/constants/api_key.py,sha256=IPT4qk9hd0g7Plsz8VPCRY6gi8p3jJR6zCRiQLUskYk,261
|
|
4
|
+
maleo/identity/constants/organization.py,sha256=weSP2pJK8gEBUweTQbKzXEjC1wAfOImY8bZEUBsm2qI,256
|
|
5
|
+
maleo/identity/constants/organization_registration_code.py,sha256=nNJFzMzwhBqAIrjVubCR19hbKT59Z2RO9YDtbKP5aeg,353
|
|
6
|
+
maleo/identity/constants/organization_relation.py,sha256=G-J3LsMz9DMi-oQ9ICacgDN4h5rP8kzGhgIwcpaJt_w,317
|
|
7
|
+
maleo/identity/constants/patient.py,sha256=X-9IPESVoO2uzxIquitinSvdQWINEFZ_iTs72BZ_XY8,200
|
|
8
|
+
maleo/identity/constants/user.py,sha256=2zHW0DVSkbfqpOcanKF2-Tcet37uwIx-FOLta4KAlSo,188
|
|
9
|
+
maleo/identity/constants/user_medical_role.py,sha256=py97sjQQJPlsXpErcet9rxF-9DiTBcUtJ2gxxZTYDgU,301
|
|
10
|
+
maleo/identity/constants/user_organization.py,sha256=xFVK_hoHMN9EQgzOa26rGfOPpOjP2hxxLOBzQlmrP4M,301
|
|
11
|
+
maleo/identity/constants/user_organization_role.py,sha256=OxMlGMkY9EctobdX1BvATHPm4T-z5GZkesjYA7YtRp8,321
|
|
12
|
+
maleo/identity/constants/user_profile.py,sha256=sVfeeDZJSfcy2zB33hqpvbln-OfjCw6QzoiYs8ziYV8,457
|
|
13
|
+
maleo/identity/constants/user_system_role.py,sha256=4vpNn3imirQHNn-tXTXkldUF5qY_aZVRNLTKnw6KAeQ,398
|
|
14
|
+
maleo/identity/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
+
maleo/identity/enums/api_key.py,sha256=M8bEQCXQ9PUcLxFk9HWuRcXod0nMgRxW0GZwI5AksL4,720
|
|
16
|
+
maleo/identity/enums/organization.py,sha256=gllSMsl4M3F1KUlqmJmDylhC8tz8oYj0VcAZB4DMFEE,630
|
|
17
|
+
maleo/identity/enums/organization_registration_code.py,sha256=zQcmywtJGqpHYh-0lomYdlhwbfPcWUwpfm5OEwqzX_E,351
|
|
18
|
+
maleo/identity/enums/organization_relation.py,sha256=Mf4WXbzfH2E54BRmPEBLAyn5ErbsV5L6GkIXVdcQCZM,948
|
|
19
|
+
maleo/identity/enums/patient.py,sha256=n368TQouADrfLFfA6ciDO3GrHixf2EtUpJfwjZ1ujRA,622
|
|
20
|
+
maleo/identity/enums/user.py,sha256=iAa9V52u2wkoNGonss1nK3L5pTK7SmGsVz_11Eze9Gk,862
|
|
21
|
+
maleo/identity/enums/user_medical_role.py,sha256=yOiWjNvyHHEG6g_X6BAfHeg16t3yviv_YJ6SDmEkKHc,946
|
|
22
|
+
maleo/identity/enums/user_organization.py,sha256=qvY_8NfBawftgAno3IVHc8BR1bBUL_RIMU9KTei8ehA,1098
|
|
23
|
+
maleo/identity/enums/user_organization_role.py,sha256=KkOq8qngXaPqkzWt8ezUOaYoCfjd8RZIllETihk2pZw,961
|
|
24
|
+
maleo/identity/enums/user_profile.py,sha256=7CtBujNG0KeTaf-JfTu7CD3oy7Ti1NMKuUcyG_Gjmfc,670
|
|
25
|
+
maleo/identity/enums/user_system_role.py,sha256=ADWEov14uciKRcJt9rAUGl56hEqXcnhd2SpdVUvjIsY,924
|
|
26
|
+
maleo/identity/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
27
|
+
maleo/identity/mixins/api_key.py,sha256=quVojC0VZbAdXOYeoCogNWEUBcFIoIofdEFEkc7WmpM,2867
|
|
28
|
+
maleo/identity/mixins/common.py,sha256=wMQ8QvutdFMeg6FJN2xNVb4OP56OH7-LQ8N-cM3A-uE,903
|
|
29
|
+
maleo/identity/mixins/organization.py,sha256=iaNGjk3cWxN-OxWAAgz1qacEXvKBMH8riw3p05q81Xg,2723
|
|
30
|
+
maleo/identity/mixins/organization_registration_code.py,sha256=9UAlzrYPVSYWJ1-qvt8HTI11ozxE4swfjT7AY5XTXJU,4689
|
|
31
|
+
maleo/identity/mixins/organization_relation.py,sha256=XtlE6AYtQKOBoNZJ2S5k87tzNW4jA4rvtTgzNxdIsyk,3046
|
|
32
|
+
maleo/identity/mixins/patient.py,sha256=t3i7xmRCccidUu4CDdeeSjFjPJik8v6wMlroJOq64B4,2191
|
|
33
|
+
maleo/identity/mixins/user.py,sha256=H7fUfs1aF6uMK34EZPfDPAncmEXoywpuZR-hEYS3MlQ,3705
|
|
34
|
+
maleo/identity/mixins/user_medical_role.py,sha256=ow4TH514peow8KYQeKEid0VL1TYg26ptFZSBdBZTc-g,2599
|
|
35
|
+
maleo/identity/mixins/user_organization.py,sha256=30j7zmaT_Mo7zAdmVK7OY2KpQhBTpyLYCEMHwKKerF8,2614
|
|
36
|
+
maleo/identity/mixins/user_organization_role.py,sha256=J6OshfHkk0SP7DY-A_guyM5ksfhFIUuLa80-N2ErV80,2690
|
|
37
|
+
maleo/identity/mixins/user_profile.py,sha256=gWIem_tp3JrU4UI-PWy7ZPKRqqKR6M4wuNQHM_7tP2o,4366
|
|
38
|
+
maleo/identity/mixins/user_system_role.py,sha256=ORyNHlumoOS8ctDkDiip4QE1Ak0YKiDcQWfkG5ueAew,2582
|
|
39
|
+
maleo/identity/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
|
+
maleo/identity/schemas/api_key.py,sha256=R1fl_q1t-WfOYEtj3txbAnxuCuZrn9GPOevycfnQFXM,5814
|
|
41
|
+
maleo/identity/schemas/common.py,sha256=jS1vu7qnYBuUaMI_P9SfjirStyunBDcVVca4wfB9Foo,7807
|
|
42
|
+
maleo/identity/schemas/organization.py,sha256=DkqGaL99ruttm3m51v6NpCAB2b_eGXQHyQi7Rt-AkT4,10542
|
|
43
|
+
maleo/identity/schemas/organization_registration_code.py,sha256=7oY4z7ie3BuZETTuqgkox7pVXS6--78096k9suEs1fc,9181
|
|
44
|
+
maleo/identity/schemas/organization_relation.py,sha256=QPBt385OH6u0ze1YlWnfx55oHMixYi1ddS7IKGDlfJI,11103
|
|
45
|
+
maleo/identity/schemas/patient.py,sha256=SCVT52CnFeovwYUAXE3ej0MC7uR2JokHKS5aymtVoGI,10210
|
|
46
|
+
maleo/identity/schemas/user.py,sha256=civFUwnIGQ5CUXPRQdgcb8d-FICU_kc0BHKjuoHK1uE,12120
|
|
47
|
+
maleo/identity/schemas/user_medical_role.py,sha256=YHOEHUF8bbzWzJN-hPMHERj_8slU9CQli1clvT1hBwE,10672
|
|
48
|
+
maleo/identity/schemas/user_organization.py,sha256=8sgIfyJyemx-Dd7BKM8iLV8Z1ahRGXKwbc_AGHojLeE,9943
|
|
49
|
+
maleo/identity/schemas/user_organization_role.py,sha256=Wao32vAEgXnaJsRec_bSu-SgAwKmTZb_kmtIKDV0VYw,10880
|
|
50
|
+
maleo/identity/schemas/user_profile.py,sha256=jgg4JCzTXhyr876KOq3zwLiK8k75ywZz1wEsY9MmPwM,11023
|
|
51
|
+
maleo/identity/schemas/user_system_role.py,sha256=R1FDLURVQ97g5L0eTVxsd04SUytlWi8Jm1hMZYtzdC4,10085
|
|
52
|
+
maleo/identity/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
|
+
maleo/identity/types/api_key.py,sha256=52iGy7nb8iaTsyqZ1HjY-bZq3JY0aGjPUI0Wy4sM6Tw,239
|
|
54
|
+
maleo/identity/types/organization.py,sha256=uyrEYc4_Mh4YWXDXKsWEFqUi-X8I_Np7ErPQ2JuWCZQ,63
|
|
55
|
+
maleo/identity/types/organization_registration_code.py,sha256=uyrEYc4_Mh4YWXDXKsWEFqUi-X8I_Np7ErPQ2JuWCZQ,63
|
|
56
|
+
maleo/identity/types/organization_relation.py,sha256=AlFBJQOiHgm1sn4LqJlzS2ygYLh3k9O69civK3axqzc,270
|
|
57
|
+
maleo/identity/types/patient.py,sha256=DJ-l-Ft2atX2oMzExo381PTSgdpVCtqBVSxZlmF_pCA,57
|
|
58
|
+
maleo/identity/types/user.py,sha256=uyrEYc4_Mh4YWXDXKsWEFqUi-X8I_Np7ErPQ2JuWCZQ,63
|
|
59
|
+
maleo/identity/types/user_medical_role.py,sha256=NiDeMc2ICGN4PK6aQwnVq4tIW-s1bc6O1hqe5jKTM0w,248
|
|
60
|
+
maleo/identity/types/user_organization.py,sha256=1h6_O5u2SaPS5jCzCC_S9IW2WE_Wr08eCbLPNZhAFUU,192
|
|
61
|
+
maleo/identity/types/user_organization_role.py,sha256=lF7hGByP9GGFFOgzFA1idyS4Jev8kRjsG4dxrjoEY2o,263
|
|
62
|
+
maleo/identity/types/user_profile.py,sha256=uyrEYc4_Mh4YWXDXKsWEFqUi-X8I_Np7ErPQ2JuWCZQ,63
|
|
63
|
+
maleo/identity/types/user_system_role.py,sha256=9vLrrKdVeiJo-mpwyxeBM1aEFZ0RPkZKiGRCZFqE9Ys,240
|
|
64
|
+
maleo_identity-0.1.59.dist-info/licenses/LICENSE,sha256=aftGsecnk7TWVX-7KW94FqK4Syy6YSZ8PZEF7EcIp3M,2621
|
|
65
|
+
maleo_identity-0.1.59.dist-info/METADATA,sha256=ygVL0nDk8W2Z5FggeQzHMzZ6A-ob8cO_MZeCPISQKgo,3607
|
|
66
|
+
maleo_identity-0.1.59.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
67
|
+
maleo_identity-0.1.59.dist-info/top_level.txt,sha256=3Tpd1siVsfYoeI9FEOJNYnffx_shzZ3wsPpTvz5bljc,6
|
|
68
|
+
maleo_identity-0.1.59.dist-info/RECORD,,
|
maleo/identity/utils/__init__.py
DELETED
|
File without changes
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
from typing import Literal, Type, overload
|
|
2
|
-
from ..schemas.common import (
|
|
3
|
-
StandardOrganizationSchema,
|
|
4
|
-
FullOrganizationSchema,
|
|
5
|
-
AnyOrganizationSchemaType,
|
|
6
|
-
)
|
|
7
|
-
from ..enums.organization import Granularity
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@overload
|
|
11
|
-
def get_schema_model(
|
|
12
|
-
granularity: Literal[Granularity.STANDARD],
|
|
13
|
-
/,
|
|
14
|
-
) -> Type[StandardOrganizationSchema]: ...
|
|
15
|
-
@overload
|
|
16
|
-
def get_schema_model(
|
|
17
|
-
granularity: Literal[Granularity.FULL],
|
|
18
|
-
/,
|
|
19
|
-
) -> Type[FullOrganizationSchema]: ...
|
|
20
|
-
@overload
|
|
21
|
-
def get_schema_model(
|
|
22
|
-
granularity: Granularity = Granularity.STANDARD,
|
|
23
|
-
/,
|
|
24
|
-
) -> AnyOrganizationSchemaType: ...
|
|
25
|
-
def get_schema_model(
|
|
26
|
-
granularity: Granularity = Granularity.STANDARD,
|
|
27
|
-
/,
|
|
28
|
-
) -> AnyOrganizationSchemaType:
|
|
29
|
-
if granularity is Granularity.STANDARD:
|
|
30
|
-
return StandardOrganizationSchema
|
|
31
|
-
elif granularity is Granularity.FULL:
|
|
32
|
-
return FullOrganizationSchema
|