@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,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=describeServer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describeServer.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/describeServer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"describeServer.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/describeServer.ts"],"names":[],"mappings":"AAEA,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,QAsBvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describeServer.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/describeServer.ts"],"names":[],"mappings":"AAIA,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,MAAM,CAAC,cAAc,EAAE,GAAG,EAAE;QACjD,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,GAAgB,CAAA;QAC5C,MAAM,oBAAoB,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,oBAAoB,CAAA;QAClE,MAAM,kBAAkB,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAA;QACnD,MAAM,aAAa,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,gBAA6B,CAAA;QACnE,MAAM,cAAc,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,iBAA8B,CAAA;QACrE,MAAM,mBAAmB,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,mBAAmB,CAAA;QAE/D,OAAO;YACL,QAAQ,EAAE,kBAA2B;YACrC,IAAI,EAAE;gBACJ,GAAG;gBACH,oBAAoB;gBACpB,kBAAkB;gBAClB,KAAK,EAAE,EAAE,aAAa,EAAE,cAAc,EAAE;gBACxC,OAAO,EAAE;oBACP,KAAK,EAAE,mBAAmB;iBAC3B;aACF;SACF,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { UriString } from '@atproto/lex'\nimport { DidString } from '@atproto/syntax'\nimport { 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.server.describeServer, () => {\n const did = ctx.cfg.service.did as DidString\n const availableUserDomains = ctx.cfg.identity.serviceHandleDomains\n const inviteCodeRequired = ctx.cfg.invites.required\n const privacyPolicy = ctx.cfg.service.privacyPolicyUrl as UriString\n const termsOfService = ctx.cfg.service.termsOfServiceUrl as UriString\n const contactEmailAddress = ctx.cfg.service.contactEmailAddress\n\n return {\n encoding: 'application/json' as const,\n body: {\n did,\n availableUserDomains,\n inviteCodeRequired,\n links: { privacyPolicy, termsOfService },\n contact: {\n email: contactEmailAddress,\n },\n },\n }\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"describeServer.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/describeServer.ts"],"names":[],"mappings":"AAIA,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,MAAM,CAAC,cAAc,EAAE,GAAG,EAAE;QACjD,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,GAAgB,CAAA;QAC5C,MAAM,oBAAoB,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,oBAAoB,CAAA;QAClE,MAAM,kBAAkB,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAA;QACnD,MAAM,aAAa,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,gBAA6B,CAAA;QACnE,MAAM,cAAc,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,iBAA8B,CAAA;QACrE,MAAM,mBAAmB,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,mBAAmB,CAAA;QAE/D,OAAO;YACL,QAAQ,EAAE,kBAA2B;YACrC,IAAI,EAAE;gBACJ,GAAG;gBACH,oBAAoB;gBACpB,kBAAkB;gBAClB,KAAK,EAAE,EAAE,aAAa,EAAE,cAAc,EAAE;gBACxC,OAAO,EAAE;oBACP,KAAK,EAAE,mBAAmB;iBAC3B;aACF;SACF,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import type { UriString } from '@atproto/lex'\nimport type { DidString } from '@atproto/syntax'\nimport 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.server.describeServer, () => {\n const did = ctx.cfg.service.did as DidString\n const availableUserDomains = ctx.cfg.identity.serviceHandleDomains\n const inviteCodeRequired = ctx.cfg.invites.required\n const privacyPolicy = ctx.cfg.service.privacyPolicyUrl as UriString\n const termsOfService = ctx.cfg.service.termsOfServiceUrl as UriString\n const contactEmailAddress = ctx.cfg.service.contactEmailAddress\n\n return {\n encoding: 'application/json' as const,\n body: {\n did,\n availableUserDomains,\n inviteCodeRequired,\n links: { privacyPolicy, termsOfService },\n contact: {\n email: contactEmailAddress,\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=getAccountInviteCodes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAccountInviteCodes.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/getAccountInviteCodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,MAAM,
|
|
1
|
+
{"version":3,"file":"getAccountInviteCodes.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/getAccountInviteCodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,sBAAsB,CAAA;AAG7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA0EvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAccountInviteCodes.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/getAccountInviteCodes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,GAE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I,CAAC,KAAK,CACvC,oBAAoB,GAAG,IAAI,CAAC,QAAQ,CACrC,CAAA;QACD,WAAW,GAAG,gBAAgB,GAAG,sBAAsB,CAAA;IACzD,CAAC;IACD,wEAAwE;IACxE,MAAM,UAAU,GAAG,YAAY,CAAC,MAAM,CACpC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAC1D,CAAA;IACD,iHAAiH;IACjH,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CACvB,CAAC,GAAG,kBAAkB,CAAC,MAAM,EAC7B,WAAW,GAAG,UAAU,CAAC,MAAM,CAChC,CAAA;IACD,OAAO;QACL,QAAQ;QACR,KAAK,EAAE,YAAY,CAAC,MAAM,GAAG,QAAQ;KACtC,CAAA;AACH,CAAC,CAAA","sourcesContent":["import {\n ForbiddenError,\n InvalidRequestError,\n Server,\n} from '@atproto/xrpc-server'\nimport { CodeDetail } from '../../../../account-manager/helpers/invite.js'\nimport { ACCESS_FULL } from '../../../../auth-scope.js'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { genInvCodes } from './util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.server.getAccountInviteCodes, {\n auth: ctx.authVerifier.authorization({\n checkTakedown: true,\n scopes: ACCESS_FULL,\n authorize: () => {\n throw new ForbiddenError(\n 'OAuth credentials are not supported for this endpoint',\n )\n },\n }),\n handler: async ({ params, auth, req }) => {\n if (ctx.entrywayClient) {\n const { headers } = await ctx.entrywayAuthHeaders(\n req,\n auth.credentials.did,\n com.atproto.server.getAccountInviteCodes.$lxm,\n )\n return ctx.entrywayClient.xrpc(\n com.atproto.server.getAccountInviteCodes,\n { params, headers },\n )\n }\n\n const requester = auth.credentials.did\n const { includeUsed, createAvailable } = params\n\n const [account, userCodes] = await Promise.all([\n ctx.accountManager.getAccount(requester),\n ctx.accountManager.getAccountInvitesCodes(requester),\n ])\n if (!account) {\n throw new InvalidRequestError('Account not found', 'NotFound')\n }\n\n let created: CodeDetail[] = []\n\n if (\n createAvailable &&\n ctx.cfg.invites.required &&\n ctx.cfg.invites.interval !== null\n ) {\n const { toCreate, total } = calculateCodesToCreate({\n did: requester,\n userCreatedAt: new Date(account.createdAt).getTime(),\n codes: userCodes,\n epoch: ctx.cfg.invites.epoch,\n interval: ctx.cfg.invites.interval,\n })\n if (toCreate > 0) {\n const codes = genInvCodes(ctx.cfg, toCreate)\n created = await ctx.accountManager.createAccountInviteCodes(\n requester,\n codes,\n total,\n account.invitesDisabled ?? 0,\n )\n }\n }\n\n const allCodes = [...userCodes, ...created]\n\n const filtered = allCodes.filter((code) => {\n if (code.disabled) return false\n if (!includeUsed && code.uses.length >= code.available) return false\n return true\n })\n\n return {\n encoding: 'application/json' as const,\n body: { codes: filtered },\n }\n },\n })\n}\n\n/**\n * WARNING: TRICKY SUBTLE MATH - DONT MESS WITH THIS FUNCTION UNLESS YOUR'RE VERY CONFIDENT\n * if the user wishes to create available codes & the server allows that,\n * we determine the number to create by dividing their account lifetime by the interval at which they can create codes\n * if an invite epoch is provided, we only calculate available invites since that epoch\n * we allow a max of 5 open codes at a given time\n * note: even if a user is disabled from future invites, we still create the invites for bookkeeping, we just immediately disable them as well\n */\nconst calculateCodesToCreate = (opts: {\n did: string\n userCreatedAt: number\n codes: CodeDetail[]\n epoch: number\n interval: number\n}): { toCreate: number; total: number } => {\n // for the sake of generating routine interval codes, we do not count explicitly gifted admin codes\n const routineCodes = opts.codes.filter((code) => code.createdBy !== 'admin')\n const unusedRoutineCodes = routineCodes.filter(\n (row) => !row.disabled && row.available > row.uses.length,\n )\n\n const userLifespan = Date.now() - opts.userCreatedAt\n\n // how many codes a user could create within the current epoch if they have 0\n let couldCreate: number\n\n if (opts.userCreatedAt >= opts.epoch) {\n // if the user was created after the epoch, then they can create a code for each interval since the epoch\n couldCreate = Math.floor(userLifespan / opts.interval)\n } else {\n // if the user was created before the epoch, we:\n // - calculate the total intervals since account creation\n // - calculate the total intervals before the epoch\n // - subtract the two\n const couldCreateTotal = Math.floor(userLifespan / opts.interval)\n const userPreEpochLifespan = opts.epoch - opts.userCreatedAt\n const couldCreateBeforeEpoch = Math.floor(\n userPreEpochLifespan / opts.interval,\n )\n couldCreate = couldCreateTotal - couldCreateBeforeEpoch\n }\n // we count the codes that the user has created within the current epoch\n const epochCodes = routineCodes.filter(\n (code) => new Date(code.createdAt).getTime() > opts.epoch,\n )\n // finally we the number of codes they currently have from the number that they could create, and take a max of 5\n const toCreate = Math.min(\n 5 - unusedRoutineCodes.length,\n couldCreate - epochCodes.length,\n )\n return {\n toCreate,\n total: routineCodes.length + toCreate,\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"getAccountInviteCodes.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/getAccountInviteCodes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,GAEpB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAEvD,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE;QACnD,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;YACnC,aAAa,EAAE,IAAI;YACnB,MAAM,EAAE,WAAW;YACnB,SAAS,EAAE,GAAG,EAAE;gBACd,MAAM,IAAI,cAAc,CACtB,uDAAuD,CACxD,CAAA;YACH,CAAC;SACF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE;YACvC,IAAI,GAAG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proto/xrpc-server'\nimport type { CodeDetail } from '../../../../account-manager/helpers/invite.js'\nimport { ACCESS_FULL } from '../../../../auth-scope.js'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { genInvCodes } from './util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.server.getAccountInviteCodes, {\n auth: ctx.authVerifier.authorization({\n checkTakedown: true,\n scopes: ACCESS_FULL,\n authorize: () => {\n throw new ForbiddenError(\n 'OAuth credentials are not supported for this endpoint',\n )\n },\n }),\n handler: async ({ params, auth, req }) => {\n if (ctx.entrywayClient) {\n const { headers } = await ctx.entrywayAuthHeaders(\n req,\n auth.credentials.did,\n com.atproto.server.getAccountInviteCodes.$lxm,\n )\n return ctx.entrywayClient.xrpc(\n com.atproto.server.getAccountInviteCodes,\n { params, headers },\n )\n }\n\n const requester = auth.credentials.did\n const { includeUsed, createAvailable } = params\n\n const [account, userCodes] = await Promise.all([\n ctx.accountManager.getAccount(requester),\n ctx.accountManager.getAccountInvitesCodes(requester),\n ])\n if (!account) {\n throw new InvalidRequestError('Account not found', 'NotFound')\n }\n\n let created: CodeDetail[] = []\n\n if (\n createAvailable &&\n ctx.cfg.invites.required &&\n ctx.cfg.invites.interval !== null\n ) {\n const { toCreate, total } = calculateCodesToCreate({\n did: requester,\n userCreatedAt: new Date(account.createdAt).getTime(),\n codes: userCodes,\n epoch: ctx.cfg.invites.epoch,\n interval: ctx.cfg.invites.interval,\n })\n if (toCreate > 0) {\n const codes = genInvCodes(ctx.cfg, toCreate)\n created = await ctx.accountManager.createAccountInviteCodes(\n requester,\n codes,\n total,\n account.invitesDisabled ?? 0,\n )\n }\n }\n\n const allCodes = [...userCodes, ...created]\n\n const filtered = allCodes.filter((code) => {\n if (code.disabled) return false\n if (!includeUsed && code.uses.length >= code.available) return false\n return true\n })\n\n return {\n encoding: 'application/json' as const,\n body: { codes: filtered },\n }\n },\n })\n}\n\n/**\n * WARNING: TRICKY SUBTLE MATH - DONT MESS WITH THIS FUNCTION UNLESS YOUR'RE VERY CONFIDENT\n * if the user wishes to create available codes & the server allows that,\n * we determine the number to create by dividing their account lifetime by the interval at which they can create codes\n * if an invite epoch is provided, we only calculate available invites since that epoch\n * we allow a max of 5 open codes at a given time\n * note: even if a user is disabled from future invites, we still create the invites for bookkeeping, we just immediately disable them as well\n */\nconst calculateCodesToCreate = (opts: {\n did: string\n userCreatedAt: number\n codes: CodeDetail[]\n epoch: number\n interval: number\n}): { toCreate: number; total: number } => {\n // for the sake of generating routine interval codes, we do not count explicitly gifted admin codes\n const routineCodes = opts.codes.filter((code) => code.createdBy !== 'admin')\n const unusedRoutineCodes = routineCodes.filter(\n (row) => !row.disabled && row.available > row.uses.length,\n )\n\n const userLifespan = Date.now() - opts.userCreatedAt\n\n // how many codes a user could create within the current epoch if they have 0\n let couldCreate: number\n\n if (opts.userCreatedAt >= opts.epoch) {\n // if the user was created after the epoch, then they can create a code for each interval since the epoch\n couldCreate = Math.floor(userLifespan / opts.interval)\n } else {\n // if the user was created before the epoch, we:\n // - calculate the total intervals since account creation\n // - calculate the total intervals before the epoch\n // - subtract the two\n const couldCreateTotal = Math.floor(userLifespan / opts.interval)\n const userPreEpochLifespan = opts.epoch - opts.userCreatedAt\n const couldCreateBeforeEpoch = Math.floor(\n userPreEpochLifespan / opts.interval,\n )\n couldCreate = couldCreateTotal - couldCreateBeforeEpoch\n }\n // we count the codes that the user has created within the current epoch\n const epochCodes = routineCodes.filter(\n (code) => new Date(code.createdAt).getTime() > opts.epoch,\n )\n // finally we the number of codes they currently have from the number that they could create, and take a max of 5\n const toCreate = Math.min(\n 5 - unusedRoutineCodes.length,\n couldCreate - epochCodes.length,\n )\n return {\n toCreate,\n total: routineCodes.length + toCreate,\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=getServiceAuth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getServiceAuth.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/getServiceAuth.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,MAAM,
|
|
1
|
+
{"version":3,"file":"getServiceAuth.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/getServiceAuth.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,MAAM,EAEZ,MAAM,sBAAsB,CAAA;AAM7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAOxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA0FvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getServiceAuth.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/getServiceAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEpE,OAAO,EACL,mBAAmB,EAEnB,gBAAgB,GACjB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,WAAW,GACZ,MAAM,2BAA2B,CAAA;AAElC,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,4BAA4B,CAAA;AAEnC,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE;QAC5C,IAAI,EAAE,GAAG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ACD,MAAM,IAAI,mBAAmB,CAC3B,iFAAiF,GAAG,EAAE,CACvF,CAAA;gBACH,CAAC;YACH,CAAC;YAED,IAAI,GAAG,EAAE,CAAC;gBACR,MAAM,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBACpC,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC;oBACb,MAAM,IAAI,mBAAmB,CAC3B,uBAAuB,EACvB,eAAe,CAChB,CAAA;gBACH,CAAC;qBAAM,IAAI,IAAI,GAAG,IAAI,EAAE,CAAC;oBACvB,MAAM,IAAI,mBAAmB,CAC3B,2EAA2E,EAC3E,eAAe,CAChB,CAAA;gBACH,CAAC;qBAAM,IAAI,CAAC,GAAG,IAAI,IAAI,GAAG,MAAM,EAAE,CAAC;oBACjC,MAAM,IAAI,mBAAmB,CAC3B,wFAAwF,EACxF,eAAe,CAChB,CAAA;gBACH,CAAC;YACH,CAAC;YAED,IAAI,GAAG,IAAI,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBACtC,MAAM,IAAI,mBAAmB,CAC3B,2EAA2E,GAAG,EAAE,CACjF,CAAA;YACH,CAAC;YAED,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YAEjD,MAAM,KAAK,GAAG,MAAM,gBAAgB,CAAC;gBACnC,GAAG,EAAE,GAAG;gBACR,GAAG;gBACH,GAAG;gBACH,GAAG;gBACH,OAAO;aACR,CAAC,CAAA;YACF,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI,EAAE;oBACJ,KAAK;iBACN;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { HOUR, MINUTE } from '@atproto/common'\nimport { isAtprotoDid, isAtprotoDidRefAbsolute } from '@atproto/did'\nimport { l } from '@atproto/lex'\nimport {\n InvalidRequestError,\n Server,\n createServiceJwt,\n} from '@atproto/xrpc-server'\nimport {\n AuthScope,\n isAccessPrivileged,\n isTakendown,\n} from '../../../../auth-scope.js'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport {\n PRIVILEGED_METHODS,\n PROTECTED_METHODS,\n} from '../../../../pipethrough.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.server.getServiceAuth, {\n auth: ctx.authVerifier.authorization<\n l.InferMethodParams<typeof com.atproto.server.getServiceAuth.main>\n >({\n additional: [AuthScope.Takendown],\n authorize: (permissions, { params }) => {\n const { aud, lxm = '*' } = params\n permissions.assertRpc({ aud, lxm })\n },\n }),\n handler: async ({ params, auth }) => {\n const did = auth.credentials.did\n\n // @NOTE \"exp\" is expressed in seconds since epoch, not milliseconds\n const { aud, exp, lxm = null } = params\n\n if (!isAtprotoDid(aud) && !isAtprotoDidRefAbsolute(aud)) {\n throw new InvalidRequestError(\n 'aud must be a valid atproto DID or did#serviceId reference',\n )\n }\n\n // Takendown accounts should not be able to generate service auth tokens except for methods necessary for account migration\n if (auth.credentials.type === 'access') {\n // @NOTE We should probably use \"ForbiddenError\" here. Using\n // \"InvalidRequestError\" for legacy reasons.\n if (\n isTakendown(auth.credentials.scope) &&\n lxm !== com.atproto.server.createAccount.$lxm\n ) {\n throw new InvalidRequestError('Bad token scope', 'InvalidToken')\n }\n\n // @NOTE \"oauth\" based credentials already checked through permission\n // set in \"authorize\" method above.\n if (\n lxm != null &&\n PRIVILEGED_METHODS.has(lxm) &&\n !isAccessPrivileged(auth.credentials.scope)\n ) {\n throw new InvalidRequestError(\n `insufficient access to request a service auth token for the following method: ${lxm}`,\n )\n }\n }\n\n if (exp) {\n const diff = exp * 1000 - Date.now()\n if (diff < 0) {\n throw new InvalidRequestError(\n 'expiration is in past',\n 'BadExpiration',\n )\n } else if (diff > HOUR) {\n throw new InvalidRequestError(\n 'cannot request a token with an expiration more than an hour in the future',\n 'BadExpiration',\n )\n } else if (!lxm && diff > MINUTE) {\n throw new InvalidRequestError(\n 'cannot request a method-less token with an expiration more than a minute in the future',\n 'BadExpiration',\n )\n }\n }\n\n if (lxm && PROTECTED_METHODS.has(lxm)) {\n throw new InvalidRequestError(\n `cannot request a service auth token for the following protected method: ${lxm}`,\n )\n }\n\n const keypair = await ctx.actorStore.keypair(did)\n\n const token = await createServiceJwt({\n iss: did,\n aud,\n exp,\n lxm,\n keypair,\n })\n return {\n encoding: 'application/json' as const,\n body: {\n token,\n },\n }\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"getServiceAuth.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/getServiceAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAA;AAEpE,OAAO,EACL,mBAAmB,EAEnB,gBAAgB,GACjB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,WAAW,GACZ,MAAM,2BAA2B,CAAA;AAElC,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,4BAA4B,CAAA;AAEnC,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE;QAC5C,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,aAAa,CAElC;YACA,UAAU,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC;YACjC,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;gBACrC,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,GAAG,EAAE,GAAG,MAAM,CAAA;gBACjC,WAAW,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,GAAG,EAA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B,EACvB,eAAe,CAChB,CAAA;gBACH,CAAC;qBAAM,IAAI,IAAI,GAAG,IAAI,EAAE,CAAC;oBACvB,MAAM,IAAI,mBAAmB,CAC3B,2EAA2E,EAC3E,eAAe,CAChB,CAAA;gBACH,CAAC;qBAAM,IAAI,CAAC,GAAG,IAAI,IAAI,GAAG,MAAM,EAAE,CAAC;oBACjC,MAAM,IAAI,mBAAmB,CAC3B,wFAAwF,EACxF,eAAe,CAChB,CAAA;gBACH,CAAC;YACH,CAAC;YAED,IAAI,GAAG,IAAI,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBACtC,MAAM,IAAI,mBAAmB,CAC3B,2EAA2E,GAAG,EAAE,CACjF,CAAA;YACH,CAAC;YAED,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YAEjD,MAAM,KAAK,GAAG,MAAM,gBAAgB,CAAC;gBACnC,GAAG,EAAE,GAAG;gBACR,GAAG;gBACH,GAAG;gBACH,GAAG;gBACH,OAAO;aACR,CAAC,CAAA;YACF,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI,EAAE;oBACJ,KAAK;iBACN;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { HOUR, MINUTE } from '@atproto/common'\nimport { isAtprotoDid, isAtprotoDidRefAbsolute } from '@atproto/did'\nimport type { l } from '@atproto/lex'\nimport {\n InvalidRequestError,\n type Server,\n createServiceJwt,\n} from '@atproto/xrpc-server'\nimport {\n AuthScope,\n isAccessPrivileged,\n isTakendown,\n} from '../../../../auth-scope.js'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport {\n PRIVILEGED_METHODS,\n PROTECTED_METHODS,\n} from '../../../../pipethrough.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.server.getServiceAuth, {\n auth: ctx.authVerifier.authorization<\n l.InferMethodParams<typeof com.atproto.server.getServiceAuth.main>\n >({\n additional: [AuthScope.Takendown],\n authorize: (permissions, { params }) => {\n const { aud, lxm = '*' } = params\n permissions.assertRpc({ aud, lxm })\n },\n }),\n handler: async ({ params, auth }) => {\n const did = auth.credentials.did\n\n // @NOTE \"exp\" is expressed in seconds since epoch, not milliseconds\n const { aud, exp, lxm = null } = params\n\n if (!isAtprotoDid(aud) && !isAtprotoDidRefAbsolute(aud)) {\n throw new InvalidRequestError(\n 'aud must be a valid atproto DID or did#serviceId reference',\n )\n }\n\n // Takendown accounts should not be able to generate service auth tokens except for methods necessary for account migration\n if (auth.credentials.type === 'access') {\n // @NOTE We should probably use \"ForbiddenError\" here. Using\n // \"InvalidRequestError\" for legacy reasons.\n if (\n isTakendown(auth.credentials.scope) &&\n lxm !== com.atproto.server.createAccount.$lxm\n ) {\n throw new InvalidRequestError('Bad token scope', 'InvalidToken')\n }\n\n // @NOTE \"oauth\" based credentials already checked through permission\n // set in \"authorize\" method above.\n if (\n lxm != null &&\n PRIVILEGED_METHODS.has(lxm) &&\n !isAccessPrivileged(auth.credentials.scope)\n ) {\n throw new InvalidRequestError(\n `insufficient access to request a service auth token for the following method: ${lxm}`,\n )\n }\n }\n\n if (exp) {\n const diff = exp * 1000 - Date.now()\n if (diff < 0) {\n throw new InvalidRequestError(\n 'expiration is in past',\n 'BadExpiration',\n )\n } else if (diff > HOUR) {\n throw new InvalidRequestError(\n 'cannot request a token with an expiration more than an hour in the future',\n 'BadExpiration',\n )\n } else if (!lxm && diff > MINUTE) {\n throw new InvalidRequestError(\n 'cannot request a method-less token with an expiration more than a minute in the future',\n 'BadExpiration',\n )\n }\n }\n\n if (lxm && PROTECTED_METHODS.has(lxm)) {\n throw new InvalidRequestError(\n `cannot request a service auth token for the following protected method: ${lxm}`,\n )\n }\n\n const keypair = await ctx.actorStore.keypair(did)\n\n const token = await createServiceJwt({\n iss: did,\n aud,\n exp,\n lxm,\n keypair,\n })\n return {\n encoding: 'application/json' as const,\n body: {\n token,\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=getSession.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSession.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/getSession.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getSession.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/getSession.ts"],"names":[],"mappings":"AAKA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAIvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAuDvD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { INVALID_HANDLE } from '@atproto/syntax';
|
|
1
|
+
import { INVALID_HANDLE, } from '@atproto/syntax';
|
|
2
2
|
import { InvalidRequestError } from '@atproto/xrpc-server';
|
|
3
3
|
import { formatAccountStatus } from '../../../../account-manager/account-manager.js';
|
|
4
4
|
import { AuthScope } from '../../../../auth-scope.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSession.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/getSession.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"getSession.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/getSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,GACf,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,mBAAmB,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AU,CAAC,GAAG,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;gBAChE,gBAAgB,CAAC,GAAG,EAAE,GAAG,CAAC;aAC3B,CAAC,CAAA;YACF,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,MAAM,IAAI,mBAAmB,CAC3B,yCAAyC,GAAG,EAAE,CAC/C,CAAA;YACH,CAAC;YAED,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAA;YAEpD,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE;oBACjB,GAAG,EAAE,IAAI,CAAC,GAAgB;oBAC1B,uEAAuE;oBACvE,MAAM;oBACN,MAAM,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,cAAc,CAAiB;oBACvD,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS;oBAC9B,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB;oBACvC,MAAM;oBACN,MAAM;iBACP,CAAC;aACH,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,MAAM,CACb,EAAE,WAAW,EAA8B,EAC3C,IAA+C;IAE/C,IACE,WAAW,CAAC,IAAI,KAAK,OAAO;QAC5B,CAAC,WAAW,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,EACzE,CAAC;QACD,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAA;QAChE,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import {\n type DidString,\n type HandleString,\n INVALID_HANDLE,\n} from '@atproto/syntax'\nimport { InvalidRequestError, type Server } from '@atproto/xrpc-server'\nimport { formatAccountStatus } from '../../../../account-manager/account-manager.js'\nimport type { AccessOutput, OAuthOutput } from '../../../../auth-output.js'\nimport { AuthScope } from '../../../../auth-scope.js'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { didDocForSession } from './util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.server.getSession, {\n auth: ctx.authVerifier.authorization({\n additional: [AuthScope.SignupQueued],\n authorize: () => {\n // Always allowed. \"email\" access is checked in the handler.\n },\n }),\n handler: async ({ auth, req }) => {\n if (ctx.entrywayClient) {\n const { headers } = await ctx.entrywayAuthHeaders(\n req,\n auth.credentials.did,\n 'com.atproto.server.getSession',\n )\n\n const { body } = await ctx.entrywayClient.xrpc(\n com.atproto.server.getSession,\n { headers },\n )\n\n return {\n encoding: 'application/json' as const,\n body: output(auth, body),\n }\n }\n\n const did = auth.credentials.did\n const [user, didDoc] = await Promise.all([\n ctx.accountManager.getAccount(did, { includeDeactivated: true }),\n didDocForSession(ctx, did),\n ])\n if (!user) {\n throw new InvalidRequestError(\n `Could not find user info for account: ${did}`,\n )\n }\n\n const { status, active } = formatAccountStatus(user)\n\n return {\n encoding: 'application/json' as const,\n body: output(auth, {\n did: user.did as DidString,\n // @ts-expect-error https://github.com/bluesky-social/atproto/pull/4406\n didDoc,\n handle: (user.handle ?? INVALID_HANDLE) as HandleString,\n email: user.email ?? undefined,\n emailConfirmed: !!user.emailConfirmedAt,\n active,\n status,\n }),\n }\n },\n })\n}\n\nfunction output(\n { credentials }: OAuthOutput | AccessOutput,\n data: com.atproto.server.getSession.$OutputBody,\n): com.atproto.server.getSession.$OutputBody {\n if (\n credentials.type === 'oauth' &&\n !credentials.permissions.allowsAccount({ attr: 'email', action: 'read' })\n ) {\n const { email, emailAuthFactor, emailConfirmed, ...rest } = data\n return rest\n }\n\n return data\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/server/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/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AA2BxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA0BvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/index.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,MAAM,sBAAsB,CAAA;AAClD,OAAO,kBAAkB,MAAM,yBAAyB,CAAA;AACxD,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAC5C,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAC9C,OAAO,iBAAiB,MAAM,wBAAwB,CAAA;AACtD,OAAO,gBAAgB,MAAM,uBAAuB,CAAA;AACpD,OAAO,iBAAiB,MAAM,wBAAwB,CAAA;AACtD,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAC9C,OAAO,iBAAiB,MAAM,wBAAwB,CAAA;AACtD,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAC9C,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAC9C,OAAO,cAAc,MAAM,qBAAqB,CAAA;AAChD,OAAO,qBAAqB,MAAM,4BAA4B,CAAA;AAC9D,OAAO,cA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,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC1B,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvB,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,iBAAiB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC9B,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,iBAAiB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC9B,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC/B,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,iBAAiB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAChC,CAAC","sourcesContent":["import { Server } from '@atproto/xrpc-server'\nimport { AppContext } from '../../../../context.js'\nimport activateAccount from './activateAccount.js'\nimport checkAccountStatus from './checkAccountStatus.js'\nimport confirmEmail from './confirmEmail.js'\nimport createAccount from './createAccount.js'\nimport createAppPassword from './createAppPassword.js'\nimport createInviteCode from './createInviteCode.js'\nimport createInviteCodes from './createInviteCodes.js'\nimport createSession from './createSession.js'\nimport deactivateAccount from './deactivateAccount.js'\nimport deleteAccount from './deleteAccount.js'\nimport deleteSession from './deleteSession.js'\nimport describeServer from './describeServer.js'\nimport getAccountInviteCodes from './getAccountInviteCodes.js'\nimport getServiceAuth from './getServiceAuth.js'\nimport getSession from './getSession.js'\nimport listAppPasswords from './listAppPasswords.js'\nimport refreshSession from './refreshSession.js'\nimport requestDelete from './requestAccountDelete.js'\nimport requestEmailConfirmation from './requestEmailConfirmation.js'\nimport requestEmailUpdate from './requestEmailUpdate.js'\nimport requestPasswordReset from './requestPasswordReset.js'\nimport reserveSigningKey from './reserveSigningKey.js'\nimport resetPassword from './resetPassword.js'\nimport revokeAppPassword from './revokeAppPassword.js'\nimport updateEmail from './updateEmail.js'\n\nexport default function (server: Server, ctx: AppContext) {\n describeServer(server, ctx)\n createAccount(server, ctx)\n createInviteCode(server, ctx)\n createInviteCodes(server, ctx)\n getAccountInviteCodes(server, ctx)\n reserveSigningKey(server, ctx)\n requestDelete(server, ctx)\n deleteAccount(server, ctx)\n requestPasswordReset(server, ctx)\n resetPassword(server, ctx)\n requestEmailConfirmation(server, ctx)\n confirmEmail(server, ctx)\n requestEmailUpdate(server, ctx)\n updateEmail(server, ctx)\n createSession(server, ctx)\n deleteSession(server, ctx)\n getSession(server, ctx)\n refreshSession(server, ctx)\n createAppPassword(server, ctx)\n listAppPasswords(server, ctx)\n revokeAppPassword(server, ctx)\n getServiceAuth(server, ctx)\n checkAccountStatus(server, ctx)\n activateAccount(server, ctx)\n deactivateAccount(server, ctx)\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/index.ts"],"names":[],"mappings":"AAEA,OAAO,eAAe,MAAM,sBAAsB,CAAA;AAClD,OAAO,kBAAkB,MAAM,yBAAyB,CAAA;AACxD,OAAO,YAAY,MAAM,mBAAmB,CAAA;AAC5C,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAC9C,OAAO,iBAAiB,MAAM,wBAAwB,CAAA;AACtD,OAAO,gBAAgB,MAAM,uBAAuB,CAAA;AACpD,OAAO,iBAAiB,MAAM,wBAAwB,CAAA;AACtD,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAC9C,OAAO,iBAAiB,MAAM,wBAAwB,CAAA;AACtD,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAC9C,OAAO,aAAa,MAAM,oBAAoB,CAAA;AAC9C,OAAO,cAAc,MAAM,qBAAqB,CAAA;AAChD,OAAO,qBAAqB,MAAM,4BAA4B,CAAA;AAC9D,OAAO,cAAc,MAAM,qBAAqB,CAAA;AAChD,OAAO,UAAU,MAAM,iBAAiB,CAAA;AACxC,OAAO,gBAAgB,MAA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,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvB,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,iBAAiB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC9B,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC7B,iBAAiB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC9B,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3B,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC/B,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,iBAAiB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;AAChC,CAAC","sourcesContent":["import type { Server } from '@atproto/xrpc-server'\nimport type { AppContext } from '../../../../context.js'\nimport activateAccount from './activateAccount.js'\nimport checkAccountStatus from './checkAccountStatus.js'\nimport confirmEmail from './confirmEmail.js'\nimport createAccount from './createAccount.js'\nimport createAppPassword from './createAppPassword.js'\nimport createInviteCode from './createInviteCode.js'\nimport createInviteCodes from './createInviteCodes.js'\nimport createSession from './createSession.js'\nimport deactivateAccount from './deactivateAccount.js'\nimport deleteAccount from './deleteAccount.js'\nimport deleteSession from './deleteSession.js'\nimport describeServer from './describeServer.js'\nimport getAccountInviteCodes from './getAccountInviteCodes.js'\nimport getServiceAuth from './getServiceAuth.js'\nimport getSession from './getSession.js'\nimport listAppPasswords from './listAppPasswords.js'\nimport refreshSession from './refreshSession.js'\nimport requestDelete from './requestAccountDelete.js'\nimport requestEmailConfirmation from './requestEmailConfirmation.js'\nimport requestEmailUpdate from './requestEmailUpdate.js'\nimport requestPasswordReset from './requestPasswordReset.js'\nimport reserveSigningKey from './reserveSigningKey.js'\nimport resetPassword from './resetPassword.js'\nimport revokeAppPassword from './revokeAppPassword.js'\nimport updateEmail from './updateEmail.js'\n\nexport default function (server: Server, ctx: AppContext) {\n describeServer(server, ctx)\n createAccount(server, ctx)\n createInviteCode(server, ctx)\n createInviteCodes(server, ctx)\n getAccountInviteCodes(server, ctx)\n reserveSigningKey(server, ctx)\n requestDelete(server, ctx)\n deleteAccount(server, ctx)\n requestPasswordReset(server, ctx)\n resetPassword(server, ctx)\n requestEmailConfirmation(server, ctx)\n confirmEmail(server, ctx)\n requestEmailUpdate(server, ctx)\n updateEmail(server, ctx)\n createSession(server, ctx)\n deleteSession(server, ctx)\n getSession(server, ctx)\n refreshSession(server, ctx)\n createAppPassword(server, ctx)\n listAppPasswords(server, ctx)\n revokeAppPassword(server, ctx)\n getServiceAuth(server, ctx)\n checkAccountStatus(server, ctx)\n activateAccount(server, ctx)\n deactivateAccount(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=listAppPasswords.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listAppPasswords.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/listAppPasswords.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"listAppPasswords.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/listAppPasswords.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAwCvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listAppPasswords.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/listAppPasswords.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"listAppPasswords.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/listAppPasswords.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAe,MAAM,sBAAsB,CAAA;AAElE,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,SAAS,EAAE,GAAG,EAAE;YACd,MAAM,IAAI,cAAc,CACtB,uDAAuD,CACxD,CAAA;QACH,CAAC;KACF,CAAC,CAAA;IAEF,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE;YAC9C,IAAI;YACJ,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE;gBAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,CAAC,mBAAmB,CAC/C,GAAG,EACH,IAAI,CAAC,WAAW,CAAC,GAAG,EACpB,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CACzC,CAAA;gBAED,OAAO,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE;oBAC9D,OAAO;iBACR,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE;YAC9C,IAAI;YACJ,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;gBAC1B,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,gBAAgB,CACzD,IAAI,CAAC,WAAW,CAAC,GAAG,CACrB,CAAA;gBACD,OAAO;oBACL,QAAQ,EAAE,kBAAkB;oBAC5B,IAAI,EAAE,EAAE,SAAS,EAAE;iBACpB,CAAA;YACH,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { ForbiddenError, 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 const { entrywayClient } = ctx\n\n const auth = ctx.authVerifier.authorization({\n authorize: () => {\n throw new ForbiddenError(\n 'OAuth credentials are not supported for this endpoint',\n )\n },\n })\n\n if (entrywayClient) {\n server.add(com.atproto.server.listAppPasswords, {\n auth,\n handler: async ({ auth, req }) => {\n const { headers } = await ctx.entrywayAuthHeaders(\n req,\n auth.credentials.did,\n com.atproto.server.listAppPasswords.$lxm,\n )\n\n return entrywayClient.xrpc(com.atproto.server.listAppPasswords, {\n headers,\n })\n },\n })\n } else {\n server.add(com.atproto.server.listAppPasswords, {\n auth,\n handler: async ({ auth }) => {\n const passwords = await ctx.accountManager.listAppPasswords(\n auth.credentials.did,\n )\n return {\n encoding: 'application/json',\n body: { passwords },\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=refreshSession.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refreshSession.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/refreshSession.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"refreshSession.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/refreshSession.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAKxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA2DvD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { INVALID_HANDLE } from '@atproto/syntax';
|
|
1
|
+
import { INVALID_HANDLE, } from '@atproto/syntax';
|
|
2
2
|
import { AuthRequiredError, InvalidRequestError, } from '@atproto/xrpc-server';
|
|
3
3
|
import { formatAccountStatus } from '../../../../account-manager/account-manager.js';
|
|
4
4
|
import { softDeleted } from '../../../../db/util.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refreshSession.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/refreshSession.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"refreshSession.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/refreshSession.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,GACf,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,iBAAiB,EACjB,mBAAmB,GAEpB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAA;AAEpF,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAE5C,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC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AM,EAAE,MAAM,EAAE,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAA;YAEpD,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI,EAAE;oBACJ,SAAS,EAAE,OAAO,CAAC,SAAS;oBAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;oBAE9B,GAAG,EAAE,IAAI,CAAC,GAAgB;oBAC1B,uEAAuE;oBACvE,MAAM;oBACN,MAAM,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,cAAc,CAAiB;oBACvD,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS;oBAC9B,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB;oBACvC,MAAM;oBACN,MAAM;iBACP;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import {\n type DidString,\n type HandleString,\n INVALID_HANDLE,\n} from '@atproto/syntax'\nimport {\n AuthRequiredError,\n InvalidRequestError,\n type Server,\n} from '@atproto/xrpc-server'\nimport { formatAccountStatus } from '../../../../account-manager/account-manager.js'\nimport type { AppContext } from '../../../../context.js'\nimport { softDeleted } from '../../../../db/util.js'\nimport { com } from '../../../../lexicons/index.js'\nimport { didDocForSession } from './util.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.server.refreshSession, {\n auth: ctx.authVerifier.refresh(),\n handler: async ({\n auth,\n req,\n }): Promise<com.atproto.server.refreshSession.$Output> => {\n const did = auth.credentials.did\n const user = await ctx.accountManager.getAccount(did, {\n includeDeactivated: true,\n includeTakenDown: true,\n })\n if (!user) {\n throw new InvalidRequestError(\n `Could not find user info for account: ${did}`,\n )\n }\n if (softDeleted(user)) {\n throw new AuthRequiredError(\n 'Account has been taken down',\n 'AccountTakedown',\n )\n }\n\n if (ctx.entrywayClient) {\n const { headers } = ctx.entrywayPassthruHeaders(req)\n return ctx.entrywayClient.xrpc(com.atproto.server.refreshSession, {\n headers,\n })\n }\n\n const [didDoc, rotated] = await Promise.all([\n didDocForSession(ctx, user.did),\n ctx.accountManager.rotateRefreshToken(auth.credentials.tokenId),\n ])\n if (rotated === null) {\n throw new InvalidRequestError('Token has been revoked', 'ExpiredToken')\n }\n\n const { status, active } = formatAccountStatus(user)\n\n return {\n encoding: 'application/json' as const,\n body: {\n accessJwt: rotated.accessJwt,\n refreshJwt: rotated.refreshJwt,\n\n did: user.did as DidString,\n // @ts-expect-error https://github.com/bluesky-social/atproto/pull/4406\n didDoc,\n handle: (user.handle ?? INVALID_HANDLE) as HandleString,\n email: user.email ?? undefined,\n emailConfirmed: !!user.emailConfirmedAt,\n active,\n status,\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=requestAccountDelete.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestAccountDelete.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/requestAccountDelete.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,MAAM,
|
|
1
|
+
{"version":3,"file":"requestAccountDelete.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/requestAccountDelete.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAuDvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestAccountDelete.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/requestAccountDelete.ts"],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,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,CAAA;YACpD,CAAC;YAED,IAAI,GAAG,CAAC,cAAc,EAAE,CAAC;gBACvB,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,CAAC,mBAAmB,CAC/C,GAAG,EACH,IAAI,CAAC,WAAW,CAAC,GAAG,EACpB,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,oBAAoB,CAAC,IAAI,CAC7C,CAAA;gBACD,MAAM,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE;oBACrE,OAAO;iBACR,CAAC,CAAA;gBACF,OAAM;YACR,CAAC;YAED,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;gBACnB,MAAM,IAAI,mBAAmB,CAAC,wCAAwC,CAAC,CAAA;YACzE,CAAC;YACD,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,gBAAgB,CACrD,GAAG,EACH,gBAAgB,CACjB,CAAA;YACD,MAAM,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAA;QACtE,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { DAY, HOUR } from '@atproto/common'\nimport {\n ForbiddenError,\n InvalidRequestError,\n Server,\n} from '@atproto/xrpc-server'\nimport { ACCESS_FULL } from '../../../../auth-scope.js'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\nexport default function (server: Server, ctx: AppContext) {\n server.add(com.atproto.server.requestAccountDelete, {\n rateLimit: [\n {\n durationMs: DAY,\n points: 15,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n {\n durationMs: HOUR,\n points: 5,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n ],\n auth: ctx.authVerifier.authorization({\n checkTakedown: true,\n scopes: ACCESS_FULL,\n authorize: () => {\n throw new ForbiddenError(\n 'OAuth credentials are not supported for this endpoint',\n )\n },\n }),\n handler: async ({ auth, req }) => {\n const did = auth.credentials.did\n const account = await ctx.accountManager.getAccount(did, {\n includeDeactivated: true,\n includeTakenDown: true,\n })\n if (!account) {\n throw new InvalidRequestError('account not found')\n }\n\n if (ctx.entrywayClient) {\n const { headers } = await ctx.entrywayAuthHeaders(\n req,\n auth.credentials.did,\n com.atproto.server.requestAccountDelete.$lxm,\n )\n await ctx.entrywayClient.xrpc(com.atproto.server.requestAccountDelete, {\n headers,\n })\n return\n }\n\n if (!account.email) {\n throw new InvalidRequestError('account does not have an email address')\n }\n const token = await ctx.accountManager.createEmailToken(\n did,\n 'delete_account',\n )\n await ctx.mailer.sendAccountDelete({ token }, { to: account.email })\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"requestAccountDelete.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/requestAccountDelete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EACL,cAAc,EACd,mBAAmB,GAEpB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAEvD,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,MAAM,CAAC,oBAAoB,EAAE;QAClD,SAAS,EAAE;YACT;gBACE,UAAU,EAAE,GAAG;gBACf,MAAM,EAAE,EAAE;gBACV,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG;aAC5C;YACD;gBACE,UAAU,EAAE,IAAI;gBAChB,MAAM,EAAE,CAAC;gBACT,OAAO,EAAE,CAAC,EAAE,IAAI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gB,CACjB,CAAA;YACD,MAAM,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAA;QACtE,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { DAY, HOUR } from '@atproto/common'\nimport {\n ForbiddenError,\n InvalidRequestError,\n type Server,\n} 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.server.requestAccountDelete, {\n rateLimit: [\n {\n durationMs: DAY,\n points: 15,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n {\n durationMs: HOUR,\n points: 5,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n ],\n auth: ctx.authVerifier.authorization({\n checkTakedown: true,\n scopes: ACCESS_FULL,\n authorize: () => {\n throw new ForbiddenError(\n 'OAuth credentials are not supported for this endpoint',\n )\n },\n }),\n handler: async ({ auth, req }) => {\n const did = auth.credentials.did\n const account = await ctx.accountManager.getAccount(did, {\n includeDeactivated: true,\n includeTakenDown: true,\n })\n if (!account) {\n throw new InvalidRequestError('account not found')\n }\n\n if (ctx.entrywayClient) {\n const { headers } = await ctx.entrywayAuthHeaders(\n req,\n auth.credentials.did,\n com.atproto.server.requestAccountDelete.$lxm,\n )\n await ctx.entrywayClient.xrpc(com.atproto.server.requestAccountDelete, {\n headers,\n })\n return\n }\n\n if (!account.email) {\n throw new InvalidRequestError('account does not have an email address')\n }\n const token = await ctx.accountManager.createEmailToken(\n did,\n 'delete_account',\n )\n await ctx.mailer.sendAccountDelete({ token }, { to: account.email })\n },\n })\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MethodAuthVerifier, Server } from '@atproto/xrpc-server';
|
|
2
|
-
import { AccessOutput, OAuthOutput } from '../../../../auth-output.js';
|
|
3
|
-
import { AppContext } from '../../../../context.js';
|
|
1
|
+
import type { MethodAuthVerifier, Server } from '@atproto/xrpc-server';
|
|
2
|
+
import type { AccessOutput, OAuthOutput } from '../../../../auth-output.js';
|
|
3
|
+
import type { AppContext } from '../../../../context.js';
|
|
4
4
|
export declare function requestEmailConfirmationAuth(ctx: AppContext): MethodAuthVerifier<AccessOutput | OAuthOutput>;
|
|
5
5
|
export default function (server: Server, ctx: AppContext): void;
|
|
6
6
|
//# sourceMappingURL=requestEmailConfirmation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestEmailConfirmation.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/requestEmailConfirmation.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"requestEmailConfirmation.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/requestEmailConfirmation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAElB,MAAM,EACP,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,wBAAgB,4BAA4B,CAC1C,GAAG,EAAE,UAAU,GACd,kBAAkB,CAAC,YAAY,GAAG,WAAW,CAAC,CAOhD;AAeD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAgCvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestEmailConfirmation.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/requestEmailConfirmation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAQ3C,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,mFAAmF;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MAAM,CAAC,wBAAwB,EAAE;oBACrE,OAAO;iBACR,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,wBAAwB,EAAE;YACtD,IAAI;YACJ,SAAS;YACT,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;gBAC1B,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAA;gBAChC,MAAM,MAAM,GAAG,SAAS,CAAA,CAAC,+BAA+B;gBACxD,MAAM,GAAG,CAAC,cAAc,CAAC,wBAAwB,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;YACpE,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { DAY, HOUR } from '@atproto/common'\nimport {\n MethodAuthVerifier,\n MethodRateLimit,\n Server,\n} from '@atproto/xrpc-server'\nimport { AccessOutput, OAuthOutput } from '../../../../auth-output.js'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\n// Exposed as a utility to ensure auth in confirmEmail and requestEmailConfirmation\nexport function requestEmailConfirmationAuth(\n ctx: AppContext,\n): MethodAuthVerifier<AccessOutput | OAuthOutput> {\n return ctx.authVerifier.authorization({\n checkTakedown: true,\n authorize: (permissions) => {\n permissions.assertAccount({ attr: 'email', action: 'manage' })\n },\n })\n}\n\nconst rateLimit: MethodRateLimit<AccessOutput | OAuthOutput> = [\n {\n durationMs: DAY,\n points: 15,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n {\n durationMs: HOUR,\n points: 5,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n]\n\nexport default function (server: Server, ctx: AppContext) {\n const { entrywayClient } = ctx\n\n const auth = requestEmailConfirmationAuth(ctx)\n\n if (entrywayClient) {\n server.add(com.atproto.server.requestEmailConfirmation, {\n auth,\n rateLimit,\n handler: async ({ auth, req }) => {\n const { headers } = await ctx.entrywayAuthHeaders(\n req,\n auth.credentials.did,\n com.atproto.server.requestEmailConfirmation.$lxm,\n )\n\n await entrywayClient.xrpc(com.atproto.server.requestEmailConfirmation, {\n headers,\n })\n },\n })\n } else {\n server.add(com.atproto.server.requestEmailConfirmation, {\n auth,\n rateLimit,\n handler: async ({ auth }) => {\n const did = auth.credentials.did\n const locale = undefined // @TODO get the locale somehow\n await ctx.accountManager.requestEmailConfirmation(did, { locale })\n },\n })\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"requestEmailConfirmation.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/requestEmailConfirmation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAQ3C,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,mFAAmF;AACnF,MAAM,UAAU,4BAA4B,CAC1C,GAAe;IAEf,OAAO,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;QACpC,aAAa,EAAE,IAAI;QACnB,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE;YACzB,WAAW,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;QAChE,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,SAAS,GAAgD;IAC7D;QACE,UAAU,EAAE,GAAG;QACf,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG;KAC5C;IACD;QACE,UAAU,EAAE,IAAI;QAChB,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG;KAC5C;CACF,CAAA;AAED,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,EAAE,cAAc,EAAE,GAAG,GAAG,CAAA;IAE9B,MAAM,IAAI,GAAG,4BAA4B,CAAC,GAAG,CAAC,CAAA;IAE9C,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,wBAAwB,EAAE;YACtD,IAAI;YACJ,SAAS;YACT,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE;gBAC/B,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,CAAC,mBAAmB,CAC/C,GAAG,EACH,IAAI,CAAC,WAAW,CAAC,GAAG,EACpB,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,wBAAwB,CAAC,IAAI,CACjD,CAAA;gBAED,MAAM,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,wBAAwB,EAAE;oBACrE,OAAO;iBACR,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,wBAAwB,EAAE;YACtD,IAAI;YACJ,SAAS;YACT,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;gBAC1B,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAA;gBAChC,MAAM,MAAM,GAAG,SAAS,CAAA,CAAC,+BAA+B;gBACxD,MAAM,GAAG,CAAC,cAAc,CAAC,wBAAwB,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;YACpE,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { DAY, HOUR } from '@atproto/common'\nimport type {\n MethodAuthVerifier,\n MethodRateLimit,\n Server,\n} 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\n// Exposed as a utility to ensure auth in confirmEmail and requestEmailConfirmation\nexport function requestEmailConfirmationAuth(\n ctx: AppContext,\n): MethodAuthVerifier<AccessOutput | OAuthOutput> {\n return ctx.authVerifier.authorization({\n checkTakedown: true,\n authorize: (permissions) => {\n permissions.assertAccount({ attr: 'email', action: 'manage' })\n },\n })\n}\n\nconst rateLimit: MethodRateLimit<AccessOutput | OAuthOutput> = [\n {\n durationMs: DAY,\n points: 15,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n {\n durationMs: HOUR,\n points: 5,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n]\n\nexport default function (server: Server, ctx: AppContext) {\n const { entrywayClient } = ctx\n\n const auth = requestEmailConfirmationAuth(ctx)\n\n if (entrywayClient) {\n server.add(com.atproto.server.requestEmailConfirmation, {\n auth,\n rateLimit,\n handler: async ({ auth, req }) => {\n const { headers } = await ctx.entrywayAuthHeaders(\n req,\n auth.credentials.did,\n com.atproto.server.requestEmailConfirmation.$lxm,\n )\n\n await entrywayClient.xrpc(com.atproto.server.requestEmailConfirmation, {\n headers,\n })\n },\n })\n } else {\n server.add(com.atproto.server.requestEmailConfirmation, {\n auth,\n rateLimit,\n handler: async ({ auth }) => {\n const did = auth.credentials.did\n const locale = undefined // @TODO get the locale somehow\n await ctx.accountManager.requestEmailConfirmation(did, { locale })\n },\n })\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MethodAuthVerifier, Server } from '@atproto/xrpc-server';
|
|
2
|
-
import { AccessOutput, OAuthOutput } from '../../../../auth-output.js';
|
|
3
|
-
import { AppContext } from '../../../../context.js';
|
|
1
|
+
import { type MethodAuthVerifier, type Server } from '@atproto/xrpc-server';
|
|
2
|
+
import type { AccessOutput, OAuthOutput } from '../../../../auth-output.js';
|
|
3
|
+
import type { AppContext } from '../../../../context.js';
|
|
4
4
|
export declare function requestEmailUpdateAuth(ctx: AppContext): MethodAuthVerifier<AccessOutput | OAuthOutput>;
|
|
5
5
|
export default function (server: Server, ctx: AppContext): void;
|
|
6
6
|
//# sourceMappingURL=requestEmailUpdate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestEmailUpdate.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/requestEmailUpdate.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,kBAAkB,
|
|
1
|
+
{"version":3,"file":"requestEmailUpdate.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/requestEmailUpdate.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,kBAAkB,EAEvB,KAAK,MAAM,EACZ,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAE3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAKxD,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,UAAU,GACd,kBAAkB,CAAC,YAAY,GAAG,WAAW,CAAC,CAUhD;AAeD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA4CvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestEmailUpdate.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/requestEmailUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EACL,cAAc,GAIf,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAEvD,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,4EAA4E;AAC5E,mBAAmB;AACnB,MAAM,UAAU,sBAAsB,CACpC,GAAe;IAEf,OAAO,GAAG,CAAC,YA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,CAAC;QACN,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE;YAChD,SAAS;YACT,IAAI;YACJ,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;gBAC1B,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAA;gBAEhC,wEAAwE;gBACxE,mDAAmD;gBACnD,MAAM,MAAM,GAAG,SAAS,CAAA;gBAExB,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,kBAAkB,CACnE,GAAG,EACH,EAAE,MAAM,EAAE,CACX,CAAA;gBAED,OAAO;oBACL,QAAQ,EAAE,kBAA2B;oBACrC,IAAI,EAAE,EAAE,aAAa,EAAE;iBACxB,CAAA;YACH,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { DAY, HOUR } from '@atproto/common'\nimport {\n ForbiddenError,\n MethodAuthVerifier,\n MethodRateLimit,\n Server,\n} from '@atproto/xrpc-server'\nimport { AccessOutput, OAuthOutput } from '../../../../auth-output.js'\nimport { ACCESS_FULL } from '../../../../auth-scope.js'\nimport { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\n// Exposed as a utility to ensure auth in updateEmail and requestEmailUpdate\n// stay consistent.\nexport function requestEmailUpdateAuth(\n ctx: AppContext,\n): MethodAuthVerifier<AccessOutput | OAuthOutput> {\n return ctx.authVerifier.authorization({\n checkTakedown: true,\n scopes: ACCESS_FULL,\n authorize: () => {\n throw new ForbiddenError(\n 'Use the account manager interface to update email address associated with an account',\n )\n },\n })\n}\n\nconst rateLimit: MethodRateLimit<AccessOutput | OAuthOutput> = [\n {\n durationMs: DAY,\n points: 15,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n {\n durationMs: HOUR,\n points: 5,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n]\n\nexport default function (server: Server, ctx: AppContext) {\n const { entrywayClient } = ctx\n\n const auth = requestEmailUpdateAuth(ctx)\n\n if (entrywayClient) {\n server.add(com.atproto.server.requestEmailUpdate, {\n rateLimit,\n auth,\n handler: async ({ auth, req }) => {\n const { headers } = await ctx.entrywayAuthHeaders(\n req,\n auth.credentials.did,\n com.atproto.server.requestEmailUpdate.$lxm,\n )\n\n return entrywayClient.xrpc(com.atproto.server.requestEmailUpdate, {\n headers,\n })\n },\n })\n } else {\n server.add(com.atproto.server.requestEmailUpdate, {\n rateLimit,\n auth,\n handler: async ({ auth }) => {\n const did = auth.credentials.did\n\n // @TODO get the locale somehow (either by adding a field in the request\n // body, or by using the `Accept-Language` header).\n const locale = undefined\n\n const { tokenRequired } = await ctx.accountManager.requestEmailUpdate(\n did,\n { locale },\n )\n\n return {\n encoding: 'application/json' as const,\n body: { tokenRequired },\n }\n },\n })\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"requestEmailUpdate.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/requestEmailUpdate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EACL,cAAc,GAIf,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAEvD,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,4EAA4E;AAC5E,mBAAmB;AACnB,MAAM,UAAU,sBAAsB,CACpC,GAAe;IAEf,OAAO,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC;QACpC,aAAa,EAAE,IAAI;QACnB,MAAM,EAAE,WAAW;QACnB,SAAS,EAAE,GAAG,EAAE;YACd,MAAM,IAAI,cAAc,CACtB,sFAAsF,CACvF,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,SAAS,GAAgD;IAC7D;QACE,UAAU,EAAE,GAAG;QACf,MAAM,EAAE,EAAE;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BACnD,MAAM,MAAM,GAAG,SAAS,CAAA;gBAExB,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,kBAAkB,CACnE,GAAG,EACH,EAAE,MAAM,EAAE,CACX,CAAA;gBAED,OAAO;oBACL,QAAQ,EAAE,kBAA2B;oBACrC,IAAI,EAAE,EAAE,aAAa,EAAE;iBACxB,CAAA;YACH,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { DAY, HOUR } from '@atproto/common'\nimport {\n ForbiddenError,\n type MethodAuthVerifier,\n type MethodRateLimit,\n type Server,\n} from '@atproto/xrpc-server'\nimport type { AccessOutput, OAuthOutput } from '../../../../auth-output.js'\nimport { ACCESS_FULL } from '../../../../auth-scope.js'\nimport type { AppContext } from '../../../../context.js'\nimport { com } from '../../../../lexicons/index.js'\n\n// Exposed as a utility to ensure auth in updateEmail and requestEmailUpdate\n// stay consistent.\nexport function requestEmailUpdateAuth(\n ctx: AppContext,\n): MethodAuthVerifier<AccessOutput | OAuthOutput> {\n return ctx.authVerifier.authorization({\n checkTakedown: true,\n scopes: ACCESS_FULL,\n authorize: () => {\n throw new ForbiddenError(\n 'Use the account manager interface to update email address associated with an account',\n )\n },\n })\n}\n\nconst rateLimit: MethodRateLimit<AccessOutput | OAuthOutput> = [\n {\n durationMs: DAY,\n points: 15,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n {\n durationMs: HOUR,\n points: 5,\n calcKey: ({ auth }) => auth.credentials.did,\n },\n]\n\nexport default function (server: Server, ctx: AppContext) {\n const { entrywayClient } = ctx\n\n const auth = requestEmailUpdateAuth(ctx)\n\n if (entrywayClient) {\n server.add(com.atproto.server.requestEmailUpdate, {\n rateLimit,\n auth,\n handler: async ({ auth, req }) => {\n const { headers } = await ctx.entrywayAuthHeaders(\n req,\n auth.credentials.did,\n com.atproto.server.requestEmailUpdate.$lxm,\n )\n\n return entrywayClient.xrpc(com.atproto.server.requestEmailUpdate, {\n headers,\n })\n },\n })\n } else {\n server.add(com.atproto.server.requestEmailUpdate, {\n rateLimit,\n auth,\n handler: async ({ auth }) => {\n const did = auth.credentials.did\n\n // @TODO get the locale somehow (either by adding a field in the request\n // body, or by using the `Accept-Language` header).\n const locale = undefined\n\n const { tokenRequired } = await ctx.accountManager.requestEmailUpdate(\n did,\n { locale },\n )\n\n return {\n encoding: 'application/json' as const,\n body: { tokenRequired },\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=requestPasswordReset.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestPasswordReset.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/requestPasswordReset.ts"],"names":[],"mappings":"AACA,OAAO,EAAuB,MAAM,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"requestPasswordReset.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/requestPasswordReset.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,QA8CvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestPasswordReset.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/requestPasswordReset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"requestPasswordReset.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/requestPasswordReset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAC3C,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,EAAE,cAAc,EAAE,GAAG,GAAG,CAAA;IAE9B,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE;QAClD,SAAS,EAAE;YACT;gBACE,UAAU,EAAE,GAAG;gBACf,MAAM,EAAE,EAAE;aACX;YACD;gBACE,UAAU,EAAE,IAAI;gBAChB,MAAM,EAAE,EAAE;aACX;SACF;QACD,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;YAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAA;YAEtC,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,iBAAiB,CAAC,KAAK,EAAE;gBAChE,kBAAkB,EAAE,IAAI;gBACxB,gBAAgB,EAAE,IAAI;aACvB,CAAC,CAAA;YAEF,IAAI,OAAO,EAAE,KAAK,EAAE,CAAC;gBACnB,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,gBAAgB,CACrD,OAAO,CAAC,GAAG,EACX,gBAAgB,CACjB,CAAA;gBACD,MAAM,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAChC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,EAClD,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,EAAE,CACtB,CAAA;gBACD,OAAM;YACR,CAAC;YAED,IAAI,cAAc,EAAE,CAAC;gBACnB,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAA;gBACpD,MAAM,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE;oBACjE,OAAO;oBACP,IAAI;iBACL,CAAC,CAAA;gBACF,OAAM;YACR,CAAC;YAED,MAAM,IAAI,mBAAmB,CAAC,wCAAwC,CAAC,CAAA;QACzE,CAAC;KACF,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { DAY, HOUR } from '@atproto/common'\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 const { entrywayClient } = ctx\n\n server.add(com.atproto.server.requestPasswordReset, {\n rateLimit: [\n {\n durationMs: DAY,\n points: 50,\n },\n {\n durationMs: HOUR,\n points: 15,\n },\n ],\n handler: async ({ input: { body }, req }) => {\n const email = body.email.toLowerCase()\n\n const account = await ctx.accountManager.getAccountByEmail(email, {\n includeDeactivated: true,\n includeTakenDown: true,\n })\n\n if (account?.email) {\n const token = await ctx.accountManager.createEmailToken(\n account.did,\n 'reset_password',\n )\n await ctx.mailer.sendResetPassword(\n { handle: account.handle ?? account.email, token },\n { to: account.email },\n )\n return\n }\n\n if (entrywayClient) {\n const { headers } = ctx.entrywayPassthruHeaders(req)\n await entrywayClient.xrpc(com.atproto.server.requestPasswordReset, {\n headers,\n body,\n })\n return\n }\n\n throw new InvalidRequestError('account does not have an email address')\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=reserveSigningKey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reserveSigningKey.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/reserveSigningKey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"reserveSigningKey.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/reserveSigningKey.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,QAUvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reserveSigningKey.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/reserveSigningKey.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,MAAM,CAAC,iBAAiB,EAAE;QAC/C,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;YAC3B,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACtE,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI,EAAE,EAAE,UAAU,EAAE;aACrB,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.server.reserveSigningKey, {\n handler: async ({ input }) => {\n const signingKey = await ctx.actorStore.reserveKeypair(input.body.did)\n return {\n encoding: 'application/json' as const,\n body: { signingKey },\n }\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"reserveSigningKey.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/reserveSigningKey.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,MAAM,CAAC,iBAAiB,EAAE;QAC/C,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;YAC3B,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACtE,OAAO;gBACL,QAAQ,EAAE,kBAA2B;gBACrC,IAAI,EAAE,EAAE,UAAU,EAAE;aACrB,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.server.reserveSigningKey, {\n handler: async ({ input }) => {\n const signingKey = await ctx.actorStore.reserveKeypair(input.body.did)\n return {\n encoding: 'application/json' as const,\n body: { signingKey },\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=resetPassword.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resetPassword.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/resetPassword.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,MAAM,
|
|
1
|
+
{"version":3,"file":"resetPassword.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/resetPassword.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAuCvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resetPassword.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/resetPassword.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EACL,mBAAmB,GAGpB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAA;AAEvF,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,SAAS,GAIX;QACF;YACE,UAAU,EAAE,CAAC,GAAG,MAAM;YACtB,MAAM,EAAE,EAAE;SACX;KACF,CAAA;IAED,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE;YAC3C,SAAS;YACT,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;gBAC1C,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAA;gBACpD,MAAM,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE;oBAC1D,OAAO;oBACP,IAAI;iBACL,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE;YAC3C,SAAS;YACT,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE;gBACrC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAA;gBAEhC,IAAI,QAAQ,CAAC,MAAM,GAAG,uBAAuB,EAAE,CAAC;oBAC9C,MAAM,IAAI,mBAAmB,CAAC,0BAA0B,CAAC,CAAA;gBAC3D,CAAC;gBAED,MAAM,GAAG,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;YAC7D,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { MINUTE } from '@atproto/common'\nimport {\n InvalidRequestError,\n MethodRateLimit,\n Server,\n} from '@atproto/xrpc-server'\nimport { NEW_PASSWORD_MAX_LENGTH } from '../../../../account-manager/helpers/scrypt.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 rateLimit: MethodRateLimit<\n void,\n com.atproto.server.resetPassword.$Params,\n com.atproto.server.resetPassword.$Input\n > = [\n {\n durationMs: 5 * MINUTE,\n points: 50,\n },\n ]\n\n if (entrywayClient) {\n server.add(com.atproto.server.resetPassword, {\n rateLimit,\n handler: async ({ input: { body }, req }) => {\n const { headers } = ctx.entrywayPassthruHeaders(req)\n await entrywayClient.xrpc(com.atproto.server.resetPassword, {\n headers,\n body,\n })\n },\n })\n } else {\n server.add(com.atproto.server.resetPassword, {\n rateLimit,\n handler: async ({ input: { body } }) => {\n const { token, password } = body\n\n if (password.length > NEW_PASSWORD_MAX_LENGTH) {\n throw new InvalidRequestError('Invalid password length.')\n }\n\n await ctx.accountManager.resetPassword({ token, password })\n },\n })\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"resetPassword.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/resetPassword.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EACL,mBAAmB,GAGpB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAA;AAEvF,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,SAAS,GAIX;QACF;YACE,UAAU,EAAE,CAAC,GAAG,MAAM;YACtB,MAAM,EAAE,EAAE;SACX;KACF,CAAA;IAED,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE;YAC3C,SAAS;YACT,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;gBAC1C,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAA;gBACpD,MAAM,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE;oBAC1D,OAAO;oBACP,IAAI;iBACL,CAAC,CAAA;YACJ,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE;YAC3C,SAAS;YACT,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE;gBACrC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAA;gBAEhC,IAAI,QAAQ,CAAC,MAAM,GAAG,uBAAuB,EAAE,CAAC;oBAC9C,MAAM,IAAI,mBAAmB,CAAC,0BAA0B,CAAC,CAAA;gBAC3D,CAAC;gBAED,MAAM,GAAG,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA;YAC7D,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { MINUTE } from '@atproto/common'\nimport {\n InvalidRequestError,\n type MethodRateLimit,\n type Server,\n} from '@atproto/xrpc-server'\nimport { NEW_PASSWORD_MAX_LENGTH } from '../../../../account-manager/helpers/scrypt.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 rateLimit: MethodRateLimit<\n void,\n com.atproto.server.resetPassword.$Params,\n com.atproto.server.resetPassword.$Input\n > = [\n {\n durationMs: 5 * MINUTE,\n points: 50,\n },\n ]\n\n if (entrywayClient) {\n server.add(com.atproto.server.resetPassword, {\n rateLimit,\n handler: async ({ input: { body }, req }) => {\n const { headers } = ctx.entrywayPassthruHeaders(req)\n await entrywayClient.xrpc(com.atproto.server.resetPassword, {\n headers,\n body,\n })\n },\n })\n } else {\n server.add(com.atproto.server.resetPassword, {\n rateLimit,\n handler: async ({ input: { body } }) => {\n const { token, password } = body\n\n if (password.length > NEW_PASSWORD_MAX_LENGTH) {\n throw new InvalidRequestError('Invalid password length.')\n }\n\n await ctx.accountManager.resetPassword({ token, password })\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=revokeAppPassword.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revokeAppPassword.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/revokeAppPassword.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"revokeAppPassword.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/revokeAppPassword.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QAqCvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revokeAppPassword.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/revokeAppPassword.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"revokeAppPassword.js","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/revokeAppPassword.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAe,MAAM,sBAAsB,CAAA;AAElE,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAA;AAEnD,MAAM,CAAC,OAAO,WAAW,MAAc,EAAE,GAAe;IACtD,MAAM,EAAE,cAAc,EAAE,GAAG,GAAG,CAAA;IA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../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 authorize: () => {\n throw new ForbiddenError(\n 'OAuth credentials are not supported for this endpoint',\n )\n },\n })\n\n if (entrywayClient) {\n server.add(com.atproto.server.revokeAppPassword, {\n auth,\n handler: async ({ auth, input: { body }, req }) => {\n const { headers } = await ctx.entrywayAuthHeaders(\n req,\n auth.credentials.did,\n com.atproto.server.revokeAppPassword.$lxm,\n )\n\n await entrywayClient.xrpc(com.atproto.server.revokeAppPassword, {\n headers,\n body,\n })\n },\n })\n } else {\n server.add(com.atproto.server.revokeAppPassword, {\n auth,\n handler: async ({ auth, input: { body } }) => {\n const requester = auth.credentials.did\n\n await ctx.accountManager.revokeAppPassword(requester, body.name)\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=updateEmail.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateEmail.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/updateEmail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,MAAM,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"updateEmail.d.ts","sourceRoot":"","sources":["../../../../../src/api/com/atproto/server/updateEmail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAEvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,MAAM,CAAC,OAAO,WAAW,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,QA6CvD"}
|