Skip to content

Latest commit

 

History

History
363 lines (260 loc) · 29.6 KB

README.md

File metadata and controls

363 lines (260 loc) · 29.6 KB

Videos

(videos)

Overview

Available Operations

  • getJobStatus - This endpoint is part of the Bluesky application Lexicon APIs (app.bsky.*). Public endpoints which don't require authentication can be made directly against the public Bluesky AppView API: https://public.api.bsky.app. Authenticated requests are usually made to the user's PDS, with automatic service proxying. Authenticated requests can be used for both public and non-public endpoints.

To learn more about calling atproto API endpoints like this one, see the API Hosts and Auth guide.

Get status details for a video processing job.

  • getUploadLimits - This endpoint is part of the Bluesky application Lexicon APIs (app.bsky.*). Public endpoints which don't require authentication can be made directly against the public Bluesky AppView API: https://public.api.bsky.app. Authenticated requests are usually made to the user's PDS, with automatic service proxying. Authenticated requests can be used for both public and non-public endpoints.

To learn more about calling atproto API endpoints like this one, see the API Hosts and Auth guide.

Get video upload limits for the authenticated user.

  • upload - This endpoint is part of the Bluesky application Lexicon APIs (app.bsky.*). Public endpoints which don't require authentication can be made directly against the public Bluesky AppView API: https://public.api.bsky.app. Authenticated requests are usually made to the user's PDS, with automatic service proxying. Authenticated requests can be used for both public and non-public endpoints.

To learn more about calling atproto API endpoints like this one, see the API Hosts and Auth guide.

Upload a video to be processed then stored on the PDS.

getJobStatus

This endpoint is part of the Bluesky application Lexicon APIs (app.bsky.*). Public endpoints which don't require authentication can be made directly against the public Bluesky AppView API: https://public.api.bsky.app. Authenticated requests are usually made to the user's PDS, with automatic service proxying. Authenticated requests can be used for both public and non-public endpoints.

To learn more about calling atproto API endpoints like this one, see the API Hosts and Auth guide.

Get status details for a video processing job.

Example Usage

import { Bluesky } from "@speakeasy-sdks/bluesky";

const bluesky = new Bluesky({
  bearer: process.env["BLUESKY_BEARER"] ?? "",
});

async function run() {
  const result = await bluesky.videos.getJobStatus({
    jobId: "<id>",
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { BlueskyCore } from "@speakeasy-sdks/bluesky/core.js";
import { videosGetJobStatus } from "@speakeasy-sdks/bluesky/funcs/videosGetJobStatus.js";

// Use `BlueskyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const bluesky = new BlueskyCore({
  bearer: process.env["BLUESKY_BEARER"] ?? "",
});

async function run() {
  const res = await videosGetJobStatus(bluesky, {
    jobId: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

import {
  // Query hooks for fetching data.
  useVideosGetJobStatus,
  useVideosGetJobStatusSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchVideosGetJobStatus,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateVideosGetJobStatus,
  invalidateAllVideosGetJobStatus,
} from "@speakeasy-sdks/bluesky/react-query/videosGetJobStatus.js";

Parameters

Parameter Type Required Description
request operations.AppBskyVideoGetJobStatusRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.AppBskyVideoGetJobStatusResponseBody>

Errors

Error Type Status Code Content Type
errors.BadRequestAppBskyVideoGetJobStatusResponseBodyError 400 application/json
errors.UnauthorizedAppBskyVideoGetJobStatusResponseBodyError 401 application/json
errors.NotFoundError 404 application/json
errors.UnauthorizedError 403, 407 application/json
errors.TimeoutError 408 application/json
errors.RateLimitedError 429 application/json
errors.BadRequestError 413, 414, 415, 422, 431 application/json
errors.TimeoutError 504 application/json
errors.NotFoundError 501, 505 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.BadRequestError 510 application/json
errors.UnauthorizedError 511 application/json
errors.APIError 4XX, 5XX */*

getUploadLimits

This endpoint is part of the Bluesky application Lexicon APIs (app.bsky.*). Public endpoints which don't require authentication can be made directly against the public Bluesky AppView API: https://public.api.bsky.app. Authenticated requests are usually made to the user's PDS, with automatic service proxying. Authenticated requests can be used for both public and non-public endpoints.

To learn more about calling atproto API endpoints like this one, see the API Hosts and Auth guide.

Get video upload limits for the authenticated user.

Example Usage

import { Bluesky } from "@speakeasy-sdks/bluesky";

const bluesky = new Bluesky({
  bearer: process.env["BLUESKY_BEARER"] ?? "",
});

async function run() {
  const result = await bluesky.videos.getUploadLimits();

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { BlueskyCore } from "@speakeasy-sdks/bluesky/core.js";
import { videosGetUploadLimits } from "@speakeasy-sdks/bluesky/funcs/videosGetUploadLimits.js";

// Use `BlueskyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const bluesky = new BlueskyCore({
  bearer: process.env["BLUESKY_BEARER"] ?? "",
});

async function run() {
  const res = await videosGetUploadLimits(bluesky);

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

import {
  // Query hooks for fetching data.
  useVideosGetUploadLimits,
  useVideosGetUploadLimitsSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchVideosGetUploadLimits,
  
  // Utility to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateAllVideosGetUploadLimits,
} from "@speakeasy-sdks/bluesky/react-query/videosGetUploadLimits.js";

Parameters

Parameter Type Required Description
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.AppBskyVideoGetUploadLimitsResponseBody>

Errors

Error Type Status Code Content Type
errors.BadRequestAppBskyVideoGetUploadLimitsResponseBodyError 400 application/json
errors.UnauthorizedAppBskyVideoGetUploadLimitsResponseBodyError 401 application/json
errors.NotFoundError 404 application/json
errors.UnauthorizedError 403, 407 application/json
errors.TimeoutError 408 application/json
errors.RateLimitedError 429 application/json
errors.BadRequestError 413, 414, 415, 422, 431 application/json
errors.TimeoutError 504 application/json
errors.NotFoundError 501, 505 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.BadRequestError 510 application/json
errors.UnauthorizedError 511 application/json
errors.APIError 4XX, 5XX */*

upload

This endpoint is part of the Bluesky application Lexicon APIs (app.bsky.*). Public endpoints which don't require authentication can be made directly against the public Bluesky AppView API: https://public.api.bsky.app. Authenticated requests are usually made to the user's PDS, with automatic service proxying. Authenticated requests can be used for both public and non-public endpoints.

To learn more about calling atproto API endpoints like this one, see the API Hosts and Auth guide.

Upload a video to be processed then stored on the PDS.

Example Usage

import { Bluesky } from "@speakeasy-sdks/bluesky";
import { openAsBlob } from "node:fs";

const bluesky = new Bluesky({
  bearer: process.env["BLUESKY_BEARER"] ?? "",
});

async function run() {
  const result = await bluesky.videos.upload(await openAsBlob("example.file"));

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { BlueskyCore } from "@speakeasy-sdks/bluesky/core.js";
import { videosUpload } from "@speakeasy-sdks/bluesky/funcs/videosUpload.js";
import { openAsBlob } from "node:fs";

// Use `BlueskyCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const bluesky = new BlueskyCore({
  bearer: process.env["BLUESKY_BEARER"] ?? "",
});

async function run() {
  const res = await videosUpload(bluesky, await openAsBlob("example.file"));

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

import {
  // Mutation hook for triggering the API call.
  useVideosUploadMutation
} from "@speakeasy-sdks/bluesky/react-query/videosUpload.js";

Parameters

Parameter Type Required Description
request ReadableStream ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.AppBskyVideoUploadVideoResponseBody>

Errors

Error Type Status Code Content Type
errors.BadRequestAppBskyVideoUploadVideoResponseBodyError 400 application/json
errors.UnauthorizedAppBskyVideoUploadVideoResponseBodyError 401 application/json
errors.NotFoundError 404 application/json
errors.UnauthorizedError 403, 407 application/json
errors.TimeoutError 408 application/json
errors.RateLimitedError 429 application/json
errors.BadRequestError 413, 414, 415, 422, 431 application/json
errors.TimeoutError 504 application/json
errors.NotFoundError 501, 505 application/json
errors.InternalServerError 500, 502, 503, 506, 507, 508 application/json
errors.BadRequestError 510 application/json
errors.UnauthorizedError 511 application/json
errors.APIError 4XX, 5XX */*