muster-bridge 0.1.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.
- muster_bridge/__init__.py +112 -0
- muster_bridge/app.py +900 -0
- muster_bridge/config.py +335 -0
- muster_bridge/events.py +287 -0
- muster_bridge/mentions.py +73 -0
- muster_bridge/messenger.py +144 -0
- muster_bridge/models.py +443 -0
- muster_bridge/problems.py +273 -0
- muster_bridge/push.py +303 -0
- muster_bridge/py.typed +0 -0
- muster_bridge/store.py +286 -0
- muster_bridge-0.1.0.dist-info/METADATA +277 -0
- muster_bridge-0.1.0.dist-info/RECORD +15 -0
- muster_bridge-0.1.0.dist-info/WHEEL +4 -0
- muster_bridge-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
# Copyright The Muster Authors
|
|
3
|
+
|
|
4
|
+
"""Serve Muster's Bridge protocol, so that a bridge to a messenger is only the calls to that messenger.
|
|
5
|
+
|
|
6
|
+
BridgeApp is an ASGI application that serves api/bridge.yaml for the bots of a Config — tokens, validation,
|
|
7
|
+
idempotency, answers, the events the bridge reports and their pushes — and calls the bridge's Messenger. See the README
|
|
8
|
+
for a quick start.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from muster_bridge.app import BridgeApp, ClosedError
|
|
12
|
+
from muster_bridge.config import Bot, Config, ConfigError, PushTarget
|
|
13
|
+
from muster_bridge.events import InvalidEventError, NotOfferedError, UnknownBotError
|
|
14
|
+
from muster_bridge.mentions import replace_mentions
|
|
15
|
+
from muster_bridge.messenger import (
|
|
16
|
+
Deleter,
|
|
17
|
+
DirectMessenger,
|
|
18
|
+
EventType,
|
|
19
|
+
Messenger,
|
|
20
|
+
ReportedEvent,
|
|
21
|
+
UserFinder,
|
|
22
|
+
idempotency_key,
|
|
23
|
+
)
|
|
24
|
+
from muster_bridge.models import (
|
|
25
|
+
AnswerShownShownAs,
|
|
26
|
+
Button,
|
|
27
|
+
ButtonStyle,
|
|
28
|
+
Capabilities,
|
|
29
|
+
CapabilitiesButtons,
|
|
30
|
+
CapabilitiesDelete,
|
|
31
|
+
CapabilitiesDirectMessages,
|
|
32
|
+
CapabilitiesPrivateAnswer,
|
|
33
|
+
CapabilitiesThreadMessages,
|
|
34
|
+
DirectMessageInput,
|
|
35
|
+
DirectMessageSent,
|
|
36
|
+
InfoEventDelivery,
|
|
37
|
+
InfoUserLookup,
|
|
38
|
+
Limits,
|
|
39
|
+
Link,
|
|
40
|
+
Mention,
|
|
41
|
+
MessageContent,
|
|
42
|
+
MessageEdited,
|
|
43
|
+
MessageInput,
|
|
44
|
+
MessageKind,
|
|
45
|
+
MessagePosted,
|
|
46
|
+
Person,
|
|
47
|
+
Status,
|
|
48
|
+
ThreadReplyInput,
|
|
49
|
+
ThreadReplyPosted,
|
|
50
|
+
)
|
|
51
|
+
from muster_bridge.problems import BridgeError, Forbidden, Gone, Invalid, RateLimited, Transient
|
|
52
|
+
from muster_bridge.store import KeyClaim, KeyState, MemoryStore, Store, StoredAnswer, StoredEvent, UnknownCursorError
|
|
53
|
+
|
|
54
|
+
__version__ = "0.1.0"
|
|
55
|
+
|
|
56
|
+
__all__ = [
|
|
57
|
+
"AnswerShownShownAs",
|
|
58
|
+
"Bot",
|
|
59
|
+
"BridgeApp",
|
|
60
|
+
"BridgeError",
|
|
61
|
+
"Button",
|
|
62
|
+
"ButtonStyle",
|
|
63
|
+
"Capabilities",
|
|
64
|
+
"CapabilitiesButtons",
|
|
65
|
+
"CapabilitiesDelete",
|
|
66
|
+
"CapabilitiesDirectMessages",
|
|
67
|
+
"CapabilitiesPrivateAnswer",
|
|
68
|
+
"CapabilitiesThreadMessages",
|
|
69
|
+
"ClosedError",
|
|
70
|
+
"Config",
|
|
71
|
+
"ConfigError",
|
|
72
|
+
"Deleter",
|
|
73
|
+
"DirectMessageInput",
|
|
74
|
+
"DirectMessageSent",
|
|
75
|
+
"DirectMessenger",
|
|
76
|
+
"EventType",
|
|
77
|
+
"Forbidden",
|
|
78
|
+
"Gone",
|
|
79
|
+
"InfoEventDelivery",
|
|
80
|
+
"InfoUserLookup",
|
|
81
|
+
"Invalid",
|
|
82
|
+
"InvalidEventError",
|
|
83
|
+
"KeyClaim",
|
|
84
|
+
"KeyState",
|
|
85
|
+
"Limits",
|
|
86
|
+
"Link",
|
|
87
|
+
"MemoryStore",
|
|
88
|
+
"Mention",
|
|
89
|
+
"MessageContent",
|
|
90
|
+
"MessageEdited",
|
|
91
|
+
"MessageInput",
|
|
92
|
+
"MessageKind",
|
|
93
|
+
"MessagePosted",
|
|
94
|
+
"Messenger",
|
|
95
|
+
"NotOfferedError",
|
|
96
|
+
"Person",
|
|
97
|
+
"PushTarget",
|
|
98
|
+
"RateLimited",
|
|
99
|
+
"ReportedEvent",
|
|
100
|
+
"Status",
|
|
101
|
+
"Store",
|
|
102
|
+
"StoredAnswer",
|
|
103
|
+
"StoredEvent",
|
|
104
|
+
"ThreadReplyInput",
|
|
105
|
+
"ThreadReplyPosted",
|
|
106
|
+
"Transient",
|
|
107
|
+
"UnknownBotError",
|
|
108
|
+
"UnknownCursorError",
|
|
109
|
+
"UserFinder",
|
|
110
|
+
"idempotency_key",
|
|
111
|
+
"replace_mentions",
|
|
112
|
+
]
|