@atproto/api 0.12.26 → 0.12.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { ValidationResult } from '@atproto/lexicon';
5
+ export interface Record {
6
+ /** Reference (AT-URI) to the post record. */
7
+ post: string;
8
+ /** List of detached post URIs. */
9
+ targets: string[];
10
+ updatedAt: string;
11
+ [k: string]: unknown;
12
+ }
13
+ export declare function isRecord(v: unknown): v is Record;
14
+ export declare function validateRecord(v: unknown): ValidationResult;
15
+ //# sourceMappingURL=detach.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detach.d.ts","sourceRoot":"","sources":["../../../../../../src/client/types/app/bsky/feed/detach.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAW,MAAM,kBAAkB,CAAA;AAK5D,MAAM,WAAW,MAAM;IACrB,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,kCAAkC;IAClC,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,MAAM,CAOhD;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAE3D"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateRecord = exports.isRecord = void 0;
4
+ const util_1 = require("../../../../util");
5
+ const lexicons_1 = require("../../../../lexicons");
6
+ function isRecord(v) {
7
+ return ((0, util_1.isObj)(v) &&
8
+ (0, util_1.hasProp)(v, '$type') &&
9
+ (v.$type === 'app.bsky.feed.detach#main' ||
10
+ v.$type === 'app.bsky.feed.detach'));
11
+ }
12
+ exports.isRecord = isRecord;
13
+ function validateRecord(v) {
14
+ return lexicons_1.lexicons.validate('app.bsky.feed.detach#main', v);
15
+ }
16
+ exports.validateRecord = validateRecord;
17
+ //# sourceMappingURL=detach.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detach.js","sourceRoot":"","sources":["../../../../../../src/client/types/app/bsky/feed/detach.ts"],"names":[],"mappings":";;;AAIA,2CAAiD;AACjD,mDAA+C;AAY/C,SAAgB,QAAQ,CAAC,CAAU;IACjC,OAAO,CACL,IAAA,YAAK,EAAC,CAAC,CAAC;QACR,IAAA,cAAO,EAAC,CAAC,EAAE,OAAO,CAAC;QACnB,CAAC,CAAC,CAAC,KAAK,KAAK,2BAA2B;YACtC,CAAC,CAAC,KAAK,KAAK,sBAAsB,CAAC,CACtC,CAAA;AACH,CAAC;AAPD,4BAOC;AAED,SAAgB,cAAc,CAAC,CAAU;IACvC,OAAO,mBAAQ,CAAC,QAAQ,CAAC,2BAA2B,EAAE,CAAC,CAAC,CAAA;AAC1D,CAAC;AAFD,wCAEC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/api",
3
- "version": "0.12.26",
3
+ "version": "0.12.27",
4
4
  "license": "MIT",
5
5
  "description": "Client library for atproto and Bluesky",
6
6
  "keywords": [
@@ -101,6 +101,7 @@ import * as AppBskyEmbedRecord from './types/app/bsky/embed/record'
101
101
  import * as AppBskyEmbedRecordWithMedia from './types/app/bsky/embed/recordWithMedia'
102
102
  import * as AppBskyFeedDefs from './types/app/bsky/feed/defs'
103
103
  import * as AppBskyFeedDescribeFeedGenerator from './types/app/bsky/feed/describeFeedGenerator'
104
+ import * as AppBskyFeedDetach from './types/app/bsky/feed/detach'
104
105
  import * as AppBskyFeedGenerator from './types/app/bsky/feed/generator'
105
106
  import * as AppBskyFeedGetActorFeeds from './types/app/bsky/feed/getActorFeeds'
106
107
  import * as AppBskyFeedGetActorLikes from './types/app/bsky/feed/getActorLikes'
@@ -298,6 +299,7 @@ export * as AppBskyEmbedRecord from './types/app/bsky/embed/record'
298
299
  export * as AppBskyEmbedRecordWithMedia from './types/app/bsky/embed/recordWithMedia'
299
300
  export * as AppBskyFeedDefs from './types/app/bsky/feed/defs'
300
301
  export * as AppBskyFeedDescribeFeedGenerator from './types/app/bsky/feed/describeFeedGenerator'
302
+ export * as AppBskyFeedDetach from './types/app/bsky/feed/detach'
301
303
  export * as AppBskyFeedGenerator from './types/app/bsky/feed/generator'
302
304
  export * as AppBskyFeedGetActorFeeds from './types/app/bsky/feed/getActorFeeds'
303
305
  export * as AppBskyFeedGetActorLikes from './types/app/bsky/feed/getActorLikes'
@@ -1567,6 +1569,7 @@ export class AppBskyEmbedNS {
1567
1569
 
1568
1570
  export class AppBskyFeedNS {
1569
1571
  _service: AtpServiceClient
1572
+ detach: DetachRecord
1570
1573
  generator: GeneratorRecord
1571
1574
  like: LikeRecord
1572
1575
  post: PostRecord
@@ -1575,6 +1578,7 @@ export class AppBskyFeedNS {
1575
1578
 
1576
1579
  constructor(service: AtpServiceClient) {
1577
1580
  this._service = service
1581
+ this.detach = new DetachRecord(service)
1578
1582
  this.generator = new GeneratorRecord(service)
1579
1583
  this.like = new LikeRecord(service)
1580
1584
  this.post = new PostRecord(service)
@@ -1770,6 +1774,67 @@ export class AppBskyFeedNS {
1770
1774
  }
1771
1775
  }
1772
1776
 
1777
+ export class DetachRecord {
1778
+ _service: AtpServiceClient
1779
+
1780
+ constructor(service: AtpServiceClient) {
1781
+ this._service = service
1782
+ }
1783
+
1784
+ async list(
1785
+ params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
1786
+ ): Promise<{
1787
+ cursor?: string
1788
+ records: { uri: string; value: AppBskyFeedDetach.Record }[]
1789
+ }> {
1790
+ const res = await this._service.xrpc.call('com.atproto.repo.listRecords', {
1791
+ collection: 'app.bsky.feed.detach',
1792
+ ...params,
1793
+ })
1794
+ return res.data
1795
+ }
1796
+
1797
+ async get(
1798
+ params: Omit<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
1799
+ ): Promise<{ uri: string; cid: string; value: AppBskyFeedDetach.Record }> {
1800
+ const res = await this._service.xrpc.call('com.atproto.repo.getRecord', {
1801
+ collection: 'app.bsky.feed.detach',
1802
+ ...params,
1803
+ })
1804
+ return res.data
1805
+ }
1806
+
1807
+ async create(
1808
+ params: Omit<
1809
+ ComAtprotoRepoCreateRecord.InputSchema,
1810
+ 'collection' | 'record'
1811
+ >,
1812
+ record: AppBskyFeedDetach.Record,
1813
+ headers?: Record<string, string>,
1814
+ ): Promise<{ uri: string; cid: string }> {
1815
+ record.$type = 'app.bsky.feed.detach'
1816
+ const res = await this._service.xrpc.call(
1817
+ 'com.atproto.repo.createRecord',
1818
+ undefined,
1819
+ { collection: 'app.bsky.feed.detach', ...params, record },
1820
+ { encoding: 'application/json', headers },
1821
+ )
1822
+ return res.data
1823
+ }
1824
+
1825
+ async delete(
1826
+ params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
1827
+ headers?: Record<string, string>,
1828
+ ): Promise<void> {
1829
+ await this._service.xrpc.call(
1830
+ 'com.atproto.repo.deleteRecord',
1831
+ undefined,
1832
+ { collection: 'app.bsky.feed.detach', ...params },
1833
+ { headers },
1834
+ )
1835
+ }
1836
+ }
1837
+
1773
1838
  export class GeneratorRecord {
1774
1839
  _service: AtpServiceClient
1775
1840
 
@@ -5596,6 +5596,42 @@ export const schemaDict = {
5596
5596
  },
5597
5597
  },
5598
5598
  },
5599
+ AppBskyFeedDetach: {
5600
+ lexicon: 1,
5601
+ id: 'app.bsky.feed.detach',
5602
+ defs: {
5603
+ main: {
5604
+ type: 'record',
5605
+ key: 'tid',
5606
+ description:
5607
+ 'Record defining post URIs detached from a root post. The record key (rkey) of the detach record must match the record key of the root post in question, and that record must be in the same repository.',
5608
+ record: {
5609
+ type: 'object',
5610
+ required: ['post', 'targets', 'updatedAt'],
5611
+ properties: {
5612
+ post: {
5613
+ type: 'string',
5614
+ format: 'at-uri',
5615
+ description: 'Reference (AT-URI) to the post record.',
5616
+ },
5617
+ targets: {
5618
+ type: 'array',
5619
+ maxLength: 50,
5620
+ items: {
5621
+ type: 'string',
5622
+ format: 'at-uri',
5623
+ },
5624
+ description: 'List of detached post URIs.',
5625
+ },
5626
+ updatedAt: {
5627
+ type: 'string',
5628
+ format: 'datetime',
5629
+ },
5630
+ },
5631
+ },
5632
+ },
5633
+ },
5634
+ },
5599
5635
  AppBskyFeedGenerator: {
5600
5636
  lexicon: 1,
5601
5637
  id: 'app.bsky.feed.generator',
@@ -11762,6 +11798,7 @@ export const ids = {
11762
11798
  AppBskyEmbedRecordWithMedia: 'app.bsky.embed.recordWithMedia',
11763
11799
  AppBskyFeedDefs: 'app.bsky.feed.defs',
11764
11800
  AppBskyFeedDescribeFeedGenerator: 'app.bsky.feed.describeFeedGenerator',
11801
+ AppBskyFeedDetach: 'app.bsky.feed.detach',
11765
11802
  AppBskyFeedGenerator: 'app.bsky.feed.generator',
11766
11803
  AppBskyFeedGetActorFeeds: 'app.bsky.feed.getActorFeeds',
11767
11804
  AppBskyFeedGetActorLikes: 'app.bsky.feed.getActorLikes',
@@ -0,0 +1,29 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
+ import { isObj, hasProp } from '../../../../util'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { CID } from 'multiformats/cid'
8
+
9
+ export interface Record {
10
+ /** Reference (AT-URI) to the post record. */
11
+ post: string
12
+ /** List of detached post URIs. */
13
+ targets: string[]
14
+ updatedAt: string
15
+ [k: string]: unknown
16
+ }
17
+
18
+ export function isRecord(v: unknown): v is Record {
19
+ return (
20
+ isObj(v) &&
21
+ hasProp(v, '$type') &&
22
+ (v.$type === 'app.bsky.feed.detach#main' ||
23
+ v.$type === 'app.bsky.feed.detach')
24
+ )
25
+ }
26
+
27
+ export function validateRecord(v: unknown): ValidationResult {
28
+ return lexicons.validate('app.bsky.feed.detach#main', v)
29
+ }