@atproto/bsky 0.0.246 → 0.0.248
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 +19 -0
- package/dist/api/app/bsky/feed/searchPosts.js +1 -1
- package/dist/api/app/bsky/feed/searchPosts.js.map +1 -1
- package/dist/api/app/bsky/feed/searchPostsV2.js +2 -1
- package/dist/api/app/bsky/feed/searchPostsV2.js.map +1 -1
- package/dist/auth-verifier.d.ts +18 -13
- package/dist/auth-verifier.d.ts.map +1 -1
- package/dist/auth-verifier.js +9 -2
- package/dist/auth-verifier.js.map +1 -1
- package/dist/config.d.ts +7 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +4 -1
- package/dist/config.js.map +1 -1
- package/dist/lexicons/app/bsky/feed/searchPostsV2.defs.d.ts +14 -16
- package/dist/lexicons/app/bsky/feed/searchPostsV2.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/searchPostsV2.defs.js +6 -6
- package/dist/lexicons/app/bsky/feed/searchPostsV2.defs.js.map +1 -1
- package/dist/lexicons/chat/bsky/convo/defs.defs.d.ts +9 -1
- package/dist/lexicons/chat/bsky/convo/defs.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/convo/defs.defs.js +6 -0
- package/dist/lexicons/chat/bsky/convo/defs.defs.js.map +1 -1
- package/dist/proto/bsky_pb.d.ts +17 -17
- package/dist/proto/bsky_pb.d.ts.map +1 -1
- package/dist/proto/bsky_pb.js +18 -9
- package/dist/proto/bsky_pb.js.map +1 -1
- package/package.json +8 -8
- package/proto/bsky.proto +13 -14
- package/src/api/app/bsky/feed/searchPosts.ts +1 -1
- package/src/api/app/bsky/feed/searchPostsV2.ts +2 -1
- package/src/auth-verifier.ts +28 -18
- package/src/config.ts +8 -5
- package/tests/data-plane/subscription.test.ts +2 -1
- package/tests/data-plane/thread-mutes.test.ts +3 -2
- package/tests/feed-generation.test.ts +2 -1
- package/tests/label-hydration.test.ts +6 -5
- package/tests/query-labels.test.ts +5 -4
- package/tests/seed/feed-hidden-replies.ts +3 -2
- package/tests/seed/get-suggested-starter-packs.ts +3 -2
- package/tests/seed/get-trends.ts +3 -2
- package/tests/seed/known-followers.ts +2 -1
- package/tests/seed/postgates.ts +3 -2
- package/tests/views/account-deactivation.test.ts +2 -1
- package/tests/views/actor-likes.test.ts +4 -3
- package/tests/views/author-feed.test.ts +6 -5
- package/tests/views/block-lists.test.ts +8 -7
- package/tests/views/blocks.test.ts +5 -4
- package/tests/views/bookmarks.test.ts +5 -4
- package/tests/views/feed-hidden-replies.test.ts +5 -4
- package/tests/views/feed-view-post.test.ts +5 -4
- package/tests/views/get-suggested-onboarding-users.test.ts +3 -2
- package/tests/views/internal-actor.test.ts +2 -1
- package/tests/views/known-followers.test.ts +2 -1
- package/tests/views/labeler-service.test.ts +4 -3
- package/tests/views/likes.test.ts +5 -4
- package/tests/views/list-feed.test.ts +7 -4
- package/tests/views/mute-lists.test.ts +22 -11
- package/tests/views/mutes.test.ts +24 -10
- package/tests/views/notifications.test.ts +15 -14
- package/tests/views/post-search.test.ts +4 -3
- package/tests/views/profile.test.ts +12 -8
- package/tests/views/quotes.test.ts +5 -4
- package/tests/views/thread.test.ts +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/bsky",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.248",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Reference implementation of app.bsky App View (Bluesky API)",
|
|
6
6
|
"keywords": [
|
|
@@ -50,16 +50,16 @@
|
|
|
50
50
|
"zod": "3.23.8",
|
|
51
51
|
"@atproto-labs/fetch-node": "^0.3.2",
|
|
52
52
|
"@atproto-labs/xrpc-utils": "^0.1.1",
|
|
53
|
-
"@atproto/api": "^0.20.
|
|
53
|
+
"@atproto/api": "^0.20.21",
|
|
54
54
|
"@atproto/crypto": "^0.5.1",
|
|
55
|
-
"@atproto/
|
|
55
|
+
"@atproto/common": "^0.6.3",
|
|
56
56
|
"@atproto/repo": "^0.10.1",
|
|
57
|
+
"@atproto/did": "^0.5.1",
|
|
57
58
|
"@atproto/sync": "^0.3.3",
|
|
59
|
+
"@atproto/syntax": "^0.6.2",
|
|
60
|
+
"@atproto/identity": "^0.5.1",
|
|
58
61
|
"@atproto/lex": "^0.1.4",
|
|
59
|
-
"@atproto/
|
|
60
|
-
"@atproto/did": "^0.5.1",
|
|
61
|
-
"@atproto/xrpc-server": "^0.11.2",
|
|
62
|
-
"@atproto/syntax": "^0.6.2"
|
|
62
|
+
"@atproto/xrpc-server": "^0.11.2"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@bufbuild/buf": "^1.28.1",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@types/qs": "^6.9.7",
|
|
74
74
|
"ts-node": "^10.8.2",
|
|
75
75
|
"vitest": "^4.0.16",
|
|
76
|
-
"@atproto/pds": "^0.5.
|
|
76
|
+
"@atproto/pds": "^0.5.8"
|
|
77
77
|
},
|
|
78
78
|
"type": "module",
|
|
79
79
|
"exports": {
|
package/proto/bsky.proto
CHANGED
|
@@ -1197,6 +1197,11 @@ message PostsFilters {
|
|
|
1197
1197
|
// Canonical request field for posts embedding these AT-URI records.
|
|
1198
1198
|
repeated string embedded_at_uris = 5;
|
|
1199
1199
|
repeated string hashtags = 6;
|
|
1200
|
+
// Filter posts in any of these languages
|
|
1201
|
+
// Supports 2-char ISO prefixes ("en", "ja", "fr", etc) and compares against
|
|
1202
|
+
// the 2-char prefix of any `langs` field values of the post record.
|
|
1203
|
+
// e.g. a post with langs=["en-US", "fr"] matches ["en"] or ["fr", "ja"] but not ["ja"].
|
|
1204
|
+
repeated string languages = 7;
|
|
1200
1205
|
}
|
|
1201
1206
|
|
|
1202
1207
|
message SearchPostsV2Request {
|
|
@@ -1219,28 +1224,22 @@ message SearchPostsV2Request {
|
|
|
1219
1224
|
// so `since` and `until` will silently be capped
|
|
1220
1225
|
optional bool all_time = 7;
|
|
1221
1226
|
|
|
1222
|
-
// Language filter - match posts in this language
|
|
1223
|
-
// Supports 2-char ISO prefixes ("en", "ja, "fr", etc")
|
|
1224
|
-
// and compares against the 2-char prefix of any `langs` field values of the post record
|
|
1225
|
-
// e.g. a post with langs=["en-US", "fr"] would match "en" or "fr" but not "ja"
|
|
1226
|
-
optional string language = 8;
|
|
1227
|
-
|
|
1228
1227
|
// Media filters
|
|
1229
|
-
optional bool has_media =
|
|
1230
|
-
optional bool has_video =
|
|
1228
|
+
optional bool has_media = 8;
|
|
1229
|
+
optional bool has_video = 9;
|
|
1231
1230
|
|
|
1232
1231
|
// Reply filters
|
|
1233
|
-
optional string reply_parent_uri =
|
|
1234
|
-
optional string thread_root_uri =
|
|
1235
|
-
optional bool exclude_replies =
|
|
1236
|
-
optional bool replies_only =
|
|
1232
|
+
optional string reply_parent_uri = 10;
|
|
1233
|
+
optional string thread_root_uri = 11;
|
|
1234
|
+
optional bool exclude_replies = 12;
|
|
1235
|
+
optional bool replies_only = 13;
|
|
1237
1236
|
|
|
1238
1237
|
// Social filters
|
|
1239
|
-
optional bool following =
|
|
1238
|
+
optional bool following = 14;
|
|
1240
1239
|
|
|
1241
1240
|
// Query analysis hint — forces a specific language analyzer.
|
|
1242
1241
|
// Auto-detects from query text when unset.
|
|
1243
|
-
optional SearchQueryLanguage query_language =
|
|
1242
|
+
optional SearchQueryLanguage query_language = 15;
|
|
1244
1243
|
}
|
|
1245
1244
|
|
|
1246
1245
|
message SearchPostsV2Response {
|
|
@@ -135,10 +135,10 @@ const skeletonV2 = async (
|
|
|
135
135
|
domains: params.domain ? [params.domain] : [],
|
|
136
136
|
urls: params.url ? [params.url] : [],
|
|
137
137
|
hashtags: params.tag ?? [],
|
|
138
|
+
languages: params.lang ? [params.lang] : [],
|
|
138
139
|
},
|
|
139
140
|
since: parseTimestamp(params.since),
|
|
140
141
|
until: parseTimestamp(params.until),
|
|
141
|
-
language: params.lang,
|
|
142
142
|
})
|
|
143
143
|
return {
|
|
144
144
|
posts: res.posts.map(({ uri }) => uri as AtUriString),
|
|
@@ -103,6 +103,7 @@ const skeleton = async (
|
|
|
103
103
|
urls: params.urls ?? [],
|
|
104
104
|
embeddedAtUris: params.embeddedAtUris ?? [],
|
|
105
105
|
hashtags: params.hashtags ?? [],
|
|
106
|
+
languages: params.languages ?? [],
|
|
106
107
|
},
|
|
107
108
|
exclude: {
|
|
108
109
|
authors: params.excludeAuthors ?? [],
|
|
@@ -111,11 +112,11 @@ const skeleton = async (
|
|
|
111
112
|
urls: params.excludeUrls ?? [],
|
|
112
113
|
embeddedAtUris: params.excludeEmbeddedAtUris ?? [],
|
|
113
114
|
hashtags: params.excludeHashtags ?? [],
|
|
115
|
+
languages: params.excludeLanguages ?? [],
|
|
114
116
|
},
|
|
115
117
|
since: parseTimestamp(params.since),
|
|
116
118
|
until: parseTimestamp(params.until),
|
|
117
119
|
allTime: params.allTime,
|
|
118
|
-
language: params.language,
|
|
119
120
|
hasMedia: params.hasMedia,
|
|
120
121
|
hasVideo: params.hasVideo,
|
|
121
122
|
replyParentUri: params.replyParentUri,
|
package/src/auth-verifier.ts
CHANGED
|
@@ -49,6 +49,7 @@ type NullOutput = {
|
|
|
49
49
|
type StandardOutput = {
|
|
50
50
|
credentials: {
|
|
51
51
|
type: 'standard'
|
|
52
|
+
/** @note we don't validate this to be a {@link DidString} (we might want to in the future) */
|
|
52
53
|
aud: string
|
|
53
54
|
iss: DidString | `${DidString}#${string}`
|
|
54
55
|
}
|
|
@@ -64,8 +65,8 @@ type RoleOutput = {
|
|
|
64
65
|
type ModServiceOutput = {
|
|
65
66
|
credentials: {
|
|
66
67
|
type: 'mod_service'
|
|
67
|
-
aud:
|
|
68
|
-
iss: string
|
|
68
|
+
aud: DidString
|
|
69
|
+
iss: DidString | `${DidString}#${string}`
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
|
|
@@ -76,17 +77,17 @@ const ALLOWED_AUTH_SCOPES = new Set([
|
|
|
76
77
|
])
|
|
77
78
|
|
|
78
79
|
export type AuthVerifierOpts = {
|
|
79
|
-
ownDid:
|
|
80
|
-
alternateAudienceDids:
|
|
81
|
-
modServiceDid:
|
|
80
|
+
ownDid: DidString
|
|
81
|
+
alternateAudienceDids: DidString[]
|
|
82
|
+
modServiceDid: DidString
|
|
82
83
|
adminPasses: string[]
|
|
83
84
|
entrywayJwtPublicKey?: KeyObject
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
export class AuthVerifier {
|
|
87
|
-
public ownDid:
|
|
88
|
-
public standardAudienceDids: Set<
|
|
89
|
-
public modServiceDid:
|
|
88
|
+
public ownDid: DidString
|
|
89
|
+
public standardAudienceDids: Set<DidString>
|
|
90
|
+
public modServiceDid: DidString
|
|
90
91
|
private adminPasses: Set<string>
|
|
91
92
|
private entrywayJwtPublicKey?: KeyObject
|
|
92
93
|
|
|
@@ -138,7 +139,10 @@ export class AuthVerifier {
|
|
|
138
139
|
iss: null,
|
|
139
140
|
aud: null,
|
|
140
141
|
})
|
|
141
|
-
if (
|
|
142
|
+
if (
|
|
143
|
+
!opts.skipAudCheck &&
|
|
144
|
+
!(this.standardAudienceDids as Set<string>).has(aud)
|
|
145
|
+
) {
|
|
142
146
|
throw new AuthRequiredError(
|
|
143
147
|
'jwt audience does not match service did',
|
|
144
148
|
'BadJwtAudience',
|
|
@@ -299,17 +303,13 @@ export class AuthVerifier {
|
|
|
299
303
|
return { status: Invalid, admin: false }
|
|
300
304
|
}
|
|
301
305
|
|
|
302
|
-
async verifyServiceJwt
|
|
303
|
-
|
|
304
|
-
opts: {
|
|
306
|
+
async verifyServiceJwt<
|
|
307
|
+
TOptions extends {
|
|
305
308
|
iss: string[] | null
|
|
306
309
|
aud: string | null
|
|
307
310
|
lxmCheck?: (method?: string) => boolean
|
|
308
311
|
},
|
|
309
|
-
|
|
310
|
-
iss: DidString | `${DidString}#${string}`
|
|
311
|
-
aud: string
|
|
312
|
-
}> {
|
|
312
|
+
>(reqCtx: ReqCtx, opts: TOptions) {
|
|
313
313
|
const getSigningKey = async (
|
|
314
314
|
iss: string,
|
|
315
315
|
_forceRefresh: boolean, // @TODO consider propagating to dataplane
|
|
@@ -318,6 +318,10 @@ export class AuthVerifier {
|
|
|
318
318
|
throw new AuthRequiredError('Untrusted issuer', 'UntrustedIss')
|
|
319
319
|
}
|
|
320
320
|
const [did, serviceId] = iss.split('#')
|
|
321
|
+
if (!isDidString(did)) {
|
|
322
|
+
throw new AuthRequiredError('identity unknown')
|
|
323
|
+
}
|
|
324
|
+
|
|
321
325
|
const keyId =
|
|
322
326
|
serviceId === 'atproto_labeler' ? 'atproto_label' : 'atproto'
|
|
323
327
|
let identity: GetIdentityByDidResponse
|
|
@@ -371,10 +375,16 @@ export class AuthVerifier {
|
|
|
371
375
|
// we'll allow ozone self-hosters to upgrade before removing this condition.
|
|
372
376
|
assertLxmCheck()
|
|
373
377
|
}
|
|
374
|
-
|
|
378
|
+
|
|
379
|
+
return {
|
|
380
|
+
iss: payload.iss as (DidString | `${DidString}#${string}`) &
|
|
381
|
+
(TOptions extends { iss: ReadonlyArray<infer I> } ? I : unknown),
|
|
382
|
+
aud: payload.aud as string &
|
|
383
|
+
(TOptions extends { aud: infer A extends string } ? A : unknown),
|
|
384
|
+
}
|
|
375
385
|
}
|
|
376
386
|
|
|
377
|
-
isModService(iss: string):
|
|
387
|
+
isModService(iss: string): iss is DidString | `${DidString}#atproto_labeler` {
|
|
378
388
|
return [
|
|
379
389
|
this.modServiceDid,
|
|
380
390
|
`${this.modServiceDid}#atproto_labeler`,
|
package/src/config.ts
CHANGED
|
@@ -39,8 +39,8 @@ export interface ServerConfigValues {
|
|
|
39
39
|
debugMode?: boolean
|
|
40
40
|
port?: number
|
|
41
41
|
publicUrl?: string
|
|
42
|
-
serverDid:
|
|
43
|
-
alternateAudienceDids:
|
|
42
|
+
serverDid: DidString
|
|
43
|
+
alternateAudienceDids: DidString[]
|
|
44
44
|
entrywayJwtPublicKeyHex?: string
|
|
45
45
|
liveNowConfig?: LiveNowConfig
|
|
46
46
|
// external services
|
|
@@ -76,9 +76,9 @@ export interface ServerConfigValues {
|
|
|
76
76
|
didPlcUrl: string
|
|
77
77
|
handleResolveNameservers?: string[]
|
|
78
78
|
// moderation and administration
|
|
79
|
-
modServiceDid:
|
|
79
|
+
modServiceDid: DidString
|
|
80
80
|
adminPasswords: string[]
|
|
81
|
-
labelsFromIssuerDids?:
|
|
81
|
+
labelsFromIssuerDids?: DidString[]
|
|
82
82
|
indexedAtEpoch?: Date
|
|
83
83
|
// misc/dev
|
|
84
84
|
blobCacheLocation?: string
|
|
@@ -124,10 +124,12 @@ export class ServerConfig {
|
|
|
124
124
|
process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test'
|
|
125
125
|
const publicUrl = process.env.BSKY_PUBLIC_URL || undefined
|
|
126
126
|
const serverDid = process.env.BSKY_SERVER_DID || 'did:example:test'
|
|
127
|
+
assert(isDidString(serverDid))
|
|
127
128
|
const envPort = parseInt(process.env.BSKY_PORT || '', 10)
|
|
128
129
|
const port = isNaN(envPort) ? 2584 : envPort
|
|
129
130
|
const didPlcUrl = process.env.BSKY_DID_PLC_URL || 'http://localhost:2582'
|
|
130
131
|
const alternateAudienceDids = envList(process.env.BSKY_ALT_AUDIENCE_DIDS)
|
|
132
|
+
assert(alternateAudienceDids.every(isDidString))
|
|
131
133
|
const entrywayJwtPublicKeyHex =
|
|
132
134
|
process.env.BSKY_ENTRYWAY_JWT_PUBLIC_KEY_HEX || undefined
|
|
133
135
|
let liveNowConfig: LiveNowConfig | undefined
|
|
@@ -184,6 +186,7 @@ export class ServerConfig {
|
|
|
184
186
|
const labelsFromIssuerDids = envList(
|
|
185
187
|
process.env.BSKY_LABELS_FROM_ISSUER_DIDS,
|
|
186
188
|
)
|
|
189
|
+
assert(labelsFromIssuerDids.every(isDidString))
|
|
187
190
|
const bsyncUrl = process.env.BSKY_BSYNC_URL || undefined
|
|
188
191
|
assert(bsyncUrl)
|
|
189
192
|
const bsyncApiKey = process.env.BSKY_BSYNC_API_KEY || undefined
|
|
@@ -215,7 +218,7 @@ export class ServerConfig {
|
|
|
215
218
|
process.env.BSKY_ADMIN_PASSWORDS || process.env.BSKY_ADMIN_PASSWORD,
|
|
216
219
|
)
|
|
217
220
|
const modServiceDid = process.env.MOD_SERVICE_DID
|
|
218
|
-
assert(modServiceDid)
|
|
221
|
+
assert(modServiceDid != null && isDidString(modServiceDid))
|
|
219
222
|
|
|
220
223
|
const eventProxyTrackingEndpoint =
|
|
221
224
|
process.env.BSKY_EVENT_PROXY_TRACKING_ENDPOINT || undefined
|
|
@@ -3,6 +3,7 @@ import { AtpAgent, ids } from '@atproto/api'
|
|
|
3
3
|
import { cborDecode, cborEncode } from '@atproto/common'
|
|
4
4
|
import { SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
|
|
5
5
|
import { sequencer } from '@atproto/pds'
|
|
6
|
+
import type { DidString } from '@atproto/syntax'
|
|
6
7
|
import { DatabaseSchemaType } from '../../src/data-plane/server/db/database-schema.js'
|
|
7
8
|
import { forSnapshot } from '../_util.js'
|
|
8
9
|
|
|
@@ -98,7 +99,7 @@ describe('sync', () => {
|
|
|
98
99
|
|
|
99
100
|
async function updateProfile(
|
|
100
101
|
agent: AtpAgent,
|
|
101
|
-
did:
|
|
102
|
+
did: DidString,
|
|
102
103
|
record: Record<string, unknown>,
|
|
103
104
|
) {
|
|
104
105
|
return await agent.api.com.atproto.repo.putRecord(
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
|
2
2
|
import { AtpAgent, ids } from '@atproto/api'
|
|
3
3
|
import { RecordRef, SeedClient, TestNetwork, usersSeed } from '@atproto/dev-env'
|
|
4
|
+
import type { DidString } from '@atproto/syntax'
|
|
4
5
|
|
|
5
6
|
describe('thread mutes', () => {
|
|
6
7
|
let network: TestNetwork
|
|
7
8
|
let agent: AtpAgent
|
|
8
9
|
let sc: SeedClient
|
|
9
10
|
|
|
10
|
-
let alice:
|
|
11
|
-
let bob:
|
|
11
|
+
let alice: DidString
|
|
12
|
+
let bob: DidString
|
|
12
13
|
|
|
13
14
|
let rootPost: RecordRef
|
|
14
15
|
let replyPost: RecordRef
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
basicSeed,
|
|
19
19
|
} from '@atproto/dev-env'
|
|
20
20
|
import { SkeletonHandler, app } from '@atproto/pds'
|
|
21
|
+
import type { DidString } from '@atproto/syntax'
|
|
21
22
|
import { AuthRequiredError } from '@atproto/xrpc-server'
|
|
22
23
|
import { forSnapshot, paginateAll } from './_util.js'
|
|
23
24
|
|
|
@@ -28,7 +29,7 @@ describe('feed generation', () => {
|
|
|
28
29
|
let sc: SeedClient
|
|
29
30
|
let gen: TestFeedGen
|
|
30
31
|
|
|
31
|
-
let alice:
|
|
32
|
+
let alice: DidString
|
|
32
33
|
let feedUriAll: string
|
|
33
34
|
let feedUriAllRef: RecordRef
|
|
34
35
|
let feedUriEven: string
|
|
@@ -3,17 +3,18 @@ import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
|
3
3
|
import { AtpAgent } from '@atproto/api'
|
|
4
4
|
import { MINUTE } from '@atproto/common'
|
|
5
5
|
import { SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
|
|
6
|
+
import type { DidString } from '@atproto/syntax'
|
|
6
7
|
|
|
7
8
|
describe('label hydration', () => {
|
|
8
9
|
let network: TestNetwork
|
|
9
10
|
let pdsAgent: AtpAgent
|
|
10
11
|
let sc: SeedClient
|
|
11
12
|
|
|
12
|
-
let alice:
|
|
13
|
-
let bob:
|
|
14
|
-
let carol:
|
|
15
|
-
let labelerDid:
|
|
16
|
-
let labeler2Did:
|
|
13
|
+
let alice: DidString
|
|
14
|
+
let bob: DidString
|
|
15
|
+
let carol: DidString
|
|
16
|
+
let labelerDid: DidString
|
|
17
|
+
let labeler2Did: DidString
|
|
17
18
|
|
|
18
19
|
beforeAll(async () => {
|
|
19
20
|
network = await TestNetwork.create({
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
2
2
|
import { AtpAgent } from '@atproto/api'
|
|
3
3
|
import { SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
|
|
4
|
+
import type { DidString } from '@atproto/syntax'
|
|
4
5
|
|
|
5
6
|
describe('label hydration', () => {
|
|
6
7
|
let network: TestNetwork
|
|
7
8
|
let pdsAgent: AtpAgent
|
|
8
9
|
let sc: SeedClient
|
|
9
10
|
|
|
10
|
-
let alice:
|
|
11
|
-
let bob:
|
|
12
|
-
let carol:
|
|
13
|
-
let labelerDid:
|
|
11
|
+
let alice: DidString
|
|
12
|
+
let bob: DidString
|
|
13
|
+
let carol: DidString
|
|
14
|
+
let labelerDid: DidString
|
|
14
15
|
|
|
15
16
|
beforeAll(async () => {
|
|
16
17
|
network = await TestNetwork.create({
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { SeedClient, TestNetwork, TestNetworkNoAppView } from '@atproto/dev-env'
|
|
2
|
+
import type { DidString, HandleString } from '@atproto/syntax'
|
|
2
3
|
|
|
3
4
|
export type User = {
|
|
4
5
|
id: string
|
|
5
|
-
did:
|
|
6
|
+
did: DidString
|
|
6
7
|
email: string
|
|
7
|
-
handle:
|
|
8
|
+
handle: HandleString
|
|
8
9
|
password: string
|
|
9
10
|
displayName: string
|
|
10
11
|
description: string
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { SeedClient, TestNetwork, TestNetworkNoAppView } from '@atproto/dev-env'
|
|
2
|
+
import type { DidString, HandleString } from '@atproto/syntax'
|
|
2
3
|
|
|
3
4
|
export type User = {
|
|
4
5
|
id: string
|
|
5
|
-
did:
|
|
6
|
+
did: DidString
|
|
6
7
|
email: string
|
|
7
|
-
handle:
|
|
8
|
+
handle: HandleString
|
|
8
9
|
password: string
|
|
9
10
|
displayName: string
|
|
10
11
|
description: string
|
package/tests/seed/get-trends.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { SeedClient, TestNetwork, TestNetworkNoAppView } from '@atproto/dev-env'
|
|
2
|
+
import type { DidString, HandleString } from '@atproto/syntax'
|
|
2
3
|
|
|
3
4
|
export type User = {
|
|
4
5
|
id: string
|
|
5
|
-
did:
|
|
6
|
+
did: DidString
|
|
6
7
|
email: string
|
|
7
|
-
handle:
|
|
8
|
+
handle: HandleString
|
|
8
9
|
password: string
|
|
9
10
|
displayName: string
|
|
10
11
|
description: string
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { SeedClient, TestNetwork, TestNetworkNoAppView } from '@atproto/dev-env'
|
|
2
|
+
import type { HandleString } from '@atproto/syntax'
|
|
2
3
|
|
|
3
4
|
export type User = {
|
|
4
5
|
email: string
|
|
5
|
-
handle:
|
|
6
|
+
handle: HandleString
|
|
6
7
|
password: string
|
|
7
8
|
displayName: string
|
|
8
9
|
description: string
|
package/tests/seed/postgates.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { SeedClient, TestNetwork, TestNetworkNoAppView } from '@atproto/dev-env'
|
|
2
|
+
import type { DidString, HandleString } from '@atproto/syntax'
|
|
2
3
|
|
|
3
4
|
export type User = {
|
|
4
5
|
id: string
|
|
5
|
-
did:
|
|
6
|
+
did: DidString
|
|
6
7
|
email: string
|
|
7
|
-
handle:
|
|
8
|
+
handle: HandleString
|
|
8
9
|
password: string
|
|
9
10
|
displayName: string
|
|
10
11
|
description: string
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
2
2
|
import { AtpAgent, ids } from '@atproto/api'
|
|
3
3
|
import { SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
|
|
4
|
+
import type { DidString } from '@atproto/syntax'
|
|
4
5
|
|
|
5
6
|
describe('bsky account deactivation', () => {
|
|
6
7
|
let network: TestNetwork
|
|
7
8
|
let agent: AtpAgent
|
|
8
9
|
let sc: SeedClient
|
|
9
10
|
|
|
10
|
-
let alice:
|
|
11
|
+
let alice: DidString
|
|
11
12
|
|
|
12
13
|
beforeAll(async () => {
|
|
13
14
|
network = await TestNetwork.create({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
2
2
|
import { AtUri, AtpAgent, ids } from '@atproto/api'
|
|
3
3
|
import { SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
|
|
4
|
+
import type { DidString } from '@atproto/syntax'
|
|
4
5
|
|
|
5
6
|
describe('bsky actor likes feed views', () => {
|
|
6
7
|
let network: TestNetwork
|
|
@@ -9,9 +10,9 @@ describe('bsky actor likes feed views', () => {
|
|
|
9
10
|
let sc: SeedClient
|
|
10
11
|
|
|
11
12
|
// account dids, for convenience
|
|
12
|
-
let alice:
|
|
13
|
-
let bob:
|
|
14
|
-
let carol:
|
|
13
|
+
let alice: DidString
|
|
14
|
+
let bob: DidString
|
|
15
|
+
let carol: DidString
|
|
15
16
|
|
|
16
17
|
beforeAll(async () => {
|
|
17
18
|
network = await TestNetwork.create({
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
ids,
|
|
15
15
|
} from '@atproto/api'
|
|
16
16
|
import { SeedClient, TestNetwork, authorFeedSeed } from '@atproto/dev-env'
|
|
17
|
+
import type { DidString } from '@atproto/syntax'
|
|
17
18
|
import { uriToDid } from '../../src/util/uris.js'
|
|
18
19
|
import {
|
|
19
20
|
forSnapshot,
|
|
@@ -32,11 +33,11 @@ describe('pds author feed views', () => {
|
|
|
32
33
|
let sc: SeedClient
|
|
33
34
|
|
|
34
35
|
// account dids, for convenience
|
|
35
|
-
let alice:
|
|
36
|
-
let bob:
|
|
37
|
-
let carol:
|
|
38
|
-
let dan:
|
|
39
|
-
let eve:
|
|
36
|
+
let alice: DidString
|
|
37
|
+
let bob: DidString
|
|
38
|
+
let carol: DidString
|
|
39
|
+
let dan: DidString
|
|
40
|
+
let eve: DidString
|
|
40
41
|
|
|
41
42
|
beforeAll(async () => {
|
|
42
43
|
network = await TestNetwork.create({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
2
2
|
import { AtUri, AtpAgent, ids } from '@atproto/api'
|
|
3
3
|
import { RecordRef, SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
|
|
4
|
+
import type { DidString } from '@atproto/syntax'
|
|
4
5
|
import { forSnapshot } from '../_util.js'
|
|
5
6
|
|
|
6
7
|
describe('pds views with blocking from block lists', () => {
|
|
@@ -10,10 +11,10 @@ describe('pds views with blocking from block lists', () => {
|
|
|
10
11
|
let sc: SeedClient
|
|
11
12
|
let aliceReplyToDan: { ref: RecordRef }
|
|
12
13
|
|
|
13
|
-
let alice:
|
|
14
|
-
let bob:
|
|
15
|
-
let carol:
|
|
16
|
-
let dan:
|
|
14
|
+
let alice: DidString
|
|
15
|
+
let bob: DidString
|
|
16
|
+
let carol: DidString
|
|
17
|
+
let dan: DidString
|
|
17
18
|
|
|
18
19
|
beforeAll(async () => {
|
|
19
20
|
network = await TestNetwork.create({
|
|
@@ -232,7 +233,7 @@ describe('pds views with blocking from block lists', () => {
|
|
|
232
233
|
)
|
|
233
234
|
expect(
|
|
234
235
|
resDan.data.feed.some((post) =>
|
|
235
|
-
[bob, carol].includes(post.post.author.did),
|
|
236
|
+
[bob, carol].includes(post.post.author.did as DidString),
|
|
236
237
|
),
|
|
237
238
|
).toBeFalsy()
|
|
238
239
|
})
|
|
@@ -616,7 +617,7 @@ describe('pds views with blocking from block lists', () => {
|
|
|
616
617
|
)
|
|
617
618
|
expect(
|
|
618
619
|
resDan.data.feed.some((post) =>
|
|
619
|
-
[bob, carol].includes(post.post.author.did),
|
|
620
|
+
[bob, carol].includes(post.post.author.did as DidString),
|
|
620
621
|
),
|
|
621
622
|
).toBeTruthy()
|
|
622
623
|
})
|
|
@@ -653,7 +654,7 @@ describe('pds views with blocking from block lists', () => {
|
|
|
653
654
|
)
|
|
654
655
|
expect(
|
|
655
656
|
resDan.data.feed.some((post) =>
|
|
656
|
-
[bob, carol].includes(post.post.author.did),
|
|
657
|
+
[bob, carol].includes(post.post.author.did as DidString),
|
|
657
658
|
),
|
|
658
659
|
).toBeTruthy()
|
|
659
660
|
})
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
ids,
|
|
9
9
|
} from '@atproto/api'
|
|
10
10
|
import { RecordRef, SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
|
|
11
|
+
import type { DidString } from '@atproto/syntax'
|
|
11
12
|
import { assertIsThreadViewPost, forSnapshot } from '../_util.js'
|
|
12
13
|
|
|
13
14
|
describe('pds views with blocking', () => {
|
|
@@ -19,10 +20,10 @@ describe('pds views with blocking', () => {
|
|
|
19
20
|
let aliceReplyToDan: { ref: RecordRef }
|
|
20
21
|
let carolReplyToDan: { ref: RecordRef }
|
|
21
22
|
|
|
22
|
-
let alice:
|
|
23
|
-
let bob:
|
|
24
|
-
let carol:
|
|
25
|
-
let dan:
|
|
23
|
+
let alice: DidString
|
|
24
|
+
let bob: DidString
|
|
25
|
+
let carol: DidString
|
|
26
|
+
let dan: DidString
|
|
26
27
|
let danBlockUri: string
|
|
27
28
|
|
|
28
29
|
beforeAll(async () => {
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
ids,
|
|
21
21
|
} from '@atproto/api'
|
|
22
22
|
import { RecordRef, SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
|
|
23
|
+
import type { DidString } from '@atproto/syntax'
|
|
23
24
|
import { forSnapshot, paginateAll } from '../_util.js'
|
|
24
25
|
|
|
25
26
|
type Database = TestNetwork['bsky']['db']
|
|
@@ -31,10 +32,10 @@ describe('appview bookmarks views', () => {
|
|
|
31
32
|
let db: Database
|
|
32
33
|
|
|
33
34
|
// account dids, for convenience
|
|
34
|
-
let alice:
|
|
35
|
-
let bob:
|
|
36
|
-
let carol:
|
|
37
|
-
let dan:
|
|
35
|
+
let alice: DidString
|
|
36
|
+
let bob: DidString
|
|
37
|
+
let carol: DidString
|
|
38
|
+
let dan: DidString
|
|
38
39
|
|
|
39
40
|
beforeAll(async () => {
|
|
40
41
|
network = await TestNetwork.create({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
|
|
2
2
|
import { AtpAgent, ids } from '@atproto/api'
|
|
3
3
|
import { SeedClient, TestNetwork } from '@atproto/dev-env'
|
|
4
|
+
import type { DidString } from '@atproto/syntax'
|
|
4
5
|
import { Users, feedHiddenRepliesSeed } from '../seed/feed-hidden-replies.js'
|
|
5
6
|
|
|
6
7
|
describe('feed hidden replies', () => {
|
|
@@ -44,7 +45,7 @@ describe('feed hidden replies', () => {
|
|
|
44
45
|
createdAt: new Date().toISOString(),
|
|
45
46
|
hiddenReplies: [B.ref.uriStr],
|
|
46
47
|
},
|
|
47
|
-
sc.getHeaders(A.ref.uri.host),
|
|
48
|
+
sc.getHeaders(A.ref.uri.host as DidString),
|
|
48
49
|
)
|
|
49
50
|
|
|
50
51
|
await network.processAll()
|
|
@@ -87,7 +88,7 @@ describe('feed hidden replies', () => {
|
|
|
87
88
|
createdAt: new Date().toISOString(),
|
|
88
89
|
hiddenReplies: [B.ref.uriStr],
|
|
89
90
|
},
|
|
90
|
-
sc.getHeaders(A.ref.uri.host),
|
|
91
|
+
sc.getHeaders(A.ref.uri.host as DidString),
|
|
91
92
|
)
|
|
92
93
|
|
|
93
94
|
await network.processAll()
|
|
@@ -175,7 +176,7 @@ describe('feed hidden replies', () => {
|
|
|
175
176
|
createdAt: new Date().toISOString(),
|
|
176
177
|
hiddenReplies: [C.ref.uriStr],
|
|
177
178
|
},
|
|
178
|
-
sc.getHeaders(A.ref.uri.host),
|
|
179
|
+
sc.getHeaders(A.ref.uri.host as DidString),
|
|
179
180
|
)
|
|
180
181
|
await network.processAll()
|
|
181
182
|
const D = await sc.reply(users.viewer.did, A.ref, C.ref, `D`)
|
|
@@ -234,7 +235,7 @@ describe('feed hidden replies', () => {
|
|
|
234
235
|
repo: A.ref.uri.host,
|
|
235
236
|
rkey: A.ref.uri.rkey,
|
|
236
237
|
},
|
|
237
|
-
sc.getHeaders(A.ref.uri.host),
|
|
238
|
+
sc.getHeaders(A.ref.uri.host as DidString),
|
|
238
239
|
)
|
|
239
240
|
await network.processAll()
|
|
240
241
|
})
|