@atproto/lexicon-resolver
Version:
ATProto Lexicon resolution
68 lines (56 loc) • 1.55 kB
text/typescript
/**
* GENERATED CODE - DO NOT MODIFY
*/
import {
XrpcClient,
type FetchHandler,
type FetchHandlerOptions,
} from '@atproto/xrpc'
import { schemas } from './lexicons.js'
import { CID } from 'multiformats/cid'
import { type OmitKey, type Un$Typed } from './util.js'
import * as ComAtprotoSyncGetRecord from './types/com/atproto/sync/getRecord.js'
export * as ComAtprotoSyncGetRecord from './types/com/atproto/sync/getRecord.js'
export class AtpBaseClient extends XrpcClient {
com: ComNS
constructor(options: FetchHandler | FetchHandlerOptions) {
super(options, schemas)
this.com = new ComNS(this)
}
/** @deprecated use `this` instead */
get xrpc(): XrpcClient {
return this
}
}
export class ComNS {
_client: XrpcClient
atproto: ComAtprotoNS
constructor(client: XrpcClient) {
this._client = client
this.atproto = new ComAtprotoNS(client)
}
}
export class ComAtprotoNS {
_client: XrpcClient
sync: ComAtprotoSyncNS
constructor(client: XrpcClient) {
this._client = client
this.sync = new ComAtprotoSyncNS(client)
}
}
export class ComAtprotoSyncNS {
_client: XrpcClient
constructor(client: XrpcClient) {
this._client = client
}
getRecord(
params?: ComAtprotoSyncGetRecord.QueryParams,
opts?: ComAtprotoSyncGetRecord.CallOptions,
): Promise<ComAtprotoSyncGetRecord.Response> {
return this._client
.call('com.atproto.sync.getRecord', params, undefined, opts)
.catch((e) => {
throw ComAtprotoSyncGetRecord.toKnownErr(e)
})
}
}