From d63481453d607a5132df9a738f8c6f236b43fd4c Mon Sep 17 00:00:00 2001 From: Ilya Siamionau Date: Fri, 30 Aug 2024 13:41:09 +0200 Subject: [PATCH] Update lexicons fetched from 80ada8f committed 2024-08-28T23:03:35Z (#367) --- docs/source/aliases_db.py | 6 ++ ...roto_client.models.app.bsky.embed.defs.rst | 7 ++ .../atproto_client.models.app.bsky.embed.rst | 2 + ...oto_client.models.app.bsky.embed.video.rst | 7 ++ .../atproto_client.models.app.bsky.rst | 1 + ...roto_client.models.app.bsky.video.defs.rst | 7 ++ ...t.models.app.bsky.video.get_job_status.rst | 7 ++ ...odels.app.bsky.video.get_upload_limits.rst | 7 ++ .../atproto_client.models.app.bsky.video.rst | 18 +++++ ...ent.models.app.bsky.video.upload_video.rst | 7 ++ lexicons/app.bsky.embed.defs.json | 15 ++++ lexicons/app.bsky.embed.images.json | 19 +++-- lexicons/app.bsky.embed.record.json | 1 + lexicons/app.bsky.embed.recordWithMedia.json | 12 +++- lexicons/app.bsky.embed.video.json | 66 ++++++++++++++++++ lexicons/app.bsky.feed.defs.json | 1 + lexicons/app.bsky.feed.post.json | 1 + lexicons/app.bsky.video.defs.json | 28 ++++++++ lexicons/app.bsky.video.getJobStatus.json | 32 +++++++++ lexicons/app.bsky.video.getUploadLimits.json | 24 +++++++ lexicons/app.bsky.video.uploadVideo.json | 26 +++++++ packages/atproto_client/models/__init__.py | 12 ++++ .../models/app/bsky/embed/defs.py | 23 +++++++ .../models/app/bsky/embed/images.py | 15 +--- .../models/app/bsky/embed/record.py | 1 + .../app/bsky/embed/record_with_media.py | 6 +- .../models/app/bsky/embed/video.py | 53 ++++++++++++++ .../models/app/bsky/feed/defs.py | 1 + .../models/app/bsky/feed/post.py | 1 + .../models/app/bsky/video/__init__.py | 6 ++ .../models/app/bsky/video/defs.py | 30 ++++++++ .../models/app/bsky/video/get_job_status.py | 28 ++++++++ .../app/bsky/video/get_upload_limits.py | 20 ++++++ .../models/app/bsky/video/upload_video.py | 23 +++++++ .../atproto_client/namespaces/async_ns.py | 69 +++++++++++++++++++ packages/atproto_client/namespaces/sync_ns.py | 69 +++++++++++++++++++ 36 files changed, 623 insertions(+), 28 deletions(-) create mode 100644 docs/source/atproto/atproto_client.models.app.bsky.embed.defs.rst create mode 100644 docs/source/atproto/atproto_client.models.app.bsky.embed.video.rst create mode 100644 docs/source/atproto/atproto_client.models.app.bsky.video.defs.rst create mode 100644 docs/source/atproto/atproto_client.models.app.bsky.video.get_job_status.rst create mode 100644 docs/source/atproto/atproto_client.models.app.bsky.video.get_upload_limits.rst create mode 100644 docs/source/atproto/atproto_client.models.app.bsky.video.rst create mode 100644 docs/source/atproto/atproto_client.models.app.bsky.video.upload_video.rst create mode 100644 lexicons/app.bsky.embed.defs.json create mode 100644 lexicons/app.bsky.embed.video.json create mode 100644 lexicons/app.bsky.video.defs.json create mode 100644 lexicons/app.bsky.video.getJobStatus.json create mode 100644 lexicons/app.bsky.video.getUploadLimits.json create mode 100644 lexicons/app.bsky.video.uploadVideo.json create mode 100644 packages/atproto_client/models/app/bsky/embed/defs.py create mode 100644 packages/atproto_client/models/app/bsky/embed/video.py create mode 100644 packages/atproto_client/models/app/bsky/video/__init__.py create mode 100644 packages/atproto_client/models/app/bsky/video/defs.py create mode 100644 packages/atproto_client/models/app/bsky/video/get_job_status.py create mode 100644 packages/atproto_client/models/app/bsky/video/get_upload_limits.py create mode 100644 packages/atproto_client/models/app/bsky/video/upload_video.py diff --git a/docs/source/aliases_db.py b/docs/source/aliases_db.py index 37864415..0fc98429 100644 --- a/docs/source/aliases_db.py +++ b/docs/source/aliases_db.py @@ -8,10 +8,12 @@ 'models.AppBskyActorPutPreferences': 'atproto_client.models.app.bsky.actor.put_preferences', 'models.AppBskyActorSearchActors': 'atproto_client.models.app.bsky.actor.search_actors', 'models.AppBskyActorSearchActorsTypeahead': 'atproto_client.models.app.bsky.actor.search_actors_typeahead', + 'models.AppBskyEmbedDefs': 'atproto_client.models.app.bsky.embed.defs', 'models.AppBskyEmbedExternal': 'atproto_client.models.app.bsky.embed.external', 'models.AppBskyEmbedImages': 'atproto_client.models.app.bsky.embed.images', 'models.AppBskyEmbedRecord': 'atproto_client.models.app.bsky.embed.record', 'models.AppBskyEmbedRecordWithMedia': 'atproto_client.models.app.bsky.embed.record_with_media', + 'models.AppBskyEmbedVideo': 'atproto_client.models.app.bsky.embed.video', 'models.AppBskyFeedDefs': 'atproto_client.models.app.bsky.feed.defs', 'models.AppBskyFeedDescribeFeedGenerator': 'atproto_client.models.app.bsky.feed.describe_feed_generator', 'models.AppBskyFeedGenerator': 'atproto_client.models.app.bsky.feed.generator', @@ -79,6 +81,10 @@ 'models.AppBskyUnspeccedGetTaggedSuggestions': 'atproto_client.models.app.bsky.unspecced.get_tagged_suggestions', 'models.AppBskyUnspeccedSearchActorsSkeleton': 'atproto_client.models.app.bsky.unspecced.search_actors_skeleton', 'models.AppBskyUnspeccedSearchPostsSkeleton': 'atproto_client.models.app.bsky.unspecced.search_posts_skeleton', + 'models.AppBskyVideoDefs': 'atproto_client.models.app.bsky.video.defs', + 'models.AppBskyVideoGetJobStatus': 'atproto_client.models.app.bsky.video.get_job_status', + 'models.AppBskyVideoGetUploadLimits': 'atproto_client.models.app.bsky.video.get_upload_limits', + 'models.AppBskyVideoUploadVideo': 'atproto_client.models.app.bsky.video.upload_video', 'models.ChatBskyActorDeclaration': 'atproto_client.models.chat.bsky.actor.declaration', 'models.ChatBskyActorDefs': 'atproto_client.models.chat.bsky.actor.defs', 'models.ChatBskyActorDeleteAccount': 'atproto_client.models.chat.bsky.actor.delete_account', diff --git a/docs/source/atproto/atproto_client.models.app.bsky.embed.defs.rst b/docs/source/atproto/atproto_client.models.app.bsky.embed.defs.rst new file mode 100644 index 00000000..c7706ce6 --- /dev/null +++ b/docs/source/atproto/atproto_client.models.app.bsky.embed.defs.rst @@ -0,0 +1,7 @@ +app.bsky.embed.defs +========================================== + +.. automodule:: atproto_client.models.app.bsky.embed.defs + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/atproto/atproto_client.models.app.bsky.embed.rst b/docs/source/atproto/atproto_client.models.app.bsky.embed.rst index 8a2b9185..ee9a2687 100644 --- a/docs/source/atproto/atproto_client.models.app.bsky.embed.rst +++ b/docs/source/atproto/atproto_client.models.app.bsky.embed.rst @@ -12,7 +12,9 @@ Submodules .. toctree:: :maxdepth: 4 + atproto_client.models.app.bsky.embed.defs atproto_client.models.app.bsky.embed.external atproto_client.models.app.bsky.embed.images atproto_client.models.app.bsky.embed.record atproto_client.models.app.bsky.embed.record_with_media + atproto_client.models.app.bsky.embed.video diff --git a/docs/source/atproto/atproto_client.models.app.bsky.embed.video.rst b/docs/source/atproto/atproto_client.models.app.bsky.embed.video.rst new file mode 100644 index 00000000..50ed38cb --- /dev/null +++ b/docs/source/atproto/atproto_client.models.app.bsky.embed.video.rst @@ -0,0 +1,7 @@ +app.bsky.embed.video +=========================================== + +.. automodule:: atproto_client.models.app.bsky.embed.video + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/atproto/atproto_client.models.app.bsky.rst b/docs/source/atproto/atproto_client.models.app.bsky.rst index 3a4def2b..f7464581 100644 --- a/docs/source/atproto/atproto_client.models.app.bsky.rst +++ b/docs/source/atproto/atproto_client.models.app.bsky.rst @@ -20,3 +20,4 @@ Subpackages atproto_client.models.app.bsky.notification atproto_client.models.app.bsky.richtext atproto_client.models.app.bsky.unspecced + atproto_client.models.app.bsky.video diff --git a/docs/source/atproto/atproto_client.models.app.bsky.video.defs.rst b/docs/source/atproto/atproto_client.models.app.bsky.video.defs.rst new file mode 100644 index 00000000..a7a2d272 --- /dev/null +++ b/docs/source/atproto/atproto_client.models.app.bsky.video.defs.rst @@ -0,0 +1,7 @@ +app.bsky.video.defs +========================================== + +.. automodule:: atproto_client.models.app.bsky.video.defs + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/atproto/atproto_client.models.app.bsky.video.get_job_status.rst b/docs/source/atproto/atproto_client.models.app.bsky.video.get_job_status.rst new file mode 100644 index 00000000..51669bc7 --- /dev/null +++ b/docs/source/atproto/atproto_client.models.app.bsky.video.get_job_status.rst @@ -0,0 +1,7 @@ +app.bsky.video.get\_job\_status +====================================================== + +.. automodule:: atproto_client.models.app.bsky.video.get_job_status + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/atproto/atproto_client.models.app.bsky.video.get_upload_limits.rst b/docs/source/atproto/atproto_client.models.app.bsky.video.get_upload_limits.rst new file mode 100644 index 00000000..be06ed0a --- /dev/null +++ b/docs/source/atproto/atproto_client.models.app.bsky.video.get_upload_limits.rst @@ -0,0 +1,7 @@ +app.bsky.video.get\_upload\_limits +========================================================= + +.. automodule:: atproto_client.models.app.bsky.video.get_upload_limits + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/source/atproto/atproto_client.models.app.bsky.video.rst b/docs/source/atproto/atproto_client.models.app.bsky.video.rst new file mode 100644 index 00000000..44660612 --- /dev/null +++ b/docs/source/atproto/atproto_client.models.app.bsky.video.rst @@ -0,0 +1,18 @@ +app.bsky.video +===================================== + +.. automodule:: atproto_client.models.app.bsky.video + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +.. toctree:: + :maxdepth: 4 + + atproto_client.models.app.bsky.video.defs + atproto_client.models.app.bsky.video.get_job_status + atproto_client.models.app.bsky.video.get_upload_limits + atproto_client.models.app.bsky.video.upload_video diff --git a/docs/source/atproto/atproto_client.models.app.bsky.video.upload_video.rst b/docs/source/atproto/atproto_client.models.app.bsky.video.upload_video.rst new file mode 100644 index 00000000..6c8fea7f --- /dev/null +++ b/docs/source/atproto/atproto_client.models.app.bsky.video.upload_video.rst @@ -0,0 +1,7 @@ +app.bsky.video.upload\_video +=================================================== + +.. automodule:: atproto_client.models.app.bsky.video.upload_video + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/lexicons/app.bsky.embed.defs.json b/lexicons/app.bsky.embed.defs.json new file mode 100644 index 00000000..57ffc03a --- /dev/null +++ b/lexicons/app.bsky.embed.defs.json @@ -0,0 +1,15 @@ +{ + "lexicon": 1, + "id": "app.bsky.embed.defs", + "defs": { + "aspectRatio": { + "type": "object", + "description": "width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit.", + "required": ["width", "height"], + "properties": { + "width": { "type": "integer", "minimum": 1 }, + "height": { "type": "integer", "minimum": 1 } + } + } + } +} diff --git a/lexicons/app.bsky.embed.images.json b/lexicons/app.bsky.embed.images.json index 7de9d7a8..c6b6fa20 100644 --- a/lexicons/app.bsky.embed.images.json +++ b/lexicons/app.bsky.embed.images.json @@ -27,16 +27,10 @@ "type": "string", "description": "Alt text description of the image, for accessibility." }, - "aspectRatio": { "type": "ref", "ref": "#aspectRatio" } - } - }, - "aspectRatio": { - "type": "object", - "description": "width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit.", - "required": ["width", "height"], - "properties": { - "width": { "type": "integer", "minimum": 1 }, - "height": { "type": "integer", "minimum": 1 } + "aspectRatio": { + "type": "ref", + "ref": "app.bsky.embed.defs#aspectRatio" + } } }, "view": { @@ -68,7 +62,10 @@ "type": "string", "description": "Alt text description of the image, for accessibility." }, - "aspectRatio": { "type": "ref", "ref": "#aspectRatio" } + "aspectRatio": { + "type": "ref", + "ref": "app.bsky.embed.defs#aspectRatio" + } } } } diff --git a/lexicons/app.bsky.embed.record.json b/lexicons/app.bsky.embed.record.json index a0ffabc9..a73200a3 100644 --- a/lexicons/app.bsky.embed.record.json +++ b/lexicons/app.bsky.embed.record.json @@ -57,6 +57,7 @@ "type": "union", "refs": [ "app.bsky.embed.images#view", + "app.bsky.embed.video#view", "app.bsky.embed.external#view", "app.bsky.embed.record#view", "app.bsky.embed.recordWithMedia#view" diff --git a/lexicons/app.bsky.embed.recordWithMedia.json b/lexicons/app.bsky.embed.recordWithMedia.json index 46145464..5baf6850 100644 --- a/lexicons/app.bsky.embed.recordWithMedia.json +++ b/lexicons/app.bsky.embed.recordWithMedia.json @@ -13,7 +13,11 @@ }, "media": { "type": "union", - "refs": ["app.bsky.embed.images", "app.bsky.embed.external"] + "refs": [ + "app.bsky.embed.images", + "app.bsky.embed.video", + "app.bsky.embed.external" + ] } } }, @@ -27,7 +31,11 @@ }, "media": { "type": "union", - "refs": ["app.bsky.embed.images#view", "app.bsky.embed.external#view"] + "refs": [ + "app.bsky.embed.images#view", + "app.bsky.embed.video#view", + "app.bsky.embed.external#view" + ] } } } diff --git a/lexicons/app.bsky.embed.video.json b/lexicons/app.bsky.embed.video.json new file mode 100644 index 00000000..da58ded8 --- /dev/null +++ b/lexicons/app.bsky.embed.video.json @@ -0,0 +1,66 @@ +{ + "lexicon": 1, + "id": "app.bsky.embed.video", + "description": "A video embedded in a Bluesky record (eg, a post).", + "defs": { + "main": { + "type": "object", + "required": ["video"], + "properties": { + "video": { + "type": "blob", + "accept": ["video/mp4"], + "maxSize": 50000000 + }, + "captions": { + "type": "array", + "items": { "type": "ref", "ref": "#caption" }, + "maxLength": 20 + }, + "alt": { + "type": "string", + "description": "Alt text description of the video, for accessibility.", + "maxGraphemes": 1000, + "maxLength": 10000 + }, + "aspectRatio": { + "type": "ref", + "ref": "app.bsky.embed.defs#aspectRatio" + } + } + }, + "caption": { + "type": "object", + "required": ["lang", "file"], + "properties": { + "lang": { + "type": "string", + "format": "language" + }, + "file": { + "type": "blob", + "accept": ["text/vtt"], + "maxSize": 20000 + } + } + }, + "view": { + "type": "object", + "required": ["cid", "playlist"], + "properties": { + "cid": { "type": "string", "format": "cid" }, + "playlist": { "type": "string", "format": "uri" }, + "thumbnail": { "type": "string", "format": "uri" }, + "alt": { + "type": "string", + "maxGraphemes": 1000, + "maxLength": 10000 + }, + "aspectRatio": { + "type": "ref", + "ref": "app.bsky.embed.defs#aspectRatio" + } + } + } + } +} diff --git a/lexicons/app.bsky.feed.defs.json b/lexicons/app.bsky.feed.defs.json index 0d8a7f54..fcbc173e 100644 --- a/lexicons/app.bsky.feed.defs.json +++ b/lexicons/app.bsky.feed.defs.json @@ -17,6 +17,7 @@ "type": "union", "refs": [ "app.bsky.embed.images#view", + "app.bsky.embed.video#view", "app.bsky.embed.external#view", "app.bsky.embed.record#view", "app.bsky.embed.recordWithMedia#view" diff --git a/lexicons/app.bsky.feed.post.json b/lexicons/app.bsky.feed.post.json index b9b236b4..9893a355 100644 --- a/lexicons/app.bsky.feed.post.json +++ b/lexicons/app.bsky.feed.post.json @@ -31,6 +31,7 @@ "type": "union", "refs": [ "app.bsky.embed.images", + "app.bsky.embed.video", "app.bsky.embed.external", "app.bsky.embed.record", "app.bsky.embed.recordWithMedia" diff --git a/lexicons/app.bsky.video.defs.json b/lexicons/app.bsky.video.defs.json new file mode 100644 index 00000000..8c846ccb --- /dev/null +++ b/lexicons/app.bsky.video.defs.json @@ -0,0 +1,28 @@ +{ + "lexicon": 1, + "id": "app.bsky.video.defs", + "defs": { + "jobStatus": { + "type": "object", + "required": ["jobId", "did", "state"], + "properties": { + "jobId": { "type": "string" }, + "did": { "type": "string", "format": "did" }, + "state": { + "type": "string", + "description": "The state of the video processing job. All values not listed as a known value indicate that the job is in process.", + "knownValues": ["JOB_STATE_COMPLETED", "JOB_STATE_FAILED"] + }, + "progress": { + "type": "integer", + "minimum": 0, + "maximum": 100, + "description": "Progress within the current processing state." + }, + "blob": { "type": "blob" }, + "error": { "type": "string" }, + "message": { "type": "string" } + } + } + } +} diff --git a/lexicons/app.bsky.video.getJobStatus.json b/lexicons/app.bsky.video.getJobStatus.json new file mode 100644 index 00000000..ff3076f2 --- /dev/null +++ b/lexicons/app.bsky.video.getJobStatus.json @@ -0,0 +1,32 @@ +{ + "lexicon": 1, + "id": "app.bsky.video.getJobStatus", + "defs": { + "main": { + "type": "query", + "description": "Get status details for a video processing job.", + "parameters": { + "type": "params", + "required": ["jobId"], + "properties": { + "jobId": { + "type": "string" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["jobStatus"], + "properties": { + "jobStatus": { + "type": "ref", + "ref": "app.bsky.video.defs#jobStatus" + } + } + } + } + } + } +} diff --git a/lexicons/app.bsky.video.getUploadLimits.json b/lexicons/app.bsky.video.getUploadLimits.json new file mode 100644 index 00000000..bcba18e5 --- /dev/null +++ b/lexicons/app.bsky.video.getUploadLimits.json @@ -0,0 +1,24 @@ +{ + "lexicon": 1, + "id": "app.bsky.video.getUploadLimits", + "defs": { + "main": { + "type": "query", + "description": "Get video upload limits for the authenticated user.", + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["canUpload"], + "properties": { + "canUpload": { "type": "boolean" }, + "remainingDailyVideos": { "type": "integer" }, + "remainingDailyBytes": { "type": "integer" }, + "message": { "type": "string" }, + "error": { "type": "string" } + } + } + } + } + } +} diff --git a/lexicons/app.bsky.video.uploadVideo.json b/lexicons/app.bsky.video.uploadVideo.json new file mode 100644 index 00000000..8ffc2646 --- /dev/null +++ b/lexicons/app.bsky.video.uploadVideo.json @@ -0,0 +1,26 @@ +{ + "lexicon": 1, + "id": "app.bsky.video.uploadVideo", + "defs": { + "main": { + "type": "procedure", + "description": "Upload a video to be processed then stored on the PDS.", + "input": { + "encoding": "video/mp4" + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["jobStatus"], + "properties": { + "jobStatus": { + "type": "ref", + "ref": "app.bsky.video.defs#jobStatus" + } + } + } + } + } + } +} diff --git a/packages/atproto_client/models/__init__.py b/packages/atproto_client/models/__init__.py index 0db11e7b..9e41484f 100644 --- a/packages/atproto_client/models/__init__.py +++ b/packages/atproto_client/models/__init__.py @@ -7,10 +7,12 @@ from atproto_client.models.app.bsky.actor import put_preferences as AppBskyActorPutPreferences from atproto_client.models.app.bsky.actor import search_actors as AppBskyActorSearchActors from atproto_client.models.app.bsky.actor import search_actors_typeahead as AppBskyActorSearchActorsTypeahead +from atproto_client.models.app.bsky.embed import defs as AppBskyEmbedDefs from atproto_client.models.app.bsky.embed import external as AppBskyEmbedExternal from atproto_client.models.app.bsky.embed import images as AppBskyEmbedImages from atproto_client.models.app.bsky.embed import record as AppBskyEmbedRecord from atproto_client.models.app.bsky.embed import record_with_media as AppBskyEmbedRecordWithMedia +from atproto_client.models.app.bsky.embed import video as AppBskyEmbedVideo from atproto_client.models.app.bsky.feed import defs as AppBskyFeedDefs from atproto_client.models.app.bsky.feed import describe_feed_generator as AppBskyFeedDescribeFeedGenerator from atproto_client.models.app.bsky.feed import generator as AppBskyFeedGenerator @@ -82,6 +84,10 @@ from atproto_client.models.app.bsky.unspecced import get_tagged_suggestions as AppBskyUnspeccedGetTaggedSuggestions from atproto_client.models.app.bsky.unspecced import search_actors_skeleton as AppBskyUnspeccedSearchActorsSkeleton from atproto_client.models.app.bsky.unspecced import search_posts_skeleton as AppBskyUnspeccedSearchPostsSkeleton +from atproto_client.models.app.bsky.video import defs as AppBskyVideoDefs +from atproto_client.models.app.bsky.video import get_job_status as AppBskyVideoGetJobStatus +from atproto_client.models.app.bsky.video import get_upload_limits as AppBskyVideoGetUploadLimits +from atproto_client.models.app.bsky.video import upload_video as AppBskyVideoUploadVideo from atproto_client.models.chat.bsky.actor import declaration as ChatBskyActorDeclaration from atproto_client.models.chat.bsky.actor import defs as ChatBskyActorDefs from atproto_client.models.chat.bsky.actor import delete_account as ChatBskyActorDeleteAccount @@ -226,10 +232,12 @@ class _Ids: AppBskyActorPutPreferences: str = 'app.bsky.actor.putPreferences' AppBskyActorSearchActors: str = 'app.bsky.actor.searchActors' AppBskyActorSearchActorsTypeahead: str = 'app.bsky.actor.searchActorsTypeahead' + AppBskyEmbedDefs: str = 'app.bsky.embed.defs' AppBskyEmbedExternal: str = 'app.bsky.embed.external' AppBskyEmbedImages: str = 'app.bsky.embed.images' AppBskyEmbedRecord: str = 'app.bsky.embed.record' AppBskyEmbedRecordWithMedia: str = 'app.bsky.embed.recordWithMedia' + AppBskyEmbedVideo: str = 'app.bsky.embed.video' AppBskyFeedDefs: str = 'app.bsky.feed.defs' AppBskyFeedDescribeFeedGenerator: str = 'app.bsky.feed.describeFeedGenerator' AppBskyFeedGenerator: str = 'app.bsky.feed.generator' @@ -297,6 +305,10 @@ class _Ids: AppBskyUnspeccedGetTaggedSuggestions: str = 'app.bsky.unspecced.getTaggedSuggestions' AppBskyUnspeccedSearchActorsSkeleton: str = 'app.bsky.unspecced.searchActorsSkeleton' AppBskyUnspeccedSearchPostsSkeleton: str = 'app.bsky.unspecced.searchPostsSkeleton' + AppBskyVideoDefs: str = 'app.bsky.video.defs' + AppBskyVideoGetJobStatus: str = 'app.bsky.video.getJobStatus' + AppBskyVideoGetUploadLimits: str = 'app.bsky.video.getUploadLimits' + AppBskyVideoUploadVideo: str = 'app.bsky.video.uploadVideo' ChatBskyActorDeclaration: str = 'chat.bsky.actor.declaration' ChatBskyActorDefs: str = 'chat.bsky.actor.defs' ChatBskyActorDeleteAccount: str = 'chat.bsky.actor.deleteAccount' diff --git a/packages/atproto_client/models/app/bsky/embed/defs.py b/packages/atproto_client/models/app/bsky/embed/defs.py new file mode 100644 index 00000000..c8e3cf72 --- /dev/null +++ b/packages/atproto_client/models/app/bsky/embed/defs.py @@ -0,0 +1,23 @@ +################################################################## +# THIS IS THE AUTO-GENERATED CODE. DON'T EDIT IT BY HANDS! +# Copyright (C) 2024 Ilya (Marshal) . +# This file is part of Python atproto SDK. Licenced under MIT. +################################################################## + + +import typing as t + +from pydantic import Field + +from atproto_client.models import base + + +class AspectRatio(base.ModelBase): + """Definition model for :obj:`app.bsky.embed.defs`. width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit.""" + + height: int = Field(ge=1) #: Height. + width: int = Field(ge=1) #: Width. + + py_type: t.Literal['app.bsky.embed.defs#aspectRatio'] = Field( + default='app.bsky.embed.defs#aspectRatio', alias='$type', frozen=True + ) diff --git a/packages/atproto_client/models/app/bsky/embed/images.py b/packages/atproto_client/models/app/bsky/embed/images.py index cb727345..acc2b658 100644 --- a/packages/atproto_client/models/app/bsky/embed/images.py +++ b/packages/atproto_client/models/app/bsky/embed/images.py @@ -28,24 +28,13 @@ class Image(base.ModelBase): alt: str #: Alt text description of the image, for accessibility. image: 'BlobRef' #: Image. - aspect_ratio: t.Optional['models.AppBskyEmbedImages.AspectRatio'] = None #: Aspect ratio. + aspect_ratio: t.Optional['models.AppBskyEmbedDefs.AspectRatio'] = None #: Aspect ratio. py_type: t.Literal['app.bsky.embed.images#image'] = Field( default='app.bsky.embed.images#image', alias='$type', frozen=True ) -class AspectRatio(base.ModelBase): - """Definition model for :obj:`app.bsky.embed.images`. width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit.""" - - height: int = Field(ge=1) #: Height. - width: int = Field(ge=1) #: Width. - - py_type: t.Literal['app.bsky.embed.images#aspectRatio'] = Field( - default='app.bsky.embed.images#aspectRatio', alias='$type', frozen=True - ) - - class View(base.ModelBase): """Definition model for :obj:`app.bsky.embed.images`.""" @@ -62,7 +51,7 @@ class ViewImage(base.ModelBase): alt: str #: Alt text description of the image, for accessibility. fullsize: str #: Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View. thumb: str #: Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View. - aspect_ratio: t.Optional['models.AppBskyEmbedImages.AspectRatio'] = None #: Aspect ratio. + aspect_ratio: t.Optional['models.AppBskyEmbedDefs.AspectRatio'] = None #: Aspect ratio. py_type: t.Literal['app.bsky.embed.images#viewImage'] = Field( default='app.bsky.embed.images#viewImage', alias='$type', frozen=True diff --git a/packages/atproto_client/models/app/bsky/embed/record.py b/packages/atproto_client/models/app/bsky/embed/record.py index 88bafbba..4cb9ad24 100644 --- a/packages/atproto_client/models/app/bsky/embed/record.py +++ b/packages/atproto_client/models/app/bsky/embed/record.py @@ -59,6 +59,7 @@ class ViewRecord(base.ModelBase): te.Annotated[ t.Union[ 'models.AppBskyEmbedImages.View', + 'models.AppBskyEmbedVideo.View', 'models.AppBskyEmbedExternal.View', 'models.AppBskyEmbedRecord.View', 'models.AppBskyEmbedRecordWithMedia.View', diff --git a/packages/atproto_client/models/app/bsky/embed/record_with_media.py b/packages/atproto_client/models/app/bsky/embed/record_with_media.py index b123e356..775f385f 100644 --- a/packages/atproto_client/models/app/bsky/embed/record_with_media.py +++ b/packages/atproto_client/models/app/bsky/embed/record_with_media.py @@ -19,7 +19,8 @@ class Main(base.ModelBase): """Definition model for :obj:`app.bsky.embed.recordWithMedia`.""" media: te.Annotated[ - t.Union['models.AppBskyEmbedImages.Main', 'models.AppBskyEmbedExternal.Main'], Field(discriminator='py_type') + t.Union['models.AppBskyEmbedImages.Main', 'models.AppBskyEmbedVideo.Main', 'models.AppBskyEmbedExternal.Main'], + Field(discriminator='py_type'), ] #: Media. record: 'models.AppBskyEmbedRecord.Main' #: Record. @@ -32,7 +33,8 @@ class View(base.ModelBase): """Definition model for :obj:`app.bsky.embed.recordWithMedia`.""" media: te.Annotated[ - t.Union['models.AppBskyEmbedImages.View', 'models.AppBskyEmbedExternal.View'], Field(discriminator='py_type') + t.Union['models.AppBskyEmbedImages.View', 'models.AppBskyEmbedVideo.View', 'models.AppBskyEmbedExternal.View'], + Field(discriminator='py_type'), ] #: Media. record: 'models.AppBskyEmbedRecord.View' #: Record. diff --git a/packages/atproto_client/models/app/bsky/embed/video.py b/packages/atproto_client/models/app/bsky/embed/video.py new file mode 100644 index 00000000..03c290ba --- /dev/null +++ b/packages/atproto_client/models/app/bsky/embed/video.py @@ -0,0 +1,53 @@ +################################################################## +# THIS IS THE AUTO-GENERATED CODE. DON'T EDIT IT BY HANDS! +# Copyright (C) 2024 Ilya (Marshal) . +# This file is part of Python atproto SDK. Licenced under MIT. +################################################################## + + +import typing as t + +from pydantic import Field + +if t.TYPE_CHECKING: + from atproto_client import models + from atproto_client.models.blob_ref import BlobRef +from atproto_client.models import base + + +class Main(base.ModelBase): + """Definition model for :obj:`app.bsky.embed.video`.""" + + video: 'BlobRef' #: Video. + alt: t.Optional[str] = Field( + default=None, max_length=10000 + ) #: Alt text description of the video, for accessibility. + aspect_ratio: t.Optional['models.AppBskyEmbedDefs.AspectRatio'] = None #: Aspect ratio. + captions: t.Optional[t.List['models.AppBskyEmbedVideo.Caption']] = Field(default=None, max_length=20) #: Captions. + + py_type: t.Literal['app.bsky.embed.video'] = Field(default='app.bsky.embed.video', alias='$type', frozen=True) + + +class Caption(base.ModelBase): + """Definition model for :obj:`app.bsky.embed.video`.""" + + file: 'BlobRef' #: File. + lang: str #: Lang. + + py_type: t.Literal['app.bsky.embed.video#caption'] = Field( + default='app.bsky.embed.video#caption', alias='$type', frozen=True + ) + + +class View(base.ModelBase): + """Definition model for :obj:`app.bsky.embed.video`.""" + + cid: str #: Cid. + playlist: str #: Playlist. + alt: t.Optional[str] = Field(default=None, max_length=10000) #: Alt. + aspect_ratio: t.Optional['models.AppBskyEmbedDefs.AspectRatio'] = None #: Aspect ratio. + thumbnail: t.Optional[str] = None #: Thumbnail. + + py_type: t.Literal['app.bsky.embed.video#view'] = Field( + default='app.bsky.embed.video#view', alias='$type', frozen=True + ) diff --git a/packages/atproto_client/models/app/bsky/feed/defs.py b/packages/atproto_client/models/app/bsky/feed/defs.py index 174e7da9..e51b51ea 100644 --- a/packages/atproto_client/models/app/bsky/feed/defs.py +++ b/packages/atproto_client/models/app/bsky/feed/defs.py @@ -28,6 +28,7 @@ class PostView(base.ModelBase): te.Annotated[ t.Union[ 'models.AppBskyEmbedImages.View', + 'models.AppBskyEmbedVideo.View', 'models.AppBskyEmbedExternal.View', 'models.AppBskyEmbedRecord.View', 'models.AppBskyEmbedRecordWithMedia.View', diff --git a/packages/atproto_client/models/app/bsky/feed/post.py b/packages/atproto_client/models/app/bsky/feed/post.py index b79b8255..1ae3f962 100644 --- a/packages/atproto_client/models/app/bsky/feed/post.py +++ b/packages/atproto_client/models/app/bsky/feed/post.py @@ -58,6 +58,7 @@ class Record(base.RecordModelBase): te.Annotated[ t.Union[ 'models.AppBskyEmbedImages.Main', + 'models.AppBskyEmbedVideo.Main', 'models.AppBskyEmbedExternal.Main', 'models.AppBskyEmbedRecord.Main', 'models.AppBskyEmbedRecordWithMedia.Main', diff --git a/packages/atproto_client/models/app/bsky/video/__init__.py b/packages/atproto_client/models/app/bsky/video/__init__.py new file mode 100644 index 00000000..ca92af6a --- /dev/null +++ b/packages/atproto_client/models/app/bsky/video/__init__.py @@ -0,0 +1,6 @@ +################################################################## +# THIS IS THE AUTO-GENERATED CODE. DON'T EDIT IT BY HANDS! +# Copyright (C) 2024 Ilya (Marshal) . +# This file is part of Python atproto SDK. Licenced under MIT. +################################################################## + diff --git a/packages/atproto_client/models/app/bsky/video/defs.py b/packages/atproto_client/models/app/bsky/video/defs.py new file mode 100644 index 00000000..d9c1e23e --- /dev/null +++ b/packages/atproto_client/models/app/bsky/video/defs.py @@ -0,0 +1,30 @@ +################################################################## +# THIS IS THE AUTO-GENERATED CODE. DON'T EDIT IT BY HANDS! +# Copyright (C) 2024 Ilya (Marshal) . +# This file is part of Python atproto SDK. Licenced under MIT. +################################################################## + + +import typing as t + +from pydantic import Field + +if t.TYPE_CHECKING: + from atproto_client.models.blob_ref import BlobRef +from atproto_client.models import base + + +class JobStatus(base.ModelBase): + """Definition model for :obj:`app.bsky.video.defs`.""" + + 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. + blob: t.Optional['BlobRef'] = None #: Blob. + error: t.Optional[str] = None #: Error. + message: t.Optional[str] = None #: Message. + progress: t.Optional[int] = Field(default=None, ge=0, le=100) #: Progress within the current processing state. + + py_type: t.Literal['app.bsky.video.defs#jobStatus'] = Field( + default='app.bsky.video.defs#jobStatus', alias='$type', frozen=True + ) diff --git a/packages/atproto_client/models/app/bsky/video/get_job_status.py b/packages/atproto_client/models/app/bsky/video/get_job_status.py new file mode 100644 index 00000000..71028f2f --- /dev/null +++ b/packages/atproto_client/models/app/bsky/video/get_job_status.py @@ -0,0 +1,28 @@ +################################################################## +# THIS IS THE AUTO-GENERATED CODE. DON'T EDIT IT BY HANDS! +# Copyright (C) 2024 Ilya (Marshal) . +# This file is part of Python atproto SDK. Licenced under MIT. +################################################################## + + +import typing as t + +if t.TYPE_CHECKING: + from atproto_client import models +from atproto_client.models import base + + +class Params(base.ParamsModelBase): + """Parameters model for :obj:`app.bsky.video.getJobStatus`.""" + + job_id: str #: Job id. + + +class ParamsDict(t.TypedDict): + job_id: str #: Job id. + + +class Response(base.ResponseModelBase): + """Output data model for :obj:`app.bsky.video.getJobStatus`.""" + + job_status: 'models.AppBskyVideoDefs.JobStatus' #: Job status. diff --git a/packages/atproto_client/models/app/bsky/video/get_upload_limits.py b/packages/atproto_client/models/app/bsky/video/get_upload_limits.py new file mode 100644 index 00000000..0b3dfc84 --- /dev/null +++ b/packages/atproto_client/models/app/bsky/video/get_upload_limits.py @@ -0,0 +1,20 @@ +################################################################## +# THIS IS THE AUTO-GENERATED CODE. DON'T EDIT IT BY HANDS! +# Copyright (C) 2024 Ilya (Marshal) . +# This file is part of Python atproto SDK. Licenced under MIT. +################################################################## + + +import typing as t + +from atproto_client.models import base + + +class Response(base.ResponseModelBase): + """Output data model for :obj:`app.bsky.video.getUploadLimits`.""" + + can_upload: bool #: Can upload. + error: t.Optional[str] = None #: Error. + message: t.Optional[str] = None #: Message. + remaining_daily_bytes: t.Optional[int] = None #: Remaining daily bytes. + remaining_daily_videos: t.Optional[int] = None #: Remaining daily videos. diff --git a/packages/atproto_client/models/app/bsky/video/upload_video.py b/packages/atproto_client/models/app/bsky/video/upload_video.py new file mode 100644 index 00000000..9474ae12 --- /dev/null +++ b/packages/atproto_client/models/app/bsky/video/upload_video.py @@ -0,0 +1,23 @@ +################################################################## +# THIS IS THE AUTO-GENERATED CODE. DON'T EDIT IT BY HANDS! +# Copyright (C) 2024 Ilya (Marshal) . +# This file is part of Python atproto SDK. Licenced under MIT. +################################################################## + + +import typing as t + +import typing_extensions as te + +if t.TYPE_CHECKING: + from atproto_client import models +from atproto_client.models import base + +#: Data raw data type. +Data: te.TypeAlias = bytes + + +class Response(base.ResponseModelBase): + """Output data model for :obj:`app.bsky.video.uploadVideo`.""" + + job_status: 'models.AppBskyVideoDefs.JobStatus' #: Job status. diff --git a/packages/atproto_client/namespaces/async_ns.py b/packages/atproto_client/namespaces/async_ns.py index 1fc71bdb..43317335 100644 --- a/packages/atproto_client/namespaces/async_ns.py +++ b/packages/atproto_client/namespaces/async_ns.py @@ -30,6 +30,7 @@ def __init__(self, client: 'AsyncClientRaw') -> None: self.labeler = AppBskyLabelerNamespace(self._client) self.notification = AppBskyNotificationNamespace(self._client) self.unspecced = AppBskyUnspeccedNamespace(self._client) + self.video = AppBskyVideoNamespace(self._client) class AppBskyActorProfileRecord(AsyncRecordBase): @@ -3655,6 +3656,74 @@ async def search_posts_skeleton( return get_response_model(response, models.AppBskyUnspeccedSearchPostsSkeleton.Response) +class AppBskyVideoNamespace(AsyncNamespaceBase): + async def get_job_status( + self, + params: t.Union[models.AppBskyVideoGetJobStatus.Params, models.AppBskyVideoGetJobStatus.ParamsDict], + **kwargs: t.Any, + ) -> 'models.AppBskyVideoGetJobStatus.Response': + """Get status details for a video processing job. + + Args: + params: Parameters. + **kwargs: Arbitrary arguments to HTTP request. + + Returns: + :obj:`models.AppBskyVideoGetJobStatus.Response`: Output model. + + Raises: + :class:`atproto.exceptions.AtProtocolError`: Base exception. + """ + params_model = t.cast( + 'models.AppBskyVideoGetJobStatus.Params', get_or_create(params, models.AppBskyVideoGetJobStatus.Params) + ) + response = await self._client.invoke_query( + 'app.bsky.video.getJobStatus', params=params_model, output_encoding='application/json', **kwargs + ) + return get_response_model(response, models.AppBskyVideoGetJobStatus.Response) + + async def get_upload_limits(self, **kwargs: t.Any) -> 'models.AppBskyVideoGetUploadLimits.Response': + """Get video upload limits for the authenticated user. + + Args: + **kwargs: Arbitrary arguments to HTTP request. + + Returns: + :obj:`models.AppBskyVideoGetUploadLimits.Response`: Output model. + + Raises: + :class:`atproto.exceptions.AtProtocolError`: Base exception. + """ + response = await self._client.invoke_query( + 'app.bsky.video.getUploadLimits', output_encoding='application/json', **kwargs + ) + return get_response_model(response, models.AppBskyVideoGetUploadLimits.Response) + + async def upload_video( + self, data: 'models.AppBskyVideoUploadVideo.Data', **kwargs: t.Any + ) -> 'models.AppBskyVideoUploadVideo.Response': + """Upload a video to be processed then stored on the PDS. + + Args: + data: Input data alias. + **kwargs: Arbitrary arguments to HTTP request. + + Returns: + :obj:`models.AppBskyVideoUploadVideo.Response`: Output model. + + Raises: + :class:`atproto.exceptions.AtProtocolError`: Base exception. + """ + response = await self._client.invoke_procedure( + 'app.bsky.video.uploadVideo', + data=data, + input_encoding='video/mp4', + output_encoding='application/json', + **kwargs, + ) + return get_response_model(response, models.AppBskyVideoUploadVideo.Response) + + class ChatNamespace(AsyncNamespaceBase): def __init__(self, client: 'AsyncClientRaw') -> None: super().__init__(client) diff --git a/packages/atproto_client/namespaces/sync_ns.py b/packages/atproto_client/namespaces/sync_ns.py index 47d020ce..46268d11 100644 --- a/packages/atproto_client/namespaces/sync_ns.py +++ b/packages/atproto_client/namespaces/sync_ns.py @@ -30,6 +30,7 @@ def __init__(self, client: 'ClientRaw') -> None: self.labeler = AppBskyLabelerNamespace(self._client) self.notification = AppBskyNotificationNamespace(self._client) self.unspecced = AppBskyUnspeccedNamespace(self._client) + self.video = AppBskyVideoNamespace(self._client) class AppBskyActorProfileRecord(RecordBase): @@ -3655,6 +3656,74 @@ def search_posts_skeleton( return get_response_model(response, models.AppBskyUnspeccedSearchPostsSkeleton.Response) +class AppBskyVideoNamespace(NamespaceBase): + def get_job_status( + self, + params: t.Union[models.AppBskyVideoGetJobStatus.Params, models.AppBskyVideoGetJobStatus.ParamsDict], + **kwargs: t.Any, + ) -> 'models.AppBskyVideoGetJobStatus.Response': + """Get status details for a video processing job. + + Args: + params: Parameters. + **kwargs: Arbitrary arguments to HTTP request. + + Returns: + :obj:`models.AppBskyVideoGetJobStatus.Response`: Output model. + + Raises: + :class:`atproto.exceptions.AtProtocolError`: Base exception. + """ + params_model = t.cast( + 'models.AppBskyVideoGetJobStatus.Params', get_or_create(params, models.AppBskyVideoGetJobStatus.Params) + ) + response = self._client.invoke_query( + 'app.bsky.video.getJobStatus', params=params_model, output_encoding='application/json', **kwargs + ) + return get_response_model(response, models.AppBskyVideoGetJobStatus.Response) + + def get_upload_limits(self, **kwargs: t.Any) -> 'models.AppBskyVideoGetUploadLimits.Response': + """Get video upload limits for the authenticated user. + + Args: + **kwargs: Arbitrary arguments to HTTP request. + + Returns: + :obj:`models.AppBskyVideoGetUploadLimits.Response`: Output model. + + Raises: + :class:`atproto.exceptions.AtProtocolError`: Base exception. + """ + response = self._client.invoke_query( + 'app.bsky.video.getUploadLimits', output_encoding='application/json', **kwargs + ) + return get_response_model(response, models.AppBskyVideoGetUploadLimits.Response) + + def upload_video( + self, data: 'models.AppBskyVideoUploadVideo.Data', **kwargs: t.Any + ) -> 'models.AppBskyVideoUploadVideo.Response': + """Upload a video to be processed then stored on the PDS. + + Args: + data: Input data alias. + **kwargs: Arbitrary arguments to HTTP request. + + Returns: + :obj:`models.AppBskyVideoUploadVideo.Response`: Output model. + + Raises: + :class:`atproto.exceptions.AtProtocolError`: Base exception. + """ + response = self._client.invoke_procedure( + 'app.bsky.video.uploadVideo', + data=data, + input_encoding='video/mp4', + output_encoding='application/json', + **kwargs, + ) + return get_response_model(response, models.AppBskyVideoUploadVideo.Response) + + class ChatNamespace(NamespaceBase): def __init__(self, client: 'ClientRaw') -> None: super().__init__(client)