@atproto/bsky 0.0.9 → 0.0.10
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 +7 -0
- package/dist/db/index.js +55 -3
- package/dist/db/index.js.map +3 -3
- package/dist/index.js +561 -124
- package/dist/index.js.map +3 -3
- package/dist/lexicon/index.d.ts +6 -2
- package/dist/lexicon/lexicons.d.ts +203 -14
- package/dist/lexicon/types/app/bsky/actor/searchActors.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/actor/searchActorsTypeahead.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/{unspecced/applyLabels.d.ts → feed/searchPosts.d.ts} +17 -6
- package/dist/lexicon/types/app/bsky/unspecced/defs.d.ts +13 -0
- package/dist/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.d.ts +38 -0
- package/dist/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.d.ts +37 -0
- package/dist/lexicon/types/com/atproto/admin/searchRepos.d.ts +1 -0
- package/package.json +5 -6
- package/src/api/app/bsky/actor/searchActors.ts +7 -1
- package/src/api/app/bsky/actor/searchActorsTypeahead.ts +7 -1
- package/src/api/com/atproto/admin/searchRepos.ts +5 -0
- package/src/auto-moderator/index.ts +1 -17
- package/src/lexicon/index.ts +36 -12
- package/src/lexicon/lexicons.ts +229 -23
- package/src/lexicon/types/app/bsky/actor/searchActors.ts +3 -0
- package/src/lexicon/types/app/bsky/actor/searchActorsTypeahead.ts +3 -0
- package/src/lexicon/types/app/bsky/feed/searchPosts.ts +54 -0
- package/src/lexicon/types/app/bsky/unspecced/defs.ts +41 -0
- package/src/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.ts +56 -0
- package/src/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.ts +54 -0
- package/src/lexicon/types/com/atproto/admin/searchRepos.ts +2 -0
- package/src/services/indexing/plugins/block.ts +1 -1
- package/src/services/indexing/plugins/feed-generator.ts +1 -1
- package/src/services/indexing/plugins/follow.ts +1 -1
- package/src/services/indexing/plugins/like.ts +1 -1
- package/src/services/indexing/plugins/list-block.ts +1 -1
- package/src/services/indexing/plugins/list-item.ts +1 -1
- package/src/services/indexing/plugins/list.ts +1 -1
- package/src/services/indexing/plugins/post.ts +1 -1
- package/src/services/indexing/plugins/repost.ts +1 -1
- package/src/services/indexing/plugins/thread-gate.ts +1 -1
- package/src/services/label/index.ts +1 -1
- package/dist/services/indexing/util.d.ts +0 -1
- package/src/lexicon/types/app/bsky/unspecced/applyLabels.ts +0 -39
- package/src/services/indexing/util.ts +0 -16
package/dist/lexicon/index.d.ts
CHANGED
|
@@ -79,6 +79,7 @@ import * as AppBskyFeedGetPosts from './types/app/bsky/feed/getPosts';
|
|
|
79
79
|
import * as AppBskyFeedGetRepostedBy from './types/app/bsky/feed/getRepostedBy';
|
|
80
80
|
import * as AppBskyFeedGetSuggestedFeeds from './types/app/bsky/feed/getSuggestedFeeds';
|
|
81
81
|
import * as AppBskyFeedGetTimeline from './types/app/bsky/feed/getTimeline';
|
|
82
|
+
import * as AppBskyFeedSearchPosts from './types/app/bsky/feed/searchPosts';
|
|
82
83
|
import * as AppBskyGraphGetBlocks from './types/app/bsky/graph/getBlocks';
|
|
83
84
|
import * as AppBskyGraphGetFollowers from './types/app/bsky/graph/getFollowers';
|
|
84
85
|
import * as AppBskyGraphGetFollows from './types/app/bsky/graph/getFollows';
|
|
@@ -96,10 +97,11 @@ import * as AppBskyNotificationGetUnreadCount from './types/app/bsky/notificatio
|
|
|
96
97
|
import * as AppBskyNotificationListNotifications from './types/app/bsky/notification/listNotifications';
|
|
97
98
|
import * as AppBskyNotificationRegisterPush from './types/app/bsky/notification/registerPush';
|
|
98
99
|
import * as AppBskyNotificationUpdateSeen from './types/app/bsky/notification/updateSeen';
|
|
99
|
-
import * as AppBskyUnspeccedApplyLabels from './types/app/bsky/unspecced/applyLabels';
|
|
100
100
|
import * as AppBskyUnspeccedGetPopular from './types/app/bsky/unspecced/getPopular';
|
|
101
101
|
import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators';
|
|
102
102
|
import * as AppBskyUnspeccedGetTimelineSkeleton from './types/app/bsky/unspecced/getTimelineSkeleton';
|
|
103
|
+
import * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton';
|
|
104
|
+
import * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton';
|
|
103
105
|
export declare const COM_ATPROTO_ADMIN: {
|
|
104
106
|
DefsTakedown: string;
|
|
105
107
|
DefsFlag: string;
|
|
@@ -276,6 +278,7 @@ export declare class FeedNS {
|
|
|
276
278
|
getRepostedBy<AV extends AuthVerifier>(cfg: ConfigOf<AV, AppBskyFeedGetRepostedBy.Handler<ExtractAuth<AV>>, AppBskyFeedGetRepostedBy.HandlerReqCtx<ExtractAuth<AV>>>): void;
|
|
277
279
|
getSuggestedFeeds<AV extends AuthVerifier>(cfg: ConfigOf<AV, AppBskyFeedGetSuggestedFeeds.Handler<ExtractAuth<AV>>, AppBskyFeedGetSuggestedFeeds.HandlerReqCtx<ExtractAuth<AV>>>): void;
|
|
278
280
|
getTimeline<AV extends AuthVerifier>(cfg: ConfigOf<AV, AppBskyFeedGetTimeline.Handler<ExtractAuth<AV>>, AppBskyFeedGetTimeline.HandlerReqCtx<ExtractAuth<AV>>>): void;
|
|
281
|
+
searchPosts<AV extends AuthVerifier>(cfg: ConfigOf<AV, AppBskyFeedSearchPosts.Handler<ExtractAuth<AV>>, AppBskyFeedSearchPosts.HandlerReqCtx<ExtractAuth<AV>>>): void;
|
|
279
282
|
}
|
|
280
283
|
export declare class GraphNS {
|
|
281
284
|
_server: Server;
|
|
@@ -309,10 +312,11 @@ export declare class RichtextNS {
|
|
|
309
312
|
export declare class UnspeccedNS {
|
|
310
313
|
_server: Server;
|
|
311
314
|
constructor(server: Server);
|
|
312
|
-
applyLabels<AV extends AuthVerifier>(cfg: ConfigOf<AV, AppBskyUnspeccedApplyLabels.Handler<ExtractAuth<AV>>, AppBskyUnspeccedApplyLabels.HandlerReqCtx<ExtractAuth<AV>>>): void;
|
|
313
315
|
getPopular<AV extends AuthVerifier>(cfg: ConfigOf<AV, AppBskyUnspeccedGetPopular.Handler<ExtractAuth<AV>>, AppBskyUnspeccedGetPopular.HandlerReqCtx<ExtractAuth<AV>>>): void;
|
|
314
316
|
getPopularFeedGenerators<AV extends AuthVerifier>(cfg: ConfigOf<AV, AppBskyUnspeccedGetPopularFeedGenerators.Handler<ExtractAuth<AV>>, AppBskyUnspeccedGetPopularFeedGenerators.HandlerReqCtx<ExtractAuth<AV>>>): void;
|
|
315
317
|
getTimelineSkeleton<AV extends AuthVerifier>(cfg: ConfigOf<AV, AppBskyUnspeccedGetTimelineSkeleton.Handler<ExtractAuth<AV>>, AppBskyUnspeccedGetTimelineSkeleton.HandlerReqCtx<ExtractAuth<AV>>>): void;
|
|
318
|
+
searchActorsSkeleton<AV extends AuthVerifier>(cfg: ConfigOf<AV, AppBskyUnspeccedSearchActorsSkeleton.Handler<ExtractAuth<AV>>, AppBskyUnspeccedSearchActorsSkeleton.HandlerReqCtx<ExtractAuth<AV>>>): void;
|
|
319
|
+
searchPostsSkeleton<AV extends AuthVerifier>(cfg: ConfigOf<AV, AppBskyUnspeccedSearchPostsSkeleton.Handler<ExtractAuth<AV>>, AppBskyUnspeccedSearchPostsSkeleton.HandlerReqCtx<ExtractAuth<AV>>>): void;
|
|
316
320
|
}
|
|
317
321
|
declare type SharedRateLimitOpts<T> = {
|
|
318
322
|
name: string;
|
|
@@ -1003,6 +1003,10 @@ export declare const schemaDict: {
|
|
|
1003
1003
|
properties: {
|
|
1004
1004
|
term: {
|
|
1005
1005
|
type: string;
|
|
1006
|
+
description: string;
|
|
1007
|
+
};
|
|
1008
|
+
q: {
|
|
1009
|
+
type: string;
|
|
1006
1010
|
};
|
|
1007
1011
|
invitedBy: {
|
|
1008
1012
|
type: string;
|
|
@@ -3727,6 +3731,11 @@ export declare const schemaDict: {
|
|
|
3727
3731
|
properties: {
|
|
3728
3732
|
term: {
|
|
3729
3733
|
type: string;
|
|
3734
|
+
description: string;
|
|
3735
|
+
};
|
|
3736
|
+
q: {
|
|
3737
|
+
type: string;
|
|
3738
|
+
description: string;
|
|
3730
3739
|
};
|
|
3731
3740
|
limit: {
|
|
3732
3741
|
type: string;
|
|
@@ -3773,6 +3782,11 @@ export declare const schemaDict: {
|
|
|
3773
3782
|
properties: {
|
|
3774
3783
|
term: {
|
|
3775
3784
|
type: string;
|
|
3785
|
+
description: string;
|
|
3786
|
+
};
|
|
3787
|
+
q: {
|
|
3788
|
+
type: string;
|
|
3789
|
+
description: string;
|
|
3776
3790
|
};
|
|
3777
3791
|
limit: {
|
|
3778
3792
|
type: string;
|
|
@@ -5362,6 +5376,62 @@ export declare const schemaDict: {
|
|
|
5362
5376
|
};
|
|
5363
5377
|
};
|
|
5364
5378
|
};
|
|
5379
|
+
AppBskyFeedSearchPosts: {
|
|
5380
|
+
lexicon: number;
|
|
5381
|
+
id: string;
|
|
5382
|
+
defs: {
|
|
5383
|
+
main: {
|
|
5384
|
+
type: string;
|
|
5385
|
+
description: string;
|
|
5386
|
+
parameters: {
|
|
5387
|
+
type: string;
|
|
5388
|
+
required: string[];
|
|
5389
|
+
properties: {
|
|
5390
|
+
q: {
|
|
5391
|
+
type: string;
|
|
5392
|
+
description: string;
|
|
5393
|
+
};
|
|
5394
|
+
limit: {
|
|
5395
|
+
type: string;
|
|
5396
|
+
minimum: number;
|
|
5397
|
+
maximum: number;
|
|
5398
|
+
default: number;
|
|
5399
|
+
};
|
|
5400
|
+
cursor: {
|
|
5401
|
+
type: string;
|
|
5402
|
+
description: string;
|
|
5403
|
+
};
|
|
5404
|
+
};
|
|
5405
|
+
};
|
|
5406
|
+
output: {
|
|
5407
|
+
encoding: string;
|
|
5408
|
+
schema: {
|
|
5409
|
+
type: string;
|
|
5410
|
+
required: string[];
|
|
5411
|
+
properties: {
|
|
5412
|
+
cursor: {
|
|
5413
|
+
type: string;
|
|
5414
|
+
};
|
|
5415
|
+
hitsTotal: {
|
|
5416
|
+
type: string;
|
|
5417
|
+
description: string;
|
|
5418
|
+
};
|
|
5419
|
+
posts: {
|
|
5420
|
+
type: string;
|
|
5421
|
+
items: {
|
|
5422
|
+
type: string;
|
|
5423
|
+
ref: string;
|
|
5424
|
+
};
|
|
5425
|
+
};
|
|
5426
|
+
};
|
|
5427
|
+
};
|
|
5428
|
+
};
|
|
5429
|
+
errors: {
|
|
5430
|
+
name: string;
|
|
5431
|
+
}[];
|
|
5432
|
+
};
|
|
5433
|
+
};
|
|
5434
|
+
};
|
|
5365
5435
|
AppBskyFeedThreadgate: {
|
|
5366
5436
|
lexicon: number;
|
|
5367
5437
|
id: string;
|
|
@@ -6447,20 +6517,67 @@ export declare const schemaDict: {
|
|
|
6447
6517
|
};
|
|
6448
6518
|
};
|
|
6449
6519
|
};
|
|
6450
|
-
|
|
6520
|
+
AppBskyUnspeccedDefs: {
|
|
6521
|
+
lexicon: number;
|
|
6522
|
+
id: string;
|
|
6523
|
+
defs: {
|
|
6524
|
+
skeletonSearchPost: {
|
|
6525
|
+
type: string;
|
|
6526
|
+
required: string[];
|
|
6527
|
+
properties: {
|
|
6528
|
+
uri: {
|
|
6529
|
+
type: string;
|
|
6530
|
+
format: string;
|
|
6531
|
+
};
|
|
6532
|
+
};
|
|
6533
|
+
};
|
|
6534
|
+
skeletonSearchActor: {
|
|
6535
|
+
type: string;
|
|
6536
|
+
required: string[];
|
|
6537
|
+
properties: {
|
|
6538
|
+
did: {
|
|
6539
|
+
type: string;
|
|
6540
|
+
format: string;
|
|
6541
|
+
};
|
|
6542
|
+
};
|
|
6543
|
+
};
|
|
6544
|
+
};
|
|
6545
|
+
};
|
|
6546
|
+
AppBskyUnspeccedGetPopular: {
|
|
6451
6547
|
lexicon: number;
|
|
6452
6548
|
id: string;
|
|
6453
6549
|
defs: {
|
|
6454
6550
|
main: {
|
|
6455
6551
|
type: string;
|
|
6456
6552
|
description: string;
|
|
6457
|
-
|
|
6553
|
+
parameters: {
|
|
6554
|
+
type: string;
|
|
6555
|
+
properties: {
|
|
6556
|
+
includeNsfw: {
|
|
6557
|
+
type: string;
|
|
6558
|
+
default: boolean;
|
|
6559
|
+
};
|
|
6560
|
+
limit: {
|
|
6561
|
+
type: string;
|
|
6562
|
+
minimum: number;
|
|
6563
|
+
maximum: number;
|
|
6564
|
+
default: number;
|
|
6565
|
+
};
|
|
6566
|
+
cursor: {
|
|
6567
|
+
type: string;
|
|
6568
|
+
};
|
|
6569
|
+
};
|
|
6570
|
+
};
|
|
6571
|
+
output: {
|
|
6458
6572
|
encoding: string;
|
|
6459
6573
|
schema: {
|
|
6460
6574
|
type: string;
|
|
6461
6575
|
required: string[];
|
|
6462
6576
|
properties: {
|
|
6463
|
-
|
|
6577
|
+
cursor: {
|
|
6578
|
+
type: string;
|
|
6579
|
+
};
|
|
6580
|
+
feed: {
|
|
6464
6581
|
type: string;
|
|
6465
6582
|
items: {
|
|
6466
6583
|
type: string;
|
|
@@ -6473,7 +6590,7 @@ export declare const schemaDict: {
|
|
|
6473
6590
|
};
|
|
6474
6591
|
};
|
|
6475
6592
|
};
|
|
6476
|
-
|
|
6593
|
+
AppBskyUnspeccedGetPopularFeedGenerators: {
|
|
6477
6594
|
lexicon: number;
|
|
6478
6595
|
id: string;
|
|
6479
6596
|
defs: {
|
|
@@ -6483,10 +6600,52 @@ export declare const schemaDict: {
|
|
|
6483
6600
|
parameters: {
|
|
6484
6601
|
type: string;
|
|
6485
6602
|
properties: {
|
|
6486
|
-
|
|
6603
|
+
limit: {
|
|
6487
6604
|
type: string;
|
|
6488
|
-
|
|
6605
|
+
minimum: number;
|
|
6606
|
+
maximum: number;
|
|
6607
|
+
default: number;
|
|
6489
6608
|
};
|
|
6609
|
+
cursor: {
|
|
6610
|
+
type: string;
|
|
6611
|
+
};
|
|
6612
|
+
query: {
|
|
6613
|
+
type: string;
|
|
6614
|
+
};
|
|
6615
|
+
};
|
|
6616
|
+
};
|
|
6617
|
+
output: {
|
|
6618
|
+
encoding: string;
|
|
6619
|
+
schema: {
|
|
6620
|
+
type: string;
|
|
6621
|
+
required: string[];
|
|
6622
|
+
properties: {
|
|
6623
|
+
cursor: {
|
|
6624
|
+
type: string;
|
|
6625
|
+
};
|
|
6626
|
+
feeds: {
|
|
6627
|
+
type: string;
|
|
6628
|
+
items: {
|
|
6629
|
+
type: string;
|
|
6630
|
+
ref: string;
|
|
6631
|
+
};
|
|
6632
|
+
};
|
|
6633
|
+
};
|
|
6634
|
+
};
|
|
6635
|
+
};
|
|
6636
|
+
};
|
|
6637
|
+
};
|
|
6638
|
+
};
|
|
6639
|
+
AppBskyUnspeccedGetTimelineSkeleton: {
|
|
6640
|
+
lexicon: number;
|
|
6641
|
+
id: string;
|
|
6642
|
+
defs: {
|
|
6643
|
+
main: {
|
|
6644
|
+
type: string;
|
|
6645
|
+
description: string;
|
|
6646
|
+
parameters: {
|
|
6647
|
+
type: string;
|
|
6648
|
+
properties: {
|
|
6490
6649
|
limit: {
|
|
6491
6650
|
type: string;
|
|
6492
6651
|
minimum: number;
|
|
@@ -6517,10 +6676,13 @@ export declare const schemaDict: {
|
|
|
6517
6676
|
};
|
|
6518
6677
|
};
|
|
6519
6678
|
};
|
|
6679
|
+
errors: {
|
|
6680
|
+
name: string;
|
|
6681
|
+
}[];
|
|
6520
6682
|
};
|
|
6521
6683
|
};
|
|
6522
6684
|
};
|
|
6523
|
-
|
|
6685
|
+
AppBskyUnspeccedSearchActorsSkeleton: {
|
|
6524
6686
|
lexicon: number;
|
|
6525
6687
|
id: string;
|
|
6526
6688
|
defs: {
|
|
@@ -6529,7 +6691,16 @@ export declare const schemaDict: {
|
|
|
6529
6691
|
description: string;
|
|
6530
6692
|
parameters: {
|
|
6531
6693
|
type: string;
|
|
6694
|
+
required: string[];
|
|
6532
6695
|
properties: {
|
|
6696
|
+
q: {
|
|
6697
|
+
type: string;
|
|
6698
|
+
description: string;
|
|
6699
|
+
};
|
|
6700
|
+
typeahead: {
|
|
6701
|
+
type: string;
|
|
6702
|
+
description: string;
|
|
6703
|
+
};
|
|
6533
6704
|
limit: {
|
|
6534
6705
|
type: string;
|
|
6535
6706
|
minimum: number;
|
|
@@ -6538,9 +6709,7 @@ export declare const schemaDict: {
|
|
|
6538
6709
|
};
|
|
6539
6710
|
cursor: {
|
|
6540
6711
|
type: string;
|
|
6541
|
-
|
|
6542
|
-
query: {
|
|
6543
|
-
type: string;
|
|
6712
|
+
description: string;
|
|
6544
6713
|
};
|
|
6545
6714
|
};
|
|
6546
6715
|
};
|
|
@@ -6553,7 +6722,11 @@ export declare const schemaDict: {
|
|
|
6553
6722
|
cursor: {
|
|
6554
6723
|
type: string;
|
|
6555
6724
|
};
|
|
6556
|
-
|
|
6725
|
+
hitsTotal: {
|
|
6726
|
+
type: string;
|
|
6727
|
+
description: string;
|
|
6728
|
+
};
|
|
6729
|
+
actors: {
|
|
6557
6730
|
type: string;
|
|
6558
6731
|
items: {
|
|
6559
6732
|
type: string;
|
|
@@ -6563,10 +6736,13 @@ export declare const schemaDict: {
|
|
|
6563
6736
|
};
|
|
6564
6737
|
};
|
|
6565
6738
|
};
|
|
6739
|
+
errors: {
|
|
6740
|
+
name: string;
|
|
6741
|
+
}[];
|
|
6566
6742
|
};
|
|
6567
6743
|
};
|
|
6568
6744
|
};
|
|
6569
|
-
|
|
6745
|
+
AppBskyUnspeccedSearchPostsSkeleton: {
|
|
6570
6746
|
lexicon: number;
|
|
6571
6747
|
id: string;
|
|
6572
6748
|
defs: {
|
|
@@ -6575,7 +6751,12 @@ export declare const schemaDict: {
|
|
|
6575
6751
|
description: string;
|
|
6576
6752
|
parameters: {
|
|
6577
6753
|
type: string;
|
|
6754
|
+
required: string[];
|
|
6578
6755
|
properties: {
|
|
6756
|
+
q: {
|
|
6757
|
+
type: string;
|
|
6758
|
+
description: string;
|
|
6759
|
+
};
|
|
6579
6760
|
limit: {
|
|
6580
6761
|
type: string;
|
|
6581
6762
|
minimum: number;
|
|
@@ -6584,6 +6765,7 @@ export declare const schemaDict: {
|
|
|
6584
6765
|
};
|
|
6585
6766
|
cursor: {
|
|
6586
6767
|
type: string;
|
|
6768
|
+
description: string;
|
|
6587
6769
|
};
|
|
6588
6770
|
};
|
|
6589
6771
|
};
|
|
@@ -6596,7 +6778,11 @@ export declare const schemaDict: {
|
|
|
6596
6778
|
cursor: {
|
|
6597
6779
|
type: string;
|
|
6598
6780
|
};
|
|
6599
|
-
|
|
6781
|
+
hitsTotal: {
|
|
6782
|
+
type: string;
|
|
6783
|
+
description: string;
|
|
6784
|
+
};
|
|
6785
|
+
posts: {
|
|
6600
6786
|
type: string;
|
|
6601
6787
|
items: {
|
|
6602
6788
|
type: string;
|
|
@@ -6712,6 +6898,7 @@ export declare const ids: {
|
|
|
6712
6898
|
AppBskyFeedLike: string;
|
|
6713
6899
|
AppBskyFeedPost: string;
|
|
6714
6900
|
AppBskyFeedRepost: string;
|
|
6901
|
+
AppBskyFeedSearchPosts: string;
|
|
6715
6902
|
AppBskyFeedThreadgate: string;
|
|
6716
6903
|
AppBskyGraphBlock: string;
|
|
6717
6904
|
AppBskyGraphDefs: string;
|
|
@@ -6737,8 +6924,10 @@ export declare const ids: {
|
|
|
6737
6924
|
AppBskyNotificationRegisterPush: string;
|
|
6738
6925
|
AppBskyNotificationUpdateSeen: string;
|
|
6739
6926
|
AppBskyRichtextFacet: string;
|
|
6740
|
-
|
|
6927
|
+
AppBskyUnspeccedDefs: string;
|
|
6741
6928
|
AppBskyUnspeccedGetPopular: string;
|
|
6742
6929
|
AppBskyUnspeccedGetPopularFeedGenerators: string;
|
|
6743
6930
|
AppBskyUnspeccedGetTimelineSkeleton: string;
|
|
6931
|
+
AppBskyUnspeccedSearchActorsSkeleton: string;
|
|
6932
|
+
AppBskyUnspeccedSearchPostsSkeleton: string;
|
|
6744
6933
|
};
|
|
@@ -1,21 +1,32 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
3
|
-
import * as
|
|
3
|
+
import * as AppBskyFeedDefs from './defs';
|
|
4
4
|
export interface QueryParams {
|
|
5
|
+
q: string;
|
|
6
|
+
limit: number;
|
|
7
|
+
cursor?: string;
|
|
5
8
|
}
|
|
6
|
-
export
|
|
7
|
-
|
|
9
|
+
export declare type InputSchema = undefined;
|
|
10
|
+
export interface OutputSchema {
|
|
11
|
+
cursor?: string;
|
|
12
|
+
hitsTotal?: number;
|
|
13
|
+
posts: AppBskyFeedDefs.PostView[];
|
|
8
14
|
[k: string]: unknown;
|
|
9
15
|
}
|
|
10
|
-
export
|
|
16
|
+
export declare type HandlerInput = undefined;
|
|
17
|
+
export interface HandlerSuccess {
|
|
11
18
|
encoding: 'application/json';
|
|
12
|
-
body:
|
|
19
|
+
body: OutputSchema;
|
|
20
|
+
headers?: {
|
|
21
|
+
[key: string]: string;
|
|
22
|
+
};
|
|
13
23
|
}
|
|
14
24
|
export interface HandlerError {
|
|
15
25
|
status: number;
|
|
16
26
|
message?: string;
|
|
27
|
+
error?: 'BadQueryString';
|
|
17
28
|
}
|
|
18
|
-
export declare type HandlerOutput = HandlerError |
|
|
29
|
+
export declare type HandlerOutput = HandlerError | HandlerSuccess;
|
|
19
30
|
export declare type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
20
31
|
auth: HA;
|
|
21
32
|
params: QueryParams;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ValidationResult } from '@atproto/lexicon';
|
|
2
|
+
export interface SkeletonSearchPost {
|
|
3
|
+
uri: string;
|
|
4
|
+
[k: string]: unknown;
|
|
5
|
+
}
|
|
6
|
+
export declare function isSkeletonSearchPost(v: unknown): v is SkeletonSearchPost;
|
|
7
|
+
export declare function validateSkeletonSearchPost(v: unknown): ValidationResult;
|
|
8
|
+
export interface SkeletonSearchActor {
|
|
9
|
+
did: string;
|
|
10
|
+
[k: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
export declare function isSkeletonSearchActor(v: unknown): v is SkeletonSearchActor;
|
|
13
|
+
export declare function validateSkeletonSearchActor(v: unknown): ValidationResult;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import express from 'express';
|
|
2
|
+
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
3
|
+
import * as AppBskyUnspeccedDefs from './defs';
|
|
4
|
+
export interface QueryParams {
|
|
5
|
+
q: string;
|
|
6
|
+
typeahead?: boolean;
|
|
7
|
+
limit: number;
|
|
8
|
+
cursor?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare type InputSchema = undefined;
|
|
11
|
+
export interface OutputSchema {
|
|
12
|
+
cursor?: string;
|
|
13
|
+
hitsTotal?: number;
|
|
14
|
+
actors: AppBskyUnspeccedDefs.SkeletonSearchActor[];
|
|
15
|
+
[k: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
export declare type HandlerInput = undefined;
|
|
18
|
+
export interface HandlerSuccess {
|
|
19
|
+
encoding: 'application/json';
|
|
20
|
+
body: OutputSchema;
|
|
21
|
+
headers?: {
|
|
22
|
+
[key: string]: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export interface HandlerError {
|
|
26
|
+
status: number;
|
|
27
|
+
message?: string;
|
|
28
|
+
error?: 'BadQueryString';
|
|
29
|
+
}
|
|
30
|
+
export declare type HandlerOutput = HandlerError | HandlerSuccess;
|
|
31
|
+
export declare type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
32
|
+
auth: HA;
|
|
33
|
+
params: QueryParams;
|
|
34
|
+
input: HandlerInput;
|
|
35
|
+
req: express.Request;
|
|
36
|
+
res: express.Response;
|
|
37
|
+
};
|
|
38
|
+
export declare type Handler<HA extends HandlerAuth = never> = (ctx: HandlerReqCtx<HA>) => Promise<HandlerOutput> | HandlerOutput;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import express from 'express';
|
|
2
|
+
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
3
|
+
import * as AppBskyUnspeccedDefs from './defs';
|
|
4
|
+
export interface QueryParams {
|
|
5
|
+
q: string;
|
|
6
|
+
limit: number;
|
|
7
|
+
cursor?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare type InputSchema = undefined;
|
|
10
|
+
export interface OutputSchema {
|
|
11
|
+
cursor?: string;
|
|
12
|
+
hitsTotal?: number;
|
|
13
|
+
posts: AppBskyUnspeccedDefs.SkeletonSearchPost[];
|
|
14
|
+
[k: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
export declare type HandlerInput = undefined;
|
|
17
|
+
export interface HandlerSuccess {
|
|
18
|
+
encoding: 'application/json';
|
|
19
|
+
body: OutputSchema;
|
|
20
|
+
headers?: {
|
|
21
|
+
[key: string]: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface HandlerError {
|
|
25
|
+
status: number;
|
|
26
|
+
message?: string;
|
|
27
|
+
error?: 'BadQueryString';
|
|
28
|
+
}
|
|
29
|
+
export declare type HandlerOutput = HandlerError | HandlerSuccess;
|
|
30
|
+
export declare type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
31
|
+
auth: HA;
|
|
32
|
+
params: QueryParams;
|
|
33
|
+
input: HandlerInput;
|
|
34
|
+
req: express.Request;
|
|
35
|
+
res: express.Response;
|
|
36
|
+
};
|
|
37
|
+
export declare type Handler<HA extends HandlerAuth = never> = (ctx: HandlerReqCtx<HA>) => Promise<HandlerOutput> | HandlerOutput;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/bsky",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Reference implementation of app.bsky App View (Bluesky API)",
|
|
6
6
|
"keywords": [
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"http-errors": "^2.0.0",
|
|
28
28
|
"http-terminator": "^3.2.0",
|
|
29
29
|
"ioredis": "^5.3.2",
|
|
30
|
-
"iso-datestring-validator": "^2.2.2",
|
|
31
30
|
"kysely": "^0.22.0",
|
|
32
31
|
"multiformats": "^9.9.0",
|
|
33
32
|
"p-queue": "^6.6.2",
|
|
@@ -37,7 +36,7 @@
|
|
|
37
36
|
"sharp": "^0.31.2",
|
|
38
37
|
"typed-emitter": "^2.1.0",
|
|
39
38
|
"uint8arrays": "3.0.0",
|
|
40
|
-
"@atproto/api": "^0.6.
|
|
39
|
+
"@atproto/api": "^0.6.19",
|
|
41
40
|
"@atproto/common": "^0.3.0",
|
|
42
41
|
"@atproto/crypto": "^0.2.2",
|
|
43
42
|
"@atproto/syntax": "^0.1.1",
|
|
@@ -55,10 +54,10 @@
|
|
|
55
54
|
"@types/qs": "^6.9.7",
|
|
56
55
|
"@types/sharp": "^0.31.0",
|
|
57
56
|
"axios": "^0.27.2",
|
|
58
|
-
"@atproto/api": "^0.6.
|
|
59
|
-
"@atproto/dev-env": "^0.2.
|
|
57
|
+
"@atproto/api": "^0.6.19",
|
|
58
|
+
"@atproto/dev-env": "^0.2.10",
|
|
60
59
|
"@atproto/lex-cli": "^0.2.1",
|
|
61
|
-
"@atproto/pds": "^0.1.
|
|
60
|
+
"@atproto/pds": "^0.1.19",
|
|
62
61
|
"@atproto/xrpc": "^0.3.1"
|
|
63
62
|
},
|
|
64
63
|
"scripts": {
|
|
@@ -11,8 +11,14 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
11
11
|
server.app.bsky.actor.searchActors({
|
|
12
12
|
auth: ctx.authOptionalVerifier,
|
|
13
13
|
handler: async ({ auth, params }) => {
|
|
14
|
-
|
|
14
|
+
let { cursor, limit, term: rawTerm, q: rawQ } = params
|
|
15
15
|
const requester = auth.credentials.did
|
|
16
|
+
|
|
17
|
+
// prefer new 'q' query param over deprecated 'term'
|
|
18
|
+
if (rawQ) {
|
|
19
|
+
rawTerm = rawQ
|
|
20
|
+
}
|
|
21
|
+
|
|
16
22
|
const term = cleanTerm(rawTerm || '')
|
|
17
23
|
|
|
18
24
|
const db = ctx.db.getReplica('search')
|
|
@@ -9,8 +9,14 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
9
9
|
server.app.bsky.actor.searchActorsTypeahead({
|
|
10
10
|
auth: ctx.authOptionalVerifier,
|
|
11
11
|
handler: async ({ params, auth }) => {
|
|
12
|
-
|
|
12
|
+
let { limit, term: rawTerm, q: rawQ } = params
|
|
13
13
|
const requester = auth.credentials.did
|
|
14
|
+
|
|
15
|
+
// prefer new 'q' query param over deprecated 'term'
|
|
16
|
+
if (rawQ) {
|
|
17
|
+
rawTerm = rawQ
|
|
18
|
+
}
|
|
19
|
+
|
|
14
20
|
const term = cleanTerm(rawTerm || '')
|
|
15
21
|
|
|
16
22
|
const db = ctx.db.getReplica('search')
|
|
@@ -12,6 +12,11 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
12
12
|
if (invitedBy) {
|
|
13
13
|
throw new InvalidRequestError('The invitedBy parameter is unsupported')
|
|
14
14
|
}
|
|
15
|
+
// prefer new 'q' query param over deprecated 'term'
|
|
16
|
+
const { q } = params
|
|
17
|
+
if (q) {
|
|
18
|
+
params.term = q
|
|
19
|
+
}
|
|
15
20
|
|
|
16
21
|
const { results, cursor } = await ctx.services
|
|
17
22
|
.actor(db)
|
|
@@ -280,28 +280,12 @@ export class AutoModerator {
|
|
|
280
280
|
async storeLabels(uri: AtUri, cid: CID, labels: string[]): Promise<void> {
|
|
281
281
|
if (labels.length < 1) return
|
|
282
282
|
const labelSrvc = this.services.label(this.ctx.db)
|
|
283
|
-
|
|
283
|
+
await labelSrvc.formatAndCreate(
|
|
284
284
|
this.ctx.cfg.labelerDid,
|
|
285
285
|
uri.toString(),
|
|
286
286
|
cid.toString(),
|
|
287
287
|
{ create: labels },
|
|
288
288
|
)
|
|
289
|
-
if (this.pushAgent) {
|
|
290
|
-
const agent = this.pushAgent
|
|
291
|
-
try {
|
|
292
|
-
await agent.api.app.bsky.unspecced.applyLabels({ labels: formatted })
|
|
293
|
-
} catch (err) {
|
|
294
|
-
log.error(
|
|
295
|
-
{
|
|
296
|
-
err,
|
|
297
|
-
uri: uri.toString(),
|
|
298
|
-
labels,
|
|
299
|
-
receiver: agent.service.toString(),
|
|
300
|
-
},
|
|
301
|
-
'failed to push labels',
|
|
302
|
-
)
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
289
|
}
|
|
306
290
|
|
|
307
291
|
async processAll() {
|