maxapi-python 2.4.0__py3-none-any.whl → 2.5.0__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.
- {maxapi_python-2.4.0.dist-info → maxapi_python-2.5.0.dist-info}/METADATA +22 -12
- maxapi_python-2.5.0.dist-info/RECORD +195 -0
- {maxapi_python-2.4.0.dist-info → maxapi_python-2.5.0.dist-info}/WHEEL +1 -1
- pymax/__init__.py +8 -2
- pymax/_data/apk_fingerprints.json +374 -17
- pymax/_data/rootca_ssl_rsa2022.crt +33 -0
- pymax/api/auth/service.py +15 -2
- pymax/api/auth/types.py +3 -0
- pymax/api/bots/payloads.py +8 -0
- pymax/api/bots/service.py +13 -1
- pymax/api/chats/enums.py +1 -0
- pymax/api/chats/payloads.py +21 -1
- pymax/api/chats/service.py +41 -0
- pymax/api/facade.py +2 -0
- pymax/api/messages/__init__.py +1 -1
- pymax/api/messages/enums.py +1 -0
- pymax/api/messages/payloads.py +56 -4
- pymax/api/messages/service.py +405 -27
- pymax/api/response.py +1 -1
- pymax/api/stories/__init__.py +2 -0
- pymax/api/stories/enums.py +19 -0
- pymax/api/stories/payloads.py +64 -0
- pymax/api/stories/service.py +198 -0
- pymax/api/uploads/payloads.py +42 -1
- pymax/api/uploads/service.py +171 -69
- pymax/app.py +39 -8
- pymax/auth/__init__.py +2 -0
- pymax/auth/exceptions.py +9 -0
- pymax/auth/providers.py +6 -2
- pymax/auth/qr.py +11 -1
- pymax/auth/sms.py +11 -1
- pymax/base.py +146 -27
- pymax/client.py +39 -11
- pymax/client_web.py +15 -12
- pymax/config.py +101 -53
- pymax/di/__init__.py +2 -0
- pymax/di/context.py +18 -0
- pymax/di/resolver.py +38 -0
- pymax/dispatch/__init__.py +7 -0
- pymax/dispatch/dispatcher.py +143 -40
- pymax/dispatch/enums.py +1 -0
- pymax/dispatch/mapping.py +23 -3
- pymax/dispatch/middleware.py +32 -0
- pymax/dispatch/resolvers.py +4 -0
- pymax/dispatch/router.py +86 -34
- pymax/files/base.py +58 -1
- pymax/files/video.py +32 -40
- pymax/files/voice.py +18 -4
- pymax/filters/__init__.py +15 -0
- pymax/filters/base.py +218 -0
- pymax/filters/containers/__init__.py +2 -0
- pymax/filters/containers/chat.py +240 -0
- pymax/filters/containers/message.py +147 -0
- pymax/filters/filters.py +211 -0
- pymax/filters/magic.py +13 -0
- pymax/filters/presets.py +88 -0
- pymax/filters/refs.py +56 -0
- pymax/fingerprint/fingerprint.py +5 -22
- pymax/fingerprint/models.py +1 -0
- pymax/formatting/markdown.py +55 -1
- pymax/fsm/__init__.py +3 -0
- pymax/fsm/context.py +30 -0
- pymax/fsm/protocol.py +14 -0
- pymax/fsm/state.py +70 -0
- pymax/fsm/storage.py +151 -0
- pymax/infra/base.py +2 -0
- pymax/infra/bots.py +20 -0
- pymax/infra/chat.py +37 -5
- pymax/infra/message.py +204 -9
- pymax/infra/protocol.py +5 -1
- pymax/infra/stories.py +205 -0
- pymax/integrations/__init__.py +0 -0
- pymax/integrations/dishka.py +109 -0
- pymax/protocol/enums.py +2 -0
- pymax/protocol/tcp/payload.py +0 -2
- pymax/session/__init__.py +1 -1
- pymax/session/models.py +30 -0
- pymax/session/protocol.py +33 -7
- pymax/session/store.py +73 -5
- pymax/transport/tcp.py +11 -3
- pymax/types/domain/__init__.py +23 -1
- pymax/types/domain/attachments/__init__.py +1 -1
- pymax/types/domain/attachments/call.py +7 -1
- pymax/types/domain/attachments/contact.py +3 -3
- pymax/types/domain/attachments/control.py +3 -0
- pymax/types/domain/attachments/enums.py +16 -0
- pymax/types/domain/attachments/keyboards/__init__.py +1 -1
- pymax/types/domain/attachments/keyboards/enums.py +12 -0
- pymax/types/domain/attachments/keyboards/inline.py +74 -3
- pymax/types/domain/attachments/video.py +3 -3
- pymax/types/domain/callback.py +19 -0
- pymax/types/domain/comment.py +24 -0
- pymax/types/domain/enums.py +7 -0
- pymax/types/domain/message.py +158 -9
- pymax/types/domain/story.py +126 -0
- pymax/types/events/reaction.py +28 -4
- pymax/versions/__init__.py +2 -0
- pymax/versions/catalog.py +104 -0
- pymax/versions/exceptions.py +10 -0
- maxapi_python-2.4.0.dist-info/RECORD +0 -161
- {maxapi_python-2.4.0.dist-info → maxapi_python-2.5.0.dist-info}/licenses/LICENSE +0 -0
pymax/api/facade.py
CHANGED
|
@@ -10,6 +10,7 @@ from .chats import ChatService
|
|
|
10
10
|
from .messages import MessageService
|
|
11
11
|
from .self import SelfService
|
|
12
12
|
from .session import SessionService
|
|
13
|
+
from .stories import StoriesService
|
|
13
14
|
from .uploads import UploadService
|
|
14
15
|
from .users import UserService
|
|
15
16
|
|
|
@@ -31,4 +32,5 @@ class ApiFacade:
|
|
|
31
32
|
self.session = SessionService(app)
|
|
32
33
|
self.auth = AuthService(app)
|
|
33
34
|
self.uploads = UploadService(app)
|
|
35
|
+
self.stories = StoriesService(app)
|
|
34
36
|
logger.debug("api facade initialized")
|
pymax/api/messages/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
from .service import MessageService
|
|
1
|
+
from .service import DateTimeUnion, MessageService
|
pymax/api/messages/enums.py
CHANGED
pymax/api/messages/payloads.py
CHANGED
|
@@ -18,6 +18,10 @@ class GetMessagesPayload(CamelModel):
|
|
|
18
18
|
message_ids: list[int]
|
|
19
19
|
|
|
20
20
|
|
|
21
|
+
class GetCommentsPayload(GetMessagesPayload):
|
|
22
|
+
post_id: int
|
|
23
|
+
|
|
24
|
+
|
|
21
25
|
class EditMessagePayload(CamelModel):
|
|
22
26
|
chat_id: int
|
|
23
27
|
message_id: int
|
|
@@ -28,17 +32,27 @@ class EditMessagePayload(CamelModel):
|
|
|
28
32
|
)
|
|
29
33
|
|
|
30
34
|
|
|
35
|
+
class EditCommentPayload(EditMessagePayload):
|
|
36
|
+
post_id: int
|
|
37
|
+
|
|
38
|
+
|
|
31
39
|
class ReplyLink(CamelModel):
|
|
32
40
|
type: str = "REPLY" # TODO: enum?
|
|
33
41
|
message_id: int
|
|
34
42
|
|
|
35
43
|
|
|
44
|
+
class DelayedAttributes(CamelModel):
|
|
45
|
+
time_to_fire: int
|
|
46
|
+
notify_sender: bool
|
|
47
|
+
|
|
48
|
+
|
|
36
49
|
class SendMessagePayloadMessage(CamelModel):
|
|
37
50
|
text: str | None = None
|
|
38
51
|
cid: int
|
|
39
52
|
elements: list[Any]
|
|
40
53
|
attaches: list[AttachPhotoPayload | VideoAttachPayload | AttachFilePayload | Poll]
|
|
41
54
|
link: ReplyLink | None = None
|
|
55
|
+
delayed_attributes: DelayedAttributes | None = None
|
|
42
56
|
|
|
43
57
|
|
|
44
58
|
class SendMessagePayload(CamelModel):
|
|
@@ -47,6 +61,10 @@ class SendMessagePayload(CamelModel):
|
|
|
47
61
|
notify: bool = False
|
|
48
62
|
|
|
49
63
|
|
|
64
|
+
class SendCommentPayload(SendMessagePayload):
|
|
65
|
+
post_id: int
|
|
66
|
+
|
|
67
|
+
|
|
50
68
|
class ForwardLink(CamelModel):
|
|
51
69
|
type: Literal["FORWARD"] = "FORWARD"
|
|
52
70
|
message_id: str
|
|
@@ -80,6 +98,10 @@ class ChatHistoryPayload(CamelModel):
|
|
|
80
98
|
interactive: bool = False
|
|
81
99
|
|
|
82
100
|
|
|
101
|
+
class CommentsHistoryPayload(ChatHistoryPayload):
|
|
102
|
+
post_id: int
|
|
103
|
+
|
|
104
|
+
|
|
83
105
|
class DeleteMessagePayload(CamelModel):
|
|
84
106
|
chat_id: int
|
|
85
107
|
message_ids: list[int]
|
|
@@ -111,24 +133,24 @@ class ReactionInfoPayload(CamelModel):
|
|
|
111
133
|
|
|
112
134
|
class AddReactionPayload(CamelModel):
|
|
113
135
|
chat_id: int
|
|
114
|
-
message_id:
|
|
136
|
+
message_id: int
|
|
115
137
|
reaction: ReactionInfoPayload
|
|
116
138
|
|
|
117
139
|
|
|
118
140
|
class GetReactionsPayload(CamelModel):
|
|
119
141
|
chat_id: int
|
|
120
|
-
message_ids: list[
|
|
142
|
+
message_ids: list[int]
|
|
121
143
|
|
|
122
144
|
|
|
123
145
|
class RemoveReactionPayload(CamelModel):
|
|
124
146
|
chat_id: int
|
|
125
|
-
message_id:
|
|
147
|
+
message_id: int
|
|
126
148
|
|
|
127
149
|
|
|
128
150
|
class ReadMessagesPayload(CamelModel):
|
|
129
151
|
type: ReadAction
|
|
130
152
|
chat_id: int
|
|
131
|
-
message_id:
|
|
153
|
+
message_id: int
|
|
132
154
|
mark: int
|
|
133
155
|
|
|
134
156
|
|
|
@@ -137,3 +159,33 @@ class VotePollPayload(CamelModel):
|
|
|
137
159
|
message_id: int
|
|
138
160
|
poll_id: int
|
|
139
161
|
answers_ids: list[int]
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
class DeleteCommentPayload(DeleteMessagePayload):
|
|
165
|
+
post_id: int
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
class AddCommentReactionPayload(AddReactionPayload):
|
|
169
|
+
post_id: int
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
class RemoveCommentReactionPayload(RemoveReactionPayload):
|
|
173
|
+
post_id: int
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
class SubscribeCommentsPayload(CamelModel):
|
|
177
|
+
chat_id: int
|
|
178
|
+
post_id: int
|
|
179
|
+
subscribe: bool = True
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
class GetCommentsInfoPayload(CamelModel):
|
|
183
|
+
chat_id: int
|
|
184
|
+
post_ids: list[int]
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
class DeleteUserCommentsPayload(CamelModel):
|
|
188
|
+
chat_id: int
|
|
189
|
+
post_id: int
|
|
190
|
+
user_id: int
|
|
191
|
+
message_id: int
|