vc-utils 3.1__tar.gz → 3.3__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.
- {vc_utils-3.1 → vc_utils-3.3}/PKG-INFO +1 -1
- {vc_utils-3.1 → vc_utils-3.3}/linkage/session.py +37 -2
- {vc_utils-3.1 → vc_utils-3.3}/setup.py +1 -1
- {vc_utils-3.1 → vc_utils-3.3}/vc_utils.egg-info/PKG-INFO +1 -1
- {vc_utils-3.1 → vc_utils-3.3}/README.md +0 -0
- {vc_utils-3.1 → vc_utils-3.3}/linkage/__init__.py +0 -0
- {vc_utils-3.1 → vc_utils-3.3}/linkage/achievement.py +0 -0
- {vc_utils-3.1 → vc_utils-3.3}/linkage/key_generator.py +0 -0
- {vc_utils-3.1 → vc_utils-3.3}/setup.cfg +0 -0
- {vc_utils-3.1 → vc_utils-3.3}/vc_utils.egg-info/SOURCES.txt +0 -0
- {vc_utils-3.1 → vc_utils-3.3}/vc_utils.egg-info/dependency_links.txt +0 -0
- {vc_utils-3.1 → vc_utils-3.3}/vc_utils.egg-info/requires.txt +0 -0
- {vc_utils-3.1 → vc_utils-3.3}/vc_utils.egg-info/top_level.txt +0 -0
|
@@ -105,6 +105,18 @@ class Linkage_Application:
|
|
|
105
105
|
|
|
106
106
|
# then invoke the post request with the token
|
|
107
107
|
return await session.post(url, **kwargs)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
async def linkage_patch(self, session, url, **kwargs):
|
|
111
|
+
if not self.token:
|
|
112
|
+
self.token = await application_get_token()
|
|
113
|
+
|
|
114
|
+
headers = kwargs.get("headers", {})
|
|
115
|
+
headers["Authorization"] = f"Bearer {self.token}"
|
|
116
|
+
kwargs["headers"] = headers
|
|
117
|
+
|
|
118
|
+
# then invoke the patch request with the token
|
|
119
|
+
return await session.patch(url, **kwargs)
|
|
108
120
|
|
|
109
121
|
|
|
110
122
|
async def get_user_data(self, session, user_id, spec_id, download_url_expiration=3600):
|
|
@@ -129,6 +141,15 @@ class Linkage_Application:
|
|
|
129
141
|
return await resp.json()
|
|
130
142
|
|
|
131
143
|
|
|
144
|
+
async def request_review_user_data(self, session, user_id, spec_id):
|
|
145
|
+
uri = f"{LINKAGE_M2M_HOST}/data/user/{user_id}/spec/{spec_id}"
|
|
146
|
+
resp = await self.linkage_patch(session, uri)
|
|
147
|
+
if resp.status != 200:
|
|
148
|
+
error_data = await resp.json()
|
|
149
|
+
raise Exception(error_data)
|
|
150
|
+
return await resp.json()
|
|
151
|
+
|
|
152
|
+
|
|
132
153
|
async def update_achievement(self, session, user_id, achievement):
|
|
133
154
|
"""
|
|
134
155
|
POST /achievements/user/{user_id}
|
|
@@ -211,7 +232,21 @@ class Linkage_Application:
|
|
|
211
232
|
achs.append(ach)
|
|
212
233
|
result[user_id] = achs
|
|
213
234
|
return result
|
|
214
|
-
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
async def list_available_bank(self, session, user_id):
|
|
238
|
+
"""
|
|
239
|
+
GET /user/{user_id}/list/banks
|
|
240
|
+
Returns a list of available bank codes for the specified user.
|
|
241
|
+
"""
|
|
242
|
+
# Implement the logic to list available banks for the user
|
|
243
|
+
uri = f"{LINKAGE_M2M_HOST}/user/{user_id}/list/banks"
|
|
244
|
+
resp = await self.linkage_get(session, uri)
|
|
245
|
+
if resp.status != 200:
|
|
246
|
+
error_data = await resp.json()
|
|
247
|
+
raise Exception(error_data)
|
|
248
|
+
return await resp.json()
|
|
249
|
+
|
|
215
250
|
|
|
216
251
|
async def get_user_data(token, spec_id=None):
|
|
217
252
|
if not token:
|
|
@@ -222,7 +257,7 @@ async def get_user_data(token, spec_id=None):
|
|
|
222
257
|
}
|
|
223
258
|
async with aiohttp.ClientSession() as session:
|
|
224
259
|
if spec_id is not None:
|
|
225
|
-
async with session.get(f"{LINKAGE_U2M_HOST}/data/{spec_id}", headers=headers) as resp:
|
|
260
|
+
async with session.get(f"{LINKAGE_U2M_HOST}/data/{spec_id}?auto_request=true", headers=headers) as resp:
|
|
226
261
|
if resp.status != 200:
|
|
227
262
|
error_data = await resp.json()
|
|
228
263
|
raise Exception(error_data)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|