Skip to content

Commit

Permalink
Add methods to handle video upload and job status in BskyFacade.
Browse files Browse the repository at this point in the history
  • Loading branch information
shahmal1yev committed Jan 28, 2025
1 parent 5a5baa2 commit 2eac9ce
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/BskyFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@
use Atproto\Lexicons\App\Bsky\Feed\Post;
use Atproto\Lexicons\App\Bsky\Feed\SearchPosts;
use Atproto\Lexicons\App\Bsky\Graph\GetFollowers;
use Atproto\Lexicons\App\Bsky\Video\GetJobStatus;
use Atproto\Lexicons\App\Bsky\Video\UploadVideo;
use Atproto\Lexicons\Com\Atproto\Repo\CreateRecord;
use Atproto\Lexicons\Com\Atproto\Repo\StrongRef;
use Atproto\Lexicons\Com\Atproto\Repo\UploadBlob;
use Atproto\Lexicons\Com\Atproto\Server\CreateSession;
use Atproto\Lexicons\Com\Atproto\Server\GetServiceAuth;
use Atproto\Lexicons\Com\Atproto\Server\GetSession;
use Atproto\Lexicons\Com\Atproto\Server\RefreshSession;
use Atproto\Responses\Com\Atproto\Server\CreateSessionResponse;
use Atproto\Support\FileSupport;

class BskyFacade
{
Expand Down Expand Up @@ -270,4 +274,23 @@ public function videoEmbed(Blob $blob): Video
{
return $this->client->app()->bsky()->embed()->video()->forge($blob);
}

public function getServiceAuth(): GetServiceAuth
{
return $this->client->com()->atproto()->server()->getServiceAuth()->forge();
}

public function uploadVideo(
string $name,
FileSupport $file,
string $token = null
): UploadVideo
{
return $this->client->app()->bsky()->video()->uploadVideo()->forge($name, $file, $token);
}

public function getJobStatus(string $jobId): GetJobStatus
{
return $this->client->app()->bsky()->video()->getJobStatus()->forge($jobId);
}
}

0 comments on commit 2eac9ce

Please sign in to comment.