@clioplaylists/clio 0.1.1 → 0.1.3
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/package.json +4 -4
- package/dist/.env +0 -7
- package/dist/api/com/clioplaylists/alpha/actor/getProfile.d.ts +0 -0
- package/dist/api/com/clioplaylists/alpha/actor/getProfile.js +0 -37
- package/dist/api/com/clioplaylists/alpha/feed/getSongs.d.ts +0 -0
- package/dist/api/com/clioplaylists/alpha/feed/getSongs.js +0 -37
- package/dist/api/health.d.ts +0 -3
- package/dist/api/health.js +0 -32
- package/dist/api/index.d.ts +0 -4
- package/dist/api/index.js +0 -43
- package/dist/api/util.d.ts +0 -9
- package/dist/api/util.js +0 -17
- package/dist/auth-verifier.d.ts +0 -92
- package/dist/auth-verifier.js +0 -473
- package/dist/client.d.ts +0 -9
- package/dist/client.js +0 -40
- package/dist/config.d.ts +0 -21
- package/dist/config.js +0 -65
- package/dist/context.d.ts +0 -11
- package/dist/context.js +0 -19
- package/dist/dataplane/bsync/index.js +0 -150
- package/dist/dataplane/client.d.ts +0 -27
- package/dist/dataplane/client.js +0 -165
- package/dist/dataplane/index.d.ts +0 -2
- package/dist/dataplane/index.js +0 -18
- package/dist/dataplane/server/background.d.ts +0 -13
- package/dist/dataplane/server/background.js +0 -51
- package/dist/dataplane/server/db/database-schema.d.ts +0 -13
- package/dist/dataplane/server/db/database-schema.js +0 -2
- package/dist/dataplane/server/db/db.d.ts +0 -32
- package/dist/dataplane/server/db/db.js +0 -228
- package/dist/dataplane/server/db/index.d.ts +0 -1
- package/dist/dataplane/server/db/index.js +0 -17
- package/dist/dataplane/server/db/migrations/20230309T045948368Z-init.d.ts +0 -3
- package/dist/dataplane/server/db/migrations/20230309T045948368Z-init.js +0 -117
- package/dist/dataplane/server/db/migrations/20230420T211446071Z-did-cache.d.ts +0 -3
- package/dist/dataplane/server/db/migrations/20230420T211446071Z-did-cache.js +0 -15
- package/dist/dataplane/server/db/migrations/index.d.ts +0 -2
- package/dist/dataplane/server/db/migrations/index.js +0 -41
- package/dist/dataplane/server/db/migrations/provider.d.ts +0 -11
- package/dist/dataplane/server/db/migrations/provider.js +0 -31
- package/dist/dataplane/server/db/pagination.d.ts +0 -86
- package/dist/dataplane/server/db/pagination.js +0 -144
- package/dist/dataplane/server/db/tables/actor-sync.d.ts +0 -9
- package/dist/dataplane/server/db/tables/actor-sync.js +0 -4
- package/dist/dataplane/server/db/tables/actor.d.ts +0 -11
- package/dist/dataplane/server/db/tables/actor.js +0 -4
- package/dist/dataplane/server/db/tables/artist-list-item.d.ts +0 -11
- package/dist/dataplane/server/db/tables/artist-list-item.js +0 -4
- package/dist/dataplane/server/db/tables/artist.d.ts +0 -10
- package/dist/dataplane/server/db/tables/artist.js +0 -4
- package/dist/dataplane/server/db/tables/playlist-idea.d.ts +0 -14
- package/dist/dataplane/server/db/tables/playlist-idea.js +0 -4
- package/dist/dataplane/server/db/tables/playlist-item.d.ts +0 -11
- package/dist/dataplane/server/db/tables/playlist-item.js +0 -4
- package/dist/dataplane/server/db/tables/playlist.d.ts +0 -10
- package/dist/dataplane/server/db/tables/playlist.js +0 -4
- package/dist/dataplane/server/db/tables/profile.d.ts +0 -15
- package/dist/dataplane/server/db/tables/profile.js +0 -4
- package/dist/dataplane/server/db/tables/record.d.ts +0 -12
- package/dist/dataplane/server/db/tables/record.js +0 -4
- package/dist/dataplane/server/db/tables/song.d.ts +0 -12
- package/dist/dataplane/server/db/tables/song.js +0 -4
- package/dist/dataplane/server/db/types.d.ts +0 -9
- package/dist/dataplane/server/db/types.js +0 -2
- package/dist/dataplane/server/db/util.d.ts +0 -20
- package/dist/dataplane/server/db/util.js +0 -48
- package/dist/dataplane/server/index.d.ts +0 -11
- package/dist/dataplane/server/index.js +0 -52
- package/dist/dataplane/server/indexing/index.d.ts +0 -32
- package/dist/dataplane/server/indexing/index.js +0 -321
- package/dist/dataplane/server/indexing/plugins/playlist-idea.d.ts +0 -14
- package/dist/dataplane/server/indexing/plugins/playlist-idea.js +0 -163
- package/dist/dataplane/server/indexing/plugins/profile.d.ts +0 -8
- package/dist/dataplane/server/indexing/plugins/profile.js +0 -81
- package/dist/dataplane/server/indexing/processor.d.ts +0 -22
- package/dist/dataplane/server/indexing/processor.js +0 -90
- package/dist/dataplane/server/routes/blocks.js +0 -95
- package/dist/dataplane/server/routes/feed-gens.js +0 -56
- package/dist/dataplane/server/routes/feeds.js +0 -128
- package/dist/dataplane/server/routes/follows.js +0 -122
- package/dist/dataplane/server/routes/identity.d.ts +0 -6
- package/dist/dataplane/server/routes/identity.js +0 -56
- package/dist/dataplane/server/routes/index.d.ts +0 -5
- package/dist/dataplane/server/routes/index.js +0 -19
- package/dist/dataplane/server/routes/interactions.js +0 -111
- package/dist/dataplane/server/routes/labels.js +0 -73
- package/dist/dataplane/server/routes/likes.js +0 -76
- package/dist/dataplane/server/routes/lists.js +0 -77
- package/dist/dataplane/server/routes/moderation.js +0 -92
- package/dist/dataplane/server/routes/mutes.js +0 -166
- package/dist/dataplane/server/routes/notifs.js +0 -137
- package/dist/dataplane/server/routes/posts.js +0 -19
- package/dist/dataplane/server/routes/profile.d.ts +0 -5
- package/dist/dataplane/server/routes/profile.js +0 -61
- package/dist/dataplane/server/routes/quotes.js +0 -26
- package/dist/dataplane/server/routes/records.d.ts +0 -11
- package/dist/dataplane/server/routes/records.js +0 -88
- package/dist/dataplane/server/routes/relationships.js +0 -157
- package/dist/dataplane/server/routes/reposts.js +0 -59
- package/dist/dataplane/server/routes/search.js +0 -70
- package/dist/dataplane/server/routes/starter-packs.js +0 -24
- package/dist/dataplane/server/routes/suggestions.js +0 -134
- package/dist/dataplane/server/routes/sync.d.ts +0 -5
- package/dist/dataplane/server/routes/sync.js +0 -14
- package/dist/dataplane/server/routes/threads.js +0 -31
- package/dist/dataplane/server/subscription.d.ts +0 -25
- package/dist/dataplane/server/subscription.js +0 -114
- package/dist/dataplane/server/util.js +0 -117
- package/dist/error.d.ts +0 -2
- package/dist/error.js +0 -14
- package/dist/index.d.ts +0 -20
- package/dist/index.js +0 -115
- package/dist/lexicons/index.d.ts +0 -278
- package/dist/lexicons/index.js +0 -638
- package/dist/lexicons/lexicons.d.ts +0 -8466
- package/dist/lexicons/lexicons.js +0 -4551
- package/dist/lexicons/types/com/atproto/admin/defs.d.ts +0 -50
- package/dist/lexicons/types/com/atproto/admin/defs.js +0 -54
- package/dist/lexicons/types/com/atproto/admin/deleteAccount.d.ts +0 -29
- package/dist/lexicons/types/com/atproto/admin/deleteAccount.js +0 -2
- package/dist/lexicons/types/com/atproto/admin/disableAccountInvites.d.ts +0 -31
- package/dist/lexicons/types/com/atproto/admin/disableAccountInvites.js +0 -2
- package/dist/lexicons/types/com/atproto/admin/disableInviteCodes.d.ts +0 -30
- package/dist/lexicons/types/com/atproto/admin/disableInviteCodes.js +0 -2
- package/dist/lexicons/types/com/atproto/admin/enableAccountInvites.d.ts +0 -31
- package/dist/lexicons/types/com/atproto/admin/enableAccountInvites.js +0 -2
- package/dist/lexicons/types/com/atproto/admin/getAccountInfo.d.ts +0 -33
- package/dist/lexicons/types/com/atproto/admin/getAccountInfo.js +0 -2
- package/dist/lexicons/types/com/atproto/admin/getAccountInfos.d.ts +0 -36
- package/dist/lexicons/types/com/atproto/admin/getAccountInfos.js +0 -2
- package/dist/lexicons/types/com/atproto/admin/getInviteCodes.d.ts +0 -39
- package/dist/lexicons/types/com/atproto/admin/getInviteCodes.js +0 -2
- package/dist/lexicons/types/com/atproto/admin/getSubjectStatus.d.ts +0 -44
- package/dist/lexicons/types/com/atproto/admin/getSubjectStatus.js +0 -2
- package/dist/lexicons/types/com/atproto/admin/searchAccounts.d.ts +0 -39
- package/dist/lexicons/types/com/atproto/admin/searchAccounts.js +0 -2
- package/dist/lexicons/types/com/atproto/admin/sendEmail.d.ts +0 -45
- package/dist/lexicons/types/com/atproto/admin/sendEmail.js +0 -2
- package/dist/lexicons/types/com/atproto/admin/updateAccountEmail.d.ts +0 -31
- package/dist/lexicons/types/com/atproto/admin/updateAccountEmail.js +0 -2
- package/dist/lexicons/types/com/atproto/admin/updateAccountHandle.d.ts +0 -30
- package/dist/lexicons/types/com/atproto/admin/updateAccountHandle.js +0 -2
- package/dist/lexicons/types/com/atproto/admin/updateAccountPassword.d.ts +0 -30
- package/dist/lexicons/types/com/atproto/admin/updateAccountPassword.js +0 -2
- package/dist/lexicons/types/com/atproto/admin/updateSubjectStatus.d.ts +0 -51
- package/dist/lexicons/types/com/atproto/admin/updateSubjectStatus.js +0 -2
- package/dist/lexicons/types/com/atproto/identity/defs.d.ts +0 -14
- package/dist/lexicons/types/com/atproto/identity/defs.js +0 -14
- package/dist/lexicons/types/com/atproto/identity/getRecommendedDidCredentials.d.ts +0 -38
- package/dist/lexicons/types/com/atproto/identity/getRecommendedDidCredentials.js +0 -2
- package/dist/lexicons/types/com/atproto/identity/refreshIdentity.d.ts +0 -39
- package/dist/lexicons/types/com/atproto/identity/refreshIdentity.js +0 -2
- package/dist/lexicons/types/com/atproto/identity/requestPlcOperationSignature.d.ts +0 -23
- package/dist/lexicons/types/com/atproto/identity/requestPlcOperationSignature.js +0 -2
- package/dist/lexicons/types/com/atproto/identity/resolveDid.d.ts +0 -38
- package/dist/lexicons/types/com/atproto/identity/resolveDid.js +0 -2
- package/dist/lexicons/types/com/atproto/identity/resolveHandle.d.ts +0 -37
- package/dist/lexicons/types/com/atproto/identity/resolveHandle.js +0 -2
- package/dist/lexicons/types/com/atproto/identity/resolveIdentity.d.ts +0 -35
- package/dist/lexicons/types/com/atproto/identity/resolveIdentity.js +0 -2
- package/dist/lexicons/types/com/atproto/identity/signPlcOperation.d.ts +0 -46
- package/dist/lexicons/types/com/atproto/identity/signPlcOperation.js +0 -2
- package/dist/lexicons/types/com/atproto/identity/submitPlcOperation.d.ts +0 -29
- package/dist/lexicons/types/com/atproto/identity/submitPlcOperation.js +0 -2
- package/dist/lexicons/types/com/atproto/identity/updateHandle.d.ts +0 -30
- package/dist/lexicons/types/com/atproto/identity/updateHandle.js +0 -2
- package/dist/lexicons/types/com/atproto/label/defs.d.ts +0 -73
- package/dist/lexicons/types/com/atproto/label/defs.js +0 -54
- package/dist/lexicons/types/com/atproto/label/queryLabels.d.ts +0 -42
- package/dist/lexicons/types/com/atproto/label/queryLabels.js +0 -2
- package/dist/lexicons/types/com/atproto/label/subscribeLabels.d.ts +0 -38
- package/dist/lexicons/types/com/atproto/label/subscribeLabels.js +0 -24
- package/dist/lexicons/types/com/atproto/lexicon/schema.d.ts +0 -11
- package/dist/lexicons/types/com/atproto/lexicon/schema.js +0 -15
- package/dist/lexicons/types/com/atproto/moderation/createReport.d.ts +0 -57
- package/dist/lexicons/types/com/atproto/moderation/createReport.js +0 -2
- package/dist/lexicons/types/com/atproto/moderation/defs.d.ts +0 -20
- package/dist/lexicons/types/com/atproto/moderation/defs.js +0 -20
- package/dist/lexicons/types/com/atproto/repo/applyWrites.d.ts +0 -98
- package/dist/lexicons/types/com/atproto/repo/applyWrites.js +0 -64
- package/dist/lexicons/types/com/atproto/repo/createRecord.d.ts +0 -56
- package/dist/lexicons/types/com/atproto/repo/createRecord.js +0 -2
- package/dist/lexicons/types/com/atproto/repo/defs.d.ts +0 -11
- package/dist/lexicons/types/com/atproto/repo/defs.js +0 -14
- package/dist/lexicons/types/com/atproto/repo/deleteRecord.d.ts +0 -51
- package/dist/lexicons/types/com/atproto/repo/deleteRecord.js +0 -2
- package/dist/lexicons/types/com/atproto/repo/describeRepo.d.ts +0 -43
- package/dist/lexicons/types/com/atproto/repo/describeRepo.js +0 -2
- package/dist/lexicons/types/com/atproto/repo/getRecord.d.ts +0 -45
- package/dist/lexicons/types/com/atproto/repo/getRecord.js +0 -2
- package/dist/lexicons/types/com/atproto/repo/importRepo.d.ts +0 -27
- package/dist/lexicons/types/com/atproto/repo/importRepo.js +0 -2
- package/dist/lexicons/types/com/atproto/repo/listMissingBlobs.d.ts +0 -45
- package/dist/lexicons/types/com/atproto/repo/listMissingBlobs.js +0 -14
- package/dist/lexicons/types/com/atproto/repo/listRecords.d.ts +0 -53
- package/dist/lexicons/types/com/atproto/repo/listRecords.js +0 -14
- package/dist/lexicons/types/com/atproto/repo/putRecord.d.ts +0 -58
- package/dist/lexicons/types/com/atproto/repo/putRecord.js +0 -2
- package/dist/lexicons/types/com/atproto/repo/strongRef.d.ts +0 -11
- package/dist/lexicons/types/com/atproto/repo/strongRef.js +0 -15
- package/dist/lexicons/types/com/atproto/repo/uploadBlob.d.ts +0 -39
- package/dist/lexicons/types/com/atproto/repo/uploadBlob.js +0 -2
- package/dist/lexicons/types/com/atproto/server/activateAccount.d.ts +0 -23
- package/dist/lexicons/types/com/atproto/server/activateAccount.js +0 -2
- package/dist/lexicons/types/com/atproto/server/checkAccountStatus.d.ts +0 -42
- package/dist/lexicons/types/com/atproto/server/checkAccountStatus.js +0 -2
- package/dist/lexicons/types/com/atproto/server/confirmEmail.d.ts +0 -31
- package/dist/lexicons/types/com/atproto/server/confirmEmail.js +0 -2
- package/dist/lexicons/types/com/atproto/server/createAccount.d.ts +0 -61
- package/dist/lexicons/types/com/atproto/server/createAccount.js +0 -2
- package/dist/lexicons/types/com/atproto/server/createAppPassword.d.ts +0 -51
- package/dist/lexicons/types/com/atproto/server/createAppPassword.js +0 -14
- package/dist/lexicons/types/com/atproto/server/createInviteCode.d.ts +0 -41
- package/dist/lexicons/types/com/atproto/server/createInviteCode.js +0 -2
- package/dist/lexicons/types/com/atproto/server/createInviteCodes.d.ts +0 -50
- package/dist/lexicons/types/com/atproto/server/createInviteCodes.js +0 -14
- package/dist/lexicons/types/com/atproto/server/createSession.d.ts +0 -56
- package/dist/lexicons/types/com/atproto/server/createSession.js +0 -2
- package/dist/lexicons/types/com/atproto/server/deactivateAccount.d.ts +0 -30
- package/dist/lexicons/types/com/atproto/server/deactivateAccount.js +0 -2
- package/dist/lexicons/types/com/atproto/server/defs.d.ts +0 -23
- package/dist/lexicons/types/com/atproto/server/defs.js +0 -24
- package/dist/lexicons/types/com/atproto/server/deleteAccount.d.ts +0 -32
- package/dist/lexicons/types/com/atproto/server/deleteAccount.js +0 -2
- package/dist/lexicons/types/com/atproto/server/deleteSession.d.ts +0 -23
- package/dist/lexicons/types/com/atproto/server/deleteSession.js +0 -2
- package/dist/lexicons/types/com/atproto/server/describeServer.d.ts +0 -56
- package/dist/lexicons/types/com/atproto/server/describeServer.js +0 -24
- package/dist/lexicons/types/com/atproto/server/getAccountInviteCodes.d.ts +0 -39
- package/dist/lexicons/types/com/atproto/server/getAccountInviteCodes.js +0 -2
- package/dist/lexicons/types/com/atproto/server/getServiceAuth.d.ts +0 -41
- package/dist/lexicons/types/com/atproto/server/getServiceAuth.js +0 -2
- package/dist/lexicons/types/com/atproto/server/getSession.d.ts +0 -42
- package/dist/lexicons/types/com/atproto/server/getSession.js +0 -2
- package/dist/lexicons/types/com/atproto/server/listAppPasswords.d.ts +0 -44
- package/dist/lexicons/types/com/atproto/server/listAppPasswords.js +0 -14
- package/dist/lexicons/types/com/atproto/server/refreshSession.d.ts +0 -42
- package/dist/lexicons/types/com/atproto/server/refreshSession.js +0 -2
- package/dist/lexicons/types/com/atproto/server/requestAccountDelete.d.ts +0 -23
- package/dist/lexicons/types/com/atproto/server/requestAccountDelete.js +0 -2
- package/dist/lexicons/types/com/atproto/server/requestEmailConfirmation.d.ts +0 -23
- package/dist/lexicons/types/com/atproto/server/requestEmailConfirmation.js +0 -2
- package/dist/lexicons/types/com/atproto/server/requestEmailUpdate.d.ts +0 -34
- package/dist/lexicons/types/com/atproto/server/requestEmailUpdate.js +0 -2
- package/dist/lexicons/types/com/atproto/server/requestPasswordReset.d.ts +0 -29
- package/dist/lexicons/types/com/atproto/server/requestPasswordReset.js +0 -2
- package/dist/lexicons/types/com/atproto/server/reserveSigningKey.d.ts +0 -42
- package/dist/lexicons/types/com/atproto/server/reserveSigningKey.js +0 -2
- package/dist/lexicons/types/com/atproto/server/resetPassword.d.ts +0 -31
- package/dist/lexicons/types/com/atproto/server/resetPassword.js +0 -2
- package/dist/lexicons/types/com/atproto/server/revokeAppPassword.d.ts +0 -29
- package/dist/lexicons/types/com/atproto/server/revokeAppPassword.js +0 -2
- package/dist/lexicons/types/com/atproto/server/updateEmail.d.ts +0 -33
- package/dist/lexicons/types/com/atproto/server/updateEmail.js +0 -2
- package/dist/lexicons/types/com/atproto/sync/getBlob.d.ts +0 -36
- package/dist/lexicons/types/com/atproto/sync/getBlob.js +0 -2
- package/dist/lexicons/types/com/atproto/sync/getBlocks.d.ts +0 -35
- package/dist/lexicons/types/com/atproto/sync/getBlocks.js +0 -2
- package/dist/lexicons/types/com/atproto/sync/getCheckout.d.ts +0 -33
- package/dist/lexicons/types/com/atproto/sync/getCheckout.js +0 -2
- package/dist/lexicons/types/com/atproto/sync/getHead.d.ts +0 -37
- package/dist/lexicons/types/com/atproto/sync/getHead.js +0 -2
- package/dist/lexicons/types/com/atproto/sync/getLatestCommit.d.ts +0 -38
- package/dist/lexicons/types/com/atproto/sync/getLatestCommit.js +0 -2
- package/dist/lexicons/types/com/atproto/sync/getRecord.d.ts +0 -37
- package/dist/lexicons/types/com/atproto/sync/getRecord.js +0 -2
- package/dist/lexicons/types/com/atproto/sync/getRepo.d.ts +0 -36
- package/dist/lexicons/types/com/atproto/sync/getRepo.js +0 -2
- package/dist/lexicons/types/com/atproto/sync/getRepoStatus.d.ts +0 -42
- package/dist/lexicons/types/com/atproto/sync/getRepoStatus.js +0 -2
- package/dist/lexicons/types/com/atproto/sync/listBlobs.d.ts +0 -42
- package/dist/lexicons/types/com/atproto/sync/listBlobs.js +0 -2
- package/dist/lexicons/types/com/atproto/sync/listRepos.d.ts +0 -50
- package/dist/lexicons/types/com/atproto/sync/listRepos.js +0 -14
- package/dist/lexicons/types/com/atproto/sync/listReposByCollection.d.ts +0 -46
- package/dist/lexicons/types/com/atproto/sync/listReposByCollection.js +0 -14
- package/dist/lexicons/types/com/atproto/sync/notifyOfUpdate.d.ts +0 -30
- package/dist/lexicons/types/com/atproto/sync/notifyOfUpdate.js +0 -2
- package/dist/lexicons/types/com/atproto/sync/requestCrawl.d.ts +0 -30
- package/dist/lexicons/types/com/atproto/sync/requestCrawl.js +0 -2
- package/dist/lexicons/types/com/atproto/sync/subscribeRepos.d.ts +0 -111
- package/dist/lexicons/types/com/atproto/sync/subscribeRepos.js +0 -64
- package/dist/lexicons/types/com/atproto/temp/addReservedHandle.d.ts +0 -39
- package/dist/lexicons/types/com/atproto/temp/addReservedHandle.js +0 -2
- package/dist/lexicons/types/com/atproto/temp/checkSignupQueue.d.ts +0 -36
- package/dist/lexicons/types/com/atproto/temp/checkSignupQueue.js +0 -2
- package/dist/lexicons/types/com/atproto/temp/fetchLabels.d.ts +0 -37
- package/dist/lexicons/types/com/atproto/temp/fetchLabels.js +0 -2
- package/dist/lexicons/types/com/atproto/temp/requestPhoneVerification.d.ts +0 -29
- package/dist/lexicons/types/com/atproto/temp/requestPhoneVerification.js +0 -2
- package/dist/lexicons/types/com/clioplaylists/alpha/actor/profile.d.ts +0 -19
- package/dist/lexicons/types/com/clioplaylists/alpha/actor/profile.js +0 -15
- package/dist/lexicons/types/com/clioplaylists/alpha/feed/defs.d.ts +0 -32
- package/dist/lexicons/types/com/clioplaylists/alpha/feed/defs.js +0 -24
- package/dist/lexicons/types/com/clioplaylists/alpha/feed/getSongs.d.ts +0 -37
- package/dist/lexicons/types/com/clioplaylists/alpha/feed/getSongs.js +0 -2
- package/dist/lexicons/types/com/clioplaylists/alpha/feed/playlistIdea.d.ts +0 -32
- package/dist/lexicons/types/com/clioplaylists/alpha/feed/playlistIdea.js +0 -35
- package/dist/lexicons/types/com/clioplaylists/alpha/feed/song.js +0 -25
- package/dist/lexicons/util.d.ts +0 -5
- package/dist/lexicons/util.js +0 -13
- package/dist/logger.d.ts +0 -6
- package/dist/logger.js +0 -26
- package/dist/rpc/clio_connect.d.ts +0 -103
- package/dist/rpc/clio_connect.js +0 -110
- package/dist/rpc/clio_pb.d.ts +0 -457
- package/dist/rpc/clio_pb.js +0 -1365
- package/dist/start.d.ts +0 -1
- package/dist/util/retry.d.ts +0 -2
- package/dist/util/retry.js +0 -16
- package/dist/util/uris.d.ts +0 -1
- package/dist/util/uris.js +0 -7
- package/dist/util.d.ts +0 -23
- package/dist/util.js +0 -119
- /package/{dist/start.js → start.js} +0 -0
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const protobuf_1 = require("@bufbuild/protobuf");
|
|
4
|
-
const kysely_1 = require("kysely");
|
|
5
|
-
const pagination_1 = require("../db/pagination");
|
|
6
|
-
const util_1 = require("../db/util");
|
|
7
|
-
exports.default = (db) => ({
|
|
8
|
-
async getNotifications(req) {
|
|
9
|
-
const { actorDid, limit, cursor, priority } = req;
|
|
10
|
-
const { ref } = db.db.dynamic;
|
|
11
|
-
const priorityFollowQb = db.db
|
|
12
|
-
.selectFrom('follow')
|
|
13
|
-
.select((0, kysely_1.sql) `${true}`.as('val'))
|
|
14
|
-
.where('creator', '=', actorDid)
|
|
15
|
-
.whereRef('subjectDid', '=', ref('notif.author'))
|
|
16
|
-
.limit(1);
|
|
17
|
-
let builder = db.db
|
|
18
|
-
.selectFrom('notification as notif')
|
|
19
|
-
.where('notif.did', '=', actorDid)
|
|
20
|
-
.where((clause) => clause
|
|
21
|
-
.where('reasonSubject', 'is', null)
|
|
22
|
-
.orWhereExists(db.db
|
|
23
|
-
.selectFrom('record as subject')
|
|
24
|
-
.selectAll()
|
|
25
|
-
.whereRef('subject.uri', '=', ref('notif.reasonSubject'))))
|
|
26
|
-
.if(priority, (qb) => qb.whereExists(priorityFollowQb))
|
|
27
|
-
.select([
|
|
28
|
-
'notif.author as authorDid',
|
|
29
|
-
'notif.recordUri as uri',
|
|
30
|
-
'notif.recordCid as cid',
|
|
31
|
-
'notif.reason as reason',
|
|
32
|
-
'notif.reasonSubject as reasonSubject',
|
|
33
|
-
'notif.sortAt as sortAt',
|
|
34
|
-
])
|
|
35
|
-
.select(priorityFollowQb.as('priority'));
|
|
36
|
-
const keyset = new pagination_1.TimeCidKeyset(ref('notif.sortAt'), ref('notif.recordCid'));
|
|
37
|
-
builder = (0, pagination_1.paginate)(builder, {
|
|
38
|
-
cursor,
|
|
39
|
-
limit,
|
|
40
|
-
keyset,
|
|
41
|
-
tryIndex: true,
|
|
42
|
-
});
|
|
43
|
-
const notifsRes = await builder.execute();
|
|
44
|
-
const notifications = notifsRes.map((notif) => ({
|
|
45
|
-
recipientDid: actorDid,
|
|
46
|
-
uri: notif.uri,
|
|
47
|
-
reason: notif.reason,
|
|
48
|
-
reasonSubject: notif.reasonSubject ?? undefined,
|
|
49
|
-
timestamp: protobuf_1.Timestamp.fromDate(new Date(notif.sortAt)),
|
|
50
|
-
priority: notif.priority ?? false,
|
|
51
|
-
}));
|
|
52
|
-
return {
|
|
53
|
-
notifications,
|
|
54
|
-
cursor: keyset.packFromResult(notifsRes),
|
|
55
|
-
};
|
|
56
|
-
},
|
|
57
|
-
async getNotificationSeen(req) {
|
|
58
|
-
const { actorDid, priority } = req;
|
|
59
|
-
const res = await db.db
|
|
60
|
-
.selectFrom('actor_state')
|
|
61
|
-
.where('did', '=', actorDid)
|
|
62
|
-
.selectAll()
|
|
63
|
-
.executeTakeFirst();
|
|
64
|
-
if (!res) {
|
|
65
|
-
return {};
|
|
66
|
-
}
|
|
67
|
-
const lastSeen = priority && res.lastSeenPriorityNotifs
|
|
68
|
-
? res.lastSeenPriorityNotifs
|
|
69
|
-
: res.lastSeenNotifs;
|
|
70
|
-
return {
|
|
71
|
-
timestamp: protobuf_1.Timestamp.fromDate(new Date(lastSeen)),
|
|
72
|
-
};
|
|
73
|
-
},
|
|
74
|
-
async getUnreadNotificationCount(req) {
|
|
75
|
-
const { actorDid, priority } = req;
|
|
76
|
-
const { ref } = db.db.dynamic;
|
|
77
|
-
const lastSeenRes = await db.db
|
|
78
|
-
.selectFrom('actor_state')
|
|
79
|
-
.where('did', '=', actorDid)
|
|
80
|
-
.selectAll()
|
|
81
|
-
.executeTakeFirst();
|
|
82
|
-
const lastSeen = priority && lastSeenRes?.lastSeenPriorityNotifs
|
|
83
|
-
? lastSeenRes.lastSeenPriorityNotifs
|
|
84
|
-
: lastSeenRes?.lastSeenNotifs;
|
|
85
|
-
const result = await db.db
|
|
86
|
-
.selectFrom('notification')
|
|
87
|
-
.select(util_1.countAll.as('count'))
|
|
88
|
-
.innerJoin('actor', 'actor.did', 'notification.did')
|
|
89
|
-
.leftJoin('actor_state', 'actor_state.did', 'actor.did')
|
|
90
|
-
.innerJoin('record', 'record.uri', 'notification.recordUri')
|
|
91
|
-
.where((0, util_1.notSoftDeletedClause)(ref('record')))
|
|
92
|
-
.where((0, util_1.notSoftDeletedClause)(ref('actor')))
|
|
93
|
-
// Ensure to hit notification_did_sortat_idx, handling case where lastSeenNotifs is null.
|
|
94
|
-
.where('notification.did', '=', actorDid)
|
|
95
|
-
.where('notification.sortAt', '>', lastSeen ?? '')
|
|
96
|
-
.if(priority, (qb) => qb.whereExists(db.db
|
|
97
|
-
.selectFrom('follow')
|
|
98
|
-
.select((0, kysely_1.sql) `${true}`.as('val'))
|
|
99
|
-
.where('creator', '=', actorDid)
|
|
100
|
-
.whereRef('subjectDid', '=', ref('notification.author'))))
|
|
101
|
-
.executeTakeFirst();
|
|
102
|
-
return {
|
|
103
|
-
count: result?.count,
|
|
104
|
-
};
|
|
105
|
-
},
|
|
106
|
-
async updateNotificationSeen(req) {
|
|
107
|
-
const { actorDid, timestamp, priority } = req;
|
|
108
|
-
if (!timestamp) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
const timestampIso = timestamp.toDate().toISOString();
|
|
112
|
-
let builder = db.db
|
|
113
|
-
.updateTable('actor_state')
|
|
114
|
-
.where('did', '=', actorDid)
|
|
115
|
-
.returningAll();
|
|
116
|
-
if (priority) {
|
|
117
|
-
builder = builder.set({ lastSeenPriorityNotifs: timestampIso });
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
builder = builder.set({ lastSeenNotifs: timestampIso });
|
|
121
|
-
}
|
|
122
|
-
const updateRes = await builder.executeTakeFirst();
|
|
123
|
-
if (updateRes) {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
await db.db
|
|
127
|
-
.insertInto('actor_state')
|
|
128
|
-
.values({
|
|
129
|
-
did: actorDid,
|
|
130
|
-
lastSeenNotifs: timestampIso,
|
|
131
|
-
priorityNotifs: priority,
|
|
132
|
-
lastSeenPriorityNotifs: priority ? timestampIso : undefined,
|
|
133
|
-
})
|
|
134
|
-
.onConflict((oc) => oc.doNothing())
|
|
135
|
-
.executeTakeFirst();
|
|
136
|
-
},
|
|
137
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const common_1 = require("@atproto/common");
|
|
4
|
-
exports.default = (db) => ({
|
|
5
|
-
async getPostReplyCounts(req) {
|
|
6
|
-
const uris = req.refs.map((ref) => ref.uri);
|
|
7
|
-
if (uris.length === 0) {
|
|
8
|
-
return { counts: [] };
|
|
9
|
-
}
|
|
10
|
-
const res = await db.db
|
|
11
|
-
.selectFrom('post_agg')
|
|
12
|
-
.select(['uri', 'replyCount'])
|
|
13
|
-
.where('uri', 'in', uris)
|
|
14
|
-
.execute();
|
|
15
|
-
const byUri = (0, common_1.keyBy)(res, 'uri');
|
|
16
|
-
const counts = uris.map((uri) => byUri.get(uri)?.replyCount ?? 0);
|
|
17
|
-
return { counts };
|
|
18
|
-
},
|
|
19
|
-
});
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const common_1 = require("@atproto/common");
|
|
4
|
-
const util_1 = require("../../../util");
|
|
5
|
-
const records_1 = require("./records");
|
|
6
|
-
exports.default = (db) => ({
|
|
7
|
-
async getActors(req) {
|
|
8
|
-
const { dids } = req;
|
|
9
|
-
if (dids.length === 0) {
|
|
10
|
-
return { actors: [] };
|
|
11
|
-
}
|
|
12
|
-
const profileUris = dids.map((did) => `at://${did}/app.bsky.actor.profile/self`);
|
|
13
|
-
const chatDeclarationUris = dids.map((did) => `at://${did}/chat.bsky.actor.declaration/self`);
|
|
14
|
-
const [handlesRes, profiles, chatDeclarations] = await Promise.all([
|
|
15
|
-
db.db.selectFrom('actor').selectAll().execute(),
|
|
16
|
-
(0, records_1.getRecords)(db)({ uris: profileUris }),
|
|
17
|
-
(0, records_1.getRecords)(db)({ uris: chatDeclarationUris }),
|
|
18
|
-
]);
|
|
19
|
-
const byDid = (0, common_1.keyBy)(handlesRes, 'did');
|
|
20
|
-
const actors = dids.map((did, i) => {
|
|
21
|
-
const row = byDid.get(did);
|
|
22
|
-
const chatDeclaration = (0, util_1.parseRecordBytes)(chatDeclarations.records[i].record);
|
|
23
|
-
return {
|
|
24
|
-
exists: !!row,
|
|
25
|
-
handle: row?.handle ?? undefined,
|
|
26
|
-
profile: profiles.records[i],
|
|
27
|
-
takenDown: !!row?.takedownRef,
|
|
28
|
-
takedownRef: row?.takedownRef || undefined,
|
|
29
|
-
tombstonedAt: undefined, // in current implementation, tombstoned actors are deleted
|
|
30
|
-
allowIncomingChatsFrom: typeof chatDeclaration?.['allowIncoming'] === 'string'
|
|
31
|
-
? chatDeclaration['allowIncoming']
|
|
32
|
-
: undefined,
|
|
33
|
-
upstreamStatus: row?.upstreamStatus ?? '',
|
|
34
|
-
createdAt: profiles.records[i].createdAt, // @NOTE profile creation date not trusted in production
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
return { actors };
|
|
38
|
-
},
|
|
39
|
-
async getDidsByHandles(req) {
|
|
40
|
-
const { handles } = req;
|
|
41
|
-
if (handles.length === 0) {
|
|
42
|
-
return { dids: [] };
|
|
43
|
-
}
|
|
44
|
-
const res = await db.db
|
|
45
|
-
.selectFrom('actor')
|
|
46
|
-
.where('handle', 'in', handles)
|
|
47
|
-
.selectAll()
|
|
48
|
-
.execute();
|
|
49
|
-
const byHandle = (0, common_1.keyBy)(res, 'handle');
|
|
50
|
-
const dids = handles.map((handle) => byHandle.get(handle)?.did ?? '');
|
|
51
|
-
return { dids };
|
|
52
|
-
},
|
|
53
|
-
async updateActorUpstreamStatus(req) {
|
|
54
|
-
const { actorDid, upstreamStatus } = req;
|
|
55
|
-
await db.db
|
|
56
|
-
.updateTable('actor')
|
|
57
|
-
.set({ upstreamStatus })
|
|
58
|
-
.where('did', '=', actorDid)
|
|
59
|
-
.execute();
|
|
60
|
-
},
|
|
61
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const pagination_1 = require("../db/pagination");
|
|
4
|
-
exports.default = (db) => ({
|
|
5
|
-
async getQuotesBySubjectSorted(req) {
|
|
6
|
-
const { subject, cursor, limit } = req;
|
|
7
|
-
const { ref } = db.db.dynamic;
|
|
8
|
-
if (!subject?.uri)
|
|
9
|
-
return { uris: [] };
|
|
10
|
-
let builder = db.db
|
|
11
|
-
.selectFrom('quote')
|
|
12
|
-
.where('quote.subject', '=', subject.uri)
|
|
13
|
-
.select(['quote.uri', 'quote.cid', 'quote.sortAt']);
|
|
14
|
-
const keyset = new pagination_1.TimeCidKeyset(ref('quote.sortAt'), ref('quote.cid'));
|
|
15
|
-
builder = (0, pagination_1.paginate)(builder, {
|
|
16
|
-
limit,
|
|
17
|
-
cursor,
|
|
18
|
-
keyset,
|
|
19
|
-
});
|
|
20
|
-
const quotes = await builder.execute();
|
|
21
|
-
return {
|
|
22
|
-
uris: quotes.map((q) => q.uri),
|
|
23
|
-
cursor: keyset.packFromResult(quotes),
|
|
24
|
-
};
|
|
25
|
-
},
|
|
26
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ServiceImpl } from '@connectrpc/connect';
|
|
2
|
-
import { ClioService } from '../../../rpc/clio_connect';
|
|
3
|
-
import { Record } from '../../../rpc/clio_pb';
|
|
4
|
-
import { Database } from '../db';
|
|
5
|
-
declare const _default: (db: Database) => Partial<ServiceImpl<typeof ClioService>>;
|
|
6
|
-
export default _default;
|
|
7
|
-
export declare const getRecords: (db: Database, collection?: string) => (req: {
|
|
8
|
-
uris: string[];
|
|
9
|
-
}) => Promise<{
|
|
10
|
-
records: Record[];
|
|
11
|
-
}>;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.getRecords = void 0;
|
|
37
|
-
const common_1 = require("@atproto/common");
|
|
38
|
-
const syntax_1 = require("@atproto/syntax");
|
|
39
|
-
const protobuf_1 = require("@bufbuild/protobuf");
|
|
40
|
-
const ui8 = __importStar(require("uint8arrays"));
|
|
41
|
-
const lexicons_1 = require("../../../lexicons/lexicons");
|
|
42
|
-
const clio_pb_1 = require("../../../rpc/clio_pb");
|
|
43
|
-
exports.default = (db) => ({
|
|
44
|
-
getProfileRecords: (0, exports.getRecords)(db, lexicons_1.ids.ComClioplaylistsAlphaActorProfile),
|
|
45
|
-
});
|
|
46
|
-
const getRecords = (db, collection) => async (req) => {
|
|
47
|
-
const validUris = collection
|
|
48
|
-
? req.uris.filter((uri) => new syntax_1.AtUri(uri).collection === collection)
|
|
49
|
-
: req.uris;
|
|
50
|
-
const res = validUris.length
|
|
51
|
-
? await db.db
|
|
52
|
-
.selectFrom('record')
|
|
53
|
-
.selectAll()
|
|
54
|
-
.where('uri', 'in', validUris)
|
|
55
|
-
.execute()
|
|
56
|
-
: [];
|
|
57
|
-
const byUri = (0, common_1.keyBy)(res, 'uri');
|
|
58
|
-
const records = req.uris.map((uri) => {
|
|
59
|
-
const row = byUri.get(uri);
|
|
60
|
-
const json = row ? row.json : JSON.stringify(null);
|
|
61
|
-
const createdAtRaw = new Date(JSON.parse(json)?.['createdAt']);
|
|
62
|
-
const createdAt = !isNaN(createdAtRaw.getTime())
|
|
63
|
-
? protobuf_1.Timestamp.fromDate(createdAtRaw)
|
|
64
|
-
: undefined;
|
|
65
|
-
const indexedAt = row?.indexed_at
|
|
66
|
-
? protobuf_1.Timestamp.fromDate(new Date(row?.indexed_at))
|
|
67
|
-
: undefined;
|
|
68
|
-
const recordBytes = ui8.fromString(json, 'utf8');
|
|
69
|
-
return new clio_pb_1.Record({
|
|
70
|
-
record: recordBytes,
|
|
71
|
-
cid: row?.cid,
|
|
72
|
-
createdAt,
|
|
73
|
-
indexedAt,
|
|
74
|
-
sortedAt: compositeTime(createdAt, indexedAt),
|
|
75
|
-
takenDown: !!row?.takedown_ref,
|
|
76
|
-
takedownRef: row?.takedown_ref ?? undefined,
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
return { records };
|
|
80
|
-
};
|
|
81
|
-
exports.getRecords = getRecords;
|
|
82
|
-
const compositeTime = (ts1, ts2) => {
|
|
83
|
-
if (!ts1)
|
|
84
|
-
return ts2;
|
|
85
|
-
if (!ts2)
|
|
86
|
-
return ts1;
|
|
87
|
-
return ts1.toDate() < ts2.toDate() ? ts1 : ts2;
|
|
88
|
-
};
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const kysely_1 = require("kysely");
|
|
4
|
-
const common_1 = require("@atproto/common");
|
|
5
|
-
const util_1 = require("../db/util");
|
|
6
|
-
exports.default = (db) => ({
|
|
7
|
-
async getRelationships(req) {
|
|
8
|
-
const { actorDid, targetDids } = req;
|
|
9
|
-
if (targetDids.length === 0) {
|
|
10
|
-
return { relationships: [] };
|
|
11
|
-
}
|
|
12
|
-
const { ref } = db.db.dynamic;
|
|
13
|
-
const res = await db.db
|
|
14
|
-
.selectFrom('actor')
|
|
15
|
-
.where('did', 'in', targetDids)
|
|
16
|
-
.select([
|
|
17
|
-
'actor.did',
|
|
18
|
-
db.db
|
|
19
|
-
.selectFrom('mute')
|
|
20
|
-
.where('mute.mutedByDid', '=', actorDid)
|
|
21
|
-
.whereRef('mute.subjectDid', '=', ref('actor.did'))
|
|
22
|
-
.select((0, kysely_1.sql) `${true}`.as('val'))
|
|
23
|
-
.as('muted'),
|
|
24
|
-
db.db
|
|
25
|
-
.selectFrom('list_item')
|
|
26
|
-
.innerJoin('list_mute', 'list_mute.listUri', 'list_item.listUri')
|
|
27
|
-
.where('list_mute.mutedByDid', '=', actorDid)
|
|
28
|
-
.whereRef('list_item.subjectDid', '=', ref('actor.did'))
|
|
29
|
-
.select('list_item.listUri')
|
|
30
|
-
.as('mutedByList'),
|
|
31
|
-
db.db
|
|
32
|
-
.selectFrom('actor_block')
|
|
33
|
-
.where('actor_block.creator', '=', actorDid)
|
|
34
|
-
.whereRef('actor_block.subjectDid', '=', ref('actor.did'))
|
|
35
|
-
.select('uri')
|
|
36
|
-
.as('blocking'),
|
|
37
|
-
db.db
|
|
38
|
-
.selectFrom('actor_block')
|
|
39
|
-
.where('actor_block.subjectDid', '=', actorDid)
|
|
40
|
-
.whereRef('actor_block.creator', '=', ref('actor.did'))
|
|
41
|
-
.select('uri')
|
|
42
|
-
.as('blockedBy'),
|
|
43
|
-
db.db
|
|
44
|
-
.selectFrom('list_item')
|
|
45
|
-
.innerJoin('list_block', 'list_block.subjectUri', 'list_item.listUri')
|
|
46
|
-
.where('list_block.creator', '=', actorDid)
|
|
47
|
-
.whereRef('list_item.subjectDid', '=', ref('actor.did'))
|
|
48
|
-
.select('list_item.listUri')
|
|
49
|
-
.as('blockingByList'),
|
|
50
|
-
db.db
|
|
51
|
-
.selectFrom('list_item')
|
|
52
|
-
.innerJoin('list_block', 'list_block.subjectUri', 'list_item.listUri')
|
|
53
|
-
.where('list_item.subjectDid', '=', actorDid)
|
|
54
|
-
.whereRef('list_block.creator', '=', ref('actor.did'))
|
|
55
|
-
.select('list_item.listUri')
|
|
56
|
-
.as('blockedByList'),
|
|
57
|
-
db.db
|
|
58
|
-
.selectFrom('follow')
|
|
59
|
-
.where('follow.creator', '=', actorDid)
|
|
60
|
-
.whereRef('follow.subjectDid', '=', ref('actor.did'))
|
|
61
|
-
.select('uri')
|
|
62
|
-
.as('following'),
|
|
63
|
-
db.db
|
|
64
|
-
.selectFrom('follow')
|
|
65
|
-
.where('follow.subjectDid', '=', actorDid)
|
|
66
|
-
.whereRef('follow.creator', '=', ref('actor.did'))
|
|
67
|
-
.select('uri')
|
|
68
|
-
.as('followedBy'),
|
|
69
|
-
])
|
|
70
|
-
.execute();
|
|
71
|
-
const byDid = (0, common_1.keyBy)(res, 'did');
|
|
72
|
-
const relationships = targetDids.map((did) => {
|
|
73
|
-
const row = byDid.get(did);
|
|
74
|
-
return {
|
|
75
|
-
muted: row?.muted ?? false,
|
|
76
|
-
mutedByList: row?.mutedByList ?? '',
|
|
77
|
-
blockedBy: row?.blockedBy ?? '',
|
|
78
|
-
blocking: row?.blocking ?? '',
|
|
79
|
-
blockedByList: row?.blockedByList ?? '',
|
|
80
|
-
blockingByList: row?.blockingByList ?? '',
|
|
81
|
-
following: row?.following ?? '',
|
|
82
|
-
followedBy: row?.followedBy ?? '',
|
|
83
|
-
};
|
|
84
|
-
});
|
|
85
|
-
return { relationships };
|
|
86
|
-
},
|
|
87
|
-
async getBlockExistence(req) {
|
|
88
|
-
const { pairs } = req;
|
|
89
|
-
if (pairs.length === 0) {
|
|
90
|
-
return { exists: [], blocks: [] };
|
|
91
|
-
}
|
|
92
|
-
const { ref } = db.db.dynamic;
|
|
93
|
-
const sourceRef = ref('pair.source');
|
|
94
|
-
const targetRef = ref('pair.target');
|
|
95
|
-
const values = (0, util_1.valuesList)(pairs.map((p) => (0, kysely_1.sql) `${p.a}, ${p.b}`));
|
|
96
|
-
const res = await db.db
|
|
97
|
-
.selectFrom(values.as((0, kysely_1.sql) `pair (source, target)`))
|
|
98
|
-
.select([
|
|
99
|
-
(0, kysely_1.sql) `${sourceRef}`.as('source'),
|
|
100
|
-
(0, kysely_1.sql) `${targetRef}`.as('target'),
|
|
101
|
-
(eb) => eb
|
|
102
|
-
.selectFrom('actor_block')
|
|
103
|
-
.whereRef('actor_block.creator', '=', sourceRef)
|
|
104
|
-
.whereRef('actor_block.subjectDid', '=', targetRef)
|
|
105
|
-
.select('uri')
|
|
106
|
-
.as('blocking'),
|
|
107
|
-
(eb) => eb
|
|
108
|
-
.selectFrom('actor_block')
|
|
109
|
-
.whereRef('actor_block.creator', '=', targetRef)
|
|
110
|
-
.whereRef('actor_block.subjectDid', '=', sourceRef)
|
|
111
|
-
.select('uri')
|
|
112
|
-
.as('blockedBy'),
|
|
113
|
-
(eb) => eb
|
|
114
|
-
.selectFrom('list_item')
|
|
115
|
-
.innerJoin('list_block', 'list_block.subjectUri', 'list_item.listUri')
|
|
116
|
-
.whereRef('list_block.creator', '=', sourceRef)
|
|
117
|
-
.whereRef('list_item.subjectDid', '=', targetRef)
|
|
118
|
-
.select('list_item.listUri')
|
|
119
|
-
.as('blockingByList'),
|
|
120
|
-
(eb) => eb
|
|
121
|
-
.selectFrom('list_item')
|
|
122
|
-
.innerJoin('list_block', 'list_block.subjectUri', 'list_item.listUri')
|
|
123
|
-
.whereRef('list_block.creator', '=', targetRef)
|
|
124
|
-
.whereRef('list_item.subjectDid', '=', sourceRef)
|
|
125
|
-
.select('list_item.listUri')
|
|
126
|
-
.as('blockedByList'),
|
|
127
|
-
])
|
|
128
|
-
.execute();
|
|
129
|
-
const getKey = (a, b) => [a, b].sort().join(',');
|
|
130
|
-
const lookup = res.reduce((acc, cur) => {
|
|
131
|
-
const key = getKey(cur.source, cur.target);
|
|
132
|
-
return acc.set(key, cur);
|
|
133
|
-
}, new Map());
|
|
134
|
-
return {
|
|
135
|
-
exists: pairs.map((pair) => {
|
|
136
|
-
const item = lookup.get(getKey(pair.a, pair.b));
|
|
137
|
-
if (!item)
|
|
138
|
-
return false;
|
|
139
|
-
return !!(item.blocking ||
|
|
140
|
-
item.blockedBy ||
|
|
141
|
-
item.blockingByList ||
|
|
142
|
-
item.blockedByList);
|
|
143
|
-
}),
|
|
144
|
-
blocks: pairs.map((pair) => {
|
|
145
|
-
const item = lookup.get(getKey(pair.a, pair.b));
|
|
146
|
-
if (!item)
|
|
147
|
-
return {};
|
|
148
|
-
return {
|
|
149
|
-
blockedBy: item.blockedBy || undefined,
|
|
150
|
-
blocking: item.blocking || undefined,
|
|
151
|
-
blockedByList: item.blockedByList || undefined,
|
|
152
|
-
blockingByList: item.blockingByList || undefined,
|
|
153
|
-
};
|
|
154
|
-
}),
|
|
155
|
-
};
|
|
156
|
-
},
|
|
157
|
-
});
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const common_1 = require("@atproto/common");
|
|
4
|
-
const pagination_1 = require("../db/pagination");
|
|
5
|
-
exports.default = (db) => ({
|
|
6
|
-
async getRepostsBySubject(req) {
|
|
7
|
-
const { subject, cursor, limit } = req;
|
|
8
|
-
const { ref } = db.db.dynamic;
|
|
9
|
-
let builder = db.db
|
|
10
|
-
.selectFrom('repost')
|
|
11
|
-
.where('repost.subject', '=', subject?.uri ?? '')
|
|
12
|
-
.selectAll('repost');
|
|
13
|
-
const keyset = new pagination_1.TimeCidKeyset(ref('repost.sortAt'), ref('repost.cid'));
|
|
14
|
-
builder = (0, pagination_1.paginate)(builder, {
|
|
15
|
-
limit,
|
|
16
|
-
cursor,
|
|
17
|
-
keyset,
|
|
18
|
-
});
|
|
19
|
-
const reposts = await builder.execute();
|
|
20
|
-
return {
|
|
21
|
-
uris: reposts.map((l) => l.uri),
|
|
22
|
-
cursor: keyset.packFromResult(reposts),
|
|
23
|
-
};
|
|
24
|
-
},
|
|
25
|
-
async getRepostsByActorAndSubjects(req) {
|
|
26
|
-
const { actorDid, refs } = req;
|
|
27
|
-
if (refs.length === 0) {
|
|
28
|
-
return { uris: [] };
|
|
29
|
-
}
|
|
30
|
-
const res = await db.db
|
|
31
|
-
.selectFrom('repost')
|
|
32
|
-
.where('creator', '=', actorDid)
|
|
33
|
-
.where('subject', 'in', refs.map(({ uri }) => uri))
|
|
34
|
-
.selectAll()
|
|
35
|
-
.execute();
|
|
36
|
-
const bySubject = (0, common_1.keyBy)(res, 'subject');
|
|
37
|
-
const uris = refs.map(({ uri }) => bySubject.get(uri)?.uri ?? '');
|
|
38
|
-
return { uris };
|
|
39
|
-
},
|
|
40
|
-
async getActorReposts(req) {
|
|
41
|
-
const { actorDid, limit, cursor } = req;
|
|
42
|
-
const { ref } = db.db.dynamic;
|
|
43
|
-
let builder = db.db
|
|
44
|
-
.selectFrom('repost')
|
|
45
|
-
.where('repost.creator', '=', actorDid)
|
|
46
|
-
.selectAll();
|
|
47
|
-
const keyset = new pagination_1.TimeCidKeyset(ref('repost.sortAt'), ref('repost.cid'));
|
|
48
|
-
builder = (0, pagination_1.paginate)(builder, {
|
|
49
|
-
limit,
|
|
50
|
-
cursor,
|
|
51
|
-
keyset,
|
|
52
|
-
});
|
|
53
|
-
const reposts = await builder.execute();
|
|
54
|
-
return {
|
|
55
|
-
uris: reposts.map((l) => l.uri),
|
|
56
|
-
cursor: keyset.packFromResult(reposts),
|
|
57
|
-
};
|
|
58
|
-
},
|
|
59
|
-
});
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const pagination_1 = require("../db/pagination");
|
|
4
|
-
exports.default = (db) => ({
|
|
5
|
-
// @TODO actor search endpoints still fall back to search service
|
|
6
|
-
async searchActors(req) {
|
|
7
|
-
const { term, limit, cursor } = req;
|
|
8
|
-
const { ref } = db.db.dynamic;
|
|
9
|
-
let builder = db.db
|
|
10
|
-
.selectFrom('actor')
|
|
11
|
-
.where('actor.handle', 'like', `%${cleanQuery(term)}%`)
|
|
12
|
-
.selectAll();
|
|
13
|
-
const keyset = new pagination_1.IndexedAtDidKeyset(ref('actor.indexedAt'), ref('actor.did'));
|
|
14
|
-
builder = (0, pagination_1.paginate)(builder, {
|
|
15
|
-
limit,
|
|
16
|
-
cursor,
|
|
17
|
-
keyset,
|
|
18
|
-
tryIndex: true,
|
|
19
|
-
});
|
|
20
|
-
const res = await builder.execute();
|
|
21
|
-
return {
|
|
22
|
-
dids: res.map((row) => row.did),
|
|
23
|
-
cursor: keyset.packFromResult(res),
|
|
24
|
-
};
|
|
25
|
-
},
|
|
26
|
-
// @TODO post search endpoint still falls back to search service
|
|
27
|
-
async searchPosts(req) {
|
|
28
|
-
const { term, limit, cursor } = req;
|
|
29
|
-
const { ref } = db.db.dynamic;
|
|
30
|
-
let builder = db.db
|
|
31
|
-
.selectFrom('post')
|
|
32
|
-
.where('post.text', 'like', `%${term}%`)
|
|
33
|
-
.selectAll();
|
|
34
|
-
const keyset = new pagination_1.TimeCidKeyset(ref('post.sortAt'), ref('post.cid'));
|
|
35
|
-
builder = (0, pagination_1.paginate)(builder, {
|
|
36
|
-
limit,
|
|
37
|
-
cursor,
|
|
38
|
-
keyset,
|
|
39
|
-
tryIndex: true,
|
|
40
|
-
});
|
|
41
|
-
const res = await builder.execute();
|
|
42
|
-
return {
|
|
43
|
-
uris: res.map((row) => row.uri),
|
|
44
|
-
cursor: keyset.packFromResult(res),
|
|
45
|
-
};
|
|
46
|
-
},
|
|
47
|
-
async searchStarterPacks(req) {
|
|
48
|
-
const { term, limit, cursor } = req;
|
|
49
|
-
const { ref } = db.db.dynamic;
|
|
50
|
-
let builder = db.db
|
|
51
|
-
.selectFrom('starter_pack')
|
|
52
|
-
.where('starter_pack.name', 'ilike', `%${term}%`)
|
|
53
|
-
.selectAll();
|
|
54
|
-
const keyset = new pagination_1.TimeCidKeyset(ref('starter_pack.sortAt'), ref('starter_pack.cid'));
|
|
55
|
-
builder = (0, pagination_1.paginate)(builder, {
|
|
56
|
-
limit,
|
|
57
|
-
cursor,
|
|
58
|
-
keyset,
|
|
59
|
-
tryIndex: true,
|
|
60
|
-
});
|
|
61
|
-
const res = await builder.execute();
|
|
62
|
-
const cur = keyset.packFromResult(res);
|
|
63
|
-
return {
|
|
64
|
-
uris: res.map((row) => row.uri),
|
|
65
|
-
cursor: cur,
|
|
66
|
-
};
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
// Remove leading @ in case a handle is input that way
|
|
70
|
-
const cleanQuery = (query) => query.trim().replace(/^@/g, '');
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const pagination_1 = require("../db/pagination");
|
|
4
|
-
exports.default = (db) => ({
|
|
5
|
-
async getActorStarterPacks(req) {
|
|
6
|
-
const { actorDid, limit, cursor } = req;
|
|
7
|
-
const { ref } = db.db.dynamic;
|
|
8
|
-
let builder = db.db
|
|
9
|
-
.selectFrom('starter_pack')
|
|
10
|
-
.selectAll()
|
|
11
|
-
.where('creator', '=', actorDid);
|
|
12
|
-
const keyset = new pagination_1.TimeCidKeyset(ref('starter_pack.sortAt'), ref('starter_pack.cid'));
|
|
13
|
-
builder = (0, pagination_1.paginate)(builder, {
|
|
14
|
-
limit,
|
|
15
|
-
cursor,
|
|
16
|
-
keyset,
|
|
17
|
-
});
|
|
18
|
-
const starterPacks = await builder.execute();
|
|
19
|
-
return {
|
|
20
|
-
uris: starterPacks.map((sp) => sp.uri),
|
|
21
|
-
cursor: keyset.packFromResult(starterPacks),
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
});
|