Habiticalib 0.3.4__py3-none-any.whl → 0.3.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.
habiticalib/const.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """Constants for Habiticalib."""
2
2
 
3
- __version__ = "0.3.4"
3
+ __version__ = "0.3.6"
4
4
 
5
5
  DEFAULT_URL = "https://habitica.com/"
6
6
  ASSETS_URL = "https://habitica-assets.s3.amazonaws.com/mobileApp/images/"
habiticalib/types.py CHANGED
@@ -11,6 +11,7 @@ from typing import Any, NotRequired, TypedDict
11
11
  from uuid import UUID
12
12
 
13
13
  from mashumaro import field_options
14
+ from mashumaro.config import BaseConfig
14
15
  from mashumaro.mixins.orjson import DataClassORJSONMixin
15
16
 
16
17
 
@@ -702,17 +703,48 @@ class PushDevicesUser:
702
703
  updatedAt: datetime
703
704
 
704
705
 
706
+ class WebhooksType(StrEnum):
707
+ """Webhook types."""
708
+
709
+ TASK_ACTIVITY = "taskActivity"
710
+ USER_ACTIVITY = "userActivity"
711
+ QUEST_ACTIVITY = "questActivity"
712
+ GROUP_CHAT_RECEIVED = "groupChatReceived"
713
+
714
+
715
+ @dataclass(kw_only=True)
716
+ class WebhooksOptions:
717
+ """Webhooks options data."""
718
+
719
+ created: bool | None = None
720
+ updated: bool | None = None
721
+ deleted: bool | None = None
722
+ scored: bool | None = None
723
+ questStarted: bool | None = None
724
+ questFinished: bool | None = None
725
+ questInvited: bool | None = None
726
+ petHatched: bool | None = None
727
+ mountRaised: bool | None = None
728
+ leveledUp: bool | None = None
729
+ groupId: UUID | None = None
730
+
731
+
705
732
  @dataclass(kw_only=True)
706
733
  class WebhooksUser:
707
734
  """Webhooks user data."""
708
735
 
709
- id: UUID
710
- Type: str = field(metadata=field_options(alias="type"))
711
- label: str
712
- url: str
713
- enabled: bool
714
- failures: int
715
- lastFailureAt: datetime | None
736
+ id: UUID | None = None
737
+ Type: WebhooksType = field(
738
+ metadata=field_options(alias="type"), default=WebhooksType.TASK_ACTIVITY
739
+ )
740
+ url: str | None = None
741
+ enabled: bool = True
742
+ failures: int = 0
743
+ label: str = ""
744
+ options = WebhooksOptions
745
+ lastFailureAt: datetime | None = None
746
+ createdAt: datetime | None = None
747
+ updatedAt: datetime | None = None
716
748
 
717
749
 
718
750
  @dataclass(kw_only=True)
@@ -907,9 +939,14 @@ class Task(TypedDict("Task", {"type": NotRequired[TaskType]}), total=True):
907
939
 
908
940
 
909
941
  @dataclass(kw_only=True)
910
- class TaskData:
942
+ class TaskData(DataClassORJSONMixin):
911
943
  """Task data."""
912
944
 
945
+ class Config(BaseConfig):
946
+ """Configuration for TaskData."""
947
+
948
+ serialize_by_alias = True
949
+
913
950
  challenge: Challenge = field(default_factory=Challenge)
914
951
  group: GroupTask = field(default_factory=GroupTask)
915
952
  Type: TaskType | None = field(default=None, metadata=field_options(alias="type"))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Habiticalib
3
- Version: 0.3.4
3
+ Version: 0.3.6
4
4
  Summary: Asynchronous Python client library for the Habitica API
5
5
  Project-URL: Documentation, https://tr4nt0r.github.io/habiticalib/
6
6
  Project-URL: Source, https://github.com/tr4nt0r/habiticalib
@@ -1,12 +1,12 @@
1
1
  habiticalib/__init__.py,sha256=YDYsEGMIxZftYU9YkNC0tyvJrkxn2lXV8WcVQoOXyvA,2415
2
- habiticalib/const.py,sha256=HP5xKY09-GES72btrXbI0XUFSrCBCqXdn2JPwfOR0vs,2308
2
+ habiticalib/const.py,sha256=MVr38-2gSv2INTDYj9JAZRnIEYZZSkYn5ky6TKHQwQw,2308
3
3
  habiticalib/exceptions.py,sha256=oVFCGbHkVn0UpIKIPZPzXfvzs9US4R05ebdEn6cOpqM,1350
4
4
  habiticalib/ha.py,sha256=rSzrs7ixLJH3ZtOFlcuKV2t1ZndT0VpuPhDsGqorkOs,20757
5
5
  habiticalib/helpers.py,sha256=IRZLYWkDVLI0iVBgBMmvZ6L83KCUl-CnzGhUR_tP6Fg,4576
6
6
  habiticalib/lib.py,sha256=YxnlRwCsSlmrdvVu06TKRa6SgnQj2fh2LY8JM7HRqq8,73610
7
7
  habiticalib/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- habiticalib/types.py,sha256=GS3GOlSY31SrJKcuci__drYewhJpi4jfPmAHapPijrg,43359
9
- habiticalib-0.3.4.dist-info/METADATA,sha256=9DSGPmVo5IqO1hR1Z47oPP1xMiEsiCZpdMT3AGvs448,4207
10
- habiticalib-0.3.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
11
- habiticalib-0.3.4.dist-info/licenses/LICENSE,sha256=oIinIOSJ49l1iVIRI3XGXFWt6SF7a83kEFBAY8ORwNI,1084
12
- habiticalib-0.3.4.dist-info/RECORD,,
8
+ habiticalib/types.py,sha256=oFf70uTTgj1qE9USKwjI5osEApJQ_XInXZ9TDabkfVc,44415
9
+ habiticalib-0.3.6.dist-info/METADATA,sha256=2rGeYZZnO1JKCWfbWkzbHwk_mJKEhelpN-RcvtpYoqA,4207
10
+ habiticalib-0.3.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
11
+ habiticalib-0.3.6.dist-info/licenses/LICENSE,sha256=oIinIOSJ49l1iVIRI3XGXFWt6SF7a83kEFBAY8ORwNI,1084
12
+ habiticalib-0.3.6.dist-info/RECORD,,