tallyfy 1.0.4__py3-none-any.whl → 1.0.6__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 tallyfy might be problematic. Click here for more details.
- tallyfy/__init__.py +8 -4
- tallyfy/core.py +11 -8
- tallyfy/form_fields_management/__init__.py +70 -0
- tallyfy/form_fields_management/base.py +109 -0
- tallyfy/form_fields_management/crud_operations.py +234 -0
- tallyfy/form_fields_management/options_management.py +222 -0
- tallyfy/form_fields_management/suggestions.py +411 -0
- tallyfy/models.py +3 -1
- tallyfy/task_management/__init__.py +81 -0
- tallyfy/task_management/base.py +125 -0
- tallyfy/task_management/creation.py +221 -0
- tallyfy/task_management/retrieval.py +211 -0
- tallyfy/task_management/search.py +196 -0
- tallyfy/template_management/__init__.py +85 -0
- tallyfy/template_management/analysis.py +1093 -0
- tallyfy/template_management/automation.py +469 -0
- tallyfy/template_management/base.py +56 -0
- tallyfy/template_management/basic_operations.py +477 -0
- tallyfy/template_management/health_assessment.py +763 -0
- tallyfy/user_management/__init__.py +69 -0
- tallyfy/user_management/base.py +146 -0
- tallyfy/user_management/invitation.py +286 -0
- tallyfy/user_management/retrieval.py +339 -0
- {tallyfy-1.0.4.dist-info → tallyfy-1.0.6.dist-info}/METADATA +120 -56
- tallyfy-1.0.6.dist-info/RECORD +28 -0
- tallyfy/BUILD.md +0 -5
- tallyfy/form_fields_management.py +0 -582
- tallyfy/task_management.py +0 -356
- tallyfy/template_management.py +0 -2607
- tallyfy/user_management.py +0 -235
- tallyfy-1.0.4.dist-info/RECORD +0 -13
- {tallyfy-1.0.4.dist-info → tallyfy-1.0.6.dist-info}/WHEEL +0 -0
- {tallyfy-1.0.4.dist-info → tallyfy-1.0.6.dist-info}/licenses/LICENSE +0 -0
- {tallyfy-1.0.4.dist-info → tallyfy-1.0.6.dist-info}/top_level.txt +0 -0
tallyfy/user_management.py
DELETED
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
User management functionality for Tallyfy SDK
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
from typing import List, Optional
|
|
6
|
-
from .models import User, Guest, TallyfyError
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class UserManagement:
|
|
10
|
-
"""Handles user and guest management operations"""
|
|
11
|
-
|
|
12
|
-
def __init__(self, sdk):
|
|
13
|
-
self.sdk = sdk
|
|
14
|
-
def get_current_user_info(self, org_id: str) -> Optional[User]:
|
|
15
|
-
"""
|
|
16
|
-
Get current user with full profile data.
|
|
17
|
-
|
|
18
|
-
Args:
|
|
19
|
-
org_id: Organization ID
|
|
20
|
-
|
|
21
|
-
Returns:
|
|
22
|
-
A User object with full profile data
|
|
23
|
-
|
|
24
|
-
Raises:
|
|
25
|
-
TallyfyError: If the request fails
|
|
26
|
-
"""
|
|
27
|
-
try:
|
|
28
|
-
endpoint = f"organizations/{org_id}/me"
|
|
29
|
-
params = {}
|
|
30
|
-
|
|
31
|
-
response_data = self.sdk._make_request('GET', endpoint, params=params)
|
|
32
|
-
|
|
33
|
-
if isinstance(response_data, dict) and 'data' in response_data:
|
|
34
|
-
user_data = response_data['data']
|
|
35
|
-
return User.from_dict(user_data)
|
|
36
|
-
else:
|
|
37
|
-
if isinstance(response_data, list):
|
|
38
|
-
return User.from_dict(response_data['data'])
|
|
39
|
-
else:
|
|
40
|
-
self.sdk.logger.warning("Unexpected response format for getting current user")
|
|
41
|
-
return []
|
|
42
|
-
|
|
43
|
-
except TallyfyError as e:
|
|
44
|
-
self.sdk.logger.error(f"Failed to get organization users for org {org_id}: {e}")
|
|
45
|
-
raise
|
|
46
|
-
def get_organization_users(self, org_id: str, with_groups: bool = False) -> List[User]:
|
|
47
|
-
"""
|
|
48
|
-
Get all organization members with full profile data.
|
|
49
|
-
|
|
50
|
-
Args:
|
|
51
|
-
org_id: Organization ID
|
|
52
|
-
with_groups: Include user groups data
|
|
53
|
-
|
|
54
|
-
Returns:
|
|
55
|
-
List of User objects with full profile data
|
|
56
|
-
|
|
57
|
-
Raises:
|
|
58
|
-
TallyfyError: If the request fails
|
|
59
|
-
"""
|
|
60
|
-
try:
|
|
61
|
-
endpoint = f"organizations/{org_id}/users"
|
|
62
|
-
params = {}
|
|
63
|
-
if with_groups:
|
|
64
|
-
params['with'] = 'groups'
|
|
65
|
-
|
|
66
|
-
response_data = self.sdk._make_request('GET', endpoint, params=params)
|
|
67
|
-
|
|
68
|
-
if isinstance(response_data, dict) and 'data' in response_data:
|
|
69
|
-
users_data = response_data['data']
|
|
70
|
-
return [User.from_dict(user_data) for user_data in users_data]
|
|
71
|
-
else:
|
|
72
|
-
if isinstance(response_data, list):
|
|
73
|
-
return [User.from_dict(user_data) for user_data in response_data]
|
|
74
|
-
else:
|
|
75
|
-
self.sdk.logger.warning("Unexpected response format for users")
|
|
76
|
-
return []
|
|
77
|
-
|
|
78
|
-
except TallyfyError as e:
|
|
79
|
-
self.sdk.logger.error(f"Failed to get organization users for org {org_id}: {e}")
|
|
80
|
-
raise
|
|
81
|
-
|
|
82
|
-
def get_organization_users_list(self, org_id: str) -> List[User]:
|
|
83
|
-
"""
|
|
84
|
-
Get all organization members with minimal data for listing.
|
|
85
|
-
|
|
86
|
-
Args:
|
|
87
|
-
org_id: Organization ID
|
|
88
|
-
|
|
89
|
-
Returns:
|
|
90
|
-
List of User objects with minimal data
|
|
91
|
-
|
|
92
|
-
Raises:
|
|
93
|
-
TallyfyError: If the request fails
|
|
94
|
-
"""
|
|
95
|
-
try:
|
|
96
|
-
endpoint = f"organizations/{org_id}/users-list"
|
|
97
|
-
response_data = self.sdk._make_request('GET', endpoint)
|
|
98
|
-
|
|
99
|
-
if isinstance(response_data, dict) and 'data' in response_data:
|
|
100
|
-
users_data = response_data['data']
|
|
101
|
-
return [User.from_dict(user_data) for user_data in users_data]
|
|
102
|
-
else:
|
|
103
|
-
if isinstance(response_data, list):
|
|
104
|
-
return [User.from_dict(user_data) for user_data in response_data]
|
|
105
|
-
else:
|
|
106
|
-
self.sdk.logger.warning("Unexpected response format for users list")
|
|
107
|
-
return []
|
|
108
|
-
|
|
109
|
-
except TallyfyError as e:
|
|
110
|
-
self.sdk.logger.error(f"Failed to get organization users list for org {org_id}: {e}")
|
|
111
|
-
raise
|
|
112
|
-
|
|
113
|
-
def get_organization_guests(self, org_id: str, with_stats: bool = False) -> List[Guest]:
|
|
114
|
-
"""
|
|
115
|
-
Get all guests in an organization with full profile data.
|
|
116
|
-
|
|
117
|
-
Args:
|
|
118
|
-
org_id: Organization ID
|
|
119
|
-
with_stats: Include guest statistics
|
|
120
|
-
|
|
121
|
-
Returns:
|
|
122
|
-
List of Guest objects with full profile data
|
|
123
|
-
|
|
124
|
-
Raises:
|
|
125
|
-
TallyfyError: If the request fails
|
|
126
|
-
"""
|
|
127
|
-
try:
|
|
128
|
-
endpoint = f"organizations/{org_id}/guests"
|
|
129
|
-
params = {}
|
|
130
|
-
if with_stats:
|
|
131
|
-
params['with'] = 'stats'
|
|
132
|
-
|
|
133
|
-
response_data = self.sdk._make_request('GET', endpoint, params=params)
|
|
134
|
-
|
|
135
|
-
if isinstance(response_data, dict) and 'data' in response_data:
|
|
136
|
-
guests_data = response_data['data']
|
|
137
|
-
return [Guest.from_dict(guest_data) for guest_data in guests_data]
|
|
138
|
-
else:
|
|
139
|
-
if isinstance(response_data, list):
|
|
140
|
-
return [Guest.from_dict(guest_data) for guest_data in response_data]
|
|
141
|
-
else:
|
|
142
|
-
self.sdk.logger.warning("Unexpected response format for guests")
|
|
143
|
-
return []
|
|
144
|
-
|
|
145
|
-
except TallyfyError as e:
|
|
146
|
-
self.sdk.logger.error(f"Failed to get organization guests for org {org_id}: {e}")
|
|
147
|
-
raise
|
|
148
|
-
|
|
149
|
-
def get_organization_guests_list(self, org_id: str) -> List[Guest]:
|
|
150
|
-
"""
|
|
151
|
-
Get organization guests with minimal data.
|
|
152
|
-
|
|
153
|
-
Args:
|
|
154
|
-
org_id: Organization ID
|
|
155
|
-
|
|
156
|
-
Returns:
|
|
157
|
-
List of Guest objects with minimal data
|
|
158
|
-
|
|
159
|
-
Raises:
|
|
160
|
-
TallyfyError: If the request fails
|
|
161
|
-
"""
|
|
162
|
-
try:
|
|
163
|
-
endpoint = f"organizations/{org_id}/guests-list"
|
|
164
|
-
response_data = self.sdk._make_request('GET', endpoint)
|
|
165
|
-
|
|
166
|
-
# Handle different response formats
|
|
167
|
-
if isinstance(response_data, dict) and 'data' in response_data:
|
|
168
|
-
guests_data = response_data['data']
|
|
169
|
-
if isinstance(guests_data, list):
|
|
170
|
-
return [Guest.from_dict(guest_data) for guest_data in guests_data]
|
|
171
|
-
else:
|
|
172
|
-
return [Guest.from_dict(guests_data)]
|
|
173
|
-
elif isinstance(response_data, list):
|
|
174
|
-
# Direct list response
|
|
175
|
-
return [Guest.from_dict(guest_data) for guest_data in response_data]
|
|
176
|
-
else:
|
|
177
|
-
self.sdk.logger.warning("Unexpected response format for guests list")
|
|
178
|
-
return []
|
|
179
|
-
|
|
180
|
-
except TallyfyError as e:
|
|
181
|
-
self.sdk.logger.error(f"Failed to get organization guests list for org {org_id}: {e}")
|
|
182
|
-
raise
|
|
183
|
-
|
|
184
|
-
def invite_user_to_organization(self, org_id: str, email: str, first_name: str, last_name: str, role: str = "light", message: Optional[str] = None) -> Optional[User]:
|
|
185
|
-
"""
|
|
186
|
-
Invite a member to your organization.
|
|
187
|
-
|
|
188
|
-
Args:
|
|
189
|
-
org_id: Organization ID
|
|
190
|
-
email: Email address of the user to invite
|
|
191
|
-
first_name: First name of the user (required)
|
|
192
|
-
last_name: Last name of the user (required)
|
|
193
|
-
role: User role - 'light', 'standard', or 'admin' (default: 'light')
|
|
194
|
-
message: Custom invitation message (optional)
|
|
195
|
-
|
|
196
|
-
Returns:
|
|
197
|
-
User object for the invited user
|
|
198
|
-
|
|
199
|
-
Raises:
|
|
200
|
-
TallyfyError: If the request fails
|
|
201
|
-
ValueError: If role is not valid
|
|
202
|
-
"""
|
|
203
|
-
# Validate role
|
|
204
|
-
valid_roles = ["light", "standard", "admin"]
|
|
205
|
-
if role not in valid_roles:
|
|
206
|
-
raise ValueError(f"Role must be one of: {', '.join(valid_roles)}")
|
|
207
|
-
|
|
208
|
-
try:
|
|
209
|
-
endpoint = f"organizations/{org_id}/users/invite"
|
|
210
|
-
|
|
211
|
-
invite_data = {
|
|
212
|
-
"email": email,
|
|
213
|
-
"first_name": first_name,
|
|
214
|
-
"last_name": last_name,
|
|
215
|
-
"role": role
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
# Add message if provided, otherwise use default
|
|
219
|
-
if message:
|
|
220
|
-
invite_data["message"] = message
|
|
221
|
-
else:
|
|
222
|
-
invite_data["message"] = "Please join Tallyfy - it's going to help us automate tasks between people."
|
|
223
|
-
|
|
224
|
-
response_data = self.sdk._make_request('POST', endpoint, data=invite_data)
|
|
225
|
-
|
|
226
|
-
if isinstance(response_data, dict) and 'data' in response_data:
|
|
227
|
-
user_data = response_data['data']
|
|
228
|
-
return User.from_dict(user_data)
|
|
229
|
-
else:
|
|
230
|
-
self.sdk.logger.warning("Unexpected response format for user invitation")
|
|
231
|
-
return None
|
|
232
|
-
|
|
233
|
-
except TallyfyError as e:
|
|
234
|
-
self.sdk.logger.error(f"Failed to invite user to organization {org_id}: {e}")
|
|
235
|
-
raise
|
tallyfy-1.0.4.dist-info/RECORD
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
tallyfy/BUILD.md,sha256=38Ley-pN-MPfFAsLT98fV0Sz05JHMmcenXyy7P17tZ0,85
|
|
2
|
-
tallyfy/__init__.py,sha256=E4eHCzUwVOD9r3PQBXHdJv0KYPSNe-2lH7h1yKdUHQ8,492
|
|
3
|
-
tallyfy/core.py,sha256=crdfYp8jzB-MFLkUsfelNBzm9DfOyFCnK0neQEhzD4w,16464
|
|
4
|
-
tallyfy/form_fields_management.py,sha256=-ifTFKQuA3pcftKfPAyNCV840DOJPqRvJPsBCDNXbWU,24223
|
|
5
|
-
tallyfy/models.py,sha256=Pmcl3B_zTURnA--E72hpuRi4DHpl6FdWQM84OfPeGqo,38070
|
|
6
|
-
tallyfy/task_management.py,sha256=DIfhbo8qU3DWzuLKBZtwPlFta_D6Ip9HH3PUltr3T2o,14785
|
|
7
|
-
tallyfy/template_management.py,sha256=peYgh4vkhKT5L_782pPzCpJzE18tFQNnIWQ72lyiovU,121138
|
|
8
|
-
tallyfy/user_management.py,sha256=R7L8Nsszm7htvZDRou7C0zQvgFx0pbNmcjHHyWYbl3g,8581
|
|
9
|
-
tallyfy-1.0.4.dist-info/licenses/LICENSE,sha256=8HUsrXnc3l2sZxhPV9Z1gYinq76Q2Ym7ahYJy57QlLc,1063
|
|
10
|
-
tallyfy-1.0.4.dist-info/METADATA,sha256=moIhI0vL6Up4mj06ORZzuYp-kPGuipVtrceMBLMPdVM,23252
|
|
11
|
-
tallyfy-1.0.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
12
|
-
tallyfy-1.0.4.dist-info/top_level.txt,sha256=yIycWbR61EZJD0MYRPwUQjOS2XZw5B5jCWx1IP73KcM,8
|
|
13
|
-
tallyfy-1.0.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|