@atproto/bsky 0.0.246 → 0.0.247

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/auth-verifier.d.ts +18 -13
  3. package/dist/auth-verifier.d.ts.map +1 -1
  4. package/dist/auth-verifier.js +9 -2
  5. package/dist/auth-verifier.js.map +1 -1
  6. package/dist/config.d.ts +7 -7
  7. package/dist/config.d.ts.map +1 -1
  8. package/dist/config.js +4 -1
  9. package/dist/config.js.map +1 -1
  10. package/package.json +6 -6
  11. package/src/auth-verifier.ts +28 -18
  12. package/src/config.ts +8 -5
  13. package/tests/data-plane/subscription.test.ts +2 -1
  14. package/tests/data-plane/thread-mutes.test.ts +3 -2
  15. package/tests/feed-generation.test.ts +2 -1
  16. package/tests/label-hydration.test.ts +6 -5
  17. package/tests/query-labels.test.ts +5 -4
  18. package/tests/seed/feed-hidden-replies.ts +3 -2
  19. package/tests/seed/get-suggested-starter-packs.ts +3 -2
  20. package/tests/seed/get-trends.ts +3 -2
  21. package/tests/seed/known-followers.ts +2 -1
  22. package/tests/seed/postgates.ts +3 -2
  23. package/tests/views/account-deactivation.test.ts +2 -1
  24. package/tests/views/actor-likes.test.ts +4 -3
  25. package/tests/views/author-feed.test.ts +6 -5
  26. package/tests/views/block-lists.test.ts +8 -7
  27. package/tests/views/blocks.test.ts +5 -4
  28. package/tests/views/bookmarks.test.ts +5 -4
  29. package/tests/views/feed-hidden-replies.test.ts +5 -4
  30. package/tests/views/feed-view-post.test.ts +5 -4
  31. package/tests/views/get-suggested-onboarding-users.test.ts +3 -2
  32. package/tests/views/internal-actor.test.ts +2 -1
  33. package/tests/views/known-followers.test.ts +2 -1
  34. package/tests/views/labeler-service.test.ts +4 -3
  35. package/tests/views/likes.test.ts +5 -4
  36. package/tests/views/list-feed.test.ts +7 -4
  37. package/tests/views/mute-lists.test.ts +22 -11
  38. package/tests/views/mutes.test.ts +24 -10
  39. package/tests/views/notifications.test.ts +15 -14
  40. package/tests/views/post-search.test.ts +4 -3
  41. package/tests/views/profile.test.ts +12 -8
  42. package/tests/views/quotes.test.ts +5 -4
  43. package/tests/views/thread.test.ts +4 -3
@@ -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: string
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: string
80
- alternateAudienceDids: string[]
81
- modServiceDid: string
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: string
88
- public standardAudienceDids: Set<string>
89
- public modServiceDid: string
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 (!opts.skipAudCheck && !this.standardAudienceDids.has(aud)) {
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
- reqCtx: ReqCtx,
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
- ): Promise<{
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
- return { iss: payload.iss, aud: payload.aud }
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): boolean {
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: string
43
- alternateAudienceDids: string[]
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: string
79
+ modServiceDid: DidString
80
80
  adminPasswords: string[]
81
- labelsFromIssuerDids?: string[]
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: string,
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: string
11
- let bob: string
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: string
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: string
13
- let bob: string
14
- let carol: string
15
- let labelerDid: string
16
- let labeler2Did: string
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: string
11
- let bob: string
12
- let carol: string
13
- let labelerDid: string
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: string
6
+ did: DidString
6
7
  email: string
7
- handle: string
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: string
6
+ did: DidString
6
7
  email: string
7
- handle: string
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: string
6
+ did: DidString
6
7
  email: string
7
- handle: string
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: string
6
+ handle: HandleString
6
7
  password: string
7
8
  displayName: string
8
9
  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: string
6
+ did: DidString
6
7
  email: string
7
- handle: string
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: string
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: string
13
- let bob: string
14
- let carol: string
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: string
36
- let bob: string
37
- let carol: string
38
- let dan: string
39
- let eve: string
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: string
14
- let bob: string
15
- let carol: string
16
- let dan: string
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: string
23
- let bob: string
24
- let carol: string
25
- let dan: string
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: string
35
- let bob: string
36
- let carol: string
37
- let dan: string
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
  })
@@ -2,6 +2,7 @@ import assert from 'node:assert'
2
2
  import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
3
3
  import { AppBskyFeedDefs, AtUri, AtpAgent, ids } from '@atproto/api'
4
4
  import { SeedClient, TestNetwork, basicSeed } from '@atproto/dev-env'
5
+ import type { DidString } from '@atproto/syntax'
5
6
 
6
7
  /**
7
8
  * The frontend computes feed slices for display using at-most one
@@ -23,10 +24,10 @@ describe('pds thread views', () => {
23
24
  let sc: SeedClient
24
25
 
25
26
  // account dids, for convenience
26
- let alice: string
27
- let bob: string
28
- let carol: string
29
- let dan: string
27
+ let alice: DidString
28
+ let bob: DidString
29
+ let carol: DidString
30
+ let dan: DidString
30
31
 
31
32
  beforeAll(async () => {
32
33
  network = await TestNetwork.create({
@@ -11,12 +11,13 @@ import {
11
11
  ids,
12
12
  } from '@atproto/api'
13
13
  import { SeedClient, TestNetwork } from '@atproto/dev-env'
14
+ import type { DidString, HandleString } from '@atproto/syntax'
14
15
 
15
16
  type User = {
16
17
  id: string
17
- did: string
18
+ did: DidString
18
19
  email: string
19
- handle: string
20
+ handle: HandleString
20
21
  password: string
21
22
  displayName: string
22
23
  description: string
@@ -1,6 +1,7 @@
1
1
  import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
2
2
  import { AppBskyActorDefs, AtpAgent } from '@atproto/api'
3
3
  import { SeedClient, TestNetwork } from '@atproto/dev-env'
4
+ import type { DidString } from '@atproto/syntax'
4
5
  import { knownFollowersSeed } from '../seed/known-followers.js'
5
6
 
6
7
  describe('internal actor views', () => {
@@ -8,7 +9,7 @@ describe('internal actor views', () => {
8
9
  let pdsAgent: AtpAgent
9
10
  let seedClient: SeedClient
10
11
 
11
- let dids: Record<string, string>
12
+ let dids: Record<string, DidString>
12
13
 
13
14
  beforeAll(async () => {
14
15
  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 { knownFollowersSeed } from '../seed/known-followers.js'
5
6
 
6
7
  describe('known followers (social proof)', () => {
@@ -9,7 +10,7 @@ describe('known followers (social proof)', () => {
9
10
  let pdsAgent: AtpAgent
10
11
  let seedClient: SeedClient
11
12
 
12
- let dids: Record<string, string>
13
+ let dids: Record<string, DidString>
13
14
 
14
15
  beforeAll(async () => {
15
16
  network = await TestNetwork.create({
@@ -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 { forSnapshot, stripViewerFromLabeler } from '../_util.js'
12
13
 
13
14
  describe('labeler service views', () => {
@@ -17,9 +18,9 @@ describe('labeler service views', () => {
17
18
  let sc: SeedClient
18
19
 
19
20
  // account dids, for convenience
20
- let alice: string
21
- let bob: string
22
- let carol: string
21
+ let alice: DidString
22
+ let bob: DidString
23
+ let carol: DidString
23
24
 
24
25
  let aliceService: RecordRef
25
26
 
@@ -1,6 +1,7 @@
1
1
  import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'
2
2
  import { AppBskyFeedGetLikes, AtpAgent, ids } from '@atproto/api'
3
3
  import { SeedClient, TestNetwork, likesSeed } from '@atproto/dev-env'
4
+ import type { DidString } from '@atproto/syntax'
4
5
  import {
5
6
  constantDate,
6
7
  forSnapshot,
@@ -14,10 +15,10 @@ describe('pds like views', () => {
14
15
  let sc: SeedClient
15
16
 
16
17
  // account dids, for convenience
17
- let alice: string
18
- let bob: string
19
- let carol: string
20
- let frankie: string
18
+ let alice: DidString
19
+ let bob: DidString
20
+ let carol: DidString
21
+ let frankie: DidString
21
22
 
22
23
  beforeAll(async () => {
23
24
  network = await TestNetwork.create({