@atproto/api 0.6.11 → 0.6.13
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.
- package/CHANGELOG.md +8 -0
- package/dist/bsky-agent.d.ts +8 -0
- package/dist/client/index.d.ts +58 -8
- package/dist/client/lexicons.d.ts +259 -29
- package/dist/client/types/app/bsky/feed/defs.d.ts +18 -0
- package/dist/client/types/app/bsky/feed/{getSavedFeeds.d.ts → getListFeed.d.ts} +6 -2
- package/dist/client/types/app/bsky/feed/threadgate.d.ts +26 -0
- package/dist/client/types/app/bsky/graph/defs.d.ts +3 -1
- package/dist/client/types/app/bsky/{notification/getCount.d.ts → graph/getSuggestedFollowsByActor.d.ts} +3 -1
- package/dist/index.js +598 -177
- package/dist/index.js.map +3 -3
- package/dist/types.d.ts +1 -0
- package/package.json +2 -2
- package/src/bsky-agent.ts +61 -11
- package/src/client/index.ts +183 -23
- package/src/client/lexicons.ts +272 -30
- package/src/client/types/app/bsky/feed/defs.ts +40 -0
- package/src/client/types/app/bsky/feed/getListFeed.ts +46 -0
- package/src/client/types/app/bsky/feed/threadgate.ts +80 -0
- package/src/client/types/app/bsky/graph/defs.ts +7 -1
- package/src/client/types/app/bsky/graph/getListBlocks.ts +38 -0
- package/src/client/types/{com/atproto/temp/upgradeRepoVersion.ts → app/bsky/graph/getSuggestedFollowsByActor.ts} +9 -6
- package/src/client/types/app/bsky/graph/listblock.ts +26 -0
- package/src/types.ts +1 -0
- package/tests/bsky-agent.test.ts +182 -0
- package/dist/client/types/app/bsky/actor/createScene.d.ts +0 -32
- package/dist/client/types/app/bsky/actor/ref.d.ts +0 -28
- package/dist/client/types/app/bsky/actor/search.d.ts +0 -22
- package/dist/client/types/app/bsky/actor/searchTypeahead.d.ts +0 -20
- package/dist/client/types/app/bsky/actor/updateProfile.d.ts +0 -40
- package/dist/client/types/app/bsky/feed/feedViewPost.d.ts +0 -28
- package/dist/client/types/app/bsky/feed/getVotes.d.ts +0 -36
- package/dist/client/types/app/bsky/feed/saveFeed.d.ts +0 -17
- package/dist/client/types/app/bsky/feed/setVote.d.ts +0 -25
- package/dist/client/types/app/bsky/feed/trend.d.ts +0 -9
- package/dist/client/types/app/bsky/feed/unsaveFeed.d.ts +0 -17
- package/dist/client/types/app/bsky/feed/vote.d.ts +0 -10
- package/dist/client/types/app/bsky/graph/assertCreator.d.ts +0 -1
- package/dist/client/types/app/bsky/graph/assertMember.d.ts +0 -1
- package/dist/client/types/app/bsky/graph/assertion.d.ts +0 -10
- package/dist/client/types/app/bsky/graph/confirmation.d.ts +0 -11
- package/dist/client/types/app/bsky/graph/getAssertions.d.ts +0 -48
- package/dist/client/types/app/bsky/graph/getMembers.d.ts +0 -36
- package/dist/client/types/app/bsky/graph/getMemberships.d.ts +0 -36
- package/dist/client/types/app/bsky/graph/mute.d.ts +0 -17
- package/dist/client/types/app/bsky/graph/subscribeMuteList.d.ts +0 -17
- package/dist/client/types/app/bsky/graph/unmute.d.ts +0 -17
- package/dist/client/types/app/bsky/graph/unsubscribeMuteList.d.ts +0 -17
- package/dist/client/types/app/bsky/notification/list.d.ts +0 -35
- package/dist/client/types/app/bsky/system/actorScene.d.ts +0 -1
- package/dist/client/types/app/bsky/system/actorUser.d.ts +0 -1
- package/dist/client/types/app/bsky/system/declRef.d.ts +0 -8
- package/dist/client/types/app/bsky/system/declaration.d.ts +0 -7
- package/dist/client/types/app/bsky/unspecced/registerPushNotification.d.ts +0 -16
- package/dist/client/types/com/atproto/account/create.d.ts +0 -41
- package/dist/client/types/com/atproto/account/createInviteCode.d.ts +0 -22
- package/dist/client/types/com/atproto/account/delete.d.ts +0 -25
- package/dist/client/types/com/atproto/account/get.d.ts +0 -12
- package/dist/client/types/com/atproto/account/requestDelete.d.ts +0 -13
- package/dist/client/types/com/atproto/account/requestPasswordReset.d.ts +0 -17
- package/dist/client/types/com/atproto/account/resetPassword.d.ts +0 -24
- package/dist/client/types/com/atproto/admin/blob.d.ts +0 -37
- package/dist/client/types/com/atproto/admin/moderationAction.d.ts +0 -60
- package/dist/client/types/com/atproto/admin/moderationReport.d.ts +0 -37
- package/dist/client/types/com/atproto/admin/rebaseRepo.d.ts +0 -24
- package/dist/client/types/com/atproto/admin/record.d.ts +0 -43
- package/dist/client/types/com/atproto/admin/repo.d.ts +0 -45
- package/dist/client/types/com/atproto/blob/upload.d.ts +0 -19
- package/dist/client/types/com/atproto/handle/resolve.d.ts +0 -18
- package/dist/client/types/com/atproto/handle/update.d.ts +0 -17
- package/dist/client/types/com/atproto/repo/batchWrite.d.ts +0 -46
- package/dist/client/types/com/atproto/repo/describe.d.ts +0 -22
- package/dist/client/types/com/atproto/repo/rebaseRepo.d.ts +0 -24
- package/dist/client/types/com/atproto/repo/recordRef.d.ts +0 -8
- package/dist/client/types/com/atproto/repo/repoRef.d.ts +0 -7
- package/dist/client/types/com/atproto/report/create.d.ts +0 -39
- package/dist/client/types/com/atproto/report/reasonType.d.ts +0 -3
- package/dist/client/types/com/atproto/report/subject.d.ts +0 -23
- package/dist/client/types/com/atproto/server/getAccountsConfig.d.ts +0 -27
- package/dist/client/types/com/atproto/session/create.d.ts +0 -29
- package/dist/client/types/com/atproto/session/delete.d.ts +0 -13
- package/dist/client/types/com/atproto/session/get.d.ts +0 -18
- package/dist/client/types/com/atproto/session/refresh.d.ts +0 -24
- package/dist/client/types/com/atproto/sync/getCommitPath.d.ts +0 -20
- package/dist/client/types/com/atproto/sync/getRoot.d.ts +0 -18
- package/dist/client/types/com/atproto/sync/subscribeAllRepos.d.ts +0 -9
- package/dist/client/types/com/atproto/sync/updateRepo.d.ts +0 -15
- package/dist/client/types/com/atproto/temp/upgradeRepoVersion.d.ts +0 -18
- package/dist/helpers/bsky.d.ts +0 -20
- package/dist/mixins/bsky.d.ts +0 -23
- package/dist/rich-text/sanitize.d.ts +0 -4
- package/dist/session.d.ts +0 -42
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/api",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.13",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"common-tags": "^1.8.2",
|
|
22
22
|
"@atproto/lex-cli": "^0.2.0",
|
|
23
|
-
"@atproto/pds": "^0.1.
|
|
23
|
+
"@atproto/pds": "^0.1.13"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
26
|
"codegen": "pnpm docgen && node ./scripts/generate-code.mjs && lex gen-api ./src/client ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/*",
|
package/src/bsky-agent.ts
CHANGED
|
@@ -8,6 +8,15 @@ import {
|
|
|
8
8
|
} from './client'
|
|
9
9
|
import { BskyPreferences, BskyLabelPreference } from './types'
|
|
10
10
|
|
|
11
|
+
declare global {
|
|
12
|
+
interface Array<T> {
|
|
13
|
+
findLast(
|
|
14
|
+
predicate: (value: T, index: number, obj: T[]) => unknown,
|
|
15
|
+
thisArg?: any,
|
|
16
|
+
): T
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
11
20
|
export class BskyAgent extends AtpAgent {
|
|
12
21
|
get app() {
|
|
13
22
|
return this.api.app
|
|
@@ -247,6 +256,7 @@ export class BskyAgent extends AtpAgent {
|
|
|
247
256
|
},
|
|
248
257
|
adultContentEnabled: false,
|
|
249
258
|
contentLabels: {},
|
|
259
|
+
birthDate: undefined,
|
|
250
260
|
}
|
|
251
261
|
const res = await this.app.bsky.actor.getPreferences({})
|
|
252
262
|
for (const pref of res.data.preferences) {
|
|
@@ -272,6 +282,13 @@ export class BskyAgent extends AtpAgent {
|
|
|
272
282
|
) {
|
|
273
283
|
prefs.feeds.saved = pref.saved
|
|
274
284
|
prefs.feeds.pinned = pref.pinned
|
|
285
|
+
} else if (
|
|
286
|
+
AppBskyActorDefs.isPersonalDetailsPref(pref) &&
|
|
287
|
+
AppBskyActorDefs.validatePersonalDetailsPref(pref).success
|
|
288
|
+
) {
|
|
289
|
+
if (pref.birthDate) {
|
|
290
|
+
prefs.birthDate = new Date(pref.birthDate)
|
|
291
|
+
}
|
|
275
292
|
}
|
|
276
293
|
}
|
|
277
294
|
return prefs
|
|
@@ -314,20 +331,22 @@ export class BskyAgent extends AtpAgent {
|
|
|
314
331
|
|
|
315
332
|
async setAdultContentEnabled(v: boolean) {
|
|
316
333
|
await updatePreferences(this, (prefs: AppBskyActorDefs.Preferences) => {
|
|
317
|
-
|
|
334
|
+
let adultContentPref = prefs.findLast(
|
|
318
335
|
(pref) =>
|
|
319
336
|
AppBskyActorDefs.isAdultContentPref(pref) &&
|
|
320
337
|
AppBskyActorDefs.validateAdultContentPref(pref).success,
|
|
321
338
|
)
|
|
322
|
-
if (
|
|
323
|
-
|
|
339
|
+
if (adultContentPref) {
|
|
340
|
+
adultContentPref.enabled = v
|
|
324
341
|
} else {
|
|
325
|
-
|
|
342
|
+
adultContentPref = {
|
|
326
343
|
$type: 'app.bsky.actor.defs#adultContentPref',
|
|
327
344
|
enabled: v,
|
|
328
|
-
}
|
|
345
|
+
}
|
|
329
346
|
}
|
|
330
347
|
return prefs
|
|
348
|
+
.filter((pref) => !AppBskyActorDefs.isAdultContentPref(pref))
|
|
349
|
+
.concat([adultContentPref])
|
|
331
350
|
})
|
|
332
351
|
}
|
|
333
352
|
|
|
@@ -338,22 +357,53 @@ export class BskyAgent extends AtpAgent {
|
|
|
338
357
|
}
|
|
339
358
|
|
|
340
359
|
await updatePreferences(this, (prefs: AppBskyActorDefs.Preferences) => {
|
|
341
|
-
|
|
360
|
+
let labelPref = prefs.findLast(
|
|
342
361
|
(pref) =>
|
|
343
362
|
AppBskyActorDefs.isContentLabelPref(pref) &&
|
|
344
363
|
AppBskyActorDefs.validateAdultContentPref(pref).success &&
|
|
345
364
|
pref.label === key,
|
|
346
365
|
)
|
|
347
|
-
if (
|
|
348
|
-
|
|
366
|
+
if (labelPref) {
|
|
367
|
+
labelPref.visibility = value
|
|
349
368
|
} else {
|
|
350
|
-
|
|
369
|
+
labelPref = {
|
|
351
370
|
$type: 'app.bsky.actor.defs#contentLabelPref',
|
|
352
371
|
label: key,
|
|
353
372
|
visibility: value,
|
|
354
|
-
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
return prefs
|
|
376
|
+
.filter(
|
|
377
|
+
(pref) =>
|
|
378
|
+
!AppBskyActorDefs.isContentLabelPref(pref) || pref.label !== key,
|
|
379
|
+
)
|
|
380
|
+
.concat([labelPref])
|
|
381
|
+
})
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
async setPersonalDetails({
|
|
385
|
+
birthDate,
|
|
386
|
+
}: {
|
|
387
|
+
birthDate: string | Date | undefined
|
|
388
|
+
}) {
|
|
389
|
+
birthDate = birthDate instanceof Date ? birthDate.toISOString() : birthDate
|
|
390
|
+
await updatePreferences(this, (prefs: AppBskyActorDefs.Preferences) => {
|
|
391
|
+
let personalDetailsPref = prefs.findLast(
|
|
392
|
+
(pref) =>
|
|
393
|
+
AppBskyActorDefs.isPersonalDetailsPref(pref) &&
|
|
394
|
+
AppBskyActorDefs.validatePersonalDetailsPref(pref).success,
|
|
395
|
+
)
|
|
396
|
+
if (personalDetailsPref) {
|
|
397
|
+
personalDetailsPref.birthDate = birthDate
|
|
398
|
+
} else {
|
|
399
|
+
personalDetailsPref = {
|
|
400
|
+
$type: 'app.bsky.actor.defs#personalDetailsPref',
|
|
401
|
+
birthDate,
|
|
402
|
+
}
|
|
355
403
|
}
|
|
356
404
|
return prefs
|
|
405
|
+
.filter((pref) => !AppBskyActorDefs.isPersonalDetailsPref(pref))
|
|
406
|
+
.concat([personalDetailsPref])
|
|
357
407
|
})
|
|
358
408
|
}
|
|
359
409
|
}
|
|
@@ -394,7 +444,7 @@ async function updateFeedPreferences(
|
|
|
394
444
|
): Promise<{ saved: string[]; pinned: string[] }> {
|
|
395
445
|
let res
|
|
396
446
|
await updatePreferences(agent, (prefs: AppBskyActorDefs.Preferences) => {
|
|
397
|
-
let feedsPref = prefs.
|
|
447
|
+
let feedsPref = prefs.findLast(
|
|
398
448
|
(pref) =>
|
|
399
449
|
AppBskyActorDefs.isSavedFeedsPref(pref) &&
|
|
400
450
|
AppBskyActorDefs.validateSavedFeedsPref(pref).success,
|
package/src/client/index.ts
CHANGED
|
@@ -70,7 +70,6 @@ import * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos'
|
|
|
70
70
|
import * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate'
|
|
71
71
|
import * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl'
|
|
72
72
|
import * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos'
|
|
73
|
-
import * as ComAtprotoTempUpgradeRepoVersion from './types/com/atproto/temp/upgradeRepoVersion'
|
|
74
73
|
import * as AppBskyActorDefs from './types/app/bsky/actor/defs'
|
|
75
74
|
import * as AppBskyActorGetPreferences from './types/app/bsky/actor/getPreferences'
|
|
76
75
|
import * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile'
|
|
@@ -95,6 +94,7 @@ import * as AppBskyFeedGetFeedGenerator from './types/app/bsky/feed/getFeedGener
|
|
|
95
94
|
import * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGenerators'
|
|
96
95
|
import * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton'
|
|
97
96
|
import * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes'
|
|
97
|
+
import * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed'
|
|
98
98
|
import * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread'
|
|
99
99
|
import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts'
|
|
100
100
|
import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy'
|
|
@@ -103,6 +103,7 @@ import * as AppBskyFeedGetTimeline from './types/app/bsky/feed/getTimeline'
|
|
|
103
103
|
import * as AppBskyFeedLike from './types/app/bsky/feed/like'
|
|
104
104
|
import * as AppBskyFeedPost from './types/app/bsky/feed/post'
|
|
105
105
|
import * as AppBskyFeedRepost from './types/app/bsky/feed/repost'
|
|
106
|
+
import * as AppBskyFeedThreadgate from './types/app/bsky/feed/threadgate'
|
|
106
107
|
import * as AppBskyGraphBlock from './types/app/bsky/graph/block'
|
|
107
108
|
import * as AppBskyGraphDefs from './types/app/bsky/graph/defs'
|
|
108
109
|
import * as AppBskyGraphFollow from './types/app/bsky/graph/follow'
|
|
@@ -110,10 +111,13 @@ import * as AppBskyGraphGetBlocks from './types/app/bsky/graph/getBlocks'
|
|
|
110
111
|
import * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers'
|
|
111
112
|
import * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows'
|
|
112
113
|
import * as AppBskyGraphGetList from './types/app/bsky/graph/getList'
|
|
114
|
+
import * as AppBskyGraphGetListBlocks from './types/app/bsky/graph/getListBlocks'
|
|
113
115
|
import * as AppBskyGraphGetListMutes from './types/app/bsky/graph/getListMutes'
|
|
114
116
|
import * as AppBskyGraphGetLists from './types/app/bsky/graph/getLists'
|
|
115
117
|
import * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes'
|
|
118
|
+
import * as AppBskyGraphGetSuggestedFollowsByActor from './types/app/bsky/graph/getSuggestedFollowsByActor'
|
|
116
119
|
import * as AppBskyGraphList from './types/app/bsky/graph/list'
|
|
120
|
+
import * as AppBskyGraphListblock from './types/app/bsky/graph/listblock'
|
|
117
121
|
import * as AppBskyGraphListitem from './types/app/bsky/graph/listitem'
|
|
118
122
|
import * as AppBskyGraphMuteActor from './types/app/bsky/graph/muteActor'
|
|
119
123
|
import * as AppBskyGraphMuteActorList from './types/app/bsky/graph/muteActorList'
|
|
@@ -192,7 +196,6 @@ export * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos'
|
|
|
192
196
|
export * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate'
|
|
193
197
|
export * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl'
|
|
194
198
|
export * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos'
|
|
195
|
-
export * as ComAtprotoTempUpgradeRepoVersion from './types/com/atproto/temp/upgradeRepoVersion'
|
|
196
199
|
export * as AppBskyActorDefs from './types/app/bsky/actor/defs'
|
|
197
200
|
export * as AppBskyActorGetPreferences from './types/app/bsky/actor/getPreferences'
|
|
198
201
|
export * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile'
|
|
@@ -217,6 +220,7 @@ export * as AppBskyFeedGetFeedGenerator from './types/app/bsky/feed/getFeedGener
|
|
|
217
220
|
export * as AppBskyFeedGetFeedGenerators from './types/app/bsky/feed/getFeedGenerators'
|
|
218
221
|
export * as AppBskyFeedGetFeedSkeleton from './types/app/bsky/feed/getFeedSkeleton'
|
|
219
222
|
export * as AppBskyFeedGetLikes from './types/app/bsky/feed/getLikes'
|
|
223
|
+
export * as AppBskyFeedGetListFeed from './types/app/bsky/feed/getListFeed'
|
|
220
224
|
export * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread'
|
|
221
225
|
export * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts'
|
|
222
226
|
export * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy'
|
|
@@ -225,6 +229,7 @@ export * as AppBskyFeedGetTimeline from './types/app/bsky/feed/getTimeline'
|
|
|
225
229
|
export * as AppBskyFeedLike from './types/app/bsky/feed/like'
|
|
226
230
|
export * as AppBskyFeedPost from './types/app/bsky/feed/post'
|
|
227
231
|
export * as AppBskyFeedRepost from './types/app/bsky/feed/repost'
|
|
232
|
+
export * as AppBskyFeedThreadgate from './types/app/bsky/feed/threadgate'
|
|
228
233
|
export * as AppBskyGraphBlock from './types/app/bsky/graph/block'
|
|
229
234
|
export * as AppBskyGraphDefs from './types/app/bsky/graph/defs'
|
|
230
235
|
export * as AppBskyGraphFollow from './types/app/bsky/graph/follow'
|
|
@@ -232,10 +237,13 @@ export * as AppBskyGraphGetBlocks from './types/app/bsky/graph/getBlocks'
|
|
|
232
237
|
export * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers'
|
|
233
238
|
export * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows'
|
|
234
239
|
export * as AppBskyGraphGetList from './types/app/bsky/graph/getList'
|
|
240
|
+
export * as AppBskyGraphGetListBlocks from './types/app/bsky/graph/getListBlocks'
|
|
235
241
|
export * as AppBskyGraphGetListMutes from './types/app/bsky/graph/getListMutes'
|
|
236
242
|
export * as AppBskyGraphGetLists from './types/app/bsky/graph/getLists'
|
|
237
243
|
export * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes'
|
|
244
|
+
export * as AppBskyGraphGetSuggestedFollowsByActor from './types/app/bsky/graph/getSuggestedFollowsByActor'
|
|
238
245
|
export * as AppBskyGraphList from './types/app/bsky/graph/list'
|
|
246
|
+
export * as AppBskyGraphListblock from './types/app/bsky/graph/listblock'
|
|
239
247
|
export * as AppBskyGraphListitem from './types/app/bsky/graph/listitem'
|
|
240
248
|
export * as AppBskyGraphMuteActor from './types/app/bsky/graph/muteActor'
|
|
241
249
|
export * as AppBskyGraphMuteActorList from './types/app/bsky/graph/muteActorList'
|
|
@@ -267,6 +275,7 @@ export const COM_ATPROTO_MODERATION = {
|
|
|
267
275
|
}
|
|
268
276
|
export const APP_BSKY_GRAPH = {
|
|
269
277
|
DefsModlist: 'app.bsky.graph.defs#modlist',
|
|
278
|
+
DefsCuratelist: 'app.bsky.graph.defs#curatelist',
|
|
270
279
|
}
|
|
271
280
|
|
|
272
281
|
export class AtpBaseClient {
|
|
@@ -318,7 +327,6 @@ export class AtprotoNS {
|
|
|
318
327
|
repo: RepoNS
|
|
319
328
|
server: ServerNS
|
|
320
329
|
sync: SyncNS
|
|
321
|
-
temp: TempNS
|
|
322
330
|
|
|
323
331
|
constructor(service: AtpServiceClient) {
|
|
324
332
|
this._service = service
|
|
@@ -329,7 +337,6 @@ export class AtprotoNS {
|
|
|
329
337
|
this.repo = new RepoNS(service)
|
|
330
338
|
this.server = new ServerNS(service)
|
|
331
339
|
this.sync = new SyncNS(service)
|
|
332
|
-
this.temp = new TempNS(service)
|
|
333
340
|
}
|
|
334
341
|
}
|
|
335
342
|
|
|
@@ -1005,25 +1012,6 @@ export class SyncNS {
|
|
|
1005
1012
|
}
|
|
1006
1013
|
}
|
|
1007
1014
|
|
|
1008
|
-
export class TempNS {
|
|
1009
|
-
_service: AtpServiceClient
|
|
1010
|
-
|
|
1011
|
-
constructor(service: AtpServiceClient) {
|
|
1012
|
-
this._service = service
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
upgradeRepoVersion(
|
|
1016
|
-
data?: ComAtprotoTempUpgradeRepoVersion.InputSchema,
|
|
1017
|
-
opts?: ComAtprotoTempUpgradeRepoVersion.CallOptions,
|
|
1018
|
-
): Promise<ComAtprotoTempUpgradeRepoVersion.Response> {
|
|
1019
|
-
return this._service.xrpc
|
|
1020
|
-
.call('com.atproto.temp.upgradeRepoVersion', opts?.qp, data, opts)
|
|
1021
|
-
.catch((e) => {
|
|
1022
|
-
throw ComAtprotoTempUpgradeRepoVersion.toKnownErr(e)
|
|
1023
|
-
})
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
|
|
1027
1015
|
export class AppNS {
|
|
1028
1016
|
_service: AtpServiceClient
|
|
1029
1017
|
bsky: BskyNS
|
|
@@ -1218,6 +1206,7 @@ export class FeedNS {
|
|
|
1218
1206
|
like: LikeRecord
|
|
1219
1207
|
post: PostRecord
|
|
1220
1208
|
repost: RepostRecord
|
|
1209
|
+
threadgate: ThreadgateRecord
|
|
1221
1210
|
|
|
1222
1211
|
constructor(service: AtpServiceClient) {
|
|
1223
1212
|
this._service = service
|
|
@@ -1225,6 +1214,7 @@ export class FeedNS {
|
|
|
1225
1214
|
this.like = new LikeRecord(service)
|
|
1226
1215
|
this.post = new PostRecord(service)
|
|
1227
1216
|
this.repost = new RepostRecord(service)
|
|
1217
|
+
this.threadgate = new ThreadgateRecord(service)
|
|
1228
1218
|
}
|
|
1229
1219
|
|
|
1230
1220
|
describeFeedGenerator(
|
|
@@ -1326,6 +1316,17 @@ export class FeedNS {
|
|
|
1326
1316
|
})
|
|
1327
1317
|
}
|
|
1328
1318
|
|
|
1319
|
+
getListFeed(
|
|
1320
|
+
params?: AppBskyFeedGetListFeed.QueryParams,
|
|
1321
|
+
opts?: AppBskyFeedGetListFeed.CallOptions,
|
|
1322
|
+
): Promise<AppBskyFeedGetListFeed.Response> {
|
|
1323
|
+
return this._service.xrpc
|
|
1324
|
+
.call('app.bsky.feed.getListFeed', params, undefined, opts)
|
|
1325
|
+
.catch((e) => {
|
|
1326
|
+
throw AppBskyFeedGetListFeed.toKnownErr(e)
|
|
1327
|
+
})
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1329
1330
|
getPostThread(
|
|
1330
1331
|
params?: AppBskyFeedGetPostThread.QueryParams,
|
|
1331
1332
|
opts?: AppBskyFeedGetPostThread.CallOptions,
|
|
@@ -1626,11 +1627,77 @@ export class RepostRecord {
|
|
|
1626
1627
|
}
|
|
1627
1628
|
}
|
|
1628
1629
|
|
|
1630
|
+
export class ThreadgateRecord {
|
|
1631
|
+
_service: AtpServiceClient
|
|
1632
|
+
|
|
1633
|
+
constructor(service: AtpServiceClient) {
|
|
1634
|
+
this._service = service
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
async list(
|
|
1638
|
+
params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
|
|
1639
|
+
): Promise<{
|
|
1640
|
+
cursor?: string
|
|
1641
|
+
records: { uri: string; value: AppBskyFeedThreadgate.Record }[]
|
|
1642
|
+
}> {
|
|
1643
|
+
const res = await this._service.xrpc.call('com.atproto.repo.listRecords', {
|
|
1644
|
+
collection: 'app.bsky.feed.threadgate',
|
|
1645
|
+
...params,
|
|
1646
|
+
})
|
|
1647
|
+
return res.data
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
async get(
|
|
1651
|
+
params: Omit<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
|
|
1652
|
+
): Promise<{
|
|
1653
|
+
uri: string
|
|
1654
|
+
cid: string
|
|
1655
|
+
value: AppBskyFeedThreadgate.Record
|
|
1656
|
+
}> {
|
|
1657
|
+
const res = await this._service.xrpc.call('com.atproto.repo.getRecord', {
|
|
1658
|
+
collection: 'app.bsky.feed.threadgate',
|
|
1659
|
+
...params,
|
|
1660
|
+
})
|
|
1661
|
+
return res.data
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
async create(
|
|
1665
|
+
params: Omit<
|
|
1666
|
+
ComAtprotoRepoCreateRecord.InputSchema,
|
|
1667
|
+
'collection' | 'record'
|
|
1668
|
+
>,
|
|
1669
|
+
record: AppBskyFeedThreadgate.Record,
|
|
1670
|
+
headers?: Record<string, string>,
|
|
1671
|
+
): Promise<{ uri: string; cid: string }> {
|
|
1672
|
+
record.$type = 'app.bsky.feed.threadgate'
|
|
1673
|
+
const res = await this._service.xrpc.call(
|
|
1674
|
+
'com.atproto.repo.createRecord',
|
|
1675
|
+
undefined,
|
|
1676
|
+
{ collection: 'app.bsky.feed.threadgate', ...params, record },
|
|
1677
|
+
{ encoding: 'application/json', headers },
|
|
1678
|
+
)
|
|
1679
|
+
return res.data
|
|
1680
|
+
}
|
|
1681
|
+
|
|
1682
|
+
async delete(
|
|
1683
|
+
params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
|
|
1684
|
+
headers?: Record<string, string>,
|
|
1685
|
+
): Promise<void> {
|
|
1686
|
+
await this._service.xrpc.call(
|
|
1687
|
+
'com.atproto.repo.deleteRecord',
|
|
1688
|
+
undefined,
|
|
1689
|
+
{ collection: 'app.bsky.feed.threadgate', ...params },
|
|
1690
|
+
{ headers },
|
|
1691
|
+
)
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1629
1695
|
export class GraphNS {
|
|
1630
1696
|
_service: AtpServiceClient
|
|
1631
1697
|
block: BlockRecord
|
|
1632
1698
|
follow: FollowRecord
|
|
1633
1699
|
list: ListRecord
|
|
1700
|
+
listblock: ListblockRecord
|
|
1634
1701
|
listitem: ListitemRecord
|
|
1635
1702
|
|
|
1636
1703
|
constructor(service: AtpServiceClient) {
|
|
@@ -1638,6 +1705,7 @@ export class GraphNS {
|
|
|
1638
1705
|
this.block = new BlockRecord(service)
|
|
1639
1706
|
this.follow = new FollowRecord(service)
|
|
1640
1707
|
this.list = new ListRecord(service)
|
|
1708
|
+
this.listblock = new ListblockRecord(service)
|
|
1641
1709
|
this.listitem = new ListitemRecord(service)
|
|
1642
1710
|
}
|
|
1643
1711
|
|
|
@@ -1685,6 +1753,17 @@ export class GraphNS {
|
|
|
1685
1753
|
})
|
|
1686
1754
|
}
|
|
1687
1755
|
|
|
1756
|
+
getListBlocks(
|
|
1757
|
+
params?: AppBskyGraphGetListBlocks.QueryParams,
|
|
1758
|
+
opts?: AppBskyGraphGetListBlocks.CallOptions,
|
|
1759
|
+
): Promise<AppBskyGraphGetListBlocks.Response> {
|
|
1760
|
+
return this._service.xrpc
|
|
1761
|
+
.call('app.bsky.graph.getListBlocks', params, undefined, opts)
|
|
1762
|
+
.catch((e) => {
|
|
1763
|
+
throw AppBskyGraphGetListBlocks.toKnownErr(e)
|
|
1764
|
+
})
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1688
1767
|
getListMutes(
|
|
1689
1768
|
params?: AppBskyGraphGetListMutes.QueryParams,
|
|
1690
1769
|
opts?: AppBskyGraphGetListMutes.CallOptions,
|
|
@@ -1718,6 +1797,22 @@ export class GraphNS {
|
|
|
1718
1797
|
})
|
|
1719
1798
|
}
|
|
1720
1799
|
|
|
1800
|
+
getSuggestedFollowsByActor(
|
|
1801
|
+
params?: AppBskyGraphGetSuggestedFollowsByActor.QueryParams,
|
|
1802
|
+
opts?: AppBskyGraphGetSuggestedFollowsByActor.CallOptions,
|
|
1803
|
+
): Promise<AppBskyGraphGetSuggestedFollowsByActor.Response> {
|
|
1804
|
+
return this._service.xrpc
|
|
1805
|
+
.call(
|
|
1806
|
+
'app.bsky.graph.getSuggestedFollowsByActor',
|
|
1807
|
+
params,
|
|
1808
|
+
undefined,
|
|
1809
|
+
opts,
|
|
1810
|
+
)
|
|
1811
|
+
.catch((e) => {
|
|
1812
|
+
throw AppBskyGraphGetSuggestedFollowsByActor.toKnownErr(e)
|
|
1813
|
+
})
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1721
1816
|
muteActor(
|
|
1722
1817
|
data?: AppBskyGraphMuteActor.InputSchema,
|
|
1723
1818
|
opts?: AppBskyGraphMuteActor.CallOptions,
|
|
@@ -1946,6 +2041,71 @@ export class ListRecord {
|
|
|
1946
2041
|
}
|
|
1947
2042
|
}
|
|
1948
2043
|
|
|
2044
|
+
export class ListblockRecord {
|
|
2045
|
+
_service: AtpServiceClient
|
|
2046
|
+
|
|
2047
|
+
constructor(service: AtpServiceClient) {
|
|
2048
|
+
this._service = service
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
async list(
|
|
2052
|
+
params: Omit<ComAtprotoRepoListRecords.QueryParams, 'collection'>,
|
|
2053
|
+
): Promise<{
|
|
2054
|
+
cursor?: string
|
|
2055
|
+
records: { uri: string; value: AppBskyGraphListblock.Record }[]
|
|
2056
|
+
}> {
|
|
2057
|
+
const res = await this._service.xrpc.call('com.atproto.repo.listRecords', {
|
|
2058
|
+
collection: 'app.bsky.graph.listblock',
|
|
2059
|
+
...params,
|
|
2060
|
+
})
|
|
2061
|
+
return res.data
|
|
2062
|
+
}
|
|
2063
|
+
|
|
2064
|
+
async get(
|
|
2065
|
+
params: Omit<ComAtprotoRepoGetRecord.QueryParams, 'collection'>,
|
|
2066
|
+
): Promise<{
|
|
2067
|
+
uri: string
|
|
2068
|
+
cid: string
|
|
2069
|
+
value: AppBskyGraphListblock.Record
|
|
2070
|
+
}> {
|
|
2071
|
+
const res = await this._service.xrpc.call('com.atproto.repo.getRecord', {
|
|
2072
|
+
collection: 'app.bsky.graph.listblock',
|
|
2073
|
+
...params,
|
|
2074
|
+
})
|
|
2075
|
+
return res.data
|
|
2076
|
+
}
|
|
2077
|
+
|
|
2078
|
+
async create(
|
|
2079
|
+
params: Omit<
|
|
2080
|
+
ComAtprotoRepoCreateRecord.InputSchema,
|
|
2081
|
+
'collection' | 'record'
|
|
2082
|
+
>,
|
|
2083
|
+
record: AppBskyGraphListblock.Record,
|
|
2084
|
+
headers?: Record<string, string>,
|
|
2085
|
+
): Promise<{ uri: string; cid: string }> {
|
|
2086
|
+
record.$type = 'app.bsky.graph.listblock'
|
|
2087
|
+
const res = await this._service.xrpc.call(
|
|
2088
|
+
'com.atproto.repo.createRecord',
|
|
2089
|
+
undefined,
|
|
2090
|
+
{ collection: 'app.bsky.graph.listblock', ...params, record },
|
|
2091
|
+
{ encoding: 'application/json', headers },
|
|
2092
|
+
)
|
|
2093
|
+
return res.data
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
async delete(
|
|
2097
|
+
params: Omit<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>,
|
|
2098
|
+
headers?: Record<string, string>,
|
|
2099
|
+
): Promise<void> {
|
|
2100
|
+
await this._service.xrpc.call(
|
|
2101
|
+
'com.atproto.repo.deleteRecord',
|
|
2102
|
+
undefined,
|
|
2103
|
+
{ collection: 'app.bsky.graph.listblock', ...params },
|
|
2104
|
+
{ headers },
|
|
2105
|
+
)
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
|
|
1949
2109
|
export class ListitemRecord {
|
|
1950
2110
|
_service: AtpServiceClient
|
|
1951
2111
|
|