+1
-7
src/commands/config-cmd.ts
+1
-7
src/commands/config-cmd.ts
···
1
1
import { defineCommand } from "citty";
2
2
import { consola } from "consola";
3
3
import { colorize, leftAlign, type ColorName } from "consola/utils";
4
-
import type { Did } from "@atcute/lexicons";
5
4
import { exists, loadConfig } from "../utils.ts";
6
5
7
6
export const configCmd = defineCommand({
···
40
39
publicationStatus = "HandleNotProvided";
41
40
throw new Error("BSKY_HANDLE not provided in .env");
42
41
}
43
-
const didRes = (await (
44
-
await fetch(
45
-
`https://quickdid.smokesignal.tools/xrpc/com.atproto.identity.resolveHandle?handle=${process.env.BSKY_HANDLE}`
46
-
)
47
-
).json()) as { did: Did };
48
42
49
43
const rkey = config.publicationUri.split("/").at(-1) as string;
50
44
51
45
const recordRes = await fetch(
52
-
`https://slingshot.microcosm.blue/xrpc/com.atproto.repo.getRecord?repo=${encodeURIComponent(didRes.did)}&collection=pub.leaflet.publication&rkey=${rkey}`
46
+
`https://slingshot.microcosm.blue/xrpc/com.atproto.repo.getRecord?repo=${encodeURIComponent(process.env.BSKY_HANDLE)}&collection=pub.leaflet.publication&rkey=${rkey}`
53
47
);
54
48
55
49
if (recordRes.status == 400) {