cc-ampapi 1.1.2__tar.gz → 1.2.1__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.
Files changed (30) hide show
  1. {cc_ampapi-1.1.2/cc_ampapi.egg-info → cc_ampapi-1.2.1}/PKG-INFO +6 -2
  2. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/ampapi/__init__.py +2 -2
  3. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/ampapi/core.py +14 -2
  4. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/ampapi/dataclass.py +1 -2
  5. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/ampapi/minecraft.py +49 -26
  6. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/ampapi/util.py +9 -9
  7. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1/cc_ampapi.egg-info}/PKG-INFO +6 -2
  8. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/cc_ampapi.egg-info/SOURCES.txt +2 -0
  9. cc_ampapi-1.2.1/cc_ampapi.egg-info/requires.txt +3 -0
  10. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/pyproject.toml +1 -1
  11. cc_ampapi-1.2.1/requirements.txt +3 -0
  12. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/LICENSE +0 -0
  13. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/LICENSE-dpy +0 -0
  14. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/MANIFEST.in +0 -0
  15. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/README.md +0 -0
  16. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/ampapi/adsmodule.py +0 -0
  17. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/ampapi/analytics.py +0 -0
  18. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/ampapi/base.py +0 -0
  19. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/ampapi/bridge.py +0 -0
  20. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/ampapi/controller.py +0 -0
  21. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/ampapi/emailsender.py +0 -0
  22. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/ampapi/enums.py +0 -0
  23. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/ampapi/filebackup.py +0 -0
  24. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/ampapi/filemanager.py +0 -0
  25. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/ampapi/instance.py +0 -0
  26. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/ampapi/modules.py +0 -0
  27. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/ampapi/types_.py +0 -0
  28. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/cc_ampapi.egg-info/dependency_links.txt +0 -0
  29. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/cc_ampapi.egg-info/top_level.txt +0 -0
  30. {cc_ampapi-1.1.2 → cc_ampapi-1.2.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: cc-ampapi
3
- Version: 1.1.2
3
+ Version: 1.2.1
4
4
  Summary: A Python wrapper for the AMP API by CubeCoders
5
5
  Author-email: k8thekat <Cadwalladerkatelynn+AMPAPI@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -703,6 +703,10 @@ Requires-Python: >=3.10.0
703
703
  Description-Content-Type: text/markdown
704
704
  License-File: LICENSE
705
705
  License-File: LICENSE-dpy
706
+ Requires-Dist: aiohttp>=3.7.4.post0
707
+ Requires-Dist: dataclass_wizard>=0.22.2
708
+ Requires-Dist: pyotp>=2.6.0
709
+ Dynamic: license-file
706
710
 
707
711
  # AMP API Python
708
712
  ___
@@ -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.1.2"
28
+ __version__ = "1.2.1"
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=1, Revision=2, releaseLevel="release")
58
+ version_info: VersionInfo = VersionInfo(Major=1, Minor=2, Revision=1, releaseLevel="release")
59
59
 
60
60
  del NamedTuple, Literal, VersionInfo
@@ -1067,6 +1067,18 @@ class Core(Base):
1067
1067
  result: Any = await self._call_api(api="Core/GetNewGuid", format_data=format_data)
1068
1068
  return result
1069
1069
 
1070
+ async def get_oidc_login_url(self) -> None:
1071
+ """
1072
+ Interacts with OIDC credentials.
1073
+
1074
+ Returns
1075
+ --------
1076
+ None
1077
+ """
1078
+ await self._connect()
1079
+ await self._call_api(api="Core/GetOIDCLoginURL", _no_data=True)
1080
+ return
1081
+
1070
1082
  async def get_permissions_spec(self) -> list[PermissionNode]:
1071
1083
  """|coro|
1072
1084
 
@@ -1450,7 +1462,7 @@ class Core(Base):
1450
1462
  Parameters
1451
1463
  -----------
1452
1464
  user_id: :class:`str`
1453
- The Application User id. See :meth:`get_user_list`
1465
+ The Application User id. See :meth:`get_user_list`.
1454
1466
  format_data: Union[:class:`bool`, None], optional
1455
1467
  Format the JSON response data, by default None.
1456
1468
 
@@ -1468,7 +1480,7 @@ class Core(Base):
1468
1480
  return result
1469
1481
 
1470
1482
  async def get_user_list(self, format_data: Union[bool, None] = None) -> Players:
1471
- """|coro|Players
1483
+ """|coro|
1472
1484
 
1473
1485
  Returns the list of the connected users to the Application.
1474
1486
 
@@ -1377,8 +1377,7 @@ class Instance:
1377
1377
  def __repr__(self) -> str:
1378
1378
  res: str = f"Type: {type(self)} | ID: {id(self)}\n"
1379
1379
  res += f"Name: {self.instance_name}\nInstance ID: {self.instance_id}\n"
1380
- res += f"Application State: {self.app_state.name}\nInstance Running: {self.running}\nModule: {self.module}\nPort: {self.port}"
1381
- res += "\n"
1380
+ res += f"Application State: {self.app_state.name}\nInstance Running: {self.running}\nModule: {self.module}\nPort: {self.port}\n"
1382
1381
  return res
1383
1382
 
1384
1383
  @staticmethod
@@ -6,7 +6,6 @@ from typing import TYPE_CHECKING, Any, Union
6
6
  from .base import Base
7
7
  from .dataclass import ActionResult, BukkitPlugin, MCUser, OPList, OPWhitelist, RunningTask
8
8
 
9
-
10
9
  if TYPE_CHECKING:
11
10
  from collections.abc import Callable, Coroutine
12
11
  from typing import Concatenate
@@ -52,7 +51,8 @@ class MinecraftModule(Base):
52
51
 
53
52
  @mc_only
54
53
  async def mc_accept_eula(self) -> bool:
55
- """
54
+ """|coro|
55
+
56
56
  Accept the EULA summary.
57
57
 
58
58
  Returns
@@ -67,7 +67,8 @@ class MinecraftModule(Base):
67
67
 
68
68
  @mc_only
69
69
  async def mc_add_op_entry(self, user_or_uuid: str, format_data: Union[bool, None] = None) -> ActionResult:
70
- """
70
+ """|coro|
71
+
71
72
  Add an entry to the OP list.
72
73
 
73
74
  Parameters
@@ -91,7 +92,8 @@ class MinecraftModule(Base):
91
92
 
92
93
  @mc_only
93
94
  async def mc_add_to_whitelist(self, user_or_uuid: str, format_data: Union[bool, None] = None) -> ActionResult:
94
- """
95
+ """|coro|
96
+
95
97
  Add a user to the whitelist.
96
98
 
97
99
  Parameters
@@ -114,7 +116,8 @@ class MinecraftModule(Base):
114
116
 
115
117
  @mc_only
116
118
  async def mc_buk_get_categories(self) -> list[BukkitCategories]:
117
- """
119
+ """|coro|
120
+
118
121
  Get Bukkit categories.
119
122
 
120
123
  .. note::
@@ -133,7 +136,8 @@ class MinecraftModule(Base):
133
136
 
134
137
  @mc_only
135
138
  async def mc_buk_get_installed_plugins(self, format_data: Union[bool, None] = None) -> list[BukkitPlugin]:
136
- """
139
+ """|coro|
140
+
137
141
  Get Bukkit installed plugins.
138
142
 
139
143
  Parameters
@@ -155,7 +159,8 @@ class MinecraftModule(Base):
155
159
 
156
160
  @mc_only
157
161
  async def mc_buk_get_install_update_plugin(self, plugin_id: int, format_data: Union[bool, None] = None) -> RunningTask:
158
- """
162
+ """|coro|
163
+
159
164
  Get update for Bukkit plugin.
160
165
 
161
166
  Parameters
@@ -183,7 +188,8 @@ class MinecraftModule(Base):
183
188
 
184
189
  @mc_only
185
190
  async def mc_buk_get_plugin_info(self, plugin_id: int, format_data: Union[bool, None] = None) -> Any:
186
- """
191
+ """|coro|
192
+
187
193
  Get Bukkit plugin info.
188
194
 
189
195
 
@@ -211,7 +217,8 @@ class MinecraftModule(Base):
211
217
  async def mc_buk_get_plugins_for_category(
212
218
  self, category_id: str, page_number: int = 1, page_size: int = 10, format_data: Union[bool, None] = None
213
219
  ) -> list[BukkitPlugin]:
214
- """
220
+ """|coro|
221
+
215
222
  Get Bukkit plugins from category.
216
223
 
217
224
  Parameters
@@ -245,7 +252,8 @@ class MinecraftModule(Base):
245
252
 
246
253
  @mc_only
247
254
  async def mc_buk_get_popular_plugins(self, format_data: Union[bool, None] = None) -> list[BukkitPlugin]:
248
- """
255
+ """|coro|
256
+
249
257
  Get Bukkit popular plugins.
250
258
 
251
259
  Parameters
@@ -267,7 +275,8 @@ class MinecraftModule(Base):
267
275
 
268
276
  @mc_only
269
277
  async def mc_buk_get_remove_plugin(self, plugin_id: int) -> None:
270
- """
278
+ """|coro|
279
+
271
280
  Remove Bukkit plugin.
272
281
 
273
282
  Parameters
@@ -289,7 +298,8 @@ class MinecraftModule(Base):
289
298
  async def mc_buk_get_search(
290
299
  self, query: str, page_number: int = 0, page_size: int = 10, format_data: Union[bool, None] = None
291
300
  ) -> list[BukkitPlugin]:
292
- """
301
+ """|coro|
302
+
293
303
  Search for Bukkit plugins.
294
304
 
295
305
  Parameters
@@ -318,7 +328,8 @@ class MinecraftModule(Base):
318
328
 
319
329
  @mc_only
320
330
  async def mc_ban_user_by_id(self, user_id: str) -> None:
321
- """
331
+ """|coro|
332
+
322
333
  Ban the specified Minecraft UUID.
323
334
 
324
335
  .. note::
@@ -342,7 +353,8 @@ class MinecraftModule(Base):
342
353
 
343
354
  @mc_only
344
355
  async def mc_clear_inventory_by_id(self, user_id: str) -> None:
345
- """
356
+ """|coro|
357
+
346
358
  Clear a players inventory.
347
359
 
348
360
  .. note::
@@ -366,7 +378,8 @@ class MinecraftModule(Base):
366
378
 
367
379
  @mc_only
368
380
  async def mc_get_failure_reason(self) -> str:
369
- """
381
+ """|coro|
382
+
370
383
  Get the Server failure reason, if any.
371
384
 
372
385
  Returns
@@ -381,7 +394,8 @@ class MinecraftModule(Base):
381
394
 
382
395
  @mc_only
383
396
  async def mc_get_head_by_uuid(self, user_id: str) -> str:
384
- """
397
+ """|coro|
398
+
385
399
  Get a skin as a base64 string.
386
400
 
387
401
  .. note::
@@ -406,7 +420,8 @@ class MinecraftModule(Base):
406
420
 
407
421
  @mc_only
408
422
  async def mc_get_op_whitelist(self, format_data: Union[bool, None] = None) -> OPWhitelist:
409
- """
423
+ """|coro|
424
+
410
425
  Get the OP whitelist.
411
426
 
412
427
  Parameters
@@ -428,7 +443,8 @@ class MinecraftModule(Base):
428
443
 
429
444
  @mc_only
430
445
  async def mc_get_whitelist(self, format_data: Union[bool, None] = None) -> list[MCUser]:
431
- """
446
+ """|coro|
447
+
432
448
  Get the whitelist.
433
449
 
434
450
  Parameters
@@ -436,8 +452,9 @@ class MinecraftModule(Base):
436
452
  format_data: Union[:class:`bool`, None], optional
437
453
  Format the JSON response data, by default None.
438
454
 
439
- Returns:
440
- ---
455
+
456
+ Returns
457
+ --------
441
458
  list[:class:`MCUser`]
442
459
  On success returns a list of :class:`MCUser` dataclasses.
443
460
  """
@@ -448,7 +465,8 @@ class MinecraftModule(Base):
448
465
 
449
466
  @mc_only
450
467
  async def mc_kick_user_by_id(self, user_id: str) -> None:
451
- """
468
+ """|coro|
469
+
452
470
  Kick the specified Minecraft Users UUID.
453
471
 
454
472
  .. note::
@@ -472,7 +490,8 @@ class MinecraftModule(Base):
472
490
 
473
491
  @mc_only
474
492
  async def mc_kill_by_id(self, user_id: str) -> None:
475
- """
493
+ """|coro|
494
+
476
495
  Kill the Minecraft player.
477
496
 
478
497
  .. note::
@@ -496,7 +515,8 @@ class MinecraftModule(Base):
496
515
 
497
516
  @mc_only
498
517
  async def mc_load_op_list(self, format_data: Union[bool, None] = None) -> list[OPList]:
499
- """
518
+ """|coro|
519
+
500
520
  Get the OP list.
501
521
 
502
522
  Parameters
@@ -516,7 +536,8 @@ class MinecraftModule(Base):
516
536
 
517
537
  @mc_only
518
538
  async def mc_remove_op_entry(self, user: str) -> None:
519
- """
539
+ """|coro|
540
+
520
541
  Remove an entry from the OP list.
521
542
 
522
543
  .. note::
@@ -536,7 +557,8 @@ class MinecraftModule(Base):
536
557
 
537
558
  @mc_only
538
559
  async def mc_remove_whitelist_entry(self, user: str) -> None:
539
- """
560
+ """|coro|
561
+
540
562
  Remove a user from the whitelist.
541
563
 
542
564
  .. note::
@@ -556,7 +578,8 @@ class MinecraftModule(Base):
556
578
 
557
579
  @mc_only
558
580
  async def mc_smite_by_id(self, user_id: str) -> None:
559
- """
581
+ """|coro|
582
+
560
583
  Strike a player with lightning
561
584
 
562
585
  .. note::
@@ -20,11 +20,7 @@ if TYPE_CHECKING:
20
20
 
21
21
  from .controller import AMPADSInstance, AMPControllerInstance, AMPInstance
22
22
  from .dataclass import Diagnostics, Methods, SettingSpec, SettingsSpecParent, Triggers
23
- from .types_ import (
24
- APISpec,
25
- PermissionNode,
26
- ScheduleDataData,
27
- )
23
+ from .types_ import APISpec, PermissionNode, ScheduleDataData
28
24
 
29
25
 
30
26
  # static strings for documentation
@@ -151,6 +147,7 @@ async def _parse_get_api_spec_to_file(
151
147
  file.write(f"INSTANCE TYPE: {instance_type}\n")
152
148
  file.write(f"APP VERSION: {diag_info.application_version}\n")
153
149
  file.write(f"BUILD: {diag_info.build_date}\n\n")
150
+
154
151
  for parent, parent_value in sorted(data.items()):
155
152
  if parent not in parents:
156
153
  parents.append(parent)
@@ -235,10 +232,13 @@ def _permission_node_parse(
235
232
  for children in entry["children"]:
236
233
  # We cheaply ignore them since they always have a "-" in them.
237
234
  if "-" in children["name"]:
238
- new_child: PermissionNode = children["children"][0]
239
- for node in sorted(new_child["children"], key=lambda x: x["name"]):
240
- # Handles formatting our nodes
241
- file.write(f"- Instances.`instance-id`.{node['name']}\n")
235
+ new_child: list[PermissionNode] | PermissionNode = children.get("children", [])
236
+ if len(new_child) > 0:
237
+ new_child = new_child[0]
238
+ for node in sorted(new_child["children"], key=lambda x: x["name"]):
239
+ # Handles formatting our nodes
240
+ file.write(f"- Instances.`instance-id`.{node['name']}\n")
241
+
242
242
  continue
243
243
  else:
244
244
  # Our notes about the prefix characters.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: cc-ampapi
3
- Version: 1.1.2
3
+ Version: 1.2.1
4
4
  Summary: A Python wrapper for the AMP API by CubeCoders
5
5
  Author-email: k8thekat <Cadwalladerkatelynn+AMPAPI@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -703,6 +703,10 @@ Requires-Python: >=3.10.0
703
703
  Description-Content-Type: text/markdown
704
704
  License-File: LICENSE
705
705
  License-File: LICENSE-dpy
706
+ Requires-Dist: aiohttp>=3.7.4.post0
707
+ Requires-Dist: dataclass_wizard>=0.22.2
708
+ Requires-Dist: pyotp>=2.6.0
709
+ Dynamic: license-file
706
710
 
707
711
  # AMP API Python
708
712
  ___
@@ -3,6 +3,7 @@ LICENSE-dpy
3
3
  MANIFEST.in
4
4
  README.md
5
5
  pyproject.toml
6
+ requirements.txt
6
7
  ampapi/__init__.py
7
8
  ampapi/adsmodule.py
8
9
  ampapi/analytics.py
@@ -23,4 +24,5 @@ ampapi/util.py
23
24
  cc_ampapi.egg-info/PKG-INFO
24
25
  cc_ampapi.egg-info/SOURCES.txt
25
26
  cc_ampapi.egg-info/dependency_links.txt
27
+ cc_ampapi.egg-info/requires.txt
26
28
  cc_ampapi.egg-info/top_level.txt
@@ -0,0 +1,3 @@
1
+ aiohttp>=3.7.4.post0
2
+ dataclass_wizard>=0.22.2
3
+ pyotp>=2.6.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "cc-ampapi"
7
- dynamic = ["version"]
7
+ dynamic = ["version", "dependencies"]
8
8
  authors = [
9
9
  { name = "k8thekat", email = "Cadwalladerkatelynn+AMPAPI@gmail.com" },
10
10
  ]
@@ -0,0 +1,3 @@
1
+ aiohttp>=3.7.4.post0
2
+ dataclass_wizard>=0.22.2
3
+ pyotp>=2.6.0
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