@atproto/bsky 0.0.251 → 0.0.253
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 +35 -0
- package/dist/api/age-assurance/const.js +19 -19
- package/dist/api/age-assurance/const.js.map +1 -1
- package/dist/kws.d.ts +8 -0
- package/dist/kws.d.ts.map +1 -1
- package/dist/kws.js +53 -4
- package/dist/kws.js.map +1 -1
- package/package.json +28 -23
- package/bin/migration-create.ts +0 -46
- package/buf.gen.yaml +0 -12
- package/proto/bsky.proto +0 -1907
- package/proto/courier.proto +0 -84
- package/proto/rolodex.proto +0 -116
- package/src/api/age-assurance/const.ts +0 -203
- package/src/api/age-assurance/index.ts +0 -34
- package/src/api/age-assurance/kws/age-verified.test.ts +0 -98
- package/src/api/age-assurance/kws/age-verified.ts +0 -81
- package/src/api/age-assurance/kws/const.ts +0 -33
- package/src/api/age-assurance/kws/external-payload.test.ts +0 -72
- package/src/api/age-assurance/kws/external-payload.ts +0 -149
- package/src/api/age-assurance/redirects/kws-age-verified.ts +0 -107
- package/src/api/age-assurance/stash.ts +0 -23
- package/src/api/age-assurance/types.ts +0 -10
- package/src/api/age-assurance/util.ts +0 -68
- package/src/api/age-assurance/webhooks/kws-age-verified.ts +0 -75
- package/src/api/app/bsky/actor/getProfile.ts +0 -106
- package/src/api/app/bsky/actor/getProfiles.ts +0 -99
- package/src/api/app/bsky/actor/getSuggestions.ts +0 -163
- package/src/api/app/bsky/actor/searchActors.ts +0 -171
- package/src/api/app/bsky/actor/searchActorsTypeahead.ts +0 -164
- package/src/api/app/bsky/ageassurance/begin.ts +0 -175
- package/src/api/app/bsky/ageassurance/getConfig.ts +0 -16
- package/src/api/app/bsky/ageassurance/getState.ts +0 -58
- package/src/api/app/bsky/bookmark/createBookmark.ts +0 -39
- package/src/api/app/bsky/bookmark/deleteBookmark.ts +0 -32
- package/src/api/app/bsky/bookmark/getBookmarks.ts +0 -97
- package/src/api/app/bsky/bookmark/util.ts +0 -13
- package/src/api/app/bsky/contact/dismissMatch.ts +0 -26
- package/src/api/app/bsky/contact/getMatches.ts +0 -111
- package/src/api/app/bsky/contact/getSyncStatus.ts +0 -38
- package/src/api/app/bsky/contact/importContacts.ts +0 -119
- package/src/api/app/bsky/contact/removeData.ts +0 -25
- package/src/api/app/bsky/contact/sendNotification.ts +0 -33
- package/src/api/app/bsky/contact/startPhoneVerification.ts +0 -26
- package/src/api/app/bsky/contact/util.ts +0 -92
- package/src/api/app/bsky/contact/verifyPhone.ts +0 -29
- package/src/api/app/bsky/draft/createDraft.ts +0 -45
- package/src/api/app/bsky/draft/deleteDraft.ts +0 -20
- package/src/api/app/bsky/draft/getDrafts.ts +0 -44
- package/src/api/app/bsky/draft/updateDraft.ts +0 -26
- package/src/api/app/bsky/embed/getEmbedExternalView.ts +0 -154
- package/src/api/app/bsky/feed/getActorFeeds.ts +0 -101
- package/src/api/app/bsky/feed/getActorLikes.ts +0 -128
- package/src/api/app/bsky/feed/getAuthorFeed.ts +0 -279
- package/src/api/app/bsky/feed/getFeed.ts +0 -282
- package/src/api/app/bsky/feed/getFeedGenerator.ts +0 -68
- package/src/api/app/bsky/feed/getFeedGenerators.ts +0 -86
- package/src/api/app/bsky/feed/getLikes.ts +0 -151
- package/src/api/app/bsky/feed/getListFeed.ts +0 -147
- package/src/api/app/bsky/feed/getPostThread.ts +0 -156
- package/src/api/app/bsky/feed/getPosts.ts +0 -100
- package/src/api/app/bsky/feed/getQuotes.ts +0 -122
- package/src/api/app/bsky/feed/getRepostedBy.ts +0 -121
- package/src/api/app/bsky/feed/getSuggestedFeeds.ts +0 -39
- package/src/api/app/bsky/feed/getTimeline.ts +0 -127
- package/src/api/app/bsky/feed/searchPosts.ts +0 -274
- package/src/api/app/bsky/feed/searchPostsV2.ts +0 -243
- package/src/api/app/bsky/graph/getActorStarterPacks.ts +0 -103
- package/src/api/app/bsky/graph/getBlocks.ts +0 -94
- package/src/api/app/bsky/graph/getFollowers.ts +0 -153
- package/src/api/app/bsky/graph/getFollows.ts +0 -151
- package/src/api/app/bsky/graph/getKnownFollowers.ts +0 -123
- package/src/api/app/bsky/graph/getList.ts +0 -152
- package/src/api/app/bsky/graph/getListBlocks.ts +0 -87
- package/src/api/app/bsky/graph/getListMutes.ts +0 -87
- package/src/api/app/bsky/graph/getLists.ts +0 -125
- package/src/api/app/bsky/graph/getListsWithMembership.ts +0 -146
- package/src/api/app/bsky/graph/getMutes.ts +0 -87
- package/src/api/app/bsky/graph/getRelationships.ts +0 -58
- package/src/api/app/bsky/graph/getStarterPack.ts +0 -82
- package/src/api/app/bsky/graph/getStarterPacks.ts +0 -86
- package/src/api/app/bsky/graph/getStarterPacksWithMembership.ts +0 -136
- package/src/api/app/bsky/graph/getSuggestedFollowsByActor.ts +0 -171
- package/src/api/app/bsky/graph/muteActor.ts +0 -24
- package/src/api/app/bsky/graph/muteActorList.ts +0 -19
- package/src/api/app/bsky/graph/muteThread.ts +0 -19
- package/src/api/app/bsky/graph/searchStarterPacks.ts +0 -169
- package/src/api/app/bsky/graph/unmuteActor.ts +0 -21
- package/src/api/app/bsky/graph/unmuteActorList.ts +0 -19
- package/src/api/app/bsky/graph/unmuteThread.ts +0 -19
- package/src/api/app/bsky/labeler/getServices.ts +0 -41
- package/src/api/app/bsky/notification/getPreferences.ts +0 -49
- package/src/api/app/bsky/notification/getUnreadCount.ts +0 -83
- package/src/api/app/bsky/notification/listActivitySubscriptions.ts +0 -116
- package/src/api/app/bsky/notification/listNotifications.ts +0 -272
- package/src/api/app/bsky/notification/putActivitySubscription.ts +0 -69
- package/src/api/app/bsky/notification/putPreferences.ts +0 -17
- package/src/api/app/bsky/notification/putPreferencesV2.ts +0 -64
- package/src/api/app/bsky/notification/registerPush.ts +0 -40
- package/src/api/app/bsky/notification/unregisterPush.ts +0 -39
- package/src/api/app/bsky/notification/updateSeen.ts +0 -52
- package/src/api/app/bsky/notification/util.ts +0 -134
- package/src/api/app/bsky/unspecced/getAgeAssuranceState.ts +0 -48
- package/src/api/app/bsky/unspecced/getConfig.ts +0 -20
- package/src/api/app/bsky/unspecced/getOnboardingSuggestedStarterPacks.ts +0 -162
- package/src/api/app/bsky/unspecced/getPopularFeedGenerators.ts +0 -91
- package/src/api/app/bsky/unspecced/getPostThreadOtherV2.ts +0 -126
- package/src/api/app/bsky/unspecced/getPostThreadV2.ts +0 -148
- package/src/api/app/bsky/unspecced/getSuggestedFeeds.ts +0 -100
- package/src/api/app/bsky/unspecced/getSuggestedOnboardingUsers.ts +0 -143
- package/src/api/app/bsky/unspecced/getSuggestedStarterPacks.ts +0 -165
- package/src/api/app/bsky/unspecced/getSuggestedUsers.ts +0 -183
- package/src/api/app/bsky/unspecced/getSuggestedUsersForDiscover.ts +0 -175
- package/src/api/app/bsky/unspecced/getSuggestedUsersForExplore.ts +0 -178
- package/src/api/app/bsky/unspecced/getSuggestedUsersForSeeMore.ts +0 -178
- package/src/api/app/bsky/unspecced/getTaggedSuggestions.ts +0 -27
- package/src/api/app/bsky/unspecced/getTrendingTopics.ts +0 -96
- package/src/api/app/bsky/unspecced/getTrends.ts +0 -162
- package/src/api/app/bsky/unspecced/initAgeAssurance.ts +0 -150
- package/src/api/blob-dispatcher.ts +0 -41
- package/src/api/blob-resolver.ts +0 -401
- package/src/api/com/atproto/admin/getAccountInfos.ts +0 -49
- package/src/api/com/atproto/admin/getSubjectStatus.ts +0 -79
- package/src/api/com/atproto/admin/updateSubjectStatus.ts +0 -80
- package/src/api/com/atproto/identity/resolveHandle.ts +0 -19
- package/src/api/com/atproto/label/queryLabels.ts +0 -42
- package/src/api/com/atproto/repo/getRecord.ts +0 -44
- package/src/api/com/atproto/temp/fetchLabels.ts +0 -9
- package/src/api/external.ts +0 -15
- package/src/api/health.ts +0 -47
- package/src/api/index.ts +0 -216
- package/src/api/internal/bsky/actor/getProfiles.ts +0 -87
- package/src/api/kws/api.ts +0 -113
- package/src/api/kws/index.ts +0 -29
- package/src/api/kws/types.ts +0 -78
- package/src/api/kws/util.test.ts +0 -50
- package/src/api/kws/util.ts +0 -109
- package/src/api/kws/webhook.ts +0 -134
- package/src/api/sitemap.ts +0 -76
- package/src/api/util.ts +0 -45
- package/src/api/well-known.ts +0 -44
- package/src/auth-verifier.ts +0 -522
- package/src/bsync.ts +0 -41
- package/src/cache/read-through.ts +0 -157
- package/src/config.ts +0 -719
- package/src/context.ts +0 -143
- package/src/courier.ts +0 -41
- package/src/data-plane/client/hosts.ts +0 -103
- package/src/data-plane/client/index.ts +0 -125
- package/src/data-plane/client/util.test.ts +0 -29
- package/src/data-plane/client/util.ts +0 -74
- package/src/data-plane/index.ts +0 -2
- package/src/data-plane/server/background.ts +0 -66
- package/src/data-plane/server/bsync-subscription.ts +0 -590
- package/src/data-plane/server/db/database-schema.ts +0 -90
- package/src/data-plane/server/db/db.ts +0 -204
- package/src/data-plane/server/db/index.ts +0 -2
- package/src/data-plane/server/db/migrations/20230309T045948368Z-init.ts +0 -305
- package/src/data-plane/server/db/migrations/20230408T152211201Z-notification-init.ts +0 -25
- package/src/data-plane/server/db/migrations/20230417T210628672Z-moderation-init.ts +0 -127
- package/src/data-plane/server/db/migrations/20230420T211446071Z-did-cache.ts +0 -14
- package/src/data-plane/server/db/migrations/20230427T194702079Z-notif-record-index.ts +0 -14
- package/src/data-plane/server/db/migrations/20230605T144730094Z-post-profile-aggs.ts +0 -23
- package/src/data-plane/server/db/migrations/20230607T211442112Z-feed-generator-init.ts +0 -34
- package/src/data-plane/server/db/migrations/20230608T155101190Z-algo-whats-hot-view.ts +0 -85
- package/src/data-plane/server/db/migrations/20230608T201813132Z-mute-lists.ts +0 -78
- package/src/data-plane/server/db/migrations/20230608T205147239Z-mutes.ts +0 -15
- package/src/data-plane/server/db/migrations/20230609T153623961Z-blocks.ts +0 -33
- package/src/data-plane/server/db/migrations/20230609T232122649Z-actor-deletion-indexes.ts +0 -27
- package/src/data-plane/server/db/migrations/20230610T203555962Z-suggested-follows.ts +0 -13
- package/src/data-plane/server/db/migrations/20230611T215300060Z-actor-state.ts +0 -13
- package/src/data-plane/server/db/migrations/20230620T161134972Z-post-langs.ts +0 -9
- package/src/data-plane/server/db/migrations/20230627T212437895Z-optional-handle.ts +0 -15
- package/src/data-plane/server/db/migrations/20230629T220835893Z-remove-post-hierarchy.ts +0 -32
- package/src/data-plane/server/db/migrations/20230703T045536691Z-feed-and-label-indices.ts +0 -31
- package/src/data-plane/server/db/migrations/20230720T164800037Z-posts-cursor-idx.ts +0 -19
- package/src/data-plane/server/db/migrations/20230807T035309811Z-feed-item-delete-invite-for-user-idx.ts +0 -14
- package/src/data-plane/server/db/migrations/20230808T172902639Z-repo-rev.ts +0 -12
- package/src/data-plane/server/db/migrations/20230810T203349843Z-action-duration.ts +0 -23
- package/src/data-plane/server/db/migrations/20230817T195936007Z-native-notifications.ts +0 -16
- package/src/data-plane/server/db/migrations/20230830T205507322Z-suggested-feeds.ts +0 -13
- package/src/data-plane/server/db/migrations/20230904T211011773Z-block-lists.ts +0 -24
- package/src/data-plane/server/db/migrations/20230906T222220386Z-thread-gating.ts +0 -27
- package/src/data-plane/server/db/migrations/20230920T213858047Z-add-tags-to-post.ts +0 -9
- package/src/data-plane/server/db/migrations/20230929T192920807Z-record-cursor-indexes.ts +0 -40
- package/src/data-plane/server/db/migrations/20231003T202833377Z-create-moderation-subject-status.ts +0 -123
- package/src/data-plane/server/db/migrations/20231220T225126090Z-blob-takedowns.ts +0 -66
- package/src/data-plane/server/db/migrations/20240124T023719200Z-tagged-suggestions.ts +0 -15
- package/src/data-plane/server/db/migrations/20240226T225725627Z-labelers.ts +0 -27
- package/src/data-plane/server/db/migrations/20240530T170337073Z-account-deactivation.ts +0 -12
- package/src/data-plane/server/db/migrations/20240606T171229898Z-thread-mutes.ts +0 -15
- package/src/data-plane/server/db/migrations/20240606T222548219Z-starter-packs.ts +0 -45
- package/src/data-plane/server/db/migrations/20240719T203853939Z-priority-notifs.ts +0 -25
- package/src/data-plane/server/db/migrations/20240723T220700077Z-quotes-post-aggs.ts +0 -12
- package/src/data-plane/server/db/migrations/20240723T220703655Z-quotes.ts +0 -28
- package/src/data-plane/server/db/migrations/20240801T193939827Z-post-gate.ts +0 -17
- package/src/data-plane/server/db/migrations/20240808T224251220Z-post-gate-flags.ts +0 -25
- package/src/data-plane/server/db/migrations/20240829T211238293Z-simplify-actor-sync.ts +0 -23
- package/src/data-plane/server/db/migrations/20240831T134810923Z-pinned-posts.ts +0 -17
- package/src/data-plane/server/db/migrations/20241114T153108102Z-add-starter-packs-name.ts +0 -19
- package/src/data-plane/server/db/migrations/20250116T222618297Z-post-embed-video.ts +0 -17
- package/src/data-plane/server/db/migrations/20250207T174822012Z-add-label-exp.ts +0 -9
- package/src/data-plane/server/db/migrations/20250404T163421487Z-verifications.ts +0 -39
- package/src/data-plane/server/db/migrations/20250526T023712742Z-like-repost-via.ts +0 -17
- package/src/data-plane/server/db/migrations/20250528T221913281Z-add-record-tags.ts +0 -9
- package/src/data-plane/server/db/migrations/20250602T190357447Z-add-private-data.ts +0 -22
- package/src/data-plane/server/db/migrations/20250611T140649895Z-add-activity-subscription.ts +0 -22
- package/src/data-plane/server/db/migrations/20250627T025331240Z-add-actor-age-assurance-columns.ts +0 -22
- package/src/data-plane/server/db/migrations/20250812T183735692Z-add-bookmarks.ts +0 -23
- package/src/data-plane/server/db/migrations/20250813T174955711Z-add-post-agg-bookmarks.ts +0 -12
- package/src/data-plane/server/db/migrations/20251120T004738098Z-update-actor-age-assurance-v2.ts +0 -28
- package/src/data-plane/server/db/migrations/20260112T133951271Z-add-drafts.ts +0 -24
- package/src/data-plane/server/db/migrations/20260604T224952774Z-post-embed-gallery-image.ts +0 -19
- package/src/data-plane/server/db/migrations/index.ts +0 -60
- package/src/data-plane/server/db/migrations/provider.ts +0 -26
- package/src/data-plane/server/db/pagination.ts +0 -341
- package/src/data-plane/server/db/tables/activity-subscription.ts +0 -12
- package/src/data-plane/server/db/tables/actor-block.ts +0 -14
- package/src/data-plane/server/db/tables/actor-state.ts +0 -10
- package/src/data-plane/server/db/tables/actor-sync.ts +0 -9
- package/src/data-plane/server/db/tables/actor.ts +0 -19
- package/src/data-plane/server/db/tables/algo.ts +0 -11
- package/src/data-plane/server/db/tables/blob-takedown.ts +0 -9
- package/src/data-plane/server/db/tables/bookmark.ts +0 -11
- package/src/data-plane/server/db/tables/did-cache.ts +0 -13
- package/src/data-plane/server/db/tables/draft.ts +0 -11
- package/src/data-plane/server/db/tables/duplicate-record.ts +0 -12
- package/src/data-plane/server/db/tables/feed-generator.ts +0 -21
- package/src/data-plane/server/db/tables/feed-item.ts +0 -12
- package/src/data-plane/server/db/tables/follow.ts +0 -15
- package/src/data-plane/server/db/tables/label.ts +0 -13
- package/src/data-plane/server/db/tables/labeler.ts +0 -16
- package/src/data-plane/server/db/tables/like.ts +0 -18
- package/src/data-plane/server/db/tables/list-block.ts +0 -15
- package/src/data-plane/server/db/tables/list-item.ts +0 -16
- package/src/data-plane/server/db/tables/list-mute.ts +0 -9
- package/src/data-plane/server/db/tables/list.ts +0 -19
- package/src/data-plane/server/db/tables/mute.ts +0 -9
- package/src/data-plane/server/db/tables/notification-push-token.ts +0 -10
- package/src/data-plane/server/db/tables/notification.ts +0 -16
- package/src/data-plane/server/db/tables/post-agg.ts +0 -16
- package/src/data-plane/server/db/tables/post-embed.ts +0 -47
- package/src/data-plane/server/db/tables/post-gate.ts +0 -12
- package/src/data-plane/server/db/tables/post.ts +0 -28
- package/src/data-plane/server/db/tables/private-data.ts +0 -13
- package/src/data-plane/server/db/tables/profile-agg.ts +0 -14
- package/src/data-plane/server/db/tables/profile.ts +0 -17
- package/src/data-plane/server/db/tables/quote.ts +0 -15
- package/src/data-plane/server/db/tables/record.ts +0 -15
- package/src/data-plane/server/db/tables/repost.ts +0 -18
- package/src/data-plane/server/db/tables/starter-pack.ts +0 -17
- package/src/data-plane/server/db/tables/subscription.ts +0 -9
- package/src/data-plane/server/db/tables/suggested-feed.ts +0 -10
- package/src/data-plane/server/db/tables/suggested-follow.ts +0 -10
- package/src/data-plane/server/db/tables/tagged-suggestion.ts +0 -11
- package/src/data-plane/server/db/tables/thread-gate.ts +0 -12
- package/src/data-plane/server/db/tables/thread-mute.ts +0 -9
- package/src/data-plane/server/db/tables/verification.ts +0 -20
- package/src/data-plane/server/db/tables/view-param.ts +0 -12
- package/src/data-plane/server/db/types.ts +0 -12
- package/src/data-plane/server/db/util.ts +0 -67
- package/src/data-plane/server/index.ts +0 -44
- package/src/data-plane/server/indexing/index.ts +0 -458
- package/src/data-plane/server/indexing/plugins/block.ts +0 -84
- package/src/data-plane/server/indexing/plugins/chat-declaration.ts +0 -60
- package/src/data-plane/server/indexing/plugins/feed-generator.ts +0 -80
- package/src/data-plane/server/indexing/plugins/follow.ts +0 -132
- package/src/data-plane/server/indexing/plugins/germ-declaration.ts +0 -57
- package/src/data-plane/server/indexing/plugins/labeler.ts +0 -74
- package/src/data-plane/server/indexing/plugins/like.ts +0 -151
- package/src/data-plane/server/indexing/plugins/list-block.ts +0 -84
- package/src/data-plane/server/indexing/plugins/list-item.ts +0 -92
- package/src/data-plane/server/indexing/plugins/list.ts +0 -80
- package/src/data-plane/server/indexing/plugins/notif-declaration.ts +0 -57
- package/src/data-plane/server/indexing/plugins/post-gate.ts +0 -101
- package/src/data-plane/server/indexing/plugins/post.ts +0 -675
- package/src/data-plane/server/indexing/plugins/profile.ts +0 -90
- package/src/data-plane/server/indexing/plugins/repost.ts +0 -176
- package/src/data-plane/server/indexing/plugins/starter-pack.ts +0 -74
- package/src/data-plane/server/indexing/plugins/status.ts +0 -57
- package/src/data-plane/server/indexing/plugins/thread-gate.ts +0 -101
- package/src/data-plane/server/indexing/plugins/verification.ts +0 -113
- package/src/data-plane/server/indexing/processor.ts +0 -292
- package/src/data-plane/server/routes/activity-subscription.ts +0 -84
- package/src/data-plane/server/routes/blocks.ts +0 -127
- package/src/data-plane/server/routes/bookmarks.ts +0 -83
- package/src/data-plane/server/routes/drafts.ts +0 -37
- package/src/data-plane/server/routes/feed-gens.ts +0 -89
- package/src/data-plane/server/routes/feeds.ts +0 -176
- package/src/data-plane/server/routes/follows.ts +0 -141
- package/src/data-plane/server/routes/identity.ts +0 -59
- package/src/data-plane/server/routes/index.ts +0 -67
- package/src/data-plane/server/routes/interactions.ts +0 -120
- package/src/data-plane/server/routes/labels.ts +0 -55
- package/src/data-plane/server/routes/likes.ts +0 -92
- package/src/data-plane/server/routes/lists.ts +0 -88
- package/src/data-plane/server/routes/moderation.ts +0 -102
- package/src/data-plane/server/routes/mutes.ts +0 -195
- package/src/data-plane/server/routes/notifs.ts +0 -239
- package/src/data-plane/server/routes/profile.ts +0 -220
- package/src/data-plane/server/routes/quotes.ts +0 -32
- package/src/data-plane/server/routes/records.ts +0 -119
- package/src/data-plane/server/routes/relationships.ts +0 -174
- package/src/data-plane/server/routes/reposts.ts +0 -76
- package/src/data-plane/server/routes/search.ts +0 -181
- package/src/data-plane/server/routes/site-standard.ts +0 -12
- package/src/data-plane/server/routes/sitemap.ts +0 -43
- package/src/data-plane/server/routes/starter-packs.ts +0 -32
- package/src/data-plane/server/routes/suggestions.ts +0 -175
- package/src/data-plane/server/routes/sync.ts +0 -16
- package/src/data-plane/server/routes/threads.ts +0 -33
- package/src/data-plane/server/subscription.ts +0 -152
- package/src/data-plane/server/util.ts +0 -202
- package/src/error.ts +0 -12
- package/src/etcd.ts +0 -90
- package/src/feature-gates/README.md +0 -83
- package/src/feature-gates/gates.ts +0 -25
- package/src/feature-gates/index.ts +0 -235
- package/src/feature-gates/metrics.test.ts +0 -196
- package/src/feature-gates/metrics.ts +0 -107
- package/src/feature-gates/types.ts +0 -62
- package/src/feature-gates/utils.test.ts +0 -66
- package/src/feature-gates/utils.ts +0 -135
- package/src/hydration/actor.ts +0 -578
- package/src/hydration/external.test.ts +0 -281
- package/src/hydration/external.ts +0 -268
- package/src/hydration/feed.ts +0 -455
- package/src/hydration/graph.ts +0 -354
- package/src/hydration/hydrator.ts +0 -1835
- package/src/hydration/label.ts +0 -207
- package/src/hydration/util.ts +0 -199
- package/src/image/index.ts +0 -2
- package/src/image/invalidator.ts +0 -33
- package/src/image/logger.ts +0 -6
- package/src/image/server.ts +0 -228
- package/src/image/sharp.ts +0 -89
- package/src/image/uri.ts +0 -114
- package/src/image/util.ts +0 -41
- package/src/index.ts +0 -312
- package/src/kws.ts +0 -197
- package/src/logger.ts +0 -40
- package/src/pipeline.ts +0 -60
- package/src/redis.ts +0 -205
- package/src/rolodex.ts +0 -42
- package/src/stash.ts +0 -76
- package/src/util/debug.ts +0 -10
- package/src/util/http.ts +0 -42
- package/src/util/retry.ts +0 -10
- package/src/util/standard-site.test.ts +0 -423
- package/src/util/standard-site.ts +0 -196
- package/src/util/uris.ts +0 -38
- package/src/util.ts +0 -48
- package/src/views/index.ts +0 -2783
- package/src/views/threads-v2.ts +0 -510
- package/src/views/types.ts +0 -193
- package/src/views/util.ts +0 -114
- package/test.env +0 -2
- package/tests/__snapshots__/feed-generation.test.ts.snap +0 -2510
- package/tests/_util.ts +0 -292
- package/tests/admin/admin-auth.test.ts +0 -190
- package/tests/admin/moderation.test.ts +0 -222
- package/tests/auth.test.ts +0 -90
- package/tests/blob-resolver.test.ts +0 -125
- package/tests/data-plane/__snapshots__/indexing.test.ts.snap +0 -887
- package/tests/data-plane/db.test.ts +0 -189
- package/tests/data-plane/duplicate-records.test.ts +0 -156
- package/tests/data-plane/handle-invalidation.test.ts +0 -153
- package/tests/data-plane/indexing.test.ts +0 -827
- package/tests/data-plane/subscription.test.ts +0 -128
- package/tests/data-plane/thread-mutes.test.ts +0 -175
- package/tests/entryway-auth.test.ts +0 -177
- package/tests/etcd.test.ts +0 -302
- package/tests/feed-generation.test.ts +0 -965
- package/tests/hydration/util.test.ts +0 -119
- package/tests/image/server.test.ts +0 -97
- package/tests/image/sharp.test.ts +0 -199
- package/tests/image/uri.test.ts +0 -106
- package/tests/label-hydration.test.ts +0 -245
- package/tests/postgates.test.ts +0 -182
- package/tests/query-labels.test.ts +0 -85
- package/tests/redis-cache.test.ts +0 -230
- package/tests/seed/feed-hidden-replies.ts +0 -63
- package/tests/seed/get-suggested-starter-packs.ts +0 -64
- package/tests/seed/get-trends.ts +0 -71
- package/tests/seed/known-followers.ts +0 -111
- package/tests/seed/postgates.ts +0 -57
- package/tests/server.test.ts +0 -115
- package/tests/sitemap.test.ts +0 -75
- package/tests/stash.test.ts +0 -180
- package/tests/utils.test.ts +0 -36
- package/tests/views/__snapshots__/actor-search.test.ts.snap +0 -155
- package/tests/views/__snapshots__/author-feed.test.ts.snap +0 -6301
- package/tests/views/__snapshots__/block-lists.test.ts.snap +0 -690
- package/tests/views/__snapshots__/blocks.test.ts.snap +0 -462
- package/tests/views/__snapshots__/bookmarks.test.ts.snap +0 -379
- package/tests/views/__snapshots__/follows.test.ts.snap +0 -798
- package/tests/views/__snapshots__/labeler-service.test.ts.snap +0 -233
- package/tests/views/__snapshots__/likes.test.ts.snap +0 -124
- package/tests/views/__snapshots__/list-feed.test.ts.snap +0 -883
- package/tests/views/__snapshots__/lists.test.ts.snap +0 -650
- package/tests/views/__snapshots__/mute-lists.test.ts.snap +0 -705
- package/tests/views/__snapshots__/mutes.test.ts.snap +0 -353
- package/tests/views/__snapshots__/notifications.test.ts.snap +0 -3074
- package/tests/views/__snapshots__/posts.test.ts.snap +0 -1019
- package/tests/views/__snapshots__/profile.test.ts.snap +0 -811
- package/tests/views/__snapshots__/quotes.test.ts.snap +0 -445
- package/tests/views/__snapshots__/reposts.test.ts.snap +0 -112
- package/tests/views/__snapshots__/starter-packs.test.ts.snap +0 -836
- package/tests/views/__snapshots__/thread-v2.test.ts.snap +0 -1298
- package/tests/views/__snapshots__/thread.test.ts.snap +0 -2051
- package/tests/views/__snapshots__/threadgating.test.ts.snap +0 -189
- package/tests/views/__snapshots__/timeline.test.ts.snap +0 -7252
- package/tests/views/account-deactivation.test.ts +0 -81
- package/tests/views/actor-likes.test.ts +0 -138
- package/tests/views/actor-search.test.ts +0 -261
- package/tests/views/age-assurance-v2.test.ts +0 -823
- package/tests/views/age-assurance.test.ts +0 -479
- package/tests/views/author-feed.test.ts +0 -694
- package/tests/views/block-lists.test.ts +0 -661
- package/tests/views/blocks.test.ts +0 -889
- package/tests/views/bookmarks.test.ts +0 -345
- package/tests/views/drafts.test.ts +0 -430
- package/tests/views/feed-hidden-replies.test.ts +0 -243
- package/tests/views/feed-view-post.test.ts +0 -501
- package/tests/views/follows.test.ts +0 -372
- package/tests/views/get-config.test.ts +0 -64
- package/tests/views/get-suggested-onboarding-users.test.ts +0 -193
- package/tests/views/get-suggested-starter-packs.test.ts +0 -137
- package/tests/views/get-trends.test.ts +0 -141
- package/tests/views/internal-actor.test.ts +0 -127
- package/tests/views/known-followers.test.ts +0 -193
- package/tests/views/labeler-service.test.ts +0 -242
- package/tests/views/labels-needs-review.test.ts +0 -316
- package/tests/views/labels-takedown.test.ts +0 -247
- package/tests/views/likes.test.ts +0 -192
- package/tests/views/list-feed.test.ts +0 -195
- package/tests/views/lists.test.ts +0 -412
- package/tests/views/mute-lists.test.ts +0 -509
- package/tests/views/mutes.test.ts +0 -308
- package/tests/views/notifications.test.ts +0 -1581
- package/tests/views/post-search.test.ts +0 -281
- package/tests/views/posts-debug.test.ts +0 -79
- package/tests/views/posts.test.ts +0 -427
- package/tests/views/profile-debug.test.ts +0 -75
- package/tests/views/profile.test.ts +0 -795
- package/tests/views/quotes.test.ts +0 -133
- package/tests/views/reposts.test.ts +0 -112
- package/tests/views/starter-packs.test.ts +0 -395
- package/tests/views/suggestions.test.ts +0 -145
- package/tests/views/thread-v2.test.ts +0 -2005
- package/tests/views/thread.test.ts +0 -637
- package/tests/views/threadgating.test.ts +0 -843
- package/tests/views/timeline.test.ts +0 -328
- package/tests/views/verification.test.ts +0 -296
- package/tsconfig.build.json +0 -10
- package/tsconfig.build.tsbuildinfo +0 -1
- package/tsconfig.json +0 -7
- package/tsconfig.tests.json +0 -8
- package/vitest.config.ts +0 -10
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { InvalidRequestError, Server } from '@atproto/xrpc-server'
|
|
2
|
-
import { AppContext } from '../../../../context.js'
|
|
3
|
-
import { com } from '../../../../lexicons/index.js'
|
|
4
|
-
|
|
5
|
-
export default function (server: Server, ctx: AppContext) {
|
|
6
|
-
server.add(com.atproto.admin.getSubjectStatus, {
|
|
7
|
-
auth: ctx.authVerifier.roleOrModService,
|
|
8
|
-
handler: async ({ params }) => {
|
|
9
|
-
const { did, uri, blob } = params
|
|
10
|
-
|
|
11
|
-
let body: com.atproto.admin.getSubjectStatus.$OutputBody | null = null
|
|
12
|
-
if (blob) {
|
|
13
|
-
if (!did) {
|
|
14
|
-
throw new InvalidRequestError(
|
|
15
|
-
'Must provide a did to request blob state',
|
|
16
|
-
)
|
|
17
|
-
}
|
|
18
|
-
const res = await ctx.dataplane.getBlobTakedown({
|
|
19
|
-
did,
|
|
20
|
-
cid: blob,
|
|
21
|
-
})
|
|
22
|
-
body = {
|
|
23
|
-
subject: {
|
|
24
|
-
$type: 'com.atproto.admin.defs#repoBlobRef',
|
|
25
|
-
did: did,
|
|
26
|
-
cid: blob,
|
|
27
|
-
},
|
|
28
|
-
takedown: {
|
|
29
|
-
applied: res.takenDown,
|
|
30
|
-
ref: res.takedownRef ? 'TAKEDOWN' : undefined,
|
|
31
|
-
},
|
|
32
|
-
}
|
|
33
|
-
} else if (uri) {
|
|
34
|
-
const res = await ctx.hydrator.getRecord(uri, true)
|
|
35
|
-
if (res) {
|
|
36
|
-
body = {
|
|
37
|
-
subject: {
|
|
38
|
-
$type: 'com.atproto.repo.strongRef',
|
|
39
|
-
uri,
|
|
40
|
-
cid: res.cid,
|
|
41
|
-
},
|
|
42
|
-
takedown: {
|
|
43
|
-
applied: !!res.takedownRef,
|
|
44
|
-
ref: res.takedownRef || undefined,
|
|
45
|
-
},
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
} else if (did) {
|
|
49
|
-
const res = (
|
|
50
|
-
await ctx.hydrator.actor.getActors([did], {
|
|
51
|
-
includeTakedowns: true,
|
|
52
|
-
skipCacheForDids: [did],
|
|
53
|
-
})
|
|
54
|
-
).get(did)
|
|
55
|
-
if (res) {
|
|
56
|
-
body = {
|
|
57
|
-
subject: {
|
|
58
|
-
$type: 'com.atproto.admin.defs#repoRef',
|
|
59
|
-
did: did,
|
|
60
|
-
},
|
|
61
|
-
takedown: {
|
|
62
|
-
applied: !!res.takedownRef,
|
|
63
|
-
ref: res.takedownRef || undefined,
|
|
64
|
-
},
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
} else {
|
|
68
|
-
throw new InvalidRequestError('No provided subject')
|
|
69
|
-
}
|
|
70
|
-
if (body === null) {
|
|
71
|
-
throw new InvalidRequestError('Subject not found', 'NotFound')
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
74
|
-
encoding: 'application/json',
|
|
75
|
-
body,
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
})
|
|
79
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { Timestamp } from '@bufbuild/protobuf'
|
|
2
|
-
import {
|
|
3
|
-
AuthRequiredError,
|
|
4
|
-
InvalidRequestError,
|
|
5
|
-
Server,
|
|
6
|
-
} from '@atproto/xrpc-server'
|
|
7
|
-
import { AppContext } from '../../../../context.js'
|
|
8
|
-
import { com } from '../../../../lexicons/index.js'
|
|
9
|
-
|
|
10
|
-
export default function (server: Server, ctx: AppContext) {
|
|
11
|
-
server.add(com.atproto.admin.updateSubjectStatus, {
|
|
12
|
-
auth: ctx.authVerifier.roleOrModService,
|
|
13
|
-
handler: async ({ input, auth }) => {
|
|
14
|
-
const { canPerformTakedown } = ctx.authVerifier.parseCreds(auth)
|
|
15
|
-
if (!canPerformTakedown) {
|
|
16
|
-
throw new AuthRequiredError(
|
|
17
|
-
'Must be a full moderator to update subject state',
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
const now = new Date()
|
|
21
|
-
const { subject, takedown } = input.body
|
|
22
|
-
if (takedown) {
|
|
23
|
-
if (com.atproto.admin.defs.repoRef.$isTypeOf(subject)) {
|
|
24
|
-
if (takedown.applied) {
|
|
25
|
-
await ctx.dataplane.takedownActor({
|
|
26
|
-
did: subject.did,
|
|
27
|
-
ref: takedown.ref,
|
|
28
|
-
seen: Timestamp.fromDate(now),
|
|
29
|
-
})
|
|
30
|
-
} else {
|
|
31
|
-
await ctx.dataplane.untakedownActor({
|
|
32
|
-
did: subject.did,
|
|
33
|
-
seen: Timestamp.fromDate(now),
|
|
34
|
-
})
|
|
35
|
-
}
|
|
36
|
-
} else if (com.atproto.repo.strongRef.$isTypeOf(subject)) {
|
|
37
|
-
if (takedown.applied) {
|
|
38
|
-
await ctx.dataplane.takedownRecord({
|
|
39
|
-
recordUri: subject.uri,
|
|
40
|
-
ref: takedown.ref,
|
|
41
|
-
seen: Timestamp.fromDate(now),
|
|
42
|
-
})
|
|
43
|
-
} else {
|
|
44
|
-
await ctx.dataplane.untakedownRecord({
|
|
45
|
-
recordUri: subject.uri,
|
|
46
|
-
seen: Timestamp.fromDate(now),
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
} else if (com.atproto.admin.defs.repoBlobRef.$isTypeOf(subject)) {
|
|
50
|
-
if (takedown.applied) {
|
|
51
|
-
await ctx.dataplane.takedownBlob({
|
|
52
|
-
did: subject.did,
|
|
53
|
-
cid: subject.cid,
|
|
54
|
-
ref: takedown.ref,
|
|
55
|
-
seen: Timestamp.fromDate(now),
|
|
56
|
-
})
|
|
57
|
-
} else {
|
|
58
|
-
await ctx.dataplane.untakedownBlob({
|
|
59
|
-
did: subject.did,
|
|
60
|
-
cid: subject.cid,
|
|
61
|
-
seen: Timestamp.fromDate(now),
|
|
62
|
-
})
|
|
63
|
-
}
|
|
64
|
-
} else {
|
|
65
|
-
throw new InvalidRequestError(
|
|
66
|
-
`Invalid subject type: ${subject.$type}`,
|
|
67
|
-
)
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return {
|
|
72
|
-
encoding: 'application/json',
|
|
73
|
-
body: {
|
|
74
|
-
subject,
|
|
75
|
-
takedown,
|
|
76
|
-
},
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
})
|
|
80
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { InvalidRequestError, Server } from '@atproto/xrpc-server'
|
|
2
|
-
import { AppContext } from '../../../../context.js'
|
|
3
|
-
import { com } from '../../../../lexicons/index.js'
|
|
4
|
-
|
|
5
|
-
export default function (server: Server, ctx: AppContext) {
|
|
6
|
-
server.add(com.atproto.identity.resolveHandle, async ({ params }) => {
|
|
7
|
-
const [did] = await ctx.hydrator.actor.getDids([params.handle], {
|
|
8
|
-
lookupUnidirectional: true,
|
|
9
|
-
})
|
|
10
|
-
if (!did) {
|
|
11
|
-
throw new InvalidRequestError('Unable to resolve handle')
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return {
|
|
15
|
-
encoding: 'application/json',
|
|
16
|
-
body: { did },
|
|
17
|
-
}
|
|
18
|
-
})
|
|
19
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { isUriString } from '@atproto/lex'
|
|
2
|
-
import { InvalidRequestError, Server } from '@atproto/xrpc-server'
|
|
3
|
-
import { AppContext } from '../../../../context.js'
|
|
4
|
-
import { com } from '../../../../lexicons/index.js'
|
|
5
|
-
|
|
6
|
-
export default function (server: Server, ctx: AppContext) {
|
|
7
|
-
server.add(com.atproto.label.queryLabels, async ({ params }) => {
|
|
8
|
-
const { uriPatterns, sources } = params
|
|
9
|
-
|
|
10
|
-
if (!sources?.length) {
|
|
11
|
-
throw new InvalidRequestError('source dids are required')
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (uriPatterns.some(includesWildcard)) {
|
|
15
|
-
throw new InvalidRequestError('wildcards not supported')
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// @TODO Should this be enforced at the schema level?
|
|
19
|
-
if (!uriPatterns.every(isUriString)) {
|
|
20
|
-
throw new InvalidRequestError('invalid uri pattern')
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const labelMap = await ctx.hydrator.label.getLabelsForSubjects(
|
|
24
|
-
uriPatterns,
|
|
25
|
-
// If sources are provided, use them. Otherwise, use the labelers from the request header
|
|
26
|
-
{
|
|
27
|
-
dids: sources,
|
|
28
|
-
redact: new Set(),
|
|
29
|
-
},
|
|
30
|
-
)
|
|
31
|
-
const labels = uriPatterns.flatMap((sub) => labelMap.getBySubject(sub))
|
|
32
|
-
|
|
33
|
-
return {
|
|
34
|
-
encoding: 'application/json',
|
|
35
|
-
body: { labels },
|
|
36
|
-
}
|
|
37
|
-
})
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function includesWildcard(str: string) {
|
|
41
|
-
return str.includes('*')
|
|
42
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { atUri } from '@atproto/lex'
|
|
2
|
-
import { InvalidRequestError, Server } from '@atproto/xrpc-server'
|
|
3
|
-
import { AppContext } from '../../../../context.js'
|
|
4
|
-
import { com } from '../../../../lexicons/index.js'
|
|
5
|
-
|
|
6
|
-
export default function (server: Server, ctx: AppContext) {
|
|
7
|
-
server.add(com.atproto.repo.getRecord, {
|
|
8
|
-
auth: ctx.authVerifier.optionalStandardOrRole,
|
|
9
|
-
handler: async ({ auth, params }) => {
|
|
10
|
-
const { repo, collection, rkey, cid } = params
|
|
11
|
-
const { includeTakedowns } = ctx.authVerifier.parseCreds(auth)
|
|
12
|
-
const [did] = await ctx.hydrator.actor.getDids([repo])
|
|
13
|
-
if (!did) {
|
|
14
|
-
throw new InvalidRequestError(`Could not find repo: ${repo}`)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const actors = await ctx.hydrator.actor.getActors([did], {
|
|
18
|
-
includeTakedowns,
|
|
19
|
-
})
|
|
20
|
-
if (!actors.get(did)) {
|
|
21
|
-
throw new InvalidRequestError(`Could not find repo: ${repo}`)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const uri = atUri(did, collection, rkey)
|
|
25
|
-
const result = await ctx.hydrator.getRecord(uri, includeTakedowns)
|
|
26
|
-
|
|
27
|
-
if (!result || (cid && result.cid !== cid)) {
|
|
28
|
-
throw new InvalidRequestError(
|
|
29
|
-
`Could not locate record: ${uri}`,
|
|
30
|
-
'RecordNotFound',
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
encoding: 'application/json' as const,
|
|
36
|
-
body: {
|
|
37
|
-
uri: uri,
|
|
38
|
-
cid: result.cid,
|
|
39
|
-
value: result.record,
|
|
40
|
-
},
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
})
|
|
44
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { InvalidRequestError, Server } from '@atproto/xrpc-server'
|
|
2
|
-
import { AppContext } from '../../../../context.js'
|
|
3
|
-
import { com } from '../../../../lexicons/index.js'
|
|
4
|
-
|
|
5
|
-
export default function (server: Server, _ctx: AppContext) {
|
|
6
|
-
server.add(com.atproto.temp.fetchLabels, async (_reqCtx) => {
|
|
7
|
-
throw new InvalidRequestError('not implemented on dataplane')
|
|
8
|
-
})
|
|
9
|
-
}
|
package/src/api/external.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Router } from 'express'
|
|
2
|
-
import { AppContext } from '../context.js'
|
|
3
|
-
import * as aaApi from './age-assurance/index.js'
|
|
4
|
-
import * as kwsApi from './kws/index.js'
|
|
5
|
-
|
|
6
|
-
export const createRouter = (ctx: AppContext): Router => {
|
|
7
|
-
const router = Router()
|
|
8
|
-
|
|
9
|
-
if (ctx.kwsClient) {
|
|
10
|
-
router.use('/kws', kwsApi.createRouter(ctx))
|
|
11
|
-
router.use(aaApi.createRouter(ctx))
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return router
|
|
15
|
-
}
|
package/src/api/health.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Router } from 'express'
|
|
2
|
-
import { AppContext } from '../context.js'
|
|
3
|
-
|
|
4
|
-
export const createRouter = (ctx: AppContext): Router => {
|
|
5
|
-
const router = Router()
|
|
6
|
-
|
|
7
|
-
router.get('/', function (req, res) {
|
|
8
|
-
res.type('text/plain')
|
|
9
|
-
res.send(`
|
|
10
|
-
_ _
|
|
11
|
-
| | | |
|
|
12
|
-
| |__ ___| | ___ _
|
|
13
|
-
| '_ \\/ __| |/ / | | |
|
|
14
|
-
| |_) \\__ \\ <| |_| |
|
|
15
|
-
|_.__/|___/_|\\_\\\\__, |
|
|
16
|
-
__/ |
|
|
17
|
-
|___/
|
|
18
|
-
|
|
19
|
-
This is an AT Protocol Application View (AppView) for the "bsky.app" application.
|
|
20
|
-
|
|
21
|
-
Most API routes are under /xrpc/
|
|
22
|
-
|
|
23
|
-
Code: https://github.com/bluesky-social/atproto
|
|
24
|
-
Protocol: https://atproto.com
|
|
25
|
-
`)
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
router.get('/robots.txt', function (req, res) {
|
|
29
|
-
res.type('text/plain')
|
|
30
|
-
res.send(
|
|
31
|
-
'# Hello Friends!\n\n# Crawling the public parts of the API is allowed. HTTP 429 ("backoff") status codes are used for rate-limiting. Up to a handful concurrent requests should be ok.\nUser-agent: *\nAllow: /',
|
|
32
|
-
)
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
router.get('/xrpc/_health', async function (req, res) {
|
|
36
|
-
const { version } = ctx.cfg
|
|
37
|
-
try {
|
|
38
|
-
await ctx.dataplane.ping({})
|
|
39
|
-
} catch (err) {
|
|
40
|
-
req.log.error({ err }, 'failed health check')
|
|
41
|
-
return res.status(503).send({ version, error: 'Service Unavailable' })
|
|
42
|
-
}
|
|
43
|
-
res.send({ version })
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
return router
|
|
47
|
-
}
|
package/src/api/index.ts
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
import { Server } from '@atproto/xrpc-server'
|
|
2
|
-
import { AppContext } from '../context.js'
|
|
3
|
-
import getProfile from './app/bsky/actor/getProfile.js'
|
|
4
|
-
import getProfiles from './app/bsky/actor/getProfiles.js'
|
|
5
|
-
import getSuggestions from './app/bsky/actor/getSuggestions.js'
|
|
6
|
-
import searchActors from './app/bsky/actor/searchActors.js'
|
|
7
|
-
import searchActorsTypeahead from './app/bsky/actor/searchActorsTypeahead.js'
|
|
8
|
-
import aaBegin from './app/bsky/ageassurance/begin.js'
|
|
9
|
-
import aaGetConfig from './app/bsky/ageassurance/getConfig.js'
|
|
10
|
-
import aaGetState from './app/bsky/ageassurance/getState.js'
|
|
11
|
-
import createBookmark from './app/bsky/bookmark/createBookmark.js'
|
|
12
|
-
import deleteBookmark from './app/bsky/bookmark/deleteBookmark.js'
|
|
13
|
-
import getBookmarks from './app/bsky/bookmark/getBookmarks.js'
|
|
14
|
-
import dismissMatch from './app/bsky/contact/dismissMatch.js'
|
|
15
|
-
import getMatches from './app/bsky/contact/getMatches.js'
|
|
16
|
-
import getSyncStatus from './app/bsky/contact/getSyncStatus.js'
|
|
17
|
-
import importContacts from './app/bsky/contact/importContacts.js'
|
|
18
|
-
import removeData from './app/bsky/contact/removeData.js'
|
|
19
|
-
import sendNotification from './app/bsky/contact/sendNotification.js'
|
|
20
|
-
import startPhoneVerification from './app/bsky/contact/startPhoneVerification.js'
|
|
21
|
-
import verifyPhone from './app/bsky/contact/verifyPhone.js'
|
|
22
|
-
import createDraft from './app/bsky/draft/createDraft.js'
|
|
23
|
-
import deleteDraft from './app/bsky/draft/deleteDraft.js'
|
|
24
|
-
import getDrafts from './app/bsky/draft/getDrafts.js'
|
|
25
|
-
import updateDraft from './app/bsky/draft/updateDraft.js'
|
|
26
|
-
import getEmbedExternalView from './app/bsky/embed/getEmbedExternalView.js'
|
|
27
|
-
import getActorFeeds from './app/bsky/feed/getActorFeeds.js'
|
|
28
|
-
import getActorLikes from './app/bsky/feed/getActorLikes.js'
|
|
29
|
-
import getAuthorFeed from './app/bsky/feed/getAuthorFeed.js'
|
|
30
|
-
import getFeed from './app/bsky/feed/getFeed.js'
|
|
31
|
-
import getFeedGenerator from './app/bsky/feed/getFeedGenerator.js'
|
|
32
|
-
import getFeedGenerators from './app/bsky/feed/getFeedGenerators.js'
|
|
33
|
-
import getLikes from './app/bsky/feed/getLikes.js'
|
|
34
|
-
import getListFeed from './app/bsky/feed/getListFeed.js'
|
|
35
|
-
import getPostThread from './app/bsky/feed/getPostThread.js'
|
|
36
|
-
import getPosts from './app/bsky/feed/getPosts.js'
|
|
37
|
-
import getQuotes from './app/bsky/feed/getQuotes.js'
|
|
38
|
-
import getRepostedBy from './app/bsky/feed/getRepostedBy.js'
|
|
39
|
-
import getSuggestedFeeds from './app/bsky/feed/getSuggestedFeeds.js'
|
|
40
|
-
import getTimeline from './app/bsky/feed/getTimeline.js'
|
|
41
|
-
import searchPosts from './app/bsky/feed/searchPosts.js'
|
|
42
|
-
import searchPostsV2 from './app/bsky/feed/searchPostsV2.js'
|
|
43
|
-
import getActorStarterPacks from './app/bsky/graph/getActorStarterPacks.js'
|
|
44
|
-
import getBlocks from './app/bsky/graph/getBlocks.js'
|
|
45
|
-
import getFollowers from './app/bsky/graph/getFollowers.js'
|
|
46
|
-
import getFollows from './app/bsky/graph/getFollows.js'
|
|
47
|
-
import getKnownFollowers from './app/bsky/graph/getKnownFollowers.js'
|
|
48
|
-
import getList from './app/bsky/graph/getList.js'
|
|
49
|
-
import getListBlocks from './app/bsky/graph/getListBlocks.js'
|
|
50
|
-
import getListMutes from './app/bsky/graph/getListMutes.js'
|
|
51
|
-
import getLists from './app/bsky/graph/getLists.js'
|
|
52
|
-
import getListsWithMembership from './app/bsky/graph/getListsWithMembership.js'
|
|
53
|
-
import getMutes from './app/bsky/graph/getMutes.js'
|
|
54
|
-
import getRelationships from './app/bsky/graph/getRelationships.js'
|
|
55
|
-
import getStarterPack from './app/bsky/graph/getStarterPack.js'
|
|
56
|
-
import getStarterPacks from './app/bsky/graph/getStarterPacks.js'
|
|
57
|
-
import getStarterPacksWithMembership from './app/bsky/graph/getStarterPacksWithMembership.js'
|
|
58
|
-
import getSuggestedFollowsByActor from './app/bsky/graph/getSuggestedFollowsByActor.js'
|
|
59
|
-
import muteActor from './app/bsky/graph/muteActor.js'
|
|
60
|
-
import muteActorList from './app/bsky/graph/muteActorList.js'
|
|
61
|
-
import muteThread from './app/bsky/graph/muteThread.js'
|
|
62
|
-
import searchStarterPacks from './app/bsky/graph/searchStarterPacks.js'
|
|
63
|
-
import unmuteActor from './app/bsky/graph/unmuteActor.js'
|
|
64
|
-
import unmuteActorList from './app/bsky/graph/unmuteActorList.js'
|
|
65
|
-
import unmuteThread from './app/bsky/graph/unmuteThread.js'
|
|
66
|
-
import getLabelerServices from './app/bsky/labeler/getServices.js'
|
|
67
|
-
import getPreferences from './app/bsky/notification/getPreferences.js'
|
|
68
|
-
import getUnreadCount from './app/bsky/notification/getUnreadCount.js'
|
|
69
|
-
import listActivitySubscriptions from './app/bsky/notification/listActivitySubscriptions.js'
|
|
70
|
-
import listNotifications from './app/bsky/notification/listNotifications.js'
|
|
71
|
-
import putActivitySubscription from './app/bsky/notification/putActivitySubscription.js'
|
|
72
|
-
import putPreferences from './app/bsky/notification/putPreferences.js'
|
|
73
|
-
import putPreferencesV2 from './app/bsky/notification/putPreferencesV2.js'
|
|
74
|
-
import registerPush from './app/bsky/notification/registerPush.js'
|
|
75
|
-
import unregisterPush from './app/bsky/notification/unregisterPush.js'
|
|
76
|
-
import updateSeen from './app/bsky/notification/updateSeen.js'
|
|
77
|
-
import getAgeAssuranceState from './app/bsky/unspecced/getAgeAssuranceState.js'
|
|
78
|
-
import getConfig from './app/bsky/unspecced/getConfig.js'
|
|
79
|
-
import getOnboardingSuggestedStarterPacks from './app/bsky/unspecced/getOnboardingSuggestedStarterPacks.js'
|
|
80
|
-
import getPopularFeedGenerators from './app/bsky/unspecced/getPopularFeedGenerators.js'
|
|
81
|
-
import getPostThreadOtherV2 from './app/bsky/unspecced/getPostThreadOtherV2.js'
|
|
82
|
-
import getPostThreadV2 from './app/bsky/unspecced/getPostThreadV2.js'
|
|
83
|
-
import getUnspeccedSuggestedFeeds from './app/bsky/unspecced/getSuggestedFeeds.js'
|
|
84
|
-
import getSuggestedOnboardingUsers from './app/bsky/unspecced/getSuggestedOnboardingUsers.js'
|
|
85
|
-
import getSuggestedStarterPacks from './app/bsky/unspecced/getSuggestedStarterPacks.js'
|
|
86
|
-
import getSuggestedUsers from './app/bsky/unspecced/getSuggestedUsers.js'
|
|
87
|
-
import getSuggestedUsersForDiscover from './app/bsky/unspecced/getSuggestedUsersForDiscover.js'
|
|
88
|
-
import getSuggestedUsersForExplore from './app/bsky/unspecced/getSuggestedUsersForExplore.js'
|
|
89
|
-
import getSuggestedUsersForSeeMore from './app/bsky/unspecced/getSuggestedUsersForSeeMore.js'
|
|
90
|
-
import getTaggedSuggestions from './app/bsky/unspecced/getTaggedSuggestions.js'
|
|
91
|
-
import getTrendingTopics from './app/bsky/unspecced/getTrendingTopics.js'
|
|
92
|
-
import getTrends from './app/bsky/unspecced/getTrends.js'
|
|
93
|
-
import initAgeAssurance from './app/bsky/unspecced/initAgeAssurance.js'
|
|
94
|
-
import getAccountInfos from './com/atproto/admin/getAccountInfos.js'
|
|
95
|
-
import getSubjectStatus from './com/atproto/admin/getSubjectStatus.js'
|
|
96
|
-
import updateSubjectStatus from './com/atproto/admin/updateSubjectStatus.js'
|
|
97
|
-
import resolveHandle from './com/atproto/identity/resolveHandle.js'
|
|
98
|
-
import queryLabels from './com/atproto/label/queryLabels.js'
|
|
99
|
-
import getRecord from './com/atproto/repo/getRecord.js'
|
|
100
|
-
import fetchLabels from './com/atproto/temp/fetchLabels.js'
|
|
101
|
-
import internalGetProfiles from './internal/bsky/actor/getProfiles.js'
|
|
102
|
-
|
|
103
|
-
export * as health from './health.js'
|
|
104
|
-
|
|
105
|
-
export * as wellKnown from './well-known.js'
|
|
106
|
-
|
|
107
|
-
export * as blobResolver from './blob-resolver.js'
|
|
108
|
-
|
|
109
|
-
export * as external from './external.js'
|
|
110
|
-
|
|
111
|
-
export * as sitemap from './sitemap.js'
|
|
112
|
-
|
|
113
|
-
export default function (server: Server, ctx: AppContext) {
|
|
114
|
-
// app.bsky
|
|
115
|
-
getTimeline(server, ctx)
|
|
116
|
-
createBookmark(server, ctx)
|
|
117
|
-
deleteBookmark(server, ctx)
|
|
118
|
-
getBookmarks(server, ctx)
|
|
119
|
-
createDraft(server, ctx)
|
|
120
|
-
deleteDraft(server, ctx)
|
|
121
|
-
getDrafts(server, ctx)
|
|
122
|
-
updateDraft(server, ctx)
|
|
123
|
-
getEmbedExternalView(server, ctx)
|
|
124
|
-
dismissMatch(server, ctx)
|
|
125
|
-
getMatches(server, ctx)
|
|
126
|
-
getSyncStatus(server, ctx)
|
|
127
|
-
importContacts(server, ctx)
|
|
128
|
-
removeData(server, ctx)
|
|
129
|
-
sendNotification(server, ctx)
|
|
130
|
-
startPhoneVerification(server, ctx)
|
|
131
|
-
verifyPhone(server, ctx)
|
|
132
|
-
getActorFeeds(server, ctx)
|
|
133
|
-
getSuggestedFeeds(server, ctx)
|
|
134
|
-
getAuthorFeed(server, ctx)
|
|
135
|
-
getFeed(server, ctx)
|
|
136
|
-
getFeedGenerator(server, ctx)
|
|
137
|
-
getFeedGenerators(server, ctx)
|
|
138
|
-
getLikes(server, ctx)
|
|
139
|
-
getListFeed(server, ctx)
|
|
140
|
-
getQuotes(server, ctx)
|
|
141
|
-
getPostThread(server, ctx)
|
|
142
|
-
getPostThreadOtherV2(server, ctx)
|
|
143
|
-
getPostThreadV2(server, ctx)
|
|
144
|
-
getPosts(server, ctx)
|
|
145
|
-
searchPosts(server, ctx)
|
|
146
|
-
searchPostsV2(server, ctx)
|
|
147
|
-
getActorLikes(server, ctx)
|
|
148
|
-
getProfile(server, ctx)
|
|
149
|
-
getProfiles(server, ctx)
|
|
150
|
-
getRepostedBy(server, ctx)
|
|
151
|
-
getActorStarterPacks(server, ctx)
|
|
152
|
-
getBlocks(server, ctx)
|
|
153
|
-
getListBlocks(server, ctx)
|
|
154
|
-
getFollowers(server, ctx)
|
|
155
|
-
getKnownFollowers(server, ctx)
|
|
156
|
-
getFollows(server, ctx)
|
|
157
|
-
getList(server, ctx)
|
|
158
|
-
getLists(server, ctx)
|
|
159
|
-
getListsWithMembership(server, ctx)
|
|
160
|
-
getListMutes(server, ctx)
|
|
161
|
-
getMutes(server, ctx)
|
|
162
|
-
getRelationships(server, ctx)
|
|
163
|
-
getStarterPack(server, ctx)
|
|
164
|
-
getStarterPacks(server, ctx)
|
|
165
|
-
getStarterPacksWithMembership(server, ctx)
|
|
166
|
-
searchStarterPacks(server, ctx)
|
|
167
|
-
muteActor(server, ctx)
|
|
168
|
-
unmuteActor(server, ctx)
|
|
169
|
-
muteActorList(server, ctx)
|
|
170
|
-
unmuteActorList(server, ctx)
|
|
171
|
-
muteThread(server, ctx)
|
|
172
|
-
unmuteThread(server, ctx)
|
|
173
|
-
getSuggestedFollowsByActor(server, ctx)
|
|
174
|
-
getTrendingTopics(server, ctx)
|
|
175
|
-
getTrends(server, ctx)
|
|
176
|
-
getOnboardingSuggestedStarterPacks(server, ctx)
|
|
177
|
-
getSuggestedOnboardingUsers(server, ctx)
|
|
178
|
-
getSuggestedStarterPacks(server, ctx)
|
|
179
|
-
getSuggestedUsers(server, ctx)
|
|
180
|
-
getSuggestedUsersForDiscover(server, ctx)
|
|
181
|
-
getSuggestedUsersForExplore(server, ctx)
|
|
182
|
-
getSuggestedUsersForSeeMore(server, ctx)
|
|
183
|
-
getUnspeccedSuggestedFeeds(server, ctx)
|
|
184
|
-
getLabelerServices(server, ctx)
|
|
185
|
-
searchActors(server, ctx)
|
|
186
|
-
searchActorsTypeahead(server, ctx)
|
|
187
|
-
getSuggestions(server, ctx)
|
|
188
|
-
getPreferences(server, ctx)
|
|
189
|
-
getUnreadCount(server, ctx)
|
|
190
|
-
listActivitySubscriptions(server, ctx)
|
|
191
|
-
listNotifications(server, ctx)
|
|
192
|
-
putActivitySubscription(server, ctx)
|
|
193
|
-
updateSeen(server, ctx)
|
|
194
|
-
putPreferences(server, ctx)
|
|
195
|
-
putPreferencesV2(server, ctx)
|
|
196
|
-
registerPush(server, ctx)
|
|
197
|
-
unregisterPush(server, ctx)
|
|
198
|
-
getConfig(server, ctx)
|
|
199
|
-
getPopularFeedGenerators(server, ctx)
|
|
200
|
-
getTaggedSuggestions(server, ctx)
|
|
201
|
-
getAgeAssuranceState(server, ctx)
|
|
202
|
-
initAgeAssurance(server, ctx)
|
|
203
|
-
aaGetConfig(server, ctx)
|
|
204
|
-
aaGetState(server, ctx)
|
|
205
|
-
aaBegin(server, ctx)
|
|
206
|
-
// com.atproto
|
|
207
|
-
getSubjectStatus(server, ctx)
|
|
208
|
-
updateSubjectStatus(server, ctx)
|
|
209
|
-
getAccountInfos(server, ctx)
|
|
210
|
-
resolveHandle(server, ctx)
|
|
211
|
-
getRecord(server, ctx)
|
|
212
|
-
fetchLabels(server, ctx)
|
|
213
|
-
queryLabels(server, ctx)
|
|
214
|
-
// internal.bsky
|
|
215
|
-
internalGetProfiles(server, ctx)
|
|
216
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { mapDefined } from '@atproto/common'
|
|
2
|
-
import { DidString } from '@atproto/syntax'
|
|
3
|
-
import { Server } from '@atproto/xrpc-server'
|
|
4
|
-
import { AppContext } from '../../../../context.js'
|
|
5
|
-
import {
|
|
6
|
-
HydrateCtx,
|
|
7
|
-
HydrationState,
|
|
8
|
-
Hydrator,
|
|
9
|
-
} from '../../../../hydration/hydrator.js'
|
|
10
|
-
import { internal } from '../../../../lexicons/index.js'
|
|
11
|
-
import { createPipeline, noRules } from '../../../../pipeline.js'
|
|
12
|
-
import { Views } from '../../../../views/index.js'
|
|
13
|
-
|
|
14
|
-
export default function (server: Server, ctx: AppContext) {
|
|
15
|
-
const getProfiles = createPipeline(skeleton, hydration, noRules, presentation)
|
|
16
|
-
server.add(internal.bsky.actor.getProfiles, {
|
|
17
|
-
auth: ctx.authVerifier.role,
|
|
18
|
-
handler: async ({ params, req }) => {
|
|
19
|
-
const labelers = ctx.reqLabelers(req)
|
|
20
|
-
const hydrateCtx = await ctx.hydrator.createContext({
|
|
21
|
-
viewer: params.viewer ?? null,
|
|
22
|
-
labelers,
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
const result = await getProfiles({ ...params, hydrateCtx }, ctx)
|
|
26
|
-
|
|
27
|
-
return {
|
|
28
|
-
encoding: 'application/json',
|
|
29
|
-
body: result,
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
})
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const skeleton = async (input: {
|
|
36
|
-
ctx: Context
|
|
37
|
-
params: Params
|
|
38
|
-
}): Promise<SkeletonState> => {
|
|
39
|
-
const { params } = input
|
|
40
|
-
const dids = params.dids
|
|
41
|
-
const didSet = new Set(dids)
|
|
42
|
-
// social proof is only hydrated for dids present in both inputs
|
|
43
|
-
const socialProofDids = (params.socialProof ?? []).filter((did) =>
|
|
44
|
-
didSet.has(did),
|
|
45
|
-
)
|
|
46
|
-
return { dids, socialProofDids }
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const hydration = async (input: {
|
|
50
|
-
ctx: Context
|
|
51
|
-
params: Params
|
|
52
|
-
skeleton: SkeletonState
|
|
53
|
-
}) => {
|
|
54
|
-
const { ctx, params, skeleton } = input
|
|
55
|
-
return ctx.hydrator.hydrateProfilesDetailed(
|
|
56
|
-
skeleton.dids,
|
|
57
|
-
params.hydrateCtx,
|
|
58
|
-
{ knownFollowersDids: skeleton.socialProofDids },
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const presentation = (input: {
|
|
63
|
-
ctx: Context
|
|
64
|
-
params: Params
|
|
65
|
-
skeleton: SkeletonState
|
|
66
|
-
hydration: HydrationState
|
|
67
|
-
}) => {
|
|
68
|
-
const { ctx, skeleton, hydration } = input
|
|
69
|
-
const profiles = mapDefined(skeleton.dids, (did) =>
|
|
70
|
-
ctx.views.profileDetailed(did, hydration),
|
|
71
|
-
)
|
|
72
|
-
return { profiles }
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
type Context = {
|
|
76
|
-
hydrator: Hydrator
|
|
77
|
-
views: Views
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
type Params = internal.bsky.actor.getProfiles.$Params & {
|
|
81
|
-
hydrateCtx: HydrateCtx
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
type SkeletonState = {
|
|
85
|
-
dids: DidString[]
|
|
86
|
-
socialProofDids: DidString[]
|
|
87
|
-
}
|