-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
760 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# GENERATED CODE - DO NOT MODIFY | ||
from __future__ import annotations | ||
from chitose.xrpc import XrpcCall | ||
from chitose.xrpc import XrpcSubscribe | ||
from .bsky import Bsky_ | ||
|
||
class Chat_: | ||
"""We recommend calling methods in this class via the :doc:`chitose.BskyAgent <chitose>` class instead of creating instances of this class directly.""" | ||
|
||
def __init__(self, call: XrpcCall, subscribe: XrpcSubscribe) -> None: | ||
self.call = call | ||
self.subscribe = subscribe | ||
|
||
@property | ||
def bsky(self) -> Bsky_: | ||
return Bsky_(self.call, self.subscribe) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# GENERATED CODE - DO NOT MODIFY | ||
from __future__ import annotations | ||
from chitose.xrpc import XrpcCall | ||
from chitose.xrpc import XrpcSubscribe | ||
from .actor import Actor_ | ||
from .convo import Convo_ | ||
from .moderation import Moderation_ | ||
|
||
class Bsky_: | ||
"""We recommend calling methods in this class via the :doc:`chitose.BskyAgent <chitose>` class instead of creating instances of this class directly.""" | ||
|
||
def __init__(self, call: XrpcCall, subscribe: XrpcSubscribe) -> None: | ||
self.call = call | ||
self.subscribe = subscribe | ||
|
||
@property | ||
def actor(self) -> Actor_: | ||
return Actor_(self.call, self.subscribe) | ||
|
||
@property | ||
def convo(self) -> Convo_: | ||
return Convo_(self.call, self.subscribe) | ||
|
||
@property | ||
def moderation(self) -> Moderation_: | ||
return Moderation_(self.call, self.subscribe) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# GENERATED CODE - DO NOT MODIFY | ||
from __future__ import annotations | ||
from chitose.xrpc import XrpcCall | ||
from chitose.xrpc import XrpcSubscribe | ||
from .delete_account import _delete_account | ||
from .export_account_data import _export_account_data | ||
|
||
class Actor_: | ||
"""We recommend calling methods in this class via the :doc:`chitose.BskyAgent <chitose>` class instead of creating instances of this class directly.""" | ||
|
||
def __init__(self, call: XrpcCall, subscribe: XrpcSubscribe) -> None: | ||
self.call = call | ||
self.subscribe = subscribe | ||
|
||
def export_account_data(self) -> bytes: | ||
"""""" | ||
return _export_account_data(self.call) | ||
|
||
def delete_account(self) -> bytes: | ||
"""""" | ||
return _delete_account(self.call) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# GENERATED CODE - DO NOT MODIFY | ||
"""""" | ||
from __future__ import annotations | ||
import chitose | ||
import typing | ||
|
||
class Declaration(chitose.Record): | ||
"""""" | ||
|
||
def __init__(self, allow_incoming: typing.Literal['all', 'none', 'following']) -> None: | ||
self.allow_incoming = allow_incoming | ||
|
||
def to_dict(self) -> dict[str, typing.Any]: | ||
return {'allowIncoming': self.allow_incoming, '$type': 'chat.bsky.actor.declaration'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# GENERATED CODE - DO NOT MODIFY | ||
"""""" | ||
from __future__ import annotations | ||
import chitose | ||
import chitose.app.bsky.actor.defs | ||
import chitose.com.atproto.label.defs | ||
import typing | ||
|
||
class ProfileViewBasic(chitose.Object): | ||
""" | ||
:param chat_disabled: Set to true when the actor cannot actively participate in converations | ||
""" | ||
|
||
def __init__(self, did: str, handle: str, display_name: typing.Optional[str]=None, avatar: typing.Optional[str]=None, associated: typing.Optional[chitose.app.bsky.actor.defs.ProfileAssociated]=None, viewer: typing.Optional[chitose.app.bsky.actor.defs.ViewerState]=None, labels: typing.Optional[list[chitose.com.atproto.label.defs.Label]]=None, chat_disabled: typing.Optional[bool]=None) -> None: | ||
self.did = did | ||
self.handle = handle | ||
self.display_name = display_name | ||
self.avatar = avatar | ||
self.associated = associated | ||
self.viewer = viewer | ||
self.labels = labels | ||
self.chat_disabled = chat_disabled | ||
|
||
def to_dict(self) -> dict[str, typing.Any]: | ||
return {'did': self.did, 'handle': self.handle, 'displayName': self.display_name, 'avatar': self.avatar, 'associated': self.associated, 'viewer': self.viewer, 'labels': self.labels, 'chatDisabled': self.chat_disabled, '$type': 'chat.bsky.actor.defs#profileViewBasic'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# GENERATED CODE - DO NOT MODIFY | ||
"""""" | ||
from __future__ import annotations | ||
import chitose | ||
|
||
def _delete_account(call: chitose.xrpc.XrpcCall) -> bytes: | ||
"""""" | ||
return call('chat.bsky.actor.deleteAccount', [], {}, {}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# GENERATED CODE - DO NOT MODIFY | ||
"""""" | ||
from __future__ import annotations | ||
import chitose | ||
|
||
def _export_account_data(call: chitose.xrpc.XrpcCall) -> bytes: | ||
"""""" | ||
return call('chat.bsky.actor.exportAccountData', [], None, {}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# GENERATED CODE - DO NOT MODIFY | ||
from __future__ import annotations | ||
from chitose.xrpc import XrpcCall | ||
from chitose.xrpc import XrpcSubscribe | ||
from .delete_message_for_self import _delete_message_for_self | ||
from .get_convo import _get_convo | ||
from .get_convo_for_members import _get_convo_for_members | ||
from .get_log import _get_log | ||
from .get_messages import _get_messages | ||
from .leave_convo import _leave_convo | ||
from .list_convos import _list_convos | ||
from .mute_convo import _mute_convo | ||
from .send_message import _send_message | ||
from .send_message_batch import _send_message_batch | ||
from .unmute_convo import _unmute_convo | ||
from .update_read import _update_read | ||
import chitose.chat.bsky.convo.defs | ||
import chitose.chat.bsky.convo.send_message_batch | ||
import typing | ||
|
||
class Convo_: | ||
"""We recommend calling methods in this class via the :doc:`chitose.BskyAgent <chitose>` class instead of creating instances of this class directly.""" | ||
|
||
def __init__(self, call: XrpcCall, subscribe: XrpcSubscribe) -> None: | ||
self.call = call | ||
self.subscribe = subscribe | ||
|
||
def list_convos(self, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes: | ||
"""""" | ||
return _list_convos(self.call, limit, cursor) | ||
|
||
def unmute_convo(self, convo_id: str) -> bytes: | ||
"""""" | ||
return _unmute_convo(self.call, convo_id) | ||
|
||
def get_log(self, cursor: typing.Optional[str]=None) -> bytes: | ||
"""""" | ||
return _get_log(self.call, cursor) | ||
|
||
def send_message(self, convo_id: str, message: chitose.chat.bsky.convo.defs.Message) -> bytes: | ||
"""""" | ||
return _send_message(self.call, convo_id, message) | ||
|
||
def leave_convo(self, convo_id: str) -> bytes: | ||
"""""" | ||
return _leave_convo(self.call, convo_id) | ||
|
||
def mute_convo(self, convo_id: str) -> bytes: | ||
"""""" | ||
return _mute_convo(self.call, convo_id) | ||
|
||
def delete_message_for_self(self, convo_id: str, message_id: str) -> bytes: | ||
"""""" | ||
return _delete_message_for_self(self.call, convo_id, message_id) | ||
|
||
def update_read(self, convo_id: str, message_id: typing.Optional[str]=None) -> bytes: | ||
"""""" | ||
return _update_read(self.call, convo_id, message_id) | ||
|
||
def get_convo(self, convo_id: str) -> bytes: | ||
"""""" | ||
return _get_convo(self.call, convo_id) | ||
|
||
def get_messages(self, convo_id: str, limit: typing.Optional[int]=None, cursor: typing.Optional[str]=None) -> bytes: | ||
"""""" | ||
return _get_messages(self.call, convo_id, limit, cursor) | ||
|
||
def get_convo_for_members(self, members: list[str]) -> bytes: | ||
"""""" | ||
return _get_convo_for_members(self.call, members) | ||
|
||
def send_message_batch(self, items: list[chitose.chat.bsky.convo.send_message_batch.BatchItem]) -> bytes: | ||
"""""" | ||
return _send_message_batch(self.call, items) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
# GENERATED CODE - DO NOT MODIFY | ||
"""""" | ||
from __future__ import annotations | ||
import chitose | ||
import chitose.app.bsky.embed.record | ||
import chitose.app.bsky.richtext.facet | ||
import chitose.chat.bsky.actor.defs | ||
import chitose.chat.bsky.convo.defs | ||
import typing | ||
|
||
class MessageRef(chitose.Object): | ||
"""""" | ||
|
||
def __init__(self, did: str, message_id: str) -> None: | ||
self.did = did | ||
self.message_id = message_id | ||
|
||
def to_dict(self) -> dict[str, typing.Any]: | ||
return {'did': self.did, 'messageId': self.message_id, '$type': 'chat.bsky.convo.defs#messageRef'} | ||
|
||
class Message(chitose.Object): | ||
""" | ||
:param facets: Annotations of text (mentions, URLs, hashtags, etc) | ||
""" | ||
|
||
def __init__(self, text: str, id: typing.Optional[str]=None, facets: typing.Optional[list[chitose.app.bsky.richtext.facet.Facet]]=None, embed: typing.Optional[chitose.app.bsky.embed.record.Record]=None) -> None: | ||
self.text = text | ||
self.id = id | ||
self.facets = facets | ||
self.embed = embed | ||
|
||
def to_dict(self) -> dict[str, typing.Any]: | ||
return {'text': self.text, 'id': self.id, 'facets': self.facets, 'embed': self.embed, '$type': 'chat.bsky.convo.defs#message'} | ||
|
||
class MessageView(chitose.Object): | ||
""" | ||
:param facets: Annotations of text (mentions, URLs, hashtags, etc) | ||
""" | ||
|
||
def __init__(self, id: str, rev: str, text: str, sender: chitose.chat.bsky.convo.defs.MessageViewSender, sent_at: str, facets: typing.Optional[list[chitose.app.bsky.richtext.facet.Facet]]=None, embed: typing.Optional[chitose.app.bsky.embed.record.Record]=None) -> None: | ||
self.id = id | ||
self.rev = rev | ||
self.text = text | ||
self.sender = sender | ||
self.sent_at = sent_at | ||
self.facets = facets | ||
self.embed = embed | ||
|
||
def to_dict(self) -> dict[str, typing.Any]: | ||
return {'id': self.id, 'rev': self.rev, 'text': self.text, 'sender': self.sender, 'sentAt': self.sent_at, 'facets': self.facets, 'embed': self.embed, '$type': 'chat.bsky.convo.defs#messageView'} | ||
|
||
class DeletedMessageView(chitose.Object): | ||
"""""" | ||
|
||
def __init__(self, id: str, rev: str, sender: chitose.chat.bsky.convo.defs.MessageViewSender, sent_at: str) -> None: | ||
self.id = id | ||
self.rev = rev | ||
self.sender = sender | ||
self.sent_at = sent_at | ||
|
||
def to_dict(self) -> dict[str, typing.Any]: | ||
return {'id': self.id, 'rev': self.rev, 'sender': self.sender, 'sentAt': self.sent_at, '$type': 'chat.bsky.convo.defs#deletedMessageView'} | ||
|
||
class MessageViewSender(chitose.Object): | ||
"""""" | ||
|
||
def __init__(self, did: str) -> None: | ||
self.did = did | ||
|
||
def to_dict(self) -> dict[str, typing.Any]: | ||
return {'did': self.did, '$type': 'chat.bsky.convo.defs#messageViewSender'} | ||
|
||
class ConvoView(chitose.Object): | ||
"""""" | ||
|
||
def __init__(self, id: str, rev: str, members: list[chitose.chat.bsky.actor.defs.ProfileViewBasic], muted: bool, unread_count: int, last_message: typing.Optional[typing.Union[chitose.chat.bsky.convo.defs.MessageView, chitose.chat.bsky.convo.defs.DeletedMessageView]]=None) -> None: | ||
self.id = id | ||
self.rev = rev | ||
self.members = members | ||
self.muted = muted | ||
self.unread_count = unread_count | ||
self.last_message = last_message | ||
|
||
def to_dict(self) -> dict[str, typing.Any]: | ||
return {'id': self.id, 'rev': self.rev, 'members': self.members, 'muted': self.muted, 'unreadCount': self.unread_count, 'lastMessage': self.last_message, '$type': 'chat.bsky.convo.defs#convoView'} | ||
|
||
class LogBeginConvo(chitose.Object): | ||
"""""" | ||
|
||
def __init__(self, rev: str, convo_id: str) -> None: | ||
self.rev = rev | ||
self.convo_id = convo_id | ||
|
||
def to_dict(self) -> dict[str, typing.Any]: | ||
return {'rev': self.rev, 'convoId': self.convo_id, '$type': 'chat.bsky.convo.defs#logBeginConvo'} | ||
|
||
class LogLeaveConvo(chitose.Object): | ||
"""""" | ||
|
||
def __init__(self, rev: str, convo_id: str) -> None: | ||
self.rev = rev | ||
self.convo_id = convo_id | ||
|
||
def to_dict(self) -> dict[str, typing.Any]: | ||
return {'rev': self.rev, 'convoId': self.convo_id, '$type': 'chat.bsky.convo.defs#logLeaveConvo'} | ||
|
||
class LogCreateMessage(chitose.Object): | ||
"""""" | ||
|
||
def __init__(self, rev: str, convo_id: str, message: typing.Union[chitose.chat.bsky.convo.defs.MessageView, chitose.chat.bsky.convo.defs.DeletedMessageView]) -> None: | ||
self.rev = rev | ||
self.convo_id = convo_id | ||
self.message = message | ||
|
||
def to_dict(self) -> dict[str, typing.Any]: | ||
return {'rev': self.rev, 'convoId': self.convo_id, 'message': self.message, '$type': 'chat.bsky.convo.defs#logCreateMessage'} | ||
|
||
class LogDeleteMessage(chitose.Object): | ||
"""""" | ||
|
||
def __init__(self, rev: str, convo_id: str, message: typing.Union[chitose.chat.bsky.convo.defs.MessageView, chitose.chat.bsky.convo.defs.DeletedMessageView]) -> None: | ||
self.rev = rev | ||
self.convo_id = convo_id | ||
self.message = message | ||
|
||
def to_dict(self) -> dict[str, typing.Any]: | ||
return {'rev': self.rev, 'convoId': self.convo_id, 'message': self.message, '$type': 'chat.bsky.convo.defs#logDeleteMessage'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# GENERATED CODE - DO NOT MODIFY | ||
"""""" | ||
from __future__ import annotations | ||
import chitose | ||
|
||
def _delete_message_for_self(call: chitose.xrpc.XrpcCall, convo_id: str, message_id: str) -> bytes: | ||
"""""" | ||
return call('chat.bsky.convo.deleteMessageForSelf', [], {'convoId': convo_id, 'messageId': message_id}, {'Content-Type': 'application/json'}) |
Oops, something went wrong.