@atproto/pds 0.4.12 → 0.4.14
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +14 -0
- package/dist/actor-store/migrate.d.ts.map +1 -1
- package/dist/api/proxy.d.ts.map +1 -1
- package/dist/auth-verifier.d.ts.map +1 -1
- package/dist/db/pagination.d.ts +4 -4
- package/dist/db/pagination.d.ts.map +1 -1
- package/dist/db/util.d.ts.map +1 -1
- package/dist/handle/index.js +1 -1
- package/dist/handle/index.js.map +1 -1
- package/dist/lexicon/index.d.ts +16 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +19 -1
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +230 -0
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +243 -0
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/embed/record.d.ts +3 -0
- package/dist/lexicon/types/app/bsky/embed/record.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/embed/record.js.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/defs.d.ts +38 -0
- package/dist/lexicon/types/app/bsky/feed/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/defs.js +35 -1
- package/dist/lexicon/types/app/bsky/feed/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/generator.d.ts +2 -0
- package/dist/lexicon/types/app/bsky/feed/generator.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/generator.js.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/searchPosts.d.ts +18 -0
- package/dist/lexicon/types/app/bsky/feed/searchPosts.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/feed/sendInteractions.d.ts +40 -0
- package/dist/lexicon/types/app/bsky/feed/sendInteractions.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/feed/sendInteractions.js +3 -0
- package/dist/lexicon/types/app/bsky/feed/sendInteractions.js.map +1 -0
- package/dist/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.d.ts +2 -0
- package/dist/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.d.ts +20 -0
- package/dist/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.d.ts.map +1 -1
- package/dist/pipethrough.d.ts.map +1 -1
- package/dist/read-after-write/util.d.ts +2 -10
- package/dist/read-after-write/util.d.ts.map +1 -1
- package/dist/read-after-write/viewer.d.ts.map +1 -1
- package/dist/read-after-write/viewer.js +8 -11
- package/dist/read-after-write/viewer.js.map +1 -1
- package/dist/redis.d.ts.map +1 -1
- package/dist/util/debug.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/handle/index.ts +1 -1
- package/src/lexicon/index.ts +26 -0
- package/src/lexicon/lexicons.ts +269 -0
- package/src/lexicon/types/app/bsky/embed/record.ts +3 -0
- package/src/lexicon/types/app/bsky/feed/defs.ts +63 -0
- package/src/lexicon/types/app/bsky/feed/generator.ts +2 -0
- package/src/lexicon/types/app/bsky/feed/searchPosts.ts +18 -0
- package/src/lexicon/types/app/bsky/feed/sendInteractions.ts +49 -0
- package/src/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.ts +2 -0
- package/src/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.ts +20 -0
- package/src/read-after-write/viewer.ts +8 -11
- package/tests/handle-validation.test.ts +28 -0
- package/tests/proxied/__snapshots__/feedgen.test.ts.snap +3 -0
- package/tests/proxied/__snapshots__/views.test.ts.snap +30 -0
- package/tests/seeds/users-bulk.ts +5 -5
@@ -25,4 +25,32 @@ describe('handle validation', () => {
|
|
25
25
|
expect(isValidTld('atproto.onion')).toBe(false)
|
26
26
|
expect(isValidTld('atproto.internal')).toBe(false)
|
27
27
|
})
|
28
|
+
|
29
|
+
it('validates handle length', () => {
|
30
|
+
const domains = [
|
31
|
+
'.loooooooooooooooooong-pds-over18chars.mybsky.mydomain.com',
|
32
|
+
'.test',
|
33
|
+
]
|
34
|
+
const expectThrow = (handle: string, err: string) => {
|
35
|
+
expect(() => ensureHandleServiceConstraints(handle, domains)).toThrow(err)
|
36
|
+
}
|
37
|
+
const expectNotThrow = (handle: string, memo: string) => {
|
38
|
+
expect(() =>
|
39
|
+
ensureHandleServiceConstraints(handle, domains),
|
40
|
+
).not.toThrow()
|
41
|
+
}
|
42
|
+
expectThrow('usernamepartover18c.test', 'Handle too long')
|
43
|
+
expectNotThrow(
|
44
|
+
'u23456789012345678.test',
|
45
|
+
'safe up to 18 chars in first segment of the handle',
|
46
|
+
)
|
47
|
+
expectThrow(
|
48
|
+
'usernamepartover18c.loooooooooooooooooong-pds-over18chars.mybsky.mydomain.com',
|
49
|
+
'Handle too long',
|
50
|
+
)
|
51
|
+
expectNotThrow(
|
52
|
+
'u23456789012345678.loooooooooooooooooong-pds-over18chars.mybsky.mydomain.com',
|
53
|
+
'safe long domain in the handle',
|
54
|
+
)
|
55
|
+
})
|
28
56
|
})
|
@@ -1040,6 +1040,9 @@ Object {
|
|
1040
1040
|
"cid": "cids(8)",
|
1041
1041
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
1042
1042
|
"labels": Array [],
|
1043
|
+
"likeCount": 2,
|
1044
|
+
"replyCount": 0,
|
1045
|
+
"repostCount": 0,
|
1043
1046
|
"uri": "record(9)",
|
1044
1047
|
"value": Object {
|
1045
1048
|
"$type": "app.bsky.feed.post",
|
@@ -1087,6 +1090,9 @@ Object {
|
|
1087
1090
|
],
|
1088
1091
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
1089
1092
|
"labels": Array [],
|
1093
|
+
"likeCount": 0,
|
1094
|
+
"replyCount": 0,
|
1095
|
+
"repostCount": 1,
|
1090
1096
|
"uri": "record(7)",
|
1091
1097
|
"value": Object {
|
1092
1098
|
"$type": "app.bsky.feed.post",
|
@@ -1392,6 +1398,9 @@ Object {
|
|
1392
1398
|
"embeds": Array [],
|
1393
1399
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
1394
1400
|
"labels": Array [],
|
1401
|
+
"likeCount": 0,
|
1402
|
+
"replyCount": 0,
|
1403
|
+
"repostCount": 0,
|
1395
1404
|
"uri": "record(0)",
|
1396
1405
|
"value": Object {
|
1397
1406
|
"$type": "app.bsky.feed.post",
|
@@ -1804,6 +1813,9 @@ Object {
|
|
1804
1813
|
"cid": "cids(9)",
|
1805
1814
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
1806
1815
|
"labels": Array [],
|
1816
|
+
"likeCount": 0,
|
1817
|
+
"replyCount": 0,
|
1818
|
+
"repostCount": 0,
|
1807
1819
|
"uri": "record(11)",
|
1808
1820
|
"value": Object {
|
1809
1821
|
"$type": "app.bsky.feed.post",
|
@@ -1820,6 +1832,9 @@ Object {
|
|
1820
1832
|
],
|
1821
1833
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
1822
1834
|
"labels": Array [],
|
1835
|
+
"likeCount": 2,
|
1836
|
+
"replyCount": 0,
|
1837
|
+
"repostCount": 0,
|
1823
1838
|
"uri": "record(8)",
|
1824
1839
|
"value": Object {
|
1825
1840
|
"$type": "app.bsky.feed.post",
|
@@ -2422,6 +2437,9 @@ Object {
|
|
2422
2437
|
"cid": "cids(7)",
|
2423
2438
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
2424
2439
|
"labels": Array [],
|
2440
|
+
"likeCount": 2,
|
2441
|
+
"replyCount": 0,
|
2442
|
+
"repostCount": 0,
|
2425
2443
|
"uri": "record(8)",
|
2426
2444
|
"value": Object {
|
2427
2445
|
"$type": "app.bsky.feed.post",
|
@@ -2469,6 +2487,9 @@ Object {
|
|
2469
2487
|
],
|
2470
2488
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
2471
2489
|
"labels": Array [],
|
2490
|
+
"likeCount": 0,
|
2491
|
+
"replyCount": 0,
|
2492
|
+
"repostCount": 1,
|
2472
2493
|
"uri": "record(7)",
|
2473
2494
|
"value": Object {
|
2474
2495
|
"$type": "app.bsky.feed.post",
|
@@ -2665,6 +2686,9 @@ Object {
|
|
2665
2686
|
"cid": "cids(9)",
|
2666
2687
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
2667
2688
|
"labels": Array [],
|
2689
|
+
"likeCount": 0,
|
2690
|
+
"replyCount": 0,
|
2691
|
+
"repostCount": 0,
|
2668
2692
|
"uri": "record(11)",
|
2669
2693
|
"value": Object {
|
2670
2694
|
"$type": "app.bsky.feed.post",
|
@@ -2681,6 +2705,9 @@ Object {
|
|
2681
2705
|
],
|
2682
2706
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
2683
2707
|
"labels": Array [],
|
2708
|
+
"likeCount": 2,
|
2709
|
+
"replyCount": 0,
|
2710
|
+
"repostCount": 0,
|
2684
2711
|
"uri": "record(8)",
|
2685
2712
|
"value": Object {
|
2686
2713
|
"$type": "app.bsky.feed.post",
|
@@ -2845,6 +2872,9 @@ Object {
|
|
2845
2872
|
"embeds": Array [],
|
2846
2873
|
"indexedAt": "1970-01-01T00:00:00.000Z",
|
2847
2874
|
"labels": Array [],
|
2875
|
+
"likeCount": 0,
|
2876
|
+
"replyCount": 0,
|
2877
|
+
"repostCount": 0,
|
2848
2878
|
"uri": "record(11)",
|
2849
2879
|
"value": Object {
|
2850
2880
|
"$type": "app.bsky.feed.post",
|
@@ -115,14 +115,14 @@ const users = [
|
|
115
115
|
{ handle: 'kiana-schmitt39.test', displayName: null },
|
116
116
|
{ handle: 'rhianna-stamm29.test', displayName: null },
|
117
117
|
{ handle: 'tiara-mohr.test', displayName: null },
|
118
|
-
{ handle: 'eleazar-
|
118
|
+
{ handle: 'eleazar-balist70.test', displayName: 'Gordon Weissnat' },
|
119
119
|
{ handle: 'bettie-bogisich96.test', displayName: null },
|
120
120
|
{ handle: 'lura-jacobi55.test', displayName: null },
|
121
121
|
{ handle: 'santa-hermann78.test', displayName: 'Melissa Johnson' },
|
122
122
|
{ handle: 'dylan61.test', displayName: null },
|
123
123
|
{ handle: 'ryley-kerluke.test', displayName: 'Alexander Purdy' },
|
124
124
|
{ handle: 'moises-bins8.test', displayName: null },
|
125
|
-
{ handle: 'angelita-
|
125
|
+
{ handle: 'angelita-schaef27.test', displayName: null },
|
126
126
|
{ handle: 'natasha83.test', displayName: 'Dean Romaguera' },
|
127
127
|
{ handle: 'sydni48.test', displayName: null },
|
128
128
|
{ handle: 'darrion91.test', displayName: 'Jeanette Weimann' },
|
@@ -199,10 +199,10 @@ const users = [
|
|
199
199
|
{ handle: 'melyna-zboncak.test', displayName: null },
|
200
200
|
{ handle: 'rowan-parisian.test', displayName: 'Mr. Veronica Feeney' },
|
201
201
|
{ handle: 'lois-blanda20.test', displayName: 'Todd Rolfson' },
|
202
|
-
{ handle: 'turner-
|
202
|
+
{ handle: 'turner-bali76.test', displayName: null },
|
203
203
|
{ handle: 'dee-hoppe65.test', displayName: null },
|
204
204
|
{ handle: 'nikko-rosenbaum60.test', displayName: 'Joann Gutmann' },
|
205
|
-
{ handle: 'cornell-
|
205
|
+
{ handle: 'cornell-rom53.test', displayName: null },
|
206
206
|
{ handle: 'zack3.test', displayName: null },
|
207
207
|
{ handle: 'fredrick41.test', displayName: 'Julius Kreiger' },
|
208
208
|
{ handle: 'elwyn62.test', displayName: null },
|
@@ -240,6 +240,6 @@ const users = [
|
|
240
240
|
{ handle: 'nayeli-koss73.test', displayName: 'Johnny Lang' },
|
241
241
|
{ handle: 'cara-wiegand69.test', displayName: null },
|
242
242
|
{ handle: 'gideon-ohara51.test', displayName: null },
|
243
|
-
{ handle: 'carolina-
|
243
|
+
{ handle: 'carolina-mcderm77.test', displayName: 'Latoya Windler' },
|
244
244
|
{ handle: 'danyka90.test', displayName: 'Hope Kub' },
|
245
245
|
]
|