a tool for shared writing and social publishing
1/**
2 * GENERATED CODE - DO NOT MODIFY
3 */
4import {
5 XrpcClient,
6 type FetchHandler,
7 type FetchHandlerOptions,
8} from '@atproto/xrpc'
9import { schemas } from './lexicons'
10import { CID } from 'multiformats/cid'
11import { type OmitKey, type Un$Typed } from './util'
12import * as AppBskyActorProfile from './types/app/bsky/actor/profile'
13import * as ComAtprotoLabelDefs from './types/com/atproto/label/defs'
14import * as ComAtprotoRepoApplyWrites from './types/com/atproto/repo/applyWrites'
15import * as ComAtprotoRepoCreateRecord from './types/com/atproto/repo/createRecord'
16import * as ComAtprotoRepoDefs from './types/com/atproto/repo/defs'
17import * as ComAtprotoRepoDeleteRecord from './types/com/atproto/repo/deleteRecord'
18import * as ComAtprotoRepoDescribeRepo from './types/com/atproto/repo/describeRepo'
19import * as ComAtprotoRepoGetRecord from './types/com/atproto/repo/getRecord'
20import * as ComAtprotoRepoImportRepo from './types/com/atproto/repo/importRepo'
21import * as ComAtprotoRepoListMissingBlobs from './types/com/atproto/repo/listMissingBlobs'
22import * as ComAtprotoRepoListRecords from './types/com/atproto/repo/listRecords'
23import * as ComAtprotoRepoPutRecord from './types/com/atproto/repo/putRecord'
24import * as ComAtprotoRepoStrongRef from './types/com/atproto/repo/strongRef'
25import * as ComAtprotoRepoUploadBlob from './types/com/atproto/repo/uploadBlob'
26import * as PubLeafletBlocksBlockquote from './types/pub/leaflet/blocks/blockquote'
27import * as PubLeafletBlocksBskyPost from './types/pub/leaflet/blocks/bskyPost'
28import * as PubLeafletBlocksButton from './types/pub/leaflet/blocks/button'
29import * as PubLeafletBlocksCode from './types/pub/leaflet/blocks/code'
30import * as PubLeafletBlocksHeader from './types/pub/leaflet/blocks/header'
31import * as PubLeafletBlocksHorizontalRule from './types/pub/leaflet/blocks/horizontalRule'
32import * as PubLeafletBlocksIframe from './types/pub/leaflet/blocks/iframe'
33import * as PubLeafletBlocksImage from './types/pub/leaflet/blocks/image'
34import * as PubLeafletBlocksMath from './types/pub/leaflet/blocks/math'
35import * as PubLeafletBlocksOrderedList from './types/pub/leaflet/blocks/orderedList'
36import * as PubLeafletBlocksPage from './types/pub/leaflet/blocks/page'
37import * as PubLeafletBlocksPoll from './types/pub/leaflet/blocks/poll'
38import * as PubLeafletBlocksText from './types/pub/leaflet/blocks/text'
39import * as PubLeafletBlocksUnorderedList from './types/pub/leaflet/blocks/unorderedList'
40import * as PubLeafletBlocksWebsite from './types/pub/leaflet/blocks/website'
41import * as PubLeafletComment from './types/pub/leaflet/comment'
42import * as PubLeafletContent from './types/pub/leaflet/content'
43import * as PubLeafletDocument from './types/pub/leaflet/document'
44import * as PubLeafletGraphSubscription from './types/pub/leaflet/graph/subscription'
45import * as PubLeafletInteractionsRecommend from './types/pub/leaflet/interactions/recommend'
46import * as PubLeafletPagesCanvas from './types/pub/leaflet/pages/canvas'
47import * as PubLeafletPagesLinearDocument from './types/pub/leaflet/pages/linearDocument'
48import * as PubLeafletPollDefinition from './types/pub/leaflet/poll/definition'
49import * as PubLeafletPollVote from './types/pub/leaflet/poll/vote'
50import * as PubLeafletPublication from './types/pub/leaflet/publication'
51import * as PubLeafletRichtextFacet from './types/pub/leaflet/richtext/facet'
52import * as PubLeafletThemeBackgroundImage from './types/pub/leaflet/theme/backgroundImage'
53import * as PubLeafletThemeColor from './types/pub/leaflet/theme/color'
54import * as SiteStandardDocument from './types/site/standard/document'
55import * as SiteStandardGraphSubscription from './types/site/standard/graph/subscription'
56import * as SiteStandardPublication from './types/site/standard/publication'
57import * as SiteStandardThemeBasic from './types/site/standard/theme/basic'
58import * as SiteStandardThemeColor from './types/site/standard/theme/color'
59
60export * as AppBskyActorProfile from './types/app/bsky/actor/profile'
61export * as ComAtprotoLabelDefs from './types/com/atproto/label/defs'
62export * as ComAtprotoRepoApplyWrites from './types/com/atproto/repo/applyWrites'
63export * as ComAtprotoRepoCreateRecord from './types/com/atproto/repo/createRecord'
64export * as ComAtprotoRepoDefs from './types/com/atproto/repo/defs'
65export * as ComAtprotoRepoDeleteRecord from './types/com/atproto/repo/deleteRecord'
66export * as ComAtprotoRepoDescribeRepo from './types/com/atproto/repo/describeRepo'
67export * as ComAtprotoRepoGetRecord from './types/com/atproto/repo/getRecord'
68export * as ComAtprotoRepoImportRepo from './types/com/atproto/repo/importRepo'
69export * as ComAtprotoRepoListMissingBlobs from './types/com/atproto/repo/listMissingBlobs'
70export * as ComAtprotoRepoListRecords from './types/com/atproto/repo/listRecords'
71export * as ComAtprotoRepoPutRecord from './types/com/atproto/repo/putRecord'
72export * as ComAtprotoRepoStrongRef from './types/com/atproto/repo/strongRef'
73export * as ComAtprotoRepoUploadBlob from './types/com/atproto/repo/uploadBlob'
74export * as PubLeafletBlocksBlockquote from './types/pub/leaflet/blocks/blockquote'
75export * as PubLeafletBlocksBskyPost from './types/pub/leaflet/blocks/bskyPost'
76export * as PubLeafletBlocksButton from './types/pub/leaflet/blocks/button'
77export * as PubLeafletBlocksCode from './types/pub/leaflet/blocks/code'
78export * as PubLeafletBlocksHeader from './types/pub/leaflet/blocks/header'
79export * as PubLeafletBlocksHorizontalRule from './types/pub/leaflet/blocks/horizontalRule'
80export * as PubLeafletBlocksIframe from './types/pub/leaflet/blocks/iframe'
81export * as PubLeafletBlocksImage from './types/pub/leaflet/blocks/image'
82export * as PubLeafletBlocksMath from './types/pub/leaflet/blocks/math'
83export * as PubLeafletBlocksOrderedList from './types/pub/leaflet/blocks/orderedList'
84export * as PubLeafletBlocksPage from './types/pub/leaflet/blocks/page'
85export * as PubLeafletBlocksPoll from './types/pub/leaflet/blocks/poll'
86export * as PubLeafletBlocksText from './types/pub/leaflet/blocks/text'
87export * as PubLeafletBlocksUnorderedList from './types/pub/leaflet/blocks/unorderedList'
88export * as PubLeafletBlocksWebsite from './types/pub/leaflet/blocks/website'
89export * as PubLeafletComment from './types/pub/leaflet/comment'
90export * as PubLeafletContent from './types/pub/leaflet/content'
91export * as PubLeafletDocument from './types/pub/leaflet/document'
92export * as PubLeafletGraphSubscription from './types/pub/leaflet/graph/subscription'
93export * as PubLeafletInteractionsRecommend from './types/pub/leaflet/interactions/recommend'
94export * as PubLeafletPagesCanvas from './types/pub/leaflet/pages/canvas'
95export * as PubLeafletPagesLinearDocument from './types/pub/leaflet/pages/linearDocument'
96export * as PubLeafletPollDefinition from './types/pub/leaflet/poll/definition'
97export * as PubLeafletPollVote from './types/pub/leaflet/poll/vote'
98export * as PubLeafletPublication from './types/pub/leaflet/publication'
99export * as PubLeafletRichtextFacet from './types/pub/leaflet/richtext/facet'
100export * as PubLeafletThemeBackgroundImage from './types/pub/leaflet/theme/backgroundImage'
101export * as PubLeafletThemeColor from './types/pub/leaflet/theme/color'
102export * as SiteStandardDocument from './types/site/standard/document'
103export * as SiteStandardGraphSubscription from './types/site/standard/graph/subscription'
104export * as SiteStandardPublication from './types/site/standard/publication'
105export * as SiteStandardThemeBasic from './types/site/standard/theme/basic'
106export * as SiteStandardThemeColor from './types/site/standard/theme/color'
107
108export const PUB_LEAFLET_PAGES = {
109 CanvasTextAlignLeft: 'pub.leaflet.pages.canvas#textAlignLeft',
110 CanvasTextAlignCenter: 'pub.leaflet.pages.canvas#textAlignCenter',
111 CanvasTextAlignRight: 'pub.leaflet.pages.canvas#textAlignRight',
112 LinearDocumentTextAlignLeft: 'pub.leaflet.pages.linearDocument#textAlignLeft',
113 LinearDocumentTextAlignCenter:
114 'pub.leaflet.pages.linearDocument#textAlignCenter',
115 LinearDocumentTextAlignRight:
116 'pub.leaflet.pages.linearDocument#textAlignRight',
117 LinearDocumentTextAlignJustify:
118 'pub.leaflet.pages.linearDocument#textAlignJustify',
119}
120
121export class AtpBaseClient extends XrpcClient {
122 app: AppNS
123 com: ComNS
124 pub: PubNS
125 site: SiteNS
126
127 constructor(options: FetchHandler | FetchHandlerOptions) {
128 super(options, schemas)
129 this.app = new AppNS(this)
130 this.com = new ComNS(this)
131 this.pub = new PubNS(this)
132 this.site = new SiteNS(this)
133 }
134
135 /** @deprecated use `this` instead */
136 get xrpc(): XrpcClient {
137 return this
138 }
139}
140
141export class AppNS {
142 _client: XrpcClient
143 bsky: AppBskyNS
144
145 constructor(client: XrpcClient) {
146 this._client = client
147 this.bsky = new AppBskyNS(client)
148 }
149}
150
151export class AppBskyNS {
152 _client: XrpcClient
153 actor: AppBskyActorNS
154
155 constructor(client: XrpcClient) {
156 this._client = client
157 this.actor = new AppBskyActorNS(client)
158 }
159}
160
161export class AppBskyActorNS {
162 _client: XrpcClient
163 profile: AppBskyActorProfileRecord
164
165 constructor(client: XrpcClient) {
166 this._client = client
167 this.profile = new AppBskyActorProfileRecord(client)
168 }
169}
170
171export class AppBskyActorProfileRecord {
172 _client: XrpcClient
173
174 constructor(client: XrpcClient) {
175 this._client = client
176 }
177
178 async list(
179 params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
180 ): Promise<{
181 cursor?: string
182 records: { uri: string; value: AppBskyActorProfile.Record }[]
183 }> {
184 const res = await this._client.call('com.atproto.repo.listRecords', {
185 collection: 'app.bsky.actor.profile',
186 ...params,
187 })
188 return res.data
189 }
190
191 async get(
192 params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
193 ): Promise<{ uri: string; cid: string; value: AppBskyActorProfile.Record }> {
194 const res = await this._client.call('com.atproto.repo.getRecord', {
195 collection: 'app.bsky.actor.profile',
196 ...params,
197 })
198 return res.data
199 }
200
201 async create(
202 params: OmitKey<
203 ComAtprotoRepoCreateRecord.InputSchema,
204 'collection' | 'record'
205 >,
206 record: Un$Typed<AppBskyActorProfile.Record>,
207 headers?: Record<string, string>,
208 ): Promise<{ uri: string; cid: string }> {
209 const collection = 'app.bsky.actor.profile'
210 const res = await this._client.call(
211 'com.atproto.repo.createRecord',
212 undefined,
213 {
214 collection,
215 rkey: 'self',
216 ...params,
217 record: { ...record, $type: collection },
218 },
219 { encoding: 'application/json', headers },
220 )
221 return res.data
222 }
223
224 async put(
225 params: OmitKey<
226 ComAtprotoRepoPutRecord.InputSchema,
227 'collection' | 'record'
228 >,
229 record: Un$Typed<AppBskyActorProfile.Record>,
230 headers?: Record<string, string>,
231 ): Promise<{ uri: string; cid: string }> {
232 const collection = 'app.bsky.actor.profile'
233 const res = await this._client.call(
234 'com.atproto.repo.putRecord',
235 undefined,
236 { collection, ...params, record: { ...record, $type: collection } },
237 { encoding: 'application/json', headers },
238 )
239 return res.data
240 }
241
242 async delete(
243 params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
244 headers?: Record<string, string>,
245 ): Promise<void> {
246 await this._client.call(
247 'com.atproto.repo.deleteRecord',
248 undefined,
249 { collection: 'app.bsky.actor.profile', ...params },
250 { headers },
251 )
252 }
253}
254
255export class ComNS {
256 _client: XrpcClient
257 atproto: ComAtprotoNS
258
259 constructor(client: XrpcClient) {
260 this._client = client
261 this.atproto = new ComAtprotoNS(client)
262 }
263}
264
265export class ComAtprotoNS {
266 _client: XrpcClient
267 repo: ComAtprotoRepoNS
268
269 constructor(client: XrpcClient) {
270 this._client = client
271 this.repo = new ComAtprotoRepoNS(client)
272 }
273}
274
275export class ComAtprotoRepoNS {
276 _client: XrpcClient
277
278 constructor(client: XrpcClient) {
279 this._client = client
280 }
281
282 applyWrites(
283 data?: ComAtprotoRepoApplyWrites.InputSchema,
284 opts?: ComAtprotoRepoApplyWrites.CallOptions,
285 ): Promise<ComAtprotoRepoApplyWrites.Response> {
286 return this._client
287 .call('com.atproto.repo.applyWrites', opts?.qp, data, opts)
288 .catch((e) => {
289 throw ComAtprotoRepoApplyWrites.toKnownErr(e)
290 })
291 }
292
293 createRecord(
294 data?: ComAtprotoRepoCreateRecord.InputSchema,
295 opts?: ComAtprotoRepoCreateRecord.CallOptions,
296 ): Promise<ComAtprotoRepoCreateRecord.Response> {
297 return this._client
298 .call('com.atproto.repo.createRecord', opts?.qp, data, opts)
299 .catch((e) => {
300 throw ComAtprotoRepoCreateRecord.toKnownErr(e)
301 })
302 }
303
304 deleteRecord(
305 data?: ComAtprotoRepoDeleteRecord.InputSchema,
306 opts?: ComAtprotoRepoDeleteRecord.CallOptions,
307 ): Promise<ComAtprotoRepoDeleteRecord.Response> {
308 return this._client
309 .call('com.atproto.repo.deleteRecord', opts?.qp, data, opts)
310 .catch((e) => {
311 throw ComAtprotoRepoDeleteRecord.toKnownErr(e)
312 })
313 }
314
315 describeRepo(
316 params?: ComAtprotoRepoDescribeRepo.QueryParams,
317 opts?: ComAtprotoRepoDescribeRepo.CallOptions,
318 ): Promise<ComAtprotoRepoDescribeRepo.Response> {
319 return this._client.call(
320 'com.atproto.repo.describeRepo',
321 params,
322 undefined,
323 opts,
324 )
325 }
326
327 getRecord(
328 params?: ComAtprotoRepoGetRecord.QueryParams,
329 opts?: ComAtprotoRepoGetRecord.CallOptions,
330 ): Promise<ComAtprotoRepoGetRecord.Response> {
331 return this._client
332 .call('com.atproto.repo.getRecord', params, undefined, opts)
333 .catch((e) => {
334 throw ComAtprotoRepoGetRecord.toKnownErr(e)
335 })
336 }
337
338 importRepo(
339 data?: ComAtprotoRepoImportRepo.InputSchema,
340 opts?: ComAtprotoRepoImportRepo.CallOptions,
341 ): Promise<ComAtprotoRepoImportRepo.Response> {
342 return this._client.call(
343 'com.atproto.repo.importRepo',
344 opts?.qp,
345 data,
346 opts,
347 )
348 }
349
350 listMissingBlobs(
351 params?: ComAtprotoRepoListMissingBlobs.QueryParams,
352 opts?: ComAtprotoRepoListMissingBlobs.CallOptions,
353 ): Promise<ComAtprotoRepoListMissingBlobs.Response> {
354 return this._client.call(
355 'com.atproto.repo.listMissingBlobs',
356 params,
357 undefined,
358 opts,
359 )
360 }
361
362 listRecords(
363 params?: ComAtprotoRepoListRecords.QueryParams,
364 opts?: ComAtprotoRepoListRecords.CallOptions,
365 ): Promise<ComAtprotoRepoListRecords.Response> {
366 return this._client.call(
367 'com.atproto.repo.listRecords',
368 params,
369 undefined,
370 opts,
371 )
372 }
373
374 putRecord(
375 data?: ComAtprotoRepoPutRecord.InputSchema,
376 opts?: ComAtprotoRepoPutRecord.CallOptions,
377 ): Promise<ComAtprotoRepoPutRecord.Response> {
378 return this._client
379 .call('com.atproto.repo.putRecord', opts?.qp, data, opts)
380 .catch((e) => {
381 throw ComAtprotoRepoPutRecord.toKnownErr(e)
382 })
383 }
384
385 uploadBlob(
386 data?: ComAtprotoRepoUploadBlob.InputSchema,
387 opts?: ComAtprotoRepoUploadBlob.CallOptions,
388 ): Promise<ComAtprotoRepoUploadBlob.Response> {
389 return this._client.call(
390 'com.atproto.repo.uploadBlob',
391 opts?.qp,
392 data,
393 opts,
394 )
395 }
396}
397
398export class PubNS {
399 _client: XrpcClient
400 leaflet: PubLeafletNS
401
402 constructor(client: XrpcClient) {
403 this._client = client
404 this.leaflet = new PubLeafletNS(client)
405 }
406}
407
408export class PubLeafletNS {
409 _client: XrpcClient
410 comment: PubLeafletCommentRecord
411 document: PubLeafletDocumentRecord
412 publication: PubLeafletPublicationRecord
413 blocks: PubLeafletBlocksNS
414 graph: PubLeafletGraphNS
415 interactions: PubLeafletInteractionsNS
416 pages: PubLeafletPagesNS
417 poll: PubLeafletPollNS
418 richtext: PubLeafletRichtextNS
419 theme: PubLeafletThemeNS
420
421 constructor(client: XrpcClient) {
422 this._client = client
423 this.blocks = new PubLeafletBlocksNS(client)
424 this.graph = new PubLeafletGraphNS(client)
425 this.interactions = new PubLeafletInteractionsNS(client)
426 this.pages = new PubLeafletPagesNS(client)
427 this.poll = new PubLeafletPollNS(client)
428 this.richtext = new PubLeafletRichtextNS(client)
429 this.theme = new PubLeafletThemeNS(client)
430 this.comment = new PubLeafletCommentRecord(client)
431 this.document = new PubLeafletDocumentRecord(client)
432 this.publication = new PubLeafletPublicationRecord(client)
433 }
434}
435
436export class PubLeafletBlocksNS {
437 _client: XrpcClient
438
439 constructor(client: XrpcClient) {
440 this._client = client
441 }
442}
443
444export class PubLeafletGraphNS {
445 _client: XrpcClient
446 subscription: PubLeafletGraphSubscriptionRecord
447
448 constructor(client: XrpcClient) {
449 this._client = client
450 this.subscription = new PubLeafletGraphSubscriptionRecord(client)
451 }
452}
453
454export class PubLeafletGraphSubscriptionRecord {
455 _client: XrpcClient
456
457 constructor(client: XrpcClient) {
458 this._client = client
459 }
460
461 async list(
462 params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
463 ): Promise<{
464 cursor?: string
465 records: { uri: string; value: PubLeafletGraphSubscription.Record }[]
466 }> {
467 const res = await this._client.call('com.atproto.repo.listRecords', {
468 collection: 'pub.leaflet.graph.subscription',
469 ...params,
470 })
471 return res.data
472 }
473
474 async get(
475 params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
476 ): Promise<{
477 uri: string
478 cid: string
479 value: PubLeafletGraphSubscription.Record
480 }> {
481 const res = await this._client.call('com.atproto.repo.getRecord', {
482 collection: 'pub.leaflet.graph.subscription',
483 ...params,
484 })
485 return res.data
486 }
487
488 async create(
489 params: OmitKey<
490 ComAtprotoRepoCreateRecord.InputSchema,
491 'collection' | 'record'
492 >,
493 record: Un$Typed<PubLeafletGraphSubscription.Record>,
494 headers?: Record<string, string>,
495 ): Promise<{ uri: string; cid: string }> {
496 const collection = 'pub.leaflet.graph.subscription'
497 const res = await this._client.call(
498 'com.atproto.repo.createRecord',
499 undefined,
500 { collection, ...params, record: { ...record, $type: collection } },
501 { encoding: 'application/json', headers },
502 )
503 return res.data
504 }
505
506 async put(
507 params: OmitKey<
508 ComAtprotoRepoPutRecord.InputSchema,
509 'collection' | 'record'
510 >,
511 record: Un$Typed<PubLeafletGraphSubscription.Record>,
512 headers?: Record<string, string>,
513 ): Promise<{ uri: string; cid: string }> {
514 const collection = 'pub.leaflet.graph.subscription'
515 const res = await this._client.call(
516 'com.atproto.repo.putRecord',
517 undefined,
518 { collection, ...params, record: { ...record, $type: collection } },
519 { encoding: 'application/json', headers },
520 )
521 return res.data
522 }
523
524 async delete(
525 params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
526 headers?: Record<string, string>,
527 ): Promise<void> {
528 await this._client.call(
529 'com.atproto.repo.deleteRecord',
530 undefined,
531 { collection: 'pub.leaflet.graph.subscription', ...params },
532 { headers },
533 )
534 }
535}
536
537export class PubLeafletInteractionsNS {
538 _client: XrpcClient
539 recommend: PubLeafletInteractionsRecommendRecord
540
541 constructor(client: XrpcClient) {
542 this._client = client
543 this.recommend = new PubLeafletInteractionsRecommendRecord(client)
544 }
545}
546
547export class PubLeafletInteractionsRecommendRecord {
548 _client: XrpcClient
549
550 constructor(client: XrpcClient) {
551 this._client = client
552 }
553
554 async list(
555 params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
556 ): Promise<{
557 cursor?: string
558 records: { uri: string; value: PubLeafletInteractionsRecommend.Record }[]
559 }> {
560 const res = await this._client.call('com.atproto.repo.listRecords', {
561 collection: 'pub.leaflet.interactions.recommend',
562 ...params,
563 })
564 return res.data
565 }
566
567 async get(
568 params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
569 ): Promise<{
570 uri: string
571 cid: string
572 value: PubLeafletInteractionsRecommend.Record
573 }> {
574 const res = await this._client.call('com.atproto.repo.getRecord', {
575 collection: 'pub.leaflet.interactions.recommend',
576 ...params,
577 })
578 return res.data
579 }
580
581 async create(
582 params: OmitKey<
583 ComAtprotoRepoCreateRecord.InputSchema,
584 'collection' | 'record'
585 >,
586 record: Un$Typed<PubLeafletInteractionsRecommend.Record>,
587 headers?: Record<string, string>,
588 ): Promise<{ uri: string; cid: string }> {
589 const collection = 'pub.leaflet.interactions.recommend'
590 const res = await this._client.call(
591 'com.atproto.repo.createRecord',
592 undefined,
593 { collection, ...params, record: { ...record, $type: collection } },
594 { encoding: 'application/json', headers },
595 )
596 return res.data
597 }
598
599 async put(
600 params: OmitKey<
601 ComAtprotoRepoPutRecord.InputSchema,
602 'collection' | 'record'
603 >,
604 record: Un$Typed<PubLeafletInteractionsRecommend.Record>,
605 headers?: Record<string, string>,
606 ): Promise<{ uri: string; cid: string }> {
607 const collection = 'pub.leaflet.interactions.recommend'
608 const res = await this._client.call(
609 'com.atproto.repo.putRecord',
610 undefined,
611 { collection, ...params, record: { ...record, $type: collection } },
612 { encoding: 'application/json', headers },
613 )
614 return res.data
615 }
616
617 async delete(
618 params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
619 headers?: Record<string, string>,
620 ): Promise<void> {
621 await this._client.call(
622 'com.atproto.repo.deleteRecord',
623 undefined,
624 { collection: 'pub.leaflet.interactions.recommend', ...params },
625 { headers },
626 )
627 }
628}
629
630export class PubLeafletPagesNS {
631 _client: XrpcClient
632
633 constructor(client: XrpcClient) {
634 this._client = client
635 }
636}
637
638export class PubLeafletPollNS {
639 _client: XrpcClient
640 definition: PubLeafletPollDefinitionRecord
641 vote: PubLeafletPollVoteRecord
642
643 constructor(client: XrpcClient) {
644 this._client = client
645 this.definition = new PubLeafletPollDefinitionRecord(client)
646 this.vote = new PubLeafletPollVoteRecord(client)
647 }
648}
649
650export class PubLeafletPollDefinitionRecord {
651 _client: XrpcClient
652
653 constructor(client: XrpcClient) {
654 this._client = client
655 }
656
657 async list(
658 params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
659 ): Promise<{
660 cursor?: string
661 records: { uri: string; value: PubLeafletPollDefinition.Record }[]
662 }> {
663 const res = await this._client.call('com.atproto.repo.listRecords', {
664 collection: 'pub.leaflet.poll.definition',
665 ...params,
666 })
667 return res.data
668 }
669
670 async get(
671 params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
672 ): Promise<{
673 uri: string
674 cid: string
675 value: PubLeafletPollDefinition.Record
676 }> {
677 const res = await this._client.call('com.atproto.repo.getRecord', {
678 collection: 'pub.leaflet.poll.definition',
679 ...params,
680 })
681 return res.data
682 }
683
684 async create(
685 params: OmitKey<
686 ComAtprotoRepoCreateRecord.InputSchema,
687 'collection' | 'record'
688 >,
689 record: Un$Typed<PubLeafletPollDefinition.Record>,
690 headers?: Record<string, string>,
691 ): Promise<{ uri: string; cid: string }> {
692 const collection = 'pub.leaflet.poll.definition'
693 const res = await this._client.call(
694 'com.atproto.repo.createRecord',
695 undefined,
696 { collection, ...params, record: { ...record, $type: collection } },
697 { encoding: 'application/json', headers },
698 )
699 return res.data
700 }
701
702 async put(
703 params: OmitKey<
704 ComAtprotoRepoPutRecord.InputSchema,
705 'collection' | 'record'
706 >,
707 record: Un$Typed<PubLeafletPollDefinition.Record>,
708 headers?: Record<string, string>,
709 ): Promise<{ uri: string; cid: string }> {
710 const collection = 'pub.leaflet.poll.definition'
711 const res = await this._client.call(
712 'com.atproto.repo.putRecord',
713 undefined,
714 { collection, ...params, record: { ...record, $type: collection } },
715 { encoding: 'application/json', headers },
716 )
717 return res.data
718 }
719
720 async delete(
721 params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
722 headers?: Record<string, string>,
723 ): Promise<void> {
724 await this._client.call(
725 'com.atproto.repo.deleteRecord',
726 undefined,
727 { collection: 'pub.leaflet.poll.definition', ...params },
728 { headers },
729 )
730 }
731}
732
733export class PubLeafletPollVoteRecord {
734 _client: XrpcClient
735
736 constructor(client: XrpcClient) {
737 this._client = client
738 }
739
740 async list(
741 params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
742 ): Promise<{
743 cursor?: string
744 records: { uri: string; value: PubLeafletPollVote.Record }[]
745 }> {
746 const res = await this._client.call('com.atproto.repo.listRecords', {
747 collection: 'pub.leaflet.poll.vote',
748 ...params,
749 })
750 return res.data
751 }
752
753 async get(
754 params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
755 ): Promise<{ uri: string; cid: string; value: PubLeafletPollVote.Record }> {
756 const res = await this._client.call('com.atproto.repo.getRecord', {
757 collection: 'pub.leaflet.poll.vote',
758 ...params,
759 })
760 return res.data
761 }
762
763 async create(
764 params: OmitKey<
765 ComAtprotoRepoCreateRecord.InputSchema,
766 'collection' | 'record'
767 >,
768 record: Un$Typed<PubLeafletPollVote.Record>,
769 headers?: Record<string, string>,
770 ): Promise<{ uri: string; cid: string }> {
771 const collection = 'pub.leaflet.poll.vote'
772 const res = await this._client.call(
773 'com.atproto.repo.createRecord',
774 undefined,
775 { collection, ...params, record: { ...record, $type: collection } },
776 { encoding: 'application/json', headers },
777 )
778 return res.data
779 }
780
781 async put(
782 params: OmitKey<
783 ComAtprotoRepoPutRecord.InputSchema,
784 'collection' | 'record'
785 >,
786 record: Un$Typed<PubLeafletPollVote.Record>,
787 headers?: Record<string, string>,
788 ): Promise<{ uri: string; cid: string }> {
789 const collection = 'pub.leaflet.poll.vote'
790 const res = await this._client.call(
791 'com.atproto.repo.putRecord',
792 undefined,
793 { collection, ...params, record: { ...record, $type: collection } },
794 { encoding: 'application/json', headers },
795 )
796 return res.data
797 }
798
799 async delete(
800 params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
801 headers?: Record<string, string>,
802 ): Promise<void> {
803 await this._client.call(
804 'com.atproto.repo.deleteRecord',
805 undefined,
806 { collection: 'pub.leaflet.poll.vote', ...params },
807 { headers },
808 )
809 }
810}
811
812export class PubLeafletRichtextNS {
813 _client: XrpcClient
814
815 constructor(client: XrpcClient) {
816 this._client = client
817 }
818}
819
820export class PubLeafletThemeNS {
821 _client: XrpcClient
822
823 constructor(client: XrpcClient) {
824 this._client = client
825 }
826}
827
828export class PubLeafletCommentRecord {
829 _client: XrpcClient
830
831 constructor(client: XrpcClient) {
832 this._client = client
833 }
834
835 async list(
836 params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
837 ): Promise<{
838 cursor?: string
839 records: { uri: string; value: PubLeafletComment.Record }[]
840 }> {
841 const res = await this._client.call('com.atproto.repo.listRecords', {
842 collection: 'pub.leaflet.comment',
843 ...params,
844 })
845 return res.data
846 }
847
848 async get(
849 params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
850 ): Promise<{ uri: string; cid: string; value: PubLeafletComment.Record }> {
851 const res = await this._client.call('com.atproto.repo.getRecord', {
852 collection: 'pub.leaflet.comment',
853 ...params,
854 })
855 return res.data
856 }
857
858 async create(
859 params: OmitKey<
860 ComAtprotoRepoCreateRecord.InputSchema,
861 'collection' | 'record'
862 >,
863 record: Un$Typed<PubLeafletComment.Record>,
864 headers?: Record<string, string>,
865 ): Promise<{ uri: string; cid: string }> {
866 const collection = 'pub.leaflet.comment'
867 const res = await this._client.call(
868 'com.atproto.repo.createRecord',
869 undefined,
870 { collection, ...params, record: { ...record, $type: collection } },
871 { encoding: 'application/json', headers },
872 )
873 return res.data
874 }
875
876 async put(
877 params: OmitKey<
878 ComAtprotoRepoPutRecord.InputSchema,
879 'collection' | 'record'
880 >,
881 record: Un$Typed<PubLeafletComment.Record>,
882 headers?: Record<string, string>,
883 ): Promise<{ uri: string; cid: string }> {
884 const collection = 'pub.leaflet.comment'
885 const res = await this._client.call(
886 'com.atproto.repo.putRecord',
887 undefined,
888 { collection, ...params, record: { ...record, $type: collection } },
889 { encoding: 'application/json', headers },
890 )
891 return res.data
892 }
893
894 async delete(
895 params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
896 headers?: Record<string, string>,
897 ): Promise<void> {
898 await this._client.call(
899 'com.atproto.repo.deleteRecord',
900 undefined,
901 { collection: 'pub.leaflet.comment', ...params },
902 { headers },
903 )
904 }
905}
906
907export class PubLeafletDocumentRecord {
908 _client: XrpcClient
909
910 constructor(client: XrpcClient) {
911 this._client = client
912 }
913
914 async list(
915 params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
916 ): Promise<{
917 cursor?: string
918 records: { uri: string; value: PubLeafletDocument.Record }[]
919 }> {
920 const res = await this._client.call('com.atproto.repo.listRecords', {
921 collection: 'pub.leaflet.document',
922 ...params,
923 })
924 return res.data
925 }
926
927 async get(
928 params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
929 ): Promise<{ uri: string; cid: string; value: PubLeafletDocument.Record }> {
930 const res = await this._client.call('com.atproto.repo.getRecord', {
931 collection: 'pub.leaflet.document',
932 ...params,
933 })
934 return res.data
935 }
936
937 async create(
938 params: OmitKey<
939 ComAtprotoRepoCreateRecord.InputSchema,
940 'collection' | 'record'
941 >,
942 record: Un$Typed<PubLeafletDocument.Record>,
943 headers?: Record<string, string>,
944 ): Promise<{ uri: string; cid: string }> {
945 const collection = 'pub.leaflet.document'
946 const res = await this._client.call(
947 'com.atproto.repo.createRecord',
948 undefined,
949 { collection, ...params, record: { ...record, $type: collection } },
950 { encoding: 'application/json', headers },
951 )
952 return res.data
953 }
954
955 async put(
956 params: OmitKey<
957 ComAtprotoRepoPutRecord.InputSchema,
958 'collection' | 'record'
959 >,
960 record: Un$Typed<PubLeafletDocument.Record>,
961 headers?: Record<string, string>,
962 ): Promise<{ uri: string; cid: string }> {
963 const collection = 'pub.leaflet.document'
964 const res = await this._client.call(
965 'com.atproto.repo.putRecord',
966 undefined,
967 { collection, ...params, record: { ...record, $type: collection } },
968 { encoding: 'application/json', headers },
969 )
970 return res.data
971 }
972
973 async delete(
974 params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
975 headers?: Record<string, string>,
976 ): Promise<void> {
977 await this._client.call(
978 'com.atproto.repo.deleteRecord',
979 undefined,
980 { collection: 'pub.leaflet.document', ...params },
981 { headers },
982 )
983 }
984}
985
986export class PubLeafletPublicationRecord {
987 _client: XrpcClient
988
989 constructor(client: XrpcClient) {
990 this._client = client
991 }
992
993 async list(
994 params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
995 ): Promise<{
996 cursor?: string
997 records: { uri: string; value: PubLeafletPublication.Record }[]
998 }> {
999 const res = await this._client.call('com.atproto.repo.listRecords', {
1000 collection: 'pub.leaflet.publication',
1001 ...params,
1002 })
1003 return res.data
1004 }
1005
1006 async get(
1007 params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
1008 ): Promise<{
1009 uri: string
1010 cid: string
1011 value: PubLeafletPublication.Record
1012 }> {
1013 const res = await this._client.call('com.atproto.repo.getRecord', {
1014 collection: 'pub.leaflet.publication',
1015 ...params,
1016 })
1017 return res.data
1018 }
1019
1020 async create(
1021 params: OmitKey<
1022 ComAtprotoRepoCreateRecord.InputSchema,
1023 'collection' | 'record'
1024 >,
1025 record: Un$Typed<PubLeafletPublication.Record>,
1026 headers?: Record<string, string>,
1027 ): Promise<{ uri: string; cid: string }> {
1028 const collection = 'pub.leaflet.publication'
1029 const res = await this._client.call(
1030 'com.atproto.repo.createRecord',
1031 undefined,
1032 { collection, ...params, record: { ...record, $type: collection } },
1033 { encoding: 'application/json', headers },
1034 )
1035 return res.data
1036 }
1037
1038 async put(
1039 params: OmitKey<
1040 ComAtprotoRepoPutRecord.InputSchema,
1041 'collection' | 'record'
1042 >,
1043 record: Un$Typed<PubLeafletPublication.Record>,
1044 headers?: Record<string, string>,
1045 ): Promise<{ uri: string; cid: string }> {
1046 const collection = 'pub.leaflet.publication'
1047 const res = await this._client.call(
1048 'com.atproto.repo.putRecord',
1049 undefined,
1050 { collection, ...params, record: { ...record, $type: collection } },
1051 { encoding: 'application/json', headers },
1052 )
1053 return res.data
1054 }
1055
1056 async delete(
1057 params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
1058 headers?: Record<string, string>,
1059 ): Promise<void> {
1060 await this._client.call(
1061 'com.atproto.repo.deleteRecord',
1062 undefined,
1063 { collection: 'pub.leaflet.publication', ...params },
1064 { headers },
1065 )
1066 }
1067}
1068
1069export class SiteNS {
1070 _client: XrpcClient
1071 standard: SiteStandardNS
1072
1073 constructor(client: XrpcClient) {
1074 this._client = client
1075 this.standard = new SiteStandardNS(client)
1076 }
1077}
1078
1079export class SiteStandardNS {
1080 _client: XrpcClient
1081 document: SiteStandardDocumentRecord
1082 publication: SiteStandardPublicationRecord
1083 graph: SiteStandardGraphNS
1084 theme: SiteStandardThemeNS
1085
1086 constructor(client: XrpcClient) {
1087 this._client = client
1088 this.graph = new SiteStandardGraphNS(client)
1089 this.theme = new SiteStandardThemeNS(client)
1090 this.document = new SiteStandardDocumentRecord(client)
1091 this.publication = new SiteStandardPublicationRecord(client)
1092 }
1093}
1094
1095export class SiteStandardGraphNS {
1096 _client: XrpcClient
1097 subscription: SiteStandardGraphSubscriptionRecord
1098
1099 constructor(client: XrpcClient) {
1100 this._client = client
1101 this.subscription = new SiteStandardGraphSubscriptionRecord(client)
1102 }
1103}
1104
1105export class SiteStandardGraphSubscriptionRecord {
1106 _client: XrpcClient
1107
1108 constructor(client: XrpcClient) {
1109 this._client = client
1110 }
1111
1112 async list(
1113 params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
1114 ): Promise<{
1115 cursor?: string
1116 records: { uri: string; value: SiteStandardGraphSubscription.Record }[]
1117 }> {
1118 const res = await this._client.call('com.atproto.repo.listRecords', {
1119 collection: 'site.standard.graph.subscription',
1120 ...params,
1121 })
1122 return res.data
1123 }
1124
1125 async get(
1126 params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
1127 ): Promise<{
1128 uri: string
1129 cid: string
1130 value: SiteStandardGraphSubscription.Record
1131 }> {
1132 const res = await this._client.call('com.atproto.repo.getRecord', {
1133 collection: 'site.standard.graph.subscription',
1134 ...params,
1135 })
1136 return res.data
1137 }
1138
1139 async create(
1140 params: OmitKey<
1141 ComAtprotoRepoCreateRecord.InputSchema,
1142 'collection' | 'record'
1143 >,
1144 record: Un$Typed<SiteStandardGraphSubscription.Record>,
1145 headers?: Record<string, string>,
1146 ): Promise<{ uri: string; cid: string }> {
1147 const collection = 'site.standard.graph.subscription'
1148 const res = await this._client.call(
1149 'com.atproto.repo.createRecord',
1150 undefined,
1151 { collection, ...params, record: { ...record, $type: collection } },
1152 { encoding: 'application/json', headers },
1153 )
1154 return res.data
1155 }
1156
1157 async put(
1158 params: OmitKey<
1159 ComAtprotoRepoPutRecord.InputSchema,
1160 'collection' | 'record'
1161 >,
1162 record: Un$Typed<SiteStandardGraphSubscription.Record>,
1163 headers?: Record<string, string>,
1164 ): Promise<{ uri: string; cid: string }> {
1165 const collection = 'site.standard.graph.subscription'
1166 const res = await this._client.call(
1167 'com.atproto.repo.putRecord',
1168 undefined,
1169 { collection, ...params, record: { ...record, $type: collection } },
1170 { encoding: 'application/json', headers },
1171 )
1172 return res.data
1173 }
1174
1175 async delete(
1176 params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
1177 headers?: Record<string, string>,
1178 ): Promise<void> {
1179 await this._client.call(
1180 'com.atproto.repo.deleteRecord',
1181 undefined,
1182 { collection: 'site.standard.graph.subscription', ...params },
1183 { headers },
1184 )
1185 }
1186}
1187
1188export class SiteStandardThemeNS {
1189 _client: XrpcClient
1190
1191 constructor(client: XrpcClient) {
1192 this._client = client
1193 }
1194}
1195
1196export class SiteStandardDocumentRecord {
1197 _client: XrpcClient
1198
1199 constructor(client: XrpcClient) {
1200 this._client = client
1201 }
1202
1203 async list(
1204 params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
1205 ): Promise<{
1206 cursor?: string
1207 records: { uri: string; value: SiteStandardDocument.Record }[]
1208 }> {
1209 const res = await this._client.call('com.atproto.repo.listRecords', {
1210 collection: 'site.standard.document',
1211 ...params,
1212 })
1213 return res.data
1214 }
1215
1216 async get(
1217 params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
1218 ): Promise<{ uri: string; cid: string; value: SiteStandardDocument.Record }> {
1219 const res = await this._client.call('com.atproto.repo.getRecord', {
1220 collection: 'site.standard.document',
1221 ...params,
1222 })
1223 return res.data
1224 }
1225
1226 async create(
1227 params: OmitKey<
1228 ComAtprotoRepoCreateRecord.InputSchema,
1229 'collection' | 'record'
1230 >,
1231 record: Un$Typed<SiteStandardDocument.Record>,
1232 headers?: Record<string, string>,
1233 ): Promise<{ uri: string; cid: string }> {
1234 const collection = 'site.standard.document'
1235 const res = await this._client.call(
1236 'com.atproto.repo.createRecord',
1237 undefined,
1238 { collection, ...params, record: { ...record, $type: collection } },
1239 { encoding: 'application/json', headers },
1240 )
1241 return res.data
1242 }
1243
1244 async put(
1245 params: OmitKey<
1246 ComAtprotoRepoPutRecord.InputSchema,
1247 'collection' | 'record'
1248 >,
1249 record: Un$Typed<SiteStandardDocument.Record>,
1250 headers?: Record<string, string>,
1251 ): Promise<{ uri: string; cid: string }> {
1252 const collection = 'site.standard.document'
1253 const res = await this._client.call(
1254 'com.atproto.repo.putRecord',
1255 undefined,
1256 { collection, ...params, record: { ...record, $type: collection } },
1257 { encoding: 'application/json', headers },
1258 )
1259 return res.data
1260 }
1261
1262 async delete(
1263 params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
1264 headers?: Record<string, string>,
1265 ): Promise<void> {
1266 await this._client.call(
1267 'com.atproto.repo.deleteRecord',
1268 undefined,
1269 { collection: 'site.standard.document', ...params },
1270 { headers },
1271 )
1272 }
1273}
1274
1275export class SiteStandardPublicationRecord {
1276 _client: XrpcClient
1277
1278 constructor(client: XrpcClient) {
1279 this._client = client
1280 }
1281
1282 async list(
1283 params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
1284 ): Promise<{
1285 cursor?: string
1286 records: { uri: string; value: SiteStandardPublication.Record }[]
1287 }> {
1288 const res = await this._client.call('com.atproto.repo.listRecords', {
1289 collection: 'site.standard.publication',
1290 ...params,
1291 })
1292 return res.data
1293 }
1294
1295 async get(
1296 params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
1297 ): Promise<{
1298 uri: string
1299 cid: string
1300 value: SiteStandardPublication.Record
1301 }> {
1302 const res = await this._client.call('com.atproto.repo.getRecord', {
1303 collection: 'site.standard.publication',
1304 ...params,
1305 })
1306 return res.data
1307 }
1308
1309 async create(
1310 params: OmitKey<
1311 ComAtprotoRepoCreateRecord.InputSchema,
1312 'collection' | 'record'
1313 >,
1314 record: Un$Typed<SiteStandardPublication.Record>,
1315 headers?: Record<string, string>,
1316 ): Promise<{ uri: string; cid: string }> {
1317 const collection = 'site.standard.publication'
1318 const res = await this._client.call(
1319 'com.atproto.repo.createRecord',
1320 undefined,
1321 { collection, ...params, record: { ...record, $type: collection } },
1322 { encoding: 'application/json', headers },
1323 )
1324 return res.data
1325 }
1326
1327 async put(
1328 params: OmitKey<
1329 ComAtprotoRepoPutRecord.InputSchema,
1330 'collection' | 'record'
1331 >,
1332 record: Un$Typed<SiteStandardPublication.Record>,
1333 headers?: Record<string, string>,
1334 ): Promise<{ uri: string; cid: string }> {
1335 const collection = 'site.standard.publication'
1336 const res = await this._client.call(
1337 'com.atproto.repo.putRecord',
1338 undefined,
1339 { collection, ...params, record: { ...record, $type: collection } },
1340 { encoding: 'application/json', headers },
1341 )
1342 return res.data
1343 }
1344
1345 async delete(
1346 params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
1347 headers?: Record<string, string>,
1348 ): Promise<void> {
1349 await this._client.call(
1350 'com.atproto.repo.deleteRecord',
1351 undefined,
1352 { collection: 'site.standard.publication', ...params },
1353 { headers },
1354 )
1355 }
1356}