@atproto/pds 0.5.15 → 0.5.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/dist/account-manager/account-manager.d.ts +13 -13
- package/dist/account-manager/account-manager.d.ts.map +1 -1
- package/dist/account-manager/account-manager.js +1 -1
- package/dist/account-manager/account-manager.js.map +1 -1
- package/dist/account-manager/db/index.d.ts +1 -1
- package/dist/account-manager/db/index.d.ts.map +1 -1
- package/dist/account-manager/db/index.js.map +1 -1
- package/dist/account-manager/db/migrations/001-init.d.ts +1 -1
- package/dist/account-manager/db/migrations/001-init.d.ts.map +1 -1
- package/dist/account-manager/db/migrations/001-init.js.map +1 -1
- package/dist/account-manager/db/migrations/002-account-deactivation.d.ts +1 -1
- package/dist/account-manager/db/migrations/002-account-deactivation.d.ts.map +1 -1
- package/dist/account-manager/db/migrations/002-account-deactivation.js.map +1 -1
- package/dist/account-manager/db/migrations/003-privileged-app-passwords.d.ts +1 -1
- package/dist/account-manager/db/migrations/003-privileged-app-passwords.d.ts.map +1 -1
- package/dist/account-manager/db/migrations/003-privileged-app-passwords.js.map +1 -1
- package/dist/account-manager/db/migrations/004-oauth.d.ts +1 -1
- package/dist/account-manager/db/migrations/004-oauth.d.ts.map +1 -1
- package/dist/account-manager/db/migrations/004-oauth.js.map +1 -1
- package/dist/account-manager/db/migrations/005-oauth-account-management.d.ts +3 -3
- package/dist/account-manager/db/migrations/005-oauth-account-management.d.ts.map +1 -1
- package/dist/account-manager/db/migrations/005-oauth-account-management.js.map +1 -1
- package/dist/account-manager/db/migrations/006-oauth-permission-sets.d.ts +1 -1
- package/dist/account-manager/db/migrations/006-oauth-permission-sets.d.ts.map +1 -1
- package/dist/account-manager/db/migrations/006-oauth-permission-sets.js.map +1 -1
- package/dist/account-manager/db/migrations/007-lexicon-failures-index.d.ts +1 -1
- package/dist/account-manager/db/migrations/007-lexicon-failures-index.d.ts.map +1 -1
- package/dist/account-manager/db/migrations/007-lexicon-failures-index.js.map +1 -1
- package/dist/account-manager/db/schema/account-device.d.ts +2 -2
- package/dist/account-manager/db/schema/account-device.d.ts.map +1 -1
- package/dist/account-manager/db/schema/account-device.js.map +1 -1
- package/dist/account-manager/db/schema/account.d.ts +2 -2
- package/dist/account-manager/db/schema/account.d.ts.map +1 -1
- package/dist/account-manager/db/schema/account.js.map +1 -1
- package/dist/account-manager/db/schema/actor.d.ts +2 -2
- package/dist/account-manager/db/schema/actor.d.ts.map +1 -1
- package/dist/account-manager/db/schema/actor.js.map +1 -1
- package/dist/account-manager/db/schema/app-password.d.ts +1 -1
- package/dist/account-manager/db/schema/app-password.d.ts.map +1 -1
- package/dist/account-manager/db/schema/app-password.js.map +1 -1
- package/dist/account-manager/db/schema/authorization-request.d.ts +4 -4
- package/dist/account-manager/db/schema/authorization-request.d.ts.map +1 -1
- package/dist/account-manager/db/schema/authorization-request.js.map +1 -1
- package/dist/account-manager/db/schema/authorized-client.d.ts +4 -4
- package/dist/account-manager/db/schema/authorized-client.d.ts.map +1 -1
- package/dist/account-manager/db/schema/authorized-client.js.map +1 -1
- package/dist/account-manager/db/schema/device.d.ts +3 -3
- package/dist/account-manager/db/schema/device.d.ts.map +1 -1
- package/dist/account-manager/db/schema/device.js.map +1 -1
- package/dist/account-manager/db/schema/email-token.d.ts +1 -1
- package/dist/account-manager/db/schema/email-token.d.ts.map +1 -1
- package/dist/account-manager/db/schema/email-token.js.map +1 -1
- package/dist/account-manager/db/schema/index.d.ts +14 -14
- package/dist/account-manager/db/schema/index.d.ts.map +1 -1
- package/dist/account-manager/db/schema/index.js.map +1 -1
- package/dist/account-manager/db/schema/invite-code.d.ts +1 -1
- package/dist/account-manager/db/schema/invite-code.d.ts.map +1 -1
- package/dist/account-manager/db/schema/invite-code.js.map +1 -1
- package/dist/account-manager/db/schema/lexicon.d.ts +2 -2
- package/dist/account-manager/db/schema/lexicon.d.ts.map +1 -1
- package/dist/account-manager/db/schema/lexicon.js.map +1 -1
- package/dist/account-manager/db/schema/repo-root.d.ts +1 -1
- package/dist/account-manager/db/schema/repo-root.d.ts.map +1 -1
- package/dist/account-manager/db/schema/repo-root.js.map +1 -1
- package/dist/account-manager/db/schema/token.d.ts +4 -4
- package/dist/account-manager/db/schema/token.d.ts.map +1 -1
- package/dist/account-manager/db/schema/token.js.map +1 -1
- package/dist/account-manager/db/schema/used-refresh-token.d.ts +2 -2
- package/dist/account-manager/db/schema/used-refresh-token.d.ts.map +1 -1
- package/dist/account-manager/db/schema/used-refresh-token.js.map +1 -1
- package/dist/account-manager/helpers/account-device.d.ts +2 -2
- package/dist/account-manager/helpers/account-device.d.ts.map +1 -1
- package/dist/account-manager/helpers/account-device.js.map +1 -1
- package/dist/account-manager/helpers/account.d.ts +3 -3
- package/dist/account-manager/helpers/account.d.ts.map +1 -1
- package/dist/account-manager/helpers/account.js.map +1 -1
- package/dist/account-manager/helpers/auth.d.ts +3 -3
- package/dist/account-manager/helpers/auth.d.ts.map +1 -1
- package/dist/account-manager/helpers/auth.js.map +1 -1
- package/dist/account-manager/helpers/authorization-request.d.ts +5 -5
- package/dist/account-manager/helpers/authorization-request.d.ts.map +1 -1
- package/dist/account-manager/helpers/authorization-request.js.map +1 -1
- package/dist/account-manager/helpers/authorized-client.d.ts +2 -2
- package/dist/account-manager/helpers/authorized-client.d.ts.map +1 -1
- package/dist/account-manager/helpers/authorized-client.js.map +1 -1
- package/dist/account-manager/helpers/device.d.ts +3 -3
- package/dist/account-manager/helpers/device.d.ts.map +1 -1
- package/dist/account-manager/helpers/device.js.map +1 -1
- package/dist/account-manager/helpers/email-token.d.ts +2 -2
- package/dist/account-manager/helpers/email-token.d.ts.map +1 -1
- package/dist/account-manager/helpers/email-token.js.map +1 -1
- package/dist/account-manager/helpers/invite.d.ts +3 -3
- package/dist/account-manager/helpers/invite.d.ts.map +1 -1
- package/dist/account-manager/helpers/invite.js +1 -1
- package/dist/account-manager/helpers/invite.js.map +1 -1
- package/dist/account-manager/helpers/lexicon.d.ts +2 -2
- package/dist/account-manager/helpers/lexicon.d.ts.map +1 -1
- package/dist/account-manager/helpers/lexicon.js +1 -1
- package/dist/account-manager/helpers/lexicon.js.map +1 -1
- package/dist/account-manager/helpers/password.d.ts +3 -3
- package/dist/account-manager/helpers/password.d.ts.map +1 -1
- package/dist/account-manager/helpers/password.js.map +1 -1
- package/dist/account-manager/helpers/repo.d.ts +2 -2
- package/dist/account-manager/helpers/repo.d.ts.map +1 -1
- package/dist/account-manager/helpers/repo.js.map +1 -1
- package/dist/account-manager/helpers/token.d.ts +4 -4
- package/dist/account-manager/helpers/token.d.ts.map +1 -1
- package/dist/account-manager/helpers/token.js.map +1 -1
- package/dist/account-manager/helpers/used-refresh-token.d.ts +2 -2
- package/dist/account-manager/helpers/used-refresh-token.d.ts.map +1 -1
- package/dist/account-manager/helpers/used-refresh-token.js.map +1 -1
- package/dist/account-manager/oauth-store.d.ts +10 -10
- package/dist/account-manager/oauth-store.d.ts.map +1 -1
- package/dist/account-manager/oauth-store.js +3 -3
- package/dist/account-manager/oauth-store.js.map +1 -1
- package/dist/account-manager/scope-reference-getter.d.ts +4 -4
- package/dist/account-manager/scope-reference-getter.d.ts.map +1 -1
- package/dist/account-manager/scope-reference-getter.js +1 -1
- package/dist/account-manager/scope-reference-getter.js.map +1 -1
- package/dist/actor-store/actor-store-reader.d.ts +3 -3
- package/dist/actor-store/actor-store-reader.d.ts.map +1 -1
- package/dist/actor-store/actor-store-reader.js.map +1 -1
- package/dist/actor-store/actor-store-resources.d.ts +2 -2
- package/dist/actor-store/actor-store-resources.d.ts.map +1 -1
- package/dist/actor-store/actor-store-resources.js.map +1 -1
- package/dist/actor-store/actor-store-transactor.d.ts +3 -3
- package/dist/actor-store/actor-store-transactor.d.ts.map +1 -1
- package/dist/actor-store/actor-store-transactor.js.map +1 -1
- package/dist/actor-store/actor-store.d.ts +4 -4
- package/dist/actor-store/actor-store.d.ts.map +1 -1
- package/dist/actor-store/actor-store.js.map +1 -1
- package/dist/actor-store/blob/reader.d.ts +6 -6
- package/dist/actor-store/blob/reader.d.ts.map +1 -1
- package/dist/actor-store/blob/reader.js.map +1 -1
- package/dist/actor-store/blob/transactor.d.ts +8 -8
- package/dist/actor-store/blob/transactor.d.ts.map +1 -1
- package/dist/actor-store/blob/transactor.js.map +1 -1
- package/dist/actor-store/db/index.d.ts +1 -1
- package/dist/actor-store/db/index.d.ts.map +1 -1
- package/dist/actor-store/db/index.js.map +1 -1
- package/dist/actor-store/db/migrations/001-init.d.ts +1 -1
- package/dist/actor-store/db/migrations/001-init.d.ts.map +1 -1
- package/dist/actor-store/db/migrations/001-init.js.map +1 -1
- package/dist/actor-store/db/schema/account-pref.d.ts +1 -1
- package/dist/actor-store/db/schema/account-pref.d.ts.map +1 -1
- package/dist/actor-store/db/schema/account-pref.js.map +1 -1
- package/dist/actor-store/db/schema/index.d.ts +7 -7
- package/dist/actor-store/db/schema/index.d.ts.map +1 -1
- package/dist/actor-store/db/schema/index.js.map +1 -1
- package/dist/actor-store/migrate.d.ts +1 -1
- package/dist/actor-store/migrate.d.ts.map +1 -1
- package/dist/actor-store/migrate.js.map +1 -1
- package/dist/actor-store/preference/reader.d.ts +2 -2
- package/dist/actor-store/preference/reader.d.ts.map +1 -1
- package/dist/actor-store/preference/reader.js.map +1 -1
- package/dist/actor-store/preference/transactor.d.ts +2 -2
- package/dist/actor-store/preference/transactor.d.ts.map +1 -1
- package/dist/actor-store/preference/transactor.js.map +1 -1
- package/dist/actor-store/record/reader.d.ts +5 -5
- package/dist/actor-store/record/reader.d.ts.map +1 -1
- package/dist/actor-store/record/reader.js.map +1 -1
- package/dist/actor-store/record/transactor.d.ts +5 -5
- package/dist/actor-store/record/transactor.d.ts.map +1 -1
- package/dist/actor-store/record/transactor.js.map +1 -1
- package/dist/actor-store/repo/reader.d.ts +3 -3
- package/dist/actor-store/repo/reader.d.ts.map +1 -1
- package/dist/actor-store/repo/reader.js.map +1 -1
- package/dist/actor-store/repo/sql-repo-reader.d.ts +3 -3
- package/dist/actor-store/repo/sql-repo-reader.d.ts.map +1 -1
- package/dist/actor-store/repo/sql-repo-reader.js.map +1 -1
- package/dist/actor-store/repo/sql-repo-transactor.d.ts +3 -3
- package/dist/actor-store/repo/sql-repo-transactor.d.ts.map +1 -1
- package/dist/actor-store/repo/sql-repo-transactor.js.map +1 -1
- package/dist/actor-store/repo/transactor.d.ts +7 -7
- package/dist/actor-store/repo/transactor.d.ts.map +1 -1
- package/dist/actor-store/repo/transactor.js +1 -1
- package/dist/actor-store/repo/transactor.js.map +1 -1
- package/dist/api/app/bsky/actor/getPreferences.d.ts +2 -2
- package/dist/api/app/bsky/actor/getPreferences.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/getPreferences.js.map +1 -1
- package/dist/api/app/bsky/actor/getProfile.d.ts +2 -2
- package/dist/api/app/bsky/actor/getProfile.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/getProfile.js.map +1 -1
- package/dist/api/app/bsky/actor/getProfiles.d.ts +2 -2
- package/dist/api/app/bsky/actor/getProfiles.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/getProfiles.js.map +1 -1
- package/dist/api/app/bsky/actor/index.d.ts +2 -2
- package/dist/api/app/bsky/actor/index.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/index.js.map +1 -1
- package/dist/api/app/bsky/actor/putPreferences.d.ts +2 -2
- package/dist/api/app/bsky/actor/putPreferences.d.ts.map +1 -1
- package/dist/api/app/bsky/actor/putPreferences.js.map +1 -1
- package/dist/api/app/bsky/feed/getActorLikes.d.ts +2 -2
- package/dist/api/app/bsky/feed/getActorLikes.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getActorLikes.js.map +1 -1
- package/dist/api/app/bsky/feed/getAuthorFeed.d.ts +2 -2
- package/dist/api/app/bsky/feed/getAuthorFeed.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getAuthorFeed.js.map +1 -1
- package/dist/api/app/bsky/feed/getFeed.d.ts +2 -2
- package/dist/api/app/bsky/feed/getFeed.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getFeed.js +1 -1
- package/dist/api/app/bsky/feed/getFeed.js.map +1 -1
- package/dist/api/app/bsky/feed/getPostThread.d.ts +2 -2
- package/dist/api/app/bsky/feed/getPostThread.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getPostThread.js.map +1 -1
- package/dist/api/app/bsky/feed/getTimeline.d.ts +2 -2
- package/dist/api/app/bsky/feed/getTimeline.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/getTimeline.js.map +1 -1
- package/dist/api/app/bsky/feed/index.d.ts +2 -2
- package/dist/api/app/bsky/feed/index.d.ts.map +1 -1
- package/dist/api/app/bsky/feed/index.js.map +1 -1
- package/dist/api/app/bsky/index.d.ts +2 -2
- package/dist/api/app/bsky/index.d.ts.map +1 -1
- package/dist/api/app/bsky/index.js.map +1 -1
- package/dist/api/app/bsky/notification/index.d.ts +2 -2
- package/dist/api/app/bsky/notification/index.d.ts.map +1 -1
- package/dist/api/app/bsky/notification/index.js.map +1 -1
- package/dist/api/app/bsky/notification/registerPush.d.ts +2 -2
- package/dist/api/app/bsky/notification/registerPush.d.ts.map +1 -1
- package/dist/api/app/bsky/notification/registerPush.js.map +1 -1
- package/dist/api/app/bsky/notification/unregisterPush.d.ts +2 -2
- package/dist/api/app/bsky/notification/unregisterPush.d.ts.map +1 -1
- package/dist/api/app/bsky/notification/unregisterPush.js.map +1 -1
- package/dist/api/app/bsky/util/resolver.d.ts +1 -1
- package/dist/api/app/bsky/util/resolver.d.ts.map +1 -1
- package/dist/api/app/bsky/util/resolver.js +1 -1
- package/dist/api/app/bsky/util/resolver.js.map +1 -1
- package/dist/api/com/atproto/admin/deleteAccount.d.ts +2 -2
- package/dist/api/com/atproto/admin/deleteAccount.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/deleteAccount.js.map +1 -1
- package/dist/api/com/atproto/admin/disableAccountInvites.d.ts +2 -2
- package/dist/api/com/atproto/admin/disableAccountInvites.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/disableAccountInvites.js.map +1 -1
- package/dist/api/com/atproto/admin/disableInviteCodes.d.ts +2 -2
- package/dist/api/com/atproto/admin/disableInviteCodes.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/disableInviteCodes.js.map +1 -1
- package/dist/api/com/atproto/admin/enableAccountInvites.d.ts +2 -2
- package/dist/api/com/atproto/admin/enableAccountInvites.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/enableAccountInvites.js.map +1 -1
- package/dist/api/com/atproto/admin/getAccountInfo.d.ts +2 -2
- package/dist/api/com/atproto/admin/getAccountInfo.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/getAccountInfo.js.map +1 -1
- package/dist/api/com/atproto/admin/getAccountInfos.d.ts +2 -2
- package/dist/api/com/atproto/admin/getAccountInfos.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/getAccountInfos.js.map +1 -1
- package/dist/api/com/atproto/admin/getInviteCodes.d.ts +3 -3
- package/dist/api/com/atproto/admin/getInviteCodes.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/getInviteCodes.js.map +1 -1
- package/dist/api/com/atproto/admin/getSubjectStatus.d.ts +2 -2
- package/dist/api/com/atproto/admin/getSubjectStatus.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/getSubjectStatus.js.map +1 -1
- package/dist/api/com/atproto/admin/index.d.ts +2 -2
- package/dist/api/com/atproto/admin/index.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/index.js.map +1 -1
- package/dist/api/com/atproto/admin/sendEmail.d.ts +2 -2
- package/dist/api/com/atproto/admin/sendEmail.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/sendEmail.js.map +1 -1
- package/dist/api/com/atproto/admin/updateAccountEmail.d.ts +2 -2
- package/dist/api/com/atproto/admin/updateAccountEmail.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/updateAccountEmail.js.map +1 -1
- package/dist/api/com/atproto/admin/updateAccountHandle.d.ts +2 -2
- package/dist/api/com/atproto/admin/updateAccountHandle.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/updateAccountHandle.js.map +1 -1
- package/dist/api/com/atproto/admin/updateAccountPassword.d.ts +2 -2
- package/dist/api/com/atproto/admin/updateAccountPassword.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/updateAccountPassword.js.map +1 -1
- package/dist/api/com/atproto/admin/updateSubjectStatus.d.ts +2 -2
- package/dist/api/com/atproto/admin/updateSubjectStatus.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/updateSubjectStatus.js.map +1 -1
- package/dist/api/com/atproto/admin/util.d.ts +4 -4
- package/dist/api/com/atproto/admin/util.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/util.js.map +1 -1
- package/dist/api/com/atproto/identity/getRecommendedDidCredentials.d.ts +2 -2
- package/dist/api/com/atproto/identity/getRecommendedDidCredentials.d.ts.map +1 -1
- package/dist/api/com/atproto/identity/getRecommendedDidCredentials.js.map +1 -1
- package/dist/api/com/atproto/identity/index.d.ts +2 -2
- package/dist/api/com/atproto/identity/index.d.ts.map +1 -1
- package/dist/api/com/atproto/identity/index.js.map +1 -1
- package/dist/api/com/atproto/identity/requestPlcOperationSignature.d.ts +2 -2
- package/dist/api/com/atproto/identity/requestPlcOperationSignature.d.ts.map +1 -1
- package/dist/api/com/atproto/identity/requestPlcOperationSignature.js.map +1 -1
- package/dist/api/com/atproto/identity/resolveHandle.d.ts +2 -2
- package/dist/api/com/atproto/identity/resolveHandle.d.ts.map +1 -1
- package/dist/api/com/atproto/identity/resolveHandle.js.map +1 -1
- package/dist/api/com/atproto/identity/signPlcOperation.d.ts +2 -2
- package/dist/api/com/atproto/identity/signPlcOperation.d.ts.map +1 -1
- package/dist/api/com/atproto/identity/signPlcOperation.js.map +1 -1
- package/dist/api/com/atproto/identity/submitPlcOperation.d.ts +2 -2
- package/dist/api/com/atproto/identity/submitPlcOperation.d.ts.map +1 -1
- package/dist/api/com/atproto/identity/submitPlcOperation.js.map +1 -1
- package/dist/api/com/atproto/identity/updateHandle.d.ts +2 -2
- package/dist/api/com/atproto/identity/updateHandle.d.ts.map +1 -1
- package/dist/api/com/atproto/identity/updateHandle.js.map +1 -1
- package/dist/api/com/atproto/index.d.ts +2 -2
- package/dist/api/com/atproto/index.d.ts.map +1 -1
- package/dist/api/com/atproto/index.js.map +1 -1
- package/dist/api/com/atproto/moderation/createReport.d.ts +2 -2
- package/dist/api/com/atproto/moderation/createReport.d.ts.map +1 -1
- package/dist/api/com/atproto/moderation/createReport.js.map +1 -1
- package/dist/api/com/atproto/moderation/index.d.ts +2 -2
- package/dist/api/com/atproto/moderation/index.d.ts.map +1 -1
- package/dist/api/com/atproto/moderation/index.js.map +1 -1
- package/dist/api/com/atproto/repo/applyWrites.d.ts +2 -2
- package/dist/api/com/atproto/repo/applyWrites.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/applyWrites.js.map +1 -1
- package/dist/api/com/atproto/repo/createRecord.d.ts +2 -2
- package/dist/api/com/atproto/repo/createRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/createRecord.js.map +1 -1
- package/dist/api/com/atproto/repo/deleteRecord.d.ts +2 -2
- package/dist/api/com/atproto/repo/deleteRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/deleteRecord.js.map +1 -1
- package/dist/api/com/atproto/repo/describeRepo.d.ts +2 -2
- package/dist/api/com/atproto/repo/describeRepo.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/describeRepo.js.map +1 -1
- package/dist/api/com/atproto/repo/getRecord.d.ts +2 -2
- package/dist/api/com/atproto/repo/getRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/getRecord.js.map +1 -1
- package/dist/api/com/atproto/repo/importRepo.d.ts +2 -2
- package/dist/api/com/atproto/repo/importRepo.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/importRepo.js.map +1 -1
- package/dist/api/com/atproto/repo/index.d.ts +2 -2
- package/dist/api/com/atproto/repo/index.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/index.js.map +1 -1
- package/dist/api/com/atproto/repo/listMissingBlobs.d.ts +2 -2
- package/dist/api/com/atproto/repo/listMissingBlobs.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/listMissingBlobs.js.map +1 -1
- package/dist/api/com/atproto/repo/listRecords.d.ts +2 -2
- package/dist/api/com/atproto/repo/listRecords.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/listRecords.js.map +1 -1
- package/dist/api/com/atproto/repo/putRecord.d.ts +2 -2
- package/dist/api/com/atproto/repo/putRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/putRecord.js.map +1 -1
- package/dist/api/com/atproto/repo/uploadBlob.d.ts +2 -2
- package/dist/api/com/atproto/repo/uploadBlob.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/uploadBlob.js +9 -2
- package/dist/api/com/atproto/repo/uploadBlob.js.map +1 -1
- package/dist/api/com/atproto/server/activateAccount.d.ts +2 -2
- package/dist/api/com/atproto/server/activateAccount.d.ts.map +1 -1
- package/dist/api/com/atproto/server/activateAccount.js.map +1 -1
- package/dist/api/com/atproto/server/checkAccountStatus.d.ts +2 -2
- package/dist/api/com/atproto/server/checkAccountStatus.d.ts.map +1 -1
- package/dist/api/com/atproto/server/checkAccountStatus.js.map +1 -1
- package/dist/api/com/atproto/server/confirmEmail.d.ts +2 -2
- package/dist/api/com/atproto/server/confirmEmail.d.ts.map +1 -1
- package/dist/api/com/atproto/server/confirmEmail.js.map +1 -1
- package/dist/api/com/atproto/server/createAccount.d.ts +2 -2
- package/dist/api/com/atproto/server/createAccount.d.ts.map +1 -1
- package/dist/api/com/atproto/server/createAccount.js +1 -1
- package/dist/api/com/atproto/server/createAccount.js.map +1 -1
- package/dist/api/com/atproto/server/createAppPassword.d.ts +2 -2
- package/dist/api/com/atproto/server/createAppPassword.d.ts.map +1 -1
- package/dist/api/com/atproto/server/createAppPassword.js.map +1 -1
- package/dist/api/com/atproto/server/createInviteCode.d.ts +2 -2
- package/dist/api/com/atproto/server/createInviteCode.d.ts.map +1 -1
- package/dist/api/com/atproto/server/createInviteCode.js.map +1 -1
- package/dist/api/com/atproto/server/createInviteCodes.d.ts +2 -2
- package/dist/api/com/atproto/server/createInviteCodes.d.ts.map +1 -1
- package/dist/api/com/atproto/server/createInviteCodes.js.map +1 -1
- package/dist/api/com/atproto/server/createSession.d.ts +2 -2
- package/dist/api/com/atproto/server/createSession.d.ts.map +1 -1
- package/dist/api/com/atproto/server/createSession.js +1 -1
- package/dist/api/com/atproto/server/createSession.js.map +1 -1
- package/dist/api/com/atproto/server/deactivateAccount.d.ts +2 -2
- package/dist/api/com/atproto/server/deactivateAccount.d.ts.map +1 -1
- package/dist/api/com/atproto/server/deactivateAccount.js.map +1 -1
- package/dist/api/com/atproto/server/deleteAccount.d.ts +2 -2
- package/dist/api/com/atproto/server/deleteAccount.d.ts.map +1 -1
- package/dist/api/com/atproto/server/deleteAccount.js.map +1 -1
- package/dist/api/com/atproto/server/deleteSession.d.ts +2 -2
- package/dist/api/com/atproto/server/deleteSession.d.ts.map +1 -1
- package/dist/api/com/atproto/server/deleteSession.js.map +1 -1
- package/dist/api/com/atproto/server/describeServer.d.ts +2 -2
- package/dist/api/com/atproto/server/describeServer.d.ts.map +1 -1
- package/dist/api/com/atproto/server/describeServer.js.map +1 -1
- package/dist/api/com/atproto/server/getAccountInviteCodes.d.ts +2 -2
- package/dist/api/com/atproto/server/getAccountInviteCodes.d.ts.map +1 -1
- package/dist/api/com/atproto/server/getAccountInviteCodes.js.map +1 -1
- package/dist/api/com/atproto/server/getServiceAuth.d.ts +2 -2
- package/dist/api/com/atproto/server/getServiceAuth.d.ts.map +1 -1
- package/dist/api/com/atproto/server/getServiceAuth.js.map +1 -1
- package/dist/api/com/atproto/server/getSession.d.ts +2 -2
- package/dist/api/com/atproto/server/getSession.d.ts.map +1 -1
- package/dist/api/com/atproto/server/getSession.js +1 -1
- package/dist/api/com/atproto/server/getSession.js.map +1 -1
- package/dist/api/com/atproto/server/index.d.ts +2 -2
- package/dist/api/com/atproto/server/index.d.ts.map +1 -1
- package/dist/api/com/atproto/server/index.js.map +1 -1
- package/dist/api/com/atproto/server/listAppPasswords.d.ts +2 -2
- package/dist/api/com/atproto/server/listAppPasswords.d.ts.map +1 -1
- package/dist/api/com/atproto/server/listAppPasswords.js.map +1 -1
- package/dist/api/com/atproto/server/refreshSession.d.ts +2 -2
- package/dist/api/com/atproto/server/refreshSession.d.ts.map +1 -1
- package/dist/api/com/atproto/server/refreshSession.js +1 -1
- package/dist/api/com/atproto/server/refreshSession.js.map +1 -1
- package/dist/api/com/atproto/server/requestAccountDelete.d.ts +2 -2
- package/dist/api/com/atproto/server/requestAccountDelete.d.ts.map +1 -1
- package/dist/api/com/atproto/server/requestAccountDelete.js.map +1 -1
- package/dist/api/com/atproto/server/requestEmailConfirmation.d.ts +3 -3
- package/dist/api/com/atproto/server/requestEmailConfirmation.d.ts.map +1 -1
- package/dist/api/com/atproto/server/requestEmailConfirmation.js.map +1 -1
- package/dist/api/com/atproto/server/requestEmailUpdate.d.ts +3 -3
- package/dist/api/com/atproto/server/requestEmailUpdate.d.ts.map +1 -1
- package/dist/api/com/atproto/server/requestEmailUpdate.js.map +1 -1
- package/dist/api/com/atproto/server/requestPasswordReset.d.ts +2 -2
- package/dist/api/com/atproto/server/requestPasswordReset.d.ts.map +1 -1
- package/dist/api/com/atproto/server/requestPasswordReset.js.map +1 -1
- package/dist/api/com/atproto/server/reserveSigningKey.d.ts +2 -2
- package/dist/api/com/atproto/server/reserveSigningKey.d.ts.map +1 -1
- package/dist/api/com/atproto/server/reserveSigningKey.js.map +1 -1
- package/dist/api/com/atproto/server/resetPassword.d.ts +2 -2
- package/dist/api/com/atproto/server/resetPassword.d.ts.map +1 -1
- package/dist/api/com/atproto/server/resetPassword.js.map +1 -1
- package/dist/api/com/atproto/server/revokeAppPassword.d.ts +2 -2
- package/dist/api/com/atproto/server/revokeAppPassword.d.ts.map +1 -1
- package/dist/api/com/atproto/server/revokeAppPassword.js.map +1 -1
- package/dist/api/com/atproto/server/updateEmail.d.ts +2 -2
- package/dist/api/com/atproto/server/updateEmail.d.ts.map +1 -1
- package/dist/api/com/atproto/server/updateEmail.js.map +1 -1
- package/dist/api/com/atproto/server/util.d.ts +4 -4
- package/dist/api/com/atproto/server/util.d.ts.map +1 -1
- package/dist/api/com/atproto/server/util.js.map +1 -1
- package/dist/api/com/atproto/sync/deprecated/getCheckout.d.ts +2 -2
- package/dist/api/com/atproto/sync/deprecated/getCheckout.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/deprecated/getCheckout.js.map +1 -1
- package/dist/api/com/atproto/sync/deprecated/getHead.d.ts +2 -2
- package/dist/api/com/atproto/sync/deprecated/getHead.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/deprecated/getHead.js.map +1 -1
- package/dist/api/com/atproto/sync/getBlob.d.ts +2 -2
- package/dist/api/com/atproto/sync/getBlob.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/getBlob.js.map +1 -1
- package/dist/api/com/atproto/sync/getBlocks.d.ts +2 -2
- package/dist/api/com/atproto/sync/getBlocks.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/getBlocks.js.map +1 -1
- package/dist/api/com/atproto/sync/getLatestCommit.d.ts +2 -2
- package/dist/api/com/atproto/sync/getLatestCommit.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/getLatestCommit.js.map +1 -1
- package/dist/api/com/atproto/sync/getRecord.d.ts +2 -2
- package/dist/api/com/atproto/sync/getRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/getRecord.js.map +1 -1
- package/dist/api/com/atproto/sync/getRepo.d.ts +3 -3
- package/dist/api/com/atproto/sync/getRepo.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/getRepo.js.map +1 -1
- package/dist/api/com/atproto/sync/getRepoStatus.d.ts +2 -2
- package/dist/api/com/atproto/sync/getRepoStatus.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/getRepoStatus.js.map +1 -1
- package/dist/api/com/atproto/sync/index.d.ts +2 -2
- package/dist/api/com/atproto/sync/index.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/index.js.map +1 -1
- package/dist/api/com/atproto/sync/listBlobs.d.ts +2 -2
- package/dist/api/com/atproto/sync/listBlobs.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/listBlobs.js.map +1 -1
- package/dist/api/com/atproto/sync/listRepos.d.ts +3 -3
- package/dist/api/com/atproto/sync/listRepos.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/listRepos.js +1 -1
- package/dist/api/com/atproto/sync/listRepos.js.map +1 -1
- package/dist/api/com/atproto/sync/subscribeRepos.d.ts +2 -2
- package/dist/api/com/atproto/sync/subscribeRepos.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/subscribeRepos.js.map +1 -1
- package/dist/api/com/atproto/sync/util.d.ts +3 -3
- package/dist/api/com/atproto/sync/util.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/util.js.map +1 -1
- package/dist/api/com/atproto/temp/checkSignupQueue.d.ts +2 -2
- package/dist/api/com/atproto/temp/checkSignupQueue.d.ts.map +1 -1
- package/dist/api/com/atproto/temp/checkSignupQueue.js.map +1 -1
- package/dist/api/com/atproto/temp/index.d.ts +2 -2
- package/dist/api/com/atproto/temp/index.d.ts.map +1 -1
- package/dist/api/com/atproto/temp/index.js.map +1 -1
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/proxy.d.ts +2 -2
- package/dist/api/proxy.d.ts.map +1 -1
- package/dist/api/proxy.js.map +1 -1
- package/dist/auth-output.d.ts +3 -3
- package/dist/auth-output.d.ts.map +1 -1
- package/dist/auth-output.js.map +1 -1
- package/dist/auth-routes.d.ts +1 -1
- package/dist/auth-routes.d.ts.map +1 -1
- package/dist/auth-routes.js +4 -2
- package/dist/auth-routes.js.map +1 -1
- package/dist/auth-verifier.d.ts +11 -11
- package/dist/auth-verifier.d.ts.map +1 -1
- package/dist/auth-verifier.js +2 -2
- package/dist/auth-verifier.js.map +1 -1
- package/dist/basic-routes.d.ts +1 -1
- package/dist/basic-routes.d.ts.map +1 -1
- package/dist/basic-routes.js.map +1 -1
- package/dist/config/config.d.ts +4 -3
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +1 -0
- package/dist/config/config.js.map +1 -1
- package/dist/config/env.d.ts +1 -0
- package/dist/config/env.d.ts.map +1 -1
- package/dist/config/env.js +1 -0
- package/dist/config/env.js.map +1 -1
- package/dist/config/secrets.d.ts +1 -1
- package/dist/config/secrets.d.ts.map +1 -1
- package/dist/config/secrets.js.map +1 -1
- package/dist/context.d.ts +8 -8
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +4 -2
- package/dist/context.js.map +1 -1
- package/dist/crawlers.d.ts +1 -1
- package/dist/crawlers.d.ts.map +1 -1
- package/dist/crawlers.js.map +1 -1
- package/dist/db/db.js.map +1 -1
- package/dist/db/migrator.d.ts +2 -2
- package/dist/db/migrator.d.ts.map +1 -1
- package/dist/db/migrator.js.map +1 -1
- package/dist/db/pagination.d.ts +2 -2
- package/dist/db/pagination.d.ts.map +1 -1
- package/dist/db/pagination.js.map +1 -1
- package/dist/db/tables/moderation.d.ts +2 -2
- package/dist/db/tables/moderation.d.ts.map +1 -1
- package/dist/db/tables/moderation.js.map +1 -1
- package/dist/db/util.d.ts +1 -1
- package/dist/db/util.d.ts.map +1 -1
- package/dist/db/util.js.map +1 -1
- package/dist/did-cache/db/index.d.ts +1 -1
- package/dist/did-cache/db/index.d.ts.map +1 -1
- package/dist/did-cache/db/index.js.map +1 -1
- package/dist/did-cache/db/migrations.d.ts +1 -1
- package/dist/did-cache/db/migrations.d.ts.map +1 -1
- package/dist/did-cache/db/migrations.js.map +1 -1
- package/dist/did-cache/index.d.ts +2 -2
- package/dist/did-cache/index.d.ts.map +1 -1
- package/dist/did-cache/index.js.map +1 -1
- package/dist/disk-blobstore.d.ts +3 -3
- package/dist/disk-blobstore.d.ts.map +1 -1
- package/dist/disk-blobstore.js.map +1 -1
- package/dist/error.d.ts +1 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +1 -1
- package/dist/error.js.map +1 -1
- package/dist/image/image-url-builder.d.ts +1 -1
- package/dist/image/image-url-builder.d.ts.map +1 -1
- package/dist/image/image-url-builder.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lexicons/app/bsky/actor/defs.defs.d.ts +1 -1
- package/dist/lexicons/app/bsky/actor/defs.defs.js.map +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js.map +1 -1
- package/dist/mailer/index.d.ts +2 -2
- package/dist/mailer/index.d.ts.map +1 -1
- package/dist/mailer/index.js.map +1 -1
- package/dist/mailer/moderation.d.ts +2 -2
- package/dist/mailer/moderation.d.ts.map +1 -1
- package/dist/mailer/moderation.js.map +1 -1
- package/dist/pipethrough.d.ts +7 -7
- package/dist/pipethrough.d.ts.map +1 -1
- package/dist/pipethrough.js.map +1 -1
- package/dist/read-after-write/types.d.ts +4 -4
- package/dist/read-after-write/types.d.ts.map +1 -1
- package/dist/read-after-write/types.js.map +1 -1
- package/dist/read-after-write/util.d.ts +5 -5
- package/dist/read-after-write/util.d.ts.map +1 -1
- package/dist/read-after-write/util.js.map +1 -1
- package/dist/read-after-write/viewer.d.ts +7 -7
- package/dist/read-after-write/viewer.d.ts.map +1 -1
- package/dist/read-after-write/viewer.js +1 -1
- package/dist/read-after-write/viewer.js.map +1 -1
- package/dist/repo/prepare.d.ts +4 -4
- package/dist/repo/prepare.d.ts.map +1 -1
- package/dist/repo/prepare.js.map +1 -1
- package/dist/repo/types.d.ts +3 -3
- package/dist/repo/types.d.ts.map +1 -1
- package/dist/repo/types.js.map +1 -1
- package/dist/scripts/publish-identity.d.ts +2 -2
- package/dist/scripts/publish-identity.d.ts.map +1 -1
- package/dist/scripts/publish-identity.js.map +1 -1
- package/dist/scripts/rebuild-repo.d.ts +4 -4
- package/dist/scripts/rebuild-repo.d.ts.map +1 -1
- package/dist/scripts/rebuild-repo.js.map +1 -1
- package/dist/scripts/rotate-keys.d.ts +6 -6
- package/dist/scripts/rotate-keys.d.ts.map +1 -1
- package/dist/scripts/rotate-keys.js.map +1 -1
- package/dist/scripts/sequencer-recovery/index.d.ts +1 -1
- package/dist/scripts/sequencer-recovery/index.d.ts.map +1 -1
- package/dist/scripts/sequencer-recovery/index.js.map +1 -1
- package/dist/scripts/sequencer-recovery/recoverer.d.ts +4 -4
- package/dist/scripts/sequencer-recovery/recoverer.d.ts.map +1 -1
- package/dist/scripts/sequencer-recovery/recoverer.js.map +1 -1
- package/dist/scripts/sequencer-recovery/recovery-db.d.ts +1 -1
- package/dist/scripts/sequencer-recovery/recovery-db.d.ts.map +1 -1
- package/dist/scripts/sequencer-recovery/recovery-db.js.map +1 -1
- package/dist/scripts/sequencer-recovery/repair-repos.d.ts +1 -1
- package/dist/scripts/sequencer-recovery/repair-repos.d.ts.map +1 -1
- package/dist/scripts/sequencer-recovery/repair-repos.js.map +1 -1
- package/dist/sequencer/db/index.d.ts +1 -1
- package/dist/sequencer/db/index.d.ts.map +1 -1
- package/dist/sequencer/db/index.js.map +1 -1
- package/dist/sequencer/db/migrations/001-init.d.ts +1 -1
- package/dist/sequencer/db/migrations/001-init.d.ts.map +1 -1
- package/dist/sequencer/db/migrations/001-init.js.map +1 -1
- package/dist/sequencer/db/schema.d.ts +1 -1
- package/dist/sequencer/db/schema.d.ts.map +1 -1
- package/dist/sequencer/db/schema.js.map +1 -1
- package/dist/sequencer/events.d.ts +3 -3
- package/dist/sequencer/events.d.ts.map +1 -1
- package/dist/sequencer/events.js.map +1 -1
- package/dist/sequencer/outbox.d.ts +1 -1
- package/dist/sequencer/outbox.d.ts.map +1 -1
- package/dist/sequencer/outbox.js.map +1 -1
- package/dist/sequencer/sequencer.d.ts +5 -5
- package/dist/sequencer/sequencer.d.ts.map +1 -1
- package/dist/sequencer/sequencer.js.map +1 -1
- package/dist/util/compression.js.map +1 -1
- package/dist/util/http.d.ts +1 -1
- package/dist/util/http.d.ts.map +1 -1
- package/dist/util/http.js.map +1 -1
- package/dist/well-known.d.ts +1 -1
- package/dist/well-known.d.ts.map +1 -1
- package/dist/well-known.js.map +1 -1
- package/package.json +25 -25
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submitPlcOperation.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/identity/submitPlcOperation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,MAAM,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"submitPlcOperation.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/identity/submitPlcOperation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAyDvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submitPlcOperation.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/identity/submitPlcOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"submitPlcOperation.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/identity/submitPlcOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAe,MAAM,s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'@atproto/common'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { httpLogger as log } from '../../../../logger.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.identity.submitPlcOperation, {\n auth: ctx.authVerifier.authorization({\n authorize: (permissions) => {\n permissions.assertIdentity({ attr: '*' })\n },\n }),\n handler: async ({ auth, input }) => {\n const requester = auth.credentials.did\n const op = input.body.operation\n\n if (!check.is(op, plc.def.operation)) {\n throw new InvalidRequestError('Invalid operation')\n }\n\n const rotationKey =\n ctx.cfg.entryway?.plcRotationKey ?? ctx.plcRotationKey.did()\n if (!op.rotationKeys.includes(rotationKey)) {\n throw new InvalidRequestError(\n \"Rotation keys do not include server's rotation key\",\n )\n }\n if (op.services['atproto_pds']?.type !== 'AtprotoPersonalDataServer') {\n throw new InvalidRequestError('Incorrect type on atproto_pds service')\n }\n if (op.services['atproto_pds']?.endpoint !== ctx.cfg.service.publicUrl) {\n throw new InvalidRequestError(\n 'Incorrect endpoint on atproto_pds service',\n )\n }\n const signingKey = await ctx.actorStore.keypair(requester)\n if (op.verificationMethods['atproto'] !== signingKey.did()) {\n throw new InvalidRequestError('Incorrect signing key')\n }\n const account = await ctx.accountManager.getAccount(requester, {\n includeDeactivated: true,\n })\n if (\n account?.handle &&\n op.alsoKnownAs.at(0) !== `at://${account.handle}`\n ) {\n throw new InvalidRequestError('Incorrect handle in alsoKnownAs')\n }\n\n await ctx.plcClient.sendOperation(requester, op)\n await ctx.sequencer.sequenceIdentity(requester)\n\n try {\n await ctx.idResolver.did.resolve(requester, true)\n } catch (err) {\n log.error(\n { err, did: requester },\n 'failed to refresh did after plc update',\n )\n }\n },\n })\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Server } from '@atproto/xrpc-server';
|
|
2
|
-
import { AppContext } from '../../../../context.js';
|
|
1
|
+
import type { Server } from '@atproto/xrpc-server';
|
|
2
|
+
import type { AppContext } from '../../../../context.js';
|
|
3
3
|
export default function (server: Server, ctx: AppContext): void;
|
|
4
4
|
//# sourceMappingURL=updateHandle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateHandle.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/identity/updateHandle.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,MAAM,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"updateHandle.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/identity/updateHandle.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAEnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA2DvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateHandle.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/identity/updateHandle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAI7C,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,EAAE,cAAc,EAAE,GAAG,GAAG,CAAA;IAE9B,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;QAC1C,aAAa,EAAE,IAAI;QACnB,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE;YACzB,WAAW,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;QAChD,CAAC;KACF,CAAC,CAAA;IAEF,MAAM,SAAS,GAAgD;QAC7D;YACE,UAAU,EAAE,CAAC,GAAG,MAAM;YACtB,MAAM,EAAE,EA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YAAY,CACnC,IAAI,CAAC,WAAW,CAAC,GAAG,EACpB,KAAK,CAAC,IAAI,CAAC,MAAM,CAClB,CAAA;YACH,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { DAY, MINUTE } from '@atproto/common'\nimport { MethodRateLimit, Server } from '@atproto/xrpc-server'\nimport { AccessOutput, OAuthOutput } from '../../../../auth-output.js'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const { entrywayClient } = ctx\n\n const auth = ctx.authVerifier.authorization({\n checkTakedown: true,\n authorize: (permissions) => {\n permissions.assertIdentity({ attr: 'handle' })\n },\n })\n\n const rateLimit: MethodRateLimit<AccessOutput | OAuthOutput> = [\n {\n durationMs: 5 * MINUTE,\n points: 10,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n {\n durationMs: DAY,\n points: 50,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n ]\n\n if (entrywayClient) {\n server.add(com.atproto.identity.updateHandle, {\n auth,\n rateLimit,\n handler: async ({ auth, input, req }) => {\n const { headers } = await ctx.entrywayAuthHeaders(\n req,\n auth.credentials.did,\n com.atproto.identity.updateHandle.$lxm,\n )\n\n // The full flow is:\n // -> entryway(identity.updateHandle) [update handle, submit plc op]\n // -> pds(admin.updateAccountHandle) [track handle, sequence handle update]\n await entrywayClient.xrpc(com.atproto.identity.updateHandle, {\n headers,\n body: {\n handle: input.body.handle,\n // @ts-expect-error \"did\" is not in the schema\n did: auth.credentials.did,\n },\n })\n },\n })\n } else {\n server.add(com.atproto.identity.updateHandle, {\n auth,\n rateLimit,\n handler: async ({ auth, input }) => {\n await ctx.accountManager.updateHandle(\n auth.credentials.did,\n input.body.handle,\n )\n },\n })\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"updateHandle.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/identity/updateHandle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,EAAE;oBAC3D,OAAO;oBACP,IAAI,EAAE;wBACJ,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM;wBACzB,8CAA8C;wBAC9C,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG;qBAC1B;iBACF,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,EAAE;YAC5C,IAAI;YACJ,SAAS;YACT,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;gBACjC,MAAM,GAAG,CAAC,cAAc,CAAC,YAAY,CACnC,IAAI,CAAC,WAAW,CAAC,GAAG,EACpB,KAAK,CAAC,IAAI,CAAC,MAAM,CAClB,CAAA;YACH,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { DAY, MINUTE } from '@atproto/common'\nimport type { MethodRateLimit, Server } from '@atproto/xrpc-server'\nimport type { AccessOutput, OAuthOutput } from '../../../../auth-output.js'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n const { entrywayClient } = ctx\n\n const auth = ctx.authVerifier.authorization({\n checkTakedown: true,\n authorize: (permissions) => {\n permissions.assertIdentity({ attr: 'handle' })\n },\n })\n\n const rateLimit: MethodRateLimit<AccessOutput | OAuthOutput> = [\n {\n durationMs: 5 * MINUTE,\n points: 10,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n {\n durationMs: DAY,\n points: 50,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n ]\n\n if (entrywayClient) {\n server.add(com.atproto.identity.updateHandle, {\n auth,\n rateLimit,\n handler: async ({ auth, input, req }) => {\n const { headers } = await ctx.entrywayAuthHeaders(\n req,\n auth.credentials.did,\n com.atproto.identity.updateHandle.$lxm,\n )\n\n // The full flow is:\n // -> entryway(identity.updateHandle) [update handle, submit plc op]\n // -> pds(admin.updateAccountHandle) [track handle, sequence handle update]\n await entrywayClient.xrpc(com.atproto.identity.updateHandle, {\n headers,\n body: {\n handle: input.body.handle,\n // @ts-expect-error \"did\" is not in the schema\n did: auth.credentials.did,\n },\n })\n },\n })\n } else {\n server.add(com.atproto.identity.updateHandle, {\n auth,\n rateLimit,\n handler: async ({ auth, input }) => {\n await ctx.accountManager.updateHandle(\n auth.credentials.did,\n input.body.handle,\n )\n },\n })\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Server } from '@atproto/xrpc-server';
|
|
2
|
-
import { AppContext } from '../../../context.js';
|
|
1
|
+
import type { Server } from '@atproto/xrpc-server';
|
|
2
|
+
import type { AppContext } from '../../../context.js';
|
|
3
3
|
export default function (server: Server, ctx: AppContext): void;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/com/atproto/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/com/atproto/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AASrD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAQvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/com/atproto/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,kBAAkB,CAAA;AACpC,OAAO,QAAQ,MAAM,qBAAqB,CAAA;AAC1C,OAAO,UAAU,MAAM,uBAAuB,CAAA;AAC9C,OAAO,IAAI,MAAM,iBAAiB,CAAA;AAClC,OAAO,aAAa,MAAM,mBAAmB,CAAA;AAC7C,OAAO,IAAI,MAAM,iBAAiB,CAAA;AAClC,OAAO,IAAI,MAAM,iBAAiB,CAAA;AAElC,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAClB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACrB,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvB,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjB,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjB,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AACnB,CAAC","sourcesContent":["import { Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../context.js'\nimport admin from './admin/index.js'\nimport identity from './identity/index.js'\nimport moderation from './moderation/index.js'\nimport repo from './repo/index.js'\nimport serverMethods from './server/index.js'\nimport sync from './sync/index.js'\nimport temp from './temp/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n admin(server, ctx)\n identity(server, ctx)\n moderation(server, ctx)\n repo(server, ctx)\n serverMethods(server, ctx)\n sync(server, ctx)\n temp(server, ctx)\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/com/atproto/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,kBAAkB,CAAA;AACpC,OAAO,QAAQ,MAAM,qBAAqB,CAAA;AAC1C,OAAO,UAAU,MAAM,uBAAuB,CAAA;AAC9C,OAAO,IAAI,MAAM,iBAAiB,CAAA;AAClC,OAAO,aAAa,MAAM,mBAAmB,CAAA;AAC7C,OAAO,IAAI,MAAM,iBAAiB,CAAA;AAClC,OAAO,IAAI,MAAM,iBAAiB,CAAA;AAElC,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAClB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACrB,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvB,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjB,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACjB,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AACnB,CAAC","sourcesContent":["import type { Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../context.js'\nimport admin from './admin/index.js'\nimport identity from './identity/index.js'\nimport moderation from './moderation/index.js'\nimport repo from './repo/index.js'\nimport serverMethods from './server/index.js'\nimport sync from './sync/index.js'\nimport temp from './temp/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n admin(server, ctx)\n identity(server, ctx)\n moderation(server, ctx)\n repo(server, ctx)\n serverMethods(server, ctx)\n sync(server, ctx)\n temp(server, ctx)\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Server } from '@atproto/xrpc-server';
|
|
2
|
-
import { AppContext } from '../../../../context.js';
|
|
1
|
+
import type { Server } from '@atproto/xrpc-server';
|
|
2
|
+
import type { AppContext } from '../../../../context.js';
|
|
3
3
|
export default function (server: Server, ctx: AppContext): void;
|
|
4
4
|
//# sourceMappingURL=createReport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createReport.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/createReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"createReport.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/createReport.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAiCvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createReport.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/createReport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAE3E,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE;QAC9C,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;YACnC,UAAU,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC;YACjC,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;gBAClC,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAA;gBACpD,MAAM,GAAG,GAAG,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;gBACzC,WAAW,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAA;YACrC,CAAC;SACF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;YACxD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,cAAc,CAC5C,GAAG,EACH,GAAG,EACH,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CACzC,CAAA;YAED,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,CAAC,kBAAkB,CAC9C,IAAI,CAAC,WAAW,CAAC,GAAG,EACpB,GAAG,EACH,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CACzC,CAAA;YAED,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE;gBACpD,eAAe,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO;gBACxC,gBAAgB,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO;gBACzC,wBAAwB,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO;gBACjD,OAAO;gBACP,MAAM;gBACN,IAAI;aACL,CAAC,CAAA;QACJ,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { xrpc } from '@atproto/lex'\nimport { Server } from '@atproto/xrpc-server'\nimport { AuthScope } from '../../../../auth-scope.js'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { computeProxyTo, parseProxyInfo } from '../../../../pipethrough.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.moderation.createReport, {\n auth: ctx.authVerifier.authorization({\n additional: [AuthScope.Takendown],\n authorize: (permissions, { req }) => {\n const lxm = com.atproto.moderation.createReport.$lxm\n const aud = computeProxyTo(ctx, req, lxm)\n permissions.assertRpc({ aud, lxm })\n },\n }),\n handler: async ({ auth, params, input: { body }, req }) => {\n const { url, did: aud } = await parseProxyInfo(\n ctx,\n req,\n com.atproto.moderation.createReport.$lxm,\n )\n\n const { headers } = await ctx.serviceAuthHeaders(\n auth.credentials.did,\n aud,\n com.atproto.moderation.createReport.$lxm,\n )\n\n return xrpc(url, com.atproto.moderation.createReport, {\n validateRequest: ctx.cfg.service.devMode,\n validateResponse: ctx.cfg.service.devMode,\n strictResponseProcessing: ctx.cfg.service.devMode,\n headers,\n params,\n body,\n })\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"createReport.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/createReport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAE3E,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE;QAC9C,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;YACnC,UAAU,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC;YACjC,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;gBAClC,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAA;gBACpD,MAAM,GAAG,GAAG,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;gBACzC,WAAW,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAA;YACrC,CAAC;SACF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;YACxD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,cAAc,CAC5C,GAAG,EACH,GAAG,EACH,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CACzC,CAAA;YAED,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,CAAC,kBAAkB,CAC9C,IAAI,CAAC,WAAW,CAAC,GAAG,EACpB,GAAG,EACH,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CACzC,CAAA;YAED,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE;gBACpD,eAAe,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO;gBACxC,gBAAgB,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO;gBACzC,wBAAwB,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO;gBACjD,OAAO;gBACP,MAAM;gBACN,IAAI;aACL,CAAC,CAAA;QACJ,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { xrpc } from '@atproto/lex'\nimport type { Server } from '@atproto/xrpc-server'\nimport { AuthScope } from '../../../../auth-scope.js'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { computeProxyTo, parseProxyInfo } from '../../../../pipethrough.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.moderation.createReport, {\n auth: ctx.authVerifier.authorization({\n additional: [AuthScope.Takendown],\n authorize: (permissions, { req }) => {\n const lxm = com.atproto.moderation.createReport.$lxm\n const aud = computeProxyTo(ctx, req, lxm)\n permissions.assertRpc({ aud, lxm })\n },\n }),\n handler: async ({ auth, params, input: { body }, req }) => {\n const { url, did: aud } = await parseProxyInfo(\n ctx,\n req,\n com.atproto.moderation.createReport.$lxm,\n )\n\n const { headers } = await ctx.serviceAuthHeaders(\n auth.credentials.did,\n aud,\n com.atproto.moderation.createReport.$lxm,\n )\n\n return xrpc(url, com.atproto.moderation.createReport, {\n validateRequest: ctx.cfg.service.devMode,\n validateResponse: ctx.cfg.service.devMode,\n strictResponseProcessing: ctx.cfg.service.devMode,\n headers,\n params,\n body,\n })\n },\n })\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Server } from '@atproto/xrpc-server';
|
|
2
|
-
import { AppContext } from '../../../../context.js';
|
|
1
|
+
import type { Server } from '@atproto/xrpc-server';
|
|
2
|
+
import type { AppContext } from '../../../../context.js';
|
|
3
3
|
export default function (server: Server, ctx: AppContext): void;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAEvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/index.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAE5C,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAC3B,CAAC","sourcesContent":["import { Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport createReport from './createReport.js'\n\nexport default function (server: Server, ctx: AppContext) {\n createReport(server, ctx)\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/moderation/index.ts"],"names":[],"mappings":"AAEA,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAE5C,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAC3B,CAAC","sourcesContent":["import type { Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport createReport from './createReport.js'\n\nexport default function (server: Server, ctx: AppContext) {\n createReport(server, ctx)\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Server } from '@atproto/xrpc-server';
|
|
2
|
-
import { AppContext } from '../../../../context.js';
|
|
1
|
+
import { type Server } from '@atproto/xrpc-server';
|
|
2
|
+
import type { AppContext } from '../../../../context.js';
|
|
3
3
|
export default function (server: Server, ctx: AppContext): void;
|
|
4
4
|
//# sourceMappingURL=applyWrites.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyWrites.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/applyWrites.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,MAAM,
|
|
1
|
+
{"version":3,"file":"applyWrites.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/applyWrites.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AA8BxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAuKvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyWrites.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/applyWrites.ts"],"names":[],"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AE,MAAM,CAAC,GAAG;qBAChB;oBACD,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC,mBAAmB,CAAC;iBACjD;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,mBAAmB,GAAG,CAAC,KAAoB,EAAE,EAAE;IACnD,QAAQ,KAAK,CAAC,MAAM,EAAE,CAAC;QACrB,KAAK,aAAa,CAAC,MAAM;YACvB,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC;gBACtD,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE;gBACzB,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE;gBACzB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;aACzC,CAAC,CAAA;QACJ,KAAK,aAAa,CAAC,MAAM;YACvB,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC;gBACtD,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE;gBACzB,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE;gBACzB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;aACzC,CAAC,CAAA;QACJ,KAAK,aAAa,CAAC,MAAM;YACvB,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QAC7D;YACE,MAAM,IAAI,KAAK,CAAC,wBAAwB,KAAK,EAAE,CAAC,CAAA;IACpD,CAAC;AACH,CAAC,CAAA","sourcesContent":["import { parseCid } from '@atproto/lex-data'\nimport { WriteOpAction } from '@atproto/repo'\nimport {\n AuthRequiredError,\n InvalidRequestError,\n Server,\n} from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { dbLogger } from '../../../../logger.js'\nimport {\n BadCommitSwapError,\n InvalidRecordError,\n PreparedWrite,\n prepareCreate,\n prepareDelete,\n prepareUpdate,\n} from '../../../../repo/index.js'\n\nconst ratelimitPoints = ({\n input,\n}: {\n input: com.atproto.repo.applyWrites.$Input\n}) => {\n let points = 0\n for (const op of input.body.writes) {\n if (com.atproto.repo.applyWrites.create.$isTypeOf(op)) {\n points += 3\n } else if (com.atproto.repo.applyWrites.update.$isTypeOf(op)) {\n points += 2\n } else {\n points += 1\n }\n }\n return points\n}\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.applyWrites, {\n auth: ctx.authVerifier.authorization({\n // @NOTE the \"checkTakedown\" and \"checkDeactivated\" checks are typically\n // performed during auth. However, since this method's \"repo\" parameter\n // can be a handle, we will need to fetch the account again to ensure that\n // the handle matches the DID from the request's credentials. In order to\n // avoid fetching the account twice (during auth, and then again in the\n // controller), the checks are disabled here:\n\n // checkTakedown: true,\n // checkDeactivated: true,\n authorize: () => {\n // Performed in the handler as it is based on the request body\n },\n }),\n\n rateLimit: [\n {\n name: 'repo-write-hour',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: ratelimitPoints,\n },\n {\n name: 'repo-write-day',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: ratelimitPoints,\n },\n ],\n\n opts: {\n jsonLimit: 1_000_000,\n },\n\n handler: async ({ input, auth }) => {\n const { repo, validate, swapCommit, writes } = input.body\n\n const account = await ctx.authVerifier.findAccount(repo, {\n checkDeactivated: true,\n checkTakedown: true,\n })\n\n const did = account.did\n if (did !== auth.credentials.did) {\n throw new AuthRequiredError()\n }\n\n if (writes.length > 200) {\n throw new InvalidRequestError('Too many writes. Max: 200')\n }\n\n // Verify permission of every unique \"action\" / \"collection\" pair\n if (auth.credentials.type === 'oauth') {\n // @NOTE Unlike \"importRepo\", we do not require \"action\" = \"*\" here.\n for (const [action, collections] of [\n [\n 'create',\n new Set(\n writes\n .filter((v) => com.atproto.repo.applyWrites.create.$isTypeOf(v))\n .map((w) => w.collection),\n ),\n ],\n [\n 'update',\n new Set(\n writes\n .filter((v) => com.atproto.repo.applyWrites.update.$isTypeOf(v))\n .map((w) => w.collection),\n ),\n ],\n [\n 'delete',\n new Set(\n writes\n .filter((v) => com.atproto.repo.applyWrites.delete.$isTypeOf(v))\n .map((w) => w.collection),\n ),\n ],\n ] as const) {\n for (const collection of collections) {\n auth.credentials.permissions.assertRepo({ action, collection })\n }\n }\n }\n\n // @NOTE should preserve order of ts.writes for final use in response\n let preparedWrites: PreparedWrite[]\n try {\n preparedWrites = await Promise.all(\n writes.map(async (write, i) => {\n if (com.atproto.repo.applyWrites.create.$isTypeOf(write)) {\n return prepareCreate({\n did,\n collection: write.collection,\n record: write.value,\n rkey: write.rkey,\n validate,\n validationPath: ['writes', i, 'record'],\n })\n } else if (com.atproto.repo.applyWrites.update.$isTypeOf(write)) {\n return prepareUpdate({\n did,\n collection: write.collection,\n record: write.value,\n rkey: write.rkey,\n validate,\n validationPath: ['writes', i, 'record'],\n })\n } else if (com.atproto.repo.applyWrites.delete.$isTypeOf(write)) {\n return prepareDelete({\n did,\n collection: write.collection,\n rkey: write.rkey,\n })\n } else {\n throw new InvalidRequestError(\n `Action not supported: ${write['$type']}`,\n )\n }\n }),\n )\n } catch (err) {\n if (err instanceof InvalidRecordError) {\n throw new InvalidRequestError(err.message)\n }\n throw err\n }\n\n const swapCommitCid = swapCommit ? parseCid(swapCommit) : undefined\n\n const commit = await ctx.actorStore.transact(did, async (actorTxn) => {\n const commit = await actorTxn.repo\n .processWrites(preparedWrites, swapCommitCid)\n .catch((err) => {\n if (err instanceof BadCommitSwapError) {\n throw new InvalidRequestError(err.message, 'InvalidSwap')\n } else {\n throw err\n }\n })\n\n await ctx.sequencer.sequenceCommit(did, commit)\n return commit\n })\n\n await ctx.accountManager\n .updateRepoRoot(did, commit.cid, commit.rev)\n .catch((err) => {\n dbLogger.error(\n { err, did, cid: commit.cid, rev: commit.rev },\n 'failed to update account root',\n )\n })\n\n return {\n encoding: 'application/json' as const,\n body: {\n commit: {\n cid: commit.cid.toString(),\n rev: commit.rev,\n },\n results: preparedWrites.map(writeToOutputResult),\n },\n }\n },\n })\n}\n\nconst writeToOutputResult = (write: PreparedWrite) => {\n switch (write.action) {\n case WriteOpAction.Create:\n return com.atproto.repo.applyWrites.createResult.$build({\n cid: write.cid.toString(),\n uri: write.uri.toString(),\n validationStatus: write.validationStatus,\n })\n case WriteOpAction.Update:\n return com.atproto.repo.applyWrites.updateResult.$build({\n cid: write.cid.toString(),\n uri: write.uri.toString(),\n validationStatus: write.validationStatus,\n })\n case WriteOpAction.Delete:\n return com.atproto.repo.applyWrites.deleteResult.$build({})\n default:\n throw new Error(`Unrecognized action: ${write}`)\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"applyWrites.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/applyWrites.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GAEpB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAElB,aAAa,EACb,aAAa,EACb,aAAa,GACd,MAAM,2BAA2B,CAAA;AAElC,MAAM,eAAe,GAAG,CAAC,EACvB,KAAK,GAGN,EAAE,EAAE;IACH,IAAI,MAAM,GAAG,CAAC,CAAA;IACd,KAAK,MAAM,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QACnC,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC;YACtD,MAAM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,CAAC,GAAG,CAAC,QAAQ,EAAE;gBACzB,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE;gBACzB,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;aACzC,CAAC,CAAA;QACJ,KAAK,aAAa,CAAC,MAAM;YACvB,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QAC7D;YACE,MAAM,IAAI,KAAK,CAAC,wBAAwB,KAAK,EAAE,CAAC,CAAA;IACpD,CAAC;AACH,CAAC,CAAA","sourcesContent":["import { parseCid } from '@atproto/lex-data'\nimport { WriteOpAction } from '@atproto/repo'\nimport {\n AuthRequiredError,\n InvalidRequestError,\n type Server,\n} from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { dbLogger } from '../../../../logger.js'\nimport {\n BadCommitSwapError,\n InvalidRecordError,\n type PreparedWrite,\n prepareCreate,\n prepareDelete,\n prepareUpdate,\n} from '../../../../repo/index.js'\n\nconst ratelimitPoints = ({\n input,\n}: {\n input: com.atproto.repo.applyWrites.$Input\n}) => {\n let points = 0\n for (const op of input.body.writes) {\n if (com.atproto.repo.applyWrites.create.$isTypeOf(op)) {\n points += 3\n } else if (com.atproto.repo.applyWrites.update.$isTypeOf(op)) {\n points += 2\n } else {\n points += 1\n }\n }\n return points\n}\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.applyWrites, {\n auth: ctx.authVerifier.authorization({\n // @NOTE the \"checkTakedown\" and \"checkDeactivated\" checks are typically\n // performed during auth. However, since this method's \"repo\" parameter\n // can be a handle, we will need to fetch the account again to ensure that\n // the handle matches the DID from the request's credentials. In order to\n // avoid fetching the account twice (during auth, and then again in the\n // controller), the checks are disabled here:\n\n // checkTakedown: true,\n // checkDeactivated: true,\n authorize: () => {\n // Performed in the handler as it is based on the request body\n },\n }),\n\n rateLimit: [\n {\n name: 'repo-write-hour',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: ratelimitPoints,\n },\n {\n name: 'repo-write-day',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: ratelimitPoints,\n },\n ],\n\n opts: {\n jsonLimit: 1_000_000,\n },\n\n handler: async ({ input, auth }) => {\n const { repo, validate, swapCommit, writes } = input.body\n\n const account = await ctx.authVerifier.findAccount(repo, {\n checkDeactivated: true,\n checkTakedown: true,\n })\n\n const did = account.did\n if (did !== auth.credentials.did) {\n throw new AuthRequiredError()\n }\n\n if (writes.length > 200) {\n throw new InvalidRequestError('Too many writes. Max: 200')\n }\n\n // Verify permission of every unique \"action\" / \"collection\" pair\n if (auth.credentials.type === 'oauth') {\n // @NOTE Unlike \"importRepo\", we do not require \"action\" = \"*\" here.\n for (const [action, collections] of [\n [\n 'create',\n new Set(\n writes\n .filter((v) => com.atproto.repo.applyWrites.create.$isTypeOf(v))\n .map((w) => w.collection),\n ),\n ],\n [\n 'update',\n new Set(\n writes\n .filter((v) => com.atproto.repo.applyWrites.update.$isTypeOf(v))\n .map((w) => w.collection),\n ),\n ],\n [\n 'delete',\n new Set(\n writes\n .filter((v) => com.atproto.repo.applyWrites.delete.$isTypeOf(v))\n .map((w) => w.collection),\n ),\n ],\n ] as const) {\n for (const collection of collections) {\n auth.credentials.permissions.assertRepo({ action, collection })\n }\n }\n }\n\n // @NOTE should preserve order of ts.writes for final use in response\n let preparedWrites: PreparedWrite[]\n try {\n preparedWrites = await Promise.all(\n writes.map(async (write, i) => {\n if (com.atproto.repo.applyWrites.create.$isTypeOf(write)) {\n return prepareCreate({\n did,\n collection: write.collection,\n record: write.value,\n rkey: write.rkey,\n validate,\n validationPath: ['writes', i, 'record'],\n })\n } else if (com.atproto.repo.applyWrites.update.$isTypeOf(write)) {\n return prepareUpdate({\n did,\n collection: write.collection,\n record: write.value,\n rkey: write.rkey,\n validate,\n validationPath: ['writes', i, 'record'],\n })\n } else if (com.atproto.repo.applyWrites.delete.$isTypeOf(write)) {\n return prepareDelete({\n did,\n collection: write.collection,\n rkey: write.rkey,\n })\n } else {\n throw new InvalidRequestError(\n `Action not supported: ${write['$type']}`,\n )\n }\n }),\n )\n } catch (err) {\n if (err instanceof InvalidRecordError) {\n throw new InvalidRequestError(err.message)\n }\n throw err\n }\n\n const swapCommitCid = swapCommit ? parseCid(swapCommit) : undefined\n\n const commit = await ctx.actorStore.transact(did, async (actorTxn) => {\n const commit = await actorTxn.repo\n .processWrites(preparedWrites, swapCommitCid)\n .catch((err) => {\n if (err instanceof BadCommitSwapError) {\n throw new InvalidRequestError(err.message, 'InvalidSwap')\n } else {\n throw err\n }\n })\n\n await ctx.sequencer.sequenceCommit(did, commit)\n return commit\n })\n\n await ctx.accountManager\n .updateRepoRoot(did, commit.cid, commit.rev)\n .catch((err) => {\n dbLogger.error(\n { err, did, cid: commit.cid, rev: commit.rev },\n 'failed to update account root',\n )\n })\n\n return {\n encoding: 'application/json' as const,\n body: {\n commit: {\n cid: commit.cid.toString(),\n rev: commit.rev,\n },\n results: preparedWrites.map(writeToOutputResult),\n },\n }\n },\n })\n}\n\nconst writeToOutputResult = (write: PreparedWrite) => {\n switch (write.action) {\n case WriteOpAction.Create:\n return com.atproto.repo.applyWrites.createResult.$build({\n cid: write.cid.toString(),\n uri: write.uri.toString(),\n validationStatus: write.validationStatus,\n })\n case WriteOpAction.Update:\n return com.atproto.repo.applyWrites.updateResult.$build({\n cid: write.cid.toString(),\n uri: write.uri.toString(),\n validationStatus: write.validationStatus,\n })\n case WriteOpAction.Delete:\n return com.atproto.repo.applyWrites.deleteResult.$build({})\n default:\n throw new Error(`Unrecognized action: ${write}`)\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Server } from '@atproto/xrpc-server';
|
|
2
|
-
import { AppContext } from '../../../../context.js';
|
|
1
|
+
import { type Server } from '@atproto/xrpc-server';
|
|
2
|
+
import type { AppContext } from '../../../../context.js';
|
|
3
3
|
export default function (server: Server, ctx: AppContext): void;
|
|
4
4
|
//# sourceMappingURL=createRecord.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRecord.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/createRecord.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,MAAM,
|
|
1
|
+
{"version":3,"file":"createRecord.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/createRecord.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAWxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA4HvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRecord.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/createRecord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GAEpB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAElB,aAAa,EACb,aAAa,GACd,MAAM,2BAA2B,CAAA;AAElC,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE;QACxC,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;YACnC,wEAAwE;YACxE,uEAAuE;YACvE,0EAA0E;YAC1E,yEAAyE;YACzE,u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validRequestError,\n Server,\n} from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { dbLogger } from '../../../../logger.js'\nimport {\n BadCommitSwapError,\n InvalidRecordError,\n PreparedCreate,\n prepareCreate,\n prepareDelete,\n} from '../../../../repo/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.createRecord, {\n auth: ctx.authVerifier.authorization({\n // @NOTE the \"checkTakedown\" and \"checkDeactivated\" checks are typically\n // performed during auth. However, since this method's \"repo\" parameter\n // can be a handle, we will need to fetch the account again to ensure that\n // the handle matches the DID from the request's credentials. In order to\n // avoid fetching the account twice (during auth, and then again in the\n // controller), the checks are disabled here:\n\n // checkTakedown: true,\n // checkDeactivated: true,\n authorize: () => {\n // Performed in the handler as it requires the request body\n },\n }),\n rateLimit: [\n {\n name: 'repo-write-hour',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: () => 3,\n },\n {\n name: 'repo-write-day',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: () => 3,\n },\n ],\n opts: {\n jsonLimit: 1_000_000,\n },\n handler: async ({ input, auth }) => {\n const { repo, collection, rkey, record, swapCommit, validate } =\n input.body\n\n const account = await ctx.authVerifier.findAccount(repo, {\n checkDeactivated: true,\n checkTakedown: true,\n })\n\n const did = account.did\n if (did !== auth.credentials.did) {\n throw new AuthRequiredError()\n }\n\n if (auth.credentials.type === 'oauth') {\n auth.credentials.permissions.assertRepo({\n action: 'create',\n collection,\n })\n }\n\n const swapCommitCid = swapCommit ? parseCid(swapCommit) : undefined\n\n let write: PreparedCreate\n try {\n write = await prepareCreate({\n did,\n collection,\n record,\n rkey,\n validate,\n })\n } catch (err) {\n if (err instanceof InvalidRecordError) {\n throw new InvalidRequestError(err.message)\n }\n if (err instanceof InvalidRecordKeyError) {\n throw new InvalidRequestError(err.message)\n }\n throw err\n }\n\n const commit = await ctx.actorStore.transact(did, async (actorTxn) => {\n const backlinkConflicts =\n validate !== false\n ? await actorTxn.record.getBacklinkConflicts(\n write.uri,\n write.record,\n )\n : []\n const backlinkDeletions = backlinkConflicts.map((uri) =>\n prepareDelete({\n did: uri.did,\n collection: uri.collectionSafe,\n rkey: uri.rkeySafe,\n }),\n )\n const writes = [...backlinkDeletions, write]\n const commit = await actorTxn.repo\n .processWrites(writes, swapCommitCid)\n .catch((err) => {\n if (err instanceof BadCommitSwapError) {\n throw new InvalidRequestError(err.message, 'InvalidSwap')\n }\n throw err\n })\n await ctx.sequencer.sequenceCommit(did, commit)\n return commit\n })\n\n await ctx.accountManager\n .updateRepoRoot(did, commit.cid, commit.rev)\n .catch((err) => {\n dbLogger.error(\n { err, did, cid: commit.cid, rev: commit.rev },\n 'failed to update account root',\n )\n })\n\n return {\n encoding: 'application/json' as const,\n body: {\n uri: write.uri.toString(),\n cid: write.cid.toString(),\n commit: {\n cid: commit.cid.toString(),\n rev: commit.rev,\n },\n validationStatus: write.validationStatus,\n },\n }\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"createRecord.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/createRecord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GAEpB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAElB,aAAa,EACb,aAAa,GACd,MAAM,2BAA2B,CAAA;AAElC,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE;QACxC,IAAI,EAAE,GAA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J,CAAC","sourcesContent":["import { parseCid } from '@atproto/lex-data'\nimport { InvalidRecordKeyError } from '@atproto/syntax'\nimport {\n AuthRequiredError,\n InvalidRequestError,\n type Server,\n} from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { dbLogger } from '../../../../logger.js'\nimport {\n BadCommitSwapError,\n InvalidRecordError,\n type PreparedCreate,\n prepareCreate,\n prepareDelete,\n} from '../../../../repo/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.createRecord, {\n auth: ctx.authVerifier.authorization({\n // @NOTE the \"checkTakedown\" and \"checkDeactivated\" checks are typically\n // performed during auth. However, since this method's \"repo\" parameter\n // can be a handle, we will need to fetch the account again to ensure that\n // the handle matches the DID from the request's credentials. In order to\n // avoid fetching the account twice (during auth, and then again in the\n // controller), the checks are disabled here:\n\n // checkTakedown: true,\n // checkDeactivated: true,\n authorize: () => {\n // Performed in the handler as it requires the request body\n },\n }),\n rateLimit: [\n {\n name: 'repo-write-hour',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: () => 3,\n },\n {\n name: 'repo-write-day',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: () => 3,\n },\n ],\n opts: {\n jsonLimit: 1_000_000,\n },\n handler: async ({ input, auth }) => {\n const { repo, collection, rkey, record, swapCommit, validate } =\n input.body\n\n const account = await ctx.authVerifier.findAccount(repo, {\n checkDeactivated: true,\n checkTakedown: true,\n })\n\n const did = account.did\n if (did !== auth.credentials.did) {\n throw new AuthRequiredError()\n }\n\n if (auth.credentials.type === 'oauth') {\n auth.credentials.permissions.assertRepo({\n action: 'create',\n collection,\n })\n }\n\n const swapCommitCid = swapCommit ? parseCid(swapCommit) : undefined\n\n let write: PreparedCreate\n try {\n write = await prepareCreate({\n did,\n collection,\n record,\n rkey,\n validate,\n })\n } catch (err) {\n if (err instanceof InvalidRecordError) {\n throw new InvalidRequestError(err.message)\n }\n if (err instanceof InvalidRecordKeyError) {\n throw new InvalidRequestError(err.message)\n }\n throw err\n }\n\n const commit = await ctx.actorStore.transact(did, async (actorTxn) => {\n const backlinkConflicts =\n validate !== false\n ? await actorTxn.record.getBacklinkConflicts(\n write.uri,\n write.record,\n )\n : []\n const backlinkDeletions = backlinkConflicts.map((uri) =>\n prepareDelete({\n did: uri.did,\n collection: uri.collectionSafe,\n rkey: uri.rkeySafe,\n }),\n )\n const writes = [...backlinkDeletions, write]\n const commit = await actorTxn.repo\n .processWrites(writes, swapCommitCid)\n .catch((err) => {\n if (err instanceof BadCommitSwapError) {\n throw new InvalidRequestError(err.message, 'InvalidSwap')\n }\n throw err\n })\n await ctx.sequencer.sequenceCommit(did, commit)\n return commit\n })\n\n await ctx.accountManager\n .updateRepoRoot(did, commit.cid, commit.rev)\n .catch((err) => {\n dbLogger.error(\n { err, did, cid: commit.cid, rev: commit.rev },\n 'failed to update account root',\n )\n })\n\n return {\n encoding: 'application/json' as const,\n body: {\n uri: write.uri.toString(),\n cid: write.cid.toString(),\n commit: {\n cid: commit.cid.toString(),\n rev: commit.rev,\n },\n validationStatus: write.validationStatus,\n },\n }\n },\n })\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Server } from '@atproto/xrpc-server';
|
|
2
|
-
import { AppContext } from '../../../../context.js';
|
|
1
|
+
import { type Server } from '@atproto/xrpc-server';
|
|
2
|
+
import type { AppContext } from '../../../../context.js';
|
|
3
3
|
export default function (server: Server, ctx: AppContext): void;
|
|
4
4
|
//# sourceMappingURL=deleteRecord.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteRecord.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/deleteRecord.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,MAAM,
|
|
1
|
+
{"version":3,"file":"deleteRecord.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/deleteRecord.ts"],"names":[],"mappings":"AACA,O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AAM,EAAE,MAAM;wBACZ,CAAC,CAAC;4BACE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE;4BAC1B,GAAG,EAAE,MAAM,CAAC,GAAG;yBAChB;wBACH,CAAC,CAAC,SAAS;iBACd;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { parseCid } from '@atproto/lex-data'\nimport {\n AuthRequiredError,\n InvalidRequestError,\n Server,\n} from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { dbLogger } from '../../../../logger.js'\nimport {\n BadCommitSwapError,\n BadRecordSwapError,\n prepareDelete,\n} from '../../../../repo/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.deleteRecord, {\n auth: ctx.authVerifier.authorization({\n // @NOTE the \"checkTakedown\" and \"checkDeactivated\" checks are typically\n // performed during auth. However, since this method's \"repo\" parameter\n // can be a handle, we will need to fetch the account again to ensure that\n // the handle matches the DID from the request's credentials. In order to\n // avoid fetching the account twice (during auth, and then again in the\n // controller), the checks are disabled here:\n\n // checkTakedown: true,\n // checkDeactivated: true,\n authorize: () => {\n // Performed in the handler as it requires the request body\n },\n }),\n rateLimit: [\n {\n name: 'repo-write-hour',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: () => 1,\n },\n {\n name: 'repo-write-day',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: () => 1,\n },\n ],\n handler: async ({ input: { body }, auth }) => {\n const { repo, collection, rkey, swapCommit, swapRecord } = body\n\n const account = await ctx.authVerifier.findAccount(repo, {\n checkDeactivated: true,\n checkTakedown: true,\n })\n\n const did = account.did\n if (did !== auth.credentials.did) {\n throw new AuthRequiredError()\n }\n\n // We can't compute permissions based on the request payload (\"input\") in\n // the 'auth' phase, so we do it here.\n if (auth.credentials.type === 'oauth') {\n auth.credentials.permissions.assertRepo({\n action: 'delete',\n collection,\n })\n }\n\n const swapCommitCid = swapCommit ? parseCid(swapCommit) : undefined\n const swapRecordCid = swapRecord ? parseCid(swapRecord) : undefined\n\n const write = prepareDelete({\n did,\n collection,\n rkey,\n swapCid: swapRecordCid,\n })\n const commit = await ctx.actorStore.transact(did, async (actorTxn) => {\n const record = await actorTxn.record.getRecord(write.uri, null, true)\n if (!record) {\n return null // No-op if record already doesn't exist\n }\n\n const commit = await actorTxn.repo\n .processWrites([write], swapCommitCid)\n .catch((err) => {\n if (\n err instanceof BadCommitSwapError ||\n err instanceof BadRecordSwapError\n ) {\n throw new InvalidRequestError(err.message, 'InvalidSwap')\n } else {\n throw err\n }\n })\n\n await ctx.sequencer.sequenceCommit(did, commit)\n return commit\n })\n\n if (commit !== null) {\n await ctx.accountManager\n .updateRepoRoot(did, commit.cid, commit.rev)\n .catch((err) => {\n dbLogger.error(\n { err, did, cid: commit.cid, rev: commit.rev },\n 'failed to update account root',\n )\n })\n }\n\n return {\n encoding: 'application/json' as const,\n body: {\n commit: commit\n ? {\n cid: commit.cid.toString(),\n rev: commit.rev,\n }\n : undefined,\n },\n }\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"deleteRecord.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/deleteRecord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GAEpB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,GACd,MAAM,2BAA2B,CAAA;AAElC,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE;QACxC,IAAI,EA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f,CAAC,CAAC,CAAA;YAEF,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;gBACpB,MAAM,GAAG,CAAC,cAAc;qBACrB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC;qBAC3C,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;oBACb,QAAQ,CAAC,KAAK,CACZ,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,EAC9C,+BAA+B,CAChC,CAAA;gBACH,CAAC,CAAC,CAAA;YACN,CAAC;YAED,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI,EAAE;oBACJ,MAAM,EAAE,MAAM;wBACZ,CAAC,CAAC;4BACE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE;4BAC1B,GAAG,EAAE,MAAM,CAAC,GAAG;yBAChB;wBACH,CAAC,CAAC,SAAS;iBACd;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { parseCid } from '@atproto/lex-data'\nimport {\n AuthRequiredError,\n InvalidRequestError,\n type Server,\n} from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { dbLogger } from '../../../../logger.js'\nimport {\n BadCommitSwapError,\n BadRecordSwapError,\n prepareDelete,\n} from '../../../../repo/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.deleteRecord, {\n auth: ctx.authVerifier.authorization({\n // @NOTE the \"checkTakedown\" and \"checkDeactivated\" checks are typically\n // performed during auth. However, since this method's \"repo\" parameter\n // can be a handle, we will need to fetch the account again to ensure that\n // the handle matches the DID from the request's credentials. In order to\n // avoid fetching the account twice (during auth, and then again in the\n // controller), the checks are disabled here:\n\n // checkTakedown: true,\n // checkDeactivated: true,\n authorize: () => {\n // Performed in the handler as it requires the request body\n },\n }),\n rateLimit: [\n {\n name: 'repo-write-hour',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: () => 1,\n },\n {\n name: 'repo-write-day',\n calcKey: ({ auth }) => auth.credentials.did,\n calcPoints: () => 1,\n },\n ],\n handler: async ({ input: { body }, auth }) => {\n const { repo, collection, rkey, swapCommit, swapRecord } = body\n\n const account = await ctx.authVerifier.findAccount(repo, {\n checkDeactivated: true,\n checkTakedown: true,\n })\n\n const did = account.did\n if (did !== auth.credentials.did) {\n throw new AuthRequiredError()\n }\n\n // We can't compute permissions based on the request payload (\"input\") in\n // the 'auth' phase, so we do it here.\n if (auth.credentials.type === 'oauth') {\n auth.credentials.permissions.assertRepo({\n action: 'delete',\n collection,\n })\n }\n\n const swapCommitCid = swapCommit ? parseCid(swapCommit) : undefined\n const swapRecordCid = swapRecord ? parseCid(swapRecord) : undefined\n\n const write = prepareDelete({\n did,\n collection,\n rkey,\n swapCid: swapRecordCid,\n })\n const commit = await ctx.actorStore.transact(did, async (actorTxn) => {\n const record = await actorTxn.record.getRecord(write.uri, null, true)\n if (!record) {\n return null // No-op if record already doesn't exist\n }\n\n const commit = await actorTxn.repo\n .processWrites([write], swapCommitCid)\n .catch((err) => {\n if (\n err instanceof BadCommitSwapError ||\n err instanceof BadRecordSwapError\n ) {\n throw new InvalidRequestError(err.message, 'InvalidSwap')\n } else {\n throw err\n }\n })\n\n await ctx.sequencer.sequenceCommit(did, commit)\n return commit\n })\n\n if (commit !== null) {\n await ctx.accountManager\n .updateRepoRoot(did, commit.cid, commit.rev)\n .catch((err) => {\n dbLogger.error(\n { err, did, cid: commit.cid, rev: commit.rev },\n 'failed to update account root',\n )\n })\n }\n\n return {\n encoding: 'application/json' as const,\n body: {\n commit: commit\n ? {\n cid: commit.cid.toString(),\n rev: commit.rev,\n }\n : undefined,\n },\n }\n },\n })\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Server } from '@atproto/xrpc-server';
|
|
2
|
-
import { AppContext } from '../../../../context.js';
|
|
1
|
+
import { type Server } from '@atproto/xrpc-server';
|
|
2
|
+
import type { AppContext } from '../../../../context.js';
|
|
3
3
|
export default function (server: Server, ctx: AppContext): void;
|
|
4
4
|
//# sourceMappingURL=describeRepo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describeRepo.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/describeRepo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,MAAM,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"describeRepo.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/describeRepo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAmCvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describeRepo.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/describeRepo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"describeRepo.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/describeRepo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACvC,OAAO,EAAqB,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAe,MAAM,sBAAsB,CAAA;AAEvE,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAExD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CACR,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,EAC7B,KAAK,EAAE,EAAE,MAAM,EAAE,EAAkD,EAAE;QACnE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAA;QAEvB,MAAM,OAAO,GAAG,MAAM,sBAAsB,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;QAE9D,IAAI,MAAsB,CAAA;QAC1B,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QAC9D,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,IAAI,mBAAmB,CAAC,0BAA0B,GAAG,EAAE,CAAC,CAAA;QAChE,CAAC;QAED,MAAM,MAAM,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;QACnC,MAAM,eAAe,GAAG,MAAM,KAAK,OAAO,CAAC,MAAM,CAAA;QAEjD,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CACnE,KAAK,CAAC,MAAM,CAAC,eAAe,EAAE,CAC/B,CAAA;QAED,OAAO;YACL,QAAQ,EAAE,kBAA2B;YACrC,IAAI,EAAE;gBACJ,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,IAAI,cAAc,CAAiB;gBAC1D,GAAG,EAAE,OAAO,CAAC,GAAG;gBAChB,uEAAuE;gBACvE,MAAM;gBACN,WAAW;gBACX,eAAe;aAChB;SACF,CAAA;IACH,CAAC,CACF,CAAA;AACH,CAAC","sourcesContent":["import * as id from '@atproto/identity'\nimport { type HandleString, INVALID_HANDLE } from '@atproto/syntax'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { assertRepoAvailability } from '../sync/util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(\n com.atproto.repo.describeRepo,\n async ({ params }): Promise<com.atproto.repo.describeRepo.$Output> => {\n const { repo } = params\n\n const account = await assertRepoAvailability(ctx, repo, false)\n\n let didDoc: id.DidDocument\n try {\n didDoc = await ctx.idResolver.did.ensureResolve(account.did)\n } catch (err) {\n throw new InvalidRequestError(`Could not resolve DID: ${err}`)\n }\n\n const handle = id.getHandle(didDoc)\n const handleIsCorrect = handle === account.handle\n\n const collections = await ctx.actorStore.read(account.did, (store) =>\n store.record.listCollections(),\n )\n\n return {\n encoding: 'application/json' as const,\n body: {\n handle: (account.handle ?? INVALID_HANDLE) as HandleString,\n did: account.did,\n // @ts-expect-error https://github.com/bluesky-social/atproto/pull/4406\n didDoc,\n collections,\n handleIsCorrect,\n },\n }\n },\n )\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Server } from '@atproto/xrpc-server';
|
|
2
|
-
import { AppContext } from '../../../../context.js';
|
|
1
|
+
import { type Server } from '@atproto/xrpc-server';
|
|
2
|
+
import type { AppContext } from '../../../../context.js';
|
|
3
3
|
export default function (server: Server, ctx: AppContext): void;
|
|
4
4
|
//# sourceMappingURL=getRecord.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRecord.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/getRecord.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,MAAM,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"getRecord.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/getRecord.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAiCvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRecord.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/getRecord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACpC,OAAO,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"getRecord.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/getRecord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACpC,OAAO,EAAE,mBAAmB,EAAe,MAAM,sBAAsB,CAAA;AAEvE,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE;QAC/D,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,CAAA;QAC9C,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;QAEzD,8DAA8D;QAC9D,IAAI,GAAG,EAAE,CAAC;YACR,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,CAAC,CAAA;YACxC,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CACtD,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,CACzC,CAAA;YACD,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC;gBAC3C,MAAM,IAAI,mBAAmB,CAC3B,4BAA4B,GAAG,EAAE,EACjC,gBAAgB,CACjB,CAAA;YACH,CAAC;YACD,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI,EAAE;oBACJ,GAAG;oBACH,GAAG,EAAE,MAAM,CAAC,GAAG;oBACf,KAAK,EAAE,MAAM,CAAC,KAAK;iBACpB;aACF,CAAA;QACH,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;YACzB,MAAM,IAAI,mBAAmB,CAAC,yBAAyB,CAAC,CAAA;QAC1D,CAAC;QAED,OAAO,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IAC9B,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { atUri } from '@atproto/lex'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { pipethrough } from '../../../../pipethrough.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.getRecord, async ({ req, params }) => {\n const { repo, collection, rkey, cid } = params\n const did = await ctx.accountManager.getDidForActor(repo)\n\n // fetch from pds if available, if not then fetch from appview\n if (did) {\n const uri = atUri(did, collection, rkey)\n const record = await ctx.actorStore.read(did, (store) =>\n store.record.getRecord(uri, cid ?? null),\n )\n if (!record || record.takedownRef !== null) {\n throw new InvalidRequestError(\n `Could not locate record: ${uri}`,\n 'RecordNotFound',\n )\n }\n return {\n encoding: 'application/json' as const,\n body: {\n uri,\n cid: record.cid,\n value: record.value,\n },\n }\n }\n\n if (!ctx.cfg.bskyAppView) {\n throw new InvalidRequestError(`Could not locate record`)\n }\n\n return pipethrough(ctx, req)\n })\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Server } from '@atproto/xrpc-server';
|
|
2
|
-
import { AppContext } from '../../../../context.js';
|
|
1
|
+
import { type Server } from '@atproto/xrpc-server';
|
|
2
|
+
import type { AppContext } from '../../../../context.js';
|
|
3
3
|
export default function (server: Server, ctx: AppContext): void;
|
|
4
4
|
//# sourceMappingURL=importRepo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importRepo.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/importRepo.ts"],"names":[],"mappings":"AAUA,OAAO,EAAuB,MAAM,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"importRepo.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/importRepo.ts"],"names":[],"mappings":"AAUA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAEvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAqFvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importRepo.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/importRepo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AACrC,OAAO,
|
|
1
|
+
{"version":3,"file":"importRepo.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/importRepo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AACrC,OAAO,EAAe,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,EACL,QAAQ,EACR,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,UAAU,GACX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAe,MAAM,sBAAsB,CAAA;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM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GAAG,MAAM,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;4BAC3D,YAAY,GAAG,MAAM,CAAC,MAAM,CAAA;wBAC9B,CAAC;wBAAC,MAAM,CAAC;4BACP,MAAM,IAAI,mBAAmB,CAC3B,8BAA8B,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,IAAI,GAAG,CAChE,CAAA;wBACH,CAAC;wBAED,MAAM,KAAK,CAAC,MAAM,CAAC,WAAW,CAC5B,GAAG,EACH,KAAK,CAAC,GAAG,EACT,YAAY,EACZ,KAAK,CAAC,MAAM,EACZ,GAAG,EACH,GAAG,CACJ,CAAA;wBACD,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAC5B,YAAY,CAAC,YAAY,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CACjE,CAAA;wBACD,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,WAAW,CAAC,CAAA;oBAChE,CAAC;gBACH,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { TID } from '@atproto/common'\nimport { type LexMap, enumBlobRefs } from '@atproto/lex-data'\nimport {\n BlockMap,\n WriteOpAction,\n getAndParseRecord,\n readCarStream,\n verifyDiff,\n} from '@atproto/repo'\nimport { AtUri } from '@atproto/syntax'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport { ACCESS_FULL } from '../../../../auth-scope.js'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.importRepo, {\n opts: {\n blobLimit: ctx.cfg.service.maxImportSize,\n },\n auth: ctx.authVerifier.authorization({\n checkTakedown: true,\n scopes: ACCESS_FULL,\n authorize: (permissions) => {\n permissions.assertAccount({ attr: 'repo', action: 'manage' })\n },\n }),\n handler: async ({ input, auth }) => {\n if (!ctx.cfg.service.acceptingImports) {\n throw new InvalidRequestError('Service is not accepting repo imports')\n }\n\n const { did } = auth.credentials\n\n // @NOTE process as much as we can before the transaction, in particular\n // the reading of the body stream.\n const { roots, blocks } = await readCarStream(input.body)\n if (roots.length !== 1) {\n await blocks.dump()\n throw new InvalidRequestError('expected one root')\n }\n\n const blockMap = new BlockMap()\n for await (const block of blocks) {\n blockMap.set(block.cid, block.bytes)\n }\n\n await ctx.actorStore.transact(did, async (store) => {\n const now = new Date().toISOString()\n const rev = TID.nextStr()\n const did = store.repo.did\n\n const currRepo = await store.repo.maybeLoadRepo()\n const diff = await verifyDiff(\n currRepo,\n blockMap,\n roots[0],\n undefined,\n undefined,\n { ensureLeaves: false },\n )\n diff.commit.rev = rev\n await store.repo.storage.applyCommit(diff.commit, currRepo === null)\n\n // @NOTE There is no point in performing the following concurrently\n // since better-sqlite3 is synchronous.\n for (const write of diff.writes) {\n const uri = AtUri.make(did, write.collection, write.rkey)\n if (write.action === WriteOpAction.Delete) {\n await store.record.deleteRecord(uri)\n } else {\n let parsedRecord: LexMap\n try {\n // @NOTE getAndParseRecord returns a promise for historical\n // reasons but it's internal processing is actually synchronous.\n const parsed = await getAndParseRecord(blockMap, write.cid)\n parsedRecord = parsed.record\n } catch {\n throw new InvalidRequestError(\n `Could not parse record at '${write.collection}/${write.rkey}'`,\n )\n }\n\n await store.record.indexRecord(\n uri,\n write.cid,\n parsedRecord,\n write.action,\n rev,\n now,\n )\n const recordBlobs = Array.from(\n enumBlobRefs(parsedRecord, { allowLegacy: true, strict: false }),\n )\n await store.repo.blob.insertBlobs(uri.toString(), recordBlobs)\n }\n }\n })\n },\n })\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Server } from '@atproto/xrpc-server';
|
|
2
|
-
import { AppContext } from '../../../../context.js';
|
|
1
|
+
import type { Server } from '@atproto/xrpc-server';
|
|
2
|
+
import type { AppContext } from '../../../../context.js';
|
|
3
3
|
export default function (server: Server, ctx: AppContext): void;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAYxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAWvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/index.ts"],"names":[],"mappings":"AAEA,OAAO,WAAW,MAAM,kBAAkB,CAAA;AAC1C,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAC5C,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAC5C,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAC5C,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,UAAU,MAAM,iBAAiB,CAAA;AACxC,OAAO,gBAAgB,MAAM,uBAAuB,CAAA;AACpD,OAAO,WAAW,MAAM,kBAAkB,CAAA;AAC1C,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,UAAU,MAAM,iBAAiB,CAAA;AAExC,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvB,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AACzB,CAAC","sourcesContent":["import { Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport applyWrites from './applyWrites.js'\nimport createRecord from './createRecord.js'\nimport deleteRecord from './deleteRecord.js'\nimport describeRepo from './describeRepo.js'\nimport getRecord from './getRecord.js'\nimport importRepo from './importRepo.js'\nimport listMissingBlobs from './listMissingBlobs.js'\nimport listRecords from './listRecords.js'\nimport putRecord from './putRecord.js'\nimport uploadBlob from './uploadBlob.js'\n\nexport default function (server: Server, ctx: AppContext) {\n applyWrites(server, ctx)\n createRecord(server, ctx)\n deleteRecord(server, ctx)\n describeRepo(server, ctx)\n getRecord(server, ctx)\n listRecords(server, ctx)\n putRecord(server, ctx)\n uploadBlob(server, ctx)\n listMissingBlobs(server, ctx)\n importRepo(server, ctx)\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/index.ts"],"names":[],"mappings":"AAEA,OAAO,WAAW,MAAM,kBAAkB,CAAA;AAC1C,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAC5C,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAC5C,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAC5C,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,UAAU,MAAM,iBAAiB,CAAA;AACxC,OAAO,gBAAgB,MAAM,uBAAuB,CAAA;AACpD,OAAO,WAAW,MAAM,kBAAkB,CAAA;AAC1C,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,UAAU,MAAM,iBAAiB,CAAA;AAExC,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACzB,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACxB,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACtB,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvB,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AACzB,CAAC","sourcesContent":["import type { Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport applyWrites from './applyWrites.js'\nimport createRecord from './createRecord.js'\nimport deleteRecord from './deleteRecord.js'\nimport describeRepo from './describeRepo.js'\nimport getRecord from './getRecord.js'\nimport importRepo from './importRepo.js'\nimport listMissingBlobs from './listMissingBlobs.js'\nimport listRecords from './listRecords.js'\nimport putRecord from './putRecord.js'\nimport uploadBlob from './uploadBlob.js'\n\nexport default function (server: Server, ctx: AppContext) {\n applyWrites(server, ctx)\n createRecord(server, ctx)\n deleteRecord(server, ctx)\n describeRepo(server, ctx)\n getRecord(server, ctx)\n listRecords(server, ctx)\n putRecord(server, ctx)\n uploadBlob(server, ctx)\n listMissingBlobs(server, ctx)\n importRepo(server, ctx)\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Server } from '@atproto/xrpc-server';
|
|
2
|
-
import { AppContext } from '../../../../context.js';
|
|
1
|
+
import type { Server } from '@atproto/xrpc-server';
|
|
2
|
+
import type { AppContext } from '../../../../context.js';
|
|
3
3
|
export default function (server: Server, ctx: AppContext): void;
|
|
4
4
|
//# sourceMappingURL=listMissingBlobs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listMissingBlobs.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/listMissingBlobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"listMissingBlobs.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/listMissingBlobs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAwBvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listMissingBlobs.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/listMissingBlobs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;QAC5C,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;YACnC,SAAS,EAAE,GAAG,EAAE;gBACd,eAAe;YACjB,CAAC;SACF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;YAClC,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,WAAW,CAAA;YAChC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;YAEhC,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CACrD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CACpD,CAAA;YAED,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI,EAAE;oBACJ,KAAK;oBACL,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG;iBAC1B;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.listMissingBlobs, {\n auth: ctx.authVerifier.authorization({\n authorize: () => {\n // always allow\n },\n }),\n handler: async ({ auth, params }) => {\n const { did } = auth.credentials\n const { limit, cursor } = params\n\n const blobs = await ctx.actorStore.read(did, (store) =>\n store.repo.blob.listMissingBlobs({ limit, cursor }),\n )\n\n return {\n encoding: 'application/json' as const,\n body: {\n blobs,\n cursor: blobs.at(-1)?.cid,\n },\n }\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"listMissingBlobs.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/listMissingBlobs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;QAC5C,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;YACnC,SAAS,EAAE,GAAG,EAAE;gBACd,eAAe;YACjB,CAAC;SACF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;YAClC,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,WAAW,CAAA;YAChC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;YAEhC,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CACrD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CACpD,CAAA;YAED,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI,EAAE;oBACJ,KAAK;oBACL,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG;iBAC1B;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import type { Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.listMissingBlobs, {\n auth: ctx.authVerifier.authorization({\n authorize: () => {\n // always allow\n },\n }),\n handler: async ({ auth, params }) => {\n const { did } = auth.credentials\n const { limit, cursor } = params\n\n const blobs = await ctx.actorStore.read(did, (store) =>\n store.repo.blob.listMissingBlobs({ limit, cursor }),\n )\n\n return {\n encoding: 'application/json' as const,\n body: {\n blobs,\n cursor: blobs.at(-1)?.cid,\n },\n }\n },\n })\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Server } from '@atproto/xrpc-server';
|
|
2
|
-
import { AppContext } from '../../../../context.js';
|
|
1
|
+
import { type Server } from '@atproto/xrpc-server';
|
|
2
|
+
import type { AppContext } from '../../../../context.js';
|
|
3
3
|
export default function (server: Server, ctx: AppContext): void;
|
|
4
4
|
//# sourceMappingURL=listRecords.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listRecords.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/listRecords.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,MAAM,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"listRecords.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/listRecords.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA8BvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listRecords.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/listRecords.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"listRecords.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/listRecords.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAe,MAAM,sBAAsB,CAAA;AAEvE,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QAC5D,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,GAAG,EAAE,EAAE,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,MAAM,CAAA;QAExE,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;QACzD,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,MAAM,IAAI,mBAAmB,CAAC,wBAAwB,IAAI,EAAE,CAAC,CAAA;QAC/D,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CACvD,KAAK,CAAC,MAAM,CAAC,wBAAwB,CAAC;YACpC,UAAU;YACV,KAAK;YACL,OAAO;YACP,MAAM;SACP,CAAC,CACH,CAAA;QAED,MAAM,UAAU,GAAG,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;QACjC,MAAM,OAAO,GAAG,UAAU,IAAI,IAAI,KAAK,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;QAExD,OAAO;YACL,QAAQ,EAAE,kBAA2B;YACrC,IAAI,EAAE;gBACJ,OAAO;gBACP,iFAAiF;gBACjF,MAAM,EAAE,OAAO,EAAE,IAAI;aACtB;SACF,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { AtUri } from '@atproto/syntax'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.repo.listRecords, async ({ params }) => {\n const { repo, collection, limit = 50, cursor, reverse = false } = params\n\n const did = await ctx.accountManager.getDidForActor(repo)\n if (!did) {\n throw new InvalidRequestError(`Could not find repo: ${repo}`)\n }\n\n const records = await ctx.actorStore.read(did, (store) =>\n store.record.listRecordsForCollection({\n collection,\n limit,\n reverse,\n cursor,\n }),\n )\n\n const lastRecord = records.at(-1)\n const lastUri = lastRecord && new AtUri(lastRecord?.uri)\n\n return {\n encoding: 'application/json' as const,\n body: {\n records,\n // Paginate with `before` by default, paginate with `after` when using `reverse`.\n cursor: lastUri?.rkey,\n },\n }\n })\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Server } from '@atproto/xrpc-server';
|
|
2
|
-
import { AppContext } from '../../../../context.js';
|
|
1
|
+
import { type Server } from '@atproto/xrpc-server';
|
|
2
|
+
import type { AppContext } from '../../../../context.js';
|
|
3
3
|
export default function (server: Server, ctx: AppContext): void;
|
|
4
4
|
//# sourceMappingURL=putRecord.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"putRecord.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/putRecord.ts"],"names":[],"mappings":"AAQA,OAAO,EAGL,MAAM,
|
|
1
|
+
{"version":3,"file":"putRecord.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/repo/putRecord.ts"],"names":[],"mappings":"AAQA,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAaxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA4JvD"}
|