@clioplaylists/clio 0.1.2 → 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 +1 -1
- 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/package.json +0 -74
- 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,111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const common_1 = require("@atproto/common");
|
|
4
|
-
const util_1 = require("../db/util");
|
|
5
|
-
exports.default = (db) => ({
|
|
6
|
-
async getInteractionCounts(req) {
|
|
7
|
-
const uris = req.refs.map((ref) => ref.uri);
|
|
8
|
-
if (uris.length === 0) {
|
|
9
|
-
return { likes: [], replies: [], reposts: [], quotes: [] };
|
|
10
|
-
}
|
|
11
|
-
const res = await db.db
|
|
12
|
-
.selectFrom('post_agg')
|
|
13
|
-
.where('uri', 'in', uris)
|
|
14
|
-
.selectAll()
|
|
15
|
-
.execute();
|
|
16
|
-
const byUri = (0, common_1.keyBy)(res, 'uri');
|
|
17
|
-
return {
|
|
18
|
-
likes: uris.map((uri) => byUri.get(uri)?.likeCount ?? 0),
|
|
19
|
-
replies: uris.map((uri) => byUri.get(uri)?.replyCount ?? 0),
|
|
20
|
-
reposts: uris.map((uri) => byUri.get(uri)?.repostCount ?? 0),
|
|
21
|
-
quotes: uris.map((uri) => byUri.get(uri)?.quoteCount ?? 0),
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
async getCountsForUsers(req) {
|
|
25
|
-
if (req.dids.length === 0) {
|
|
26
|
-
return {};
|
|
27
|
-
}
|
|
28
|
-
const { ref } = db.db.dynamic;
|
|
29
|
-
const res = await db.db
|
|
30
|
-
.selectFrom('profile_agg')
|
|
31
|
-
.where('did', 'in', req.dids)
|
|
32
|
-
.selectAll('profile_agg')
|
|
33
|
-
.select([
|
|
34
|
-
db.db
|
|
35
|
-
.selectFrom('feed_generator')
|
|
36
|
-
.whereRef('creator', '=', ref('profile_agg.did'))
|
|
37
|
-
.select(util_1.countAll.as('val'))
|
|
38
|
-
.as('feedGensCount'),
|
|
39
|
-
db.db
|
|
40
|
-
.selectFrom('list')
|
|
41
|
-
.whereRef('creator', '=', ref('profile_agg.did'))
|
|
42
|
-
.select(util_1.countAll.as('val'))
|
|
43
|
-
.as('listsCount'),
|
|
44
|
-
db.db
|
|
45
|
-
.selectFrom('starter_pack')
|
|
46
|
-
.whereRef('creator', '=', ref('profile_agg.did'))
|
|
47
|
-
.select(util_1.countAll.as('val'))
|
|
48
|
-
.as('starterPacksCount'),
|
|
49
|
-
])
|
|
50
|
-
.execute();
|
|
51
|
-
const byDid = (0, common_1.keyBy)(res, 'did');
|
|
52
|
-
return {
|
|
53
|
-
followers: req.dids.map((uri) => byDid.get(uri)?.followersCount ?? 0),
|
|
54
|
-
following: req.dids.map((uri) => byDid.get(uri)?.followsCount ?? 0),
|
|
55
|
-
posts: req.dids.map((uri) => byDid.get(uri)?.postsCount ?? 0),
|
|
56
|
-
lists: req.dids.map((uri) => byDid.get(uri)?.listsCount ?? 0),
|
|
57
|
-
feeds: req.dids.map((uri) => byDid.get(uri)?.feedGensCount ?? 0),
|
|
58
|
-
starterPacks: req.dids.map((uri) => byDid.get(uri)?.starterPacksCount ?? 0),
|
|
59
|
-
};
|
|
60
|
-
},
|
|
61
|
-
async getStarterPackCounts(req) {
|
|
62
|
-
const weekAgo = new Date(Date.now() - 7 * common_1.DAY);
|
|
63
|
-
const uris = req.refs.map((ref) => ref.uri);
|
|
64
|
-
if (uris.length === 0) {
|
|
65
|
-
return { joinedAllTime: [], joinedWeek: [] };
|
|
66
|
-
}
|
|
67
|
-
const countsAllTime = await db.db
|
|
68
|
-
.selectFrom('profile')
|
|
69
|
-
.where('joinedViaStarterPackUri', 'in', uris)
|
|
70
|
-
.select(['joinedViaStarterPackUri as uri', util_1.countAll.as('count')])
|
|
71
|
-
.groupBy('joinedViaStarterPackUri')
|
|
72
|
-
.execute();
|
|
73
|
-
const countsWeek = await db.db
|
|
74
|
-
.selectFrom('profile')
|
|
75
|
-
.where('joinedViaStarterPackUri', 'in', uris)
|
|
76
|
-
.where('createdAt', '>', weekAgo.toISOString())
|
|
77
|
-
.select(['joinedViaStarterPackUri as uri', util_1.countAll.as('count')])
|
|
78
|
-
.groupBy('joinedViaStarterPackUri')
|
|
79
|
-
.execute();
|
|
80
|
-
const countsWeekByUri = countsWeek.reduce((cur, item) => {
|
|
81
|
-
if (!item.uri)
|
|
82
|
-
return cur;
|
|
83
|
-
return cur.set(item.uri, item.count);
|
|
84
|
-
}, new Map());
|
|
85
|
-
const countsAllTimeByUri = countsAllTime.reduce((cur, item) => {
|
|
86
|
-
if (!item.uri)
|
|
87
|
-
return cur;
|
|
88
|
-
return cur.set(item.uri, item.count);
|
|
89
|
-
}, new Map());
|
|
90
|
-
return {
|
|
91
|
-
joinedWeek: uris.map((uri) => countsWeekByUri.get(uri) ?? 0),
|
|
92
|
-
joinedAllTime: uris.map((uri) => countsAllTimeByUri.get(uri) ?? 0),
|
|
93
|
-
};
|
|
94
|
-
},
|
|
95
|
-
async getListCounts(req) {
|
|
96
|
-
const uris = req.refs.map((ref) => ref.uri);
|
|
97
|
-
if (uris.length === 0) {
|
|
98
|
-
return { listItems: [] };
|
|
99
|
-
}
|
|
100
|
-
const countsListItems = await db.db
|
|
101
|
-
.selectFrom('list_item')
|
|
102
|
-
.where('listUri', 'in', uris)
|
|
103
|
-
.select(['listUri as uri', util_1.countAll.as('count')])
|
|
104
|
-
.groupBy('listUri')
|
|
105
|
-
.execute();
|
|
106
|
-
const countsByUri = (0, common_1.keyBy)(countsListItems, 'uri');
|
|
107
|
-
return {
|
|
108
|
-
listItems: uris.map((uri) => countsByUri.get(uri)?.count ?? 0),
|
|
109
|
-
};
|
|
110
|
-
},
|
|
111
|
-
});
|
|
@@ -1,73 +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
|
-
const ui8 = __importStar(require("uint8arrays"));
|
|
37
|
-
const common_1 = require("@atproto/common");
|
|
38
|
-
exports.default = (db) => ({
|
|
39
|
-
async getLabels(req) {
|
|
40
|
-
const { subjects, issuers } = req;
|
|
41
|
-
if (subjects.length === 0 || issuers.length === 0) {
|
|
42
|
-
return { labels: [] };
|
|
43
|
-
}
|
|
44
|
-
const res = await db.db
|
|
45
|
-
.selectFrom('label')
|
|
46
|
-
.where('uri', 'in', subjects)
|
|
47
|
-
.where('src', 'in', issuers)
|
|
48
|
-
.selectAll()
|
|
49
|
-
.execute();
|
|
50
|
-
const labelsBySubject = new Map();
|
|
51
|
-
res.forEach((l) => {
|
|
52
|
-
const labels = labelsBySubject.get(l.uri) ?? [];
|
|
53
|
-
labels.push(l);
|
|
54
|
-
labelsBySubject.set(l.uri, labels);
|
|
55
|
-
});
|
|
56
|
-
// intentionally duplicate label results, appview frontend should be defensive to this
|
|
57
|
-
const labels = subjects.flatMap((sub) => {
|
|
58
|
-
const labelsForSub = labelsBySubject.get(sub) ?? [];
|
|
59
|
-
return labelsForSub.map((l) => {
|
|
60
|
-
const formatted = (0, common_1.noUndefinedVals)({
|
|
61
|
-
...l,
|
|
62
|
-
cid: l.cid === '' ? undefined : l.cid,
|
|
63
|
-
neg: l.neg === true ? true : undefined,
|
|
64
|
-
});
|
|
65
|
-
return ui8.fromString(JSON.stringify(formatted), 'utf8');
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
return { labels };
|
|
69
|
-
},
|
|
70
|
-
async getAllLabelers() {
|
|
71
|
-
throw new Error('not implemented');
|
|
72
|
-
},
|
|
73
|
-
});
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
7
|
-
const common_1 = require("@atproto/common");
|
|
8
|
-
const pagination_1 = require("../db/pagination");
|
|
9
|
-
exports.default = (db) => ({
|
|
10
|
-
async getLikesBySubjectSorted(req) {
|
|
11
|
-
const { subject, cursor, limit } = req;
|
|
12
|
-
const { ref } = db.db.dynamic;
|
|
13
|
-
if (!subject?.uri) {
|
|
14
|
-
return { uris: [] };
|
|
15
|
-
}
|
|
16
|
-
// @NOTE ignoring subject.cid
|
|
17
|
-
let builder = db.db
|
|
18
|
-
.selectFrom('like')
|
|
19
|
-
.where('like.subject', '=', subject?.uri)
|
|
20
|
-
.selectAll('like');
|
|
21
|
-
const keyset = new pagination_1.TimeCidKeyset(ref('like.sortAt'), ref('like.cid'));
|
|
22
|
-
builder = (0, pagination_1.paginate)(builder, {
|
|
23
|
-
limit,
|
|
24
|
-
cursor,
|
|
25
|
-
keyset,
|
|
26
|
-
});
|
|
27
|
-
const likes = await builder.execute();
|
|
28
|
-
return {
|
|
29
|
-
uris: likes.map((l) => l.uri),
|
|
30
|
-
cursor: keyset.packFromResult(likes),
|
|
31
|
-
};
|
|
32
|
-
},
|
|
33
|
-
// @NOTE deprecated in favor of getLikesBySubjectSorted
|
|
34
|
-
async getLikesBySubject(req, context) {
|
|
35
|
-
(0, node_assert_1.default)(this.getLikesBySubjectSorted);
|
|
36
|
-
return this.getLikesBySubjectSorted(req, context);
|
|
37
|
-
},
|
|
38
|
-
async getLikesByActorAndSubjects(req) {
|
|
39
|
-
const { actorDid, refs } = req;
|
|
40
|
-
if (refs.length === 0) {
|
|
41
|
-
return { uris: [] };
|
|
42
|
-
}
|
|
43
|
-
// @NOTE ignoring ref.cid
|
|
44
|
-
const res = await db.db
|
|
45
|
-
.selectFrom('like')
|
|
46
|
-
.where('creator', '=', actorDid)
|
|
47
|
-
.where('subject', 'in', refs.map(({ uri }) => uri))
|
|
48
|
-
.selectAll()
|
|
49
|
-
.execute();
|
|
50
|
-
const bySubject = (0, common_1.keyBy)(res, 'subject');
|
|
51
|
-
const uris = refs.map(({ uri }) => bySubject.get(uri)?.uri ?? '');
|
|
52
|
-
return { uris };
|
|
53
|
-
},
|
|
54
|
-
async getActorLikes(req) {
|
|
55
|
-
const { actorDid, limit, cursor } = req;
|
|
56
|
-
const { ref } = db.db.dynamic;
|
|
57
|
-
let builder = db.db
|
|
58
|
-
.selectFrom('like')
|
|
59
|
-
.where('like.creator', '=', actorDid)
|
|
60
|
-
.selectAll();
|
|
61
|
-
const keyset = new pagination_1.TimeCidKeyset(ref('like.sortAt'), ref('like.cid'));
|
|
62
|
-
builder = (0, pagination_1.paginate)(builder, {
|
|
63
|
-
limit,
|
|
64
|
-
cursor,
|
|
65
|
-
keyset,
|
|
66
|
-
});
|
|
67
|
-
const likes = await builder.execute();
|
|
68
|
-
return {
|
|
69
|
-
likes: likes.map((l) => ({
|
|
70
|
-
uri: l.uri,
|
|
71
|
-
subject: l.subject,
|
|
72
|
-
})),
|
|
73
|
-
cursor: keyset.packFromResult(likes),
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
});
|
|
@@ -1,77 +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
|
-
const util_1 = require("../db/util");
|
|
6
|
-
exports.default = (db) => ({
|
|
7
|
-
async getActorLists(req) {
|
|
8
|
-
const { actorDid, cursor, limit } = req;
|
|
9
|
-
const { ref } = db.db.dynamic;
|
|
10
|
-
let builder = db.db
|
|
11
|
-
.selectFrom('list')
|
|
12
|
-
.where('creator', '=', actorDid)
|
|
13
|
-
.selectAll();
|
|
14
|
-
const keyset = new pagination_1.TimeCidKeyset(ref('list.sortAt'), ref('list.cid'));
|
|
15
|
-
builder = (0, pagination_1.paginate)(builder, {
|
|
16
|
-
limit,
|
|
17
|
-
cursor,
|
|
18
|
-
keyset,
|
|
19
|
-
tryIndex: true,
|
|
20
|
-
});
|
|
21
|
-
const lists = await builder.execute();
|
|
22
|
-
return {
|
|
23
|
-
listUris: lists.map((item) => item.uri),
|
|
24
|
-
cursor: keyset.packFromResult(lists),
|
|
25
|
-
};
|
|
26
|
-
},
|
|
27
|
-
async getListMembers(req) {
|
|
28
|
-
const { listUri, cursor, limit } = req;
|
|
29
|
-
const { ref } = db.db.dynamic;
|
|
30
|
-
let builder = db.db
|
|
31
|
-
.selectFrom('list_item')
|
|
32
|
-
.where('listUri', '=', listUri)
|
|
33
|
-
.selectAll();
|
|
34
|
-
const keyset = new pagination_1.TimeCidKeyset(ref('list_item.sortAt'), ref('list_item.cid'));
|
|
35
|
-
builder = (0, pagination_1.paginate)(builder, {
|
|
36
|
-
limit,
|
|
37
|
-
cursor,
|
|
38
|
-
keyset,
|
|
39
|
-
tryIndex: true,
|
|
40
|
-
});
|
|
41
|
-
const listItems = await builder.execute();
|
|
42
|
-
return {
|
|
43
|
-
listitems: listItems.map((item) => ({
|
|
44
|
-
uri: item.uri,
|
|
45
|
-
did: item.subjectDid,
|
|
46
|
-
})),
|
|
47
|
-
cursor: keyset.packFromResult(listItems),
|
|
48
|
-
};
|
|
49
|
-
},
|
|
50
|
-
async getListMembership(req) {
|
|
51
|
-
const { actorDid, listUris } = req;
|
|
52
|
-
if (listUris.length === 0) {
|
|
53
|
-
return { listitemUris: [] };
|
|
54
|
-
}
|
|
55
|
-
const res = await db.db
|
|
56
|
-
.selectFrom('list_item')
|
|
57
|
-
.where('subjectDid', '=', actorDid)
|
|
58
|
-
.where('listUri', 'in', listUris)
|
|
59
|
-
.selectAll()
|
|
60
|
-
.execute();
|
|
61
|
-
const byListUri = (0, common_1.keyBy)(res, 'listUri');
|
|
62
|
-
const listitemUris = listUris.map((uri) => byListUri.get(uri)?.uri ?? '');
|
|
63
|
-
return {
|
|
64
|
-
listitemUris,
|
|
65
|
-
};
|
|
66
|
-
},
|
|
67
|
-
async getListCount(req) {
|
|
68
|
-
const res = await db.db
|
|
69
|
-
.selectFrom('list_item')
|
|
70
|
-
.select(util_1.countAll.as('count'))
|
|
71
|
-
.where('list_item.listUri', '=', req.listUri)
|
|
72
|
-
.executeTakeFirst();
|
|
73
|
-
return {
|
|
74
|
-
count: res?.count,
|
|
75
|
-
};
|
|
76
|
-
},
|
|
77
|
-
});
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = (db) => ({
|
|
4
|
-
async getActorTakedown(req) {
|
|
5
|
-
const { did } = req;
|
|
6
|
-
const res = await db.db
|
|
7
|
-
.selectFrom('actor')
|
|
8
|
-
.where('did', '=', did)
|
|
9
|
-
.select('takedownRef')
|
|
10
|
-
.executeTakeFirst();
|
|
11
|
-
return {
|
|
12
|
-
takenDown: !!res?.takedownRef,
|
|
13
|
-
takedownRef: res?.takedownRef || undefined,
|
|
14
|
-
};
|
|
15
|
-
},
|
|
16
|
-
async getBlobTakedown(req) {
|
|
17
|
-
const { did, cid } = req;
|
|
18
|
-
const res = await db.db
|
|
19
|
-
.selectFrom('blob_takedown')
|
|
20
|
-
.where('did', '=', did)
|
|
21
|
-
.where('cid', '=', cid)
|
|
22
|
-
.select('takedownRef')
|
|
23
|
-
.executeTakeFirst();
|
|
24
|
-
return {
|
|
25
|
-
takenDown: !!res,
|
|
26
|
-
takedownRef: res?.takedownRef || undefined,
|
|
27
|
-
};
|
|
28
|
-
},
|
|
29
|
-
async getRecordTakedown(req) {
|
|
30
|
-
const { recordUri } = req;
|
|
31
|
-
const res = await db.db
|
|
32
|
-
.selectFrom('record')
|
|
33
|
-
.where('uri', '=', recordUri)
|
|
34
|
-
.select('takedownRef')
|
|
35
|
-
.executeTakeFirst();
|
|
36
|
-
return {
|
|
37
|
-
takenDown: !!res?.takedownRef,
|
|
38
|
-
takedownRef: res?.takedownRef || undefined,
|
|
39
|
-
};
|
|
40
|
-
},
|
|
41
|
-
async takedownActor(req) {
|
|
42
|
-
const { did, ref } = req;
|
|
43
|
-
await db.db
|
|
44
|
-
.updateTable('actor')
|
|
45
|
-
.set({ takedownRef: ref || 'TAKEDOWN' })
|
|
46
|
-
.where('did', '=', did)
|
|
47
|
-
.execute();
|
|
48
|
-
},
|
|
49
|
-
async takedownBlob(req) {
|
|
50
|
-
const { did, cid, ref } = req;
|
|
51
|
-
await db.db
|
|
52
|
-
.insertInto('blob_takedown')
|
|
53
|
-
.values({
|
|
54
|
-
did,
|
|
55
|
-
cid,
|
|
56
|
-
takedownRef: ref || 'TAKEDOWN',
|
|
57
|
-
})
|
|
58
|
-
.execute();
|
|
59
|
-
},
|
|
60
|
-
async takedownRecord(req) {
|
|
61
|
-
const { recordUri, ref } = req;
|
|
62
|
-
await db.db
|
|
63
|
-
.updateTable('record')
|
|
64
|
-
.set({ takedownRef: ref || 'TAKEDOWN' })
|
|
65
|
-
.where('uri', '=', recordUri)
|
|
66
|
-
.execute();
|
|
67
|
-
},
|
|
68
|
-
async untakedownActor(req) {
|
|
69
|
-
const { did } = req;
|
|
70
|
-
await db.db
|
|
71
|
-
.updateTable('actor')
|
|
72
|
-
.set({ takedownRef: null })
|
|
73
|
-
.where('did', '=', did)
|
|
74
|
-
.execute();
|
|
75
|
-
},
|
|
76
|
-
async untakedownBlob(req) {
|
|
77
|
-
const { did, cid } = req;
|
|
78
|
-
await db.db
|
|
79
|
-
.deleteFrom('blob_takedown')
|
|
80
|
-
.where('did', '=', did)
|
|
81
|
-
.where('cid', '=', cid)
|
|
82
|
-
.executeTakeFirst();
|
|
83
|
-
},
|
|
84
|
-
async untakedownRecord(req) {
|
|
85
|
-
const { recordUri } = req;
|
|
86
|
-
await db.db
|
|
87
|
-
.updateTable('record')
|
|
88
|
-
.set({ takedownRef: null })
|
|
89
|
-
.where('uri', '=', recordUri)
|
|
90
|
-
.execute();
|
|
91
|
-
},
|
|
92
|
-
});
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
7
|
-
const common_1 = require("@atproto/common");
|
|
8
|
-
const syntax_1 = require("@atproto/syntax");
|
|
9
|
-
const lexicons_1 = require("../../../lexicon/lexicons");
|
|
10
|
-
const pagination_1 = require("../db/pagination");
|
|
11
|
-
exports.default = (db) => ({
|
|
12
|
-
async getActorMutesActor(req) {
|
|
13
|
-
const { actorDid, targetDid } = req;
|
|
14
|
-
const res = await db.db
|
|
15
|
-
.selectFrom('mute')
|
|
16
|
-
.selectAll()
|
|
17
|
-
.where('mutedByDid', '=', actorDid)
|
|
18
|
-
.where('subjectDid', '=', targetDid)
|
|
19
|
-
.executeTakeFirst();
|
|
20
|
-
return {
|
|
21
|
-
muted: !!res,
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
async getMutes(req) {
|
|
25
|
-
const { actorDid, limit, cursor } = req;
|
|
26
|
-
const { ref } = db.db.dynamic;
|
|
27
|
-
let builder = db.db
|
|
28
|
-
.selectFrom('mute')
|
|
29
|
-
.innerJoin('actor', 'actor.did', 'mute.subjectDid')
|
|
30
|
-
.where('mute.mutedByDid', '=', actorDid)
|
|
31
|
-
.selectAll('actor')
|
|
32
|
-
.select('mute.createdAt as createdAt');
|
|
33
|
-
const keyset = new pagination_1.CreatedAtDidKeyset(ref('mute.createdAt'), ref('mute.subjectDid'));
|
|
34
|
-
builder = (0, pagination_1.paginate)(builder, {
|
|
35
|
-
limit,
|
|
36
|
-
cursor,
|
|
37
|
-
keyset,
|
|
38
|
-
});
|
|
39
|
-
const mutes = await builder.execute();
|
|
40
|
-
return {
|
|
41
|
-
dids: mutes.map((m) => m.did),
|
|
42
|
-
cursor: keyset.packFromResult(mutes),
|
|
43
|
-
};
|
|
44
|
-
},
|
|
45
|
-
async getActorMutesActorViaList(req) {
|
|
46
|
-
const { actorDid, targetDid } = req;
|
|
47
|
-
const res = await db.db
|
|
48
|
-
.selectFrom('list_mute')
|
|
49
|
-
.innerJoin('list_item', 'list_item.listUri', 'list_mute.listUri')
|
|
50
|
-
.where('list_mute.mutedByDid', '=', actorDid)
|
|
51
|
-
.where('list_item.subjectDid', '=', targetDid)
|
|
52
|
-
.select('list_mute.listUri')
|
|
53
|
-
.limit(1)
|
|
54
|
-
.executeTakeFirst();
|
|
55
|
-
return {
|
|
56
|
-
listUri: res?.listUri,
|
|
57
|
-
};
|
|
58
|
-
},
|
|
59
|
-
async getMutelistSubscription(req) {
|
|
60
|
-
const { actorDid, listUri } = req;
|
|
61
|
-
const res = await db.db
|
|
62
|
-
.selectFrom('list_mute')
|
|
63
|
-
.where('mutedByDid', '=', actorDid)
|
|
64
|
-
.where('listUri', '=', listUri)
|
|
65
|
-
.selectAll()
|
|
66
|
-
.limit(1)
|
|
67
|
-
.executeTakeFirst();
|
|
68
|
-
return {
|
|
69
|
-
subscribed: !!res,
|
|
70
|
-
};
|
|
71
|
-
},
|
|
72
|
-
async getMutelistSubscriptions(req) {
|
|
73
|
-
const { actorDid, limit, cursor } = req;
|
|
74
|
-
const { ref } = db.db.dynamic;
|
|
75
|
-
let builder = db.db
|
|
76
|
-
.selectFrom('list')
|
|
77
|
-
.whereExists(db.db
|
|
78
|
-
.selectFrom('list_mute')
|
|
79
|
-
.where('list_mute.mutedByDid', '=', actorDid)
|
|
80
|
-
.whereRef('list_mute.listUri', '=', ref('list.uri'))
|
|
81
|
-
.selectAll())
|
|
82
|
-
.selectAll('list');
|
|
83
|
-
const keyset = new pagination_1.TimeCidKeyset(ref('list.createdAt'), ref('list.cid'));
|
|
84
|
-
builder = (0, pagination_1.paginate)(builder, {
|
|
85
|
-
limit,
|
|
86
|
-
cursor,
|
|
87
|
-
keyset,
|
|
88
|
-
});
|
|
89
|
-
const lists = await builder.execute();
|
|
90
|
-
return {
|
|
91
|
-
listUris: lists.map((l) => l.uri),
|
|
92
|
-
cursor: keyset.packFromResult(lists),
|
|
93
|
-
};
|
|
94
|
-
},
|
|
95
|
-
async createActorMute(req) {
|
|
96
|
-
const { actorDid, subjectDid } = req;
|
|
97
|
-
(0, node_assert_1.default)(actorDid !== subjectDid, 'cannot mute yourself'); // @TODO pass message through in http error
|
|
98
|
-
await db.db
|
|
99
|
-
.insertInto('mute')
|
|
100
|
-
.values({
|
|
101
|
-
subjectDid,
|
|
102
|
-
mutedByDid: actorDid,
|
|
103
|
-
createdAt: new Date().toISOString(),
|
|
104
|
-
})
|
|
105
|
-
.onConflict((oc) => oc.doNothing())
|
|
106
|
-
.execute();
|
|
107
|
-
},
|
|
108
|
-
async deleteActorMute(req) {
|
|
109
|
-
const { actorDid, subjectDid } = req;
|
|
110
|
-
(0, node_assert_1.default)(actorDid !== subjectDid, 'cannot mute yourself');
|
|
111
|
-
await db.db
|
|
112
|
-
.deleteFrom('mute')
|
|
113
|
-
.where('subjectDid', '=', subjectDid)
|
|
114
|
-
.where('mutedByDid', '=', actorDid)
|
|
115
|
-
.execute();
|
|
116
|
-
},
|
|
117
|
-
async clearActorMutes(req) {
|
|
118
|
-
const { actorDid } = req;
|
|
119
|
-
await db.db.deleteFrom('mute').where('mutedByDid', '=', actorDid).execute();
|
|
120
|
-
},
|
|
121
|
-
async createActorMutelistSubscription(req) {
|
|
122
|
-
const { actorDid, subjectUri } = req;
|
|
123
|
-
(0, node_assert_1.default)(isListUri(subjectUri), 'must mute a list');
|
|
124
|
-
await db.db
|
|
125
|
-
.insertInto('list_mute')
|
|
126
|
-
.values({
|
|
127
|
-
listUri: subjectUri,
|
|
128
|
-
mutedByDid: actorDid,
|
|
129
|
-
createdAt: new Date().toISOString(),
|
|
130
|
-
})
|
|
131
|
-
.onConflict((oc) => oc.doNothing())
|
|
132
|
-
.execute();
|
|
133
|
-
},
|
|
134
|
-
async deleteActorMutelistSubscription(req) {
|
|
135
|
-
const { actorDid, subjectUri } = req;
|
|
136
|
-
(0, node_assert_1.default)(isListUri(subjectUri), 'must mute a list');
|
|
137
|
-
await db.db
|
|
138
|
-
.deleteFrom('list_mute')
|
|
139
|
-
.where('listUri', '=', subjectUri)
|
|
140
|
-
.where('mutedByDid', '=', actorDid)
|
|
141
|
-
.execute();
|
|
142
|
-
},
|
|
143
|
-
async clearActorMutelistSubscriptions(req) {
|
|
144
|
-
const { actorDid } = req;
|
|
145
|
-
await db.db
|
|
146
|
-
.deleteFrom('list_mute')
|
|
147
|
-
.where('mutedByDid', '=', actorDid)
|
|
148
|
-
.execute();
|
|
149
|
-
},
|
|
150
|
-
async getThreadMutesOnSubjects(req) {
|
|
151
|
-
const { actorDid, threadRoots } = req;
|
|
152
|
-
if (threadRoots.length === 0) {
|
|
153
|
-
return { muted: [] };
|
|
154
|
-
}
|
|
155
|
-
const res = await db.db
|
|
156
|
-
.selectFrom('thread_mute')
|
|
157
|
-
.selectAll()
|
|
158
|
-
.where('mutedByDid', '=', actorDid)
|
|
159
|
-
.where('rootUri', 'in', threadRoots)
|
|
160
|
-
.execute();
|
|
161
|
-
const byRootUri = (0, common_1.keyBy)(res, 'rootUri');
|
|
162
|
-
const muted = threadRoots.map((uri) => !!byRootUri.get(uri));
|
|
163
|
-
return { muted };
|
|
164
|
-
},
|
|
165
|
-
});
|
|
166
|
-
const isListUri = (uri) => new syntax_1.AtUri(uri).collection === lexicons_1.ids.AppBskyGraphList;
|