@atproto/bsky 0.0.237 → 0.0.239
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 +22 -0
- package/dist/api/app/bsky/actor/searchActors.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/searchActors.js +26 -1
- package/dist/api/app/bsky/actor/searchActors.js.map +1 -1
- package/dist/api/app/bsky/actor/searchActorsTypeahead.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/searchActorsTypeahead.js +26 -2
- package/dist/api/app/bsky/actor/searchActorsTypeahead.js.map +1 -1
- package/dist/api/app/bsky/feed/getFeed.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getFeed.js +1 -0
- package/dist/api/app/bsky/feed/getFeed.js.map +1 -1
- package/dist/api/app/bsky/feed/searchPosts.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/searchPosts.js +56 -1
- package/dist/api/app/bsky/feed/searchPosts.js.map +1 -1
- package/dist/api/app/bsky/graph/searchStarterPacks.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/searchStarterPacks.js +26 -1
- package/dist/api/app/bsky/graph/searchStarterPacks.js.map +1 -1
- package/dist/api/app/bsky/unspecced/getPopularFeedGenerators.d.ts.map +1 -1
- package/dist/api/app/bsky/unspecced/getPopularFeedGenerators.js +27 -6
- package/dist/api/app/bsky/unspecced/getPopularFeedGenerators.js.map +1 -1
- package/dist/api/com/atproto/repo/getRecord.js +2 -2
- package/dist/api/com/atproto/repo/getRecord.js.map +1 -1
- package/dist/data-plane/server/routes/feed-gens.d.ts.map +1 -1
- package/dist/data-plane/server/routes/feed-gens.js +21 -12
- package/dist/data-plane/server/routes/feed-gens.js.map +1 -1
- package/dist/data-plane/server/routes/search.d.ts.map +1 -1
- package/dist/data-plane/server/routes/search.js +62 -12
- package/dist/data-plane/server/routes/search.js.map +1 -1
- package/dist/feature-gates/gates.d.ts +1 -0
- package/dist/feature-gates/gates.d.ts.map +1 -1
- package/dist/feature-gates/gates.js +1 -0
- package/dist/feature-gates/gates.js.map +1 -1
- package/dist/hydration/hydrator.d.ts.map +1 -1
- package/dist/hydration/hydrator.js +3 -2
- package/dist/hydration/hydrator.js.map +1 -1
- package/dist/hydration/label.d.ts +1 -1
- package/dist/hydration/label.d.ts.map +1 -1
- package/dist/hydration/label.js +4 -4
- package/dist/hydration/label.js.map +1 -1
- package/dist/lexicons/app/bsky/actor/profile.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/actor/status.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/draft/defs.defs.d.ts +22 -0
- package/dist/lexicons/app/bsky/draft/defs.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/draft/defs.defs.js +11 -0
- package/dist/lexicons/app/bsky/draft/defs.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/embed/gallery.d.ts +3 -0
- package/dist/lexicons/app/bsky/embed/gallery.d.ts.map +1 -0
- package/dist/lexicons/app/bsky/embed/gallery.defs.d.ts +130 -0
- package/dist/lexicons/app/bsky/embed/gallery.defs.d.ts.map +1 -0
- package/dist/lexicons/app/bsky/embed/gallery.defs.js +47 -0
- package/dist/lexicons/app/bsky/embed/gallery.defs.js.map +1 -0
- package/dist/lexicons/app/bsky/embed/gallery.js +6 -0
- package/dist/lexicons/app/bsky/embed/gallery.js.map +1 -0
- package/dist/lexicons/app/bsky/embed/record.defs.d.ts +2 -1
- package/dist/lexicons/app/bsky/embed/record.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/embed/record.defs.js +2 -0
- package/dist/lexicons/app/bsky/embed/record.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/embed/recordWithMedia.defs.d.ts +13 -12
- package/dist/lexicons/app/bsky/embed/recordWithMedia.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/embed/recordWithMedia.defs.js +3 -0
- package/dist/lexicons/app/bsky/embed/recordWithMedia.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/embed.d.ts +1 -0
- package/dist/lexicons/app/bsky/embed.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/embed.js +1 -0
- package/dist/lexicons/app/bsky/embed.js.map +1 -1
- package/dist/lexicons/app/bsky/feed/defs.defs.d.ts +2 -1
- package/dist/lexicons/app/bsky/feed/defs.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/defs.defs.js +2 -0
- package/dist/lexicons/app/bsky/feed/defs.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/feed/generator.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/like.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/post.defs.d.ts +12 -11
- package/dist/lexicons/app/bsky/feed/post.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/post.defs.js +2 -0
- package/dist/lexicons/app/bsky/feed/post.defs.js.map +1 -1
- package/dist/lexicons/app/bsky/feed/postgate.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/repost.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/threadgate.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/block.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/follow.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/list.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/listblock.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/listitem.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/starterpack.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/verification.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/labeler/service.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/notification/declaration.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/actor/declaration.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/group/createGroup.defs.d.ts +4 -4
- package/dist/lexicons/chat/bsky/group/createGroup.defs.js +2 -2
- package/dist/lexicons/chat/bsky/group/createGroup.defs.js.map +1 -1
- package/dist/lexicons/chat/bsky/group/defs.defs.d.ts +8 -1
- package/dist/lexicons/chat/bsky/group/defs.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/group/defs.defs.js +5 -1
- package/dist/lexicons/chat/bsky/group/defs.defs.js.map +1 -1
- package/dist/lexicons/com/atproto/lexicon/schema.defs.d.ts.map +1 -1
- package/dist/lexicons/com/germnetwork/declaration.defs.d.ts.map +1 -1
- package/dist/lexicons/site/standard/document.defs.d.ts.map +1 -1
- package/dist/lexicons/site/standard/graph/recommend.defs.d.ts.map +1 -1
- package/dist/lexicons/site/standard/graph/subscription.defs.d.ts.map +1 -1
- package/dist/lexicons/site/standard/publication.defs.d.ts.map +1 -1
- package/dist/lexicons/site/standard/theme/basic.defs.d.ts.map +1 -1
- package/dist/proto/bsky_connect.d.ts +49 -2
- package/dist/proto/bsky_connect.d.ts.map +1 -1
- package/dist/proto/bsky_connect.js +49 -2
- package/dist/proto/bsky_connect.js.map +1 -1
- package/dist/proto/bsky_pb.d.ts +482 -0
- package/dist/proto/bsky_pb.d.ts.map +1 -1
- package/dist/proto/bsky_pb.js +608 -0
- package/dist/proto/bsky_pb.js.map +1 -1
- package/dist/views/index.d.ts +4 -1
- package/dist/views/index.d.ts.map +1 -1
- package/dist/views/index.js +39 -5
- package/dist/views/index.js.map +1 -1
- package/dist/views/types.d.ts +8 -2
- package/dist/views/types.d.ts.map +1 -1
- package/dist/views/types.js +2 -0
- package/dist/views/types.js.map +1 -1
- package/package.json +7 -7
- package/proto/bsky.proto +166 -2
- package/src/api/app/bsky/actor/searchActors.ts +35 -1
- package/src/api/app/bsky/actor/searchActorsTypeahead.ts +35 -2
- package/src/api/app/bsky/feed/getFeed.ts +1 -0
- package/src/api/app/bsky/feed/searchPosts.ts +60 -1
- package/src/api/app/bsky/graph/searchStarterPacks.ts +35 -1
- package/src/api/app/bsky/unspecced/getPopularFeedGenerators.ts +28 -6
- package/src/api/com/atproto/repo/getRecord.ts +2 -2
- package/src/data-plane/server/routes/feed-gens.ts +33 -14
- package/src/data-plane/server/routes/search.ts +81 -13
- package/src/feature-gates/gates.ts +1 -0
- package/src/hydration/hydrator.ts +3 -6
- package/src/hydration/label.ts +3 -3
- package/src/views/index.ts +61 -11
- package/src/views/types.ts +9 -0
- package/tests/data-plane/handle-invalidation.test.ts +2 -1
- package/tests/views/__snapshots__/posts.test.ts.snap +251 -0
- package/tests/views/drafts.test.ts +105 -0
- package/tests/views/posts.test.ts +134 -0
- package/tsconfig.build.json +2 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.json +2 -2
- package/tsconfig.tests.json +2 -2
package/dist/views/types.d.ts
CHANGED
|
@@ -21,6 +21,12 @@ export type ImagesEmbedView = app.bsky.embed.images.View;
|
|
|
21
21
|
export declare const isVideoEmbedType: <TValue extends Record<string, unknown>>(value: TValue) => value is import("@atproto/lex-schema").MaybeTypedObject<"app.bsky.embed.video", TValue>;
|
|
22
22
|
export type VideoEmbed = app.bsky.embed.video.Main;
|
|
23
23
|
export type VideoEmbedView = app.bsky.embed.video.View;
|
|
24
|
+
export declare const isGalleryEmbedType: <TValue extends Record<string, unknown>>(value: TValue) => value is import("@atproto/lex-schema").MaybeTypedObject<"app.bsky.embed.gallery", TValue>;
|
|
25
|
+
export type GalleryEmbed = app.bsky.embed.gallery.Main;
|
|
26
|
+
export type GalleryEmbedView = app.bsky.embed.gallery.View;
|
|
27
|
+
export declare const isGalleryImageEmbedType: <TValue extends Record<string, unknown>>(value: TValue) => value is import("@atproto/lex-schema").MaybeTypedObject<"app.bsky.embed.gallery#image", TValue>;
|
|
28
|
+
export type GalleryImageEmbed = app.bsky.embed.gallery.Image;
|
|
29
|
+
export type GalleryImageEmbedView = app.bsky.embed.gallery.ViewImage;
|
|
24
30
|
export declare const isExternalEmbedType: <TValue extends Record<string, unknown>>(value: TValue) => value is import("@atproto/lex-schema").MaybeTypedObject<"app.bsky.embed.external", TValue>;
|
|
25
31
|
export type ExternalEmbed = app.bsky.embed.external.Main;
|
|
26
32
|
export type ExternalEmbedView = app.bsky.embed.external.View;
|
|
@@ -38,8 +44,8 @@ export declare const isRecordWithMediaType: <TValue extends Record<string, unkno
|
|
|
38
44
|
export type RecordWithMedia = app.bsky.embed.recordWithMedia.Main;
|
|
39
45
|
export type RecordWithMediaView = app.bsky.embed.recordWithMedia.View;
|
|
40
46
|
export type RecordWithMediaEmbedView = app.bsky.embed.recordWithMedia.View;
|
|
41
|
-
export type Embed = ImagesEmbed | VideoEmbed | ExternalEmbed | RecordEmbed | RecordWithMedia;
|
|
42
|
-
export type EmbedView = ImagesEmbedView | VideoEmbedView | ExternalEmbedView | RecordEmbedView | RecordWithMediaView;
|
|
47
|
+
export type Embed = ImagesEmbed | VideoEmbed | GalleryEmbed | ExternalEmbed | RecordEmbed | RecordWithMedia;
|
|
48
|
+
export type EmbedView = ImagesEmbedView | VideoEmbedView | GalleryEmbedView | ExternalEmbedView | RecordEmbedView | RecordWithMediaView;
|
|
43
49
|
export type MaybePostView = PostView | NotFoundPost | BlockedPost;
|
|
44
50
|
export type RecordEmbedViewInternal = PostEmbedView | GeneratorView | ListView | LabelerView | StarterPackViewBasic;
|
|
45
51
|
export type LikeRecord = app.bsky.feed.like.Main;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/views/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAI3D,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAA;AACvD,eAAO,MAAM,mBAAmB;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/views/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAA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IzE,MAAM,MAAM,qBAAqB,GAAG,GAAG,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAA;AAIpE,MAAM,MAAM,0BAA0B,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAA;AACpE,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAA"}
|
package/dist/views/types.js
CHANGED
|
@@ -3,6 +3,8 @@ export const isProfileRecordType = app.bsky.actor.profile.$isTypeOf;
|
|
|
3
3
|
// app.bsky.embed
|
|
4
4
|
export const isImagesEmbedType = app.bsky.embed.images.$isTypeOf;
|
|
5
5
|
export const isVideoEmbedType = app.bsky.embed.video.$isTypeOf;
|
|
6
|
+
export const isGalleryEmbedType = app.bsky.embed.gallery.$isTypeOf;
|
|
7
|
+
export const isGalleryImageEmbedType = app.bsky.embed.gallery.image.$isTypeOf;
|
|
6
8
|
export const isExternalEmbedType = app.bsky.embed.external.$isTypeOf;
|
|
7
9
|
export const isRecordEmbedType = app.bsky.embed.record.$isTypeOf;
|
|
8
10
|
export const isRecordWithMediaType = app.bsky.embed.recordWithMedia.$isTypeOf;
|
package/dist/views/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/views/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAQ,GAAG,EAAQ,MAAM,sBAAsB,CAAA;AAK3D,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAA;AAoBnE,iBAAiB;AAEjB,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAA;AAIhE,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAA;AA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C,aAAa,CAAA","sourcesContent":["import { app, chat, com, site } from '../lexicons/index.js'\n\n// app.bsky.actor\n\nexport type ProfileRecord = app.bsky.actor.profile.Main\nexport const isProfileRecordType = app.bsky.actor.profile.$isTypeOf\n\nexport type ProfileViewer = app.bsky.actor.defs.ViewerState\nexport type KnownFollowers = app.bsky.actor.defs.KnownFollowers\nexport type ProfileAssociatedActivitySubscription =\n app.bsky.actor.defs.ProfileAssociatedActivitySubscription\nexport type ProfileAssociatedChat = app.bsky.actor.defs.ProfileAssociatedChat\nexport type ProfileView = app.bsky.actor.defs.ProfileView\nexport type ProfileViewBasic = app.bsky.actor.defs.ProfileViewBasic\nexport type ProfileViewDetailed = app.bsky.actor.defs.ProfileViewDetailed\nexport type StatusView = app.bsky.actor.defs.StatusView\nexport type VerificationState = app.bsky.actor.defs.VerificationState\nexport type VerificationView = app.bsky.actor.defs.VerificationView\n\nexport type StatusRecord = app.bsky.actor.status.Main\n\n// app.bsky.bookmark\n\nexport type BookmarkView = app.bsky.bookmark.defs.BookmarkView\n\n// app.bsky.embed\n\nexport const isImagesEmbedType = app.bsky.embed.images.$isTypeOf\nexport type ImagesEmbed = app.bsky.embed.images.Main\nexport type ImagesEmbedView = app.bsky.embed.images.View\n\nexport const isVideoEmbedType = app.bsky.embed.video.$isTypeOf\nexport type VideoEmbed = app.bsky.embed.video.Main\nexport type VideoEmbedView = app.bsky.embed.video.View\n\nexport const isGalleryEmbedType = app.bsky.embed.gallery.$isTypeOf\nexport type GalleryEmbed = app.bsky.embed.gallery.Main\nexport type GalleryEmbedView = app.bsky.embed.gallery.View\nexport const isGalleryImageEmbedType = app.bsky.embed.gallery.image.$isTypeOf\nexport type GalleryImageEmbed = app.bsky.embed.gallery.Image\nexport type GalleryImageEmbedView = app.bsky.embed.gallery.ViewImage\n\nexport const isExternalEmbedType = app.bsky.embed.external.$isTypeOf\nexport type ExternalEmbed = app.bsky.embed.external.Main\nexport type ExternalEmbedView = app.bsky.embed.external.View\nexport type ExternalEmbedSourceView = app.bsky.embed.external.ViewExternalSource\nexport type ExternalEmbedSourceThemeView =\n app.bsky.embed.external.ViewExternalSourceTheme\nexport type ExternalEmbedColorRgb = app.bsky.embed.external.ColorRgb\n\nexport const isRecordEmbedType = app.bsky.embed.record.$isTypeOf\nexport type RecordEmbed = app.bsky.embed.record.Main\nexport type RecordEmbedView = app.bsky.embed.record.View\nexport type EmbedBlocked = app.bsky.embed.record.ViewBlocked\nexport type EmbedDetached = app.bsky.embed.record.ViewDetached\nexport type EmbedNotFound = app.bsky.embed.record.ViewNotFound\nexport type PostEmbedView = app.bsky.embed.record.ViewRecord\n\nexport const isRecordWithMediaType = app.bsky.embed.recordWithMedia.$isTypeOf\nexport type RecordWithMedia = app.bsky.embed.recordWithMedia.Main\nexport type RecordWithMediaView = app.bsky.embed.recordWithMedia.View\nexport type RecordWithMediaEmbedView = app.bsky.embed.recordWithMedia.View\n\nexport type Embed =\n | ImagesEmbed\n | VideoEmbed\n | GalleryEmbed\n | ExternalEmbed\n | RecordEmbed\n | RecordWithMedia\n\nexport type EmbedView =\n | ImagesEmbedView\n | VideoEmbedView\n | GalleryEmbedView\n | ExternalEmbedView\n | RecordEmbedView\n | RecordWithMediaView\n\nexport type MaybePostView = PostView | NotFoundPost | BlockedPost\n\nexport type RecordEmbedViewInternal =\n | PostEmbedView\n | GeneratorView\n | ListView\n | LabelerView\n | StarterPackViewBasic\n\n// app.bsky.feed\n\nexport type LikeRecord = app.bsky.feed.like.Main\nexport type RepostRecord = app.bsky.feed.repost.Main\n\nexport type PostRecord = app.bsky.feed.post.Main\nexport const isPostRecordType = app.bsky.feed.post.$isTypeOf\n\nexport type PostgateRecord = app.bsky.feed.postgate.Main\nexport const isPostgateDisableRuleType =\n app.bsky.feed.postgate.disableRule.$isTypeOf\n\nexport type FeedViewPost = app.bsky.feed.defs.FeedViewPost\nexport type ReasonPin = app.bsky.feed.defs.ReasonPin\nexport type ReasonRepost = app.bsky.feed.defs.ReasonRepost\nexport type ReplyRef = app.bsky.feed.defs.ReplyRef\nexport type PostReplyRef = app.bsky.feed.post.ReplyRef\nexport type ThreadViewPost = app.bsky.feed.defs.ThreadViewPost\nexport type ThreadgateView = app.bsky.feed.defs.ThreadgateView\nexport type BlockedPost = app.bsky.feed.defs.BlockedPost\nexport type GeneratorView = app.bsky.feed.defs.GeneratorView\nexport type NotFoundPost = app.bsky.feed.defs.NotFoundPost\nexport type PostView = app.bsky.feed.defs.PostView\nexport const isPostViewType = app.bsky.feed.defs.postView.$isTypeOf\n\nexport type GateRecord = app.bsky.feed.threadgate.Main\nexport const isFollowerRuleType =\n app.bsky.feed.threadgate.followerRule.$isTypeOf\nexport const isFollowingRuleType =\n app.bsky.feed.threadgate.followingRule.$isTypeOf\nexport const isListRuleType = app.bsky.feed.threadgate.listRule.$isTypeOf\nexport const isMentionRuleType = app.bsky.feed.threadgate.mentionRule.$isTypeOf\n\nexport type FeedGenRecord = app.bsky.feed.generator.Main\n\n// app.bsky.graph\n\nexport type BlockRecord = app.bsky.graph.block.Main\nexport type FollowRecord = app.bsky.graph.follow.Main\nexport type ListItemRecord = app.bsky.graph.listitem.Main\nexport type ListItemView = app.bsky.graph.defs.ListItemView\nexport type ListRecord = app.bsky.graph.list.Main\nexport type ListView = app.bsky.graph.defs.ListView\nexport type ListViewBasic = app.bsky.graph.defs.ListViewBasic\nexport type StarterPackRecord = app.bsky.graph.starterpack.Main\nexport type StarterPackView = app.bsky.graph.defs.StarterPackView\nexport type StarterPackViewBasic = app.bsky.graph.defs.StarterPackViewBasic\nexport type VerificationRecord = app.bsky.graph.verification.Main\n\n// app.bsky.labeler\n\nexport type LabelerRecord = app.bsky.labeler.service.Main\nexport const isLabelerRecordType = app.bsky.labeler.service.$isTypeOf\nexport type LabelerView = app.bsky.labeler.defs.LabelerView\nexport type LabelerViewDetailed = app.bsky.labeler.defs.LabelerViewDetailed\n\n// app.bsky.notification\n\nexport type NotificationDeclarationRecord =\n app.bsky.notification.declaration.Main\nexport type ActivitySubscription =\n app.bsky.notification.defs.ActivitySubscription\nexport type NotificationRecordDeleted = app.bsky.notification.defs.RecordDeleted\nexport type NotificationView =\n app.bsky.notification.listNotifications.Notification\n\n// app.bsky.richtext\n\nexport const isMentionFacetType = app.bsky.richtext.facet.mention.$isTypeOf\n\n// app.bsky.unspecced\n\nexport type ThreadItemBlocked = app.bsky.unspecced.defs.ThreadItemBlocked\nexport type ThreadItemNoUnauthenticated =\n app.bsky.unspecced.defs.ThreadItemNoUnauthenticated\nexport type ThreadItemNotFound = app.bsky.unspecced.defs.ThreadItemNotFound\nexport type ThreadItemPost = app.bsky.unspecced.defs.ThreadItemPost\n\nexport type ThreadOtherItem = app.bsky.unspecced.getPostThreadOtherV2.ThreadItem\nexport type GetPostThreadV2QueryParams =\n app.bsky.unspecced.getPostThreadV2.$Params\nexport type ThreadItem = app.bsky.unspecced.getPostThreadV2.ThreadItem\n\n// chat.bsky.actor\n\nexport type ChatDeclarationRecord = chat.bsky.actor.declaration.Main\n\n// com.atproto.label\n\nexport type Label = com.atproto.label.defs.Label\nexport const isSelfLabelsType = com.atproto.label.defs.selfLabels.$isTypeOf\n\n// com.atproto.label\n\nexport type StrongRef = com.atproto.repo.strongRef.Main\nexport const validateStrongRef = com.atproto.repo.strongRef.$safeValidate\n\n// com.germnetwork.declaration\n\nexport type GermDeclarationRecord = com.germnetwork.declaration.Main\n\n// site.standard\n\nexport type SiteStandardDocumentRecord = site.standard.document.Main\nexport type SiteStandardPublicationRecord = site.standard.publication.Main\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/bsky",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.239",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Reference implementation of app.bsky App View (Bluesky API)",
|
|
6
6
|
"keywords": [
|
|
@@ -50,16 +50,16 @@
|
|
|
50
50
|
"zod": "3.23.8",
|
|
51
51
|
"@atproto-labs/fetch-node": "^0.3.0",
|
|
52
52
|
"@atproto-labs/xrpc-utils": "^0.1.0",
|
|
53
|
+
"@atproto/api": "^0.20.10",
|
|
53
54
|
"@atproto/common": "^0.6.1",
|
|
54
|
-
"@atproto/api": "^0.20.8",
|
|
55
55
|
"@atproto/crypto": "^0.5.0",
|
|
56
|
-
"@atproto/did": "^0.5.0",
|
|
57
56
|
"@atproto/repo": "^0.10.0",
|
|
57
|
+
"@atproto/did": "^0.5.0",
|
|
58
|
+
"@atproto/sync": "^0.3.1",
|
|
58
59
|
"@atproto/syntax": "^0.6.1",
|
|
59
60
|
"@atproto/xrpc-server": "^0.11.1",
|
|
60
|
-
"@atproto/
|
|
61
|
-
"@atproto/identity": "^0.5.0"
|
|
62
|
-
"@atproto/lex": "^0.1.3"
|
|
61
|
+
"@atproto/lex": "^0.1.3",
|
|
62
|
+
"@atproto/identity": "^0.5.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@bufbuild/buf": "^1.28.1",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"ts-node": "^10.8.2",
|
|
75
75
|
"typescript": "^6.0.3",
|
|
76
76
|
"vitest": "^4.0.16",
|
|
77
|
-
"@atproto/pds": "^0.5.
|
|
77
|
+
"@atproto/pds": "^0.5.2"
|
|
78
78
|
},
|
|
79
79
|
"type": "module",
|
|
80
80
|
"exports": {
|
package/proto/bsky.proto
CHANGED
|
@@ -1086,7 +1086,7 @@ message GetThreadResponse {
|
|
|
1086
1086
|
}
|
|
1087
1087
|
|
|
1088
1088
|
//
|
|
1089
|
-
// Search
|
|
1089
|
+
// Search V1
|
|
1090
1090
|
//
|
|
1091
1091
|
|
|
1092
1092
|
// - Return DIDs of actors matching term, paginated
|
|
@@ -1128,6 +1128,163 @@ message SearchStarterPacksResponse {
|
|
|
1128
1128
|
string cursor = 2;
|
|
1129
1129
|
}
|
|
1130
1130
|
|
|
1131
|
+
//
|
|
1132
|
+
// Search V2
|
|
1133
|
+
//
|
|
1134
|
+
|
|
1135
|
+
enum SearchSortOrder {
|
|
1136
|
+
SEARCH_SORT_ORDER_UNSPECIFIED = 0;
|
|
1137
|
+
SEARCH_SORT_ORDER_RECENT = 1;
|
|
1138
|
+
SEARCH_SORT_ORDER_TOP = 2;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
enum SearchQueryLanguage {
|
|
1142
|
+
SEARCH_QUERY_LANGUAGE_UNSPECIFIED = 0;
|
|
1143
|
+
SEARCH_QUERY_LANGUAGE_JA = 1; // Japanese (Kuromoji)
|
|
1144
|
+
SEARCH_QUERY_LANGUAGE_ZH = 2; // Chinese (smartcn)
|
|
1145
|
+
SEARCH_QUERY_LANGUAGE_KO = 3; // Korean (nori)
|
|
1146
|
+
SEARCH_QUERY_LANGUAGE_TH = 4; // Thai
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
// Shared request params
|
|
1150
|
+
|
|
1151
|
+
message SearchParams {
|
|
1152
|
+
string query = 1;
|
|
1153
|
+
string viewer = 2;
|
|
1154
|
+
|
|
1155
|
+
// Pagination
|
|
1156
|
+
int32 limit = 3;
|
|
1157
|
+
string cursor = 4;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
// Shared result types
|
|
1161
|
+
|
|
1162
|
+
// SearchRecordResult represents a generic result hit corresponding to a record.
|
|
1163
|
+
message SearchRecordResult {
|
|
1164
|
+
// AT URI of the record, e.g. "at://did:example:alice/app.bsky.feed.post/12345"
|
|
1165
|
+
string uri = 1;
|
|
1166
|
+
double score = 2;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
message SearchActorResult {
|
|
1170
|
+
string did = 1;
|
|
1171
|
+
double score = 2;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
message PageInfo {
|
|
1175
|
+
string cursor = 1;
|
|
1176
|
+
int64 hits_total = 2;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
// Search queries
|
|
1180
|
+
|
|
1181
|
+
// PostFilters are logical filters that should be used to match or exclude posts.
|
|
1182
|
+
// Each repeated field is applied as OR within the field with all fields applied together as AND.
|
|
1183
|
+
// example:
|
|
1184
|
+
// filters: {
|
|
1185
|
+
// authors: [alice, bob]
|
|
1186
|
+
// mentions: [carol]
|
|
1187
|
+
// }
|
|
1188
|
+
// => (author is alice OR bob) AND (mentions carol)
|
|
1189
|
+
//
|
|
1190
|
+
message PostsFilters {
|
|
1191
|
+
// Author/mention filters
|
|
1192
|
+
repeated string authors = 1;
|
|
1193
|
+
repeated string mentions = 2;
|
|
1194
|
+
|
|
1195
|
+
// Content filters
|
|
1196
|
+
repeated string domains = 3;
|
|
1197
|
+
repeated string urls = 4;
|
|
1198
|
+
repeated string embed_uris = 5;
|
|
1199
|
+
repeated string hashtags = 6;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
message SearchPostsV2Request {
|
|
1203
|
+
// Required fields
|
|
1204
|
+
SearchParams params = 1;
|
|
1205
|
+
SearchSortOrder sort = 2;
|
|
1206
|
+
|
|
1207
|
+
// Logical filters and exclude fields applied together as AND
|
|
1208
|
+
//
|
|
1209
|
+
// filters: include posts matching the filters
|
|
1210
|
+
PostsFilters filters = 3;
|
|
1211
|
+
|
|
1212
|
+
// Exclude filters: exclude posts matching the filters
|
|
1213
|
+
PostsFilters exclude = 4;
|
|
1214
|
+
|
|
1215
|
+
// Date range filters
|
|
1216
|
+
optional google.protobuf.Timestamp since = 5;
|
|
1217
|
+
optional google.protobuf.Timestamp until = 6; // defaults to "now"
|
|
1218
|
+
// If false, will only query against last 30 days of posts
|
|
1219
|
+
// so `since` and `until` will silently be capped
|
|
1220
|
+
optional bool all_time = 7;
|
|
1221
|
+
|
|
1222
|
+
// Language filter - match posts in this language
|
|
1223
|
+
// Supports 2-char ISO prefixes ("en", "ja, "fr", etc")
|
|
1224
|
+
// and compares against the 2-char prefix of any `langs` field values of the post record
|
|
1225
|
+
// e.g. a post with langs=["en-US", "fr"] would match "en" or "fr" but not "ja"
|
|
1226
|
+
optional string language = 8;
|
|
1227
|
+
|
|
1228
|
+
// Media filters
|
|
1229
|
+
optional bool has_media = 9;
|
|
1230
|
+
optional bool has_video = 10;
|
|
1231
|
+
|
|
1232
|
+
// Reply filters
|
|
1233
|
+
optional string reply_parent_uri = 11;
|
|
1234
|
+
optional string thread_root_uri = 12;
|
|
1235
|
+
optional bool exclude_replies = 13;
|
|
1236
|
+
optional bool replies_only = 14;
|
|
1237
|
+
|
|
1238
|
+
// Social filters
|
|
1239
|
+
optional bool following = 15;
|
|
1240
|
+
|
|
1241
|
+
// Query analysis hint — forces a specific language analyzer.
|
|
1242
|
+
// Auto-detects from query text when unset.
|
|
1243
|
+
optional SearchQueryLanguage query_language = 16;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
message SearchPostsV2Response {
|
|
1247
|
+
repeated SearchRecordResult posts = 1;
|
|
1248
|
+
PageInfo page_info = 2;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
message SearchActorsV2Request {
|
|
1252
|
+
SearchParams params = 1;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
message SearchActorsV2Response {
|
|
1256
|
+
repeated SearchActorResult actors = 1;
|
|
1257
|
+
PageInfo page_info = 2;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
message SearchActorsTypeaheadRequest {
|
|
1261
|
+
string viewer = 1;
|
|
1262
|
+
string query = 2;
|
|
1263
|
+
int32 limit = 3;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
message SearchActorsTypeaheadResponse {
|
|
1267
|
+
repeated SearchActorResult actors = 1;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
message SearchFeedGeneratorsV2Request {
|
|
1271
|
+
SearchParams params = 1;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
message SearchFeedGeneratorsV2Response {
|
|
1275
|
+
repeated SearchRecordResult feed_generators = 1;
|
|
1276
|
+
PageInfo page_info = 2;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
message SearchStarterPacksV2Request {
|
|
1280
|
+
SearchParams params = 1;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
message SearchStarterPacksV2Response {
|
|
1284
|
+
repeated SearchRecordResult starter_packs = 1;
|
|
1285
|
+
PageInfo page_info = 2;
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1131
1288
|
//
|
|
1132
1289
|
// Suggestions
|
|
1133
1290
|
//
|
|
@@ -1532,11 +1689,18 @@ service Service {
|
|
|
1532
1689
|
// Threads
|
|
1533
1690
|
rpc GetThread(GetThreadRequest) returns (GetThreadResponse);
|
|
1534
1691
|
|
|
1535
|
-
// Search
|
|
1692
|
+
// Search (V1)
|
|
1536
1693
|
rpc SearchActors(SearchActorsRequest) returns (SearchActorsResponse);
|
|
1537
1694
|
rpc SearchPosts(SearchPostsRequest) returns (SearchPostsResponse);
|
|
1538
1695
|
rpc SearchStarterPacks(SearchStarterPacksRequest) returns (SearchStarterPacksResponse);
|
|
1539
1696
|
|
|
1697
|
+
// Search V2
|
|
1698
|
+
rpc SearchPostsV2(SearchPostsV2Request) returns (SearchPostsV2Response);
|
|
1699
|
+
rpc SearchActorsV2(SearchActorsV2Request) returns (SearchActorsV2Response);
|
|
1700
|
+
rpc SearchActorsTypeahead(SearchActorsTypeaheadRequest) returns (SearchActorsTypeaheadResponse);
|
|
1701
|
+
rpc SearchFeedGeneratorsV2(SearchFeedGeneratorsV2Request) returns (SearchFeedGeneratorsV2Response);
|
|
1702
|
+
rpc SearchStarterPacksV2(SearchStarterPacksV2Request) returns (SearchStarterPacksV2Response);
|
|
1703
|
+
|
|
1540
1704
|
// Suggestions
|
|
1541
1705
|
rpc GetFollowSuggestions(GetFollowSuggestionsRequest) returns (GetFollowSuggestionsResponse);
|
|
1542
1706
|
rpc GetSuggestedEntities(GetSuggestedEntitiesRequest) returns (GetSuggestedEntitiesResponse);
|
|
@@ -34,6 +34,12 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
34
34
|
labelers,
|
|
35
35
|
includeTakedowns,
|
|
36
36
|
skipViewerBlocks,
|
|
37
|
+
features: ctx.featureGatesClient.scope(
|
|
38
|
+
ctx.featureGatesClient.parseUserContextFromHandler({
|
|
39
|
+
viewer,
|
|
40
|
+
req,
|
|
41
|
+
}),
|
|
42
|
+
),
|
|
37
43
|
})
|
|
38
44
|
const results = await searchActors({ ...params, hydrateCtx }, ctx)
|
|
39
45
|
return {
|
|
@@ -45,7 +51,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
45
51
|
})
|
|
46
52
|
}
|
|
47
53
|
|
|
48
|
-
const
|
|
54
|
+
const skeletonV1 = async (
|
|
49
55
|
inputs: SkeletonFnInput<Context, Params>,
|
|
50
56
|
): Promise<Skeleton> => {
|
|
51
57
|
const { ctx, params } = inputs
|
|
@@ -82,6 +88,34 @@ const skeleton = async (
|
|
|
82
88
|
}
|
|
83
89
|
}
|
|
84
90
|
|
|
91
|
+
const skeletonV2 = async (
|
|
92
|
+
inputs: SkeletonFnInput<Context, Params>,
|
|
93
|
+
): Promise<Skeleton> => {
|
|
94
|
+
const { ctx, params } = inputs
|
|
95
|
+
const term = params.q ?? params.term ?? ''
|
|
96
|
+
|
|
97
|
+
const res = await ctx.dataplane.searchActorsV2({
|
|
98
|
+
params: {
|
|
99
|
+
query: term,
|
|
100
|
+
viewer: params.hydrateCtx.viewer ?? undefined,
|
|
101
|
+
limit: params.limit,
|
|
102
|
+
cursor: params.cursor,
|
|
103
|
+
},
|
|
104
|
+
})
|
|
105
|
+
return {
|
|
106
|
+
dids: res.actors.map(({ did }) => did as DidString),
|
|
107
|
+
cursor: parseString(res.pageInfo?.cursor),
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const skeleton = async (input: SkeletonFnInput<Context, Params>) => {
|
|
112
|
+
const useV2 = input.params.hydrateCtx.features.checkGate(
|
|
113
|
+
input.params.hydrateCtx.features.Gate.SearchV2Enable,
|
|
114
|
+
)
|
|
115
|
+
const skeletonFn = useV2 ? skeletonV2 : skeletonV1
|
|
116
|
+
return skeletonFn(input)
|
|
117
|
+
}
|
|
118
|
+
|
|
85
119
|
const hydration = async (
|
|
86
120
|
inputs: HydrationFnInput<Context, Params, Skeleton>,
|
|
87
121
|
) => {
|
|
@@ -27,7 +27,16 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
27
27
|
handler: async ({ params, auth, req }) => {
|
|
28
28
|
const viewer = auth.credentials.iss
|
|
29
29
|
const labelers = ctx.reqLabelers(req)
|
|
30
|
-
const hydrateCtx = await ctx.hydrator.createContext({
|
|
30
|
+
const hydrateCtx = await ctx.hydrator.createContext({
|
|
31
|
+
labelers,
|
|
32
|
+
viewer,
|
|
33
|
+
features: ctx.featureGatesClient.scope(
|
|
34
|
+
ctx.featureGatesClient.parseUserContextFromHandler({
|
|
35
|
+
viewer,
|
|
36
|
+
req,
|
|
37
|
+
}),
|
|
38
|
+
),
|
|
39
|
+
})
|
|
31
40
|
const results = await searchActorsTypeahead(
|
|
32
41
|
{ ...params, hydrateCtx },
|
|
33
42
|
ctx,
|
|
@@ -41,7 +50,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
41
50
|
})
|
|
42
51
|
}
|
|
43
52
|
|
|
44
|
-
const
|
|
53
|
+
const skeletonV1 = async (
|
|
45
54
|
inputs: SkeletonFnInput<Context, Params>,
|
|
46
55
|
): Promise<Skeleton> => {
|
|
47
56
|
const { ctx, params } = inputs
|
|
@@ -75,6 +84,30 @@ const skeleton = async (
|
|
|
75
84
|
}
|
|
76
85
|
}
|
|
77
86
|
|
|
87
|
+
const skeletonV2 = async (
|
|
88
|
+
inputs: SkeletonFnInput<Context, Params>,
|
|
89
|
+
): Promise<Skeleton> => {
|
|
90
|
+
const { ctx, params } = inputs
|
|
91
|
+
const term = params.q ?? params.term ?? ''
|
|
92
|
+
|
|
93
|
+
const res = await ctx.dataplane.searchActorsTypeahead({
|
|
94
|
+
viewer: params.hydrateCtx.viewer ?? undefined,
|
|
95
|
+
query: term,
|
|
96
|
+
limit: params.limit,
|
|
97
|
+
})
|
|
98
|
+
return {
|
|
99
|
+
dids: res.actors.map(({ did }) => did as DidString),
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const skeleton = async (input: SkeletonFnInput<Context, Params>) => {
|
|
104
|
+
const useV2 = input.params.hydrateCtx.features.checkGate(
|
|
105
|
+
input.params.hydrateCtx.features.Gate.SearchV2Enable,
|
|
106
|
+
)
|
|
107
|
+
const skeletonFn = useV2 ? skeletonV2 : skeletonV1
|
|
108
|
+
return skeletonFn(input)
|
|
109
|
+
}
|
|
110
|
+
|
|
78
111
|
const hydration = async (
|
|
79
112
|
inputs: HydrationFnInput<Context, Params, Skeleton>,
|
|
80
113
|
) => {
|
|
@@ -210,6 +210,7 @@ const skeletonFromFeedGen = async (
|
|
|
210
210
|
// @TODO currently passthrough auth headers from pds
|
|
211
211
|
const result = await xrpcSafe(fgEndpoint, app.bsky.feed.getFeedSkeleton, {
|
|
212
212
|
strictResponseProcessing: false,
|
|
213
|
+
signal: AbortSignal.timeout(10_000),
|
|
213
214
|
headers,
|
|
214
215
|
params: {
|
|
215
216
|
feed: params.feed,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Timestamp } from '@bufbuild/protobuf'
|
|
1
2
|
import { mapDefined } from '@atproto/common'
|
|
2
3
|
import { AtUriString, Client } from '@atproto/lex'
|
|
3
4
|
import { Server } from '@atproto/xrpc-server'
|
|
@@ -18,6 +19,7 @@ import {
|
|
|
18
19
|
SkeletonFnInput,
|
|
19
20
|
createPipeline,
|
|
20
21
|
} from '../../../../pipeline.js'
|
|
22
|
+
import { SearchSortOrder } from '../../../../proto/bsky_pb.js'
|
|
21
23
|
import { uriToDid as creatorFromUri } from '../../../../util/uris.js'
|
|
22
24
|
import { Views } from '../../../../views/index.js'
|
|
23
25
|
import { resHeaders } from '../../../util.js'
|
|
@@ -60,7 +62,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
60
62
|
})
|
|
61
63
|
}
|
|
62
64
|
|
|
63
|
-
const
|
|
65
|
+
const skeletonV1 = async (
|
|
64
66
|
inputs: SkeletonFnInput<Context, Params>,
|
|
65
67
|
): Promise<Skeleton> => {
|
|
66
68
|
const { ctx, params } = inputs
|
|
@@ -107,6 +109,50 @@ const skeleton = async (
|
|
|
107
109
|
}
|
|
108
110
|
}
|
|
109
111
|
|
|
112
|
+
const skeletonV2 = async (
|
|
113
|
+
inputs: SkeletonFnInput<Context, Params>,
|
|
114
|
+
): Promise<Skeleton> => {
|
|
115
|
+
const { ctx, params } = inputs
|
|
116
|
+
const parsedQuery = parsePostSearchQuery(params.q, {
|
|
117
|
+
author: params.author,
|
|
118
|
+
})
|
|
119
|
+
const res = await ctx.dataplane.searchPostsV2({
|
|
120
|
+
params: {
|
|
121
|
+
query: params.q,
|
|
122
|
+
viewer: params.hydrateCtx.viewer ?? undefined,
|
|
123
|
+
limit: params.limit,
|
|
124
|
+
cursor: params.cursor,
|
|
125
|
+
},
|
|
126
|
+
sort: postSortToV2(params.sort),
|
|
127
|
+
filters: {
|
|
128
|
+
authors: params.author ? [params.author] : [],
|
|
129
|
+
mentions: params.mentions ? [params.mentions] : [],
|
|
130
|
+
domains: params.domain ? [params.domain] : [],
|
|
131
|
+
urls: params.url ? [params.url] : [],
|
|
132
|
+
hashtags: params.tag ?? [],
|
|
133
|
+
},
|
|
134
|
+
since: parseTimestamp(params.since),
|
|
135
|
+
until: parseTimestamp(params.until),
|
|
136
|
+
language: params.lang,
|
|
137
|
+
})
|
|
138
|
+
return {
|
|
139
|
+
posts: res.posts.map(({ uri }) => uri as AtUriString),
|
|
140
|
+
cursor: parseString(res.pageInfo?.cursor),
|
|
141
|
+
hitsTotal: res.pageInfo?.hitsTotal
|
|
142
|
+
? Number(res.pageInfo.hitsTotal)
|
|
143
|
+
: undefined,
|
|
144
|
+
parsedQuery,
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const skeleton = async (input: SkeletonFnInput<Context, Params>) => {
|
|
149
|
+
const useV2 = input.params.hydrateCtx.features.checkGate(
|
|
150
|
+
input.params.hydrateCtx.features.Gate.SearchV2Enable,
|
|
151
|
+
)
|
|
152
|
+
const skeletonFn = useV2 ? skeletonV2 : skeletonV1
|
|
153
|
+
return skeletonFn(input)
|
|
154
|
+
}
|
|
155
|
+
|
|
110
156
|
const hydration = async (
|
|
111
157
|
inputs: HydrationFnInput<Context, Params, Skeleton>,
|
|
112
158
|
) => {
|
|
@@ -199,3 +245,16 @@ type Skeleton = {
|
|
|
199
245
|
cursor?: string
|
|
200
246
|
parsedQuery: PostSearchQuery
|
|
201
247
|
}
|
|
248
|
+
|
|
249
|
+
const postSortToV2 = (sort: string | undefined): SearchSortOrder => {
|
|
250
|
+
if (sort === 'top') return SearchSortOrder.TOP
|
|
251
|
+
if (sort === 'latest') return SearchSortOrder.RECENT
|
|
252
|
+
return SearchSortOrder.UNSPECIFIED
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
const parseTimestamp = (value: string | undefined): Timestamp | undefined => {
|
|
256
|
+
if (!value) return undefined
|
|
257
|
+
const date = new Date(value)
|
|
258
|
+
if (isNaN(date.getTime())) return undefined
|
|
259
|
+
return Timestamp.fromDate(date)
|
|
260
|
+
}
|
|
@@ -35,6 +35,12 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
35
35
|
labelers,
|
|
36
36
|
includeTakedowns,
|
|
37
37
|
skipViewerBlocks,
|
|
38
|
+
features: ctx.featureGatesClient.scope(
|
|
39
|
+
ctx.featureGatesClient.parseUserContextFromHandler({
|
|
40
|
+
viewer,
|
|
41
|
+
req,
|
|
42
|
+
}),
|
|
43
|
+
),
|
|
38
44
|
})
|
|
39
45
|
const results = await searchStarterPacks({ ...params, hydrateCtx }, ctx)
|
|
40
46
|
return {
|
|
@@ -46,7 +52,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
46
52
|
})
|
|
47
53
|
}
|
|
48
54
|
|
|
49
|
-
const
|
|
55
|
+
const skeletonV1 = async (
|
|
50
56
|
inputs: SkeletonFnInput<Context, Params>,
|
|
51
57
|
): Promise<Skeleton> => {
|
|
52
58
|
const { ctx, params } = inputs
|
|
@@ -80,6 +86,34 @@ const skeleton = async (
|
|
|
80
86
|
}
|
|
81
87
|
}
|
|
82
88
|
|
|
89
|
+
const skeletonV2 = async (
|
|
90
|
+
inputs: SkeletonFnInput<Context, Params>,
|
|
91
|
+
): Promise<Skeleton> => {
|
|
92
|
+
const { ctx, params } = inputs
|
|
93
|
+
const { q } = params
|
|
94
|
+
|
|
95
|
+
const res = await ctx.dataplane.searchStarterPacksV2({
|
|
96
|
+
params: {
|
|
97
|
+
query: q,
|
|
98
|
+
viewer: params.hydrateCtx.viewer ?? undefined,
|
|
99
|
+
limit: params.limit,
|
|
100
|
+
cursor: params.cursor,
|
|
101
|
+
},
|
|
102
|
+
})
|
|
103
|
+
return {
|
|
104
|
+
uris: res.starterPacks.map(({ uri }) => uri as AtUriString),
|
|
105
|
+
cursor: parseString(res.pageInfo?.cursor),
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const skeleton = async (input: SkeletonFnInput<Context, Params>) => {
|
|
110
|
+
const useV2 = input.params.hydrateCtx.features.checkGate(
|
|
111
|
+
input.params.hydrateCtx.features.Gate.SearchV2Enable,
|
|
112
|
+
)
|
|
113
|
+
const skeletonFn = useV2 ? skeletonV2 : skeletonV1
|
|
114
|
+
return skeletonFn(input)
|
|
115
|
+
}
|
|
116
|
+
|
|
83
117
|
const hydration = async (
|
|
84
118
|
inputs: HydrationFnInput<Context, Params, Skeleton>,
|
|
85
119
|
) => {
|
|
@@ -15,7 +15,17 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
15
15
|
handler: async ({ auth, params, req }) => {
|
|
16
16
|
const viewer = auth.credentials.iss
|
|
17
17
|
const labelers = ctx.reqLabelers(req)
|
|
18
|
-
const
|
|
18
|
+
const features = ctx.featureGatesClient.scope(
|
|
19
|
+
ctx.featureGatesClient.parseUserContextFromHandler({
|
|
20
|
+
viewer,
|
|
21
|
+
req,
|
|
22
|
+
}),
|
|
23
|
+
)
|
|
24
|
+
const hydrateCtx = await ctx.hydrator.createContext({
|
|
25
|
+
viewer,
|
|
26
|
+
labelers,
|
|
27
|
+
features,
|
|
28
|
+
})
|
|
19
29
|
|
|
20
30
|
if (clearlyBadCursor(params.cursor)) {
|
|
21
31
|
return {
|
|
@@ -29,11 +39,23 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
29
39
|
|
|
30
40
|
const query = params.query?.trim() ?? ''
|
|
31
41
|
if (query) {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
const useV2 = features.checkGate(features.Gate.SearchV2Enable)
|
|
43
|
+
if (useV2) {
|
|
44
|
+
const res = await ctx.dataplane.searchFeedGeneratorsV2({
|
|
45
|
+
params: {
|
|
46
|
+
query,
|
|
47
|
+
viewer: viewer ?? undefined,
|
|
48
|
+
limit: params.limit,
|
|
49
|
+
},
|
|
50
|
+
})
|
|
51
|
+
uris = res.feedGenerators.map(({ uri }) => uri) as AtUriString[]
|
|
52
|
+
} else {
|
|
53
|
+
const res = await ctx.dataplane.searchFeedGenerators({
|
|
54
|
+
query,
|
|
55
|
+
limit: params.limit,
|
|
56
|
+
})
|
|
57
|
+
uris = res.uris as AtUriString[]
|
|
58
|
+
}
|
|
37
59
|
} else {
|
|
38
60
|
const res = await ctx.dataplane.getSuggestedFeeds({
|
|
39
61
|
actorDid: viewer ?? undefined,
|