@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,150 +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
|
-
exports.MockBsync = void 0;
|
|
7
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
8
|
-
const node_events_1 = __importDefault(require("node:events"));
|
|
9
|
-
const connect_express_1 = require("@connectrpc/connect-express");
|
|
10
|
-
const express_1 = __importDefault(require("express"));
|
|
11
|
-
const syntax_1 = require("@atproto/syntax");
|
|
12
|
-
const lexicons_1 = require("../../lexicon/lexicons");
|
|
13
|
-
const bsync_connect_1 = require("../../proto/bsync_connect");
|
|
14
|
-
const bsync_pb_1 = require("../../proto/bsync_pb");
|
|
15
|
-
class MockBsync {
|
|
16
|
-
constructor(server) {
|
|
17
|
-
Object.defineProperty(this, "server", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
configurable: true,
|
|
20
|
-
writable: true,
|
|
21
|
-
value: server
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
static async create(db, port) {
|
|
25
|
-
const app = (0, express_1.default)();
|
|
26
|
-
const routes = createRoutes(db);
|
|
27
|
-
app.use((0, connect_express_1.expressConnectMiddleware)({ routes }));
|
|
28
|
-
const server = app.listen(port);
|
|
29
|
-
await node_events_1.default.once(server, 'listening');
|
|
30
|
-
return new MockBsync(server);
|
|
31
|
-
}
|
|
32
|
-
async destroy() {
|
|
33
|
-
return new Promise((resolve, reject) => {
|
|
34
|
-
this.server.close((err) => {
|
|
35
|
-
if (err) {
|
|
36
|
-
reject(err);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
resolve();
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.MockBsync = MockBsync;
|
|
46
|
-
const createRoutes = (db) => (router) => router.service(bsync_connect_1.Service, {
|
|
47
|
-
async addMuteOperation(req) {
|
|
48
|
-
const { type, actorDid, subject } = req;
|
|
49
|
-
if (type === bsync_pb_1.MuteOperation_Type.ADD) {
|
|
50
|
-
if (subject.startsWith('did:')) {
|
|
51
|
-
(0, node_assert_1.default)(actorDid !== subject, 'cannot mute yourself'); // @TODO pass message through in http error
|
|
52
|
-
await db.db
|
|
53
|
-
.insertInto('mute')
|
|
54
|
-
.values({
|
|
55
|
-
mutedByDid: actorDid,
|
|
56
|
-
subjectDid: subject,
|
|
57
|
-
createdAt: new Date().toISOString(),
|
|
58
|
-
})
|
|
59
|
-
.onConflict((oc) => oc.doNothing())
|
|
60
|
-
.execute();
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
const uri = new syntax_1.AtUri(subject);
|
|
64
|
-
if (uri.collection === lexicons_1.ids.AppBskyGraphList) {
|
|
65
|
-
await db.db
|
|
66
|
-
.insertInto('list_mute')
|
|
67
|
-
.values({
|
|
68
|
-
mutedByDid: actorDid,
|
|
69
|
-
listUri: subject,
|
|
70
|
-
createdAt: new Date().toISOString(),
|
|
71
|
-
})
|
|
72
|
-
.onConflict((oc) => oc.doNothing())
|
|
73
|
-
.execute();
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
await db.db
|
|
77
|
-
.insertInto('thread_mute')
|
|
78
|
-
.values({
|
|
79
|
-
mutedByDid: actorDid,
|
|
80
|
-
rootUri: subject,
|
|
81
|
-
createdAt: new Date().toISOString(),
|
|
82
|
-
})
|
|
83
|
-
.onConflict((oc) => oc.doNothing())
|
|
84
|
-
.execute();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
else if (type === bsync_pb_1.MuteOperation_Type.REMOVE) {
|
|
89
|
-
if (subject.startsWith('did:')) {
|
|
90
|
-
await db.db
|
|
91
|
-
.deleteFrom('mute')
|
|
92
|
-
.where('mutedByDid', '=', actorDid)
|
|
93
|
-
.where('subjectDid', '=', subject)
|
|
94
|
-
.execute();
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
const uri = new syntax_1.AtUri(subject);
|
|
98
|
-
if (uri.collection === lexicons_1.ids.AppBskyGraphList) {
|
|
99
|
-
await db.db
|
|
100
|
-
.deleteFrom('list_mute')
|
|
101
|
-
.where('mutedByDid', '=', actorDid)
|
|
102
|
-
.where('listUri', '=', subject)
|
|
103
|
-
.execute();
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
await db.db
|
|
107
|
-
.deleteFrom('thread_mute')
|
|
108
|
-
.where('mutedByDid', '=', actorDid)
|
|
109
|
-
.where('rootUri', '=', subject)
|
|
110
|
-
.execute();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
else if (type === bsync_pb_1.MuteOperation_Type.CLEAR) {
|
|
115
|
-
await db.db
|
|
116
|
-
.deleteFrom('mute')
|
|
117
|
-
.where('mutedByDid', '=', actorDid)
|
|
118
|
-
.execute();
|
|
119
|
-
await db.db
|
|
120
|
-
.deleteFrom('list_mute')
|
|
121
|
-
.where('mutedByDid', '=', actorDid)
|
|
122
|
-
.execute();
|
|
123
|
-
}
|
|
124
|
-
return {};
|
|
125
|
-
},
|
|
126
|
-
async scanMuteOperations() {
|
|
127
|
-
throw new Error('not implemented');
|
|
128
|
-
},
|
|
129
|
-
async addNotifOperation(req) {
|
|
130
|
-
const { actorDid, priority } = req;
|
|
131
|
-
if (priority !== undefined) {
|
|
132
|
-
await db.db
|
|
133
|
-
.insertInto('actor_state')
|
|
134
|
-
.values({
|
|
135
|
-
did: actorDid,
|
|
136
|
-
priorityNotifs: priority,
|
|
137
|
-
lastSeenNotifs: new Date().toISOString(),
|
|
138
|
-
})
|
|
139
|
-
.onConflict((oc) => oc.column('did').doUpdateSet({ priorityNotifs: priority }))
|
|
140
|
-
.execute();
|
|
141
|
-
}
|
|
142
|
-
return {};
|
|
143
|
-
},
|
|
144
|
-
async scanNotifOperations() {
|
|
145
|
-
throw new Error('not implemented');
|
|
146
|
-
},
|
|
147
|
-
async ping() {
|
|
148
|
-
return {};
|
|
149
|
-
},
|
|
150
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Client, Code, ConnectError } from '@connectrpc/connect';
|
|
2
|
-
import { ClioService } from '../rpc/clio_connect';
|
|
3
|
-
export type DataPlaneClient = Client<typeof ClioService>;
|
|
4
|
-
type HttpVersion = '1.1' | '2';
|
|
5
|
-
export declare const createDataPlaneClient: (baseUrls: string[], opts: {
|
|
6
|
-
httpVersion?: HttpVersion;
|
|
7
|
-
rejectUnauthorized?: boolean;
|
|
8
|
-
}) => DataPlaneClient;
|
|
9
|
-
export { Code };
|
|
10
|
-
export declare const isDataplaneError: (err: unknown, code?: Code) => err is ConnectError;
|
|
11
|
-
export declare const unpackIdentityServices: (servicesBytes: Uint8Array) => UnpackedServices;
|
|
12
|
-
export declare const unpackIdentityKeys: (keysBytes: Uint8Array) => UnpackedKeys;
|
|
13
|
-
export declare const getServiceEndpoint: (services: UnpackedServices, opts: {
|
|
14
|
-
id: string;
|
|
15
|
-
type: string;
|
|
16
|
-
}) => string | undefined;
|
|
17
|
-
export declare const getKeyAsDidKey: (keys: UnpackedKeys, opts: {
|
|
18
|
-
id: string;
|
|
19
|
-
}) => string | undefined;
|
|
20
|
-
type UnpackedServices = Record<string, {
|
|
21
|
-
Type: string;
|
|
22
|
-
URL: string;
|
|
23
|
-
}>;
|
|
24
|
-
type UnpackedKeys = Record<string, {
|
|
25
|
-
Type: string;
|
|
26
|
-
PublicKeyMultibase: string;
|
|
27
|
-
}>;
|
package/dist/dataplane/client.js
DELETED
|
@@ -1,165 +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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.getKeyAsDidKey = exports.getServiceEndpoint = exports.unpackIdentityKeys = exports.unpackIdentityServices = exports.isDataplaneError = exports.Code = exports.createDataPlaneClient = void 0;
|
|
40
|
-
const identity_1 = require("@atproto/identity");
|
|
41
|
-
const connect_1 = require("@connectrpc/connect");
|
|
42
|
-
Object.defineProperty(exports, "Code", { enumerable: true, get: function () { return connect_1.Code; } });
|
|
43
|
-
const connect_node_1 = require("@connectrpc/connect-node");
|
|
44
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
45
|
-
const node_crypto_1 = require("node:crypto");
|
|
46
|
-
const ui8 = __importStar(require("uint8arrays"));
|
|
47
|
-
const clio_connect_1 = require("../rpc/clio_connect");
|
|
48
|
-
const MAX_RETRIES = 3;
|
|
49
|
-
const createDataPlaneClient = (baseUrls, opts) => {
|
|
50
|
-
const clients = baseUrls.map((baseUrl) => createBaseClient(baseUrl, opts));
|
|
51
|
-
(0, node_assert_1.default)(clients.length > 0, 'no clients available');
|
|
52
|
-
return (0, connect_1.makeAnyClient)(clio_connect_1.ClioService, (method) => {
|
|
53
|
-
return async (...args) => {
|
|
54
|
-
let tries = 0;
|
|
55
|
-
let error;
|
|
56
|
-
let remainingClients = clients;
|
|
57
|
-
while (tries < MAX_RETRIES) {
|
|
58
|
-
const client = randomElement(remainingClients);
|
|
59
|
-
(0, node_assert_1.default)(client, 'no clients available');
|
|
60
|
-
try {
|
|
61
|
-
return await client.lib[method.localName](...args);
|
|
62
|
-
}
|
|
63
|
-
catch (err) {
|
|
64
|
-
if (err instanceof connect_1.ConnectError &&
|
|
65
|
-
(err.code === connect_1.Code.Unavailable || err.code === connect_1.Code.Aborted)) {
|
|
66
|
-
tries++;
|
|
67
|
-
error = err;
|
|
68
|
-
remainingClients = getRemainingClients(remainingClients, client);
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
throw err;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
(0, node_assert_1.default)(error);
|
|
76
|
-
throw error;
|
|
77
|
-
};
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
|
-
exports.createDataPlaneClient = createDataPlaneClient;
|
|
81
|
-
const isDataplaneError = (err, code) => {
|
|
82
|
-
if (err instanceof connect_1.ConnectError) {
|
|
83
|
-
return !code || err.code === code;
|
|
84
|
-
}
|
|
85
|
-
return false;
|
|
86
|
-
};
|
|
87
|
-
exports.isDataplaneError = isDataplaneError;
|
|
88
|
-
const createBaseClient = (baseUrl, opts) => {
|
|
89
|
-
const { httpVersion = '2', rejectUnauthorized = true } = opts;
|
|
90
|
-
const transport = (0, connect_node_1.createGrpcTransport)({
|
|
91
|
-
baseUrl,
|
|
92
|
-
httpVersion,
|
|
93
|
-
acceptCompression: [],
|
|
94
|
-
nodeOptions: { rejectUnauthorized },
|
|
95
|
-
});
|
|
96
|
-
return {
|
|
97
|
-
lib: (0, connect_1.createClient)(clio_connect_1.ClioService, transport),
|
|
98
|
-
url: new URL(baseUrl),
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
const getRemainingClients = (clients, lastClient) => {
|
|
102
|
-
if (clients.length < 2)
|
|
103
|
-
return clients; // no clients to choose from
|
|
104
|
-
if (lastClient.url.port) {
|
|
105
|
-
// if the last client had a port, we attempt to exclude its whole host.
|
|
106
|
-
const maybeRemaining = clients.filter((c) => c.url.hostname !== lastClient.url.hostname);
|
|
107
|
-
if (maybeRemaining.length) {
|
|
108
|
-
return maybeRemaining;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return clients.filter((c) => c !== lastClient);
|
|
112
|
-
};
|
|
113
|
-
const randomElement = (arr) => {
|
|
114
|
-
if (arr.length === 0)
|
|
115
|
-
return;
|
|
116
|
-
return arr[(0, node_crypto_1.randomInt)(arr.length)];
|
|
117
|
-
};
|
|
118
|
-
const unpackIdentityServices = (servicesBytes) => {
|
|
119
|
-
const servicesStr = ui8.toString(servicesBytes, 'utf8');
|
|
120
|
-
if (!servicesStr)
|
|
121
|
-
return {};
|
|
122
|
-
return JSON.parse(servicesStr);
|
|
123
|
-
};
|
|
124
|
-
exports.unpackIdentityServices = unpackIdentityServices;
|
|
125
|
-
const unpackIdentityKeys = (keysBytes) => {
|
|
126
|
-
const keysStr = ui8.toString(keysBytes, 'utf8');
|
|
127
|
-
if (!keysStr)
|
|
128
|
-
return {};
|
|
129
|
-
return JSON.parse(keysStr);
|
|
130
|
-
};
|
|
131
|
-
exports.unpackIdentityKeys = unpackIdentityKeys;
|
|
132
|
-
const getServiceEndpoint = (services, opts) => {
|
|
133
|
-
const endpoint = services[opts.id] &&
|
|
134
|
-
services[opts.id].Type === opts.type &&
|
|
135
|
-
validateUrl(services[opts.id].URL);
|
|
136
|
-
return endpoint || undefined;
|
|
137
|
-
};
|
|
138
|
-
exports.getServiceEndpoint = getServiceEndpoint;
|
|
139
|
-
const getKeyAsDidKey = (keys, opts) => {
|
|
140
|
-
const key = keys[opts.id] &&
|
|
141
|
-
(0, identity_1.getDidKeyFromMultibase)({
|
|
142
|
-
type: keys[opts.id].Type,
|
|
143
|
-
publicKeyMultibase: keys[opts.id].PublicKeyMultibase,
|
|
144
|
-
});
|
|
145
|
-
return key || undefined;
|
|
146
|
-
};
|
|
147
|
-
exports.getKeyAsDidKey = getKeyAsDidKey;
|
|
148
|
-
const validateUrl = (urlStr) => {
|
|
149
|
-
let url;
|
|
150
|
-
try {
|
|
151
|
-
url = new URL(urlStr);
|
|
152
|
-
}
|
|
153
|
-
catch {
|
|
154
|
-
return undefined;
|
|
155
|
-
}
|
|
156
|
-
if (!['http:', 'https:'].includes(url.protocol)) {
|
|
157
|
-
return undefined;
|
|
158
|
-
}
|
|
159
|
-
else if (!url.hostname) {
|
|
160
|
-
return undefined;
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
return urlStr;
|
|
164
|
-
}
|
|
165
|
-
};
|
package/dist/dataplane/index.js
DELETED
|
@@ -1,18 +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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./client"), exports);
|
|
18
|
-
__exportStar(require("./server"), exports);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import PQueue from 'p-queue';
|
|
2
|
-
import { Database } from './db';
|
|
3
|
-
export declare class BackgroundQueue {
|
|
4
|
-
db: Database;
|
|
5
|
-
queue: PQueue<import("p-queue/dist/priority-queue").default, import("p-queue").DefaultAddOptions>;
|
|
6
|
-
destroyed: boolean;
|
|
7
|
-
constructor(db: Database);
|
|
8
|
-
add(task: Task): void;
|
|
9
|
-
processAll(): Promise<void>;
|
|
10
|
-
destroy(): Promise<void>;
|
|
11
|
-
}
|
|
12
|
-
type Task = (db: Database) => Promise<void>;
|
|
13
|
-
export {};
|
|
@@ -1,51 +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
|
-
exports.BackgroundQueue = void 0;
|
|
7
|
-
const p_queue_1 = __importDefault(require("p-queue"));
|
|
8
|
-
const logger_1 = require("../../logger");
|
|
9
|
-
// A simple queue for in-process, out-of-band/backgrounded work
|
|
10
|
-
class BackgroundQueue {
|
|
11
|
-
constructor(db) {
|
|
12
|
-
Object.defineProperty(this, "db", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
configurable: true,
|
|
15
|
-
writable: true,
|
|
16
|
-
value: db
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(this, "queue", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
configurable: true,
|
|
21
|
-
writable: true,
|
|
22
|
-
value: new p_queue_1.default()
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(this, "destroyed", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
configurable: true,
|
|
27
|
-
writable: true,
|
|
28
|
-
value: false
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
add(task) {
|
|
32
|
-
if (this.destroyed) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
this.queue
|
|
36
|
-
.add(() => task(this.db))
|
|
37
|
-
.catch((err) => {
|
|
38
|
-
logger_1.dbLogger.error(err, 'background queue task failed');
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
async processAll() {
|
|
42
|
-
await this.queue.onIdle();
|
|
43
|
-
}
|
|
44
|
-
// On destroy we stop accepting new tasks, but complete all pending/in-progress tasks.
|
|
45
|
-
// The application calls this only once http connections have drained (tasks no longer being added).
|
|
46
|
-
async destroy() {
|
|
47
|
-
this.destroyed = true;
|
|
48
|
-
await this.queue.onIdle();
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
exports.BackgroundQueue = BackgroundQueue;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Kysely } from 'kysely';
|
|
2
|
-
import * as actorTable from './tables/actor';
|
|
3
|
-
import * as actorSyncTable from './tables/actor-sync';
|
|
4
|
-
import * as artistTable from './tables/artist';
|
|
5
|
-
import * as artistListItemTable from './tables/artist-list-item';
|
|
6
|
-
import * as playlistTable from './tables/playlist';
|
|
7
|
-
import * as playlistIdeaTable from './tables/playlist-idea';
|
|
8
|
-
import * as playlistItemTable from './tables/playlist-item';
|
|
9
|
-
import * as profileTable from './tables/profile';
|
|
10
|
-
import * as recordTable from './tables/record';
|
|
11
|
-
import * as songTable from './tables/song';
|
|
12
|
-
export type DatabaseSchemaType = actorTable.PartialDB & actorSyncTable.PartialDB & artistTable.PartialDB & artistListItemTable.PartialDB & playlistTable.PartialDB & playlistIdeaTable.PartialDB & playlistItemTable.PartialDB & profileTable.PartialDB & recordTable.PartialDB & songTable.PartialDB;
|
|
13
|
-
export type DatabaseSchema = Kysely<DatabaseSchemaType>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Migrator } from 'kysely';
|
|
2
|
-
import { Pool as PgPool } from 'pg';
|
|
3
|
-
import TypedEmitter from 'typed-emitter';
|
|
4
|
-
import { DatabaseSchema } from './database-schema';
|
|
5
|
-
import { PgOptions } from './types';
|
|
6
|
-
export declare class Database {
|
|
7
|
-
opts: PgOptions;
|
|
8
|
-
pool: PgPool;
|
|
9
|
-
db: DatabaseSchema;
|
|
10
|
-
migrator: Migrator;
|
|
11
|
-
txEvt: TxnEmitter;
|
|
12
|
-
destroyed: boolean;
|
|
13
|
-
constructor(opts: PgOptions, instances?: {
|
|
14
|
-
db: DatabaseSchema;
|
|
15
|
-
pool: PgPool;
|
|
16
|
-
migrator: Migrator;
|
|
17
|
-
});
|
|
18
|
-
get schema(): string | undefined;
|
|
19
|
-
transaction<T>(fn: (db: Database) => Promise<T>): Promise<T>;
|
|
20
|
-
get isTransaction(): boolean;
|
|
21
|
-
assertTransaction(): void;
|
|
22
|
-
assertNotTransaction(): void;
|
|
23
|
-
onCommit(fn: () => void): void;
|
|
24
|
-
migrateToOrThrow(migration: string): Promise<import("kysely").MigrationResult[]>;
|
|
25
|
-
migrateToLatestOrThrow(): Promise<import("kysely").MigrationResult[]>;
|
|
26
|
-
close(): Promise<void>;
|
|
27
|
-
}
|
|
28
|
-
export default Database;
|
|
29
|
-
type TxnEmitter = TypedEmitter<TxnEvents>;
|
|
30
|
-
type TxnEvents = {
|
|
31
|
-
commit: () => void;
|
|
32
|
-
};
|