@atproto/bsky 0.0.28 → 0.0.30
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 +15 -0
- package/LICENSE.txt +1 -1
- package/dist/api/app/bsky/feed/getAuthorFeed.d.ts +1 -0
- package/dist/auto-moderator/index.d.ts +1 -14
- package/dist/context.d.ts +0 -3
- package/dist/db/index.js +43762 -12377
- package/dist/db/index.js.map +3 -3
- package/dist/db/pagination.d.ts +1 -0
- package/dist/index.d.ts +0 -4
- package/dist/index.js +2422 -2135
- package/dist/index.js.map +3 -3
- package/dist/indexer/config.d.ts +0 -8
- package/dist/lexicon/index.d.ts +0 -2
- package/dist/lexicon/lexicons.d.ts +134 -52
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/actor/getPreferences.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/actor/getProfile.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/actor/getProfiles.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/actor/getSuggestions.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/actor/searchActors.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/actor/searchActorsTypeahead.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/describeFeedGenerator.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getActorFeeds.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getActorLikes.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getAuthorFeed.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getFeed.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getFeedGenerator.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getFeedGenerators.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getFeedSkeleton.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getLikes.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getListFeed.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getPostThread.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getPosts.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getRepostedBy.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getSuggestedFeeds.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/getTimeline.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/feed/searchPosts.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getBlocks.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getFollowers.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getFollows.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getList.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getListBlocks.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getListMutes.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getLists.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getMutes.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getRelationships.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/graph/getSuggestedFollowsByActor.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/notification/getUnreadCount.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/notification/listNotifications.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/unspecced/getPopularFeedGenerators.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/unspecced/getTaggedSuggestions.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.d.ts +2 -2
- package/dist/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/createCommunicationTemplate.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/defs.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/emitModerationEvent.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/getAccountInfo.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/getAccountInfos.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/getInviteCodes.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/getModerationEvent.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/getRecord.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/getRepo.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/getSubjectStatus.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/listCommunicationTemplates.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/queryModerationEvents.d.ts +9 -2
- package/dist/lexicon/types/com/atproto/admin/queryModerationStatuses.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/searchRepos.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/sendEmail.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/updateCommunicationTemplate.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/admin/updateSubjectStatus.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/identity/resolveHandle.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/label/queryLabels.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/moderation/createReport.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/repo/createRecord.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/repo/describeRepo.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/repo/getRecord.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/repo/listRecords.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/repo/putRecord.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/repo/uploadBlob.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/createAccount.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/createAppPassword.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/createInviteCode.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/createInviteCodes.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/createSession.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/describeServer.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/getAccountInviteCodes.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/getSession.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/listAppPasswords.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/refreshSession.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/requestEmailUpdate.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/server/reserveSigningKey.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/sync/getBlob.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/sync/getBlocks.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/sync/getCheckout.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/sync/getHead.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/sync/getLatestCommit.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/sync/getRecord.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/sync/getRepo.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/sync/listBlobs.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/sync/listRepos.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/temp/checkSignupQueue.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/temp/fetchLabels.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/temp/importRepo.d.ts +2 -2
- package/dist/lexicon/types/com/atproto/temp/transferAccount.d.ts +2 -2
- package/dist/services/feed/index.d.ts +2 -1
- package/package.json +8 -7
- package/src/api/app/bsky/actor/getSuggestions.ts +1 -1
- package/src/api/app/bsky/actor/searchActors.ts +1 -0
- package/src/api/app/bsky/feed/getActorFeeds.ts +6 -0
- package/src/api/app/bsky/feed/getActorLikes.ts +4 -0
- package/src/api/app/bsky/feed/getAuthorFeed.ts +16 -4
- package/src/api/app/bsky/feed/getFeed.ts +8 -5
- package/src/api/app/bsky/feed/getLikes.ts +4 -0
- package/src/api/app/bsky/feed/getListFeed.ts +4 -0
- package/src/api/app/bsky/feed/getRepostedBy.ts +4 -0
- package/src/api/app/bsky/feed/getSuggestedFeeds.ts +1 -1
- package/src/api/app/bsky/feed/getTimeline.ts +4 -0
- package/src/api/app/bsky/feed/searchPosts.ts +1 -0
- package/src/api/app/bsky/graph/getBlocks.ts +7 -0
- package/src/api/app/bsky/graph/getFollowers.ts +4 -0
- package/src/api/app/bsky/graph/getFollows.ts +4 -0
- package/src/api/app/bsky/graph/getList.ts +4 -0
- package/src/api/app/bsky/graph/getListBlocks.ts +4 -0
- package/src/api/app/bsky/graph/getListMutes.ts +7 -0
- package/src/api/app/bsky/graph/getLists.ts +7 -0
- package/src/api/app/bsky/graph/getMutes.ts +7 -0
- package/src/api/app/bsky/notification/listNotifications.ts +3 -0
- package/src/api/app/bsky/unspecced/getPopularFeedGenerators.ts +7 -1
- package/src/api/index.ts +0 -6
- package/src/auto-moderator/index.ts +9 -176
- package/src/context.ts +0 -6
- package/src/db/pagination.ts +3 -0
- package/src/index.ts +1 -6
- package/src/indexer/config.ts +0 -29
- package/src/lexicon/index.ts +0 -12
- package/src/lexicon/lexicons.ts +382 -173
- package/src/lexicon/types/app/bsky/actor/defs.ts +2 -0
- package/src/lexicon/types/app/bsky/actor/getPreferences.ts +2 -2
- package/src/lexicon/types/app/bsky/actor/getProfile.ts +3 -2
- package/src/lexicon/types/app/bsky/actor/getProfiles.ts +2 -2
- package/src/lexicon/types/app/bsky/actor/getSuggestions.ts +2 -2
- package/src/lexicon/types/app/bsky/actor/profile.ts +3 -0
- package/src/lexicon/types/app/bsky/actor/putPreferences.ts +1 -1
- package/src/lexicon/types/app/bsky/actor/searchActors.ts +2 -2
- package/src/lexicon/types/app/bsky/actor/searchActorsTypeahead.ts +2 -2
- package/src/lexicon/types/app/bsky/embed/external.ts +1 -0
- package/src/lexicon/types/app/bsky/embed/images.ts +4 -0
- package/src/lexicon/types/app/bsky/embed/record.ts +1 -0
- package/src/lexicon/types/app/bsky/feed/defs.ts +1 -0
- package/src/lexicon/types/app/bsky/feed/describeFeedGenerator.ts +2 -2
- package/src/lexicon/types/app/bsky/feed/getActorFeeds.ts +2 -2
- package/src/lexicon/types/app/bsky/feed/getActorLikes.ts +2 -2
- package/src/lexicon/types/app/bsky/feed/getAuthorFeed.ts +3 -2
- package/src/lexicon/types/app/bsky/feed/getFeed.ts +2 -2
- package/src/lexicon/types/app/bsky/feed/getFeedGenerator.ts +5 -2
- package/src/lexicon/types/app/bsky/feed/getFeedGenerators.ts +2 -2
- package/src/lexicon/types/app/bsky/feed/getFeedSkeleton.ts +3 -2
- package/src/lexicon/types/app/bsky/feed/getLikes.ts +4 -2
- package/src/lexicon/types/app/bsky/feed/getListFeed.ts +3 -2
- package/src/lexicon/types/app/bsky/feed/getPostThread.ts +5 -2
- package/src/lexicon/types/app/bsky/feed/getPosts.ts +3 -2
- package/src/lexicon/types/app/bsky/feed/getRepostedBy.ts +4 -2
- package/src/lexicon/types/app/bsky/feed/getSuggestedFeeds.ts +2 -2
- package/src/lexicon/types/app/bsky/feed/getTimeline.ts +3 -2
- package/src/lexicon/types/app/bsky/feed/post.ts +5 -1
- package/src/lexicon/types/app/bsky/feed/searchPosts.ts +2 -2
- package/src/lexicon/types/app/bsky/feed/threadgate.ts +1 -0
- package/src/lexicon/types/app/bsky/graph/block.ts +1 -0
- package/src/lexicon/types/app/bsky/graph/getBlocks.ts +2 -2
- package/src/lexicon/types/app/bsky/graph/getFollowers.ts +2 -2
- package/src/lexicon/types/app/bsky/graph/getFollows.ts +2 -2
- package/src/lexicon/types/app/bsky/graph/getList.ts +3 -2
- package/src/lexicon/types/app/bsky/graph/getListBlocks.ts +2 -2
- package/src/lexicon/types/app/bsky/graph/getListMutes.ts +2 -2
- package/src/lexicon/types/app/bsky/graph/getLists.ts +3 -2
- package/src/lexicon/types/app/bsky/graph/getMutes.ts +2 -2
- package/src/lexicon/types/app/bsky/graph/getRelationships.ts +4 -2
- package/src/lexicon/types/app/bsky/graph/getSuggestedFollowsByActor.ts +2 -2
- package/src/lexicon/types/app/bsky/graph/list.ts +1 -0
- package/src/lexicon/types/app/bsky/graph/listblock.ts +1 -0
- package/src/lexicon/types/app/bsky/graph/listitem.ts +2 -0
- package/src/lexicon/types/app/bsky/graph/muteActor.ts +1 -1
- package/src/lexicon/types/app/bsky/graph/muteActorList.ts +1 -1
- package/src/lexicon/types/app/bsky/graph/unmuteActor.ts +1 -1
- package/src/lexicon/types/app/bsky/graph/unmuteActorList.ts +1 -1
- package/src/lexicon/types/app/bsky/notification/getUnreadCount.ts +2 -2
- package/src/lexicon/types/app/bsky/notification/listNotifications.ts +2 -2
- package/src/lexicon/types/app/bsky/notification/registerPush.ts +1 -1
- package/src/lexicon/types/app/bsky/notification/updateSeen.ts +1 -1
- package/src/lexicon/types/app/bsky/richtext/facet.ts +5 -4
- package/src/lexicon/types/app/bsky/unspecced/getPopularFeedGenerators.ts +2 -2
- package/src/lexicon/types/app/bsky/unspecced/getTaggedSuggestions.ts +2 -2
- package/src/lexicon/types/app/bsky/unspecced/searchActorsSkeleton.ts +2 -2
- package/src/lexicon/types/app/bsky/unspecced/searchPostsSkeleton.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/createCommunicationTemplate.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/defs.ts +2 -0
- package/src/lexicon/types/com/atproto/admin/deleteAccount.ts +1 -1
- package/src/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.ts +1 -1
- package/src/lexicon/types/com/atproto/admin/disableAccountInvites.ts +1 -1
- package/src/lexicon/types/com/atproto/admin/disableInviteCodes.ts +1 -1
- package/src/lexicon/types/com/atproto/admin/emitModerationEvent.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/enableAccountInvites.ts +1 -1
- package/src/lexicon/types/com/atproto/admin/getAccountInfo.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/getAccountInfos.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/getInviteCodes.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/getModerationEvent.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/getRecord.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/getRepo.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/getSubjectStatus.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/listCommunicationTemplates.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/queryModerationEvents.ts +15 -2
- package/src/lexicon/types/com/atproto/admin/queryModerationStatuses.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/searchRepos.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/sendEmail.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/updateAccountEmail.ts +1 -1
- package/src/lexicon/types/com/atproto/admin/updateAccountHandle.ts +1 -1
- package/src/lexicon/types/com/atproto/admin/updateCommunicationTemplate.ts +2 -2
- package/src/lexicon/types/com/atproto/admin/updateSubjectStatus.ts +2 -2
- package/src/lexicon/types/com/atproto/identity/resolveHandle.ts +2 -2
- package/src/lexicon/types/com/atproto/identity/updateHandle.ts +2 -1
- package/src/lexicon/types/com/atproto/label/queryLabels.ts +2 -2
- package/src/lexicon/types/com/atproto/label/subscribeLabels.ts +1 -1
- package/src/lexicon/types/com/atproto/moderation/createReport.ts +3 -2
- package/src/lexicon/types/com/atproto/repo/applyWrites.ts +7 -6
- package/src/lexicon/types/com/atproto/repo/createRecord.ts +6 -6
- package/src/lexicon/types/com/atproto/repo/deleteRecord.ts +3 -3
- package/src/lexicon/types/com/atproto/repo/describeRepo.ts +5 -2
- package/src/lexicon/types/com/atproto/repo/getRecord.ts +3 -3
- package/src/lexicon/types/com/atproto/repo/listRecords.ts +2 -2
- package/src/lexicon/types/com/atproto/repo/putRecord.ts +6 -6
- package/src/lexicon/types/com/atproto/repo/uploadBlob.ts +2 -2
- package/src/lexicon/types/com/atproto/server/confirmEmail.ts +1 -1
- package/src/lexicon/types/com/atproto/server/createAccount.ts +10 -2
- package/src/lexicon/types/com/atproto/server/createAppPassword.ts +3 -2
- package/src/lexicon/types/com/atproto/server/createInviteCode.ts +2 -2
- package/src/lexicon/types/com/atproto/server/createInviteCodes.ts +2 -2
- package/src/lexicon/types/com/atproto/server/createSession.ts +2 -2
- package/src/lexicon/types/com/atproto/server/deleteAccount.ts +1 -1
- package/src/lexicon/types/com/atproto/server/deleteSession.ts +1 -1
- package/src/lexicon/types/com/atproto/server/describeServer.ts +5 -2
- package/src/lexicon/types/com/atproto/server/getAccountInviteCodes.ts +3 -2
- package/src/lexicon/types/com/atproto/server/getSession.ts +2 -2
- package/src/lexicon/types/com/atproto/server/listAppPasswords.ts +2 -2
- package/src/lexicon/types/com/atproto/server/refreshSession.ts +2 -2
- package/src/lexicon/types/com/atproto/server/requestAccountDelete.ts +1 -1
- package/src/lexicon/types/com/atproto/server/requestEmailConfirmation.ts +1 -1
- package/src/lexicon/types/com/atproto/server/requestEmailUpdate.ts +2 -2
- package/src/lexicon/types/com/atproto/server/requestPasswordReset.ts +1 -1
- package/src/lexicon/types/com/atproto/server/reserveSigningKey.ts +4 -4
- package/src/lexicon/types/com/atproto/server/resetPassword.ts +1 -1
- package/src/lexicon/types/com/atproto/server/revokeAppPassword.ts +1 -1
- package/src/lexicon/types/com/atproto/server/updateEmail.ts +1 -1
- package/src/lexicon/types/com/atproto/sync/getBlob.ts +3 -3
- package/src/lexicon/types/com/atproto/sync/getBlocks.ts +2 -2
- package/src/lexicon/types/com/atproto/sync/getCheckout.ts +2 -2
- package/src/lexicon/types/com/atproto/sync/getHead.ts +2 -2
- package/src/lexicon/types/com/atproto/sync/getLatestCommit.ts +2 -2
- package/src/lexicon/types/com/atproto/sync/getRecord.ts +3 -2
- package/src/lexicon/types/com/atproto/sync/getRepo.ts +3 -3
- package/src/lexicon/types/com/atproto/sync/listBlobs.ts +2 -2
- package/src/lexicon/types/com/atproto/sync/listRepos.ts +3 -2
- package/src/lexicon/types/com/atproto/sync/notifyOfUpdate.ts +2 -2
- package/src/lexicon/types/com/atproto/sync/requestCrawl.ts +2 -2
- package/src/lexicon/types/com/atproto/sync/subscribeRepos.ts +17 -5
- package/src/lexicon/types/com/atproto/temp/checkSignupQueue.ts +2 -2
- package/src/lexicon/types/com/atproto/temp/fetchLabels.ts +2 -2
- package/src/lexicon/types/com/atproto/temp/importRepo.ts +2 -2
- package/src/lexicon/types/com/atproto/temp/pushBlob.ts +1 -1
- package/src/lexicon/types/com/atproto/temp/requestPhoneVerification.ts +1 -1
- package/src/lexicon/types/com/atproto/temp/transferAccount.ts +2 -2
- package/src/logger.ts +32 -0
- package/src/services/feed/index.ts +10 -4
- package/src/services/feed/views.ts +3 -1
- package/tests/auto-moderator/labeler.test.ts +2 -0
- package/tests/feed-generation.test.ts +0 -6
- package/tests/views/author-feed.test.ts +29 -9
- package/tests/views/notifications.test.ts +9 -0
- package/tests/views/timeline.test.ts +8 -0
- package/dist/api/app/bsky/feed/describeFeedGenerator.d.ts +0 -3
- package/dist/api/app/bsky/feed/getFeedSkeleton.d.ts +0 -3
- package/dist/api/app/bsky/unspecced/getTimelineSkeleton.d.ts +0 -3
- package/dist/auto-moderator/abyss.d.ts +0 -48
- package/dist/auto-moderator/fuzzy-matcher.d.ts +0 -14
- package/dist/feed-gen/bsky-team.d.ts +0 -3
- package/dist/feed-gen/hot-classic.d.ts +0 -3
- package/dist/feed-gen/index.d.ts +0 -2
- package/dist/feed-gen/mutuals.d.ts +0 -3
- package/dist/feed-gen/types.d.ts +0 -15
- package/dist/lexicon/types/app/bsky/unspecced/getTimelineSkeleton.d.ts +0 -35
- package/src/api/app/bsky/feed/describeFeedGenerator.ts +0 -21
- package/src/api/app/bsky/feed/getFeedSkeleton.ts +0 -30
- package/src/api/app/bsky/unspecced/getTimelineSkeleton.ts +0 -26
- package/src/auto-moderator/abyss.ts +0 -114
- package/src/auto-moderator/fuzzy-matcher.ts +0 -126
- package/src/feed-gen/bsky-team.ts +0 -42
- package/src/feed-gen/hot-classic.ts +0 -55
- package/src/feed-gen/index.ts +0 -17
- package/src/feed-gen/mutuals.ts +0 -57
- package/src/feed-gen/types.ts +0 -32
- package/src/lexicon/types/app/bsky/unspecced/getTimelineSkeleton.ts +0 -49
- package/tests/algos/hot-classic.test.ts +0 -87
- package/tests/auto-moderator/fuzzy-matcher.test.ts +0 -163
- package/tests/auto-moderator/takedowns.test.ts +0 -202
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
2
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
3
3
|
export interface QueryParams {
|
|
4
4
|
}
|
|
5
5
|
export interface InputSchema {
|
|
@@ -25,7 +25,7 @@ export interface HandlerError {
|
|
|
25
25
|
status: number;
|
|
26
26
|
message?: string;
|
|
27
27
|
}
|
|
28
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
28
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
29
29
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
30
30
|
auth: HA;
|
|
31
31
|
params: QueryParams;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import stream from 'stream';
|
|
4
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
4
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
5
5
|
export interface QueryParams {
|
|
6
6
|
did: string;
|
|
7
7
|
cid: string;
|
|
@@ -19,7 +19,7 @@ export interface HandlerError {
|
|
|
19
19
|
status: number;
|
|
20
20
|
message?: string;
|
|
21
21
|
}
|
|
22
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
22
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
23
23
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
24
24
|
auth: HA;
|
|
25
25
|
params: QueryParams;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import stream from 'stream';
|
|
4
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
4
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
5
5
|
export interface QueryParams {
|
|
6
6
|
did: string;
|
|
7
7
|
cids: string[];
|
|
@@ -19,7 +19,7 @@ export interface HandlerError {
|
|
|
19
19
|
status: number;
|
|
20
20
|
message?: string;
|
|
21
21
|
}
|
|
22
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
22
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
23
23
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
24
24
|
auth: HA;
|
|
25
25
|
params: QueryParams;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import stream from 'stream';
|
|
4
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
4
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
5
5
|
export interface QueryParams {
|
|
6
6
|
did: string;
|
|
7
7
|
}
|
|
@@ -18,7 +18,7 @@ export interface HandlerError {
|
|
|
18
18
|
status: number;
|
|
19
19
|
message?: string;
|
|
20
20
|
}
|
|
21
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
21
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
22
22
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
23
23
|
auth: HA;
|
|
24
24
|
params: QueryParams;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
2
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
3
3
|
export interface QueryParams {
|
|
4
4
|
did: string;
|
|
5
5
|
}
|
|
@@ -21,7 +21,7 @@ export interface HandlerError {
|
|
|
21
21
|
message?: string;
|
|
22
22
|
error?: 'HeadNotFound';
|
|
23
23
|
}
|
|
24
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
24
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
25
25
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
26
26
|
auth: HA;
|
|
27
27
|
params: QueryParams;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
2
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
3
3
|
export interface QueryParams {
|
|
4
4
|
did: string;
|
|
5
5
|
}
|
|
@@ -22,7 +22,7 @@ export interface HandlerError {
|
|
|
22
22
|
message?: string;
|
|
23
23
|
error?: 'RepoNotFound';
|
|
24
24
|
}
|
|
25
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
25
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
26
26
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
27
27
|
auth: HA;
|
|
28
28
|
params: QueryParams;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import stream from 'stream';
|
|
4
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
4
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
5
5
|
export interface QueryParams {
|
|
6
6
|
did: string;
|
|
7
7
|
collection: string;
|
|
@@ -21,7 +21,7 @@ export interface HandlerError {
|
|
|
21
21
|
status: number;
|
|
22
22
|
message?: string;
|
|
23
23
|
}
|
|
24
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
24
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
25
25
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
26
26
|
auth: HA;
|
|
27
27
|
params: QueryParams;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import stream from 'stream';
|
|
4
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
4
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
5
5
|
export interface QueryParams {
|
|
6
6
|
did: string;
|
|
7
7
|
since?: string;
|
|
@@ -19,7 +19,7 @@ export interface HandlerError {
|
|
|
19
19
|
status: number;
|
|
20
20
|
message?: string;
|
|
21
21
|
}
|
|
22
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
22
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
23
23
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
24
24
|
auth: HA;
|
|
25
25
|
params: QueryParams;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
2
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
3
3
|
export interface QueryParams {
|
|
4
4
|
did: string;
|
|
5
5
|
since?: string;
|
|
@@ -24,7 +24,7 @@ export interface HandlerError {
|
|
|
24
24
|
status: number;
|
|
25
25
|
message?: string;
|
|
26
26
|
}
|
|
27
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
27
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
28
28
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
29
29
|
auth: HA;
|
|
30
30
|
params: QueryParams;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import { ValidationResult } from '@atproto/lexicon';
|
|
3
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
3
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
4
4
|
export interface QueryParams {
|
|
5
5
|
limit: number;
|
|
6
6
|
cursor?: string;
|
|
@@ -23,7 +23,7 @@ export interface HandlerError {
|
|
|
23
23
|
status: number;
|
|
24
24
|
message?: string;
|
|
25
25
|
}
|
|
26
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
26
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
27
27
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
28
28
|
auth: HA;
|
|
29
29
|
params: QueryParams;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
2
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
3
3
|
export interface QueryParams {
|
|
4
4
|
}
|
|
5
5
|
export type InputSchema = undefined;
|
|
@@ -21,7 +21,7 @@ export interface HandlerError {
|
|
|
21
21
|
status: number;
|
|
22
22
|
message?: string;
|
|
23
23
|
}
|
|
24
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
24
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
25
25
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
26
26
|
auth: HA;
|
|
27
27
|
params: QueryParams;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
2
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
3
3
|
import * as ComAtprotoLabelDefs from '../label/defs';
|
|
4
4
|
export interface QueryParams {
|
|
5
5
|
since?: number;
|
|
@@ -22,7 +22,7 @@ export interface HandlerError {
|
|
|
22
22
|
status: number;
|
|
23
23
|
message?: string;
|
|
24
24
|
}
|
|
25
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
25
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
26
26
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
27
27
|
auth: HA;
|
|
28
28
|
params: QueryParams;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import express from 'express';
|
|
3
3
|
import stream from 'stream';
|
|
4
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
4
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
5
5
|
export interface QueryParams {
|
|
6
6
|
did: string;
|
|
7
7
|
}
|
|
@@ -21,7 +21,7 @@ export interface HandlerError {
|
|
|
21
21
|
status: number;
|
|
22
22
|
message?: string;
|
|
23
23
|
}
|
|
24
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
24
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
25
25
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
26
26
|
auth: HA;
|
|
27
27
|
params: QueryParams;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
|
2
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
|
3
3
|
export interface QueryParams {
|
|
4
4
|
}
|
|
5
5
|
export interface InputSchema {
|
|
@@ -31,7 +31,7 @@ export interface HandlerError {
|
|
|
31
31
|
message?: string;
|
|
32
32
|
error?: 'InvalidHandle' | 'InvalidPassword' | 'InvalidInviteCode' | 'HandleNotAvailable' | 'UnsupportedDomain' | 'UnresolvableDid' | 'IncompatibleDidDoc';
|
|
33
33
|
}
|
|
34
|
-
export type HandlerOutput = HandlerError | HandlerSuccess;
|
|
34
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
|
35
35
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
36
36
|
auth: HA;
|
|
37
37
|
params: QueryParams;
|
|
@@ -44,7 +44,7 @@ export declare class FeedService {
|
|
|
44
44
|
feedDid: string;
|
|
45
45
|
descriptionFacets: string | null;
|
|
46
46
|
} & import("kysely").Selection<import("kysely/dist/cjs/parser/table-parser").From<import("../../db/database-schema").DatabaseSchemaType, "feed_generator">, "record" | "feed_generator" | "actor", (qb: import("kysely").ExpressionBuilder<import("kysely/dist/cjs/parser/table-parser").From<import("../../db/database-schema").DatabaseSchemaType, "feed_generator">, "record" | "feed_generator" | "actor">) => import("kysely").AliasedQueryBuilder<import("kysely/dist/cjs/parser/table-parser").From<import("kysely/dist/cjs/parser/table-parser").From<import("../../db/database-schema").DatabaseSchemaType, "feed_generator">, "like">, import("kysely/dist/cjs/parser/table-parser").FromTables<import("kysely/dist/cjs/parser/table-parser").From<import("../../db/database-schema").DatabaseSchemaType, "feed_generator">, "record" | "feed_generator" | "actor", "like">, import("kysely").Selection<import("kysely/dist/cjs/parser/table-parser").From<import("kysely/dist/cjs/parser/table-parser").From<import("../../db/database-schema").DatabaseSchemaType, "feed_generator">, "like">, import("kysely/dist/cjs/parser/table-parser").FromTables<import("kysely/dist/cjs/parser/table-parser").From<import("../../db/database-schema").DatabaseSchemaType, "feed_generator">, "record" | "feed_generator" | "actor", "like">, import("kysely").AliasedRawBuilder<number, "count">>, "likeCount">>, (qb: import("kysely").ExpressionBuilder<import("kysely/dist/cjs/parser/table-parser").From<import("../../db/database-schema").DatabaseSchemaType, "feed_generator">, "record" | "feed_generator" | "actor">) => import("kysely").AliasedQueryBuilder<import("kysely/dist/cjs/parser/table-parser").From<import("kysely/dist/cjs/parser/table-parser").From<import("../../db/database-schema").DatabaseSchemaType, "feed_generator">, "like">, import("kysely/dist/cjs/parser/table-parser").FromTables<import("kysely/dist/cjs/parser/table-parser").From<import("../../db/database-schema").DatabaseSchemaType, "feed_generator">, "record" | "feed_generator" | "actor", "like">, Partial<Omit<{}, never>> & import("kysely").Selection<import("kysely/dist/cjs/parser/table-parser").From<import("kysely/dist/cjs/parser/table-parser").From<import("../../db/database-schema").DatabaseSchemaType, "feed_generator">, "like">, import("kysely/dist/cjs/parser/table-parser").FromTables<import("kysely/dist/cjs/parser/table-parser").From<import("../../db/database-schema").DatabaseSchemaType, "feed_generator">, "record" | "feed_generator" | "actor", "like">, "uri">, "viewerLike">>;
|
|
47
|
-
getPostInfos(postUris: string[], viewer: string | null): Promise<PostInfoMap>;
|
|
47
|
+
getPostInfos(postUris: string[], viewer: string | null, includeSoftDeleted?: boolean): Promise<PostInfoMap>;
|
|
48
48
|
getFeedGeneratorInfos(generatorUris: string[], viewer: string | null): Promise<FeedGenInfoMap>;
|
|
49
49
|
getFeedItems(uris: string[]): Promise<Record<string, FeedRow>>;
|
|
50
50
|
postUrisToFeedItems(uris: string[]): Promise<FeedRow[]>;
|
|
@@ -56,6 +56,7 @@ export declare class FeedService {
|
|
|
56
56
|
dids: Set<string>;
|
|
57
57
|
uris: Set<string>;
|
|
58
58
|
viewer: string | null;
|
|
59
|
+
includeSoftDeleted?: boolean;
|
|
59
60
|
}, depth?: number): Promise<FeedHydrationState>;
|
|
60
61
|
blocksForPosts(posts: PostInfoMap, bam?: BlockAndMuteState): Promise<PostBlocksMap>;
|
|
61
62
|
embedsForPosts(postInfos: PostInfoMap, blocks: PostBlocksMap, viewer: string | null, depth: number): Promise<PostEmbedViews>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/bsky",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.30",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Reference implementation of app.bsky App View (Bluesky API)",
|
|
6
6
|
"keywords": [
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"http-errors": "^2.0.0",
|
|
30
30
|
"http-terminator": "^3.2.0",
|
|
31
31
|
"ioredis": "^5.3.2",
|
|
32
|
+
"jose": "^5.0.1",
|
|
32
33
|
"kysely": "^0.22.0",
|
|
33
34
|
"multiformats": "^9.9.0",
|
|
34
35
|
"murmurhash": "^2.0.1",
|
|
@@ -39,12 +40,12 @@
|
|
|
39
40
|
"sharp": "^0.32.6",
|
|
40
41
|
"typed-emitter": "^2.1.0",
|
|
41
42
|
"uint8arrays": "3.0.0",
|
|
42
|
-
"@atproto/api": "^0.9.
|
|
43
|
+
"@atproto/api": "^0.9.7",
|
|
43
44
|
"@atproto/common": "^0.3.3",
|
|
44
45
|
"@atproto/crypto": "^0.3.0",
|
|
45
|
-
"@atproto/lexicon": "^0.3.1",
|
|
46
46
|
"@atproto/identity": "^0.3.2",
|
|
47
|
-
"@atproto/
|
|
47
|
+
"@atproto/lexicon": "^0.3.1",
|
|
48
|
+
"@atproto/repo": "^0.3.7",
|
|
48
49
|
"@atproto/syntax": "^0.1.5",
|
|
49
50
|
"@atproto/xrpc-server": "^0.4.2"
|
|
50
51
|
},
|
|
@@ -59,10 +60,10 @@
|
|
|
59
60
|
"@types/pg": "^8.6.6",
|
|
60
61
|
"@types/qs": "^6.9.7",
|
|
61
62
|
"axios": "^0.27.2",
|
|
62
|
-
"@atproto/api": "^0.9.
|
|
63
|
-
"@atproto/dev-env": "^0.2.
|
|
63
|
+
"@atproto/api": "^0.9.7",
|
|
64
|
+
"@atproto/dev-env": "^0.2.30",
|
|
64
65
|
"@atproto/lex-cli": "^0.3.0",
|
|
65
|
-
"@atproto/pds": "^0.3.
|
|
66
|
+
"@atproto/pds": "^0.3.18",
|
|
66
67
|
"@atproto/xrpc": "^0.4.1"
|
|
67
68
|
},
|
|
68
69
|
"scripts": {
|
|
@@ -43,7 +43,7 @@ const skeleton = async (
|
|
|
43
43
|
): Promise<SkeletonState> => {
|
|
44
44
|
const { db } = ctx
|
|
45
45
|
const { viewer } = params
|
|
46
|
-
const alreadyIncluded = parseCursor(params.cursor)
|
|
46
|
+
const alreadyIncluded = parseCursor(params.cursor) // @NOTE handles bad cursor e.g. on appview swap
|
|
47
47
|
const { ref } = db.db.dynamic
|
|
48
48
|
const suggestions = await db.db
|
|
49
49
|
.selectFrom('suggested_follow')
|
|
@@ -15,6 +15,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
15
15
|
let results: string[]
|
|
16
16
|
let resCursor: string | undefined
|
|
17
17
|
if (ctx.searchAgent) {
|
|
18
|
+
// @NOTE cursors wont change on appview swap
|
|
18
19
|
const res =
|
|
19
20
|
await ctx.searchAgent.api.app.bsky.unspecced.searchActorsSkeleton({
|
|
20
21
|
q: query,
|
|
@@ -10,6 +10,12 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
10
10
|
handler: async ({ auth, params }) => {
|
|
11
11
|
const { actor, limit, cursor } = params
|
|
12
12
|
const viewer = auth.credentials.iss
|
|
13
|
+
if (TimeCidKeyset.clearlyBad(cursor)) {
|
|
14
|
+
return {
|
|
15
|
+
encoding: 'application/json',
|
|
16
|
+
body: { feeds: [] },
|
|
17
|
+
}
|
|
18
|
+
}
|
|
13
19
|
|
|
14
20
|
const db = ctx.db.getReplica()
|
|
15
21
|
const actorService = ctx.services.actor(db)
|
|
@@ -67,6 +67,10 @@ const skeleton = async (
|
|
|
67
67
|
throw new InvalidRequestError('Profile not found')
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
if (FeedKeyset.clearlyBad(cursor)) {
|
|
71
|
+
return { params, feedItems: [] }
|
|
72
|
+
}
|
|
73
|
+
|
|
70
74
|
let feedItemsQb = feedService
|
|
71
75
|
.selectFeedItemQb()
|
|
72
76
|
.innerJoin('like', 'like.subject', 'feed_item.uri')
|
|
@@ -33,7 +33,11 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
33
33
|
|
|
34
34
|
const [result, repoRev] = await Promise.all([
|
|
35
35
|
getAuthorFeed(
|
|
36
|
-
{
|
|
36
|
+
{
|
|
37
|
+
...params,
|
|
38
|
+
includeSoftDeleted: auth.credentials.type === 'role',
|
|
39
|
+
viewer,
|
|
40
|
+
},
|
|
37
41
|
{ db, actorService, feedService, graphService },
|
|
38
42
|
),
|
|
39
43
|
actorService.getRepoRev(viewer),
|
|
@@ -53,12 +57,12 @@ export const skeleton = async (
|
|
|
53
57
|
params: Params,
|
|
54
58
|
ctx: Context,
|
|
55
59
|
): Promise<SkeletonState> => {
|
|
56
|
-
const { cursor, limit, actor, filter, viewer } = params
|
|
60
|
+
const { cursor, limit, actor, filter, viewer, includeSoftDeleted } = params
|
|
57
61
|
const { db, actorService, feedService, graphService } = ctx
|
|
58
62
|
const { ref } = db.db.dynamic
|
|
59
63
|
|
|
60
64
|
// maybe resolve did first
|
|
61
|
-
const actorRes = await actorService.getActor(actor)
|
|
65
|
+
const actorRes = await actorService.getActor(actor, includeSoftDeleted)
|
|
62
66
|
if (!actorRes) {
|
|
63
67
|
throw new InvalidRequestError('Profile not found')
|
|
64
68
|
}
|
|
@@ -81,6 +85,10 @@ export const skeleton = async (
|
|
|
81
85
|
}
|
|
82
86
|
}
|
|
83
87
|
|
|
88
|
+
if (FeedKeyset.clearlyBad(cursor)) {
|
|
89
|
+
return { params, feedItems: [] }
|
|
90
|
+
}
|
|
91
|
+
|
|
84
92
|
// defaults to posts, reposts, and replies
|
|
85
93
|
let feedItemsQb = feedService
|
|
86
94
|
.selectFeedItemQb()
|
|
@@ -134,6 +142,7 @@ const hydration = async (state: SkeletonState, ctx: Context) => {
|
|
|
134
142
|
const hydrated = await feedService.feedHydration({
|
|
135
143
|
...refs,
|
|
136
144
|
viewer: params.viewer,
|
|
145
|
+
includeSoftDeleted: params.includeSoftDeleted,
|
|
137
146
|
})
|
|
138
147
|
return { ...state, ...hydrated }
|
|
139
148
|
}
|
|
@@ -164,7 +173,10 @@ type Context = {
|
|
|
164
173
|
graphService: GraphService
|
|
165
174
|
}
|
|
166
175
|
|
|
167
|
-
type Params = QueryParams & {
|
|
176
|
+
type Params = QueryParams & {
|
|
177
|
+
viewer: string | null
|
|
178
|
+
includeSoftDeleted: boolean
|
|
179
|
+
}
|
|
168
180
|
|
|
169
181
|
type SkeletonState = {
|
|
170
182
|
params: Params
|
|
@@ -17,7 +17,6 @@ import { OutputSchema as SkeletonOutput } from '../../../../lexicon/types/app/bs
|
|
|
17
17
|
import { SkeletonFeedPost } from '../../../../lexicon/types/app/bsky/feed/defs'
|
|
18
18
|
import { Server } from '../../../../lexicon'
|
|
19
19
|
import AppContext from '../../../../context'
|
|
20
|
-
import { AlgoResponse } from '../../../../feed-gen/types'
|
|
21
20
|
import { Database } from '../../../../db'
|
|
22
21
|
import {
|
|
23
22
|
FeedHydrationState,
|
|
@@ -43,6 +42,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
43
42
|
authorization: req.headers['authorization'],
|
|
44
43
|
'accept-language': req.headers['accept-language'],
|
|
45
44
|
})
|
|
45
|
+
// @NOTE feed cursors should not be affected by appview swap
|
|
46
46
|
const { timerSkele, timerHydr, resHeaders, ...result } = await getFeed(
|
|
47
47
|
{ ...params, viewer },
|
|
48
48
|
{
|
|
@@ -70,16 +70,13 @@ const skeleton = async (
|
|
|
70
70
|
ctx: Context,
|
|
71
71
|
): Promise<SkeletonState> => {
|
|
72
72
|
const timerSkele = new ServerTimer('skele').start()
|
|
73
|
-
const localAlgo = ctx.appCtx.algos[params.feed]
|
|
74
73
|
const feedParams: GetFeedParams = {
|
|
75
74
|
feed: params.feed,
|
|
76
75
|
limit: params.limit,
|
|
77
76
|
cursor: params.cursor,
|
|
78
77
|
}
|
|
79
78
|
const { feedItems, cursor, resHeaders, ...passthrough } =
|
|
80
|
-
|
|
81
|
-
? await localAlgo(ctx.appCtx, params, params.viewer)
|
|
82
|
-
: await skeletonFromFeedGen(ctx, feedParams)
|
|
79
|
+
await skeletonFromFeedGen(ctx, feedParams)
|
|
83
80
|
return {
|
|
84
81
|
params,
|
|
85
82
|
cursor,
|
|
@@ -151,6 +148,12 @@ type SkeletonState = {
|
|
|
151
148
|
type HydrationState = SkeletonState &
|
|
152
149
|
FeedHydrationState & { feedItems: FeedRow[]; timerHydr: ServerTimer }
|
|
153
150
|
|
|
151
|
+
type AlgoResponse = {
|
|
152
|
+
feedItems: FeedRow[]
|
|
153
|
+
resHeaders?: Record<string, string>
|
|
154
|
+
cursor?: string
|
|
155
|
+
}
|
|
156
|
+
|
|
154
157
|
const skeletonFromFeedGen = async (
|
|
155
158
|
ctx: Context,
|
|
156
159
|
params: GetFeedParams,
|
|
@@ -41,6 +41,10 @@ const skeleton = async (
|
|
|
41
41
|
const { uri, cid, limit, cursor } = params
|
|
42
42
|
const { ref } = db.db.dynamic
|
|
43
43
|
|
|
44
|
+
if (TimeCidKeyset.clearlyBad(cursor)) {
|
|
45
|
+
return { params, likes: [] }
|
|
46
|
+
}
|
|
47
|
+
|
|
44
48
|
let builder = db.db
|
|
45
49
|
.selectFrom('like')
|
|
46
50
|
.where('like.subject', '=', uri)
|
|
@@ -56,6 +56,10 @@ export const skeleton = async (
|
|
|
56
56
|
const { db } = ctx
|
|
57
57
|
const { ref } = db.db.dynamic
|
|
58
58
|
|
|
59
|
+
if (FeedKeyset.clearlyBad(cursor)) {
|
|
60
|
+
return { params, feedItems: [] }
|
|
61
|
+
}
|
|
62
|
+
|
|
59
63
|
const keyset = new FeedKeyset(ref('post.sortAt'), ref('post.cid'))
|
|
60
64
|
const sortFrom = keyset.unpack(cursor)?.primary
|
|
61
65
|
|
|
@@ -46,6 +46,10 @@ const skeleton = async (
|
|
|
46
46
|
const { limit, cursor, uri, cid } = params
|
|
47
47
|
const { ref } = db.db.dynamic
|
|
48
48
|
|
|
49
|
+
if (TimeCidKeyset.clearlyBad(cursor)) {
|
|
50
|
+
return { params, repostedBy: [] }
|
|
51
|
+
}
|
|
52
|
+
|
|
49
53
|
let builder = db.db
|
|
50
54
|
.selectFrom('repost')
|
|
51
55
|
.where('repost.subject', '=', uri)
|
|
@@ -6,8 +6,8 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
6
6
|
server.app.bsky.feed.getSuggestedFeeds({
|
|
7
7
|
auth: ctx.authVerifier.standardOptional,
|
|
8
8
|
handler: async ({ auth }) => {
|
|
9
|
+
// @NOTE ignores cursor, doesn't matter for appview swap
|
|
9
10
|
const viewer = auth.credentials.iss
|
|
10
|
-
|
|
11
11
|
const db = ctx.db.getReplica()
|
|
12
12
|
const feedService = ctx.services.feed(db)
|
|
13
13
|
const actorService = ctx.services.actor(db)
|
|
@@ -61,6 +61,10 @@ export const skeleton = async (
|
|
|
61
61
|
return skeletonLimit1(params, ctx)
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
if (FeedKeyset.clearlyBad(cursor)) {
|
|
65
|
+
return { params, feedItems: [] }
|
|
66
|
+
}
|
|
67
|
+
|
|
64
68
|
const keyset = new FeedKeyset(ref('feed_item.sortAt'), ref('feed_item.cid'))
|
|
65
69
|
const sortFrom = keyset.unpack(cursor)?.primary
|
|
66
70
|
|
|
@@ -49,6 +49,7 @@ const skeleton = async (
|
|
|
49
49
|
params: Params,
|
|
50
50
|
ctx: Context,
|
|
51
51
|
): Promise<SkeletonState> => {
|
|
52
|
+
// @NOTE cursors wont change on appview swap
|
|
52
53
|
const res = await ctx.searchAgent.api.app.bsky.unspecced.searchPostsSkeleton({
|
|
53
54
|
q: params.q,
|
|
54
55
|
cursor: params.cursor,
|
|
@@ -9,6 +9,13 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
9
9
|
handler: async ({ params, auth }) => {
|
|
10
10
|
const { limit, cursor } = params
|
|
11
11
|
const requester = auth.credentials.iss
|
|
12
|
+
if (TimeCidKeyset.clearlyBad(cursor)) {
|
|
13
|
+
return {
|
|
14
|
+
encoding: 'application/json',
|
|
15
|
+
body: { blocks: [] },
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
12
19
|
const db = ctx.db.getReplica()
|
|
13
20
|
const { ref } = db.db.dynamic
|
|
14
21
|
|
|
@@ -52,6 +52,10 @@ const skeleton = async (
|
|
|
52
52
|
throw new InvalidRequestError(`Actor not found: ${actor}`)
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
if (TimeCidKeyset.clearlyBad(cursor)) {
|
|
56
|
+
return { params, followers: [], subject }
|
|
57
|
+
}
|
|
58
|
+
|
|
55
59
|
let followersReq = db.db
|
|
56
60
|
.selectFrom('follow')
|
|
57
61
|
.where('follow.subjectDid', '=', subject.did)
|
|
@@ -52,6 +52,10 @@ const skeleton = async (
|
|
|
52
52
|
throw new InvalidRequestError(`Actor not found: ${actor}`)
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
if (TimeCidKeyset.clearlyBad(cursor)) {
|
|
56
|
+
return { params, follows: [], creator }
|
|
57
|
+
}
|
|
58
|
+
|
|
55
59
|
let followsReq = db.db
|
|
56
60
|
.selectFrom('follow')
|
|
57
61
|
.where('follow.creator', '=', creator.did)
|
|
@@ -49,6 +49,10 @@ const skeleton = async (
|
|
|
49
49
|
throw new InvalidRequestError(`List not found: ${list}`)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
if (TimeCidKeyset.clearlyBad(cursor)) {
|
|
53
|
+
return { params, list: listRes, listItems: [] }
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
let itemsReq = graphService
|
|
53
57
|
.getListItemsQb()
|
|
54
58
|
.where('list_item.listUri', '=', list)
|
|
@@ -45,6 +45,10 @@ const skeleton = async (
|
|
|
45
45
|
const { limit, cursor, viewer } = params
|
|
46
46
|
const { ref } = db.db.dynamic
|
|
47
47
|
|
|
48
|
+
if (TimeCidKeyset.clearlyBad(cursor)) {
|
|
49
|
+
return { params, listInfos: [] }
|
|
50
|
+
}
|
|
51
|
+
|
|
48
52
|
let listsReq = graphService
|
|
49
53
|
.getListsQb(viewer)
|
|
50
54
|
.whereExists(
|
|
@@ -9,6 +9,13 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
9
9
|
handler: async ({ params, auth }) => {
|
|
10
10
|
const { limit, cursor } = params
|
|
11
11
|
const requester = auth.credentials.iss
|
|
12
|
+
if (TimeCidKeyset.clearlyBad(cursor)) {
|
|
13
|
+
return {
|
|
14
|
+
encoding: 'application/json',
|
|
15
|
+
body: { lists: [] },
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
12
19
|
const db = ctx.db.getReplica()
|
|
13
20
|
const { ref } = db.db.dynamic
|
|
14
21
|
|
|
@@ -10,6 +10,13 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
10
10
|
handler: async ({ params, auth }) => {
|
|
11
11
|
const { actor, limit, cursor } = params
|
|
12
12
|
const requester = auth.credentials.iss
|
|
13
|
+
if (TimeCidKeyset.clearlyBad(cursor)) {
|
|
14
|
+
return {
|
|
15
|
+
encoding: 'application/json',
|
|
16
|
+
body: { lists: [] },
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
13
20
|
const db = ctx.db.getReplica()
|
|
14
21
|
const { ref } = db.db.dynamic
|
|
15
22
|
|
|
@@ -9,6 +9,13 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
9
9
|
handler: async ({ params, auth }) => {
|
|
10
10
|
const { limit, cursor } = params
|
|
11
11
|
const requester = auth.credentials.iss
|
|
12
|
+
if (TimeCidKeyset.clearlyBad(cursor)) {
|
|
13
|
+
return {
|
|
14
|
+
encoding: 'application/json',
|
|
15
|
+
body: { mutes: [] },
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
12
19
|
const db = ctx.db.getReplica()
|
|
13
20
|
const { ref } = db.db.dynamic
|
|
14
21
|
|
|
@@ -51,6 +51,9 @@ const skeleton = async (
|
|
|
51
51
|
if (params.seenAt) {
|
|
52
52
|
throw new InvalidRequestError('The seenAt parameter is unsupported')
|
|
53
53
|
}
|
|
54
|
+
if (NotifsKeyset.clearlyBad(cursor)) {
|
|
55
|
+
return { params, notifs: [] }
|
|
56
|
+
}
|
|
54
57
|
let notifBuilder = db.db
|
|
55
58
|
.selectFrom('notification as notif')
|
|
56
59
|
.where('notif.did', '=', viewer)
|