add session and content resolution for activity
This commit is contained in:
parent
6600ba56bf
commit
e876d5846e
4 changed files with 83 additions and 15 deletions
|
|
@ -7,6 +7,8 @@ import {
|
|||
XrpcHandleResolver
|
||||
} from '@atcute/identity-resolver';
|
||||
|
||||
import type { At } from '@atcute/client/lexicons';
|
||||
|
||||
const didDocumentResolver = new CompositeDidDocumentResolver({
|
||||
methods: {
|
||||
plc: new PlcDidDocumentResolver(),
|
||||
|
|
@ -68,3 +70,33 @@ export async function getActivity(rpc: XRPC, did: string) {
|
|||
});
|
||||
return records;
|
||||
}
|
||||
|
||||
export async function resolveSession(rpc: XRPC, uri: At.Uri) {
|
||||
const repo = uri.split('at://')[1].split('/')[0];
|
||||
const rkey = uri.split('/')[4];
|
||||
const {
|
||||
data: { value }
|
||||
} = await rpc.get('com.atproto.repo.getRecord', {
|
||||
params: {
|
||||
repo,
|
||||
rkey,
|
||||
collection: 'me.woach.feed.session'
|
||||
}
|
||||
});
|
||||
return value;
|
||||
}
|
||||
|
||||
export async function resolveMedia(rpc: XRPC, uri: At.Uri) {
|
||||
const repo = uri.split('at://')[1].split('/')[0];
|
||||
const rkey = uri.split('/')[4];
|
||||
const {
|
||||
data: { value }
|
||||
} = await rpc.get('com.atproto.repo.getRecord', {
|
||||
params: {
|
||||
repo,
|
||||
rkey,
|
||||
collection: 'me.woach.content.anilist'
|
||||
}
|
||||
});
|
||||
return value;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue