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