···001export interface LiveLoaderOptions {
2 /**
3 * @description Your repo is either your handle (@you.some.url) or your DID (did:plc... or did:web...). You can find this information using: https://pdsls.dev
···18 pds: string;
19 signing_key: string;
20}
000000000000000000000000
···1+import type { Agent } from "@atproto/api";
2+3export interface LiveLoaderOptions {
4 /**
5 * @description Your repo is either your handle (@you.some.url) or your DID (did:plc... or did:web...). You can find this information using: https://pdsls.dev
···20 pds: string;
21 signing_key: string;
22}
23+24+export interface CollectionFilter {
25+ limit?: number;
26+ reverse?: boolean;
27+ cursor?: string;
28+}
29+30+export interface EntryFilter {
31+ id?: string;
32+}
33+34+export interface GetLeafletDocumentsParams {
35+ repo: string;
36+ agent: Agent;
37+ cursor?: string;
38+ limit?: number;
39+ reverse?: boolean;
40+}
41+42+export interface GetSingleLeafletDocumentParams {
43+ repo: string;
44+ agent: Agent;
45+ id: string;
46+}
+37-3
src/utils.ts
···1import type { Agent } from "@atproto/api";
2-import type { MiniDoc } from "./types.js";
3-import { LiveLoaderError } from "./loader.js";
000045export function uriToRkey(uri: string) {
6 const rkey = uri.split("/").pop();
···29 }
30}
3132-export async function getLeafletDocuments(repo: string, agent: Agent) {
00000033 const response = await agent.com.atproto.repo.listRecords({
34 repo,
35 collection: "pub.leaflet.document",
00036 });
3738 if (response.success === false) {
39 throw new LiveLoaderError(
40 "Could not fetch leaflet documents",
41 "FETCH_FAILED",
00000000000000000000042 );
43 }
44