@atproto/bsky 0.0.138 → 0.0.139
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 +7 -0
- package/dist/api/app/bsky/feed/getAuthorFeed.js +4 -1
- package/dist/api/app/bsky/feed/getAuthorFeed.js.map +1 -1
- package/dist/api/app/bsky/notification/getUnreadCount.js +3 -1
- package/dist/api/app/bsky/notification/getUnreadCount.js.map +1 -1
- package/dist/api/app/bsky/notification/listNotifications.js +3 -1
- package/dist/api/app/bsky/notification/listNotifications.js.map +1 -1
- package/dist/api/com/atproto/admin/getAccountInfos.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/getAccountInfos.js +4 -1
- package/dist/api/com/atproto/admin/getAccountInfos.js.map +1 -1
- package/dist/api/com/atproto/admin/getSubjectStatus.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/getSubjectStatus.js +4 -1
- package/dist/api/com/atproto/admin/getSubjectStatus.js.map +1 -1
- package/dist/api/com/atproto/repo/getRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/getRecord.js +3 -1
- package/dist/api/com/atproto/repo/getRecord.js.map +1 -1
- package/dist/hydration/actor.d.ts +4 -1
- package/dist/hydration/actor.d.ts.map +1 -1
- package/dist/hydration/actor.js +3 -2
- package/dist/hydration/actor.js.map +1 -1
- package/dist/hydration/hydrator.d.ts +1 -0
- package/dist/hydration/hydrator.d.ts.map +1 -1
- package/dist/hydration/hydrator.js +19 -5
- package/dist/hydration/hydrator.js.map +1 -1
- package/dist/lexicon/index.d.ts +4 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +8 -0
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +254 -4
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +134 -2
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/defs.d.ts +2 -0
- package/dist/lexicon/types/com/atproto/sync/defs.d.ts.map +1 -0
- package/dist/lexicon/types/com/atproto/sync/defs.js +7 -0
- package/dist/lexicon/types/com/atproto/sync/defs.js.map +1 -0
- package/dist/lexicon/types/com/atproto/sync/getHostStatus.d.ts +43 -0
- package/dist/lexicon/types/com/atproto/sync/getHostStatus.d.ts.map +1 -0
- package/dist/lexicon/types/com/atproto/sync/getHostStatus.js +7 -0
- package/dist/lexicon/types/com/atproto/sync/getHostStatus.js.map +1 -0
- package/dist/lexicon/types/com/atproto/sync/listHosts.d.ts +51 -0
- package/dist/lexicon/types/com/atproto/sync/listHosts.d.ts.map +1 -0
- package/dist/lexicon/types/com/atproto/sync/listHosts.js +16 -0
- package/dist/lexicon/types/com/atproto/sync/listHosts.js.map +1 -0
- package/dist/lexicon/types/com/atproto/sync/requestCrawl.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/sync/requestCrawl.d.ts.map +1 -1
- package/dist/proto/bsky_pb.d.ts +4 -0
- package/dist/proto/bsky_pb.d.ts.map +1 -1
- package/dist/proto/bsky_pb.js +16 -0
- package/dist/proto/bsky_pb.js.map +1 -1
- package/package.json +4 -4
- package/proto/bsky.proto +1 -0
- package/src/api/app/bsky/feed/getAuthorFeed.ts +4 -4
- package/src/api/app/bsky/notification/getUnreadCount.ts +3 -1
- package/src/api/app/bsky/notification/listNotifications.ts +3 -1
- package/src/api/com/atproto/admin/getAccountInfos.ts +4 -1
- package/src/api/com/atproto/admin/getSubjectStatus.ts +6 -1
- package/src/api/com/atproto/repo/getRecord.ts +3 -1
- package/src/hydration/actor.ts +9 -2
- package/src/hydration/hydrator.ts +20 -13
- package/src/lexicon/index.ts +24 -0
- package/src/lexicon/lexicons.ts +141 -2
- package/src/lexicon/types/com/atproto/sync/defs.ts +23 -0
- package/src/lexicon/types/com/atproto/sync/getHostStatus.ts +61 -0
- package/src/lexicon/types/com/atproto/sync/listHosts.ts +77 -0
- package/src/lexicon/types/com/atproto/sync/requestCrawl.ts +1 -0
- package/src/proto/bsky_pb.ts +12 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/bsky",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.139",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Reference implementation of app.bsky App View (Bluesky API)",
|
|
6
6
|
"keywords": [
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"undici": "^6.19.8",
|
|
51
51
|
"@atproto-labs/fetch-node": "0.1.8",
|
|
52
52
|
"@atproto-labs/xrpc-utils": "0.0.11",
|
|
53
|
-
"@atproto/api": "^0.14.
|
|
53
|
+
"@atproto/api": "^0.14.22",
|
|
54
54
|
"@atproto/common": "^0.4.10",
|
|
55
55
|
"@atproto/crypto": "^0.4.4",
|
|
56
56
|
"@atproto/did": "^0.1.5",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"jest": "^28.1.2",
|
|
75
75
|
"ts-node": "^10.8.2",
|
|
76
76
|
"typescript": "^5.6.3",
|
|
77
|
-
"@atproto/api": "^0.14.
|
|
77
|
+
"@atproto/api": "^0.14.22",
|
|
78
78
|
"@atproto/lex-cli": "^0.7.2",
|
|
79
|
-
"@atproto/pds": "^0.4.
|
|
79
|
+
"@atproto/pds": "^0.4.123",
|
|
80
80
|
"@atproto/xrpc": "^0.6.12"
|
|
81
81
|
},
|
|
82
82
|
"scripts": {
|
package/proto/bsky.proto
CHANGED
|
@@ -70,10 +70,10 @@ export const skeleton = async (inputs: {
|
|
|
70
70
|
if (!did) {
|
|
71
71
|
throw new InvalidRequestError('Profile not found')
|
|
72
72
|
}
|
|
73
|
-
const actors = await ctx.hydrator.actor.getActors(
|
|
74
|
-
|
|
75
|
-
params.hydrateCtx.
|
|
76
|
-
)
|
|
73
|
+
const actors = await ctx.hydrator.actor.getActors([did], {
|
|
74
|
+
includeTakedowns: params.hydrateCtx.includeTakedowns,
|
|
75
|
+
skipCacheForDids: params.hydrateCtx.skipCacheForViewer,
|
|
76
|
+
})
|
|
77
77
|
const actor = actors.get(did)
|
|
78
78
|
if (!actor) {
|
|
79
79
|
throw new InvalidRequestError('Profile not found')
|
|
@@ -76,6 +76,8 @@ type SkeletonState = {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
const getPriority = async (ctx: Context, did: string) => {
|
|
79
|
-
const actors = await ctx.hydrator.actor.getActors([did]
|
|
79
|
+
const actors = await ctx.hydrator.actor.getActors([did], {
|
|
80
|
+
skipCacheForDids: [did],
|
|
81
|
+
})
|
|
80
82
|
return !!actors.get(did)?.priorityNotifications
|
|
81
83
|
}
|
|
@@ -246,6 +246,8 @@ type SkeletonState = {
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
const getPriority = async (ctx: Context, did: string) => {
|
|
249
|
-
const actors = await ctx.hydrator.actor.getActors([did]
|
|
249
|
+
const actors = await ctx.hydrator.actor.getActors([did], {
|
|
250
|
+
skipCacheForDids: [did],
|
|
251
|
+
})
|
|
250
252
|
return !!actors.get(did)?.priorityNotifications
|
|
251
253
|
}
|
|
@@ -10,7 +10,10 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
10
10
|
const { dids } = params
|
|
11
11
|
const { includeTakedowns } = ctx.authVerifier.parseCreds(auth)
|
|
12
12
|
|
|
13
|
-
const actors = await ctx.hydrator.actor.getActors(dids,
|
|
13
|
+
const actors = await ctx.hydrator.actor.getActors(dids, {
|
|
14
|
+
includeTakedowns: true,
|
|
15
|
+
skipCacheForDids: dids,
|
|
16
|
+
})
|
|
14
17
|
|
|
15
18
|
const infos = mapDefined(dids, (did) => {
|
|
16
19
|
const info = actors.get(did)
|
|
@@ -47,7 +47,12 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
} else if (did) {
|
|
50
|
-
const res = (
|
|
50
|
+
const res = (
|
|
51
|
+
await ctx.hydrator.actor.getActors([did], {
|
|
52
|
+
includeTakedowns: true,
|
|
53
|
+
skipCacheForDids: [did],
|
|
54
|
+
})
|
|
55
|
+
).get(did)
|
|
51
56
|
if (res) {
|
|
52
57
|
body = {
|
|
53
58
|
subject: {
|
|
@@ -14,7 +14,9 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
14
14
|
throw new InvalidRequestError(`Could not find repo: ${repo}`)
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
const actors = await ctx.hydrator.actor.getActors([did],
|
|
17
|
+
const actors = await ctx.hydrator.actor.getActors([did], {
|
|
18
|
+
includeTakedowns,
|
|
19
|
+
})
|
|
18
20
|
if (!actors.get(did)) {
|
|
19
21
|
throw new InvalidRequestError(`Could not find repo: ${repo}`)
|
|
20
22
|
}
|
package/src/hydration/actor.ts
CHANGED
|
@@ -100,9 +100,16 @@ export class ActorHydrator {
|
|
|
100
100
|
return res.filter((did) => did !== undefined)
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
async getActors(
|
|
103
|
+
async getActors(
|
|
104
|
+
dids: string[],
|
|
105
|
+
opts: {
|
|
106
|
+
includeTakedowns?: boolean
|
|
107
|
+
skipCacheForDids?: string[]
|
|
108
|
+
} = {},
|
|
109
|
+
): Promise<Actors> {
|
|
110
|
+
const { includeTakedowns = false, skipCacheForDids } = opts
|
|
104
111
|
if (!dids.length) return new HydrationMap<Actor>()
|
|
105
|
-
const res = await this.dataplane.getActors({ dids })
|
|
112
|
+
const res = await this.dataplane.getActors({ dids, skipCacheForDids })
|
|
106
113
|
return dids.reduce((acc, did, i) => {
|
|
107
114
|
const actor = res.actors[i]
|
|
108
115
|
const isNoHosted =
|
|
@@ -71,6 +71,11 @@ export class HydrateCtx {
|
|
|
71
71
|
includeActorTakedowns = this.vals.includeActorTakedowns
|
|
72
72
|
include3pBlocks = this.vals.include3pBlocks
|
|
73
73
|
constructor(private vals: HydrateCtxVals) {}
|
|
74
|
+
// Convenience with use with dataplane.getActors cache control
|
|
75
|
+
get skipCacheForViewer() {
|
|
76
|
+
if (!this.viewer) return
|
|
77
|
+
return [this.viewer]
|
|
78
|
+
}
|
|
74
79
|
copy<V extends Partial<HydrateCtxVals>>(vals?: V): HydrateCtx & V {
|
|
75
80
|
return new HydrateCtx({ ...this.vals, ...vals }) as HydrateCtx & V
|
|
76
81
|
}
|
|
@@ -191,7 +196,10 @@ export class Hydrator {
|
|
|
191
196
|
): Promise<HydrationState> {
|
|
192
197
|
const includeTakedowns = ctx.includeTakedowns || ctx.includeActorTakedowns
|
|
193
198
|
const [actors, labels, profileViewersState] = await Promise.all([
|
|
194
|
-
this.actor.getActors(dids,
|
|
199
|
+
this.actor.getActors(dids, {
|
|
200
|
+
includeTakedowns,
|
|
201
|
+
skipCacheForDids: ctx.skipCacheForViewer,
|
|
202
|
+
}),
|
|
195
203
|
this.label.getLabelsForSubjects(labelSubjectsForDid(dids), ctx.labelers),
|
|
196
204
|
this.hydrateProfileViewers(dids, ctx),
|
|
197
205
|
])
|
|
@@ -304,7 +312,10 @@ export class Hydrator {
|
|
|
304
312
|
[...uris, ...includeAuthorDids],
|
|
305
313
|
ctx.labelers,
|
|
306
314
|
),
|
|
307
|
-
this.actor.getActors(includeAuthorDids,
|
|
315
|
+
this.actor.getActors(includeAuthorDids, {
|
|
316
|
+
includeTakedowns: ctx.includeTakedowns,
|
|
317
|
+
skipCacheForDids: ctx.skipCacheForViewer,
|
|
318
|
+
}),
|
|
308
319
|
])
|
|
309
320
|
|
|
310
321
|
if (!ctx.includeTakedowns) {
|
|
@@ -949,10 +960,7 @@ export class Hydrator {
|
|
|
949
960
|
}
|
|
950
961
|
}
|
|
951
962
|
|
|
952
|
-
const activeListAuthors = await this.actor.getActors(
|
|
953
|
-
[...listAuthorDids],
|
|
954
|
-
false,
|
|
955
|
-
)
|
|
963
|
+
const activeListAuthors = await this.actor.getActors([...listAuthorDids])
|
|
956
964
|
|
|
957
965
|
for (const [source, targets] of didMap) {
|
|
958
966
|
const didBlocks = new HydrationMap<boolean>()
|
|
@@ -1075,9 +1083,9 @@ export class Hydrator {
|
|
|
1075
1083
|
)
|
|
1076
1084
|
} else if (collection === ids.AppBskyActorProfile) {
|
|
1077
1085
|
const did = parsed.hostname
|
|
1078
|
-
const actor = (
|
|
1079
|
-
did,
|
|
1080
|
-
)
|
|
1086
|
+
const actor = (
|
|
1087
|
+
await this.actor.getActors([did], { includeTakedowns })
|
|
1088
|
+
).get(did)
|
|
1081
1089
|
if (!actor?.profile || !actor?.profileCid) return undefined
|
|
1082
1090
|
const recordInfo: RecordInfo<ProfileRecord> = {
|
|
1083
1091
|
record: actor.profile,
|
|
@@ -1097,10 +1105,9 @@ export class Hydrator {
|
|
|
1097
1105
|
const nonServiceLabelers = labelers.filter(
|
|
1098
1106
|
(did) => !this.serviceLabelers.has(did),
|
|
1099
1107
|
)
|
|
1100
|
-
const labelerActors = await this.actor.getActors(
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
)
|
|
1108
|
+
const labelerActors = await this.actor.getActors(nonServiceLabelers, {
|
|
1109
|
+
includeTakedowns: vals.includeTakedowns,
|
|
1110
|
+
})
|
|
1104
1111
|
const availableDids = labelers.filter(
|
|
1105
1112
|
(did) => this.serviceLabelers.has(did) || !!labelerActors.get(did),
|
|
1106
1113
|
)
|
package/src/lexicon/index.ts
CHANGED
|
@@ -75,11 +75,13 @@ import * as ComAtprotoSyncGetBlob from './types/com/atproto/sync/getBlob.js'
|
|
|
75
75
|
import * as ComAtprotoSyncGetBlocks from './types/com/atproto/sync/getBlocks.js'
|
|
76
76
|
import * as ComAtprotoSyncGetCheckout from './types/com/atproto/sync/getCheckout.js'
|
|
77
77
|
import * as ComAtprotoSyncGetHead from './types/com/atproto/sync/getHead.js'
|
|
78
|
+
import * as ComAtprotoSyncGetHostStatus from './types/com/atproto/sync/getHostStatus.js'
|
|
78
79
|
import * as ComAtprotoSyncGetLatestCommit from './types/com/atproto/sync/getLatestCommit.js'
|
|
79
80
|
import * as ComAtprotoSyncGetRecord from './types/com/atproto/sync/getRecord.js'
|
|
80
81
|
import * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo.js'
|
|
81
82
|
import * as ComAtprotoSyncGetRepoStatus from './types/com/atproto/sync/getRepoStatus.js'
|
|
82
83
|
import * as ComAtprotoSyncListBlobs from './types/com/atproto/sync/listBlobs.js'
|
|
84
|
+
import * as ComAtprotoSyncListHosts from './types/com/atproto/sync/listHosts.js'
|
|
83
85
|
import * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos.js'
|
|
84
86
|
import * as ComAtprotoSyncListReposByCollection from './types/com/atproto/sync/listReposByCollection.js'
|
|
85
87
|
import * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate.js'
|
|
@@ -1061,6 +1063,17 @@ export class ComAtprotoSyncNS {
|
|
|
1061
1063
|
return this._server.xrpc.method(nsid, cfg)
|
|
1062
1064
|
}
|
|
1063
1065
|
|
|
1066
|
+
getHostStatus<AV extends AuthVerifier>(
|
|
1067
|
+
cfg: ConfigOf<
|
|
1068
|
+
AV,
|
|
1069
|
+
ComAtprotoSyncGetHostStatus.Handler<ExtractAuth<AV>>,
|
|
1070
|
+
ComAtprotoSyncGetHostStatus.HandlerReqCtx<ExtractAuth<AV>>
|
|
1071
|
+
>,
|
|
1072
|
+
) {
|
|
1073
|
+
const nsid = 'com.atproto.sync.getHostStatus' // @ts-ignore
|
|
1074
|
+
return this._server.xrpc.method(nsid, cfg)
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1064
1077
|
getLatestCommit<AV extends AuthVerifier>(
|
|
1065
1078
|
cfg: ConfigOf<
|
|
1066
1079
|
AV,
|
|
@@ -1116,6 +1129,17 @@ export class ComAtprotoSyncNS {
|
|
|
1116
1129
|
return this._server.xrpc.method(nsid, cfg)
|
|
1117
1130
|
}
|
|
1118
1131
|
|
|
1132
|
+
listHosts<AV extends AuthVerifier>(
|
|
1133
|
+
cfg: ConfigOf<
|
|
1134
|
+
AV,
|
|
1135
|
+
ComAtprotoSyncListHosts.Handler<ExtractAuth<AV>>,
|
|
1136
|
+
ComAtprotoSyncListHosts.HandlerReqCtx<ExtractAuth<AV>>
|
|
1137
|
+
>,
|
|
1138
|
+
) {
|
|
1139
|
+
const nsid = 'com.atproto.sync.listHosts' // @ts-ignore
|
|
1140
|
+
return this._server.xrpc.method(nsid, cfg)
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1119
1143
|
listRepos<AV extends AuthVerifier>(
|
|
1120
1144
|
cfg: ConfigOf<
|
|
1121
1145
|
AV,
|
package/src/lexicon/lexicons.ts
CHANGED
|
@@ -3365,6 +3365,16 @@ export const schemaDict = {
|
|
|
3365
3365
|
},
|
|
3366
3366
|
},
|
|
3367
3367
|
},
|
|
3368
|
+
ComAtprotoSyncDefs: {
|
|
3369
|
+
lexicon: 1,
|
|
3370
|
+
id: 'com.atproto.sync.defs',
|
|
3371
|
+
defs: {
|
|
3372
|
+
hostStatus: {
|
|
3373
|
+
type: 'string',
|
|
3374
|
+
knownValues: ['active', 'idle', 'offline', 'throttled', 'banned'],
|
|
3375
|
+
},
|
|
3376
|
+
},
|
|
3377
|
+
},
|
|
3368
3378
|
ComAtprotoSyncGetBlob: {
|
|
3369
3379
|
lexicon: 1,
|
|
3370
3380
|
id: 'com.atproto.sync.getBlob',
|
|
@@ -3525,6 +3535,59 @@ export const schemaDict = {
|
|
|
3525
3535
|
},
|
|
3526
3536
|
},
|
|
3527
3537
|
},
|
|
3538
|
+
ComAtprotoSyncGetHostStatus: {
|
|
3539
|
+
lexicon: 1,
|
|
3540
|
+
id: 'com.atproto.sync.getHostStatus',
|
|
3541
|
+
defs: {
|
|
3542
|
+
main: {
|
|
3543
|
+
type: 'query',
|
|
3544
|
+
description:
|
|
3545
|
+
'Returns information about a specified upstream host, as consumed by the server. Implemented by relays.',
|
|
3546
|
+
parameters: {
|
|
3547
|
+
type: 'params',
|
|
3548
|
+
required: ['hostname'],
|
|
3549
|
+
properties: {
|
|
3550
|
+
hostname: {
|
|
3551
|
+
type: 'string',
|
|
3552
|
+
description:
|
|
3553
|
+
'Hostname of the host (eg, PDS or relay) being queried.',
|
|
3554
|
+
},
|
|
3555
|
+
},
|
|
3556
|
+
},
|
|
3557
|
+
output: {
|
|
3558
|
+
encoding: 'application/json',
|
|
3559
|
+
schema: {
|
|
3560
|
+
type: 'object',
|
|
3561
|
+
required: ['hostname'],
|
|
3562
|
+
properties: {
|
|
3563
|
+
hostname: {
|
|
3564
|
+
type: 'string',
|
|
3565
|
+
},
|
|
3566
|
+
seq: {
|
|
3567
|
+
type: 'integer',
|
|
3568
|
+
description:
|
|
3569
|
+
'Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor).',
|
|
3570
|
+
},
|
|
3571
|
+
accountCount: {
|
|
3572
|
+
type: 'integer',
|
|
3573
|
+
description:
|
|
3574
|
+
'Number of accounts on the server which are associated with the upstream host. Note that the upstream may actually have more accounts.',
|
|
3575
|
+
},
|
|
3576
|
+
status: {
|
|
3577
|
+
type: 'ref',
|
|
3578
|
+
ref: 'lex:com.atproto.sync.defs#hostStatus',
|
|
3579
|
+
},
|
|
3580
|
+
},
|
|
3581
|
+
},
|
|
3582
|
+
},
|
|
3583
|
+
errors: [
|
|
3584
|
+
{
|
|
3585
|
+
name: 'HostNotFound',
|
|
3586
|
+
},
|
|
3587
|
+
],
|
|
3588
|
+
},
|
|
3589
|
+
},
|
|
3590
|
+
},
|
|
3528
3591
|
ComAtprotoSyncGetLatestCommit: {
|
|
3529
3592
|
lexicon: 1,
|
|
3530
3593
|
id: 'com.atproto.sync.getLatestCommit',
|
|
@@ -3805,6 +3868,74 @@ export const schemaDict = {
|
|
|
3805
3868
|
},
|
|
3806
3869
|
},
|
|
3807
3870
|
},
|
|
3871
|
+
ComAtprotoSyncListHosts: {
|
|
3872
|
+
lexicon: 1,
|
|
3873
|
+
id: 'com.atproto.sync.listHosts',
|
|
3874
|
+
defs: {
|
|
3875
|
+
main: {
|
|
3876
|
+
type: 'query',
|
|
3877
|
+
description:
|
|
3878
|
+
'Enumerates upstream hosts (eg, PDS or relay instances) that this service consumes from. Implemented by relays.',
|
|
3879
|
+
parameters: {
|
|
3880
|
+
type: 'params',
|
|
3881
|
+
properties: {
|
|
3882
|
+
limit: {
|
|
3883
|
+
type: 'integer',
|
|
3884
|
+
minimum: 1,
|
|
3885
|
+
maximum: 1000,
|
|
3886
|
+
default: 200,
|
|
3887
|
+
},
|
|
3888
|
+
cursor: {
|
|
3889
|
+
type: 'string',
|
|
3890
|
+
},
|
|
3891
|
+
},
|
|
3892
|
+
},
|
|
3893
|
+
output: {
|
|
3894
|
+
encoding: 'application/json',
|
|
3895
|
+
schema: {
|
|
3896
|
+
type: 'object',
|
|
3897
|
+
required: ['hosts'],
|
|
3898
|
+
properties: {
|
|
3899
|
+
cursor: {
|
|
3900
|
+
type: 'string',
|
|
3901
|
+
},
|
|
3902
|
+
hosts: {
|
|
3903
|
+
type: 'array',
|
|
3904
|
+
items: {
|
|
3905
|
+
type: 'ref',
|
|
3906
|
+
ref: 'lex:com.atproto.sync.listHosts#host',
|
|
3907
|
+
},
|
|
3908
|
+
description:
|
|
3909
|
+
'Sort order is not formally specified. Recommended order is by time host was first seen by the server, with oldest first.',
|
|
3910
|
+
},
|
|
3911
|
+
},
|
|
3912
|
+
},
|
|
3913
|
+
},
|
|
3914
|
+
},
|
|
3915
|
+
host: {
|
|
3916
|
+
type: 'object',
|
|
3917
|
+
required: ['hostname'],
|
|
3918
|
+
properties: {
|
|
3919
|
+
hostname: {
|
|
3920
|
+
type: 'string',
|
|
3921
|
+
description: 'hostname of server; not a URL (no scheme)',
|
|
3922
|
+
},
|
|
3923
|
+
seq: {
|
|
3924
|
+
type: 'integer',
|
|
3925
|
+
description:
|
|
3926
|
+
'Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor).',
|
|
3927
|
+
},
|
|
3928
|
+
accountCount: {
|
|
3929
|
+
type: 'integer',
|
|
3930
|
+
},
|
|
3931
|
+
status: {
|
|
3932
|
+
type: 'ref',
|
|
3933
|
+
ref: 'lex:com.atproto.sync.defs#hostStatus',
|
|
3934
|
+
},
|
|
3935
|
+
},
|
|
3936
|
+
},
|
|
3937
|
+
},
|
|
3938
|
+
},
|
|
3808
3939
|
ComAtprotoSyncListRepos: {
|
|
3809
3940
|
lexicon: 1,
|
|
3810
3941
|
id: 'com.atproto.sync.listRepos',
|
|
@@ -3992,6 +4123,11 @@ export const schemaDict = {
|
|
|
3992
4123
|
},
|
|
3993
4124
|
},
|
|
3994
4125
|
},
|
|
4126
|
+
errors: [
|
|
4127
|
+
{
|
|
4128
|
+
name: 'HostBanned',
|
|
4129
|
+
},
|
|
4130
|
+
],
|
|
3995
4131
|
},
|
|
3996
4132
|
},
|
|
3997
4133
|
},
|
|
@@ -10928,7 +11064,7 @@ export const schemaDict = {
|
|
|
10928
11064
|
value: {
|
|
10929
11065
|
type: 'string',
|
|
10930
11066
|
minLength: 1,
|
|
10931
|
-
maxLength:
|
|
11067
|
+
maxLength: 64,
|
|
10932
11068
|
minGraphemes: 1,
|
|
10933
11069
|
maxGraphemes: 1,
|
|
10934
11070
|
},
|
|
@@ -11714,7 +11850,7 @@ export const schemaDict = {
|
|
|
11714
11850
|
value: {
|
|
11715
11851
|
type: 'string',
|
|
11716
11852
|
minLength: 1,
|
|
11717
|
-
maxLength:
|
|
11853
|
+
maxLength: 64,
|
|
11718
11854
|
minGraphemes: 1,
|
|
11719
11855
|
maxGraphemes: 1,
|
|
11720
11856
|
},
|
|
@@ -12195,15 +12331,18 @@ export const ids = {
|
|
|
12195
12331
|
ComAtprotoServerResetPassword: 'com.atproto.server.resetPassword',
|
|
12196
12332
|
ComAtprotoServerRevokeAppPassword: 'com.atproto.server.revokeAppPassword',
|
|
12197
12333
|
ComAtprotoServerUpdateEmail: 'com.atproto.server.updateEmail',
|
|
12334
|
+
ComAtprotoSyncDefs: 'com.atproto.sync.defs',
|
|
12198
12335
|
ComAtprotoSyncGetBlob: 'com.atproto.sync.getBlob',
|
|
12199
12336
|
ComAtprotoSyncGetBlocks: 'com.atproto.sync.getBlocks',
|
|
12200
12337
|
ComAtprotoSyncGetCheckout: 'com.atproto.sync.getCheckout',
|
|
12201
12338
|
ComAtprotoSyncGetHead: 'com.atproto.sync.getHead',
|
|
12339
|
+
ComAtprotoSyncGetHostStatus: 'com.atproto.sync.getHostStatus',
|
|
12202
12340
|
ComAtprotoSyncGetLatestCommit: 'com.atproto.sync.getLatestCommit',
|
|
12203
12341
|
ComAtprotoSyncGetRecord: 'com.atproto.sync.getRecord',
|
|
12204
12342
|
ComAtprotoSyncGetRepo: 'com.atproto.sync.getRepo',
|
|
12205
12343
|
ComAtprotoSyncGetRepoStatus: 'com.atproto.sync.getRepoStatus',
|
|
12206
12344
|
ComAtprotoSyncListBlobs: 'com.atproto.sync.listBlobs',
|
|
12345
|
+
ComAtprotoSyncListHosts: 'com.atproto.sync.listHosts',
|
|
12207
12346
|
ComAtprotoSyncListRepos: 'com.atproto.sync.listRepos',
|
|
12208
12347
|
ComAtprotoSyncListReposByCollection: 'com.atproto.sync.listReposByCollection',
|
|
12209
12348
|
ComAtprotoSyncNotifyOfUpdate: 'com.atproto.sync.notifyOfUpdate',
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import {
|
|
8
|
+
type $Typed,
|
|
9
|
+
is$typed as _is$typed,
|
|
10
|
+
type OmitKey,
|
|
11
|
+
} from '../../../../util'
|
|
12
|
+
|
|
13
|
+
const is$typed = _is$typed,
|
|
14
|
+
validate = _validate
|
|
15
|
+
const id = 'com.atproto.sync.defs'
|
|
16
|
+
|
|
17
|
+
export type HostStatus =
|
|
18
|
+
| 'active'
|
|
19
|
+
| 'idle'
|
|
20
|
+
| 'offline'
|
|
21
|
+
| 'throttled'
|
|
22
|
+
| 'banned'
|
|
23
|
+
| (string & {})
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import express from 'express'
|
|
5
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { CID } from 'multiformats/cid'
|
|
7
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
8
|
+
import {
|
|
9
|
+
type $Typed,
|
|
10
|
+
is$typed as _is$typed,
|
|
11
|
+
type OmitKey,
|
|
12
|
+
} from '../../../../util'
|
|
13
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
|
|
14
|
+
import type * as ComAtprotoSyncDefs from './defs.js'
|
|
15
|
+
|
|
16
|
+
const is$typed = _is$typed,
|
|
17
|
+
validate = _validate
|
|
18
|
+
const id = 'com.atproto.sync.getHostStatus'
|
|
19
|
+
|
|
20
|
+
export interface QueryParams {
|
|
21
|
+
/** Hostname of the host (eg, PDS or relay) being queried. */
|
|
22
|
+
hostname: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type InputSchema = undefined
|
|
26
|
+
|
|
27
|
+
export interface OutputSchema {
|
|
28
|
+
hostname: string
|
|
29
|
+
/** Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor). */
|
|
30
|
+
seq?: number
|
|
31
|
+
/** Number of accounts on the server which are associated with the upstream host. Note that the upstream may actually have more accounts. */
|
|
32
|
+
accountCount?: number
|
|
33
|
+
status?: ComAtprotoSyncDefs.HostStatus
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type HandlerInput = undefined
|
|
37
|
+
|
|
38
|
+
export interface HandlerSuccess {
|
|
39
|
+
encoding: 'application/json'
|
|
40
|
+
body: OutputSchema
|
|
41
|
+
headers?: { [key: string]: string }
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface HandlerError {
|
|
45
|
+
status: number
|
|
46
|
+
message?: string
|
|
47
|
+
error?: 'HostNotFound'
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
|
|
51
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
52
|
+
auth: HA
|
|
53
|
+
params: QueryParams
|
|
54
|
+
input: HandlerInput
|
|
55
|
+
req: express.Request
|
|
56
|
+
res: express.Response
|
|
57
|
+
resetRouteRateLimits: () => Promise<void>
|
|
58
|
+
}
|
|
59
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
60
|
+
ctx: HandlerReqCtx<HA>,
|
|
61
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import express from 'express'
|
|
5
|
+
import { type ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { CID } from 'multiformats/cid'
|
|
7
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
8
|
+
import {
|
|
9
|
+
type $Typed,
|
|
10
|
+
is$typed as _is$typed,
|
|
11
|
+
type OmitKey,
|
|
12
|
+
} from '../../../../util'
|
|
13
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
|
|
14
|
+
import type * as ComAtprotoSyncDefs from './defs.js'
|
|
15
|
+
|
|
16
|
+
const is$typed = _is$typed,
|
|
17
|
+
validate = _validate
|
|
18
|
+
const id = 'com.atproto.sync.listHosts'
|
|
19
|
+
|
|
20
|
+
export interface QueryParams {
|
|
21
|
+
limit: number
|
|
22
|
+
cursor?: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type InputSchema = undefined
|
|
26
|
+
|
|
27
|
+
export interface OutputSchema {
|
|
28
|
+
cursor?: string
|
|
29
|
+
/** Sort order is not formally specified. Recommended order is by time host was first seen by the server, with oldest first. */
|
|
30
|
+
hosts: Host[]
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type HandlerInput = undefined
|
|
34
|
+
|
|
35
|
+
export interface HandlerSuccess {
|
|
36
|
+
encoding: 'application/json'
|
|
37
|
+
body: OutputSchema
|
|
38
|
+
headers?: { [key: string]: string }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface HandlerError {
|
|
42
|
+
status: number
|
|
43
|
+
message?: string
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
|
|
47
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
48
|
+
auth: HA
|
|
49
|
+
params: QueryParams
|
|
50
|
+
input: HandlerInput
|
|
51
|
+
req: express.Request
|
|
52
|
+
res: express.Response
|
|
53
|
+
resetRouteRateLimits: () => Promise<void>
|
|
54
|
+
}
|
|
55
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
56
|
+
ctx: HandlerReqCtx<HA>,
|
|
57
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
|
58
|
+
|
|
59
|
+
export interface Host {
|
|
60
|
+
$type?: 'com.atproto.sync.listHosts#host'
|
|
61
|
+
/** hostname of server; not a URL (no scheme) */
|
|
62
|
+
hostname: string
|
|
63
|
+
/** Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor). */
|
|
64
|
+
seq?: number
|
|
65
|
+
accountCount?: number
|
|
66
|
+
status?: ComAtprotoSyncDefs.HostStatus
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const hashHost = 'host'
|
|
70
|
+
|
|
71
|
+
export function isHost<V>(v: V) {
|
|
72
|
+
return is$typed(v, id, hashHost)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function validateHost<V>(v: V) {
|
|
76
|
+
return validate<Host & V>(v, id, hashHost)
|
|
77
|
+
}
|
package/src/proto/bsky_pb.ts
CHANGED
|
@@ -4474,6 +4474,11 @@ export class GetActorsRequest extends Message<GetActorsRequest> {
|
|
|
4474
4474
|
*/
|
|
4475
4475
|
dids: string[] = []
|
|
4476
4476
|
|
|
4477
|
+
/**
|
|
4478
|
+
* @generated from field: repeated string skip_cache_for_dids = 2;
|
|
4479
|
+
*/
|
|
4480
|
+
skipCacheForDids: string[] = []
|
|
4481
|
+
|
|
4477
4482
|
constructor(data?: PartialMessage<GetActorsRequest>) {
|
|
4478
4483
|
super()
|
|
4479
4484
|
proto3.util.initPartial(data, this)
|
|
@@ -4489,6 +4494,13 @@ export class GetActorsRequest extends Message<GetActorsRequest> {
|
|
|
4489
4494
|
T: 9 /* ScalarType.STRING */,
|
|
4490
4495
|
repeated: true,
|
|
4491
4496
|
},
|
|
4497
|
+
{
|
|
4498
|
+
no: 2,
|
|
4499
|
+
name: 'skip_cache_for_dids',
|
|
4500
|
+
kind: 'scalar',
|
|
4501
|
+
T: 9 /* ScalarType.STRING */,
|
|
4502
|
+
repeated: true,
|
|
4503
|
+
},
|
|
4492
4504
|
])
|
|
4493
4505
|
|
|
4494
4506
|
static fromBinary(
|