Skip to content

Latest commit

 

History

History
498 lines (355 loc) · 39.2 KB

README.md

File metadata and controls

498 lines (355 loc) · 39.2 KB

Syncs

(syncs)

Overview

Available Operations

  • getBlocks - This endpoint is part of the atproto repository synchronization APIs. Requests usually do not require authentication, and can be made to PDS intances or Relay instances.*

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

Get data blocks from a given repo, by CID. For example, intermediate MST nodes, or records. Does not require auth; implemented by PDS.

  • getLatestCommit - This endpoint is part of the atproto repository synchronization APIs. Requests usually do not require authentication, and can be made to PDS intances or Relay instances.*

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

Get the current commit CID & revision of the specified repo. Does not require auth.

  • getRepoStatus - This endpoint is part of the atproto repository synchronization APIs. Requests usually do not require authentication, and can be made to PDS intances or Relay instances.*

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

Get the hosting status for a repository, on this server. Expected to be implemented by PDS and Relay.

  • requestCrawl - This endpoint is part of the atproto repository synchronization APIs. Requests usually do not require authentication, and can be made to PDS intances or Relay instances.*

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

Request a service to persistently crawl hosted repos. Expected use is new PDS instances declaring their existence to Relays. Does not require auth.

getBlocks

This endpoint is part of the atproto repository synchronization APIs. Requests usually do not require authentication, and can be made to PDS intances or Relay instances.*

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

Get data blocks from a given repo, by CID. For example, intermediate MST nodes, or records. Does not require auth; implemented by PDS.

Example Usage

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

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

async function run() {
  await bluesky.syncs.getBlocks({
    did: "<id>",
    cids: [

    ],
  });


}

run();

Standalone function

The standalone function version of this method:

import { BlueskyCore } from "@speakeasy-sdks/bluesky/core.js";
import { syncsGetBlocks } from "@speakeasy-sdks/bluesky/funcs/syncsGetBlocks.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 syncsGetBlocks(bluesky, {
    did: "<id>",
    cids: [
  
    ],
  });

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

  const { value: result } = res;

  
}

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.
  useSyncsGetBlocks,
  useSyncsGetBlocksSuspense,

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

Parameters

Parameter Type Required Description
request operations.ComAtprotoSyncGetBlocksRequest ✔️ 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<void>

Errors

Error Type Status Code Content Type
errors.BadRequestComAtprotoSyncGetBlocksResponseBodyError 400 application/json
errors.UnauthorizedComAtprotoSyncGetBlocksResponseBodyError 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 */*

getLatestCommit

This endpoint is part of the atproto repository synchronization APIs. Requests usually do not require authentication, and can be made to PDS intances or Relay instances.*

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

Get the current commit CID & revision of the specified repo. Does not require auth.

Example Usage

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

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

async function run() {
  const result = await bluesky.syncs.getLatestCommit({
    did: "<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 { syncsGetLatestCommit } from "@speakeasy-sdks/bluesky/funcs/syncsGetLatestCommit.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 syncsGetLatestCommit(bluesky, {
    did: "<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.
  useSyncsGetLatestCommit,
  useSyncsGetLatestCommitSuspense,

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

Parameters

Parameter Type Required Description
request operations.ComAtprotoSyncGetLatestCommitRequest ✔️ 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.ComAtprotoSyncGetLatestCommitResponseBody>

Errors

Error Type Status Code Content Type
errors.BadRequestComAtprotoSyncGetLatestCommitResponseBodyError 400 application/json
errors.UnauthorizedComAtprotoSyncGetLatestCommitResponseBodyError 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 */*

getRepoStatus

This endpoint is part of the atproto repository synchronization APIs. Requests usually do not require authentication, and can be made to PDS intances or Relay instances.*

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

Get the hosting status for a repository, on this server. Expected to be implemented by PDS and Relay.

Example Usage

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

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

async function run() {
  const result = await bluesky.syncs.getRepoStatus({
    did: "<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 { syncsGetRepoStatus } from "@speakeasy-sdks/bluesky/funcs/syncsGetRepoStatus.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 syncsGetRepoStatus(bluesky, {
    did: "<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.
  useSyncsGetRepoStatus,
  useSyncsGetRepoStatusSuspense,

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

Parameters

Parameter Type Required Description
request operations.ComAtprotoSyncGetRepoStatusRequest ✔️ 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.ComAtprotoSyncGetRepoStatusResponseBody>

Errors

Error Type Status Code Content Type
errors.BadRequestComAtprotoSyncGetRepoStatusResponseBodyError 400 application/json
errors.UnauthorizedComAtprotoSyncGetRepoStatusResponseBodyError 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 */*

requestCrawl

This endpoint is part of the atproto repository synchronization APIs. Requests usually do not require authentication, and can be made to PDS intances or Relay instances.*

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

Request a service to persistently crawl hosted repos. Expected use is new PDS instances declaring their existence to Relays. Does not require auth.

Example Usage

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

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

async function run() {
  await bluesky.syncs.requestCrawl({
    hostname: "buttery-tenant.name",
  });


}

run();

Standalone function

The standalone function version of this method:

import { BlueskyCore } from "@speakeasy-sdks/bluesky/core.js";
import { syncsRequestCrawl } from "@speakeasy-sdks/bluesky/funcs/syncsRequestCrawl.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 syncsRequestCrawl(bluesky, {
    hostname: "buttery-tenant.name",
  });

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

  const { value: result } = res;

  
}

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.
  useSyncsRequestCrawlMutation
} from "@speakeasy-sdks/bluesky/react-query/syncsRequestCrawl.js";

Parameters

Parameter Type Required Description
request operations.ComAtprotoSyncRequestCrawlBody ✔️ 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<void>

Errors

Error Type Status Code Content Type
errors.BadRequestComAtprotoSyncRequestCrawlResponseBodyError 400 application/json
errors.UnauthorizedComAtprotoSyncRequestCrawlResponseBodyError 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 */*