@atproto/bsky 0.0.150 → 0.0.152
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 +16 -0
- package/dist/api/app/bsky/unspecced/getPostThreadHiddenV2.d.ts +4 -0
- package/dist/api/app/bsky/unspecced/getPostThreadHiddenV2.d.ts.map +1 -0
- package/dist/api/app/bsky/unspecced/getPostThreadHiddenV2.js +76 -0
- package/dist/api/app/bsky/unspecced/getPostThreadHiddenV2.js.map +1 -0
- package/dist/api/app/bsky/unspecced/getPostThreadV2.d.ts +4 -0
- package/dist/api/app/bsky/unspecced/getPostThreadV2.d.ts.map +1 -0
- package/dist/api/app/bsky/unspecced/getPostThreadV2.js +86 -0
- package/dist/api/app/bsky/unspecced/getPostThreadV2.js.map +1 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +4 -0
- package/dist/api/index.js.map +1 -1
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +7 -0
- package/dist/config.js.map +1 -1
- package/dist/data-plane/server/db/migrations/20250526T023712742Z-like-repost-via.d.ts +4 -0
- package/dist/data-plane/server/db/migrations/20250526T023712742Z-like-repost-via.d.ts.map +1 -0
- package/dist/data-plane/server/db/migrations/20250526T023712742Z-like-repost-via.js +17 -0
- package/dist/data-plane/server/db/migrations/20250526T023712742Z-like-repost-via.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/like.d.ts +2 -0
- package/dist/data-plane/server/db/tables/like.d.ts.map +1 -1
- package/dist/data-plane/server/db/tables/repost.d.ts +2 -0
- package/dist/data-plane/server/db/tables/repost.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/like.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/like.js +32 -9
- package/dist/data-plane/server/indexing/plugins/like.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/repost.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/repost.js +32 -9
- package/dist/data-plane/server/indexing/plugins/repost.js.map +1 -1
- package/dist/hydration/feed.d.ts.map +1 -1
- package/dist/hydration/feed.js.map +1 -1
- package/dist/lexicon/index.d.ts +6 -2
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +12 -4
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +536 -88
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +279 -44
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/defs.d.ts +2 -0
- package/dist/lexicon/types/app/bsky/feed/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/like.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/feed/like.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/like.js.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/repost.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/feed/repost.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/repost.js.map +1 -1
- package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/notification/listNotifications.js.map +1 -1
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.d.ts +61 -0
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.js +25 -0
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.js.map +1 -0
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.d.ts +92 -0
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.js +52 -0
- package/dist/lexicon/types/app/bsky/unspecced/getPostThreadV2.js.map +1 -0
- package/dist/views/index.d.ts +36 -1
- package/dist/views/index.d.ts.map +1 -1
- package/dist/views/index.js +468 -2
- package/dist/views/index.js.map +1 -1
- package/dist/views/threads-v2.d.ts +62 -0
- package/dist/views/threads-v2.d.ts.map +1 -0
- package/dist/views/threads-v2.js +180 -0
- package/dist/views/threads-v2.js.map +1 -0
- package/package.json +4 -4
- package/src/api/app/bsky/unspecced/getPostThreadHiddenV2.ts +116 -0
- package/src/api/app/bsky/unspecced/getPostThreadV2.ts +130 -0
- package/src/api/index.ts +4 -0
- package/src/config.ts +9 -0
- package/src/data-plane/server/db/migrations/20250526T023712742Z-like-repost-via.ts +17 -0
- package/src/data-plane/server/db/migrations/index.ts +1 -0
- package/src/data-plane/server/db/tables/like.ts +2 -0
- package/src/data-plane/server/db/tables/repost.ts +2 -0
- package/src/data-plane/server/indexing/plugins/like.ts +39 -9
- package/src/data-plane/server/indexing/plugins/repost.ts +38 -9
- package/src/hydration/feed.ts +1 -0
- package/src/lexicon/index.ts +33 -9
- package/src/lexicon/lexicons.ts +298 -45
- package/src/lexicon/types/app/bsky/feed/defs.ts +2 -0
- package/src/lexicon/types/app/bsky/feed/like.ts +1 -0
- package/src/lexicon/types/app/bsky/feed/repost.ts +1 -0
- package/src/lexicon/types/app/bsky/notification/listNotifications.ts +3 -1
- package/src/lexicon/types/app/bsky/unspecced/getPostThreadHiddenV2.ts +93 -0
- package/src/lexicon/types/app/bsky/unspecced/getPostThreadV2.ts +160 -0
- package/src/views/index.ts +747 -2
- package/src/views/threads-v2.ts +351 -0
- package/tests/__snapshots__/feed-generation.test.ts.snap +2 -0
- package/tests/seed/thread-v2.ts +775 -0
- package/tests/seed/util.ts +52 -0
- package/tests/views/__snapshots__/author-feed.test.ts.snap +30 -24
- package/tests/views/__snapshots__/notifications.test.ts.snap +1164 -229
- package/tests/views/__snapshots__/thread-v2.test.ts.snap +1091 -0
- package/tests/views/__snapshots__/timeline.test.ts.snap +398 -376
- package/tests/views/notifications.test.ts +177 -0
- package/tests/views/thread-v2.test.ts +2009 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.tests.tsbuildinfo +1 -1
|
@@ -12,6 +12,8 @@ describe('notification views', () => {
|
|
|
12
12
|
|
|
13
13
|
// account dids, for convenience
|
|
14
14
|
let alice: string
|
|
15
|
+
let carol: string
|
|
16
|
+
let dan: string
|
|
15
17
|
|
|
16
18
|
beforeAll(async () => {
|
|
17
19
|
network = await TestNetwork.create({
|
|
@@ -27,6 +29,8 @@ describe('notification views', () => {
|
|
|
27
29
|
.execute()
|
|
28
30
|
await network.processAll()
|
|
29
31
|
alice = sc.dids.alice
|
|
32
|
+
carol = sc.dids.carol
|
|
33
|
+
dan = sc.dids.dan
|
|
30
34
|
})
|
|
31
35
|
|
|
32
36
|
afterAll(async () => {
|
|
@@ -156,6 +160,179 @@ describe('notification views', () => {
|
|
|
156
160
|
expect(forSnapshot(sort(notifsDan.data.notifications))).toMatchSnapshot()
|
|
157
161
|
})
|
|
158
162
|
|
|
163
|
+
it('generates notifications for likes', async () => {
|
|
164
|
+
const notifsAlice = await agent.app.bsky.notification.listNotifications(
|
|
165
|
+
{},
|
|
166
|
+
{
|
|
167
|
+
headers: await network.serviceHeaders(
|
|
168
|
+
alice,
|
|
169
|
+
ids.AppBskyNotificationListNotifications,
|
|
170
|
+
),
|
|
171
|
+
},
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
const na = sort(
|
|
175
|
+
notifsAlice.data.notifications.filter((n) => n.reason === 'like'),
|
|
176
|
+
)
|
|
177
|
+
expect(na).toHaveLength(5)
|
|
178
|
+
expect(forSnapshot(na)).toMatchSnapshot()
|
|
179
|
+
})
|
|
180
|
+
|
|
181
|
+
it('generates notifications for reposts', async () => {
|
|
182
|
+
const notifsAlice = await agent.app.bsky.notification.listNotifications(
|
|
183
|
+
{},
|
|
184
|
+
{
|
|
185
|
+
headers: await network.serviceHeaders(
|
|
186
|
+
alice,
|
|
187
|
+
ids.AppBskyNotificationListNotifications,
|
|
188
|
+
),
|
|
189
|
+
},
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
const na = sort(
|
|
193
|
+
notifsAlice.data.notifications.filter((n) => n.reason === 'repost'),
|
|
194
|
+
)
|
|
195
|
+
expect(na).toHaveLength(2)
|
|
196
|
+
expect(forSnapshot(na)).toMatchSnapshot()
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
it('generates notifications for likes via repost', async () => {
|
|
200
|
+
const op = dan
|
|
201
|
+
const reposter = carol
|
|
202
|
+
const liker = alice
|
|
203
|
+
await sc.like(liker, sc.posts[op][1].ref, {
|
|
204
|
+
via: sc.reposts[reposter][0].raw,
|
|
205
|
+
})
|
|
206
|
+
await network.processAll()
|
|
207
|
+
|
|
208
|
+
const notifsOp = await agent.app.bsky.notification.listNotifications(
|
|
209
|
+
{},
|
|
210
|
+
{
|
|
211
|
+
headers: await network.serviceHeaders(
|
|
212
|
+
op,
|
|
213
|
+
ids.AppBskyNotificationListNotifications,
|
|
214
|
+
),
|
|
215
|
+
},
|
|
216
|
+
)
|
|
217
|
+
|
|
218
|
+
const no = sort(
|
|
219
|
+
notifsOp.data.notifications.filter((n) => n.reason === 'like'),
|
|
220
|
+
)
|
|
221
|
+
// Like from `alice` in this test.
|
|
222
|
+
expect(no).toHaveLength(1)
|
|
223
|
+
expect(forSnapshot(no)).toMatchSnapshot()
|
|
224
|
+
|
|
225
|
+
const notifsReposter = await agent.app.bsky.notification.listNotifications(
|
|
226
|
+
{},
|
|
227
|
+
{
|
|
228
|
+
headers: await network.serviceHeaders(
|
|
229
|
+
reposter,
|
|
230
|
+
ids.AppBskyNotificationListNotifications,
|
|
231
|
+
),
|
|
232
|
+
},
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
const nr = sort(
|
|
236
|
+
notifsReposter.data.notifications.filter(
|
|
237
|
+
(n) => n.reason === 'like-via-repost',
|
|
238
|
+
),
|
|
239
|
+
)
|
|
240
|
+
// Like from `alice` in this test.
|
|
241
|
+
expect(nr).toHaveLength(1)
|
|
242
|
+
expect(forSnapshot(nr)).toMatchSnapshot()
|
|
243
|
+
})
|
|
244
|
+
|
|
245
|
+
it('does not generate self notifications for likes via own repost', async () => {
|
|
246
|
+
const op = dan
|
|
247
|
+
const reposter = carol
|
|
248
|
+
await sc.like(reposter, sc.posts[op][1].ref, {
|
|
249
|
+
via: sc.reposts[reposter][0].raw,
|
|
250
|
+
})
|
|
251
|
+
await network.processAll()
|
|
252
|
+
|
|
253
|
+
const notifsOp = await agent.app.bsky.notification.listNotifications(
|
|
254
|
+
{},
|
|
255
|
+
{
|
|
256
|
+
headers: await network.serviceHeaders(
|
|
257
|
+
op,
|
|
258
|
+
ids.AppBskyNotificationListNotifications,
|
|
259
|
+
),
|
|
260
|
+
},
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
const no = sort(
|
|
264
|
+
notifsOp.data.notifications.filter((n) => n.reason === 'like'),
|
|
265
|
+
)
|
|
266
|
+
// Like from `alice` in previous test + `carol` on this test.
|
|
267
|
+
expect(no).toHaveLength(2)
|
|
268
|
+
expect(forSnapshot(no)).toMatchSnapshot()
|
|
269
|
+
|
|
270
|
+
const notifsReposter = await agent.app.bsky.notification.listNotifications(
|
|
271
|
+
{},
|
|
272
|
+
{
|
|
273
|
+
headers: await network.serviceHeaders(
|
|
274
|
+
reposter,
|
|
275
|
+
ids.AppBskyNotificationListNotifications,
|
|
276
|
+
),
|
|
277
|
+
},
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
const nr = sort(
|
|
281
|
+
notifsReposter.data.notifications.filter(
|
|
282
|
+
(n) => n.reason === 'like-via-repost',
|
|
283
|
+
),
|
|
284
|
+
)
|
|
285
|
+
// Like from `alice` in previous test.
|
|
286
|
+
expect(nr).toHaveLength(1)
|
|
287
|
+
expect(forSnapshot(nr)).toMatchSnapshot()
|
|
288
|
+
})
|
|
289
|
+
|
|
290
|
+
it('generates notifications for reposts via repost', async () => {
|
|
291
|
+
const op = dan
|
|
292
|
+
const reposter = carol
|
|
293
|
+
const reReposter = alice
|
|
294
|
+
await sc.repost(reReposter, sc.posts[op][1].ref, {
|
|
295
|
+
via: sc.reposts[reposter][0].raw,
|
|
296
|
+
})
|
|
297
|
+
await network.processAll()
|
|
298
|
+
|
|
299
|
+
const notifsOp = await agent.app.bsky.notification.listNotifications(
|
|
300
|
+
{},
|
|
301
|
+
{
|
|
302
|
+
headers: await network.serviceHeaders(
|
|
303
|
+
op,
|
|
304
|
+
ids.AppBskyNotificationListNotifications,
|
|
305
|
+
),
|
|
306
|
+
},
|
|
307
|
+
)
|
|
308
|
+
|
|
309
|
+
const no = sort(
|
|
310
|
+
notifsOp.data.notifications.filter((n) => n.reason === 'repost'),
|
|
311
|
+
)
|
|
312
|
+
// Repost from `carol` in seeds + `alice` on this test.
|
|
313
|
+
expect(no).toHaveLength(2)
|
|
314
|
+
expect(forSnapshot(no)).toMatchSnapshot()
|
|
315
|
+
|
|
316
|
+
const notifsReposter = await agent.app.bsky.notification.listNotifications(
|
|
317
|
+
{},
|
|
318
|
+
{
|
|
319
|
+
headers: await network.serviceHeaders(
|
|
320
|
+
reposter,
|
|
321
|
+
ids.AppBskyNotificationListNotifications,
|
|
322
|
+
),
|
|
323
|
+
},
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
const nr = sort(
|
|
327
|
+
notifsReposter.data.notifications.filter(
|
|
328
|
+
(n) => n.reason === 'repost-via-repost',
|
|
329
|
+
),
|
|
330
|
+
)
|
|
331
|
+
// Repost from `alice` in this test.
|
|
332
|
+
expect(nr).toHaveLength(1)
|
|
333
|
+
expect(forSnapshot(nr)).toMatchSnapshot()
|
|
334
|
+
})
|
|
335
|
+
|
|
159
336
|
it('generates notifications for verification created and removed', async () => {
|
|
160
337
|
await sc.verify(
|
|
161
338
|
sc.dids.alice,
|