Skip to content

Commit

Permalink
Merge branch 'main' into send-videos
Browse files Browse the repository at this point in the history
  • Loading branch information
Meorge authored Sep 12, 2024
2 parents 1ba079a + 66644d5 commit a54d044
Show file tree
Hide file tree
Showing 39 changed files with 270 additions and 101 deletions.
10 changes: 10 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change Log

## Version 0.0.53

**10.09.2024**

**⚡ Thanks to libipld 2.0.0 firehose performance should increase approximately by 30%! No changes from you are required! Check more detailed benchmark results [here](https://github.com/MarshalX/python-libipld/releases/tag/v2.0.0)**

* Add libipld v2.0.0 support by @MarshalX in https://github.com/MarshalX/atproto/pull/315
* Update lexicons fetched from e4d41d6 committed 2024-09-04T10:42:39Z by @MarshalX in https://github.com/MarshalX/atproto/pull/380
* Fix firehose client stop by @MarshalX in https://github.com/MarshalX/atproto/pull/384

## Version 0.0.52

**01.09.2024**
Expand Down
4 changes: 4 additions & 0 deletions lexicons/tools.ozone.moderation.defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@
"durationInHours": {
"type": "integer",
"description": "Indicates how long the takedown should be in effect before automatically expiring."
},
"acknowledgeAccountSubjects": {
"type": "boolean",
"description": "If true, all other reports on content authored by this account will be resolved (acknowledged)."
}
}
},
Expand Down
31 changes: 25 additions & 6 deletions lexicons/tools.ozone.moderation.queryStatuses.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@
"parameters": {
"type": "params",
"properties": {
"subject": { "type": "string", "format": "uri" },
"includeAllUserRecords": {
"type": "boolean",
"description": "All subjects belonging to the account specified in the 'subject' param will be returned."
},
"subject": {
"type": "string",
"format": "uri",
"description": "The subject to get the status for."
},
"comment": {
"type": "string",
"description": "Search subjects by keyword from comments"
Expand Down Expand Up @@ -47,7 +55,10 @@
},
"ignoreSubjects": {
"type": "array",
"items": { "type": "string", "format": "uri" }
"items": {
"type": "string",
"format": "uri"
}
},
"lastReviewedBy": {
"type": "string",
Expand Down Expand Up @@ -80,13 +91,19 @@
},
"tags": {
"type": "array",
"items": { "type": "string" }
"items": {
"type": "string"
}
},
"excludeTags": {
"type": "array",
"items": { "type": "string" }
"items": {
"type": "string"
}
},
"cursor": { "type": "string" }
"cursor": {
"type": "string"
}
}
},
"output": {
Expand All @@ -95,7 +112,9 @@
"type": "object",
"required": ["subjectStatuses"],
"properties": {
"cursor": { "type": "string" },
"cursor": {
"type": "string"
},
"subjectStatuses": {
"type": "array",
"items": {
Expand Down
22 changes: 13 additions & 9 deletions packages/atproto_client/models/app/bsky/actor/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class ProfileAssociated(base.ModelBase):
class ProfileAssociatedChat(base.ModelBase):
"""Definition model for :obj:`app.bsky.actor.defs`."""

allow_incoming: str #: Allow incoming.
allow_incoming: t.Union[t.Literal['all'], t.Literal['none'], t.Literal['following'], str] #: Allow incoming.

py_type: t.Literal['app.bsky.actor.defs#profileAssociatedChat'] = Field(
default='app.bsky.actor.defs#profileAssociatedChat', alias='$type', frozen=True
Expand Down Expand Up @@ -153,7 +153,7 @@ class KnownFollowers(base.ModelBase):
class AdultContentPref(base.ModelBase):
"""Definition model for :obj:`app.bsky.actor.defs`."""

enabled: bool = None #: Enabled.
enabled: bool = False #: Enabled.

py_type: t.Literal['app.bsky.actor.defs#adultContentPref'] = Field(
default='app.bsky.actor.defs#adultContentPref', alias='$type', frozen=True
Expand All @@ -164,7 +164,9 @@ class ContentLabelPref(base.ModelBase):
"""Definition model for :obj:`app.bsky.actor.defs`."""

label: str #: Label.
visibility: str #: Visibility.
visibility: t.Union[
t.Literal['ignore'], t.Literal['show'], t.Literal['warn'], t.Literal['hide'], str
] #: Visibility.
labeler_did: t.Optional[str] = None #: Which labeler does this preference apply to? If undefined, applies globally.

py_type: t.Literal['app.bsky.actor.defs#contentLabelPref'] = Field(
Expand All @@ -177,7 +179,7 @@ class SavedFeed(base.ModelBase):

id: str #: Id.
pinned: bool #: Pinned.
type: str #: Type.
type: t.Union[t.Literal['feed'], t.Literal['list'], t.Literal['timeline'], str] #: Type.
value: str #: Value.

py_type: t.Literal['app.bsky.actor.defs#savedFeed'] = Field(
Expand Down Expand Up @@ -226,7 +228,7 @@ class FeedViewPref(base.ModelBase):
hide_replies_by_like_count: t.Optional[
int
] = None #: Hide replies in the feed if they do not have this number of likes.
hide_replies_by_unfollowed: t.Optional[bool] = None #: Hide replies in the feed if they are not by followed users.
hide_replies_by_unfollowed: t.Optional[bool] = True #: Hide replies in the feed if they are not by followed users.
hide_reposts: t.Optional[bool] = None #: Hide reposts in the feed.

py_type: t.Literal['app.bsky.actor.defs#feedViewPref'] = Field(
Expand All @@ -238,7 +240,9 @@ class ThreadViewPref(base.ModelBase):
"""Definition model for :obj:`app.bsky.actor.defs`."""

prioritize_followed_users: t.Optional[bool] = None #: Show followed users at the top of all replies.
sort: t.Optional[str] = None #: Sorting mode for threads.
sort: t.Optional[
t.Union[t.Literal['oldest'], t.Literal['newest'], t.Literal['most-likes'], t.Literal['random'], str]
] = None #: Sorting mode for threads.

py_type: t.Literal['app.bsky.actor.defs#threadViewPref'] = Field(
default='app.bsky.actor.defs#threadViewPref', alias='$type', frozen=True
Expand All @@ -257,7 +261,7 @@ class InterestsPref(base.ModelBase):
)


MutedWordTarget = t.Union[t.Literal['content'], t.Literal['tag']] #: Muted word target
MutedWordTarget = t.Union[t.Literal['content'], t.Literal['tag'], str] #: Muted word target


class MutedWord(base.ModelBase):
Expand All @@ -266,8 +270,8 @@ class MutedWord(base.ModelBase):
targets: t.List['models.AppBskyActorDefs.MutedWordTarget'] #: The intended targets of the muted word.
value: str = Field(max_length=10000) #: The muted word itself.
actor_target: t.Optional[
str
] = None #: Groups of users to apply the muted word to. If undefined, applies to all users.
t.Union[t.Literal['all'], t.Literal['exclude-following'], str]
] = 'all' #: Groups of users to apply the muted word to. If undefined, applies to all users.
expires_at: t.Optional[
str
] = None #: The date and time at which the muted word will expire and no longer be applied.
Expand Down
18 changes: 17 additions & 1 deletion packages/atproto_client/models/app/bsky/feed/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,23 @@ class ThreadgateView(base.ModelBase):
class Interaction(base.ModelBase):
"""Definition model for :obj:`app.bsky.feed.defs`."""

event: t.Optional[str] = None #: Event.
event: t.Optional[
t.Union[
'models.AppBskyFeedDefs.RequestLess',
'models.AppBskyFeedDefs.RequestMore',
'models.AppBskyFeedDefs.ClickthroughItem',
'models.AppBskyFeedDefs.ClickthroughAuthor',
'models.AppBskyFeedDefs.ClickthroughReposter',
'models.AppBskyFeedDefs.ClickthroughEmbed',
'models.AppBskyFeedDefs.InteractionSeen',
'models.AppBskyFeedDefs.InteractionLike',
'models.AppBskyFeedDefs.InteractionRepost',
'models.AppBskyFeedDefs.InteractionReply',
'models.AppBskyFeedDefs.InteractionQuote',
'models.AppBskyFeedDefs.InteractionShare',
str,
]
] = None #: Event.
feed_context: t.Optional[str] = Field(
default=None, max_length=2000
) #: Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton.
Expand Down
22 changes: 20 additions & 2 deletions packages/atproto_client/models/app/bsky/feed/get_author_feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,32 @@ class Params(base.ParamsModelBase):

actor: str #: Actor.
cursor: t.Optional[str] = None #: Cursor.
filter: t.Optional[str] = None #: Combinations of post/repost types to include in response.
filter: t.Optional[
t.Union[
t.Literal['posts_with_replies'],
t.Literal['posts_no_replies'],
t.Literal['posts_with_media'],
t.Literal['posts_and_author_threads'],
str,
]
] = 'posts_with_replies' #: Combinations of post/repost types to include in response.
limit: t.Optional[int] = Field(default=50, ge=1, le=100) #: Limit.


class ParamsDict(t.TypedDict):
actor: str #: Actor.
cursor: te.NotRequired[t.Optional[str]] #: Cursor.
filter: te.NotRequired[t.Optional[str]] #: Combinations of post/repost types to include in response.
filter: te.NotRequired[
t.Optional[
t.Union[
t.Literal['posts_with_replies'],
t.Literal['posts_no_replies'],
t.Literal['posts_with_media'],
t.Literal['posts_and_author_threads'],
str,
]
]
] #: Combinations of post/repost types to include in response.
limit: te.NotRequired[t.Optional[int]] #: Limit.


Expand Down
8 changes: 6 additions & 2 deletions packages/atproto_client/models/app/bsky/feed/search_posts.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class Params(base.ParamsModelBase):
since: t.Optional[
str
] = None #: Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD).
sort: t.Optional[str] = None #: Specifies the ranking order of results.
sort: t.Optional[
t.Union[t.Literal['top'], t.Literal['latest'], str]
] = 'latest' #: Specifies the ranking order of results.
tag: t.Optional[
t.List[str]
] = None #: Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching.
Expand Down Expand Up @@ -71,7 +73,9 @@ class ParamsDict(t.TypedDict):
since: te.NotRequired[
t.Optional[str]
] #: Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD).
sort: te.NotRequired[t.Optional[str]] #: Specifies the ranking order of results.
sort: te.NotRequired[
t.Optional[t.Union[t.Literal['top'], t.Literal['latest'], str]]
] #: Specifies the ranking order of results.
tag: te.NotRequired[
t.Optional[t.List[str]]
] #: Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching.
Expand Down
5 changes: 4 additions & 1 deletion packages/atproto_client/models/app/bsky/graph/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ class StarterPackViewBasic(base.ModelBase):


ListPurpose = t.Union[
'models.AppBskyGraphDefs.Modlist', 'models.AppBskyGraphDefs.Curatelist', 'models.AppBskyGraphDefs.Referencelist'
'models.AppBskyGraphDefs.Modlist',
'models.AppBskyGraphDefs.Curatelist',
'models.AppBskyGraphDefs.Referencelist',
str,
] #: List purpose

Modlist = t.Literal[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Params(base.ParamsModelBase):
"""Parameters model for :obj:`app.bsky.labeler.getServices`."""

dids: t.List[str] #: Dids.
detailed: t.Optional[bool] = None #: Detailed.
detailed: t.Optional[bool] = False #: Detailed.


class ParamsDict(t.TypedDict):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,16 @@ class Notification(base.ModelBase):
cid: str #: Cid.
indexed_at: str #: Indexed at.
is_read: bool #: Is read.
reason: (
str
) #: Expected values are 'like', 'repost', 'follow', 'mention', 'reply', 'quote', and 'starterpack-joined'.
reason: t.Union[
t.Literal['like'],
t.Literal['repost'],
t.Literal['follow'],
t.Literal['mention'],
t.Literal['reply'],
t.Literal['quote'],
t.Literal['starterpack-joined'],
str,
] #: Expected values are 'like', 'repost', 'follow', 'mention', 'reply', 'quote', and 'starterpack-joined'.
record: 'UnknownType' #: Record.
uri: str #: Uri.
labels: t.Optional[t.List['models.ComAtprotoLabelDefs.Label']] = None #: Labels.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ class Data(base.DataModelBase):
"""Input data model for :obj:`app.bsky.notification.registerPush`."""

app_id: str #: App id.
platform: str #: Platform.
platform: t.Union[t.Literal['ios'], t.Literal['android'], t.Literal['web'], str] #: Platform.
service_did: str #: Service did.
token: str #: Token.


class DataDict(t.TypedDict):
app_id: str #: App id.
platform: str #: Platform.
platform: t.Union[t.Literal['ios'], t.Literal['android'], t.Literal['web'], str] #: Platform.
service_did: str #: Service did.
token: str #: Token.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Suggestion(base.ModelBase):
"""Definition model for :obj:`app.bsky.unspecced.getTaggedSuggestions`."""

subject: str #: Subject.
subject_type: str #: Subject type.
subject_type: t.Union[t.Literal['actor'], t.Literal['feed'], str] #: Subject type.
tag: str #: Tag.

py_type: t.Literal['app.bsky.unspecced.getTaggedSuggestions#suggestion'] = Field(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class Params(base.ParamsModelBase):
since: t.Optional[
str
] = None #: Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD).
sort: t.Optional[str] = None #: Specifies the ranking order of results.
sort: t.Optional[
t.Union[t.Literal['top'], t.Literal['latest'], str]
] = 'latest' #: Specifies the ranking order of results.
tag: t.Optional[
t.List[str]
] = None #: Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching.
Expand Down Expand Up @@ -74,7 +76,9 @@ class ParamsDict(t.TypedDict):
since: te.NotRequired[
t.Optional[str]
] #: Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD).
sort: te.NotRequired[t.Optional[str]] #: Specifies the ranking order of results.
sort: te.NotRequired[
t.Optional[t.Union[t.Literal['top'], t.Literal['latest'], str]]
] #: Specifies the ranking order of results.
tag: te.NotRequired[
t.Optional[t.List[str]]
] #: Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching.
Expand Down
4 changes: 3 additions & 1 deletion packages/atproto_client/models/app/bsky/video/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ class JobStatus(base.ModelBase):

did: str #: Did.
job_id: str #: Job id.
state: str #: The state of the video processing job. All values not listed as a known value indicate that the job is in process.
state: t.Union[
t.Literal['JOB_STATE_COMPLETED'], t.Literal['JOB_STATE_FAILED'], str
] #: The state of the video processing job. All values not listed as a known value indicate that the job is in process.
blob: t.Optional['BlobRef'] = None #: Blob.
error: t.Optional[str] = None #: Error.
message: t.Optional[str] = None #: Message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class Record(base.RecordModelBase):
"""Record model for :obj:`chat.bsky.actor.declaration`."""

allow_incoming: str #: Allow incoming.
allow_incoming: t.Union[t.Literal['all'], t.Literal['none'], t.Literal['following'], str] #: Allow incoming.

py_type: t.Literal['chat.bsky.actor.declaration'] = Field(
default='chat.bsky.actor.declaration', alias='$type', frozen=True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class Params(base.ParamsModelBase):
"""Parameters model for :obj:`chat.bsky.moderation.getMessageContext`."""

message_id: str #: Message id.
after: t.Optional[int] = None #: After.
before: t.Optional[int] = None #: Before.
after: t.Optional[int] = 5 #: After.
before: t.Optional[int] = 5 #: Before.
convo_id: t.Optional[
str
] = None #: Conversation that the message is from. NOTE: this field will eventually be required.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ class Params(base.ParamsModelBase):

cursor: t.Optional[str] = None #: Cursor.
limit: t.Optional[int] = Field(default=100, ge=1, le=500) #: Limit.
sort: t.Optional[str] = None #: Sort.
sort: t.Optional[t.Union[t.Literal['recent'], t.Literal['usage'], str]] = 'recent' #: Sort.


class ParamsDict(t.TypedDict):
cursor: te.NotRequired[t.Optional[str]] #: Cursor.
limit: te.NotRequired[t.Optional[int]] #: Limit.
sort: te.NotRequired[t.Optional[str]] #: Sort.
sort: te.NotRequired[t.Optional[t.Union[t.Literal['recent'], t.Literal['usage'], str]]] #: Sort.


class Response(base.ResponseModelBase):
Expand Down
Loading

0 comments on commit a54d044

Please sign in to comment.