cc-ampapi 1.2.1__tar.gz → 1.3.0__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.
- {cc_ampapi-1.2.1/cc_ampapi.egg-info → cc_ampapi-1.3.0}/PKG-INFO +1 -1
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/ampapi/__init__.py +2 -2
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/ampapi/base.py +25 -26
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0/cc_ampapi.egg-info}/PKG-INFO +1 -1
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/LICENSE +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/LICENSE-dpy +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/MANIFEST.in +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/README.md +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/ampapi/adsmodule.py +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/ampapi/analytics.py +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/ampapi/bridge.py +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/ampapi/controller.py +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/ampapi/core.py +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/ampapi/dataclass.py +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/ampapi/emailsender.py +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/ampapi/enums.py +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/ampapi/filebackup.py +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/ampapi/filemanager.py +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/ampapi/instance.py +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/ampapi/minecraft.py +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/ampapi/modules.py +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/ampapi/types_.py +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/ampapi/util.py +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/cc_ampapi.egg-info/SOURCES.txt +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/cc_ampapi.egg-info/dependency_links.txt +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/cc_ampapi.egg-info/requires.txt +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/cc_ampapi.egg-info/top_level.txt +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/pyproject.toml +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/requirements.txt +0 -0
- {cc_ampapi-1.2.1 → cc_ampapi-1.3.0}/setup.cfg +0 -0
|
@@ -25,7 +25,7 @@ from __future__ import annotations
|
|
|
25
25
|
__title__ = "CubeCoders AMP API"
|
|
26
26
|
__author__ = "k8thekat"
|
|
27
27
|
__license__ = "GNU"
|
|
28
|
-
__version__ = "1.
|
|
28
|
+
__version__ = "1.3.0"
|
|
29
29
|
__credits__ = "AMP by CubeCoders and associates."
|
|
30
30
|
|
|
31
31
|
from typing import Literal, NamedTuple
|
|
@@ -55,6 +55,6 @@ class VersionInfo(NamedTuple):
|
|
|
55
55
|
releaseLevel: Literal["alpha", "beta", "pre-release", "release", "development"]
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
version_info: VersionInfo = VersionInfo(Major=1, Minor=
|
|
58
|
+
version_info: VersionInfo = VersionInfo(Major=1, Minor=3, Revision=0, releaseLevel="release")
|
|
59
59
|
|
|
60
60
|
del NamedTuple, Literal, VersionInfo
|
|
@@ -344,30 +344,29 @@ class Base:
|
|
|
344
344
|
raise ValueError(
|
|
345
345
|
"Please check your 2 Factor Code, should not contain spaces, escape characters and it must be enclosed in quotes!"
|
|
346
346
|
)
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
self.logger.warning("Core/Login Exception:", exc_info=e)
|
|
347
|
+
try:
|
|
348
|
+
parameters: dict[str, Any] = {
|
|
349
|
+
"username": self._bridge.user,
|
|
350
|
+
"password": self._bridge.password,
|
|
351
|
+
"token": code,
|
|
352
|
+
"rememberMe": True,
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
result: Any = await self._call_api(
|
|
356
|
+
api="Core/Login", parameters=parameters, format_data=True, format_=LoginResults
|
|
357
|
+
)
|
|
358
|
+
if isinstance(result, LoginResults):
|
|
359
|
+
# This is our new sessions table to correlate InstanceID to a sessionID.
|
|
360
|
+
api_session = APISession(id=result.session_id, ttl=datetime.now())
|
|
361
|
+
self._bridge._sessions.update({self.instance_id: api_session})
|
|
362
|
+
return result
|
|
363
|
+
|
|
364
|
+
else:
|
|
365
|
+
self.logger.warning(msg="Failed response from 'API/Core/Login' in <Base>._connect()")
|
|
366
|
+
return result
|
|
367
|
+
|
|
368
|
+
except Exception as e:
|
|
369
|
+
self.logger.warning("Core/Login Exception:", exc_info=e)
|
|
371
370
|
else:
|
|
372
371
|
return
|
|
373
372
|
|
|
@@ -563,8 +562,8 @@ class Base:
|
|
|
563
562
|
if bridge.use_2fa is True:
|
|
564
563
|
if bridge.token == "":
|
|
565
564
|
raise ValueError("You must provide a 2FA Token if you are using 2FA.")
|
|
566
|
-
elif bridge.token.startswith(("'", '"')) is False or bridge.token.endswith(("'", '"')) is False:
|
|
567
|
-
|
|
565
|
+
# elif bridge.token.startswith(("'", '"')) is False or bridge.token.endswith(("'", '"')) is False:
|
|
566
|
+
# raise ValueError("2FA Token must be enclosed in quotes.")
|
|
568
567
|
# Removed starting and ending quotes
|
|
569
568
|
elif len(bridge.token) < 8:
|
|
570
569
|
raise ValueError(
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|