@atproto/bsky 0.0.155 → 0.0.157
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 +18 -0
- package/dist/api/app/bsky/{unspecced/getPostThreadHiddenV2.d.ts → notification/getPreferences.d.ts} +1 -1
- package/dist/api/app/bsky/notification/getPreferences.d.ts.map +1 -0
- package/dist/api/app/bsky/notification/getPreferences.js +39 -0
- package/dist/api/app/bsky/notification/getPreferences.js.map +1 -0
- package/dist/api/app/bsky/notification/putPreferencesV2.d.ts +4 -0
- package/dist/api/app/bsky/notification/putPreferencesV2.d.ts.map +1 -0
- package/dist/api/app/bsky/notification/putPreferencesV2.js +47 -0
- package/dist/api/app/bsky/notification/putPreferencesV2.js.map +1 -0
- package/dist/api/app/bsky/notification/util.d.ts +9 -0
- package/dist/api/app/bsky/notification/util.d.ts.map +1 -0
- package/dist/api/app/bsky/notification/util.js +84 -0
- package/dist/api/app/bsky/notification/util.js.map +1 -0
- package/dist/api/app/bsky/unspecced/getPostThreadOtherV2.d.ts +4 -0
- package/dist/api/app/bsky/unspecced/getPostThreadOtherV2.d.ts.map +1 -0
- package/dist/api/app/bsky/unspecced/{getPostThreadHiddenV2.js → getPostThreadOtherV2.js} +5 -5
- package/dist/api/app/bsky/unspecced/getPostThreadOtherV2.js.map +1 -0
- package/dist/api/app/bsky/unspecced/getPostThreadV2.js +2 -2
- package/dist/api/app/bsky/unspecced/getPostThreadV2.js.map +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +6 -2
- package/dist/api/index.js.map +1 -1
- package/dist/context.d.ts +3 -0
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +3 -0
- package/dist/context.js.map +1 -1
- package/dist/data-plane/bsync/index.d.ts.map +1 -1
- package/dist/data-plane/bsync/index.js +84 -0
- package/dist/data-plane/bsync/index.js.map +1 -1
- package/dist/data-plane/server/db/database-schema.d.ts +2 -1
- package/dist/data-plane/server/db/database-schema.d.ts.map +1 -1
- package/dist/data-plane/server/db/migrations/20250602T190357447Z-add-private-data.d.ts +4 -0
- package/dist/data-plane/server/db/migrations/20250602T190357447Z-add-private-data.d.ts.map +1 -0
- package/dist/data-plane/server/db/migrations/20250602T190357447Z-add-private-data.js +24 -0
- package/dist/data-plane/server/db/migrations/20250602T190357447Z-add-private-data.js.map +1 -0
- package/dist/data-plane/server/db/migrations/index.d.ts +1 -0
- package/dist/data-plane/server/db/migrations/index.d.ts.map +1 -1
- package/dist/data-plane/server/db/migrations/index.js +2 -1
- package/dist/data-plane/server/db/migrations/index.js.map +1 -1
- package/dist/data-plane/server/db/tables/private-data.d.ts +13 -0
- package/dist/data-plane/server/db/tables/private-data.d.ts.map +1 -0
- package/dist/data-plane/server/db/tables/private-data.js +5 -0
- package/dist/data-plane/server/db/tables/private-data.js.map +1 -0
- package/dist/data-plane/server/routes/index.d.ts.map +1 -1
- package/dist/data-plane/server/routes/index.js +2 -0
- package/dist/data-plane/server/routes/index.js.map +1 -1
- package/dist/data-plane/server/routes/private-data.d.ts +9 -0
- package/dist/data-plane/server/routes/private-data.d.ts.map +1 -0
- package/dist/data-plane/server/routes/private-data.js +63 -0
- package/dist/data-plane/server/routes/private-data.js.map +1 -0
- package/dist/data-plane/server/util.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/lexicon/index.d.ts +8 -4
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +14 -6
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +518 -100
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +277 -52
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/notification/defs.d.ts +40 -0
- package/dist/lexicon/types/app/bsky/notification/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/notification/defs.js +36 -0
- package/dist/lexicon/types/app/bsky/notification/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/notification/getPreferences.d.ts +35 -0
- package/dist/lexicon/types/app/bsky/notification/getPreferences.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/notification/getPreferences.js +7 -0
- package/dist/lexicon/types/app/bsky/notification/getPreferences.js.map +1 -0
- package/dist/lexicon/types/app/bsky/notification/putPreferencesV2.d.ts +52 -0
- package/dist/lexicon/types/app/bsky/notification/putPreferencesV2.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/notification/putPreferencesV2.js +7 -0
- package/dist/lexicon/types/app/bsky/notification/putPreferencesV2.js.map +1 -0
- package/dist/lexicon/types/app/bsky/unspecced/{getPostThreadHiddenV2.d.ts → getPostThreadOtherV2.d.ts} +7 -7
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadOtherV2.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadOtherV2.js +16 -0
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadOtherV2.js.map +1 -0
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.d.ts.map +1 -1
- package/dist/proto/bsky_connect.d.ts +10 -1
- package/dist/proto/bsky_connect.d.ts.map +1 -1
- package/dist/proto/bsky_connect.js +9 -0
- package/dist/proto/bsky_connect.js.map +1 -1
- package/dist/proto/bsky_pb.d.ts +234 -0
- package/dist/proto/bsky_pb.d.ts.map +1 -1
- package/dist/proto/bsky_pb.js +693 -5
- package/dist/proto/bsky_pb.js.map +1 -1
- package/dist/proto/bsync_pb.d.ts +10 -10
- package/dist/proto/bsync_pb.d.ts.map +1 -1
- package/dist/proto/bsync_pb.js +15 -15
- package/dist/proto/bsync_pb.js.map +1 -1
- package/dist/stash.d.ts +26 -0
- package/dist/stash.d.ts.map +1 -0
- package/dist/stash.js +56 -0
- package/dist/stash.js.map +1 -0
- package/dist/views/index.d.ts +8 -8
- package/dist/views/index.d.ts.map +1 -1
- package/dist/views/index.js +32 -32
- package/dist/views/index.js.map +1 -1
- package/dist/views/threads-v2.d.ts +11 -11
- package/dist/views/threads-v2.d.ts.map +1 -1
- package/dist/views/threads-v2.js.map +1 -1
- package/package.json +4 -4
- package/proto/bsky.proto +61 -0
- package/src/api/app/bsky/notification/getPreferences.ts +50 -0
- package/src/api/app/bsky/notification/putPreferencesV2.ts +62 -0
- package/src/api/app/bsky/notification/util.ts +123 -0
- package/src/api/app/bsky/unspecced/{getPostThreadHiddenV2.ts → getPostThreadOtherV2.ts} +5 -5
- package/src/api/app/bsky/unspecced/getPostThreadV2.ts +2 -2
- package/src/api/index.ts +6 -2
- package/src/context.ts +6 -0
- package/src/data-plane/bsync/index.ts +109 -1
- package/src/data-plane/server/db/database-schema.ts +3 -1
- package/src/data-plane/server/db/migrations/20250602T190357447Z-add-private-data.ts +22 -0
- package/src/data-plane/server/db/migrations/index.ts +1 -0
- package/src/data-plane/server/db/tables/private-data.ts +13 -0
- package/src/data-plane/server/routes/index.ts +2 -0
- package/src/data-plane/server/routes/private-data.ts +90 -0
- package/src/index.ts +4 -0
- package/src/lexicon/index.ts +38 -14
- package/src/lexicon/lexicons.ts +281 -54
- package/src/lexicon/types/app/bsky/notification/defs.ts +76 -0
- package/src/lexicon/types/app/bsky/notification/getPreferences.ts +52 -0
- package/src/lexicon/types/app/bsky/notification/putPreferencesV2.ts +69 -0
- package/src/lexicon/types/app/bsky/unspecced/{getPostThreadHiddenV2.ts → getPostThreadOtherV2.ts} +10 -10
- package/src/lexicon/types/app/bsky/unspecced/getPostThreadV2.ts +2 -2
- package/src/proto/bsky_connect.ts +11 -0
- package/src/proto/bsky_pb.ts +669 -0
- package/src/proto/bsync_pb.ts +15 -15
- package/src/stash.ts +75 -0
- package/src/views/index.ts +46 -46
- package/src/views/threads-v2.ts +23 -23
- package/tests/stash.test.ts +156 -0
- package/tests/views/__snapshots__/thread-v2.test.ts.snap +7 -7
- package/tests/views/notifications.test.ts +221 -0
- package/tests/views/thread-v2.test.ts +93 -93
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.tests.tsbuildinfo +1 -1
- package/dist/api/app/bsky/unspecced/getPostThreadHiddenV2.d.ts.map +0 -1
- package/dist/api/app/bsky/unspecced/getPostThreadHiddenV2.js.map +0 -1
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.d.ts.map +0 -1
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.js +0 -16
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.js.map +0 -1
|
@@ -3,14 +3,14 @@ import { AppBskyUnspeccedDefs, AtpAgent } from '@atproto/api'
|
|
|
3
3
|
import { SeedClient, TestNetwork } from '@atproto/dev-env'
|
|
4
4
|
import { ids } from '../../src/lexicon/lexicons'
|
|
5
5
|
import { ThreadItemPost } from '../../src/lexicon/types/app/bsky/unspecced/defs'
|
|
6
|
-
import { OutputSchema as OutputSchemaHiddenThread } from '../../src/lexicon/types/app/bsky/unspecced/
|
|
6
|
+
import { OutputSchema as OutputSchemaHiddenThread } from '../../src/lexicon/types/app/bsky/unspecced/getPostThreadOtherV2'
|
|
7
7
|
import {
|
|
8
8
|
OutputSchema as OutputSchemaThread,
|
|
9
9
|
QueryParams as QueryParamsThread,
|
|
10
10
|
} from '../../src/lexicon/types/app/bsky/unspecced/getPostThreadV2'
|
|
11
11
|
import {
|
|
12
|
-
ThreadHiddenItemValuePost,
|
|
13
12
|
ThreadItemValuePost,
|
|
13
|
+
ThreadOtherItemValuePost,
|
|
14
14
|
} from '../../src/views/threads-v2'
|
|
15
15
|
import { forSnapshot } from '../_util'
|
|
16
16
|
import * as seeds from '../seed/thread-v2'
|
|
@@ -96,10 +96,10 @@ describe('appview thread views v2', () => {
|
|
|
96
96
|
),
|
|
97
97
|
},
|
|
98
98
|
)
|
|
99
|
-
const { thread: t,
|
|
99
|
+
const { thread: t, hasOtherReplies } = data
|
|
100
100
|
|
|
101
101
|
assertPosts(t)
|
|
102
|
-
expect(
|
|
102
|
+
expect(hasOtherReplies).toBe(false)
|
|
103
103
|
expect(t).toEqual([
|
|
104
104
|
expect.objectContaining({ depth: 0, uri: seed.root.ref.uriStr }),
|
|
105
105
|
expect.objectContaining({ depth: 1, uri: seed.r['0'].ref.uriStr }),
|
|
@@ -122,10 +122,10 @@ describe('appview thread views v2', () => {
|
|
|
122
122
|
),
|
|
123
123
|
},
|
|
124
124
|
)
|
|
125
|
-
const { thread: t,
|
|
125
|
+
const { thread: t, hasOtherReplies } = data
|
|
126
126
|
|
|
127
127
|
assertPosts(t)
|
|
128
|
-
expect(
|
|
128
|
+
expect(hasOtherReplies).toBe(false)
|
|
129
129
|
expect(t).toEqual([
|
|
130
130
|
expect.objectContaining({ depth: -1, uri: seed.root.ref.uriStr }),
|
|
131
131
|
expect.objectContaining({ depth: 0, uri: seed.r['0'].ref.uriStr }),
|
|
@@ -144,10 +144,10 @@ describe('appview thread views v2', () => {
|
|
|
144
144
|
),
|
|
145
145
|
},
|
|
146
146
|
)
|
|
147
|
-
const { thread: t,
|
|
147
|
+
const { thread: t, hasOtherReplies } = data
|
|
148
148
|
|
|
149
149
|
assertPosts(t)
|
|
150
|
-
expect(
|
|
150
|
+
expect(hasOtherReplies).toBe(false)
|
|
151
151
|
expect(t).toEqual([
|
|
152
152
|
expect.objectContaining({ depth: -2, uri: seed.root.ref.uriStr }),
|
|
153
153
|
expect.objectContaining({ depth: -1, uri: seed.r['0'].ref.uriStr }),
|
|
@@ -166,10 +166,10 @@ describe('appview thread views v2', () => {
|
|
|
166
166
|
),
|
|
167
167
|
},
|
|
168
168
|
)
|
|
169
|
-
const { thread: t,
|
|
169
|
+
const { thread: t, hasOtherReplies } = data
|
|
170
170
|
|
|
171
171
|
assertPosts(t)
|
|
172
|
-
expect(
|
|
172
|
+
expect(hasOtherReplies).toBe(false)
|
|
173
173
|
expect(t).toEqual([
|
|
174
174
|
expect.objectContaining({ depth: -1, uri: seed.root.ref.uriStr }),
|
|
175
175
|
expect.objectContaining({ depth: 0, uri: seed.r['1'].ref.uriStr }),
|
|
@@ -187,10 +187,10 @@ describe('appview thread views v2', () => {
|
|
|
187
187
|
),
|
|
188
188
|
},
|
|
189
189
|
)
|
|
190
|
-
const { thread: t,
|
|
190
|
+
const { thread: t, hasOtherReplies } = data
|
|
191
191
|
|
|
192
192
|
assertPosts(t)
|
|
193
|
-
expect(
|
|
193
|
+
expect(hasOtherReplies).toBe(false)
|
|
194
194
|
expect(t).toEqual([
|
|
195
195
|
expect.objectContaining({ depth: -1, uri: seed.root.ref.uriStr }),
|
|
196
196
|
expect.objectContaining({ depth: 0, uri: seed.r['2'].ref.uriStr }),
|
|
@@ -209,10 +209,10 @@ describe('appview thread views v2', () => {
|
|
|
209
209
|
),
|
|
210
210
|
},
|
|
211
211
|
)
|
|
212
|
-
const { thread: t,
|
|
212
|
+
const { thread: t, hasOtherReplies } = data
|
|
213
213
|
|
|
214
214
|
assertPosts(t)
|
|
215
|
-
expect(
|
|
215
|
+
expect(hasOtherReplies).toBe(false)
|
|
216
216
|
expect(t).toEqual([
|
|
217
217
|
expect.objectContaining({ depth: -2, uri: seed.root.ref.uriStr }),
|
|
218
218
|
expect.objectContaining({ depth: -1, uri: seed.r['2'].ref.uriStr }),
|
|
@@ -231,10 +231,10 @@ describe('appview thread views v2', () => {
|
|
|
231
231
|
),
|
|
232
232
|
},
|
|
233
233
|
)
|
|
234
|
-
const { thread: t,
|
|
234
|
+
const { thread: t, hasOtherReplies } = data
|
|
235
235
|
|
|
236
236
|
assertPosts(t)
|
|
237
|
-
expect(
|
|
237
|
+
expect(hasOtherReplies).toBe(false)
|
|
238
238
|
expect(t).toEqual([
|
|
239
239
|
expect.objectContaining({ depth: -1, uri: seed.root.ref.uriStr }),
|
|
240
240
|
expect.objectContaining({ depth: 0, uri: seed.r['3'].ref.uriStr }),
|
|
@@ -290,10 +290,10 @@ describe('appview thread views v2', () => {
|
|
|
290
290
|
),
|
|
291
291
|
},
|
|
292
292
|
)
|
|
293
|
-
const { thread: t,
|
|
293
|
+
const { thread: t, hasOtherReplies } = data
|
|
294
294
|
|
|
295
295
|
assertPosts(t)
|
|
296
|
-
expect(
|
|
296
|
+
expect(hasOtherReplies).toBe(false)
|
|
297
297
|
const anchorIndex = t.findIndex((i) => i.uri === post.ref.uriStr)
|
|
298
298
|
const anchorPost = t[anchorIndex]
|
|
299
299
|
|
|
@@ -333,10 +333,10 @@ describe('appview thread views v2', () => {
|
|
|
333
333
|
),
|
|
334
334
|
},
|
|
335
335
|
)
|
|
336
|
-
const { thread: t,
|
|
336
|
+
const { thread: t, hasOtherReplies } = data
|
|
337
337
|
|
|
338
338
|
assertPosts(t)
|
|
339
|
-
expect(
|
|
339
|
+
expect(hasOtherReplies).toBe(false)
|
|
340
340
|
expect(t).toHaveLength(16) // anchor + 15 ancestors, as limited by `maxThreadParents`.
|
|
341
341
|
|
|
342
342
|
const first = t.at(0)
|
|
@@ -367,10 +367,10 @@ describe('appview thread views v2', () => {
|
|
|
367
367
|
),
|
|
368
368
|
},
|
|
369
369
|
)
|
|
370
|
-
const { thread: t,
|
|
370
|
+
const { thread: t, hasOtherReplies } = data
|
|
371
371
|
|
|
372
372
|
assertPosts(t)
|
|
373
|
-
expect(
|
|
373
|
+
expect(hasOtherReplies).toBe(false)
|
|
374
374
|
expect(t).toHaveLength(1)
|
|
375
375
|
|
|
376
376
|
const first = t.at(0)
|
|
@@ -394,10 +394,10 @@ describe('appview thread views v2', () => {
|
|
|
394
394
|
),
|
|
395
395
|
},
|
|
396
396
|
)
|
|
397
|
-
const { thread: t,
|
|
397
|
+
const { thread: t, hasOtherReplies } = data
|
|
398
398
|
|
|
399
399
|
assertPosts(t)
|
|
400
|
-
expect(
|
|
400
|
+
expect(hasOtherReplies).toBe(false)
|
|
401
401
|
expect(t).toHaveLength(11)
|
|
402
402
|
const first = t.at(0)
|
|
403
403
|
expect(first!.uri).toBe(seed.root.ref.uriStr)
|
|
@@ -417,10 +417,10 @@ describe('appview thread views v2', () => {
|
|
|
417
417
|
),
|
|
418
418
|
},
|
|
419
419
|
)
|
|
420
|
-
const { thread: t,
|
|
420
|
+
const { thread: t, hasOtherReplies } = data
|
|
421
421
|
|
|
422
422
|
assertPosts(t)
|
|
423
|
-
expect(
|
|
423
|
+
expect(hasOtherReplies).toBe(false)
|
|
424
424
|
expect(t).toHaveLength(4)
|
|
425
425
|
|
|
426
426
|
const first = t.at(0)
|
|
@@ -593,10 +593,10 @@ describe('appview thread views v2', () => {
|
|
|
593
593
|
),
|
|
594
594
|
},
|
|
595
595
|
)
|
|
596
|
-
const { thread: t,
|
|
596
|
+
const { thread: t, hasOtherReplies } = data
|
|
597
597
|
|
|
598
598
|
assertPosts(t)
|
|
599
|
-
expect(
|
|
599
|
+
expect(hasOtherReplies).toBe(false)
|
|
600
600
|
if ('length' in args) {
|
|
601
601
|
expect(data.thread).toHaveLength(args.length)
|
|
602
602
|
} else {
|
|
@@ -632,10 +632,10 @@ describe('appview thread views v2', () => {
|
|
|
632
632
|
),
|
|
633
633
|
},
|
|
634
634
|
)
|
|
635
|
-
const { thread: t,
|
|
635
|
+
const { thread: t, hasOtherReplies } = data
|
|
636
636
|
|
|
637
637
|
assertPosts(t)
|
|
638
|
-
expect(
|
|
638
|
+
expect(hasOtherReplies).toBe(false)
|
|
639
639
|
expect(t).toEqual([
|
|
640
640
|
expect.objectContaining({
|
|
641
641
|
uri: seed.root.ref.uriStr,
|
|
@@ -780,10 +780,10 @@ describe('appview thread views v2', () => {
|
|
|
780
780
|
),
|
|
781
781
|
},
|
|
782
782
|
)
|
|
783
|
-
const { thread: t,
|
|
783
|
+
const { thread: t, hasOtherReplies } = data
|
|
784
784
|
|
|
785
785
|
assertPosts(t)
|
|
786
|
-
expect(
|
|
786
|
+
expect(hasOtherReplies).toBe(false)
|
|
787
787
|
const opThreadPostsUris = new Set(
|
|
788
788
|
opThreadPosts.map((k) =>
|
|
789
789
|
k === 'root' ? seed.root.ref.uriStr : seed.r[k].ref.uriStr,
|
|
@@ -884,10 +884,10 @@ describe('appview thread views v2', () => {
|
|
|
884
884
|
),
|
|
885
885
|
},
|
|
886
886
|
)
|
|
887
|
-
const { thread: t,
|
|
887
|
+
const { thread: t, hasOtherReplies } = data
|
|
888
888
|
|
|
889
889
|
assertPosts(t)
|
|
890
|
-
expect(
|
|
890
|
+
expect(hasOtherReplies).toBe(false)
|
|
891
891
|
const tUris = t.map((i) => i.uri)
|
|
892
892
|
const postUris = postKeys.map((k) =>
|
|
893
893
|
k === 'root' ? seed.root.ref.uriStr : seed.r[k].ref.uriStr,
|
|
@@ -937,10 +937,10 @@ describe('appview thread views v2', () => {
|
|
|
937
937
|
),
|
|
938
938
|
},
|
|
939
939
|
)
|
|
940
|
-
const { thread: t,
|
|
940
|
+
const { thread: t, hasOtherReplies } = data
|
|
941
941
|
|
|
942
942
|
assertPosts(t)
|
|
943
|
-
expect(
|
|
943
|
+
expect(hasOtherReplies).toBe(false)
|
|
944
944
|
const tUris = t.map((i) => i.uri)
|
|
945
945
|
const postUris = postKeys.map((k) =>
|
|
946
946
|
k === 'root' ? seed.root.ref.uriStr : seed.r[k].ref.uriStr,
|
|
@@ -1089,10 +1089,10 @@ describe('appview thread views v2', () => {
|
|
|
1089
1089
|
),
|
|
1090
1090
|
},
|
|
1091
1091
|
)
|
|
1092
|
-
const { thread: t,
|
|
1092
|
+
const { thread: t, hasOtherReplies } = data
|
|
1093
1093
|
|
|
1094
1094
|
assertPosts(t)
|
|
1095
|
-
expect(
|
|
1095
|
+
expect(hasOtherReplies).toBe(false)
|
|
1096
1096
|
const tUris = t.map((i) => i.uri)
|
|
1097
1097
|
const postUris = postKeys.map((k) =>
|
|
1098
1098
|
k === 'root' ? seed.root.ref.uriStr : seed.r[k].ref.uriStr,
|
|
@@ -1128,10 +1128,10 @@ describe('appview thread views v2', () => {
|
|
|
1128
1128
|
),
|
|
1129
1129
|
},
|
|
1130
1130
|
)
|
|
1131
|
-
const { thread: t,
|
|
1131
|
+
const { thread: t, hasOtherReplies } = data
|
|
1132
1132
|
|
|
1133
1133
|
assertPosts(t)
|
|
1134
|
-
expect(
|
|
1134
|
+
expect(hasOtherReplies).toBe(false)
|
|
1135
1135
|
return t
|
|
1136
1136
|
}
|
|
1137
1137
|
|
|
@@ -1223,10 +1223,10 @@ describe('appview thread views v2', () => {
|
|
|
1223
1223
|
),
|
|
1224
1224
|
},
|
|
1225
1225
|
)
|
|
1226
|
-
const { thread: t,
|
|
1226
|
+
const { thread: t, hasOtherReplies } = data
|
|
1227
1227
|
|
|
1228
1228
|
assertPosts(t)
|
|
1229
|
-
expect(
|
|
1229
|
+
expect(hasOtherReplies).toBe(false)
|
|
1230
1230
|
expect(t).toEqual([
|
|
1231
1231
|
expect.objectContaining({ uri: seed.root.ref.uriStr }),
|
|
1232
1232
|
expect.objectContaining({ uri: seed.r['3'].ref.uriStr }),
|
|
@@ -1246,9 +1246,9 @@ describe('appview thread views v2', () => {
|
|
|
1246
1246
|
),
|
|
1247
1247
|
},
|
|
1248
1248
|
)
|
|
1249
|
-
const { thread: t,
|
|
1249
|
+
const { thread: t, hasOtherReplies } = data
|
|
1250
1250
|
|
|
1251
|
-
expect(
|
|
1251
|
+
expect(hasOtherReplies).toBe(false)
|
|
1252
1252
|
expect(t).toEqual([
|
|
1253
1253
|
expect.objectContaining({
|
|
1254
1254
|
uri: seed.r['0'].ref.uriStr,
|
|
@@ -1271,9 +1271,9 @@ describe('appview thread views v2', () => {
|
|
|
1271
1271
|
),
|
|
1272
1272
|
},
|
|
1273
1273
|
)
|
|
1274
|
-
const { thread: t,
|
|
1274
|
+
const { thread: t, hasOtherReplies } = data
|
|
1275
1275
|
|
|
1276
|
-
expect(
|
|
1276
|
+
expect(hasOtherReplies).toBe(false)
|
|
1277
1277
|
expect(t).toEqual([
|
|
1278
1278
|
expect.objectContaining({
|
|
1279
1279
|
uri: seed.r['0'].ref.uriStr,
|
|
@@ -1305,9 +1305,9 @@ describe('appview thread views v2', () => {
|
|
|
1305
1305
|
),
|
|
1306
1306
|
},
|
|
1307
1307
|
)
|
|
1308
|
-
const { thread: t,
|
|
1308
|
+
const { thread: t, hasOtherReplies } = data
|
|
1309
1309
|
|
|
1310
|
-
expect(
|
|
1310
|
+
expect(hasOtherReplies).toBe(false)
|
|
1311
1311
|
assertPosts(t)
|
|
1312
1312
|
expect(t).toEqual([
|
|
1313
1313
|
expect.objectContaining({ uri: seed.root.ref.uriStr }),
|
|
@@ -1330,9 +1330,9 @@ describe('appview thread views v2', () => {
|
|
|
1330
1330
|
),
|
|
1331
1331
|
},
|
|
1332
1332
|
)
|
|
1333
|
-
const { thread: t,
|
|
1333
|
+
const { thread: t, hasOtherReplies } = data
|
|
1334
1334
|
|
|
1335
|
-
expect(
|
|
1335
|
+
expect(hasOtherReplies).toBe(false)
|
|
1336
1336
|
expect(t).toEqual([
|
|
1337
1337
|
expect.objectContaining({
|
|
1338
1338
|
uri: seed.root.ref.uriStr,
|
|
@@ -1370,9 +1370,9 @@ describe('appview thread views v2', () => {
|
|
|
1370
1370
|
),
|
|
1371
1371
|
},
|
|
1372
1372
|
)
|
|
1373
|
-
const { thread: t,
|
|
1373
|
+
const { thread: t, hasOtherReplies } = data
|
|
1374
1374
|
|
|
1375
|
-
expect(
|
|
1375
|
+
expect(hasOtherReplies).toBe(false)
|
|
1376
1376
|
expect(t).toEqual([
|
|
1377
1377
|
expect.objectContaining({
|
|
1378
1378
|
uri: seed.r['1'].ref.uriStr,
|
|
@@ -1402,9 +1402,9 @@ describe('appview thread views v2', () => {
|
|
|
1402
1402
|
),
|
|
1403
1403
|
},
|
|
1404
1404
|
)
|
|
1405
|
-
const { thread: t,
|
|
1405
|
+
const { thread: t, hasOtherReplies } = data
|
|
1406
1406
|
|
|
1407
|
-
expect(
|
|
1407
|
+
expect(hasOtherReplies).toBe(false)
|
|
1408
1408
|
expect(t).toEqual([
|
|
1409
1409
|
expect.objectContaining({
|
|
1410
1410
|
uri: seed.root.ref.uriStr,
|
|
@@ -1442,9 +1442,9 @@ describe('appview thread views v2', () => {
|
|
|
1442
1442
|
),
|
|
1443
1443
|
},
|
|
1444
1444
|
)
|
|
1445
|
-
const { thread: t,
|
|
1445
|
+
const { thread: t, hasOtherReplies } = data
|
|
1446
1446
|
|
|
1447
|
-
expect(
|
|
1447
|
+
expect(hasOtherReplies).toBe(false)
|
|
1448
1448
|
assertPosts(t)
|
|
1449
1449
|
expect(t).toEqual([
|
|
1450
1450
|
expect.objectContaining({ uri: seed.root.ref.uriStr }),
|
|
@@ -1466,9 +1466,9 @@ describe('appview thread views v2', () => {
|
|
|
1466
1466
|
),
|
|
1467
1467
|
},
|
|
1468
1468
|
)
|
|
1469
|
-
const { thread: t,
|
|
1469
|
+
const { thread: t, hasOtherReplies } = data
|
|
1470
1470
|
|
|
1471
|
-
expect(
|
|
1471
|
+
expect(hasOtherReplies).toBe(false)
|
|
1472
1472
|
expect(t).toEqual([
|
|
1473
1473
|
expect.objectContaining({
|
|
1474
1474
|
uri: seed.r['2'].ref.uriStr,
|
|
@@ -1498,9 +1498,9 @@ describe('appview thread views v2', () => {
|
|
|
1498
1498
|
},
|
|
1499
1499
|
},
|
|
1500
1500
|
)
|
|
1501
|
-
const { thread: t,
|
|
1501
|
+
const { thread: t, hasOtherReplies } = data
|
|
1502
1502
|
|
|
1503
|
-
expect(
|
|
1503
|
+
expect(hasOtherReplies).toBe(false)
|
|
1504
1504
|
expect(t).toEqual([
|
|
1505
1505
|
expect.objectContaining({
|
|
1506
1506
|
uri: seed.root.ref.uriStr,
|
|
@@ -1535,9 +1535,9 @@ describe('appview thread views v2', () => {
|
|
|
1535
1535
|
},
|
|
1536
1536
|
},
|
|
1537
1537
|
)
|
|
1538
|
-
const { thread: t,
|
|
1538
|
+
const { thread: t, hasOtherReplies } = data
|
|
1539
1539
|
|
|
1540
|
-
expect(
|
|
1540
|
+
expect(hasOtherReplies).toBe(false)
|
|
1541
1541
|
expect(t).toEqual([
|
|
1542
1542
|
expect.objectContaining({
|
|
1543
1543
|
uri: seed.root.ref.uriStr,
|
|
@@ -1565,9 +1565,9 @@ describe('appview thread views v2', () => {
|
|
|
1565
1565
|
},
|
|
1566
1566
|
},
|
|
1567
1567
|
)
|
|
1568
|
-
const { thread: t,
|
|
1568
|
+
const { thread: t, hasOtherReplies } = data
|
|
1569
1569
|
|
|
1570
|
-
expect(
|
|
1570
|
+
expect(hasOtherReplies).toBe(false)
|
|
1571
1571
|
expect(t).toEqual([
|
|
1572
1572
|
expect.objectContaining({
|
|
1573
1573
|
uri: seed.root.ref.uriStr,
|
|
@@ -1622,9 +1622,9 @@ describe('appview thread views v2', () => {
|
|
|
1622
1622
|
),
|
|
1623
1623
|
},
|
|
1624
1624
|
)
|
|
1625
|
-
const { thread: t,
|
|
1625
|
+
const { thread: t, hasOtherReplies } = data
|
|
1626
1626
|
|
|
1627
|
-
expect(
|
|
1627
|
+
expect(hasOtherReplies).toBe(true)
|
|
1628
1628
|
assertPosts(t)
|
|
1629
1629
|
expect(t).toEqual([
|
|
1630
1630
|
expect.objectContaining({
|
|
@@ -1644,13 +1644,13 @@ describe('appview thread views v2', () => {
|
|
|
1644
1644
|
})
|
|
1645
1645
|
|
|
1646
1646
|
it(`top-level muted replies are returned when fetching hidden, sorted by newest`, async () => {
|
|
1647
|
-
const { data } = await agent.app.bsky.unspecced.
|
|
1647
|
+
const { data } = await agent.app.bsky.unspecced.getPostThreadOtherV2(
|
|
1648
1648
|
{ anchor: seed.root.ref.uriStr },
|
|
1649
1649
|
{
|
|
1650
1650
|
headers: await network.serviceHeaders(
|
|
1651
1651
|
// Fetching as `op` mutes `opMuted`.
|
|
1652
1652
|
seed.users.op.did,
|
|
1653
|
-
ids.
|
|
1653
|
+
ids.AppBskyUnspeccedGetPostThreadOtherV2,
|
|
1654
1654
|
),
|
|
1655
1655
|
},
|
|
1656
1656
|
)
|
|
@@ -1681,9 +1681,9 @@ describe('appview thread views v2', () => {
|
|
|
1681
1681
|
),
|
|
1682
1682
|
},
|
|
1683
1683
|
)
|
|
1684
|
-
const { thread: t,
|
|
1684
|
+
const { thread: t, hasOtherReplies } = data
|
|
1685
1685
|
|
|
1686
|
-
expect(
|
|
1686
|
+
expect(hasOtherReplies).toBe(true)
|
|
1687
1687
|
assertPosts(t)
|
|
1688
1688
|
expect(t).toEqual([
|
|
1689
1689
|
expect.objectContaining({
|
|
@@ -1703,13 +1703,13 @@ describe('appview thread views v2', () => {
|
|
|
1703
1703
|
})
|
|
1704
1704
|
|
|
1705
1705
|
it(`fetches hidden replies includes own mutes, not OP mutes, sorted by newest`, async () => {
|
|
1706
|
-
const { data } = await agent.app.bsky.unspecced.
|
|
1706
|
+
const { data } = await agent.app.bsky.unspecced.getPostThreadOtherV2(
|
|
1707
1707
|
{ anchor: seed.root.ref.uriStr },
|
|
1708
1708
|
{
|
|
1709
1709
|
headers: await network.serviceHeaders(
|
|
1710
1710
|
// Fetching as `muter` mutes `muted`.
|
|
1711
1711
|
seed.users.muter.did,
|
|
1712
|
-
ids.
|
|
1712
|
+
ids.AppBskyUnspeccedGetPostThreadOtherV2,
|
|
1713
1713
|
),
|
|
1714
1714
|
},
|
|
1715
1715
|
)
|
|
@@ -1737,9 +1737,9 @@ describe('appview thread views v2', () => {
|
|
|
1737
1737
|
),
|
|
1738
1738
|
},
|
|
1739
1739
|
)
|
|
1740
|
-
const { thread: t,
|
|
1740
|
+
const { thread: t, hasOtherReplies } = data
|
|
1741
1741
|
|
|
1742
|
-
expect(
|
|
1742
|
+
expect(hasOtherReplies).toBe(false)
|
|
1743
1743
|
assertPosts(t)
|
|
1744
1744
|
// No muted posts by `opMuted`, gets the full thread.
|
|
1745
1745
|
expect(t.length).toBe(1 + Object.keys(seed.r).length) // root + replies
|
|
@@ -1765,9 +1765,9 @@ describe('appview thread views v2', () => {
|
|
|
1765
1765
|
),
|
|
1766
1766
|
},
|
|
1767
1767
|
)
|
|
1768
|
-
const { thread: t,
|
|
1768
|
+
const { thread: t, hasOtherReplies } = data
|
|
1769
1769
|
|
|
1770
|
-
expect(
|
|
1770
|
+
expect(hasOtherReplies).toBe(true)
|
|
1771
1771
|
assertPosts(t)
|
|
1772
1772
|
expect(t).toEqual([
|
|
1773
1773
|
expect.objectContaining({
|
|
@@ -1792,12 +1792,12 @@ describe('appview thread views v2', () => {
|
|
|
1792
1792
|
})
|
|
1793
1793
|
|
|
1794
1794
|
it(`top-level threadgated replies are returned to OP when fetching hidden, sorted by newest`, async () => {
|
|
1795
|
-
const { data } = await agent.app.bsky.unspecced.
|
|
1795
|
+
const { data } = await agent.app.bsky.unspecced.getPostThreadOtherV2(
|
|
1796
1796
|
{ anchor: seed.root.ref.uriStr },
|
|
1797
1797
|
{
|
|
1798
1798
|
headers: await network.serviceHeaders(
|
|
1799
1799
|
seed.users.op.did,
|
|
1800
|
-
ids.
|
|
1800
|
+
ids.AppBskyUnspeccedGetPostThreadOtherV2,
|
|
1801
1801
|
),
|
|
1802
1802
|
},
|
|
1803
1803
|
)
|
|
@@ -1832,9 +1832,9 @@ describe('appview thread views v2', () => {
|
|
|
1832
1832
|
),
|
|
1833
1833
|
},
|
|
1834
1834
|
)
|
|
1835
|
-
const { thread: t,
|
|
1835
|
+
const { thread: t, hasOtherReplies } = data
|
|
1836
1836
|
|
|
1837
|
-
expect(
|
|
1837
|
+
expect(hasOtherReplies).toBe(false)
|
|
1838
1838
|
assertPosts(t)
|
|
1839
1839
|
expect(t).toEqual([
|
|
1840
1840
|
expect.objectContaining({
|
|
@@ -1895,9 +1895,9 @@ describe('appview thread views v2', () => {
|
|
|
1895
1895
|
),
|
|
1896
1896
|
},
|
|
1897
1897
|
)
|
|
1898
|
-
const { thread: t,
|
|
1898
|
+
const { thread: t, hasOtherReplies } = data
|
|
1899
1899
|
|
|
1900
|
-
expect(
|
|
1900
|
+
expect(hasOtherReplies).toBe(true)
|
|
1901
1901
|
assertPosts(t)
|
|
1902
1902
|
expect(t).toEqual([
|
|
1903
1903
|
expect.objectContaining({
|
|
@@ -1928,13 +1928,13 @@ describe('appview thread views v2', () => {
|
|
|
1928
1928
|
})
|
|
1929
1929
|
|
|
1930
1930
|
it(`top-level threadgated replies are returned to other viewers when fetching hidden, sorted by newest`, async () => {
|
|
1931
|
-
const { data } = await agent.app.bsky.unspecced.
|
|
1931
|
+
const { data } = await agent.app.bsky.unspecced.getPostThreadOtherV2(
|
|
1932
1932
|
{ anchor: seed.root.ref.uriStr },
|
|
1933
1933
|
{
|
|
1934
1934
|
headers: await network.serviceHeaders(
|
|
1935
1935
|
// `viewer` also gets the replies as hidden.
|
|
1936
1936
|
seed.users.viewer.did,
|
|
1937
|
-
ids.
|
|
1937
|
+
ids.AppBskyUnspeccedGetPostThreadOtherV2,
|
|
1938
1938
|
),
|
|
1939
1939
|
},
|
|
1940
1940
|
)
|
|
@@ -1978,9 +1978,9 @@ describe('appview thread views v2', () => {
|
|
|
1978
1978
|
),
|
|
1979
1979
|
},
|
|
1980
1980
|
)
|
|
1981
|
-
const { thread: t,
|
|
1981
|
+
const { thread: t, hasOtherReplies } = data
|
|
1982
1982
|
|
|
1983
|
-
expect(
|
|
1983
|
+
expect(hasOtherReplies).toBe(true)
|
|
1984
1984
|
assertPosts(t)
|
|
1985
1985
|
expect(t).toEqual([
|
|
1986
1986
|
expect.objectContaining({ uri: seed.root.ref.uriStr }),
|
|
@@ -2002,7 +2002,7 @@ describe('appview thread views v2', () => {
|
|
|
2002
2002
|
})
|
|
2003
2003
|
|
|
2004
2004
|
it('finds the hidden by tag', async () => {
|
|
2005
|
-
const { data } = await agent.app.bsky.unspecced.
|
|
2005
|
+
const { data } = await agent.app.bsky.unspecced.getPostThreadOtherV2(
|
|
2006
2006
|
{
|
|
2007
2007
|
anchor: seed.root.ref.uriStr,
|
|
2008
2008
|
prioritizeFollowedUsers,
|
|
@@ -2010,7 +2010,7 @@ describe('appview thread views v2', () => {
|
|
|
2010
2010
|
{
|
|
2011
2011
|
headers: await network.serviceHeaders(
|
|
2012
2012
|
seed.users.viewer.did,
|
|
2013
|
-
ids.
|
|
2013
|
+
ids.AppBskyUnspeccedGetPostThreadOtherV2,
|
|
2014
2014
|
),
|
|
2015
2015
|
},
|
|
2016
2016
|
)
|
|
@@ -2041,9 +2041,9 @@ describe('appview thread views v2', () => {
|
|
|
2041
2041
|
),
|
|
2042
2042
|
},
|
|
2043
2043
|
)
|
|
2044
|
-
const { thread: t,
|
|
2044
|
+
const { thread: t, hasOtherReplies } = data
|
|
2045
2045
|
|
|
2046
|
-
expect(
|
|
2046
|
+
expect(hasOtherReplies).toBe(true)
|
|
2047
2047
|
assertPosts(t)
|
|
2048
2048
|
expect(t).toEqual([
|
|
2049
2049
|
expect.objectContaining({ uri: seed.root.ref.uriStr }),
|
|
@@ -2064,7 +2064,7 @@ describe('appview thread views v2', () => {
|
|
|
2064
2064
|
})
|
|
2065
2065
|
|
|
2066
2066
|
it('finds the hidden by tag', async () => {
|
|
2067
|
-
const { data } = await agent.app.bsky.unspecced.
|
|
2067
|
+
const { data } = await agent.app.bsky.unspecced.getPostThreadOtherV2(
|
|
2068
2068
|
{
|
|
2069
2069
|
anchor: seed.root.ref.uriStr,
|
|
2070
2070
|
prioritizeFollowedUsers,
|
|
@@ -2072,7 +2072,7 @@ describe('appview thread views v2', () => {
|
|
|
2072
2072
|
{
|
|
2073
2073
|
headers: await network.serviceHeaders(
|
|
2074
2074
|
seed.users.viewer.did,
|
|
2075
|
-
ids.
|
|
2075
|
+
ids.AppBskyUnspeccedGetPostThreadOtherV2,
|
|
2076
2076
|
),
|
|
2077
2077
|
},
|
|
2078
2078
|
)
|
|
@@ -2103,7 +2103,7 @@ function assertPosts(
|
|
|
2103
2103
|
|
|
2104
2104
|
function assertHiddenPosts(
|
|
2105
2105
|
t: OutputSchemaHiddenThread['thread'],
|
|
2106
|
-
): asserts t is
|
|
2106
|
+
): asserts t is ThreadOtherItemValuePost[] {
|
|
2107
2107
|
t.forEach((i) => {
|
|
2108
2108
|
assert(
|
|
2109
2109
|
AppBskyUnspeccedDefs.isThreadItemPost(i.value),
|