@atproto/pds 0.4.103 → 0.4.105
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 +35 -0
- package/dist/account-manager/{index.d.ts → account-manager.d.ts} +26 -35
- package/dist/account-manager/account-manager.d.ts.map +1 -0
- package/dist/account-manager/{index.js → account-manager.js} +52 -207
- package/dist/account-manager/account-manager.js.map +1 -0
- package/dist/account-manager/helpers/account.d.ts +3 -3
- package/dist/account-manager/helpers/device-account.d.ts +15 -15
- package/dist/account-manager/helpers/device-account.d.ts.map +1 -1
- package/dist/account-manager/helpers/device-account.js +2 -1
- package/dist/account-manager/helpers/device-account.js.map +1 -1
- package/dist/account-manager/helpers/token.d.ts +98 -98
- package/dist/account-manager/oauth-store.d.ts +58 -0
- package/dist/account-manager/oauth-store.d.ts.map +1 -0
- package/dist/account-manager/oauth-store.js +417 -0
- package/dist/account-manager/oauth-store.js.map +1 -0
- package/dist/actor-store/record/reader.d.ts +3 -3
- package/dist/actor-store/repo/reader.d.ts +2 -0
- package/dist/actor-store/repo/reader.d.ts.map +1 -1
- package/dist/actor-store/repo/reader.js +9 -0
- package/dist/actor-store/repo/reader.js.map +1 -1
- package/dist/actor-store/repo/sql-repo-reader.d.ts +1 -1
- package/dist/actor-store/repo/transactor.d.ts.map +1 -1
- package/dist/actor-store/repo/transactor.js +13 -4
- package/dist/actor-store/repo/transactor.js.map +1 -1
- package/dist/api/com/atproto/admin/deleteAccount.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/deleteAccount.js +2 -3
- package/dist/api/com/atproto/admin/deleteAccount.js.map +1 -1
- package/dist/api/com/atproto/admin/sendEmail.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/sendEmail.js +2 -7
- package/dist/api/com/atproto/admin/sendEmail.js.map +1 -1
- package/dist/api/com/atproto/admin/updateAccountEmail.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/updateAccountEmail.js +1 -2
- package/dist/api/com/atproto/admin/updateAccountEmail.js.map +1 -1
- package/dist/api/com/atproto/admin/updateAccountHandle.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/updateAccountHandle.js +2 -6
- package/dist/api/com/atproto/admin/updateAccountHandle.js.map +1 -1
- package/dist/api/com/atproto/admin/updateAccountPassword.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/updateAccountPassword.js +1 -2
- package/dist/api/com/atproto/admin/updateAccountPassword.js.map +1 -1
- package/dist/api/com/atproto/identity/requestPlcOperationSignature.d.ts.map +1 -1
- package/dist/api/com/atproto/identity/requestPlcOperationSignature.js +2 -7
- package/dist/api/com/atproto/identity/requestPlcOperationSignature.js.map +1 -1
- package/dist/api/com/atproto/identity/resolveHandle.d.ts.map +1 -1
- package/dist/api/com/atproto/identity/resolveHandle.js +2 -36
- package/dist/api/com/atproto/identity/resolveHandle.js.map +1 -1
- package/dist/api/com/atproto/identity/signPlcOperation.d.ts.map +1 -1
- package/dist/api/com/atproto/identity/signPlcOperation.js +2 -7
- package/dist/api/com/atproto/identity/signPlcOperation.js.map +1 -1
- package/dist/api/com/atproto/identity/updateHandle.d.ts.map +1 -1
- package/dist/api/com/atproto/identity/updateHandle.js +3 -14
- package/dist/api/com/atproto/identity/updateHandle.js.map +1 -1
- package/dist/api/com/atproto/repo/applyWrites.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/applyWrites.js +12 -7
- package/dist/api/com/atproto/repo/applyWrites.js.map +1 -1
- package/dist/api/com/atproto/repo/createRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/createRecord.js +12 -8
- package/dist/api/com/atproto/repo/createRecord.js.map +1 -1
- package/dist/api/com/atproto/repo/deleteRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/deleteRecord.js +12 -7
- package/dist/api/com/atproto/repo/deleteRecord.js.map +1 -1
- package/dist/api/com/atproto/repo/listRecords.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/listRecords.js +1 -3
- package/dist/api/com/atproto/repo/listRecords.js.map +1 -1
- package/dist/api/com/atproto/repo/putRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/putRecord.js +11 -8
- package/dist/api/com/atproto/repo/putRecord.js.map +1 -1
- package/dist/api/com/atproto/server/activateAccount.d.ts.map +1 -1
- package/dist/api/com/atproto/server/activateAccount.js +3 -20
- package/dist/api/com/atproto/server/activateAccount.js.map +1 -1
- package/dist/api/com/atproto/server/confirmEmail.d.ts.map +1 -1
- package/dist/api/com/atproto/server/confirmEmail.js +2 -7
- package/dist/api/com/atproto/server/confirmEmail.js.map +1 -1
- package/dist/api/com/atproto/server/createAccount.d.ts.map +1 -1
- package/dist/api/com/atproto/server/createAccount.js +5 -7
- package/dist/api/com/atproto/server/createAccount.js.map +1 -1
- package/dist/api/com/atproto/server/createAppPassword.d.ts.map +1 -1
- package/dist/api/com/atproto/server/createAppPassword.js +2 -7
- package/dist/api/com/atproto/server/createAppPassword.js.map +1 -1
- package/dist/api/com/atproto/server/createSession.js +2 -2
- package/dist/api/com/atproto/server/createSession.js.map +1 -1
- package/dist/api/com/atproto/server/deactivateAccount.d.ts.map +1 -1
- package/dist/api/com/atproto/server/deactivateAccount.js +1 -2
- package/dist/api/com/atproto/server/deactivateAccount.js.map +1 -1
- package/dist/api/com/atproto/server/deleteAccount.d.ts.map +1 -1
- package/dist/api/com/atproto/server/deleteAccount.js +3 -5
- package/dist/api/com/atproto/server/deleteAccount.js.map +1 -1
- package/dist/api/com/atproto/server/deleteSession.d.ts.map +1 -1
- package/dist/api/com/atproto/server/deleteSession.js +2 -3
- package/dist/api/com/atproto/server/deleteSession.js.map +1 -1
- package/dist/api/com/atproto/server/getAccountInviteCodes.d.ts.map +1 -1
- package/dist/api/com/atproto/server/getAccountInviteCodes.js +2 -7
- package/dist/api/com/atproto/server/getAccountInviteCodes.js.map +1 -1
- package/dist/api/com/atproto/server/getSession.js +2 -2
- package/dist/api/com/atproto/server/getSession.js.map +1 -1
- package/dist/api/com/atproto/server/listAppPasswords.d.ts.map +1 -1
- package/dist/api/com/atproto/server/listAppPasswords.js +2 -7
- package/dist/api/com/atproto/server/listAppPasswords.js.map +1 -1
- package/dist/api/com/atproto/server/refreshSession.js +2 -2
- package/dist/api/com/atproto/server/refreshSession.js.map +1 -1
- package/dist/api/com/atproto/server/requestAccountDelete.d.ts.map +1 -1
- package/dist/api/com/atproto/server/requestAccountDelete.js +2 -7
- package/dist/api/com/atproto/server/requestAccountDelete.js.map +1 -1
- package/dist/api/com/atproto/server/requestEmailConfirmation.d.ts.map +1 -1
- package/dist/api/com/atproto/server/requestEmailConfirmation.js +2 -7
- package/dist/api/com/atproto/server/requestEmailConfirmation.js.map +1 -1
- package/dist/api/com/atproto/server/requestEmailUpdate.d.ts.map +1 -1
- package/dist/api/com/atproto/server/requestEmailUpdate.js +2 -7
- package/dist/api/com/atproto/server/requestEmailUpdate.js.map +1 -1
- package/dist/api/com/atproto/server/requestPasswordReset.d.ts.map +1 -1
- package/dist/api/com/atproto/server/requestPasswordReset.js +1 -2
- package/dist/api/com/atproto/server/requestPasswordReset.js.map +1 -1
- package/dist/api/com/atproto/server/resetPassword.d.ts.map +1 -1
- package/dist/api/com/atproto/server/resetPassword.js +1 -2
- package/dist/api/com/atproto/server/resetPassword.js.map +1 -1
- package/dist/api/com/atproto/server/revokeAppPassword.d.ts.map +1 -1
- package/dist/api/com/atproto/server/revokeAppPassword.js +2 -7
- package/dist/api/com/atproto/server/revokeAppPassword.js.map +1 -1
- package/dist/api/com/atproto/server/updateEmail.d.ts.map +1 -1
- package/dist/api/com/atproto/server/updateEmail.js +2 -7
- package/dist/api/com/atproto/server/updateEmail.js.map +1 -1
- package/dist/api/com/atproto/sync/getRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/sync/getRecord.js +1 -4
- package/dist/api/com/atproto/sync/getRecord.js.map +1 -1
- package/dist/api/com/atproto/sync/getRepoStatus.js +1 -1
- package/dist/api/com/atproto/sync/getRepoStatus.js.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.map +1 -1
- package/dist/api/com/atproto/sync/subscribeRepos.js +2 -10
- package/dist/api/com/atproto/sync/subscribeRepos.js.map +1 -1
- package/dist/api/com/atproto/temp/checkSignupQueue.js +1 -1
- package/dist/api/com/atproto/temp/checkSignupQueue.js.map +1 -1
- package/dist/api/proxy.d.ts +7 -8
- package/dist/api/proxy.d.ts.map +1 -1
- package/dist/api/proxy.js +14 -6
- package/dist/api/proxy.js.map +1 -1
- package/dist/app-view.d.ts +14 -0
- package/dist/app-view.d.ts.map +1 -0
- package/dist/app-view.js +36 -0
- package/dist/app-view.js.map +1 -0
- package/dist/auth-routes.d.ts +1 -1
- package/dist/auth-routes.d.ts.map +1 -1
- package/dist/auth-routes.js +9 -3
- package/dist/auth-routes.js.map +1 -1
- package/dist/auth-verifier.d.ts +1 -1
- package/dist/auth-verifier.d.ts.map +1 -1
- package/dist/config/config.d.ts +3 -2
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +17 -7
- package/dist/config/config.js.map +1 -1
- package/dist/config/env.d.ts +4 -0
- package/dist/config/env.d.ts.map +1 -1
- package/dist/config/env.js +5 -0
- package/dist/config/env.js.map +1 -1
- package/dist/context.d.ts +11 -4
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +33 -18
- package/dist/context.js.map +1 -1
- package/dist/handle/index.d.ts +0 -7
- package/dist/handle/index.d.ts.map +1 -1
- package/dist/handle/index.js +4 -58
- package/dist/handle/index.js.map +1 -1
- package/dist/image/image-url.d.ts +8 -0
- package/dist/image/image-url.d.ts.map +1 -0
- package/dist/image/image-url.js +26 -0
- package/dist/image/image-url.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lexicon/index.d.ts +6 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +12 -0
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +412 -158
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +222 -81
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/embed/video.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/embed/video.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/embed/video.js.map +1 -1
- package/dist/lexicon/types/app/bsky/labeler/defs.d.ts +7 -0
- package/dist/lexicon/types/app/bsky/labeler/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/labeler/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/labeler/service.d.ts +7 -0
- package/dist/lexicon/types/app/bsky/labeler/service.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/labeler/service.js.map +1 -1
- package/dist/lexicon/types/com/atproto/identity/defs.d.ts +17 -0
- package/dist/lexicon/types/com/atproto/identity/defs.d.ts.map +1 -0
- package/dist/lexicon/types/com/atproto/identity/defs.js +16 -0
- package/dist/lexicon/types/com/atproto/identity/defs.js.map +1 -0
- package/dist/lexicon/types/com/atproto/identity/refreshIdentity.d.ts +39 -0
- package/dist/lexicon/types/com/atproto/identity/refreshIdentity.d.ts.map +1 -0
- package/dist/lexicon/types/com/atproto/identity/refreshIdentity.js +7 -0
- package/dist/lexicon/types/com/atproto/identity/refreshIdentity.js.map +1 -0
- package/dist/lexicon/types/com/atproto/identity/resolveDid.d.ts +40 -0
- package/dist/lexicon/types/com/atproto/identity/resolveDid.d.ts.map +1 -0
- package/dist/lexicon/types/com/atproto/identity/resolveDid.js +7 -0
- package/dist/lexicon/types/com/atproto/identity/resolveDid.js.map +1 -0
- package/dist/lexicon/types/com/atproto/identity/resolveHandle.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/identity/resolveHandle.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/identity/resolveIdentity.d.ts +36 -0
- package/dist/lexicon/types/com/atproto/identity/resolveIdentity.d.ts.map +1 -0
- package/dist/lexicon/types/com/atproto/identity/resolveIdentity.js +7 -0
- package/dist/lexicon/types/com/atproto/identity/resolveIdentity.js.map +1 -0
- package/dist/lexicon/types/com/atproto/moderation/defs.d.ts +2 -0
- package/dist/lexicon/types/com/atproto/moderation/defs.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/repo/listRecords.d.ts +0 -4
- package/dist/lexicon/types/com/atproto/repo/listRecords.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/repo/listRecords.js.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/getRecord.d.ts +0 -2
- package/dist/lexicon/types/com/atproto/sync/getRecord.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.d.ts +1 -30
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.js +0 -27
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.js.map +1 -1
- package/dist/mailer/index.d.ts +5 -5
- package/dist/mailer/index.d.ts.map +1 -1
- package/dist/mailer/index.js +6 -5
- package/dist/mailer/index.js.map +1 -1
- package/dist/read-after-write/viewer.d.ts +1 -1
- package/dist/read-after-write/viewer.d.ts.map +1 -1
- package/dist/repo/types.d.ts +6 -2
- package/dist/repo/types.d.ts.map +1 -1
- package/dist/repo/types.js.map +1 -1
- package/dist/scripts/rebuild-repo.d.ts.map +1 -1
- package/dist/scripts/rebuild-repo.js +2 -1
- package/dist/scripts/rebuild-repo.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/events.d.ts +29 -41
- package/dist/sequencer/events.d.ts.map +1 -1
- package/dist/sequencer/events.js +24 -58
- package/dist/sequencer/events.js.map +1 -1
- package/dist/sequencer/sequencer.d.ts +2 -3
- package/dist/sequencer/sequencer.d.ts.map +1 -1
- package/dist/sequencer/sequencer.js +5 -17
- package/dist/sequencer/sequencer.js.map +1 -1
- package/package.json +15 -15
- package/src/account-manager/{index.ts → account-manager.ts} +107 -307
- package/src/account-manager/helpers/device-account.ts +1 -0
- package/src/account-manager/oauth-store.ts +494 -0
- package/src/actor-store/repo/reader.ts +11 -0
- package/src/actor-store/repo/transactor.ts +15 -4
- package/src/api/com/atproto/admin/deleteAccount.ts +2 -3
- package/src/api/com/atproto/admin/sendEmail.ts +3 -5
- package/src/api/com/atproto/admin/updateAccountEmail.ts +1 -2
- package/src/api/com/atproto/admin/updateAccountHandle.ts +7 -8
- package/src/api/com/atproto/admin/updateAccountPassword.ts +1 -2
- package/src/api/com/atproto/identity/requestPlcOperationSignature.ts +3 -5
- package/src/api/com/atproto/identity/resolveHandle.ts +2 -11
- package/src/api/com/atproto/identity/signPlcOperation.ts +3 -5
- package/src/api/com/atproto/identity/updateHandle.ts +7 -13
- package/src/api/com/atproto/repo/applyWrites.ts +21 -11
- package/src/api/com/atproto/repo/createRecord.ts +19 -14
- package/src/api/com/atproto/repo/deleteRecord.ts +26 -14
- package/src/api/com/atproto/repo/listRecords.ts +1 -11
- package/src/api/com/atproto/repo/putRecord.ts +24 -16
- package/src/api/com/atproto/server/activateAccount.ts +5 -20
- package/src/api/com/atproto/server/confirmEmail.ts +3 -5
- package/src/api/com/atproto/server/createAccount.ts +10 -11
- package/src/api/com/atproto/server/createAppPassword.ts +3 -6
- package/src/api/com/atproto/server/createSession.ts +3 -3
- package/src/api/com/atproto/server/deactivateAccount.ts +1 -2
- package/src/api/com/atproto/server/deleteAccount.ts +3 -5
- package/src/api/com/atproto/server/deleteSession.ts +2 -3
- package/src/api/com/atproto/server/getAccountInviteCodes.ts +3 -5
- package/src/api/com/atproto/server/getSession.ts +3 -3
- package/src/api/com/atproto/server/listAppPasswords.ts +3 -5
- package/src/api/com/atproto/server/refreshSession.ts +3 -3
- package/src/api/com/atproto/server/requestAccountDelete.ts +3 -5
- package/src/api/com/atproto/server/requestEmailConfirmation.ts +3 -5
- package/src/api/com/atproto/server/requestEmailUpdate.ts +3 -5
- package/src/api/com/atproto/server/requestPasswordReset.ts +1 -2
- package/src/api/com/atproto/server/resetPassword.ts +1 -2
- package/src/api/com/atproto/server/revokeAppPassword.ts +3 -5
- package/src/api/com/atproto/server/updateEmail.ts +3 -5
- package/src/api/com/atproto/sync/getRecord.ts +1 -4
- package/src/api/com/atproto/sync/getRepoStatus.ts +1 -1
- package/src/api/com/atproto/sync/listRepos.ts +1 -1
- package/src/api/com/atproto/sync/subscribeRepos.ts +2 -9
- package/src/api/com/atproto/temp/checkSignupQueue.ts +2 -2
- package/src/api/proxy.ts +19 -19
- package/src/app-view.ts +24 -0
- package/src/auth-routes.ts +9 -3
- package/src/auth-verifier.ts +1 -1
- package/src/config/config.ts +25 -13
- package/src/config/env.ts +12 -0
- package/src/context.ts +60 -24
- package/src/handle/index.ts +6 -52
- package/src/image/image-url.ts +16 -0
- package/src/index.ts +1 -1
- package/src/lexicon/index.ts +36 -0
- package/src/lexicon/lexicons.ts +243 -84
- package/src/lexicon/types/app/bsky/embed/video.ts +1 -0
- package/src/lexicon/types/app/bsky/labeler/defs.ts +7 -0
- package/src/lexicon/types/app/bsky/labeler/service.ts +7 -0
- package/src/lexicon/types/com/atproto/identity/defs.ts +30 -0
- package/src/lexicon/types/com/atproto/identity/refreshIdentity.ts +52 -0
- package/src/lexicon/types/com/atproto/identity/resolveDid.ts +52 -0
- package/src/lexicon/types/com/atproto/identity/resolveHandle.ts +1 -0
- package/src/lexicon/types/com/atproto/identity/resolveIdentity.ts +48 -0
- package/src/lexicon/types/com/atproto/moderation/defs.ts +3 -0
- package/src/lexicon/types/com/atproto/repo/listRecords.ts +0 -4
- package/src/lexicon/types/com/atproto/sync/getRecord.ts +0 -2
- package/src/lexicon/types/com/atproto/sync/subscribeRepos.ts +0 -59
- package/src/mailer/index.ts +7 -5
- package/src/read-after-write/viewer.ts +1 -1
- package/src/repo/types.ts +7 -2
- package/src/scripts/rebuild-repo.ts +4 -1
- package/src/sequencer/db/schema.ts +1 -8
- package/src/sequencer/events.ts +29 -75
- package/src/sequencer/sequencer.ts +9 -23
- package/tests/account-deletion.test.ts +3 -5
- package/tests/oauth.test.ts +286 -71
- package/tests/sequencer.test.ts +18 -27
- package/tests/sync/subscribe-repos.test.ts +67 -45
- package/tsconfig.build.tsbuildinfo +1 -1
- package/dist/account-manager/index.d.ts.map +0 -1
- package/dist/account-manager/index.js.map +0 -1
- package/dist/actor-store/repo/util.d.ts +0 -5
- package/dist/actor-store/repo/util.d.ts.map +0 -1
- package/dist/actor-store/repo/util.js +0 -25
- package/dist/actor-store/repo/util.js.map +0 -1
- package/dist/oauth/provider.d.ts +0 -10
- package/dist/oauth/provider.d.ts.map +0 -1
- package/dist/oauth/provider.js +0 -38
- package/dist/oauth/provider.js.map +0 -1
- package/src/actor-store/repo/util.ts +0 -22
- package/src/oauth/provider.ts +0 -59
@@ -20,10 +20,6 @@ export interface QueryParams {
|
|
20
20
|
/** The number of records to return. */
|
21
21
|
limit: number
|
22
22
|
cursor?: string
|
23
|
-
/** DEPRECATED: The lowest sort-ordered rkey to start from (exclusive) */
|
24
|
-
rkeyStart?: string
|
25
|
-
/** DEPRECATED: The highest sort-ordered rkey to stop at (exclusive) */
|
26
|
-
rkeyEnd?: string
|
27
23
|
/** Flag to reverse the order of the returned records. */
|
28
24
|
reverse?: boolean
|
29
25
|
}
|
@@ -22,9 +22,6 @@ export type OutputSchema =
|
|
22
22
|
| $Typed<Sync>
|
23
23
|
| $Typed<Identity>
|
24
24
|
| $Typed<Account>
|
25
|
-
| $Typed<Handle>
|
26
|
-
| $Typed<Migrate>
|
27
|
-
| $Typed<Tombstone>
|
28
25
|
| $Typed<Info>
|
29
26
|
| { $type: string }
|
30
27
|
export type HandlerError = ErrorFrame<'FutureCursor' | 'ConsumerTooSlow'>
|
@@ -150,62 +147,6 @@ export function validateAccount<V>(v: V) {
|
|
150
147
|
return validate<Account & V>(v, id, hashAccount)
|
151
148
|
}
|
152
149
|
|
153
|
-
/** DEPRECATED -- Use #identity event instead */
|
154
|
-
export interface Handle {
|
155
|
-
$type?: 'com.atproto.sync.subscribeRepos#handle'
|
156
|
-
seq: number
|
157
|
-
did: string
|
158
|
-
handle: string
|
159
|
-
time: string
|
160
|
-
}
|
161
|
-
|
162
|
-
const hashHandle = 'handle'
|
163
|
-
|
164
|
-
export function isHandle<V>(v: V) {
|
165
|
-
return is$typed(v, id, hashHandle)
|
166
|
-
}
|
167
|
-
|
168
|
-
export function validateHandle<V>(v: V) {
|
169
|
-
return validate<Handle & V>(v, id, hashHandle)
|
170
|
-
}
|
171
|
-
|
172
|
-
/** DEPRECATED -- Use #account event instead */
|
173
|
-
export interface Migrate {
|
174
|
-
$type?: 'com.atproto.sync.subscribeRepos#migrate'
|
175
|
-
seq: number
|
176
|
-
did: string
|
177
|
-
migrateTo: string | null
|
178
|
-
time: string
|
179
|
-
}
|
180
|
-
|
181
|
-
const hashMigrate = 'migrate'
|
182
|
-
|
183
|
-
export function isMigrate<V>(v: V) {
|
184
|
-
return is$typed(v, id, hashMigrate)
|
185
|
-
}
|
186
|
-
|
187
|
-
export function validateMigrate<V>(v: V) {
|
188
|
-
return validate<Migrate & V>(v, id, hashMigrate)
|
189
|
-
}
|
190
|
-
|
191
|
-
/** DEPRECATED -- Use #account event instead */
|
192
|
-
export interface Tombstone {
|
193
|
-
$type?: 'com.atproto.sync.subscribeRepos#tombstone'
|
194
|
-
seq: number
|
195
|
-
did: string
|
196
|
-
time: string
|
197
|
-
}
|
198
|
-
|
199
|
-
const hashTombstone = 'tombstone'
|
200
|
-
|
201
|
-
export function isTombstone<V>(v: V) {
|
202
|
-
return is$typed(v, id, hashTombstone)
|
203
|
-
}
|
204
|
-
|
205
|
-
export function validateTombstone<V>(v: V) {
|
206
|
-
return validate<Tombstone & V>(v, id, hashTombstone)
|
207
|
-
}
|
208
|
-
|
209
150
|
export interface Info {
|
210
151
|
$type?: 'com.atproto.sync.subscribeRepos#info'
|
211
152
|
name: 'OutdatedCursor' | (string & {})
|
package/src/mailer/index.ts
CHANGED
@@ -6,6 +6,8 @@ import { ServerConfig } from '../config'
|
|
6
6
|
import { mailerLogger } from '../logger'
|
7
7
|
import * as templates from './templates'
|
8
8
|
|
9
|
+
// @TODO Add support for i18n
|
10
|
+
|
9
11
|
export class ServerMailer {
|
10
12
|
constructor(
|
11
13
|
public readonly transporter: Transporter<SMTPTransport.SentMessageInfo>,
|
@@ -23,35 +25,35 @@ export class ServerMailer {
|
|
23
25
|
params: { handle: string; token: string },
|
24
26
|
mailOpts: Mail.Options,
|
25
27
|
) {
|
26
|
-
|
28
|
+
await this.sendTemplate('resetPassword', params, {
|
27
29
|
subject: 'Password Reset Requested',
|
28
30
|
...mailOpts,
|
29
31
|
})
|
30
32
|
}
|
31
33
|
|
32
34
|
async sendAccountDelete(params: { token: string }, mailOpts: Mail.Options) {
|
33
|
-
|
35
|
+
await this.sendTemplate('deleteAccount', params, {
|
34
36
|
subject: 'Account Deletion Requested',
|
35
37
|
...mailOpts,
|
36
38
|
})
|
37
39
|
}
|
38
40
|
|
39
41
|
async sendConfirmEmail(params: { token: string }, mailOpts: Mail.Options) {
|
40
|
-
|
42
|
+
await this.sendTemplate('confirmEmail', params, {
|
41
43
|
subject: 'Email Confirmation',
|
42
44
|
...mailOpts,
|
43
45
|
})
|
44
46
|
}
|
45
47
|
|
46
48
|
async sendUpdateEmail(params: { token: string }, mailOpts: Mail.Options) {
|
47
|
-
|
49
|
+
await this.sendTemplate('updateEmail', params, {
|
48
50
|
subject: 'Email Update Requested',
|
49
51
|
...mailOpts,
|
50
52
|
})
|
51
53
|
}
|
52
54
|
|
53
55
|
async sendPlcOperation(params: { token: string }, mailOpts: Mail.Options) {
|
54
|
-
|
56
|
+
await this.sendTemplate('plcOperation', params, {
|
55
57
|
subject: 'PLC Update Operation Requested',
|
56
58
|
...mailOpts,
|
57
59
|
})
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { AtUri, INVALID_HANDLE } from '@atproto/syntax'
|
2
2
|
import { createServiceAuthHeaders } from '@atproto/xrpc-server'
|
3
|
-
import { AccountManager } from '../account-manager'
|
3
|
+
import { AccountManager } from '../account-manager/account-manager'
|
4
4
|
import { ActorStoreReader } from '../actor-store/actor-store-reader'
|
5
5
|
import { BskyAppView } from '../bsky-app-view'
|
6
6
|
import { ImageUrlBuilder } from '../image/image-url-builder'
|
package/src/repo/types.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { CID } from 'multiformats/cid'
|
2
2
|
import { RepoRecord } from '@atproto/lexicon'
|
3
|
-
import {
|
3
|
+
import { BlockMap, CommitData, WriteOpAction } from '@atproto/repo'
|
4
4
|
import { AtUri } from '@atproto/syntax'
|
5
5
|
|
6
6
|
export type ValidationStatus = 'valid' | 'unknown' | undefined
|
@@ -51,12 +51,17 @@ export type CommitOp = {
|
|
51
51
|
|
52
52
|
export type CommitDataWithOps = CommitData & {
|
53
53
|
ops: CommitOp[]
|
54
|
-
blobs: CidSet
|
55
54
|
prevData: CID | null
|
56
55
|
}
|
57
56
|
|
58
57
|
export type PreparedWrite = PreparedCreate | PreparedUpdate | PreparedDelete
|
59
58
|
|
59
|
+
export type SyncEvtData = {
|
60
|
+
cid: CID
|
61
|
+
rev: string
|
62
|
+
blocks: BlockMap
|
63
|
+
}
|
64
|
+
|
60
65
|
export class InvalidRecordError extends Error {}
|
61
66
|
|
62
67
|
export class BadCommitSwapError extends Error {
|
@@ -77,7 +77,10 @@ export const rebuildRepo = async (ctx: AppContext, args: string[]) => {
|
|
77
77
|
}
|
78
78
|
})
|
79
79
|
await ctx.accountManager.updateRepoRoot(did, commit.cid, rev)
|
80
|
-
await ctx.
|
80
|
+
const syncData = await ctx.actorStore.read(did, (store) =>
|
81
|
+
store.repo.getSyncEventData(),
|
82
|
+
)
|
83
|
+
await ctx.sequencer.sequenceSyncEvt(did, syncData)
|
81
84
|
}
|
82
85
|
|
83
86
|
const promptContinue = async (): Promise<boolean> => {
|
@@ -1,13 +1,6 @@
|
|
1
1
|
import { Generated, GeneratedAlways, Insertable, Selectable } from 'kysely'
|
2
2
|
|
3
|
-
export type RepoSeqEventType =
|
4
|
-
| 'append'
|
5
|
-
| 'rebase'
|
6
|
-
| 'handle'
|
7
|
-
| 'migrate'
|
8
|
-
| 'identity'
|
9
|
-
| 'account'
|
10
|
-
| 'tombstone'
|
3
|
+
export type RepoSeqEventType = 'append' | 'sync' | 'identity' | 'account'
|
11
4
|
|
12
5
|
export interface RepoSeq {
|
13
6
|
seq: GeneratedAlways<number>
|
package/src/sequencer/events.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { z } from 'zod'
|
2
2
|
import { cborEncode, noUndefinedVals, schema } from '@atproto/common'
|
3
3
|
import { BlockMap, blocksToCarFile } from '@atproto/repo'
|
4
|
-
import { AccountStatus } from '../account-manager'
|
5
|
-
import { CommitDataWithOps } from '../repo'
|
4
|
+
import { AccountStatus } from '../account-manager/account-manager'
|
5
|
+
import { CommitDataWithOps, SyncEvtData } from '../repo'
|
6
6
|
import { RepoSeqInsert } from './db'
|
7
7
|
|
8
8
|
export const formatSeqCommit = async (
|
@@ -13,41 +13,18 @@ export const formatSeqCommit = async (
|
|
13
13
|
blocksToSend.addMap(commitData.newBlocks)
|
14
14
|
blocksToSend.addMap(commitData.relevantBlocks)
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
tooBig: true,
|
29
|
-
repo: did,
|
30
|
-
commit: commitData.cid,
|
31
|
-
rev: commitData.rev,
|
32
|
-
since: commitData.since,
|
33
|
-
blocks: await blocksToCarFile(commitData.cid, justRoot),
|
34
|
-
ops: [],
|
35
|
-
blobs: [],
|
36
|
-
prevData: commitData.prevData ?? undefined,
|
37
|
-
}
|
38
|
-
} else {
|
39
|
-
evt = {
|
40
|
-
rebase: false,
|
41
|
-
tooBig: false,
|
42
|
-
repo: did,
|
43
|
-
commit: commitData.cid,
|
44
|
-
rev: commitData.rev,
|
45
|
-
since: commitData.since,
|
46
|
-
blocks: await blocksToCarFile(commitData.cid, blocksToSend),
|
47
|
-
ops: commitData.ops,
|
48
|
-
blobs: commitData.blobs.toList(),
|
49
|
-
prevData: commitData.prevData ?? undefined,
|
50
|
-
}
|
16
|
+
const evt = {
|
17
|
+
repo: did,
|
18
|
+
commit: commitData.cid,
|
19
|
+
rev: commitData.rev,
|
20
|
+
since: commitData.since,
|
21
|
+
blocks: await blocksToCarFile(commitData.cid, blocksToSend),
|
22
|
+
ops: commitData.ops,
|
23
|
+
prevData: commitData.prevData ?? undefined,
|
24
|
+
// deprecated (but still required) fields
|
25
|
+
rebase: false,
|
26
|
+
tooBig: false,
|
27
|
+
blobs: [],
|
51
28
|
}
|
52
29
|
|
53
30
|
return {
|
@@ -58,17 +35,19 @@ export const formatSeqCommit = async (
|
|
58
35
|
}
|
59
36
|
}
|
60
37
|
|
61
|
-
export const
|
38
|
+
export const formatSeqSyncEvt = async (
|
62
39
|
did: string,
|
63
|
-
|
40
|
+
data: SyncEvtData,
|
64
41
|
): Promise<RepoSeqInsert> => {
|
65
|
-
const
|
42
|
+
const blocks = await blocksToCarFile(data.cid, data.blocks)
|
43
|
+
const evt: SyncEvt = {
|
66
44
|
did,
|
67
|
-
|
45
|
+
rev: data.rev,
|
46
|
+
blocks,
|
68
47
|
}
|
69
48
|
return {
|
70
49
|
did,
|
71
|
-
eventType: '
|
50
|
+
eventType: 'sync',
|
72
51
|
event: cborEncode(evt),
|
73
52
|
sequencedAt: new Date().toISOString(),
|
74
53
|
}
|
@@ -112,20 +91,6 @@ export const formatSeqAccountEvt = async (
|
|
112
91
|
}
|
113
92
|
}
|
114
93
|
|
115
|
-
export const formatSeqTombstone = async (
|
116
|
-
did: string,
|
117
|
-
): Promise<RepoSeqInsert> => {
|
118
|
-
const evt: TombstoneEvt = {
|
119
|
-
did,
|
120
|
-
}
|
121
|
-
return {
|
122
|
-
did,
|
123
|
-
eventType: 'tombstone',
|
124
|
-
event: cborEncode(evt),
|
125
|
-
sequencedAt: new Date().toISOString(),
|
126
|
-
}
|
127
|
-
}
|
128
|
-
|
129
94
|
export const commitEvtOp = z.object({
|
130
95
|
action: z.union([
|
131
96
|
z.literal('create'),
|
@@ -152,11 +117,12 @@ export const commitEvt = z.object({
|
|
152
117
|
})
|
153
118
|
export type CommitEvt = z.infer<typeof commitEvt>
|
154
119
|
|
155
|
-
export const
|
120
|
+
export const syncEvt = z.object({
|
156
121
|
did: z.string(),
|
157
|
-
|
122
|
+
blocks: schema.bytes,
|
123
|
+
rev: z.string(),
|
158
124
|
})
|
159
|
-
export type
|
125
|
+
export type SyncEvt = z.infer<typeof syncEvt>
|
160
126
|
|
161
127
|
export const identityEvt = z.object({
|
162
128
|
did: z.string(),
|
@@ -178,22 +144,17 @@ export const accountEvt = z.object({
|
|
178
144
|
})
|
179
145
|
export type AccountEvt = z.infer<typeof accountEvt>
|
180
146
|
|
181
|
-
export const tombstoneEvt = z.object({
|
182
|
-
did: z.string(),
|
183
|
-
})
|
184
|
-
export type TombstoneEvt = z.infer<typeof tombstoneEvt>
|
185
|
-
|
186
147
|
type TypedCommitEvt = {
|
187
148
|
type: 'commit'
|
188
149
|
seq: number
|
189
150
|
time: string
|
190
151
|
evt: CommitEvt
|
191
152
|
}
|
192
|
-
type
|
193
|
-
type: '
|
153
|
+
type TypedSyncEvt = {
|
154
|
+
type: 'sync'
|
194
155
|
seq: number
|
195
156
|
time: string
|
196
|
-
evt:
|
157
|
+
evt: SyncEvt
|
197
158
|
}
|
198
159
|
type TypedIdentityEvt = {
|
199
160
|
type: 'identity'
|
@@ -207,15 +168,8 @@ type TypedAccountEvt = {
|
|
207
168
|
time: string
|
208
169
|
evt: AccountEvt
|
209
170
|
}
|
210
|
-
type TypedTombstoneEvt = {
|
211
|
-
type: 'tombstone'
|
212
|
-
seq: number
|
213
|
-
time: string
|
214
|
-
evt: TombstoneEvt
|
215
|
-
}
|
216
171
|
export type SeqEvt =
|
217
172
|
| TypedCommitEvt
|
218
|
-
|
|
173
|
+
| TypedSyncEvt
|
219
174
|
| TypedIdentityEvt
|
220
175
|
| TypedAccountEvt
|
221
|
-
| TypedTombstoneEvt
|
@@ -4,7 +4,7 @@ import { SECOND, cborDecode, wait } from '@atproto/common'
|
|
4
4
|
import { AccountStatus } from '../account-manager/helpers/account'
|
5
5
|
import { Crawlers } from '../crawlers'
|
6
6
|
import { seqLogger as log } from '../logger'
|
7
|
-
import { CommitDataWithOps } from '../repo'
|
7
|
+
import { CommitDataWithOps, SyncEvtData } from '../repo'
|
8
8
|
import {
|
9
9
|
RepoSeqEntry,
|
10
10
|
RepoSeqInsert,
|
@@ -15,15 +15,13 @@ import {
|
|
15
15
|
import {
|
16
16
|
AccountEvt,
|
17
17
|
CommitEvt,
|
18
|
-
HandleEvt,
|
19
18
|
IdentityEvt,
|
20
19
|
SeqEvt,
|
21
|
-
|
20
|
+
SyncEvt,
|
22
21
|
formatSeqAccountEvt,
|
23
22
|
formatSeqCommit,
|
24
|
-
formatSeqHandleUpdate,
|
25
23
|
formatSeqIdentityEvt,
|
26
|
-
|
24
|
+
formatSeqSyncEvt,
|
27
25
|
} from './events'
|
28
26
|
|
29
27
|
export * from './events'
|
@@ -135,19 +133,19 @@ export class Sequencer extends (EventEmitter as new () => SequencerEmitter) {
|
|
135
133
|
continue
|
136
134
|
}
|
137
135
|
const evt = cborDecode(row.event)
|
138
|
-
if (row.eventType === 'append'
|
136
|
+
if (row.eventType === 'append') {
|
139
137
|
seqEvts.push({
|
140
138
|
type: 'commit',
|
141
139
|
seq: row.seq,
|
142
140
|
time: row.sequencedAt,
|
143
141
|
evt: evt as CommitEvt,
|
144
142
|
})
|
145
|
-
} else if (row.eventType === '
|
143
|
+
} else if (row.eventType === 'sync') {
|
146
144
|
seqEvts.push({
|
147
|
-
type: '
|
145
|
+
type: 'sync',
|
148
146
|
seq: row.seq,
|
149
147
|
time: row.sequencedAt,
|
150
|
-
evt: evt as
|
148
|
+
evt: evt as SyncEvt,
|
151
149
|
})
|
152
150
|
} else if (row.eventType === 'identity') {
|
153
151
|
seqEvts.push({
|
@@ -163,13 +161,6 @@ export class Sequencer extends (EventEmitter as new () => SequencerEmitter) {
|
|
163
161
|
time: row.sequencedAt,
|
164
162
|
evt: evt as AccountEvt,
|
165
163
|
})
|
166
|
-
} else if (row.eventType === 'tombstone') {
|
167
|
-
seqEvts.push({
|
168
|
-
type: 'tombstone',
|
169
|
-
seq: row.seq,
|
170
|
-
time: row.sequencedAt,
|
171
|
-
evt: evt as TombstoneEvt,
|
172
|
-
})
|
173
164
|
}
|
174
165
|
}
|
175
166
|
|
@@ -222,8 +213,8 @@ export class Sequencer extends (EventEmitter as new () => SequencerEmitter) {
|
|
222
213
|
return await this.sequenceEvt(evt)
|
223
214
|
}
|
224
215
|
|
225
|
-
async
|
226
|
-
const evt = await
|
216
|
+
async sequenceSyncEvt(did: string, data: SyncEvtData) {
|
217
|
+
const evt = await formatSeqSyncEvt(did, data)
|
227
218
|
return await this.sequenceEvt(evt)
|
228
219
|
}
|
229
220
|
|
@@ -240,11 +231,6 @@ export class Sequencer extends (EventEmitter as new () => SequencerEmitter) {
|
|
240
231
|
return await this.sequenceEvt(evt)
|
241
232
|
}
|
242
233
|
|
243
|
-
async sequenceTombstone(did: string): Promise<number> {
|
244
|
-
const evt = await formatSeqTombstone(did)
|
245
|
-
return await this.sequenceEvt(evt)
|
246
|
-
}
|
247
|
-
|
248
234
|
async deleteAllForUser(did: string, excludingSeqs: number[] = []) {
|
249
235
|
await this.db.executeWithRetry(
|
250
236
|
this.db.db
|
@@ -151,14 +151,12 @@ describe('account deletion', () => {
|
|
151
151
|
expect(
|
152
152
|
updatedDbContents.repoSeqs
|
153
153
|
.filter((row) => row.did === carol.did)
|
154
|
-
.every(
|
155
|
-
(row) => row.eventType === 'tombstone' || row.eventType === 'account',
|
156
|
-
),
|
154
|
+
.every((row) => row.eventType === 'account'),
|
157
155
|
).toBe(true)
|
158
|
-
// check we do have a
|
156
|
+
// check we do have a account (deletion) event for this did
|
159
157
|
expect(
|
160
158
|
updatedDbContents.repoSeqs.filter(
|
161
|
-
(row) => row.did === carol.did && row.eventType === '
|
159
|
+
(row) => row.did === carol.did && row.eventType === 'account',
|
162
160
|
).length,
|
163
161
|
).toEqual(1)
|
164
162
|
expect(updatedDbContents.appPasswords).toEqual(
|