@atproto/bsky 0.0.241 → 0.0.243
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 +28 -0
- package/dist/api/age-assurance/const.d.ts +1 -1
- package/dist/api/age-assurance/index.d.ts.map +1 -1
- package/dist/api/age-assurance/kws/age-verified.d.ts +13 -13
- package/dist/api/age-assurance/kws/age-verified.d.ts.map +1 -1
- package/dist/api/age-assurance/kws/external-payload.d.ts +4 -4
- package/dist/api/age-assurance/redirects/kws-age-verified.d.ts.map +1 -1
- package/dist/api/age-assurance/webhooks/kws-age-verified.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/searchActors.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/searchActors.js +7 -3
- package/dist/api/app/bsky/actor/searchActors.js.map +1 -1
- package/dist/api/app/bsky/actor/searchActorsTypeahead.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/searchActorsTypeahead.js +7 -3
- package/dist/api/app/bsky/actor/searchActorsTypeahead.js.map +1 -1
- package/dist/api/app/bsky/bookmark/util.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getAuthorFeed.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getAuthorFeed.js.map +1 -1
- package/dist/api/app/bsky/feed/getListFeed.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getTimeline.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/searchPosts.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/searchPosts.js +8 -3
- package/dist/api/app/bsky/feed/searchPosts.js.map +1 -1
- package/dist/api/app/bsky/graph/searchStarterPacks.d.ts.map +1 -1
- package/dist/api/app/bsky/graph/searchStarterPacks.js +7 -3
- package/dist/api/app/bsky/graph/searchStarterPacks.js.map +1 -1
- package/dist/api/app/bsky/notification/listNotifications.d.ts.map +1 -1
- package/dist/api/app/bsky/notification/util.d.ts.map +1 -1
- package/dist/api/app/bsky/unspecced/getPopularFeedGenerators.d.ts.map +1 -1
- package/dist/api/app/bsky/unspecced/getPopularFeedGenerators.js +3 -2
- package/dist/api/app/bsky/unspecced/getPopularFeedGenerators.js.map +1 -1
- package/dist/api/external.d.ts.map +1 -1
- package/dist/api/health.d.ts.map +1 -1
- package/dist/api/kws/api.d.ts.map +1 -1
- package/dist/api/kws/index.d.ts.map +1 -1
- package/dist/api/kws/types.d.ts +6 -6
- package/dist/api/kws/util.d.ts +1 -1
- package/dist/api/kws/util.d.ts.map +1 -1
- package/dist/api/kws/webhook.d.ts.map +1 -1
- package/dist/api/sitemap.d.ts.map +1 -1
- package/dist/api/util.d.ts +5 -0
- package/dist/api/util.d.ts.map +1 -1
- package/dist/api/util.js +11 -0
- package/dist/api/util.js.map +1 -1
- package/dist/api/well-known.d.ts.map +1 -1
- package/dist/auth-verifier.d.ts +2 -2
- package/dist/auth-verifier.d.ts.map +1 -1
- package/dist/bsync.d.ts.map +1 -1
- package/dist/cache/read-through.d.ts.map +1 -1
- package/dist/cache/read-through.js.map +1 -1
- package/dist/config.d.ts +6 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -0
- package/dist/config.js.map +1 -1
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js.map +1 -1
- package/dist/courier.d.ts.map +1 -1
- package/dist/data-plane/bsync/index.d.ts.map +1 -1
- package/dist/data-plane/bsync/index.js.map +1 -1
- package/dist/data-plane/client/hosts.d.ts.map +1 -1
- package/dist/data-plane/client/index.d.ts.map +1 -1
- package/dist/data-plane/client/util.d.ts.map +1 -1
- package/dist/data-plane/server/background.d.ts.map +1 -1
- package/dist/data-plane/server/db/db.d.ts +4 -5
- package/dist/data-plane/server/db/db.d.ts.map +1 -1
- package/dist/data-plane/server/db/db.js +2 -1
- package/dist/data-plane/server/db/db.js.map +1 -1
- package/dist/data-plane/server/db/migrations/20230627T212437895Z-optional-handle.d.ts.map +1 -1
- package/dist/data-plane/server/db/migrations/20230627T212437895Z-optional-handle.js +2 -4
- package/dist/data-plane/server/db/migrations/20230627T212437895Z-optional-handle.js.map +1 -1
- package/dist/data-plane/server/db/migrations/provider.d.ts +2 -1
- package/dist/data-plane/server/db/migrations/provider.d.ts.map +1 -1
- package/dist/data-plane/server/db/migrations/provider.js.map +1 -1
- package/dist/data-plane/server/db/pagination.d.ts +4 -3
- package/dist/data-plane/server/db/pagination.d.ts.map +1 -1
- package/dist/data-plane/server/db/pagination.js +8 -8
- package/dist/data-plane/server/db/pagination.js.map +1 -1
- package/dist/data-plane/server/db/util.d.ts +5 -5
- package/dist/data-plane/server/db/util.d.ts.map +1 -1
- package/dist/data-plane/server/db/util.js.map +1 -1
- package/dist/data-plane/server/index.d.ts.map +1 -1
- package/dist/data-plane/server/index.js.map +1 -1
- package/dist/data-plane/server/indexing/index.d.ts +78 -78
- package/dist/data-plane/server/indexing/index.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/index.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/block.d.ts +9 -4
- package/dist/data-plane/server/indexing/plugins/block.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/chat-declaration.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/feed-generator.d.ts +13 -4
- package/dist/data-plane/server/indexing/plugins/feed-generator.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/follow.d.ts +9 -4
- package/dist/data-plane/server/indexing/plugins/follow.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/germ-declaration.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/labeler.d.ts +8 -4
- package/dist/data-plane/server/indexing/plugins/labeler.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/like.d.ts +12 -4
- package/dist/data-plane/server/indexing/plugins/like.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/list-block.d.ts +9 -4
- package/dist/data-plane/server/indexing/plugins/list-block.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/list-item.d.ts +10 -4
- package/dist/data-plane/server/indexing/plugins/list-item.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/list.d.ts +13 -4
- package/dist/data-plane/server/indexing/plugins/list.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/notif-declaration.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/post-gate.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/post.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/post.js +4 -3
- package/dist/data-plane/server/indexing/plugins/post.js.map +1 -1
- package/dist/data-plane/server/indexing/plugins/profile.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/repost.d.ts +12 -4
- package/dist/data-plane/server/indexing/plugins/repost.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/starter-pack.d.ts +9 -4
- package/dist/data-plane/server/indexing/plugins/starter-pack.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/status.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/thread-gate.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/plugins/verification.d.ts +12 -4
- package/dist/data-plane/server/indexing/plugins/verification.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/processor.d.ts.map +1 -1
- package/dist/data-plane/server/indexing/processor.js.map +1 -1
- package/dist/data-plane/server/routes/activity-subscription.d.ts.map +1 -1
- package/dist/data-plane/server/routes/blocks.d.ts.map +1 -1
- package/dist/data-plane/server/routes/blocks.js +22 -14
- package/dist/data-plane/server/routes/blocks.js.map +1 -1
- package/dist/data-plane/server/routes/bookmarks.d.ts.map +1 -1
- package/dist/data-plane/server/routes/drafts.d.ts.map +1 -1
- package/dist/data-plane/server/routes/feed-gens.d.ts.map +1 -1
- package/dist/data-plane/server/routes/feed-gens.js +2 -2
- package/dist/data-plane/server/routes/feed-gens.js.map +1 -1
- package/dist/data-plane/server/routes/feeds.d.ts.map +1 -1
- package/dist/data-plane/server/routes/feeds.js +18 -16
- package/dist/data-plane/server/routes/feeds.js.map +1 -1
- package/dist/data-plane/server/routes/follows.d.ts.map +1 -1
- package/dist/data-plane/server/routes/identity.d.ts.map +1 -1
- package/dist/data-plane/server/routes/index.d.ts.map +1 -1
- package/dist/data-plane/server/routes/interactions.d.ts.map +1 -1
- package/dist/data-plane/server/routes/labels.d.ts.map +1 -1
- package/dist/data-plane/server/routes/labels.js +1 -1
- package/dist/data-plane/server/routes/labels.js.map +1 -1
- package/dist/data-plane/server/routes/likes.d.ts.map +1 -1
- package/dist/data-plane/server/routes/lists.d.ts.map +1 -1
- package/dist/data-plane/server/routes/moderation.d.ts.map +1 -1
- package/dist/data-plane/server/routes/mutes.d.ts.map +1 -1
- package/dist/data-plane/server/routes/mutes.js +2 -2
- package/dist/data-plane/server/routes/mutes.js.map +1 -1
- package/dist/data-plane/server/routes/notifs.d.ts.map +1 -1
- package/dist/data-plane/server/routes/notifs.js +10 -9
- package/dist/data-plane/server/routes/notifs.js.map +1 -1
- package/dist/data-plane/server/routes/profile.d.ts.map +1 -1
- package/dist/data-plane/server/routes/quotes.d.ts.map +1 -1
- package/dist/data-plane/server/routes/records.d.ts.map +1 -1
- package/dist/data-plane/server/routes/relationships.d.ts.map +1 -1
- package/dist/data-plane/server/routes/relationships.js.map +1 -1
- package/dist/data-plane/server/routes/reposts.d.ts.map +1 -1
- package/dist/data-plane/server/routes/search.d.ts.map +1 -1
- package/dist/data-plane/server/routes/site-standard.d.ts.map +1 -1
- package/dist/data-plane/server/routes/sitemap.d.ts.map +1 -1
- package/dist/data-plane/server/routes/starter-packs.d.ts.map +1 -1
- package/dist/data-plane/server/routes/suggestions.d.ts.map +1 -1
- package/dist/data-plane/server/routes/suggestions.js +2 -2
- package/dist/data-plane/server/routes/suggestions.js.map +1 -1
- package/dist/data-plane/server/routes/sync.d.ts.map +1 -1
- package/dist/data-plane/server/routes/threads.d.ts.map +1 -1
- package/dist/data-plane/server/subscription.d.ts.map +1 -1
- package/dist/data-plane/server/subscription.js.map +1 -1
- package/dist/data-plane/server/util.d.ts +31 -23
- package/dist/data-plane/server/util.d.ts.map +1 -1
- package/dist/etcd.d.ts.map +1 -1
- package/dist/etcd.js.map +1 -1
- package/dist/feature-gates/index.d.ts.map +1 -1
- package/dist/feature-gates/metrics.d.ts.map +1 -1
- package/dist/feature-gates/metrics.js.map +1 -1
- package/dist/hydration/actor.d.ts.map +1 -1
- package/dist/hydration/actor.js.map +1 -1
- package/dist/hydration/external.d.ts.map +1 -1
- package/dist/hydration/external.js.map +1 -1
- package/dist/hydration/feed.d.ts.map +1 -1
- package/dist/hydration/feed.js.map +1 -1
- package/dist/hydration/graph.d.ts.map +1 -1
- package/dist/hydration/graph.js.map +1 -1
- package/dist/hydration/hydrator.d.ts +1 -1
- package/dist/hydration/hydrator.d.ts.map +1 -1
- package/dist/hydration/hydrator.js.map +1 -1
- package/dist/hydration/label.d.ts.map +1 -1
- package/dist/hydration/label.js.map +1 -1
- package/dist/hydration/util.d.ts.map +1 -1
- package/dist/image/invalidator.d.ts.map +1 -1
- package/dist/image/invalidator.js.map +1 -1
- package/dist/image/logger.d.ts.map +1 -1
- package/dist/image/server.d.ts.map +1 -1
- package/dist/image/server.js.map +1 -1
- package/dist/image/sharp.d.ts +1 -1
- package/dist/image/uri.d.ts.map +1 -1
- package/dist/image/uri.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/kws.d.ts.map +1 -1
- package/dist/kws.js.map +1 -1
- package/dist/lexicons/app/bsky/actor/defs.defs.d.ts +75 -155
- package/dist/lexicons/app/bsky/actor/defs.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/actor/profile.defs.d.ts +100 -300
- package/dist/lexicons/app/bsky/actor/profile.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/actor/status.defs.d.ts +40 -40
- package/dist/lexicons/app/bsky/actor/status.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/draft/defs.defs.d.ts +4 -4
- package/dist/lexicons/app/bsky/draft/defs.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/embed/external.defs.d.ts +10 -10
- package/dist/lexicons/app/bsky/embed/gallery.defs.d.ts +10 -42
- package/dist/lexicons/app/bsky/embed/gallery.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/embed/images.defs.d.ts +10 -10
- package/dist/lexicons/app/bsky/embed/record.defs.d.ts +10 -10
- package/dist/lexicons/app/bsky/embed/recordWithMedia.defs.d.ts +10 -10
- package/dist/lexicons/app/bsky/embed/video.defs.d.ts +50 -162
- package/dist/lexicons/app/bsky/embed/video.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/generator.defs.d.ts +80 -160
- package/dist/lexicons/app/bsky/feed/generator.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/like.defs.d.ts +30 -30
- package/dist/lexicons/app/bsky/feed/like.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/post.defs.d.ts +80 -200
- package/dist/lexicons/app/bsky/feed/post.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/postgate.defs.d.ts +40 -80
- package/dist/lexicons/app/bsky/feed/postgate.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/repost.defs.d.ts +30 -30
- package/dist/lexicons/app/bsky/feed/repost.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/feed/threadgate.defs.d.ts +30 -30
- package/dist/lexicons/app/bsky/feed/threadgate.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/block.defs.d.ts +20 -20
- package/dist/lexicons/app/bsky/graph/block.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/follow.defs.d.ts +30 -30
- package/dist/lexicons/app/bsky/graph/follow.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/list.defs.d.ts +70 -70
- package/dist/lexicons/app/bsky/graph/list.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/listblock.defs.d.ts +20 -20
- package/dist/lexicons/app/bsky/graph/listblock.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/listitem.defs.d.ts +20 -20
- package/dist/lexicons/app/bsky/graph/listitem.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/starterpack.defs.d.ts +50 -90
- package/dist/lexicons/app/bsky/graph/starterpack.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/graph/verification.defs.d.ts +30 -30
- package/dist/lexicons/app/bsky/graph/verification.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/labeler/service.defs.d.ts +60 -140
- package/dist/lexicons/app/bsky/labeler/service.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/notification/declaration.defs.d.ts +10 -10
- package/dist/lexicons/app/bsky/notification/declaration.defs.d.ts.map +1 -1
- package/dist/lexicons/app/bsky/richtext/facet.defs.d.ts +10 -10
- package/dist/lexicons/chat/bsky/actor/declaration.defs.d.ts +20 -20
- package/dist/lexicons/chat/bsky/actor/declaration.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/convo/defs.defs.d.ts +17 -0
- package/dist/lexicons/chat/bsky/convo/defs.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/convo/defs.defs.js +11 -0
- package/dist/lexicons/chat/bsky/convo/defs.defs.js.map +1 -1
- package/dist/lexicons/chat/bsky/convo/getUnreadCounts.defs.d.ts +7 -3
- package/dist/lexicons/chat/bsky/convo/getUnreadCounts.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/convo/getUnreadCounts.defs.js +5 -2
- package/dist/lexicons/chat/bsky/convo/getUnreadCounts.defs.js.map +1 -1
- package/dist/lexicons/chat/bsky/convo/sendMessage.defs.d.ts +1 -1
- package/dist/lexicons/chat/bsky/convo/sendMessage.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/convo/sendMessage.defs.js +1 -0
- package/dist/lexicons/chat/bsky/convo/sendMessage.defs.js.map +1 -1
- package/dist/lexicons/chat/bsky/convo/sendMessageBatch.defs.d.ts +1 -1
- package/dist/lexicons/chat/bsky/convo/sendMessageBatch.defs.d.ts.map +1 -1
- package/dist/lexicons/chat/bsky/convo/sendMessageBatch.defs.js +1 -0
- package/dist/lexicons/chat/bsky/convo/sendMessageBatch.defs.js.map +1 -1
- package/dist/lexicons/chat/bsky/embed/joinLink.defs.d.ts +10 -42
- package/dist/lexicons/chat/bsky/embed/joinLink.defs.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/lexicon/schema.defs.d.ts +10 -10
- package/dist/lexicons/com/atproto/lexicon/schema.defs.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/repo/strongRef.defs.d.ts +10 -10
- package/dist/lexicons/com/germnetwork/declaration.defs.d.ts +40 -120
- package/dist/lexicons/com/germnetwork/declaration.defs.d.ts.map +1 -1
- package/dist/lexicons/site/standard/document.defs.d.ts +140 -460
- package/dist/lexicons/site/standard/document.defs.d.ts.map +1 -1
- package/dist/lexicons/site/standard/graph/recommend.defs.d.ts +10 -10
- package/dist/lexicons/site/standard/graph/recommend.defs.d.ts.map +1 -1
- package/dist/lexicons/site/standard/graph/subscription.defs.d.ts +20 -60
- package/dist/lexicons/site/standard/graph/subscription.defs.d.ts.map +1 -1
- package/dist/lexicons/site/standard/publication.defs.d.ts +60 -220
- package/dist/lexicons/site/standard/publication.defs.d.ts.map +1 -1
- package/dist/lexicons/site/standard/theme/basic.defs.d.ts +10 -10
- package/dist/lexicons/site/standard/theme/basic.defs.d.ts.map +1 -1
- package/dist/lexicons/tools/ozone/moderation/queryStatuses.defs.d.ts +2 -2
- package/dist/lexicons/tools/ozone/set/querySets.defs.d.ts +2 -2
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/proto/bsky_connect.d.ts.map +1 -1
- package/dist/proto/bsky_pb.d.ts.map +1 -1
- package/dist/proto/bsky_pb.js.map +1 -1
- package/dist/proto/bsync_connect.d.ts.map +1 -1
- package/dist/proto/bsync_pb.d.ts.map +1 -1
- package/dist/proto/bsync_pb.js.map +1 -1
- package/dist/proto/courier_connect.d.ts.map +1 -1
- package/dist/proto/courier_pb.d.ts.map +1 -1
- package/dist/proto/courier_pb.js.map +1 -1
- package/dist/proto/rolodex_connect.d.ts.map +1 -1
- package/dist/proto/rolodex_pb.d.ts.map +1 -1
- package/dist/proto/rolodex_pb.js.map +1 -1
- package/dist/redis.d.ts.map +1 -1
- package/dist/rolodex.d.ts.map +1 -1
- package/dist/stash.d.ts.map +1 -1
- package/dist/stash.js.map +1 -1
- package/dist/util/debug.d.ts.map +1 -1
- package/dist/util/standard-site.d.ts.map +1 -1
- package/dist/util.d.ts.map +1 -1
- package/dist/views/index.d.ts.map +1 -1
- package/dist/views/types.d.ts +1 -1
- package/dist/views/types.d.ts.map +1 -1
- package/dist/views/util.d.ts.map +1 -1
- package/dist/views/util.js.map +1 -1
- package/package.json +17 -18
- package/src/api/app/bsky/actor/searchActors.ts +17 -6
- package/src/api/app/bsky/actor/searchActorsTypeahead.ts +11 -5
- package/src/api/app/bsky/feed/searchPosts.ts +12 -5
- package/src/api/app/bsky/graph/searchStarterPacks.ts +14 -5
- package/src/api/app/bsky/unspecced/getPopularFeedGenerators.ts +9 -2
- package/src/api/util.ts +17 -0
- package/src/config.ts +9 -0
- package/src/data-plane/server/db/db.ts +1 -1
- package/src/data-plane/server/db/migrations/20230627T212437895Z-optional-handle.ts +2 -4
- package/src/data-plane/server/db/migrations/provider.ts +2 -1
- package/src/data-plane/server/db/pagination.ts +15 -15
- package/src/data-plane/server/db/util.ts +8 -5
- package/src/data-plane/server/indexing/plugins/post.ts +5 -4
- package/src/data-plane/server/routes/blocks.ts +30 -24
- package/src/data-plane/server/routes/feed-gens.ts +2 -2
- package/src/data-plane/server/routes/feeds.ts +23 -19
- package/src/data-plane/server/routes/labels.ts +2 -2
- package/src/data-plane/server/routes/mutes.ts +8 -6
- package/src/data-plane/server/routes/notifs.ts +15 -12
- package/src/data-plane/server/routes/relationships.ts +4 -2
- package/src/data-plane/server/routes/suggestions.ts +2 -2
- package/tests/data-plane/subscription.test.ts +18 -16
- package/tsconfig.build.tsbu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,GAAG,CACzB,KAAoC,EACpC,SAAiB,EACjB,EAAE;IACF,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IACvB,MAAM,QAAQ,GACZ,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAA;IACrE,mBAAmB;IACnB,IAAI,QAAQ,GAAG,GAAG;QAAE,OAAO,IAAI,CAAA;IAC/B,uDAAuD;IACvD,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,IAAI,QAAQ,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IACzD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA","sourcesContent":["import { Selectable, sql } from 'kysely'\nimport { DAY, HOUR } from '@atproto/common'\nimport { IdResolver, getPds } from '@atproto/identity'\nimport { Cid, l, parseCid, xrpc, xrpcSafe } from '@atproto/lex'\nimport {\n VerifiedRepo,\n WriteOpAction,\n getAndParseRecord,\n readCarWithRoot,\n verifyRepo,\n} from '@atproto/repo'\nimport { AtUri, DidString } from '@atproto/syntax'\nimport { com } from '../../../lexicons/index.js'\nimport { subLogger } from '../../../logger.js'\nimport { retryXrpc } from '../../../util/retry.js'\nimport { BackgroundQueue } from '../background.js'\nimport { Database } from '../db/index.js'\nimport { Actor } from '../db/tables/actor.js'\nimport * as Block from './plugins/block.js'\nimport * as ChatDeclaration from './plugins/chat-declaration.js'\nimport * as FeedGenerator from './plugins/feed-generator.js'\nimport * as Follow from './plugins/follow.js'\nimport * as GermDeclaration from './plugins/germ-declaration.js'\nimport * as Labeler from './plugins/labeler.js'\nimport * as Like from './plugins/like.js'\nimport * as ListBlock from './plugins/list-block.js'\nimport * as ListItem from './plugins/list-item.js'\nimport * as List from './plugins/list.js'\nimport * as NotifDeclaration from './plugins/notif-declaration.js'\nimport * as Postgate from './plugins/post-gate.js'\nimport * as Post from './plugins/post.js'\nimport * as Profile from './plugins/profile.js'\nimport * as Repost from './plugins/repost.js'\nimport * as StarterPack from './plugins/starter-pack.js'\nimport * as Status from './plugins/status.js'\nimport * as Threadgate from './plugins/thread-gate.js'\nimport * as Verification from './plugins/verification.js'\n\nexport class IndexingService {\n records: {\n post: Post.PluginType\n threadGate: Threadgate.PluginType\n postGate: Postgate.PluginType\n like: Like.PluginType\n repost: Repost.PluginType\n follow: Follow.PluginType\n profile: Profile.PluginType\n list: List.PluginType\n listItem: ListItem.PluginType\n listBlock: ListBlock.PluginType\n block: Block.PluginType\n feedGenerator: FeedGenerator.PluginType\n starterPack: StarterPack.PluginType\n labeler: Labeler.PluginType\n notifDeclaration: NotifDeclaration.PluginType\n chatDeclaration: ChatDeclaration.PluginType\n germDeclaration: GermDeclaration.PluginType\n verification: Verification.PluginType\n status: Status.PluginType\n }\n\n constructor(\n public db: Database,\n public idResolver: IdResolver,\n public background: BackgroundQueue,\n ) {\n this.records = {\n post: Post.makePlugin(this.db, this.background),\n threadGate: Threadgate.makePlugin(this.db, this.background),\n postGate: Postgate.makePlugin(this.db, this.background),\n like: Like.makePlugin(this.db, this.background),\n repost: Repost.makePlugin(this.db, this.background),\n follow: Follow.makePlugin(this.db, this.background),\n profile: Profile.makePlugin(this.db, this.background),\n list: List.makePlugin(this.db, this.background),\n listItem: ListItem.makePlugin(this.db, this.background),\n listBlock: ListBlock.makePlugin(this.db, this.background),\n block: Block.makePlugin(this.db, this.background),\n feedGenerator: FeedGenerator.makePlugin(this.db, this.background),\n starterPack: StarterPack.makePlugin(this.db, this.background),\n labeler: Labeler.makePlugin(this.db, this.background),\n notifDeclaration: NotifDeclaration.makePlugin(this.db, this.background),\n chatDeclaration: ChatDeclaration.makePlugin(this.db, this.background),\n germDeclaration: GermDeclaration.makePlugin(this.db, this.background),\n verification: Verification.makePlugin(this.db, this.background),\n status: Status.makePlugin(this.db, this.background),\n }\n }\n\n transact(txn: Database) {\n txn.assertTransaction()\n return new IndexingService(txn, this.idResolver, this.background)\n }\n\n async indexRecord(\n uri: AtUri,\n cid: Cid,\n obj: unknown,\n action: WriteOpAction.Create | WriteOpAction.Update,\n timestamp: string,\n opts?: { disableNotifs?: boolean; disableLabels?: boolean },\n ) {\n this.db.assertNotTransaction()\n return this.db.transaction(async (txn) => {\n const indexingTx = this.transact(txn)\n const indexer = indexingTx.findIndexerForCollection(uri.collection)\n if (!indexer) return\n if (action === WriteOpAction.Create) {\n await indexer.insertRecord(uri, cid, obj, timestamp, opts)\n } else {\n await indexer.updateRecord(uri, cid, obj, timestamp)\n }\n })\n }\n\n async deleteRecord(uri: AtUri, cascading = false) {\n this.db.assertNotTransaction()\n await this.db.transaction(async (txn) => {\n const indexingTx = this.transact(txn)\n const indexer = indexingTx.findIndexerForCollection(uri.collection)\n if (!indexer) return\n await indexer.deleteRecord(uri, cascading)\n })\n }\n\n async indexHandle(did: string, timestamp: string, force = false) {\n this.db.assertNotTransaction()\n const actor = await this.db.db\n .selectFrom('actor')\n .where('did', '=', did)\n .selectAll()\n .executeTakeFirst()\n if (!force && !needsHandleReindex(actor, timestamp)) {\n return\n }\n const atpData = await this.idResolver.did.resolveAtprotoData(did, true)\n const handleToDid = await this.idResolver.handle.resolve(atpData.handle)\n\n const handle: string | null =\n did === handleToDid ? atpData.handle.toLowerCase() : null\n\n const actorWithHandle =\n handle !== null\n ? await this.db.db\n .selectFrom('actor')\n .where('handle', '=', handle)\n .selectAll()\n .executeTakeFirst()\n : null\n\n // handle contention\n if (handle && actorWithHandle && did !== actorWithHandle.did) {\n await this.db.db\n .updateTable('actor')\n .where('actor.did', '=', actorWithHandle.did)\n .set({ handle: null })\n .execute()\n }\n\n const actorInfo = { handle, indexedAt: timestamp }\n await this.db.db\n .insertInto('actor')\n .values({ did, ...actorInfo })\n .onConflict((oc) => oc.column('did').doUpdateSet(actorInfo))\n .returning('did')\n .executeTakeFirst()\n }\n\n async indexRepo(did: DidString, commit?: string) {\n this.db.assertNotTransaction()\n const now = new Date().toISOString()\n const { pds, signingKey } = await this.idResolver.did.resolveAtprotoData(\n did,\n true,\n )\n\n const { body: car } = await retryXrpc(() => {\n return xrpc(pds, com.atproto.sync.getRepo, { params: { did } })\n })\n const { root, blocks } = await readCarWithRoot(car)\n const verifiedRepo = await verifyRepo(blocks, root, did, signingKey)\n\n const currRecords = await this.getCurrentRecords(did)\n const repoRecords = formatCheckout(did, verifiedRepo)\n const diff = findDiffFromCheckout(currRecords, repoRecords)\n\n await Promise.all(\n diff.map(async (op) => {\n const { uri, cid } = op\n try {\n if (op.op === 'delete') {\n await this.deleteRecord(uri)\n } else {\n const parsed = await getAndParseRecord(blocks, cid)\n await this.indexRecord(\n uri,\n cid,\n parsed.record,\n op.op === 'create' ? WriteOpAction.Create : WriteOpAction.Update,\n now,\n )\n }\n } catch (err) {\n if (err instanceof l.LexValidationError) {\n subLogger.warn(\n { did, commit, uri: uri.toString(), cid: cid.toString() },\n 'skipping indexing of invalid record',\n )\n } else {\n subLogger.error(\n { err, did, commit, uri: uri.toString(), cid: cid.toString() },\n 'skipping indexing due to error processing record',\n )\n }\n }\n }),\n )\n }\n\n async getCurrentRecords(did: string) {\n const res = await this.db.db\n .selectFrom('record')\n .where('did', '=', did)\n .select(['uri', 'cid'])\n .execute()\n return res.reduce(\n (acc, cur) => {\n acc[cur.uri] = {\n uri: new AtUri(cur.uri),\n cid: parseCid(cur.cid),\n }\n return acc\n },\n {} as Record<string, { uri: AtUri; cid: Cid }>,\n )\n }\n\n async setCommitLastSeen(did: string, commit: Cid, rev: string) {\n const { ref } = this.db.db.dynamic\n await this.db.db\n .insertInto('actor_sync')\n .values({\n did,\n commitCid: commit.toString(),\n repoRev: rev ?? null,\n })\n .onConflict((oc) => {\n const excluded = (col: string) => ref(`excluded.${col}`)\n return oc.column('did').doUpdateSet({\n commitCid: sql`${excluded('commitCid')}`,\n repoRev: sql`${excluded('repoRev')}`,\n })\n })\n .execute()\n }\n\n findIndexerForCollection(collection: string) {\n for (const indexer of Object.values(this.records)) {\n if (indexer.collection === collection) {\n return indexer\n }\n }\n }\n\n async updateActorStatus(\n did: DidString,\n active: boolean,\n status: string = '',\n ) {\n let upstreamStatus: string | null\n if (active) {\n upstreamStatus = null\n } else if (['deactivated', 'suspended', 'takendown'].includes(status)) {\n upstreamStatus = status\n } else {\n throw new Error(`Unrecognized account status: ${status}`)\n }\n await this.db.db\n .updateTable('actor')\n .set({ upstreamStatus })\n .where('did', '=', did)\n .execute()\n }\n\n async deleteActor(did: DidString) {\n this.db.assertNotTransaction()\n const actorIsHosted = await this.getActorIsHosted(did)\n if (actorIsHosted === false) {\n await this.db.db.deleteFrom('actor').where('did', '=', did).execute()\n await this.unindexActor(did)\n await this.db.db\n .deleteFrom('notification')\n .where('did', '=', did)\n .execute()\n }\n }\n\n private async getActorIsHosted(did: DidString): Promise<boolean> {\n const doc = await this.idResolver.did.resolve(did, true)\n const pds = doc && getPds(doc)\n if (!pds) return false\n\n return retryXrpc(async () => {\n const res = await xrpcSafe(pds, com.atproto.sync.getLatestCommit, {\n params: { did },\n })\n if (res.success) return true\n if (res.error === 'RepoNotFound') return false\n throw res.reason // let retryXrpc() handle retries for transient errors\n })\n }\n\n async unindexActor(did: DidString) {\n this.db.assertNotTransaction()\n // per-record-type indexes\n await this.db.db.deleteFrom('profile').where('creator', '=', did).execute()\n await this.db.db.deleteFrom('follow').where('creator', '=', did).execute()\n await this.db.db.deleteFrom('repost').where('creator', '=', did).execute()\n await this.db.db.deleteFrom('like').where('creator', '=', did).execute()\n await this.db.db\n .deleteFrom('feed_generator')\n .where('creator', '=', did)\n .execute()\n await this.db.db.deleteFrom('labeler').where('creator', '=', did).execute()\n // lists\n await this.db.db\n .deleteFrom('list_item')\n .where('creator', '=', did)\n .execute()\n await this.db.db.deleteFrom('list').where('creator', '=', did).execute()\n // blocks\n await this.db.db\n .deleteFrom('actor_block')\n .where('creator', '=', did)\n .execute()\n await this.db.db\n .deleteFrom('list_block')\n .where('creator', '=', did)\n .execute()\n // posts\n const postByUser = (qb) =>\n qb\n .selectFrom('post')\n .where('post.creator', '=', did)\n .select('post.uri as uri')\n await this.db.db\n .deleteFrom('post_embed_image')\n .where('post_embed_image.postUri', 'in', postByUser)\n .execute()\n await this.db.db\n .deleteFrom('post_embed_external')\n .where('post_embed_external.postUri', 'in', postByUser)\n .execute()\n await this.db.db\n .deleteFrom('post_embed_record')\n .where('post_embed_record.postUri', 'in', postByUser)\n .execute()\n await this.db.db\n .deleteFrom('post_embed_video')\n .where('post_embed_video.postUri', 'in', postByUser)\n .execute()\n await this.db.db\n .deleteFrom('post_embed_gallery_image')\n .where('post_embed_gallery_image.postUri', 'in', postByUser)\n .execute()\n await this.db.db.deleteFrom('post').where('creator', '=', did).execute()\n await this.db.db\n .deleteFrom('thread_gate')\n .where('creator', '=', did)\n .execute()\n await this.db.db\n .deleteFrom('post_gate')\n .where('creator', '=', did)\n .execute()\n // notifications\n await this.db.db\n .deleteFrom('notification')\n .where('notification.author', '=', did)\n .execute()\n // generic record indexes\n await this.db.db\n .deleteFrom('duplicate_record')\n .where('duplicate_record.duplicateOf', 'in', (qb) =>\n qb\n .selectFrom('record')\n .where('record.did', '=', did)\n .select('record.uri as uri'),\n )\n .execute()\n await this.db.db.deleteFrom('record').where('did', '=', did).execute()\n }\n}\n\ntype UriAndCid = {\n uri: AtUri\n cid: Cid\n}\n\ntype IndexOp =\n | ({\n op: 'create' | 'update'\n } & UriAndCid)\n | ({ op: 'delete' } & UriAndCid)\n\nconst findDiffFromCheckout = (\n curr: Record<string, UriAndCid>,\n checkout: Record<string, UriAndCid>,\n): IndexOp[] => {\n const ops: IndexOp[] = []\n for (const uri of Object.keys(checkout)) {\n const record = checkout[uri]\n if (!curr[uri]) {\n ops.push({ op: 'create', ...record })\n } else {\n if (curr[uri].cid.equals(record.cid)) {\n // no-op\n continue\n }\n ops.push({ op: 'update', ...record })\n }\n }\n for (const uri of Object.keys(curr)) {\n const record = curr[uri]\n if (!checkout[uri]) {\n ops.push({ op: 'delete', ...record })\n }\n }\n return ops\n}\n\nconst formatCheckout = (\n did: string,\n verifiedRepo: VerifiedRepo,\n): Record<string, UriAndCid> => {\n const records: Record<string, UriAndCid> = {}\n for (const create of verifiedRepo.creates) {\n const uri = AtUri.make(did, create.collection, create.rkey)\n records[uri.toString()] = {\n uri,\n cid: create.cid,\n }\n }\n return records\n}\n\nconst needsHandleReindex = (\n actor: Selectable<Actor> | undefined,\n timestamp: string,\n) => {\n if (!actor) return true\n const timeDiff =\n new Date(timestamp).getTime() - new Date(actor.indexedAt).getTime()\n // revalidate daily\n if (timeDiff > DAY) return true\n // revalidate more aggressively for invalidated handles\n if (actor.handle === null && timeDiff > HOUR) return true\n return false\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/data-plane/server/indexing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,GAAG,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAc,MAAM,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC/D,OAAO,EAEL,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,UAAU,GACX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,KAAK,EAAa,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,4BAA4B,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAIlD,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,eAAe,MAAM,+BAA+B,CAAA;AAChE,OAAO,KAAK,aAAa,MAAM,6BAA6B,CAAA;AAC5D,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAA;AAC7C,OAAO,KAAK,eA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,CAAC,OAAO,EAAE,CAAC;QAC1C,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;QAC3D,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG;YACxB,GAAG;YACH,GAAG,EAAE,MAAM,CAAC,GAAG;SAChB,CAAA;IACH,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA;AAED,MAAM,kBAAkB,GAAG,CACzB,KAAoC,EACpC,SAAiB,EACjB,EAAE;IACF,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IACvB,MAAM,QAAQ,GACZ,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAA;IACrE,mBAAmB;IACnB,IAAI,QAAQ,GAAG,GAAG;QAAE,OAAO,IAAI,CAAA;IAC/B,uDAAuD;IACvD,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,IAAI,QAAQ,GAAG,IAAI;QAAE,OAAO,IAAI,CAAA;IACzD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA","sourcesContent":["import { Selectable, sql } from 'kysely'\nimport { DAY, HOUR } from '@atproto/common'\nimport { IdResolver, getPds } from '@atproto/identity'\nimport { Cid, l, parseCid, xrpc, xrpcSafe } from '@atproto/lex'\nimport {\n VerifiedRepo,\n WriteOpAction,\n getAndParseRecord,\n readCarWithRoot,\n verifyRepo,\n} from '@atproto/repo'\nimport { AtUri, DidString } from '@atproto/syntax'\nimport { com } from '../../../lexicons/index.js'\nimport { subLogger } from '../../../logger.js'\nimport { retryXrpc } from '../../../util/retry.js'\nimport { BackgroundQueue } from '../background.js'\nimport { Database } from '../db/index.js'\nimport { Actor } from '../db/tables/actor.js'\nimport * as Block from './plugins/block.js'\nimport * as ChatDeclaration from './plugins/chat-declaration.js'\nimport * as FeedGenerator from './plugins/feed-generator.js'\nimport * as Follow from './plugins/follow.js'\nimport * as GermDeclaration from './plugins/germ-declaration.js'\nimport * as Labeler from './plugins/labeler.js'\nimport * as Like from './plugins/like.js'\nimport * as ListBlock from './plugins/list-block.js'\nimport * as ListItem from './plugins/list-item.js'\nimport * as List from './plugins/list.js'\nimport * as NotifDeclaration from './plugins/notif-declaration.js'\nimport * as Postgate from './plugins/post-gate.js'\nimport * as Post from './plugins/post.js'\nimport * as Profile from './plugins/profile.js'\nimport * as Repost from './plugins/repost.js'\nimport * as StarterPack from './plugins/starter-pack.js'\nimport * as Status from './plugins/status.js'\nimport * as Threadgate from './plugins/thread-gate.js'\nimport * as Verification from './plugins/verification.js'\n\nexport class IndexingService {\n records: {\n post: Post.PluginType\n threadGate: Threadgate.PluginType\n postGate: Postgate.PluginType\n like: Like.PluginType\n repost: Repost.PluginType\n follow: Follow.PluginType\n profile: Profile.PluginType\n list: List.PluginType\n listItem: ListItem.PluginType\n listBlock: ListBlock.PluginType\n block: Block.PluginType\n feedGenerator: FeedGenerator.PluginType\n starterPack: StarterPack.PluginType\n labeler: Labeler.PluginType\n notifDeclaration: NotifDeclaration.PluginType\n chatDeclaration: ChatDeclaration.PluginType\n germDeclaration: GermDeclaration.PluginType\n verification: Verification.PluginType\n status: Status.PluginType\n }\n\n constructor(\n public db: Database,\n public idResolver: IdResolver,\n public background: BackgroundQueue,\n ) {\n this.records = {\n post: Post.makePlugin(this.db, this.background),\n threadGate: Threadgate.makePlugin(this.db, this.background),\n postGate: Postgate.makePlugin(this.db, this.background),\n like: Like.makePlugin(this.db, this.background),\n repost: Repost.makePlugin(this.db, this.background),\n follow: Follow.makePlugin(this.db, this.background),\n profile: Profile.makePlugin(this.db, this.background),\n list: List.makePlugin(this.db, this.background),\n listItem: ListItem.makePlugin(this.db, this.background),\n listBlock: ListBlock.makePlugin(this.db, this.background),\n block: Block.makePlugin(this.db, this.background),\n feedGenerator: FeedGenerator.makePlugin(this.db, this.background),\n starterPack: StarterPack.makePlugin(this.db, this.background),\n labeler: Labeler.makePlugin(this.db, this.background),\n notifDeclaration: NotifDeclaration.makePlugin(this.db, this.background),\n chatDeclaration: ChatDeclaration.makePlugin(this.db, this.background),\n germDeclaration: GermDeclaration.makePlugin(this.db, this.background),\n verification: Verification.makePlugin(this.db, this.background),\n status: Status.makePlugin(this.db, this.background),\n }\n }\n\n transact(txn: Database) {\n txn.assertTransaction()\n return new IndexingService(txn, this.idResolver, this.background)\n }\n\n async indexRecord(\n uri: AtUri,\n cid: Cid,\n obj: unknown,\n action: WriteOpAction.Create | WriteOpAction.Update,\n timestamp: string,\n opts?: { disableNotifs?: boolean; disableLabels?: boolean },\n ) {\n this.db.assertNotTransaction()\n return this.db.transaction(async (txn) => {\n const indexingTx = this.transact(txn)\n const indexer = indexingTx.findIndexerForCollection(uri.collection)\n if (!indexer) return\n if (action === WriteOpAction.Create) {\n await indexer.insertRecord(uri, cid, obj, timestamp, opts)\n } else {\n await indexer.updateRecord(uri, cid, obj, timestamp)\n }\n })\n }\n\n async deleteRecord(uri: AtUri, cascading = false) {\n this.db.assertNotTransaction()\n await this.db.transaction(async (txn) => {\n const indexingTx = this.transact(txn)\n const indexer = indexingTx.findIndexerForCollection(uri.collection)\n if (!indexer) return\n await indexer.deleteRecord(uri, cascading)\n })\n }\n\n async indexHandle(did: string, timestamp: string, force = false) {\n this.db.assertNotTransaction()\n const actor = await this.db.db\n .selectFrom('actor')\n .where('did', '=', did)\n .selectAll()\n .executeTakeFirst()\n if (!force && !needsHandleReindex(actor, timestamp)) {\n return\n }\n const atpData = await this.idResolver.did.resolveAtprotoData(did, true)\n const handleToDid = await this.idResolver.handle.resolve(atpData.handle)\n\n const handle: string | null =\n did === handleToDid ? atpData.handle.toLowerCase() : null\n\n const actorWithHandle =\n handle !== null\n ? await this.db.db\n .selectFrom('actor')\n .where('handle', '=', handle)\n .selectAll()\n .executeTakeFirst()\n : null\n\n // handle contention\n if (handle && actorWithHandle && did !== actorWithHandle.did) {\n await this.db.db\n .updateTable('actor')\n .where('actor.did', '=', actorWithHandle.did)\n .set({ handle: null })\n .execute()\n }\n\n const actorInfo = { handle, indexedAt: timestamp }\n await this.db.db\n .insertInto('actor')\n .values({ did, ...actorInfo })\n .onConflict((oc) => oc.column('did').doUpdateSet(actorInfo))\n .returning('did')\n .executeTakeFirst()\n }\n\n async indexRepo(did: DidString, commit?: string) {\n this.db.assertNotTransaction()\n const now = new Date().toISOString()\n const { pds, signingKey } = await this.idResolver.did.resolveAtprotoData(\n did,\n true,\n )\n\n const { body: car } = await retryXrpc(() => {\n return xrpc(pds, com.atproto.sync.getRepo, { params: { did } })\n })\n const { root, blocks } = await readCarWithRoot(car)\n const verifiedRepo = await verifyRepo(blocks, root, did, signingKey)\n\n const currRecords = await this.getCurrentRecords(did)\n const repoRecords = formatCheckout(did, verifiedRepo)\n const diff = findDiffFromCheckout(currRecords, repoRecords)\n\n await Promise.all(\n diff.map(async (op) => {\n const { uri, cid } = op\n try {\n if (op.op === 'delete') {\n await this.deleteRecord(uri)\n } else {\n const parsed = await getAndParseRecord(blocks, cid)\n await this.indexRecord(\n uri,\n cid,\n parsed.record,\n op.op === 'create' ? WriteOpAction.Create : WriteOpAction.Update,\n now,\n )\n }\n } catch (err) {\n if (err instanceof l.LexValidationError) {\n subLogger.warn(\n { did, commit, uri: uri.toString(), cid: cid.toString() },\n 'skipping indexing of invalid record',\n )\n } else {\n subLogger.error(\n { err, did, commit, uri: uri.toString(), cid: cid.toString() },\n 'skipping indexing due to error processing record',\n )\n }\n }\n }),\n )\n }\n\n async getCurrentRecords(did: string) {\n const res = await this.db.db\n .selectFrom('record')\n .where('did', '=', did)\n .select(['uri', 'cid'])\n .execute()\n return res.reduce(\n (acc, cur) => {\n acc[cur.uri] = {\n uri: new AtUri(cur.uri),\n cid: parseCid(cur.cid),\n }\n return acc\n },\n {} as Record<string, { uri: AtUri; cid: Cid }>,\n )\n }\n\n async setCommitLastSeen(did: string, commit: Cid, rev: string) {\n const { ref } = this.db.db.dynamic\n await this.db.db\n .insertInto('actor_sync')\n .values({\n did,\n commitCid: commit.toString(),\n repoRev: rev ?? null,\n })\n .onConflict((oc) => {\n const excluded = (col: string) => ref(`excluded.${col}`)\n return oc.column('did').doUpdateSet({\n commitCid: sql`${excluded('commitCid')}`,\n repoRev: sql`${excluded('repoRev')}`,\n })\n })\n .execute()\n }\n\n findIndexerForCollection(collection: string) {\n for (const indexer of Object.values(this.records)) {\n if (indexer.collection === collection) {\n return indexer\n }\n }\n }\n\n async updateActorStatus(\n did: DidString,\n active: boolean,\n status: string = '',\n ) {\n let upstreamStatus: string | null\n if (active) {\n upstreamStatus = null\n } else if (['deactivated', 'suspended', 'takendown'].includes(status)) {\n upstreamStatus = status\n } else {\n throw new Error(`Unrecognized account status: ${status}`)\n }\n await this.db.db\n .updateTable('actor')\n .set({ upstreamStatus })\n .where('did', '=', did)\n .execute()\n }\n\n async deleteActor(did: DidString) {\n this.db.assertNotTransaction()\n const actorIsHosted = await this.getActorIsHosted(did)\n if (actorIsHosted === false) {\n await this.db.db.deleteFrom('actor').where('did', '=', did).execute()\n await this.unindexActor(did)\n await this.db.db\n .deleteFrom('notification')\n .where('did', '=', did)\n .execute()\n }\n }\n\n private async getActorIsHosted(did: DidString): Promise<boolean> {\n const doc = await this.idResolver.did.resolve(did, true)\n const pds = doc && getPds(doc)\n if (!pds) return false\n\n return retryXrpc(async () => {\n const res = await xrpcSafe(pds, com.atproto.sync.getLatestCommit, {\n params: { did },\n })\n if (res.success) return true\n if (res.error === 'RepoNotFound') return false\n throw res.reason // let retryXrpc() handle retries for transient errors\n })\n }\n\n async unindexActor(did: DidString) {\n this.db.assertNotTransaction()\n // per-record-type indexes\n await this.db.db.deleteFrom('profile').where('creator', '=', did).execute()\n await this.db.db.deleteFrom('follow').where('creator', '=', did).execute()\n await this.db.db.deleteFrom('repost').where('creator', '=', did).execute()\n await this.db.db.deleteFrom('like').where('creator', '=', did).execute()\n await this.db.db\n .deleteFrom('feed_generator')\n .where('creator', '=', did)\n .execute()\n await this.db.db.deleteFrom('labeler').where('creator', '=', did).execute()\n // lists\n await this.db.db\n .deleteFrom('list_item')\n .where('creator', '=', did)\n .execute()\n await this.db.db.deleteFrom('list').where('creator', '=', did).execute()\n // blocks\n await this.db.db\n .deleteFrom('actor_block')\n .where('creator', '=', did)\n .execute()\n await this.db.db\n .deleteFrom('list_block')\n .where('creator', '=', did)\n .execute()\n // posts\n const postByUser = (qb) =>\n qb\n .selectFrom('post')\n .where('post.creator', '=', did)\n .select('post.uri as uri')\n await this.db.db\n .deleteFrom('post_embed_image')\n .where('post_embed_image.postUri', 'in', postByUser)\n .execute()\n await this.db.db\n .deleteFrom('post_embed_external')\n .where('post_embed_external.postUri', 'in', postByUser)\n .execute()\n await this.db.db\n .deleteFrom('post_embed_record')\n .where('post_embed_record.postUri', 'in', postByUser)\n .execute()\n await this.db.db\n .deleteFrom('post_embed_video')\n .where('post_embed_video.postUri', 'in', postByUser)\n .execute()\n await this.db.db\n .deleteFrom('post_embed_gallery_image')\n .where('post_embed_gallery_image.postUri', 'in', postByUser)\n .execute()\n await this.db.db.deleteFrom('post').where('creator', '=', did).execute()\n await this.db.db\n .deleteFrom('thread_gate')\n .where('creator', '=', did)\n .execute()\n await this.db.db\n .deleteFrom('post_gate')\n .where('creator', '=', did)\n .execute()\n // notifications\n await this.db.db\n .deleteFrom('notification')\n .where('notification.author', '=', did)\n .execute()\n // generic record indexes\n await this.db.db\n .deleteFrom('duplicate_record')\n .where('duplicate_record.duplicateOf', 'in', (qb) =>\n qb\n .selectFrom('record')\n .where('record.did', '=', did)\n .select('record.uri as uri'),\n )\n .execute()\n await this.db.db.deleteFrom('record').where('did', '=', did).execute()\n }\n}\n\ntype UriAndCid = {\n uri: AtUri\n cid: Cid\n}\n\ntype IndexOp =\n | ({\n op: 'create' | 'update'\n } & UriAndCid)\n | ({ op: 'delete' } & UriAndCid)\n\nconst findDiffFromCheckout = (\n curr: Record<string, UriAndCid>,\n checkout: Record<string, UriAndCid>,\n): IndexOp[] => {\n const ops: IndexOp[] = []\n for (const uri of Object.keys(checkout)) {\n const record = checkout[uri]\n if (!curr[uri]) {\n ops.push({ op: 'create', ...record })\n } else {\n if (curr[uri].cid.equals(record.cid)) {\n // no-op\n continue\n }\n ops.push({ op: 'update', ...record })\n }\n }\n for (const uri of Object.keys(curr)) {\n const record = curr[uri]\n if (!checkout[uri]) {\n ops.push({ op: 'delete', ...record })\n }\n }\n return ops\n}\n\nconst formatCheckout = (\n did: string,\n verifiedRepo: VerifiedRepo,\n): Record<string, UriAndCid> => {\n const records: Record<string, UriAndCid> = {}\n for (const create of verifiedRepo.creates) {\n const uri = AtUri.make(did, create.collection, create.rkey)\n records[uri.toString()] = {\n uri,\n cid: create.cid,\n }\n }\n return records\n}\n\nconst needsHandleReindex = (\n actor: Selectable<Actor> | undefined,\n timestamp: string,\n) => {\n if (!actor) return true\n const timeDiff =\n new Date(timestamp).getTime() - new Date(actor.indexedAt).getTime()\n // revalidate daily\n if (timeDiff > DAY) return true\n // revalidate more aggressively for invalidated handles\n if (actor.handle === null && timeDiff > HOUR) return true\n return false\n}\n"]}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { Selectable } from 'kysely';
|
|
2
1
|
import { app } from '../../../../lexicons/index.js';
|
|
3
2
|
import { BackgroundQueue } from '../../background.js';
|
|
4
|
-
import { DatabaseSchemaType } from '../../db/database-schema.js';
|
|
5
3
|
import { Database } from '../../db/index.js';
|
|
6
4
|
import { RecordProcessor } from '../processor.js';
|
|
7
|
-
type IndexedBlock = Selectable<DatabaseSchemaType['actor_block']>;
|
|
8
5
|
export type PluginType = ReturnType<typeof makePlugin>;
|
|
9
|
-
export declare const makePlugin: (db: Database, background: BackgroundQueue) => RecordProcessor<import("@atproto/lex").RecordSchema<"tid", "app.bsky.graph.block", import("@atproto/lex").Validator<Omit<app.bsky.graph.block.Main, "$type">, Omit<app.bsky.graph.block.Main, "$type">>>,
|
|
6
|
+
export declare const makePlugin: (db: Database, background: BackgroundQueue) => RecordProcessor<import("@atproto/lex").RecordSchema<"tid", "app.bsky.graph.block", import("@atproto/lex").Validator<Omit<app.bsky.graph.block.Main, "$type">, Omit<app.bsky.graph.block.Main, "$type">>>, {
|
|
7
|
+
cid: string;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
creator: string;
|
|
10
|
+
indexedAt: string;
|
|
11
|
+
sortAt: string;
|
|
12
|
+
subjectDid: string;
|
|
13
|
+
uri: string;
|
|
14
|
+
}>;
|
|
10
15
|
export default makePlugin;
|
|
11
16
|
//# sourceMappingURL=block.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/block.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/block.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AA6DjD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AACtD,eAAO,MAAM,UAAU,OAAQ,QAAQ,cAAc,eAAe;;;;;;;;EASnE,CAAA;eAEc,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-declaration.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/chat-declaration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAmCjD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AACtD,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"chat-declaration.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/chat-declaration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAmCjD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AACtD,eAAO,MAAM,UAAU,OAAQ,QAAQ,cAAc,eAAe,qPAYnE,CAAA;eAEc,UAAU"}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import { Selectable } from 'kysely';
|
|
2
1
|
import { app } from '../../../../lexicons/index.js';
|
|
3
2
|
import { BackgroundQueue } from '../../background.js';
|
|
4
|
-
import { DatabaseSchemaType } from '../../db/database-schema.js';
|
|
5
3
|
import { Database } from '../../db/index.js';
|
|
6
4
|
import { RecordProcessor } from '../processor.js';
|
|
7
|
-
type IndexedFeedGenerator = Selectable<DatabaseSchemaType['feed_generator']>;
|
|
8
5
|
export type PluginType = ReturnType<typeof makePlugin>;
|
|
9
|
-
export declare const makePlugin: (db: Database, background: BackgroundQueue) => RecordProcessor<import("@atproto/lex").RecordSchema<"any", "app.bsky.feed.generator", import("@atproto/lex").Validator<Omit<app.bsky.feed.generator.Main, "$type">, Omit<app.bsky.feed.generator.Main, "$type">>>,
|
|
6
|
+
export declare const makePlugin: (db: Database, background: BackgroundQueue) => RecordProcessor<import("@atproto/lex").RecordSchema<"any", "app.bsky.feed.generator", import("@atproto/lex").Validator<Omit<app.bsky.feed.generator.Main, "$type">, Omit<app.bsky.feed.generator.Main, "$type">>>, {
|
|
7
|
+
avatarCid: string | null;
|
|
8
|
+
cid: string;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
creator: string;
|
|
11
|
+
description: string | null;
|
|
12
|
+
descriptionFacets: string | null;
|
|
13
|
+
displayName: string;
|
|
14
|
+
feedDid: string;
|
|
15
|
+
indexedAt: string;
|
|
16
|
+
sortAt: string;
|
|
17
|
+
uri: string;
|
|
18
|
+
}>;
|
|
10
19
|
export default makePlugin;
|
|
11
20
|
//# sourceMappingURL=feed-generator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feed-generator.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/feed-generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"feed-generator.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/feed-generator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAyDjD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AACtD,eAAO,MAAM,UAAU,OAAQ,QAAQ,cAAc,eAAe;;;;;;;;;;;;EASnE,CAAA;eAEc,UAAU"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { Selectable } from 'kysely';
|
|
2
1
|
import { app } from '../../../../lexicons/index.js';
|
|
3
2
|
import { BackgroundQueue } from '../../background.js';
|
|
4
|
-
import { DatabaseSchemaType } from '../../db/database-schema.js';
|
|
5
3
|
import { Database } from '../../db/index.js';
|
|
6
4
|
import { RecordProcessor } from '../processor.js';
|
|
7
|
-
type IndexedFollow = Selectable<DatabaseSchemaType['follow']>;
|
|
8
5
|
export type PluginType = ReturnType<typeof makePlugin>;
|
|
9
|
-
export declare const makePlugin: (db: Database, background: BackgroundQueue) => RecordProcessor<import("@atproto/lex").RecordSchema<"tid", "app.bsky.graph.follow", import("@atproto/lex").Validator<Omit<app.bsky.graph.follow.Main, "$type">, Omit<app.bsky.graph.follow.Main, "$type">>>,
|
|
6
|
+
export declare const makePlugin: (db: Database, background: BackgroundQueue) => RecordProcessor<import("@atproto/lex").RecordSchema<"tid", "app.bsky.graph.follow", import("@atproto/lex").Validator<Omit<app.bsky.graph.follow.Main, "$type">, Omit<app.bsky.graph.follow.Main, "$type">>>, {
|
|
7
|
+
cid: string;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
creator: string;
|
|
10
|
+
indexedAt: string;
|
|
11
|
+
sortAt: string;
|
|
12
|
+
subjectDid: string;
|
|
13
|
+
uri: string;
|
|
14
|
+
}>;
|
|
10
15
|
export default makePlugin;
|
|
11
16
|
//# sourceMappingURL=follow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"follow.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/follow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"follow.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/follow.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AA2GjD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AACtD,eAAO,MAAM,UAAU,OAAQ,QAAQ,cAAc,eAAe;;;;;;;;EAUnE,CAAA;eAEc,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"germ-declaration.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/germ-declaration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAmCjD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AACtD,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"germ-declaration.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/germ-declaration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAmCjD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AACtD,eAAO,MAAM,UAAU,OAAQ,QAAQ,cAAc,eAAe,qPASnE,CAAA;eAEc,UAAU"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { Selectable } from 'kysely';
|
|
2
1
|
import { app } from '../../../../lexicons/index.js';
|
|
3
2
|
import { BackgroundQueue } from '../../background.js';
|
|
4
|
-
import { DatabaseSchemaType } from '../../db/database-schema.js';
|
|
5
3
|
import { Database } from '../../db/index.js';
|
|
6
4
|
import { RecordProcessor } from '../processor.js';
|
|
7
|
-
type IndexedLabeler = Selectable<DatabaseSchemaType['labeler']>;
|
|
8
5
|
export type PluginType = ReturnType<typeof makePlugin>;
|
|
9
|
-
export declare const makePlugin: (db: Database, background: BackgroundQueue) => RecordProcessor<import("@atproto/lex").RecordSchema<"literal:self", "app.bsky.labeler.service", import("@atproto/lex").Validator<Omit<app.bsky.labeler.service.Main, "$type">, Omit<app.bsky.labeler.service.Main, "$type">>>,
|
|
6
|
+
export declare const makePlugin: (db: Database, background: BackgroundQueue) => RecordProcessor<import("@atproto/lex").RecordSchema<"literal:self", "app.bsky.labeler.service", import("@atproto/lex").Validator<Omit<app.bsky.labeler.service.Main, "$type">, Omit<app.bsky.labeler.service.Main, "$type">>>, {
|
|
7
|
+
cid: string;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
creator: string;
|
|
10
|
+
indexedAt: string;
|
|
11
|
+
sortAt: string;
|
|
12
|
+
uri: string;
|
|
13
|
+
}>;
|
|
10
14
|
export default makePlugin;
|
|
11
15
|
//# sourceMappingURL=labeler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"labeler.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/labeler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"labeler.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/labeler.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAmDjD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AACtD,eAAO,MAAM,UAAU,OAAQ,QAAQ,cAAc,eAAe;;;;;;;EASnE,CAAA;eAEc,UAAU"}
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import { Selectable } from 'kysely';
|
|
2
1
|
import { app } from '../../../../lexicons/index.js';
|
|
3
2
|
import { BackgroundQueue } from '../../background.js';
|
|
4
|
-
import { DatabaseSchemaType } from '../../db/database-schema.js';
|
|
5
3
|
import { Database } from '../../db/index.js';
|
|
6
4
|
import { RecordProcessor } from '../processor.js';
|
|
7
|
-
type IndexedLike = Selectable<DatabaseSchemaType['like']>;
|
|
8
5
|
export type PluginType = ReturnType<typeof makePlugin>;
|
|
9
|
-
export declare const makePlugin: (db: Database, background: BackgroundQueue) => RecordProcessor<import("@atproto/lex").RecordSchema<"tid", "app.bsky.feed.like", import("@atproto/lex").Validator<Omit<app.bsky.feed.like.Main, "$type">, Omit<app.bsky.feed.like.Main, "$type">>>,
|
|
6
|
+
export declare const makePlugin: (db: Database, background: BackgroundQueue) => RecordProcessor<import("@atproto/lex").RecordSchema<"tid", "app.bsky.feed.like", import("@atproto/lex").Validator<Omit<app.bsky.feed.like.Main, "$type">, Omit<app.bsky.feed.like.Main, "$type">>>, {
|
|
7
|
+
cid: string;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
creator: string;
|
|
10
|
+
indexedAt: string;
|
|
11
|
+
sortAt: string;
|
|
12
|
+
subject: string;
|
|
13
|
+
subjectCid: string;
|
|
14
|
+
uri: string;
|
|
15
|
+
via: string | null;
|
|
16
|
+
viaCid: string | null;
|
|
17
|
+
}>;
|
|
10
18
|
export default makePlugin;
|
|
11
19
|
//# sourceMappingURL=like.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"like.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/like.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"like.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/like.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AA6HjD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AACtD,eAAO,MAAM,UAAU,OAAQ,QAAQ,cAAc,eAAe;;;;;;;;;;;EAUnE,CAAA;eAEc,UAAU"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { Selectable } from 'kysely';
|
|
2
1
|
import { app } from '../../../../lexicons/index.js';
|
|
3
2
|
import { BackgroundQueue } from '../../background.js';
|
|
4
|
-
import { DatabaseSchemaType } from '../../db/database-schema.js';
|
|
5
3
|
import { Database } from '../../db/index.js';
|
|
6
4
|
import { RecordProcessor } from '../processor.js';
|
|
7
|
-
type IndexedListBlock = Selectable<DatabaseSchemaType['list_block']>;
|
|
8
5
|
export type PluginType = ReturnType<typeof makePlugin>;
|
|
9
|
-
export declare const makePlugin: (db: Database, background: BackgroundQueue) => RecordProcessor<import("@atproto/lex").RecordSchema<"tid", "app.bsky.graph.listblock", import("@atproto/lex").Validator<Omit<app.bsky.graph.listblock.Main, "$type">, Omit<app.bsky.graph.listblock.Main, "$type">>>,
|
|
6
|
+
export declare const makePlugin: (db: Database, background: BackgroundQueue) => RecordProcessor<import("@atproto/lex").RecordSchema<"tid", "app.bsky.graph.listblock", import("@atproto/lex").Validator<Omit<app.bsky.graph.listblock.Main, "$type">, Omit<app.bsky.graph.listblock.Main, "$type">>>, {
|
|
7
|
+
cid: string;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
creator: string;
|
|
10
|
+
indexedAt: string;
|
|
11
|
+
sortAt: string;
|
|
12
|
+
subjectUri: string;
|
|
13
|
+
uri: string;
|
|
14
|
+
}>;
|
|
10
15
|
export default makePlugin;
|
|
11
16
|
//# sourceMappingURL=list-block.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-block.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/list-block.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list-block.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/list-block.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AA6DjD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AACtD,eAAO,MAAM,UAAU,OAAQ,QAAQ,cAAc,eAAe;;;;;;;;EASnE,CAAA;eAEc,UAAU"}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { Selectable } from 'kysely';
|
|
2
1
|
import { app } from '../../../../lexicons/index.js';
|
|
3
2
|
import { BackgroundQueue } from '../../background.js';
|
|
4
|
-
import { DatabaseSchemaType } from '../../db/database-schema.js';
|
|
5
3
|
import { Database } from '../../db/index.js';
|
|
6
4
|
import { RecordProcessor } from '../processor.js';
|
|
7
|
-
type IndexedListItem = Selectable<DatabaseSchemaType['list_item']>;
|
|
8
5
|
export type PluginType = ReturnType<typeof makePlugin>;
|
|
9
|
-
export declare const makePlugin: (db: Database, background: BackgroundQueue) => RecordProcessor<import("@atproto/lex").RecordSchema<"tid", "app.bsky.graph.listitem", import("@atproto/lex").Validator<Omit<app.bsky.graph.listitem.Main, "$type">, Omit<app.bsky.graph.listitem.Main, "$type">>>,
|
|
6
|
+
export declare const makePlugin: (db: Database, background: BackgroundQueue) => RecordProcessor<import("@atproto/lex").RecordSchema<"tid", "app.bsky.graph.listitem", import("@atproto/lex").Validator<Omit<app.bsky.graph.listitem.Main, "$type">, Omit<app.bsky.graph.listitem.Main, "$type">>>, {
|
|
7
|
+
cid: string;
|
|
8
|
+
createdAt: string;
|
|
9
|
+
creator: string;
|
|
10
|
+
indexedAt: string;
|
|
11
|
+
listUri: string;
|
|
12
|
+
sortAt: string;
|
|
13
|
+
subjectDid: string;
|
|
14
|
+
uri: string;
|
|
15
|
+
}>;
|
|
10
16
|
export default makePlugin;
|
|
11
17
|
//# sourceMappingURL=list-item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-item.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/list-item.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list-item.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/list-item.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAoEjD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AACtD,eAAO,MAAM,UAAU,OAAQ,QAAQ,cAAc,eAAe;;;;;;;;;EASnE,CAAA;eAEc,UAAU"}
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import { Selectable } from 'kysely';
|
|
2
1
|
import { app } from '../../../../lexicons/index.js';
|
|
3
2
|
import { BackgroundQueue } from '../../background.js';
|
|
4
|
-
import { DatabaseSchemaType } from '../../db/database-schema.js';
|
|
5
3
|
import { Database } from '../../db/index.js';
|
|
6
4
|
import { RecordProcessor } from '../processor.js';
|
|
7
|
-
type IndexedList = Selectable<DatabaseSchemaType['list']>;
|
|
8
5
|
export type PluginType = ReturnType<typeof makePlugin>;
|
|
9
|
-
export declare const makePlugin: (db: Database, background: BackgroundQueue) => RecordProcessor<import("@atproto/lex").RecordSchema<"tid", "app.bsky.graph.list", import("@atproto/lex").Validator<Omit<app.bsky.graph.list.Main, "$type">, Omit<app.bsky.graph.list.Main, "$type">>>,
|
|
6
|
+
export declare const makePlugin: (db: Database, background: BackgroundQueue) => RecordProcessor<import("@atproto/lex").RecordSchema<"tid", "app.bsky.graph.list", import("@atproto/lex").Validator<Omit<app.bsky.graph.list.Main, "$type">, Omit<app.bsky.graph.list.Main, "$type">>>, {
|
|
7
|
+
avatarCid: string | null;
|
|
8
|
+
cid: string;
|
|
9
|
+
createdAt: string;
|
|
10
|
+
creator: string;
|
|
11
|
+
description: string | null;
|
|
12
|
+
descriptionFacets: string | null;
|
|
13
|
+
indexedAt: string;
|
|
14
|
+
name: string;
|
|
15
|
+
purpose: string;
|
|
16
|
+
sortAt: string;
|
|
17
|
+
uri: string;
|
|
18
|
+
}>;
|
|
10
19
|
export default makePlugin;
|
|
11
20
|
//# sourceMappingURL=list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/list.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAyDjD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AACtD,eAAO,MAAM,UAAU,OAAQ,QAAQ,cAAc,eAAe;;;;;;;;;;;;EASnE,CAAA;eAEc,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notif-declaration.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/notif-declaration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAmCjD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AACtD,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"notif-declaration.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/notif-declaration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAmCjD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AACtD,eAAO,MAAM,UAAU,OAAQ,QAAQ,cAAc,eAAe,uQASnE,CAAA;eAEc,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-gate.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/post-gate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AA8EjD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAA;AACtD,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"post-gate.d.ts","sourceRoot":"","sources":["../../../../../src/data-plane/server/indexing/plugins/post-gate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where('post.replyParent', '=', postIdx.post.replyParent)
|
|
402
|
-
.where((
|
|
403
|
-
|
|
404
|
-
|
|
402
|
+
.where((eb) => eb.or([
|
|
403
|
+
eb('post.violatesThreadGate', 'is', null),
|
|
404
|
+
eb('post.violatesThreadGate', '=', false),
|
|
405
|
+
]))
|
|
405
406
|
.select(countAll.as('count')),
|
|
406
407
|
})
|
|
407
408
|
.onConflict((oc) => oc
|