atproto explorer pdsls.dev
atproto tool

switch to simpleFetchHandler

juli.ee daeccf11 c141b1fb

verified
+2 -2
src/auth/session-manager.ts
···
-
import { Client, CredentialManager } from "@atcute/client";
+
import { Client, simpleFetchHandler } from "@atcute/client";
import { Did } from "@atcute/lexicons";
import {
finalizeAuthorization,
···
export const getAvatar = async (did: Did): Promise<string | undefined> => {
const rpc = new Client({
-
handler: new CredentialManager({ service: "https://public.api.bsky.app" }),
+
handler: simpleFetchHandler({ service: "https://public.api.bsky.app" }),
});
const res = await rpc.get("app.bsky.actor.getProfile", { params: { actor: did } });
if (res.ok) {
+2 -2
src/components/search.tsx
···
-
import { Client, CredentialManager } from "@atcute/client";
+
import { Client, simpleFetchHandler } from "@atcute/client";
import { Nsid } from "@atcute/lexicons";
import { A, useLocation, useNavigate } from "@solidjs/router";
import { createResource, createSignal, For, onCleanup, onMount, Show } from "solid-js";
···
const navigate = useNavigate();
let searchInput!: HTMLInputElement;
const rpc = new Client({
-
handler: new CredentialManager({ service: "https://public.api.bsky.app" }),
+
handler: simpleFetchHandler({ service: "https://public.api.bsky.app" }),
});
onMount(() => {
+2 -2
src/views/blob.tsx
···
-
import { Client, CredentialManager } from "@atcute/client";
+
import { Client, simpleFetchHandler } from "@atcute/client";
import { createResource, createSignal, For, Show } from "solid-js";
import { Button } from "../components/button";
···
let rpc: Client;
const fetchBlobs = async () => {
-
if (!rpc) rpc = new Client({ handler: new CredentialManager({ service: props.pds }) });
+
if (!rpc) rpc = new Client({ handler: simpleFetchHandler({ service: props.pds }) });
const res = await rpc.get("com.atproto.sync.listBlobs", {
params: {
did: props.repo as `did:${string}:${string}`,
+2 -2
src/views/collection.tsx
···
import { ComAtprotoRepoApplyWrites, ComAtprotoRepoGetRecord } from "@atcute/atproto";
-
import { Client, CredentialManager } from "@atcute/client";
+
import { Client, simpleFetchHandler } from "@atcute/client";
import { $type, ActorIdentifier, InferXRPCBodyOutput } from "@atcute/lexicons";
import * as TID from "@atcute/tid";
import { A, useParams } from "@solidjs/router";
···
const fetchRecords = async () => {
if (!pds) pds = await resolvePDS(did!);
-
if (!rpc) rpc = new Client({ handler: new CredentialManager({ service: pds }) });
+
if (!rpc) rpc = new Client({ handler: simpleFetchHandler({ service: pds }) });
const res = await rpc.get("com.atproto.repo.listRecords", {
params: {
repo: did as ActorIdentifier,
+2 -2
src/views/labels.tsx
···
import { ComAtprotoLabelDefs } from "@atcute/atproto";
-
import { Client, CredentialManager } from "@atcute/client";
+
import { Client, simpleFetchHandler } from "@atcute/client";
import { isAtprotoDid } from "@atcute/identity";
import { Handle } from "@atcute/lexicons";
import { A, useSearchParams } from "@solidjs/router";
···
await resolvePDS(did);
if (!labelerCache[did]) throw new Error("Repository is not a labeler");
rpc = new Client({
-
handler: new CredentialManager({ service: labelerCache[did] }),
+
handler: simpleFetchHandler({ service: labelerCache[did] }),
});
setSearchParams({ did, uriPatterns });
+2 -2
src/views/pds.tsx
···
import { ComAtprotoServerDescribeServer, ComAtprotoSyncListRepos } from "@atcute/atproto";
-
import { Client, CredentialManager } from "@atcute/client";
+
import { Client, simpleFetchHandler } from "@atcute/client";
import { InferXRPCBodyOutput } from "@atcute/lexicons";
import * as TID from "@atcute/tid";
import { A, useLocation, useParams } from "@solidjs/router";
···
setPDS(params.pds);
const pds =
params.pds!.startsWith("localhost") ? `http://${params.pds}` : `https://${params.pds}`;
-
const rpc = new Client({ handler: new CredentialManager({ service: pds }) });
+
const rpc = new Client({ handler: simpleFetchHandler({ service: pds }) });
const getVersion = async () => {
// @ts-expect-error: undocumented endpoint
+3 -3
src/views/record.tsx
···
-
import { Client, CredentialManager } from "@atcute/client";
+
import { Client, simpleFetchHandler } from "@atcute/client";
import { DidDocument, getPdsEndpoint } from "@atcute/identity";
import { lexiconDoc } from "@atcute/lexicon-doc";
import { RecordValidator } from "@atcute/lexicon-doc/validations";
···
});
}
-
const rpc = new Client({ handler: new CredentialManager({ service: pdsEndpoint }) });
+
const rpc = new Client({ handler: simpleFetchHandler({ service: pdsEndpoint }) });
const response = await rpc.get("com.atproto.repo.getRecord", {
params: {
repo: authority,
···
setValidSchema(undefined);
setLexiconUri(undefined);
const pds = await resolvePDS(did!);
-
rpc = new Client({ handler: new CredentialManager({ service: pds }) });
+
rpc = new Client({ handler: simpleFetchHandler({ service: pds }) });
const res = await rpc.get("com.atproto.repo.getRecord", {
params: {
repo: did as ActorIdentifier,
+2 -2
src/views/repo.tsx
···
-
import { Client, CredentialManager } from "@atcute/client";
+
import { Client, simpleFetchHandler } from "@atcute/client";
import { DidDocument } from "@atcute/identity";
import { ActorIdentifier, Did, Handle, Nsid } from "@atcute/lexicons";
import { A, useLocation, useNavigate, useParams } from "@solidjs/router";
···
return {};
}
-
rpc = new Client({ handler: new CredentialManager({ service: pds }) });
+
rpc = new Client({ handler: simpleFetchHandler({ service: pds }) });
try {
const res = await rpc.get("com.atproto.repo.describeRepo", {
params: { repo: did as ActorIdentifier },