@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,228 +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.Database = void 0;
|
|
40
|
-
const kysely_1 = require("kysely");
|
|
41
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
42
|
-
const node_events_1 = __importDefault(require("node:events"));
|
|
43
|
-
const pg_1 = require("pg");
|
|
44
|
-
const logger_1 = require("../../../logger");
|
|
45
|
-
const migrations = __importStar(require("./migrations"));
|
|
46
|
-
const provider_1 = require("./migrations/provider");
|
|
47
|
-
class Database {
|
|
48
|
-
constructor(opts, instances) {
|
|
49
|
-
Object.defineProperty(this, "opts", {
|
|
50
|
-
enumerable: true,
|
|
51
|
-
configurable: true,
|
|
52
|
-
writable: true,
|
|
53
|
-
value: opts
|
|
54
|
-
});
|
|
55
|
-
Object.defineProperty(this, "pool", {
|
|
56
|
-
enumerable: true,
|
|
57
|
-
configurable: true,
|
|
58
|
-
writable: true,
|
|
59
|
-
value: void 0
|
|
60
|
-
});
|
|
61
|
-
Object.defineProperty(this, "db", {
|
|
62
|
-
enumerable: true,
|
|
63
|
-
configurable: true,
|
|
64
|
-
writable: true,
|
|
65
|
-
value: void 0
|
|
66
|
-
});
|
|
67
|
-
Object.defineProperty(this, "migrator", {
|
|
68
|
-
enumerable: true,
|
|
69
|
-
configurable: true,
|
|
70
|
-
writable: true,
|
|
71
|
-
value: void 0
|
|
72
|
-
});
|
|
73
|
-
Object.defineProperty(this, "txEvt", {
|
|
74
|
-
enumerable: true,
|
|
75
|
-
configurable: true,
|
|
76
|
-
writable: true,
|
|
77
|
-
value: new node_events_1.default()
|
|
78
|
-
});
|
|
79
|
-
Object.defineProperty(this, "destroyed", {
|
|
80
|
-
enumerable: true,
|
|
81
|
-
configurable: true,
|
|
82
|
-
writable: true,
|
|
83
|
-
value: false
|
|
84
|
-
});
|
|
85
|
-
// if instances are provided, use those
|
|
86
|
-
if (instances) {
|
|
87
|
-
this.db = instances.db;
|
|
88
|
-
this.pool = instances.pool;
|
|
89
|
-
this.migrator = instances.migrator;
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
// else create a pool & connect
|
|
93
|
-
const { schema, url } = opts;
|
|
94
|
-
const pool = opts.pool ??
|
|
95
|
-
new pg_1.Pool({
|
|
96
|
-
connectionString: url,
|
|
97
|
-
max: opts.poolSize,
|
|
98
|
-
maxUses: opts.poolMaxUses,
|
|
99
|
-
idleTimeoutMillis: opts.poolIdleTimeoutMs,
|
|
100
|
-
});
|
|
101
|
-
// Select count(*) and other pg bigints as js integer
|
|
102
|
-
pg_1.types.setTypeParser(pg_1.types.builtins.INT8, (n) => parseInt(n, 10));
|
|
103
|
-
// Setup schema usage, primarily for test parallelism (each test suite runs in its own pg schema)
|
|
104
|
-
if (schema && !/^[a-z_]+$/i.test(schema)) {
|
|
105
|
-
throw new Error(`Postgres schema must only contain [A-Za-z_]: ${schema}`);
|
|
106
|
-
}
|
|
107
|
-
pool.on('error', onPoolError);
|
|
108
|
-
pool.on('connect', (client) => {
|
|
109
|
-
client.on('error', onClientError);
|
|
110
|
-
// Used for trigram indexes, e.g. on actor search
|
|
111
|
-
client.query('SET pg_trgm.word_similarity_threshold TO .4;');
|
|
112
|
-
if (schema) {
|
|
113
|
-
// Shared objects such as extensions will go in the public schema
|
|
114
|
-
client.query(`SET search_path TO "${schema}",public;`);
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
this.pool = pool;
|
|
118
|
-
this.db = new kysely_1.Kysely({
|
|
119
|
-
dialect: new kysely_1.PostgresDialect({ pool }),
|
|
120
|
-
});
|
|
121
|
-
this.migrator = new kysely_1.Migrator({
|
|
122
|
-
db: this.db,
|
|
123
|
-
migrationTableSchema: opts.schema,
|
|
124
|
-
provider: new provider_1.CtxMigrationProvider(migrations, 'pg'),
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
get schema() {
|
|
128
|
-
return this.opts.schema;
|
|
129
|
-
}
|
|
130
|
-
async transaction(fn) {
|
|
131
|
-
const leakyTxPlugin = new LeakyTxPlugin();
|
|
132
|
-
const { dbTxn, txRes } = await this.db
|
|
133
|
-
.withPlugin(leakyTxPlugin)
|
|
134
|
-
.transaction()
|
|
135
|
-
.execute(async (txn) => {
|
|
136
|
-
const dbTxn = new Database(this.opts, {
|
|
137
|
-
db: txn,
|
|
138
|
-
pool: this.pool,
|
|
139
|
-
migrator: this.migrator,
|
|
140
|
-
});
|
|
141
|
-
const txRes = await fn(dbTxn)
|
|
142
|
-
.catch(async (err) => {
|
|
143
|
-
leakyTxPlugin.endTx();
|
|
144
|
-
// ensure that all in-flight queries are flushed & the connection is open
|
|
145
|
-
await dbTxn.db.getExecutor().provideConnection(noopAsync);
|
|
146
|
-
throw err;
|
|
147
|
-
})
|
|
148
|
-
.finally(() => leakyTxPlugin.endTx());
|
|
149
|
-
return { dbTxn, txRes };
|
|
150
|
-
});
|
|
151
|
-
dbTxn?.txEvt.emit('commit');
|
|
152
|
-
return txRes;
|
|
153
|
-
}
|
|
154
|
-
get isTransaction() {
|
|
155
|
-
return this.db.isTransaction;
|
|
156
|
-
}
|
|
157
|
-
assertTransaction() {
|
|
158
|
-
(0, node_assert_1.default)(this.isTransaction, 'Transaction required');
|
|
159
|
-
}
|
|
160
|
-
assertNotTransaction() {
|
|
161
|
-
(0, node_assert_1.default)(!this.isTransaction, 'Cannot be in a transaction');
|
|
162
|
-
}
|
|
163
|
-
onCommit(fn) {
|
|
164
|
-
this.assertTransaction();
|
|
165
|
-
this.txEvt.once('commit', fn);
|
|
166
|
-
}
|
|
167
|
-
async migrateToOrThrow(migration) {
|
|
168
|
-
if (this.schema) {
|
|
169
|
-
await this.db.schema.createSchema(this.schema).ifNotExists().execute();
|
|
170
|
-
}
|
|
171
|
-
const { error, results } = await this.migrator.migrateTo(migration);
|
|
172
|
-
if (error) {
|
|
173
|
-
throw error;
|
|
174
|
-
}
|
|
175
|
-
if (!results) {
|
|
176
|
-
throw new Error('An unknown failure occurred while migrating');
|
|
177
|
-
}
|
|
178
|
-
return results;
|
|
179
|
-
}
|
|
180
|
-
async migrateToLatestOrThrow() {
|
|
181
|
-
if (this.schema) {
|
|
182
|
-
await this.db.schema.createSchema(this.schema).ifNotExists().execute();
|
|
183
|
-
}
|
|
184
|
-
const { error, results } = await this.migrator.migrateToLatest();
|
|
185
|
-
if (error) {
|
|
186
|
-
throw error;
|
|
187
|
-
}
|
|
188
|
-
if (!results) {
|
|
189
|
-
throw new Error('An unknown failure occurred while migrating');
|
|
190
|
-
}
|
|
191
|
-
return results;
|
|
192
|
-
}
|
|
193
|
-
async close() {
|
|
194
|
-
if (this.destroyed)
|
|
195
|
-
return;
|
|
196
|
-
await this.db.destroy();
|
|
197
|
-
this.destroyed = true;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
exports.Database = Database;
|
|
201
|
-
exports.default = Database;
|
|
202
|
-
const onPoolError = (err) => logger_1.dbLogger.error({ err }, 'db pool error');
|
|
203
|
-
const onClientError = (err) => logger_1.dbLogger.error({ err }, 'db client error');
|
|
204
|
-
// utils
|
|
205
|
-
// -------
|
|
206
|
-
class LeakyTxPlugin {
|
|
207
|
-
constructor() {
|
|
208
|
-
Object.defineProperty(this, "txOver", {
|
|
209
|
-
enumerable: true,
|
|
210
|
-
configurable: true,
|
|
211
|
-
writable: true,
|
|
212
|
-
value: false
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
endTx() {
|
|
216
|
-
this.txOver = true;
|
|
217
|
-
}
|
|
218
|
-
transformQuery(args) {
|
|
219
|
-
if (this.txOver) {
|
|
220
|
-
throw new Error('tx already failed');
|
|
221
|
-
}
|
|
222
|
-
return args.node;
|
|
223
|
-
}
|
|
224
|
-
async transformResult(args) {
|
|
225
|
-
return args.result;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
const noopAsync = async () => { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './db';
|
|
@@ -1,17 +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("./db"), exports);
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.up = up;
|
|
4
|
-
exports.down = down;
|
|
5
|
-
const kysely_1 = require("kysely");
|
|
6
|
-
// @TODO subject indexes, naming?
|
|
7
|
-
// @TODO drop indexes in down()?
|
|
8
|
-
async function up(db) {
|
|
9
|
-
try {
|
|
10
|
-
// Add trigram support, supporting user search.
|
|
11
|
-
// Explicitly add to public schema, so the extension can be seen in all schemas.
|
|
12
|
-
await (0, kysely_1.sql) `create extension if not exists pg_trgm with schema public`.execute(db);
|
|
13
|
-
}
|
|
14
|
-
catch (err) {
|
|
15
|
-
// The "if not exists" isn't bulletproof against races, and we see test suites racing to
|
|
16
|
-
// create the extension. So we can just ignore errors indicating the extension already exists.
|
|
17
|
-
if (!err?.['detail']?.includes?.('(pg_trgm) already exists'))
|
|
18
|
-
throw err;
|
|
19
|
-
}
|
|
20
|
-
// profile
|
|
21
|
-
await db.schema
|
|
22
|
-
.createTable('profile')
|
|
23
|
-
.addColumn('uri', 'varchar', (col) => col.primaryKey())
|
|
24
|
-
.addColumn('cid', 'varchar', (col) => col.notNull())
|
|
25
|
-
.addColumn('creator_did', 'varchar', (col) => col.notNull())
|
|
26
|
-
.addColumn('display_name', 'varchar')
|
|
27
|
-
.addColumn('description', 'varchar')
|
|
28
|
-
.addColumn('avatar_cid', 'varchar')
|
|
29
|
-
.addColumn('banner_cid', 'varchar')
|
|
30
|
-
.addColumn('indexed_at', 'varchar', (col) => col.notNull())
|
|
31
|
-
.execute();
|
|
32
|
-
// follow
|
|
33
|
-
await db.schema
|
|
34
|
-
.createTable('follow')
|
|
35
|
-
.addColumn('uri', 'varchar', (col) => col.primaryKey())
|
|
36
|
-
.addColumn('cid', 'varchar', (col) => col.notNull())
|
|
37
|
-
.addColumn('creator', 'varchar', (col) => col.notNull())
|
|
38
|
-
.addColumn('subjectDid', 'varchar', (col) => col.notNull())
|
|
39
|
-
.addColumn('createdAt', 'varchar', (col) => col.notNull())
|
|
40
|
-
.addColumn('indexedAt', 'varchar', (col) => col.notNull())
|
|
41
|
-
.addColumn('sortAt', 'varchar', (col) => col
|
|
42
|
-
.generatedAlwaysAs((0, kysely_1.sql) `least("createdAt", "indexedAt")`)
|
|
43
|
-
.stored()
|
|
44
|
-
.notNull())
|
|
45
|
-
.addUniqueConstraint('follow_unique_subject', ['creator', 'subjectDid'])
|
|
46
|
-
.execute();
|
|
47
|
-
// for, eg, "followersCount" on profile views
|
|
48
|
-
await db.schema
|
|
49
|
-
.createIndex('follow_subjectdid_idx')
|
|
50
|
-
.on('follow')
|
|
51
|
-
.column('subjectDid')
|
|
52
|
-
.execute();
|
|
53
|
-
// like
|
|
54
|
-
await db.schema
|
|
55
|
-
.createTable('like')
|
|
56
|
-
.addColumn('uri', 'varchar', (col) => col.primaryKey())
|
|
57
|
-
.addColumn('cid', 'varchar', (col) => col.notNull())
|
|
58
|
-
.addColumn('creator', 'varchar', (col) => col.notNull())
|
|
59
|
-
.addColumn('subject', 'varchar', (col) => col.notNull())
|
|
60
|
-
.addColumn('subjectCid', 'varchar', (col) => col.notNull())
|
|
61
|
-
.addColumn('createdAt', 'varchar', (col) => col.notNull())
|
|
62
|
-
.addColumn('indexedAt', 'varchar', (col) => col.notNull())
|
|
63
|
-
.addColumn('sortAt', 'varchar', (col) => col
|
|
64
|
-
.generatedAlwaysAs((0, kysely_1.sql) `least("createdAt", "indexedAt")`)
|
|
65
|
-
.stored()
|
|
66
|
-
.notNull())
|
|
67
|
-
// Aids in index uniqueness plus post like counts
|
|
68
|
-
.addUniqueConstraint('like_unique_subject', ['subject', 'creator'])
|
|
69
|
-
.execute();
|
|
70
|
-
// subscription
|
|
71
|
-
await db.schema
|
|
72
|
-
.createTable('subscription')
|
|
73
|
-
.addColumn('service', 'varchar', (col) => col.notNull())
|
|
74
|
-
.addColumn('method', 'varchar', (col) => col.notNull())
|
|
75
|
-
.addColumn('state', 'varchar', (col) => col.notNull())
|
|
76
|
-
.addPrimaryKeyConstraint('subscription_pkey', ['service', 'method'])
|
|
77
|
-
.execute();
|
|
78
|
-
// actor
|
|
79
|
-
await db.schema
|
|
80
|
-
.createTable('actor')
|
|
81
|
-
.addColumn('did', 'varchar', (col) => col.primaryKey())
|
|
82
|
-
.addColumn('handle', 'varchar', (col) => col.unique())
|
|
83
|
-
.addColumn('indexedAt', 'varchar', (col) => col.notNull())
|
|
84
|
-
.execute();
|
|
85
|
-
await db.schema // Supports user search
|
|
86
|
-
.createIndex(`actor_handle_tgrm_idx`)
|
|
87
|
-
.on('actor')
|
|
88
|
-
.using('gist')
|
|
89
|
-
.expression((0, kysely_1.sql) `"handle" gist_trgm_ops`)
|
|
90
|
-
.execute();
|
|
91
|
-
//record
|
|
92
|
-
await db.schema
|
|
93
|
-
.createTable('record')
|
|
94
|
-
.addColumn('uri', 'varchar', (col) => col.primaryKey())
|
|
95
|
-
.addColumn('cid', 'varchar', (col) => col.notNull())
|
|
96
|
-
.addColumn('did', 'varchar', (col) => col.notNull())
|
|
97
|
-
.addColumn('json', 'text', (col) => col.notNull())
|
|
98
|
-
.addColumn('indexedAt', 'varchar', (col) => col.notNull())
|
|
99
|
-
.addColumn('takedownId', 'integer') // foreign key created in moderation-init migration
|
|
100
|
-
.execute();
|
|
101
|
-
}
|
|
102
|
-
async function down(db) {
|
|
103
|
-
// record
|
|
104
|
-
await db.schema.dropTable('record').execute();
|
|
105
|
-
// actor
|
|
106
|
-
await db.schema.dropTable('actor').execute();
|
|
107
|
-
// subscription
|
|
108
|
-
await db.schema.dropTable('subscription').execute();
|
|
109
|
-
// like
|
|
110
|
-
await db.schema.dropTable('like').execute();
|
|
111
|
-
// follow
|
|
112
|
-
await db.schema.dropTable('follow').execute();
|
|
113
|
-
// post
|
|
114
|
-
await db.schema.dropTable('post').execute();
|
|
115
|
-
// profile
|
|
116
|
-
await db.schema.dropTable('profile').execute();
|
|
117
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.up = up;
|
|
4
|
-
exports.down = down;
|
|
5
|
-
async function up(db) {
|
|
6
|
-
await db.schema
|
|
7
|
-
.createTable('did_cache')
|
|
8
|
-
.addColumn('did', 'varchar', (col) => col.primaryKey())
|
|
9
|
-
.addColumn('doc', 'jsonb', (col) => col.notNull())
|
|
10
|
-
.addColumn('updatedAt', 'bigint', (col) => col.notNull())
|
|
11
|
-
.execute();
|
|
12
|
-
}
|
|
13
|
-
async function down(db) {
|
|
14
|
-
await db.schema.dropTable('did_cache').execute();
|
|
15
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// NOTE this file can be edited by hand, but it is also appended to by the migration:create command.
|
|
3
|
-
// It's important that every migration is exported from here with the proper name. We'd simplify
|
|
4
|
-
// this with kysely's FileMigrationProvider, but it doesn't play nicely with the build process.
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
-
var ownKeys = function(o) {
|
|
23
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
-
var ar = [];
|
|
25
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
-
return ar;
|
|
27
|
-
};
|
|
28
|
-
return ownKeys(o);
|
|
29
|
-
};
|
|
30
|
-
return function (mod) {
|
|
31
|
-
if (mod && mod.__esModule) return mod;
|
|
32
|
-
var result = {};
|
|
33
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
-
__setModuleDefault(result, mod);
|
|
35
|
-
return result;
|
|
36
|
-
};
|
|
37
|
-
})();
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports._20230420T211446071Z = exports._20230309T045948368Z = void 0;
|
|
40
|
-
exports._20230309T045948368Z = __importStar(require("./20230309T045948368Z-init"));
|
|
41
|
-
exports._20230420T211446071Z = __importStar(require("./20230420T211446071Z-did-cache"));
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Kysely, Migration, MigrationProvider } from 'kysely';
|
|
2
|
-
export declare class CtxMigrationProvider<T> implements MigrationProvider {
|
|
3
|
-
private migrations;
|
|
4
|
-
private ctx;
|
|
5
|
-
constructor(migrations: Record<string, CtxMigration<T>>, ctx: T);
|
|
6
|
-
getMigrations(): Promise<Record<string, Migration>>;
|
|
7
|
-
}
|
|
8
|
-
export interface CtxMigration<T> {
|
|
9
|
-
up(db: Kysely<unknown>, ctx: T): Promise<void>;
|
|
10
|
-
down?(db: Kysely<unknown>, ctx: T): Promise<void>;
|
|
11
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CtxMigrationProvider = void 0;
|
|
4
|
-
// Passes a context argument to migrations. We use this to thread the dialect into migrations
|
|
5
|
-
class CtxMigrationProvider {
|
|
6
|
-
constructor(migrations, ctx) {
|
|
7
|
-
Object.defineProperty(this, "migrations", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
configurable: true,
|
|
10
|
-
writable: true,
|
|
11
|
-
value: migrations
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(this, "ctx", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
configurable: true,
|
|
16
|
-
writable: true,
|
|
17
|
-
value: ctx
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
async getMigrations() {
|
|
21
|
-
const ctxMigrations = {};
|
|
22
|
-
Object.entries(this.migrations).forEach(([name, migration]) => {
|
|
23
|
-
ctxMigrations[name] = {
|
|
24
|
-
up: async (db) => await migration.up(db, this.ctx),
|
|
25
|
-
down: async (db) => await migration.down?.(db, this.ctx),
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
|
-
return ctxMigrations;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.CtxMigrationProvider = CtxMigrationProvider;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { AnyQb, DbRef } from './util';
|
|
2
|
-
export type Cursor = {
|
|
3
|
-
primary: string;
|
|
4
|
-
secondary: string;
|
|
5
|
-
};
|
|
6
|
-
export type LabeledResult = {
|
|
7
|
-
primary: string | number;
|
|
8
|
-
secondary: string | number;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* The GenericKeyset is an abstract class that sets-up the interface and partial implementation
|
|
12
|
-
* of a keyset-paginated cursor with two parts. There are three types involved:
|
|
13
|
-
* - Result: a raw result (i.e. a row from the db) containing data that will make-up a cursor.
|
|
14
|
-
* - E.g. { createdAt: '2022-01-01T12:00:00Z', cid: 'bafyx' }
|
|
15
|
-
* - LabeledResult: a Result processed such that the "primary" and "secondary" parts of the cursor are labeled.
|
|
16
|
-
* - E.g. { primary: '2022-01-01T12:00:00Z', secondary: 'bafyx' }
|
|
17
|
-
* - Cursor: the two string parts that make-up the packed/string cursor.
|
|
18
|
-
* - E.g. packed cursor '1641038400000__bafyx' in parts { primary: '1641038400000', secondary: 'bafyx' }
|
|
19
|
-
*
|
|
20
|
-
* These types relate as such. Implementers define the relations marked with a *:
|
|
21
|
-
* Result -*-> LabeledResult <-*-> Cursor <--> packed/string cursor
|
|
22
|
-
* ↳ SQL Condition
|
|
23
|
-
*/
|
|
24
|
-
export declare abstract class GenericKeyset<R, LR extends LabeledResult> {
|
|
25
|
-
primary: DbRef;
|
|
26
|
-
secondary: DbRef;
|
|
27
|
-
constructor(primary: DbRef, secondary: DbRef);
|
|
28
|
-
abstract labelResult(result: R): LR;
|
|
29
|
-
abstract labeledResultToCursor(labeled: LR): Cursor;
|
|
30
|
-
abstract cursorToLabeledResult(cursor: Cursor): LR;
|
|
31
|
-
packFromResult(results: R | R[]): string | undefined;
|
|
32
|
-
pack(labeled?: LR): string | undefined;
|
|
33
|
-
unpack(cursorStr?: string): LR | undefined;
|
|
34
|
-
packCursor(cursor?: Cursor): string | undefined;
|
|
35
|
-
unpackCursor(cursorStr?: string): Cursor | undefined;
|
|
36
|
-
getSql(labeled?: LR, direction?: 'asc' | 'desc', tryIndex?: boolean): import("kysely").RawBuilder<unknown> | undefined;
|
|
37
|
-
}
|
|
38
|
-
type SortAtCidResult = {
|
|
39
|
-
sortAt: string;
|
|
40
|
-
cid: string;
|
|
41
|
-
};
|
|
42
|
-
type TimeCidLabeledResult = Cursor;
|
|
43
|
-
export declare class TimeCidKeyset<TimeCidResult = SortAtCidResult> extends GenericKeyset<TimeCidResult, TimeCidLabeledResult> {
|
|
44
|
-
labelResult(result: TimeCidResult): TimeCidLabeledResult;
|
|
45
|
-
labeledResultToCursor(labeled: TimeCidLabeledResult): {
|
|
46
|
-
primary: string;
|
|
47
|
-
secondary: string;
|
|
48
|
-
};
|
|
49
|
-
cursorToLabeledResult(cursor: Cursor): {
|
|
50
|
-
primary: string;
|
|
51
|
-
secondary: string;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
export declare class CreatedAtDidKeyset extends TimeCidKeyset<{
|
|
55
|
-
createdAt: string;
|
|
56
|
-
did: string;
|
|
57
|
-
}> {
|
|
58
|
-
labelResult(result: {
|
|
59
|
-
createdAt: string;
|
|
60
|
-
did: string;
|
|
61
|
-
}): {
|
|
62
|
-
primary: string;
|
|
63
|
-
secondary: string;
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
export declare class IndexedAtDidKeyset extends TimeCidKeyset<{
|
|
67
|
-
indexedAt: string;
|
|
68
|
-
did: string;
|
|
69
|
-
}> {
|
|
70
|
-
labelResult(result: {
|
|
71
|
-
indexedAt: string;
|
|
72
|
-
did: string;
|
|
73
|
-
}): {
|
|
74
|
-
primary: string;
|
|
75
|
-
secondary: string;
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
export declare const paginate: <QB extends AnyQb, K extends GenericKeyset<unknown, any>>(qb: QB, opts: {
|
|
79
|
-
limit?: number;
|
|
80
|
-
cursor?: string;
|
|
81
|
-
direction?: "asc" | "desc";
|
|
82
|
-
keyset: K;
|
|
83
|
-
tryIndex?: boolean;
|
|
84
|
-
nullsLast?: boolean;
|
|
85
|
-
}) => QB;
|
|
86
|
-
export {};
|