payload 3.0.0-beta.56 → 3.0.0-beta.58
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/dist/admin/RichText.d.ts +3 -3
- package/dist/admin/RichText.d.ts.map +1 -1
- package/dist/admin/RichText.js.map +1 -1
- package/dist/admin/views/types.d.ts +2 -2
- package/dist/admin/views/types.d.ts.map +1 -1
- package/dist/admin/views/types.js.map +1 -1
- package/dist/auth/baseFields/auth.d.ts.map +1 -1
- package/dist/auth/baseFields/auth.js +0 -14
- package/dist/auth/baseFields/auth.js.map +1 -1
- package/dist/auth/baseFields/loginField.d.ts +4 -0
- package/dist/auth/baseFields/loginField.d.ts.map +1 -0
- package/dist/auth/baseFields/loginField.js +35 -0
- package/dist/auth/baseFields/loginField.js.map +1 -0
- package/dist/auth/defaultAccess.d.ts +2 -2
- package/dist/auth/defaultAccess.d.ts.map +1 -1
- package/dist/auth/defaultAccess.js.map +1 -1
- package/dist/auth/executeAccess.d.ts +2 -2
- package/dist/auth/executeAccess.d.ts.map +1 -1
- package/dist/auth/executeAccess.js.map +1 -1
- package/dist/auth/getAccessResults.d.ts +2 -2
- package/dist/auth/getAccessResults.d.ts.map +1 -1
- package/dist/auth/getAccessResults.js.map +1 -1
- package/dist/auth/getFieldsToSign.d.ts +2 -2
- package/dist/auth/getFieldsToSign.d.ts.map +1 -1
- package/dist/auth/getFieldsToSign.js.map +1 -1
- package/dist/auth/operations/access.d.ts +2 -2
- package/dist/auth/operations/access.d.ts.map +1 -1
- package/dist/auth/operations/access.js.map +1 -1
- package/dist/auth/operations/auth.d.ts +2 -2
- package/dist/auth/operations/auth.d.ts.map +1 -1
- package/dist/auth/operations/auth.js.map +1 -1
- package/dist/auth/operations/forgotPassword.d.ts +7 -7
- package/dist/auth/operations/forgotPassword.d.ts.map +1 -1
- package/dist/auth/operations/forgotPassword.js +11 -6
- package/dist/auth/operations/forgotPassword.js.map +1 -1
- package/dist/auth/operations/init.d.ts +2 -2
- package/dist/auth/operations/init.d.ts.map +1 -1
- package/dist/auth/operations/init.js.map +1 -1
- package/dist/auth/operations/local/auth.js.map +1 -1
- package/dist/auth/operations/local/forgotPassword.d.ts +2 -2
- package/dist/auth/operations/local/forgotPassword.d.ts.map +1 -1
- package/dist/auth/operations/local/forgotPassword.js.map +1 -1
- package/dist/auth/operations/local/login.d.ts +4 -7
- package/dist/auth/operations/local/login.d.ts.map +1 -1
- package/dist/auth/operations/local/login.js.map +1 -1
- package/dist/auth/operations/local/resetPassword.d.ts +2 -2
- package/dist/auth/operations/local/resetPassword.d.ts.map +1 -1
- package/dist/auth/operations/local/resetPassword.js.map +1 -1
- package/dist/auth/operations/local/unlock.d.ts +2 -2
- package/dist/auth/operations/local/unlock.d.ts.map +1 -1
- package/dist/auth/operations/local/unlock.js.map +1 -1
- package/dist/auth/operations/local/verifyEmail.d.ts +2 -2
- package/dist/auth/operations/local/verifyEmail.d.ts.map +1 -1
- package/dist/auth/operations/local/verifyEmail.js.map +1 -1
- package/dist/auth/operations/login.d.ts +6 -9
- package/dist/auth/operations/login.d.ts.map +1 -1
- package/dist/auth/operations/login.js +23 -5
- package/dist/auth/operations/login.js.map +1 -1
- package/dist/auth/operations/logout.d.ts +2 -2
- package/dist/auth/operations/logout.d.ts.map +1 -1
- package/dist/auth/operations/logout.js.map +1 -1
- package/dist/auth/operations/me.d.ts +2 -2
- package/dist/auth/operations/me.d.ts.map +1 -1
- package/dist/auth/operations/me.js.map +1 -1
- package/dist/auth/operations/refresh.d.ts +2 -2
- package/dist/auth/operations/refresh.d.ts.map +1 -1
- package/dist/auth/operations/refresh.js.map +1 -1
- package/dist/auth/operations/registerFirstUser.d.ts +4 -7
- package/dist/auth/operations/registerFirstUser.d.ts.map +1 -1
- package/dist/auth/operations/registerFirstUser.js.map +1 -1
- package/dist/auth/operations/resetPassword.d.ts +2 -2
- package/dist/auth/operations/resetPassword.d.ts.map +1 -1
- package/dist/auth/operations/resetPassword.js.map +1 -1
- package/dist/auth/operations/unlock.d.ts +2 -2
- package/dist/auth/operations/unlock.d.ts.map +1 -1
- package/dist/auth/operations/unlock.js.map +1 -1
- package/dist/auth/operations/verifyEmail.d.ts +2 -2
- package/dist/auth/operations/verifyEmail.d.ts.map +1 -1
- package/dist/auth/operations/verifyEmail.js.map +1 -1
- package/dist/auth/sendVerificationEmail.d.ts +2 -2
- package/dist/auth/sendVerificationEmail.d.ts.map +1 -1
- package/dist/auth/sendVerificationEmail.js.map +1 -1
- package/dist/auth/strategies/local/incrementLoginAttempts.d.ts +2 -2
- package/dist/auth/strategies/local/incrementLoginAttempts.d.ts.map +1 -1
- package/dist/auth/strategies/local/incrementLoginAttempts.js.map +1 -1
- package/dist/auth/strategies/local/register.d.ts +2 -2
- package/dist/auth/strategies/local/register.d.ts.map +1 -1
- package/dist/auth/strategies/local/register.js +10 -2
- package/dist/auth/strategies/local/register.js.map +1 -1
- package/dist/auth/strategies/local/resetLoginAttempts.d.ts +2 -2
- package/dist/auth/strategies/local/resetLoginAttempts.d.ts.map +1 -1
- package/dist/auth/strategies/local/resetLoginAttempts.js.map +1 -1
- package/dist/auth/types.d.ts +16 -14
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/auth/types.js.map +1 -1
- package/dist/collections/config/client.d.ts +1 -1
- package/dist/collections/config/client.d.ts.map +1 -1
- package/dist/collections/config/defaults.d.ts +6 -5
- package/dist/collections/config/defaults.d.ts.map +1 -1
- package/dist/collections/config/defaults.js +1 -0
- package/dist/collections/config/defaults.js.map +1 -1
- package/dist/collections/config/sanitize.d.ts.map +1 -1
- package/dist/collections/config/sanitize.js +3 -0
- package/dist/collections/config/sanitize.js.map +1 -1
- package/dist/collections/config/schema.d.ts.map +1 -1
- package/dist/collections/config/schema.js +1 -0
- package/dist/collections/config/schema.js.map +1 -1
- package/dist/collections/config/types.d.ts +17 -16
- package/dist/collections/config/types.d.ts.map +1 -1
- package/dist/collections/config/types.js.map +1 -1
- package/dist/collections/dataloader.d.ts.map +1 -1
- package/dist/collections/dataloader.js +1 -1
- package/dist/collections/dataloader.js.map +1 -1
- package/dist/collections/operations/count.d.ts +2 -2
- package/dist/collections/operations/count.d.ts.map +1 -1
- package/dist/collections/operations/count.js.map +1 -1
- package/dist/collections/operations/create.d.ts +2 -2
- package/dist/collections/operations/create.d.ts.map +1 -1
- package/dist/collections/operations/create.js.map +1 -1
- package/dist/collections/operations/delete.d.ts +2 -2
- package/dist/collections/operations/delete.d.ts.map +1 -1
- package/dist/collections/operations/delete.js.map +1 -1
- package/dist/collections/operations/deleteByID.d.ts +2 -2
- package/dist/collections/operations/deleteByID.d.ts.map +1 -1
- package/dist/collections/operations/deleteByID.js.map +1 -1
- package/dist/collections/operations/docAccess.d.ts +2 -2
- package/dist/collections/operations/docAccess.d.ts.map +1 -1
- package/dist/collections/operations/docAccess.js.map +1 -1
- package/dist/collections/operations/duplicate.d.ts +2 -2
- package/dist/collections/operations/duplicate.d.ts.map +1 -1
- package/dist/collections/operations/duplicate.js.map +1 -1
- package/dist/collections/operations/find.d.ts +2 -2
- package/dist/collections/operations/find.d.ts.map +1 -1
- package/dist/collections/operations/find.js.map +1 -1
- package/dist/collections/operations/findByID.d.ts +2 -2
- package/dist/collections/operations/findByID.d.ts.map +1 -1
- package/dist/collections/operations/findByID.js.map +1 -1
- package/dist/collections/operations/findVersionByID.d.ts +2 -2
- package/dist/collections/operations/findVersionByID.d.ts.map +1 -1
- package/dist/collections/operations/findVersionByID.js.map +1 -1
- package/dist/collections/operations/findVersions.d.ts +2 -2
- package/dist/collections/operations/findVersions.d.ts.map +1 -1
- package/dist/collections/operations/findVersions.js.map +1 -1
- package/dist/collections/operations/local/count.d.ts +2 -2
- package/dist/collections/operations/local/count.d.ts.map +1 -1
- package/dist/collections/operations/local/count.js.map +1 -1
- package/dist/collections/operations/local/create.d.ts +2 -2
- package/dist/collections/operations/local/create.d.ts.map +1 -1
- package/dist/collections/operations/local/create.js.map +1 -1
- package/dist/collections/operations/local/delete.d.ts +2 -2
- package/dist/collections/operations/local/delete.d.ts.map +1 -1
- package/dist/collections/operations/local/delete.js.map +1 -1
- package/dist/collections/operations/local/duplicate.d.ts +2 -2
- package/dist/collections/operations/local/duplicate.d.ts.map +1 -1
- package/dist/collections/operations/local/duplicate.js.map +1 -1
- package/dist/collections/operations/local/find.d.ts +2 -2
- package/dist/collections/operations/local/find.d.ts.map +1 -1
- package/dist/collections/operations/local/find.js.map +1 -1
- package/dist/collections/operations/local/findByID.d.ts +2 -2
- package/dist/collections/operations/local/findByID.d.ts.map +1 -1
- package/dist/collections/operations/local/findByID.js.map +1 -1
- package/dist/collections/operations/local/findVersionByID.d.ts +2 -2
- package/dist/collections/operations/local/findVersionByID.d.ts.map +1 -1
- package/dist/collections/operations/local/findVersionByID.js.map +1 -1
- package/dist/collections/operations/local/findVersions.d.ts +2 -2
- package/dist/collections/operations/local/findVersions.d.ts.map +1 -1
- package/dist/collections/operations/local/findVersions.js.map +1 -1
- package/dist/collections/operations/local/restoreVersion.d.ts +2 -2
- package/dist/collections/operations/local/restoreVersion.d.ts.map +1 -1
- package/dist/collections/operations/local/restoreVersion.js.map +1 -1
- package/dist/collections/operations/local/update.d.ts +2 -2
- package/dist/collections/operations/local/update.d.ts.map +1 -1
- package/dist/collections/operations/local/update.js.map +1 -1
- package/dist/collections/operations/restoreVersion.d.ts +2 -2
- package/dist/collections/operations/restoreVersion.d.ts.map +1 -1
- package/dist/collections/operations/restoreVersion.js.map +1 -1
- package/dist/collections/operations/update.d.ts +2 -2
- package/dist/collections/operations/update.d.ts.map +1 -1
- package/dist/collections/operations/update.js.map +1 -1
- package/dist/collections/operations/updateByID.d.ts +2 -2
- package/dist/collections/operations/updateByID.d.ts.map +1 -1
- package/dist/collections/operations/updateByID.js.map +1 -1
- package/dist/collections/operations/utils.d.ts +2 -2
- package/dist/collections/operations/utils.d.ts.map +1 -1
- package/dist/collections/operations/utils.js.map +1 -1
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +4 -2
- package/dist/config/schema.js.map +1 -1
- package/dist/config/types.d.ts +14 -4
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js.map +1 -1
- package/dist/database/migrations/migrate.js.map +1 -1
- package/dist/database/migrations/migrateDown.js.map +1 -1
- package/dist/database/migrations/migrateRefresh.js.map +1 -1
- package/dist/database/migrations/migrateReset.js.map +1 -1
- package/dist/database/queryValidation/validateQueryPaths.d.ts +2 -2
- package/dist/database/queryValidation/validateQueryPaths.d.ts.map +1 -1
- package/dist/database/queryValidation/validateQueryPaths.js +3 -3
- package/dist/database/queryValidation/validateQueryPaths.js.map +1 -1
- package/dist/database/queryValidation/validateSearchParams.d.ts +2 -2
- package/dist/database/queryValidation/validateSearchParams.d.ts.map +1 -1
- package/dist/database/queryValidation/validateSearchParams.js.map +1 -1
- package/dist/database/types.d.ts +20 -20
- package/dist/database/types.d.ts.map +1 -1
- package/dist/database/types.js.map +1 -1
- package/dist/errors/AuthenticationError.d.ts +1 -1
- package/dist/errors/AuthenticationError.d.ts.map +1 -1
- package/dist/errors/AuthenticationError.js +2 -2
- package/dist/errors/AuthenticationError.js.map +1 -1
- package/dist/fields/config/client.d.ts +84 -2
- package/dist/fields/config/client.d.ts.map +1 -1
- package/dist/fields/config/client.js +2 -1
- package/dist/fields/config/client.js.map +1 -1
- package/dist/fields/config/schema.d.ts.map +1 -1
- package/dist/fields/config/schema.js +1 -0
- package/dist/fields/config/schema.js.map +1 -1
- package/dist/fields/config/types.d.ts +19 -7
- package/dist/fields/config/types.d.ts.map +1 -1
- package/dist/fields/config/types.js.map +1 -1
- package/dist/fields/getDefaultValue.d.ts +2 -2
- package/dist/fields/getDefaultValue.d.ts.map +1 -1
- package/dist/fields/getDefaultValue.js.map +1 -1
- package/dist/fields/hooks/afterChange/index.d.ts +2 -2
- package/dist/fields/hooks/afterChange/index.d.ts.map +1 -1
- package/dist/fields/hooks/afterChange/index.js.map +1 -1
- package/dist/fields/hooks/afterChange/promise.d.ts +2 -2
- package/dist/fields/hooks/afterChange/promise.d.ts.map +1 -1
- package/dist/fields/hooks/afterChange/promise.js.map +1 -1
- package/dist/fields/hooks/afterChange/traverseFields.d.ts +2 -2
- package/dist/fields/hooks/afterChange/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/afterChange/traverseFields.js.map +1 -1
- package/dist/fields/hooks/afterRead/index.d.ts +2 -2
- package/dist/fields/hooks/afterRead/index.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/index.js.map +1 -1
- package/dist/fields/hooks/afterRead/promise.d.ts +2 -2
- package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/promise.js.map +1 -1
- package/dist/fields/hooks/afterRead/relationshipPopulationPromise.d.ts +2 -2
- package/dist/fields/hooks/afterRead/relationshipPopulationPromise.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/relationshipPopulationPromise.js.map +1 -1
- package/dist/fields/hooks/afterRead/traverseFields.d.ts +2 -2
- package/dist/fields/hooks/afterRead/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/traverseFields.js.map +1 -1
- package/dist/fields/hooks/beforeChange/index.d.ts +2 -2
- package/dist/fields/hooks/beforeChange/index.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/index.js.map +1 -1
- package/dist/fields/hooks/beforeChange/promise.d.ts +2 -2
- package/dist/fields/hooks/beforeChange/promise.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/promise.js.map +1 -1
- package/dist/fields/hooks/beforeChange/traverseFields.d.ts +2 -2
- package/dist/fields/hooks/beforeChange/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/traverseFields.js.map +1 -1
- package/dist/fields/hooks/beforeValidate/index.d.ts +2 -2
- package/dist/fields/hooks/beforeValidate/index.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/index.js.map +1 -1
- package/dist/fields/hooks/beforeValidate/promise.d.ts +2 -2
- package/dist/fields/hooks/beforeValidate/promise.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/promise.js.map +1 -1
- package/dist/fields/hooks/beforeValidate/traverseFields.d.ts +2 -2
- package/dist/fields/hooks/beforeValidate/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/traverseFields.js.map +1 -1
- package/dist/fields/validations.d.ts +5 -1
- package/dist/fields/validations.d.ts.map +1 -1
- package/dist/globals/config/types.d.ts +7 -7
- package/dist/globals/config/types.d.ts.map +1 -1
- package/dist/globals/config/types.js.map +1 -1
- package/dist/globals/operations/docAccess.d.ts +2 -2
- package/dist/globals/operations/docAccess.d.ts.map +1 -1
- package/dist/globals/operations/docAccess.js.map +1 -1
- package/dist/globals/operations/findOne.d.ts +2 -2
- package/dist/globals/operations/findOne.d.ts.map +1 -1
- package/dist/globals/operations/findOne.js.map +1 -1
- package/dist/globals/operations/findVersionByID.d.ts +2 -2
- package/dist/globals/operations/findVersionByID.d.ts.map +1 -1
- package/dist/globals/operations/findVersionByID.js.map +1 -1
- package/dist/globals/operations/findVersions.d.ts +2 -2
- package/dist/globals/operations/findVersions.d.ts.map +1 -1
- package/dist/globals/operations/findVersions.js.map +1 -1
- package/dist/globals/operations/local/findOne.d.ts +2 -2
- package/dist/globals/operations/local/findOne.d.ts.map +1 -1
- package/dist/globals/operations/local/findOne.js.map +1 -1
- package/dist/globals/operations/local/findVersionByID.d.ts +2 -2
- package/dist/globals/operations/local/findVersionByID.d.ts.map +1 -1
- package/dist/globals/operations/local/findVersionByID.js.map +1 -1
- package/dist/globals/operations/local/findVersions.d.ts +2 -2
- package/dist/globals/operations/local/findVersions.d.ts.map +1 -1
- package/dist/globals/operations/local/findVersions.js.map +1 -1
- package/dist/globals/operations/local/restoreVersion.d.ts +2 -2
- package/dist/globals/operations/local/restoreVersion.d.ts.map +1 -1
- package/dist/globals/operations/local/restoreVersion.js.map +1 -1
- package/dist/globals/operations/local/update.d.ts +2 -2
- package/dist/globals/operations/local/update.d.ts.map +1 -1
- package/dist/globals/operations/local/update.js.map +1 -1
- package/dist/globals/operations/restoreVersion.d.ts +2 -2
- package/dist/globals/operations/restoreVersion.d.ts.map +1 -1
- package/dist/globals/operations/restoreVersion.js.map +1 -1
- package/dist/globals/operations/update.d.ts +2 -2
- package/dist/globals/operations/update.d.ts.map +1 -1
- package/dist/globals/operations/update.js.map +1 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/preferences/deleteUserPreferences.d.ts +2 -2
- package/dist/preferences/deleteUserPreferences.d.ts.map +1 -1
- package/dist/preferences/deleteUserPreferences.js.map +1 -1
- package/dist/preferences/requestHandlers/delete.js.map +1 -1
- package/dist/preferences/requestHandlers/findOne.js.map +1 -1
- package/dist/preferences/requestHandlers/update.js.map +1 -1
- package/dist/preferences/types.d.ts +3 -3
- package/dist/preferences/types.d.ts.map +1 -1
- package/dist/preferences/types.js.map +1 -1
- package/dist/types/index.d.ts +14 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/uploads/deleteAssociatedFiles.d.ts +2 -2
- package/dist/uploads/deleteAssociatedFiles.d.ts.map +1 -1
- package/dist/uploads/deleteAssociatedFiles.js.map +1 -1
- package/dist/uploads/docWithFilenameExists.d.ts +2 -2
- package/dist/uploads/docWithFilenameExists.d.ts.map +1 -1
- package/dist/uploads/docWithFilenameExists.js.map +1 -1
- package/dist/uploads/generateFileData.d.ts +2 -2
- package/dist/uploads/generateFileData.d.ts.map +1 -1
- package/dist/uploads/generateFileData.js.map +1 -1
- package/dist/uploads/getExternalFile.d.ts +2 -2
- package/dist/uploads/getExternalFile.d.ts.map +1 -1
- package/dist/uploads/getExternalFile.js.map +1 -1
- package/dist/uploads/getFileByPath.d.ts +2 -2
- package/dist/uploads/getFileByPath.d.ts.map +1 -1
- package/dist/uploads/getFileByPath.js.map +1 -1
- package/dist/uploads/getImageSize.d.ts +2 -2
- package/dist/uploads/getImageSize.d.ts.map +1 -1
- package/dist/uploads/getImageSize.js.map +1 -1
- package/dist/uploads/getSafeFilename.d.ts +2 -2
- package/dist/uploads/getSafeFilename.d.ts.map +1 -1
- package/dist/uploads/getSafeFilename.js.map +1 -1
- package/dist/uploads/imageResizer.d.ts +3 -3
- package/dist/uploads/imageResizer.d.ts.map +1 -1
- package/dist/uploads/imageResizer.js.map +1 -1
- package/dist/uploads/types.d.ts +2 -2
- package/dist/uploads/types.d.ts.map +1 -1
- package/dist/uploads/types.js.map +1 -1
- package/dist/uploads/unlinkTempFiles.d.ts +2 -2
- package/dist/uploads/unlinkTempFiles.d.ts.map +1 -1
- package/dist/uploads/unlinkTempFiles.js.map +1 -1
- package/dist/uploads/uploadFiles.d.ts +2 -2
- package/dist/uploads/uploadFiles.d.ts.map +1 -1
- package/dist/uploads/uploadFiles.js.map +1 -1
- package/dist/utilities/commitTransaction.d.ts +2 -2
- package/dist/utilities/commitTransaction.d.ts.map +1 -1
- package/dist/utilities/commitTransaction.js.map +1 -1
- package/dist/utilities/configToJSONSchema.d.ts +1 -0
- package/dist/utilities/configToJSONSchema.d.ts.map +1 -1
- package/dist/utilities/configToJSONSchema.js +104 -4
- package/dist/utilities/configToJSONSchema.js.map +1 -1
- package/dist/utilities/configToJSONSchema.spec.js +58 -0
- package/dist/utilities/configToJSONSchema.spec.js.map +1 -1
- package/dist/utilities/createLocalReq.d.ts +3 -3
- package/dist/utilities/createLocalReq.d.ts.map +1 -1
- package/dist/utilities/createLocalReq.js.map +1 -1
- package/dist/utilities/getEntityPolicies.d.ts +2 -2
- package/dist/utilities/getEntityPolicies.d.ts.map +1 -1
- package/dist/utilities/getEntityPolicies.js.map +1 -1
- package/dist/utilities/initTransaction.d.ts +2 -2
- package/dist/utilities/initTransaction.d.ts.map +1 -1
- package/dist/utilities/initTransaction.js.map +1 -1
- package/dist/utilities/isEntityHidden.d.ts +2 -2
- package/dist/utilities/isEntityHidden.d.ts.map +1 -1
- package/dist/utilities/isEntityHidden.js.map +1 -1
- package/dist/utilities/killTransaction.d.ts +2 -2
- package/dist/utilities/killTransaction.d.ts.map +1 -1
- package/dist/utilities/killTransaction.js.map +1 -1
- package/dist/utilities/telemetry/events/adminInit.d.ts +2 -2
- package/dist/utilities/telemetry/events/adminInit.d.ts.map +1 -1
- package/dist/utilities/telemetry/events/adminInit.js.map +1 -1
- package/dist/versions/deleteCollectionVersions.d.ts +2 -2
- package/dist/versions/deleteCollectionVersions.d.ts.map +1 -1
- package/dist/versions/deleteCollectionVersions.js.map +1 -1
- package/dist/versions/drafts/replaceWithDraftIfAvailable.d.ts +2 -2
- package/dist/versions/drafts/replaceWithDraftIfAvailable.d.ts.map +1 -1
- package/dist/versions/drafts/replaceWithDraftIfAvailable.js.map +1 -1
- package/dist/versions/enforceMaxVersions.d.ts +2 -2
- package/dist/versions/enforceMaxVersions.d.ts.map +1 -1
- package/dist/versions/enforceMaxVersions.js.map +1 -1
- package/dist/versions/getLatestCollectionVersion.d.ts +2 -2
- package/dist/versions/getLatestCollectionVersion.d.ts.map +1 -1
- package/dist/versions/getLatestCollectionVersion.js.map +1 -1
- package/dist/versions/getLatestGlobalVersion.d.ts +2 -2
- package/dist/versions/getLatestGlobalVersion.d.ts.map +1 -1
- package/dist/versions/getLatestGlobalVersion.js.map +1 -1
- package/dist/versions/saveVersion.d.ts +2 -2
- package/dist/versions/saveVersion.d.ts.map +1 -1
- package/dist/versions/saveVersion.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/auth/operations/refresh.ts"],"sourcesContent":["import jwt from 'jsonwebtoken'\nimport url from 'url'\n\nimport type { BeforeOperationHook, Collection } from '../../collections/config/types.js'\nimport type { Document,
|
|
1
|
+
{"version":3,"sources":["../../../src/auth/operations/refresh.ts"],"sourcesContent":["import jwt from 'jsonwebtoken'\nimport url from 'url'\n\nimport type { BeforeOperationHook, Collection } from '../../collections/config/types.js'\nimport type { Document, PayloadRequest } from '../../types/index.js'\n\nimport { buildAfterOperation } from '../../collections/operations/utils.js'\nimport { Forbidden } from '../../errors/index.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { getFieldsToSign } from '../getFieldsToSign.js'\n\nexport type Result = {\n exp: number\n refreshedToken: string\n setCookie?: boolean\n strategy?: string\n user: Document\n}\n\nexport type Arguments = {\n collection: Collection\n req: PayloadRequest\n}\n\nexport const refreshOperation = async (incomingArgs: Arguments): Promise<Result> => {\n let args = incomingArgs\n\n try {\n const shouldCommit = await initTransaction(args.req)\n\n // /////////////////////////////////////\n // beforeOperation - Collection\n // /////////////////////////////////////\n\n await args.collection.config.hooks.beforeOperation.reduce(\n async (priorHook: BeforeOperationHook | Promise<void>, hook: BeforeOperationHook) => {\n await priorHook\n\n args =\n (await hook({\n args,\n collection: args.collection?.config,\n context: args.req.context,\n operation: 'refresh',\n req: args.req,\n })) || args\n },\n Promise.resolve(),\n )\n\n // /////////////////////////////////////\n // Refresh\n // /////////////////////////////////////\n\n const {\n collection: { config: collectionConfig },\n req,\n req: {\n payload: { config, secret },\n },\n } = args\n\n if (!args.req.user) throw new Forbidden(args.req.t)\n\n const parsedURL = url.parse(args.req.url)\n const isGraphQL = parsedURL.pathname === config.routes.graphQL\n\n const user = await args.req.payload.findByID({\n id: args.req.user.id,\n collection: args.req.user.collection,\n depth: isGraphQL ? 0 : args.collection.config.auth.depth,\n req: args.req,\n })\n\n let result: Result\n\n // /////////////////////////////////////\n // refresh hook - Collection\n // /////////////////////////////////////\n\n for (const refreshHook of args.collection.config.hooks.refresh) {\n const hookResult = await refreshHook({ args, user })\n\n if (hookResult) {\n result = hookResult\n break\n }\n }\n\n if (!result) {\n const fieldsToSign = getFieldsToSign({\n collectionConfig,\n email: user?.email as string,\n user: args?.req?.user,\n })\n\n const refreshedToken = jwt.sign(fieldsToSign, secret, {\n expiresIn: collectionConfig.auth.tokenExpiration,\n })\n\n const exp = (jwt.decode(refreshedToken) as Record<string, unknown>).exp as number\n\n result = {\n exp,\n refreshedToken,\n setCookie: true,\n strategy: args.req.user._strategy,\n user,\n }\n }\n\n // /////////////////////////////////////\n // After Refresh - Collection\n // /////////////////////////////////////\n\n await collectionConfig.hooks.afterRefresh.reduce(async (priorHook, hook) => {\n await priorHook\n\n result =\n (await hook({\n collection: args.collection?.config,\n context: args.req.context,\n exp: result.exp,\n req: args.req,\n token: result.refreshedToken,\n })) || result\n }, Promise.resolve())\n\n // /////////////////////////////////////\n // afterOperation - Collection\n // /////////////////////////////////////\n\n result = await buildAfterOperation({\n args,\n collection: args.collection?.config,\n operation: 'refresh',\n result,\n })\n\n // /////////////////////////////////////\n // Return results\n // /////////////////////////////////////\n\n if (shouldCommit) await commitTransaction(req)\n\n return result\n } catch (error: unknown) {\n await killTransaction(args.req)\n throw error\n }\n}\n"],"names":["jwt","url","buildAfterOperation","Forbidden","commitTransaction","initTransaction","killTransaction","getFieldsToSign","refreshOperation","incomingArgs","args","shouldCommit","req","collection","config","hooks","beforeOperation","reduce","priorHook","hook","context","operation","Promise","resolve","collectionConfig","payload","secret","user","t","parsedURL","parse","isGraphQL","pathname","routes","graphQL","findByID","id","depth","auth","result","refreshHook","refresh","hookResult","fieldsToSign","email","refreshedToken","sign","expiresIn","tokenExpiration","exp","decode","setCookie","strategy","_strategy","afterRefresh","token","error"],"mappings":"AAAA,OAAOA,SAAS,eAAc;AAC9B,OAAOC,SAAS,MAAK;AAKrB,SAASC,mBAAmB,QAAQ,wCAAuC;AAC3E,SAASC,SAAS,QAAQ,wBAAuB;AACjD,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,wBAAuB;AAevD,OAAO,MAAMC,mBAAmB,OAAOC;IACrC,IAAIC,OAAOD;IAEX,IAAI;QACF,MAAME,eAAe,MAAMN,gBAAg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
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import type { Collection, DataFromCollectionSlug, RequiredDataFromCollectionSlug } from '../../collections/config/types.js';
|
|
1
|
+
import type { AuthOperationsFromCollectionSlug, Collection, DataFromCollectionSlug, RequiredDataFromCollectionSlug } from '../../collections/config/types.js';
|
|
2
2
|
import type { CollectionSlug } from '../../index.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PayloadRequest } from '../../types/index.js';
|
|
4
4
|
export type Arguments<TSlug extends CollectionSlug> = {
|
|
5
5
|
collection: Collection;
|
|
6
|
-
data: RequiredDataFromCollectionSlug<TSlug> &
|
|
7
|
-
|
|
8
|
-
password: string;
|
|
9
|
-
};
|
|
10
|
-
req: PayloadRequestWithData;
|
|
6
|
+
data: RequiredDataFromCollectionSlug<TSlug> & AuthOperationsFromCollectionSlug<TSlug>['registerFirstUser'];
|
|
7
|
+
req: PayloadRequest;
|
|
11
8
|
};
|
|
12
9
|
export type Result<TData> = {
|
|
13
10
|
exp?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerFirstUser.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/registerFirstUser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,sBAAsB,EACtB,8BAA8B,EAC/B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"registerFirstUser.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/registerFirstUser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gCAAgC,EAChC,UAAU,EACV,sBAAsB,EACtB,8BAA8B,EAC/B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAO1D,MAAM,MAAM,SAAS,CAAC,KAAK,SAAS,cAAc,IAAI;IACpD,UAAU,EAAE,UAAU,CAAA;IACtB,IAAI,EAAE,8BAA8B,CAAC,KAAK,CAAC,GACzC,gCAAgC,CAAC,KAAK,CAAC,CAAC,mBAAmB,CAAC,CAAA;IAC9D,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,MAAM,CAAC,KAAK,IAAI;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,KAAK,CAAA;CACb,CAAA;AAED,eAAO,MAAM,0BAA0B,GAAU,KAAK,SAAS,cAAc,QACrE,SAAS,CAAC,KAAK,CAAC,KACrB,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAoE/C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/auth/operations/registerFirstUser.ts"],"sourcesContent":["import type {\n Collection,\n DataFromCollectionSlug,\n RequiredDataFromCollectionSlug,\n} from '../../collections/config/types.js'\nimport type { CollectionSlug } from '../../index.js'\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../src/auth/operations/registerFirstUser.ts"],"sourcesContent":["import type {\n AuthOperationsFromCollectionSlug,\n Collection,\n DataFromCollectionSlug,\n RequiredDataFromCollectionSlug,\n} from '../../collections/config/types.js'\nimport type { CollectionSlug } from '../../index.js'\nimport type { PayloadRequest } from '../../types/index.js'\n\nimport { Forbidden } from '../../errors/index.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\n\nexport type Arguments<TSlug extends CollectionSlug> = {\n collection: Collection\n data: RequiredDataFromCollectionSlug<TSlug> &\n AuthOperationsFromCollectionSlug<TSlug>['registerFirstUser']\n req: PayloadRequest\n}\n\nexport type Result<TData> = {\n exp?: number\n token?: string\n user?: TData\n}\n\nexport const registerFirstUserOperation = async <TSlug extends CollectionSlug>(\n args: Arguments<TSlug>,\n): Promise<Result<DataFromCollectionSlug<TSlug>>> => {\n const {\n collection: {\n config,\n config: {\n slug,\n auth: { verify },\n },\n },\n data,\n req,\n req: { payload },\n } = args\n\n try {\n const shouldCommit = await initTransaction(req)\n\n const doc = await payload.db.findOne({\n collection: config.slug,\n req,\n })\n\n if (doc) throw new Forbidden(req.t)\n\n // /////////////////////////////////////\n // Register first user\n // /////////////////////////////////////\n\n const result = await payload.create<TSlug>({\n collection: slug as TSlug,\n data,\n overrideAccess: true,\n req,\n })\n\n // auto-verify (if applicable)\n if (verify) {\n await payload.update({\n id: result.id,\n collection: slug,\n data: {\n _verified: true,\n },\n req,\n })\n }\n\n // /////////////////////////////////////\n // Log in new user\n // /////////////////////////////////////\n\n const { exp, token } = await payload.login({\n ...args,\n collection: slug,\n req,\n })\n\n if (shouldCommit) await commitTransaction(req)\n\n return {\n exp,\n token,\n user: result,\n }\n } catch (error: unknown) {\n await killTransaction(req)\n throw error\n }\n}\n"],"names":["Forbidden","commitTransaction","initTransaction","killTransaction","registerFirstUserOperation","args","collection","config","slug","auth","verify","data","req","payload","shouldCommit","doc","db","findOne","t","result","create","overrideAccess","update","id","_verified","exp","token","login","user","error"],"mappings":"AASA,SAASA,SAAS,QAAQ,wBAAuB;AACjD,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AAepE,OAAO,MAAMC,6BAA6B,OACxCC;IAEA,MAAM,EACJC,YAAY,EACVC,MAAM,EACNA,QAAQ,EACNC,IAAI,EACJC,MAAM,EAAEC,MAAM,EAAE,EACjB,EACF,EACDC,IAAI,EACJC,GAAG,EACHA,KAAK,EAAEC,OAAO,EAAE,EACjB,GAAGR;IAEJ,IAAI;QACF,MAAMS,eAAe,MAAMZ,gBAAgBU;QAE3C,MAAMG,MAAM,MAAMF,QAAQG,EAAE,CAACC,OAAO,CAAC;YACnCX,YAAYC,OAAOC,IAAI;YACvBI;QACF;QAEA,IAAIG,KAAK,MAAM,IAAIf,UAAUY,IAAIM,CAAC;QAElC,wCAAwC;QACxC,sBAAsB;QACtB,wCAAwC;QAExC,MAAMC,SAAS,MAAMN,QAAQO,MAAM,CAAQ;YACzCd,YAAYE;YACZG;YACAU,gBAAgB;YAChBT;QACF;QAEA,8BAA8B;QAC9B,IAAIF,QAAQ;YACV,MAAMG,QAAQS,MAAM,CAAC;gBACnBC,IAAIJ,OAAOI,EAAE;gBACbjB,YAAYE;gBACZG,MAAM;oBACJa,WAAW;gBACb;gBACAZ;YACF;QACF;QAEA,wCAAwC;QACxC,kBAAkB;QAClB,wCAAwC;QAExC,MAAM,EAAEa,GAAG,EAAEC,KAAK,EAAE,GAAG,MAAMb,QAAQc,KAAK,CAAC;YACzC,GAAGtB,IAAI;YACPC,YAAYE;YACZI;QACF;QAEA,IAAIE,cAAc,MAAMb,kBAAkBW;QAE1C,OAAO;YACLa;YACAC;YACAE,MAAMT;QACR;IACF,EAAE,OAAOU,OAAgB;QACvB,MAAM1B,gBAAgBS;QACtB,MAAMiB;IACR;AACF,EAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Collection } from '../../collections/config/types.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PayloadRequest } from '../../types/index.js';
|
|
3
3
|
export type Result = {
|
|
4
4
|
token?: string;
|
|
5
5
|
user: Record<string, unknown>;
|
|
@@ -12,7 +12,7 @@ export type Arguments = {
|
|
|
12
12
|
};
|
|
13
13
|
depth?: number;
|
|
14
14
|
overrideAccess?: boolean;
|
|
15
|
-
req:
|
|
15
|
+
req: PayloadRequest;
|
|
16
16
|
};
|
|
17
17
|
export declare const resetPasswordOperation: (args: Arguments) => Promise<Result>;
|
|
18
18
|
export default resetPasswordOperation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resetPassword.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/resetPassword.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"resetPassword.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/resetPassword.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAU1D,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,UAAU,EAAE,UAAU,CAAA;IACtB,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAA;QAChB,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,sBAAsB,SAAgB,SAAS,KAAG,OAAO,CAAC,MAAM,CA2F5E,CAAA;AAED,eAAe,sBAAsB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/auth/operations/resetPassword.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport jwt from 'jsonwebtoken'\n\nimport type { Collection } from '../../collections/config/types.js'\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../src/auth/operations/resetPassword.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport jwt from 'jsonwebtoken'\n\nimport type { Collection } from '../../collections/config/types.js'\nimport type { PayloadRequest } from '../../types/index.js'\n\nimport { APIError } from '../../errors/index.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { getFieldsToSign } from '../getFieldsToSign.js'\nimport { authenticateLocalStrategy } from '../strategies/local/authenticate.js'\nimport { generatePasswordSaltHash } from '../strategies/local/generatePasswordSaltHash.js'\n\nexport type Result = {\n token?: string\n user: Record<string, unknown>\n}\n\nexport type Arguments = {\n collection: Collection\n data: {\n password: string\n token: string\n }\n depth?: number\n overrideAccess?: boolean\n req: PayloadRequest\n}\n\nexport const resetPasswordOperation = async (args: Arguments): Promise<Result> => {\n if (\n !Object.prototype.hasOwnProperty.call(args.data, 'token') ||\n !Object.prototype.hasOwnProperty.call(args.data, 'password')\n ) {\n throw new APIError('Missing required data.', httpStatus.BAD_REQUEST)\n }\n\n const {\n collection: { config: collectionConfig },\n data,\n depth,\n overrideAccess,\n req: {\n payload: { secret },\n payload,\n },\n req,\n } = args\n\n try {\n const shouldCommit = await initTransaction(req)\n\n // /////////////////////////////////////\n // Reset Password\n // /////////////////////////////////////\n\n const user = await payload.db.findOne<any>({\n collection: collectionConfig.slug,\n req,\n where: {\n resetPasswordExpiration: { greater_than: new Date() },\n resetPasswordToken: { equals: data.token },\n },\n })\n\n if (!user) throw new APIError('Token is either invalid or has expired.', httpStatus.FORBIDDEN)\n\n // TODO: replace this method\n const { hash, salt } = await generatePasswordSaltHash({\n collection: collectionConfig,\n password: data.password,\n })\n\n user.salt = salt\n user.hash = hash\n\n user.resetPasswordExpiration = new Date().toISOString()\n\n if (collectionConfig.auth.verify) {\n user._verified = true\n }\n\n const doc = await payload.db.updateOne({\n id: user.id,\n collection: collectionConfig.slug,\n data: user,\n req,\n })\n\n await authenticateLocalStrategy({ doc, password: data.password })\n\n const fieldsToSign = getFieldsToSign({\n collectionConfig,\n email: user.email,\n user,\n })\n\n const token = jwt.sign(fieldsToSign, secret, {\n expiresIn: collectionConfig.auth.tokenExpiration,\n })\n\n const fullUser = await payload.findByID({\n id: user.id,\n collection: collectionConfig.slug,\n depth,\n overrideAccess,\n req,\n })\n if (shouldCommit) await commitTransaction(req)\n\n const result = {\n token,\n user: fullUser,\n }\n\n return result\n } catch (error: unknown) {\n await killTransaction(req)\n throw error\n }\n}\n\nexport default resetPasswordOperation\n"],"names":["httpStatus","jwt","APIError","commitTransaction","initTransaction","killTransaction","getFieldsToSign","authenticateLocalStrategy","generatePasswordSaltHash","resetPasswordOperation","args","Object","prototype","hasOwnProperty","call","data","BAD_REQUEST","collection","config","collectionConfig","depth","overrideAccess","req","payload","secret","shouldCommit","user","db","findOne","slug","where","resetPasswordExpiration","greater_than","Date","resetPasswordToken","equals","token","FORBIDDEN","hash","salt","password","toISOString","auth","verify","_verified","doc","updateOne","id","fieldsToSign","email","sign","expiresIn","tokenExpiration","fullUser","findByID","result","error"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,OAAOC,SAAS,eAAc;AAK9B,SAASC,QAAQ,QAAQ,wBAAuB;AAChD,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,wBAAuB;AACvD,SAASC,yBAAyB,QAAQ,sCAAqC;AAC/E,SAASC,wBAAwB,QAAQ,kDAAiD;AAkB1F,OAAO,MAAMC,yBAAyB,OAAOC;IAC3C,IACE,CAACC,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACJ,KAAKK,IAAI,EAAE,YACjD,CAACJ,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACJ,KAAKK,IAAI,EAAE,aACjD;QACA,MAAM,IAAIb,SAAS,0BAA0BF,WAAWgB,WAAW;IACrE;IAEA,MAAM,EACJC,YAAY,EAAEC,QAAQC,gBAAgB,EAAE,EACxCJ,IAAI,EACJK,KAAK,EACLC,cAAc,EACdC,KAAK,EACHC,SAAS,EAAEC,MAAM,EAAE,EACnBD,OAAO,EACR,EACDD,GAAG,EACJ,GAAGZ;IAEJ,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;YACAC;QACF;QACA,IAAIG,cAAc,MAAMtB,kBAAkBmB;QAE1C,MAAMiC,SAAS;YACbnB;YACAV,MAAM2B;QACR;QAEA,OAAOE;IACT,EAAE,OAAOC,OAAgB;QACvB,MAAMnD,gBAAgBiB;QACtB,MAAMkC;IACR;AACF,EAAC;AAED,eAAe/C,uBAAsB"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Collection } from '../../collections/config/types.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PayloadRequest } from '../../types/index.js';
|
|
3
3
|
export type Args = {
|
|
4
4
|
collection: Collection;
|
|
5
5
|
data: {
|
|
6
6
|
email: string;
|
|
7
7
|
};
|
|
8
8
|
overrideAccess?: boolean;
|
|
9
|
-
req:
|
|
9
|
+
req: PayloadRequest;
|
|
10
10
|
};
|
|
11
11
|
export declare const unlockOperation: (args: Args) => Promise<boolean>;
|
|
12
12
|
export default unlockOperation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unlock.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/unlock.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"unlock.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/unlock.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAS1D,MAAM,MAAM,IAAI,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,eAAe,SAAgB,IAAI,KAAG,OAAO,CAAC,OAAO,CA+DjE,CAAA;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/auth/operations/unlock.ts"],"sourcesContent":["import httpStatus from 'http-status'\n\nimport type { Collection } from '../../collections/config/types.js'\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../src/auth/operations/unlock.ts"],"sourcesContent":["import httpStatus from 'http-status'\n\nimport type { Collection } from '../../collections/config/types.js'\nimport type { PayloadRequest } from '../../types/index.js'\n\nimport { APIError } from '../../errors/index.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport executeAccess from '../executeAccess.js'\nimport { resetLoginAttempts } from '../strategies/local/resetLoginAttempts.js'\n\nexport type Args = {\n collection: Collection\n data: {\n email: string\n }\n overrideAccess?: boolean\n req: PayloadRequest\n}\n\nexport const unlockOperation = async (args: Args): Promise<boolean> => {\n if (!Object.prototype.hasOwnProperty.call(args.data, 'email')) {\n throw new APIError('Missing email.', httpStatus.BAD_REQUEST)\n }\n\n const {\n collection: { config: collectionConfig },\n overrideAccess,\n req: { locale },\n req,\n } = args\n\n try {\n const shouldCommit = await initTransaction(req)\n\n // /////////////////////////////////////\n // Access\n // /////////////////////////////////////\n\n if (!overrideAccess) {\n await executeAccess({ req }, collectionConfig.access.unlock)\n }\n\n const options = { ...args }\n\n const { data } = options\n\n // /////////////////////////////////////\n // Unlock\n // /////////////////////////////////////\n\n if (!data.email) {\n throw new APIError('Missing email.', httpStatus.BAD_REQUEST)\n }\n\n const user = await req.payload.db.findOne({\n collection: collectionConfig.slug,\n locale,\n req,\n where: { email: { equals: data.email.toLowerCase() } },\n })\n\n let result\n\n if (user) {\n await resetLoginAttempts({\n collection: collectionConfig,\n doc: user,\n payload: req.payload,\n req,\n })\n result = true\n } else {\n result = null\n }\n\n if (shouldCommit) await commitTransaction(req)\n\n return result\n } catch (error: unknown) {\n await killTransaction(req)\n throw error\n }\n}\n\nexport default unlockOperation\n"],"names":["httpStatus","APIError","commitTransaction","initTransaction","killTransaction","executeAccess","resetLoginAttempts","unlockOperation","args","Object","prototype","hasOwnProperty","call","data","BAD_REQUEST","collection","config","collectionConfig","overrideAccess","req","locale","shouldCommit","access","unlock","options","email","user","payload","db","findOne","slug","where","equals","toLowerCase","result","doc","error"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AAKpC,SAASC,QAAQ,QAAQ,wBAAuB;AAChD,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,OAAOC,mBAAmB,sBAAqB;AAC/C,SAASC,kBAAkB,QAAQ,4CAA2C;AAW9E,OAAO,MAAMC,kBAAkB,OAAOC;IACpC,IAAI,CAACC,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACJ,KAAKK,IAAI,EAAE,UAAU;QAC7D,MAAM,IAAIZ,SAAS,kBAAkBD,WAAWc,WAAW;IAC7D;IAEA,MAAM,EACJC,YAAY,EAAEC,QAAQC,gBAAgB,EAAE,EACxCC,cAAc,EACdC,KAAK,EAAEC,MAAM,EAAE,EACfD,GAAG,EACJ,GAAGX;IAEJ,IAAI;QACF,MAAMa,eAAe,MAAMlB,gBAAgBgB;QAE3C,wCAAwC;QACxC,SAAS;QACT,wCAAwC;QAExC,IAAI,CAACD,gBAAgB;YACnB,MAAMb,cAAc;gBAAEc;YAAI,GAAGF,iBAAiBK,MAAM,CAACC,MAAM;QAC7D;QAEA,MAAMC,UAAU;YAAE,GAAGhB,IAAI;QAAC;QAE1B,MAAM,EAAEK,IAAI,EAAE,GAAGW;QAEjB,wCAAwC;QACxC,SAAS;QACT,wCAAwC;QAExC,IAAI,CAACX,KAAKY,KAAK,EAAE;YACf,MAAM,IAAIxB,SAAS,kBAAkBD,WAAWc,WAAW;QAC7D;QAEA,MAAMY,OAAO,MAAMP,IAAIQ,OAAO,CAACC,EAAE,CAACC,OAAO,CAAC;YACxCd,YAAYE,iBAAiBa,IAAI;YACjCV;YACAD;YACAY,OAAO;gBAAEN,OAAO;oBAAEO,QAAQnB,KAAKY,KAAK,CAACQ,WAAW;gBAAG;YAAE;QACvD;QAEA,IAAIC;QAEJ,IAAIR,MAAM;YACR,MAAMpB,mBAAmB;gBACvBS,YAAYE;gBACZkB,KAAKT;gBACLC,SAASR,IAAIQ,OAAO;gBACpBR;YACF;YACAe,SAAS;QACX,OAAO;YACLA,SAAS;QACX;QAEA,IAAIb,cAAc,MAAMnB,kBAAkBiB;QAE1C,OAAOe;IACT,EAAE,OAAOE,OAAgB;QACvB,MAAMhC,gBAAgBe;QACtB,MAAMiB;IACR;AACF,EAAC;AAED,eAAe7B,gBAAe"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Collection } from '../../collections/config/types.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PayloadRequest } from '../../types/index.js';
|
|
3
3
|
export type Args = {
|
|
4
4
|
collection: Collection;
|
|
5
|
-
req:
|
|
5
|
+
req: PayloadRequest;
|
|
6
6
|
token: string;
|
|
7
7
|
};
|
|
8
8
|
export declare const verifyEmailOperation: (args: Args) => Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifyEmail.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/verifyEmail.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"verifyEmail.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/verifyEmail.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAO1D,MAAM,MAAM,IAAI,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;IACtB,GAAG,EAAE,cAAc,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,eAAO,MAAM,oBAAoB,SAAgB,IAAI,KAAG,OAAO,CAAC,OAAO,CAuCtE,CAAA;AAED,eAAe,oBAAoB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/auth/operations/verifyEmail.ts"],"sourcesContent":["import httpStatus from 'http-status'\n\nimport type { Collection } from '../../collections/config/types.js'\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../src/auth/operations/verifyEmail.ts"],"sourcesContent":["import httpStatus from 'http-status'\n\nimport type { Collection } from '../../collections/config/types.js'\nimport type { PayloadRequest } from '../../types/index.js'\n\nimport { APIError } from '../../errors/index.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\n\nexport type Args = {\n collection: Collection\n req: PayloadRequest\n token: string\n}\n\nexport const verifyEmailOperation = async (args: Args): Promise<boolean> => {\n const { collection, req, token } = args\n if (!Object.prototype.hasOwnProperty.call(args, 'token')) {\n throw new APIError('Missing required data.', httpStatus.BAD_REQUEST)\n }\n\n try {\n const shouldCommit = await initTransaction(req)\n\n const user = await req.payload.db.findOne<any>({\n collection: collection.config.slug,\n req,\n where: {\n _verificationToken: { equals: token },\n },\n })\n\n if (!user) throw new APIError('Verification token is invalid.', httpStatus.FORBIDDEN)\n if (user && user._verified === true)\n throw new APIError('This account has already been activated.', httpStatus.ACCEPTED)\n\n await req.payload.db.updateOne({\n id: user.id,\n collection: collection.config.slug,\n data: {\n ...user,\n _verificationToken: null,\n _verified: true,\n },\n req,\n })\n\n if (shouldCommit) await commitTransaction(req)\n\n return true\n } catch (error: unknown) {\n await killTransaction(req)\n throw error\n }\n}\n\nexport default verifyEmailOperation\n"],"names":["httpStatus","APIError","commitTransaction","initTransaction","killTransaction","verifyEmailOperation","args","collection","req","token","Object","prototype","hasOwnProperty","call","BAD_REQUEST","shouldCommit","user","payload","db","findOne","config","slug","where","_verificationToken","equals","FORBIDDEN","_verified","ACCEPTED","updateOne","id","data","error"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AAKpC,SAASC,QAAQ,QAAQ,wBAAuB;AAChD,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AAQpE,OAAO,MAAMC,uBAAuB,OAAOC;IACzC,MAAM,EAAEC,UAAU,EAAEC,GAAG,EAAEC,KAAK,EAAE,GAAGH;IACnC,IAAI,CAACI,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,MAAM,UAAU;QACxD,MAAM,IAAIL,SAAS,0BAA0BD,WAAWc,WAAW;IACrE;IAEA,IAAI;QACF,MAAMC,eAAe,MAAMZ,gBAAgBK;QAE3C,MAAMQ,OAAO,MAAMR,IAAIS,OAAO,CAACC,EAAE,CAACC,OAAO,CAAM;YAC7CZ,YAAYA,WAAWa,MAAM,CAACC,IAAI;YAClCb;YACAc,OAAO;gBACLC,oBAAoB;oBAAEC,QAAQf;gBAAM;YACtC;QACF;QAEA,IAAI,CAACO,MAAM,MAAM,IAAIf,SAAS,kCAAkCD,WAAWyB,SAAS;QACpF,IAAIT,QAAQA,KAAKU,SAAS,KAAK,MAC7B,MAAM,IAAIzB,SAAS,4CAA4CD,WAAW2B,QAAQ;QAEpF,MAAMnB,IAAIS,OAAO,CAACC,EAAE,CAACU,SAAS,CAAC;YAC7BC,IAAIb,KAAKa,EAAE;YACXtB,YAAYA,WAAWa,MAAM,CAACC,IAAI;YAClCS,MAAM;gBACJ,GAAGd,IAAI;gBACPO,oBAAoB;gBACpBG,WAAW;YACb;YACAlB;QACF;QAEA,IAAIO,cAAc,MAAMb,kBAAkBM;QAE1C,OAAO;IACT,EAAE,OAAOuB,OAAgB;QACvB,MAAM3B,gBAAgBI;QACtB,MAAMuB;IACR;AACF,EAAC;AAED,eAAe1B,qBAAoB"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { Collection } from '../collections/config/types.js';
|
|
2
2
|
import type { SanitizedConfig } from '../config/types.js';
|
|
3
3
|
import type { InitializedEmailAdapter } from '../email/types.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { PayloadRequest } from '../types/index.js';
|
|
5
5
|
import type { User } from './types.js';
|
|
6
6
|
type Args = {
|
|
7
7
|
collection: Collection;
|
|
8
8
|
config: SanitizedConfig;
|
|
9
9
|
disableEmail: boolean;
|
|
10
10
|
email: InitializedEmailAdapter;
|
|
11
|
-
req:
|
|
11
|
+
req: PayloadRequest;
|
|
12
12
|
token: string;
|
|
13
13
|
user: User;
|
|
14
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendVerificationEmail.d.ts","sourceRoot":"","sources":["../../src/auth/sendVerificationEmail.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"sendVerificationEmail.d.ts","sourceRoot":"","sources":["../../src/auth/sendVerificationEmail.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,IAAI,EAAgB,MAAM,YAAY,CAAA;AAEpD,KAAK,IAAI,GAAG;IACV,UAAU,EAAE,UAAU,CAAA;IACtB,MAAM,EAAE,eAAe,CAAA;IACvB,YAAY,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,uBAAuB,CAAA;IAC9B,GAAG,EAAE,cAAc,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,IAAI,CAAA;CACX,CAAA;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAuDrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/auth/sendVerificationEmail.ts"],"sourcesContent":["import { URL } from 'url'\n\nimport type { Collection } from '../collections/config/types.js'\nimport type { SanitizedConfig } from '../config/types.js'\nimport type { InitializedEmailAdapter } from '../email/types.js'\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../src/auth/sendVerificationEmail.ts"],"sourcesContent":["import { URL } from 'url'\n\nimport type { Collection } from '../collections/config/types.js'\nimport type { SanitizedConfig } from '../config/types.js'\nimport type { InitializedEmailAdapter } from '../email/types.js'\nimport type { PayloadRequest } from '../types/index.js'\nimport type { User, VerifyConfig } from './types.js'\n\ntype Args = {\n collection: Collection\n config: SanitizedConfig\n disableEmail: boolean\n email: InitializedEmailAdapter\n req: PayloadRequest\n token: string\n user: User\n}\n\nexport async function sendVerificationEmail(args: Args): Promise<void> {\n // Verify token from e-mail\n const {\n collection: { config: collectionConfig },\n config,\n disableEmail,\n email,\n req,\n token,\n user,\n } = args\n\n if (!disableEmail) {\n const protocol = new URL(req.url).protocol // includes the final :\n const serverURL =\n config.serverURL !== null && config.serverURL !== ''\n ? config.serverURL\n : `${protocol}//${req.headers.get('host')}`\n\n const verificationURL = `${serverURL}${config.routes.admin}/${collectionConfig.slug}/verify/${token}`\n\n let html = `${req.t('authentication:newAccountCreated', {\n serverURL: config.serverURL,\n verificationURL,\n })}`\n\n const verify = collectionConfig.auth.verify as VerifyConfig\n\n // Allow config to override email content\n if (typeof verify.generateEmailHTML === 'function') {\n html = await verify.generateEmailHTML({\n req,\n token,\n user,\n })\n }\n\n let subject = req.t('authentication:verifyYourEmail')\n\n // Allow config to override email subject\n if (typeof verify.generateEmailSubject === 'function') {\n subject = await verify.generateEmailSubject({\n req,\n token,\n user,\n })\n }\n\n await email.sendEmail({\n from: `\"${email.defaultFromName}\" <${email.defaultFromAddress}>`,\n html,\n subject,\n to: user.email,\n })\n }\n}\n"],"names":["URL","sendVerificationEmail","args","collection","config","collectionConfig","disableEmail","email","req","token","user","protocol","url","serverURL","headers","get","verificationURL","routes","admin","slug","html","t","verify","auth","generateEmailHTML","subject","generateEmailSubject","sendEmail","from","defaultFromName","defaultFromAddress","to"],"mappings":"AAAA,SAASA,GAAG,QAAQ,MAAK;AAkBzB,OAAO,eAAeC,sBAAsBC,IAAU;IACpD,2BAA2B;IAC3B,MAAM,EACJC,YAAY,EAAEC,QAAQC,gBAAgB,EAAE,EACxCD,MAAM,EACNE,YAAY,EACZC,KAAK,EACLC,GAAG,EACHC,KAAK,EACLC,IAAI,EACL,GAAGR;IAEJ,IAAI,CAACI,cAAc;QACjB,MAAMK,WAAW,IAAIX,IAAIQ,IAAII,GAAG,EAAED,QAAQ,CAAC,uBAAuB;;QAClE,MAAME,YACJT,OAAOS,SAAS,KAAK,QAAQT,OAAOS,SAAS,KAAK,KAC9CT,OAAOS,SAAS,GAChB,CAAC,EAAEF,SAAS,EAAE,EAAEH,IAAIM,OAAO,CAACC,GAAG,CAAC,QAAQ,CAAC;QAE/C,MAAMC,kBAAkB,CAAC,EAAEH,UAAU,EAAET,OAAOa,MAAM,CAACC,KAAK,CAAC,CAAC,EAAEb,iBAAiBc,IAAI,CAAC,QAAQ,EAAEV,MAAM,CAAC;QAErG,IAAIW,OAAO,CAAC,EAAEZ,IAAIa,CAAC,CAAC,oCAAoC;YACtDR,WAAWT,OAAOS,SAAS;YAC3BG;QACF,GAAG,CAAC;QAEJ,MAAMM,SAASjB,iBAAiBkB,IAAI,CAACD,MAAM;QAE3C,yCAAyC;QACzC,IAAI,OAAOA,OAAOE,iBAAiB,KAAK,YAAY;YAClDJ,OAAO,MAAME,OAAOE,iBAAiB,CAAC;gBACpChB;gBACAC;gBACAC;YACF;QACF;QAEA,IAAIe,UAAUjB,IAAIa,CAAC,CAAC;QAEpB,yCAAyC;QACzC,IAAI,OAAOC,OAAOI,oBAAoB,KAAK,YAAY;YACrDD,UAAU,MAAMH,OAAOI,oBAAoB,CAAC;gBAC1ClB;gBACAC;gBACAC;YACF;QACF;QAEA,MAAMH,MAAMoB,SAAS,CAAC;YACpBC,MAAM,CAAC,CAAC,EAAErB,MAAMsB,eAAe,CAAC,GAAG,EAAEtB,MAAMuB,kBAAkB,CAAC,CAAC,CAAC;YAChEV;YACAK;YACAM,IAAIrB,KAAKH,KAAK;QAChB;IACF;AACF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { SanitizedCollectionConfig, TypeWithID } from '../../../collections/config/types.js';
|
|
2
2
|
import type { Payload } from '../../../index.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PayloadRequest } from '../../../types/index.js';
|
|
4
4
|
type Args = {
|
|
5
5
|
collection: SanitizedCollectionConfig;
|
|
6
6
|
doc: TypeWithID & Record<string, unknown>;
|
|
7
7
|
payload: Payload;
|
|
8
|
-
req:
|
|
8
|
+
req: PayloadRequest;
|
|
9
9
|
};
|
|
10
10
|
export declare const incrementLoginAttempts: ({ collection, doc, payload, req, }: Args) => Promise<void>;
|
|
11
11
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incrementLoginAttempts.d.ts","sourceRoot":"","sources":["../../../../src/auth/strategies/local/incrementLoginAttempts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AACjG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"incrementLoginAttempts.d.ts","sourceRoot":"","sources":["../../../../src/auth/strategies/local/incrementLoginAttempts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AACjG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAE7D,KAAK,IAAI,GAAG;IACV,UAAU,EAAE,yBAAyB,CAAA;IACrC,GAAG,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACzC,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,sBAAsB,uCAKhC,IAAI,KAAG,OAAO,CAAC,IAAI,CA0CrB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/auth/strategies/local/incrementLoginAttempts.ts"],"sourcesContent":["import type { SanitizedCollectionConfig, TypeWithID } from '../../../collections/config/types.js'\nimport type { Payload } from '../../../index.js'\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../../src/auth/strategies/local/incrementLoginAttempts.ts"],"sourcesContent":["import type { SanitizedCollectionConfig, TypeWithID } from '../../../collections/config/types.js'\nimport type { Payload } from '../../../index.js'\nimport type { PayloadRequest } from '../../../types/index.js'\n\ntype Args = {\n collection: SanitizedCollectionConfig\n doc: TypeWithID & Record<string, unknown>\n payload: Payload\n req: PayloadRequest\n}\n\nexport const incrementLoginAttempts = async ({\n collection,\n doc,\n payload,\n req,\n}: Args): Promise<void> => {\n const {\n auth: { lockTime, maxLoginAttempts },\n } = collection\n\n if ('lockUntil' in doc && typeof doc.lockUntil === 'string') {\n const lockUntil = new Date(doc.lockUntil).getTime()\n\n // Expired lock, restart count at 1\n if (lockUntil < Date.now()) {\n await payload.update({\n id: doc.id,\n collection: collection.slug,\n data: {\n lockUntil: null,\n loginAttempts: 1,\n },\n depth: 0,\n req,\n })\n }\n\n return\n }\n\n const data: Record<string, unknown> = {\n loginAttempts: Number(doc.loginAttempts) + 1,\n }\n\n // Lock the account if at max attempts and not already locked\n if (typeof doc.loginAttempts === 'number' && doc.loginAttempts + 1 >= maxLoginAttempts) {\n const lockUntil = new Date(Date.now() + lockTime)\n data.lockUntil = lockUntil\n }\n\n await payload.update({\n id: doc.id,\n collection: collection.slug,\n data,\n depth: 0,\n req,\n })\n}\n"],"names":["incrementLoginAttempts","collection","doc","payload","req","auth","lockTime","maxLoginAttempts","lockUntil","Date","getTime","now","update","id","slug","data","loginAttempts","depth","Number"],"mappings":"AAWA,OAAO,MAAMA,yBAAyB,OAAO,EAC3CC,UAAU,EACVC,GAAG,EACHC,OAAO,EACPC,GAAG,EACE;IACL,MAAM,EACJC,MAAM,EAAEC,QAAQ,EAAEC,gBAAgB,EAAE,EACrC,GAAGN;IAEJ,IAAI,eAAeC,OAAO,OAAOA,IAAIM,SAAS,KAAK,UAAU;QAC3D,MAAMA,YAAY,IAAIC,KAAKP,IAAIM,SAAS,EAAEE,OAAO;QAEjD,mCAAmC;QACnC,IAAIF,YAAYC,KAAKE,GAAG,IAAI;YAC1B,MAAMR,QAAQS,MAAM,CAAC;gBACnBC,IAAIX,IAAIW,EAAE;gBACVZ,YAAYA,WAAWa,IAAI;gBAC3BC,MAAM;oBACJP,WAAW;oBACXQ,eAAe;gBACjB;gBACAC,OAAO;gBACPb;YACF;QACF;QAEA;IACF;IAEA,MAAMW,OAAgC;QACpCC,eAAeE,OAAOhB,IAAIc,aAAa,IAAI;IAC7C;IAEA,6DAA6D;IAC7D,IAAI,OAAOd,IAAIc,aAAa,KAAK,YAAYd,IAAIc,aAAa,GAAG,KAAKT,kBAAkB;QACtF,MAAMC,YAAY,IAAIC,KAAKA,KAAKE,GAAG,KAAKL;QACxCS,KAAKP,SAAS,GAAGA;IACnB;IAEA,MAAML,QAAQS,MAAM,CAAC;QACnBC,IAAIX,IAAIW,EAAE;QACVZ,YAAYA,WAAWa,IAAI;QAC3BC;QACAE,OAAO;QACPb;IACF;AACF,EAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { SanitizedCollectionConfig } from '../../../collections/config/types.js';
|
|
2
2
|
import type { Payload } from '../../../index.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PayloadRequest } from '../../../types/index.js';
|
|
4
4
|
type Args = {
|
|
5
5
|
collection: SanitizedCollectionConfig;
|
|
6
6
|
doc: Record<string, unknown>;
|
|
7
7
|
password: string;
|
|
8
8
|
payload: Payload;
|
|
9
|
-
req:
|
|
9
|
+
req: PayloadRequest;
|
|
10
10
|
};
|
|
11
11
|
export declare const registerLocalStrategy: ({ collection, doc, password, payload, req, }: Args) => Promise<Record<string, unknown>>;
|
|
12
12
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/auth/strategies/local/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AACrF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/auth/strategies/local/register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AACrF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAK7D,KAAK,IAAI,GAAG;IACV,UAAU,EAAE,yBAAyB,CAAA;IACrC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5B,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,qBAAqB,iDAM/B,IAAI,KAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAkDxC,CAAA"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { ValidationError } from '../../../errors/index.js';
|
|
2
2
|
import { generatePasswordSaltHash } from './generatePasswordSaltHash.js';
|
|
3
3
|
export const registerLocalStrategy = async ({ collection, doc, password, payload, req })=>{
|
|
4
|
+
const loginWithUsername = collection?.auth?.loginWithUsername;
|
|
4
5
|
const existingUser = await payload.find({
|
|
5
6
|
collection: collection.slug,
|
|
6
7
|
depth: 0,
|
|
7
8
|
limit: 1,
|
|
8
9
|
pagination: false,
|
|
9
10
|
req,
|
|
10
|
-
where: {
|
|
11
|
+
where: loginWithUsername ? {
|
|
12
|
+
username: {
|
|
13
|
+
equals: doc.username
|
|
14
|
+
}
|
|
15
|
+
} : {
|
|
11
16
|
email: {
|
|
12
17
|
equals: doc.email
|
|
13
18
|
}
|
|
@@ -17,7 +22,10 @@ export const registerLocalStrategy = async ({ collection, doc, password, payload
|
|
|
17
22
|
throw new ValidationError({
|
|
18
23
|
collection: collection.slug,
|
|
19
24
|
errors: [
|
|
20
|
-
{
|
|
25
|
+
loginWithUsername ? {
|
|
26
|
+
field: 'username',
|
|
27
|
+
message: req.t('error:usernameAlreadyRegistered')
|
|
28
|
+
} : {
|
|
21
29
|
field: 'email',
|
|
22
30
|
message: req.t('error:userEmailAlreadyRegistered')
|
|
23
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/auth/strategies/local/register.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../../../collections/config/types.js'\nimport type { Payload } from '../../../index.js'\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../../src/auth/strategies/local/register.ts"],"sourcesContent":["import type { SanitizedCollectionConfig } from '../../../collections/config/types.js'\nimport type { Payload } from '../../../index.js'\nimport type { PayloadRequest } from '../../../types/index.js'\n\nimport { ValidationError } from '../../../errors/index.js'\nimport { generatePasswordSaltHash } from './generatePasswordSaltHash.js'\n\ntype Args = {\n collection: SanitizedCollectionConfig\n doc: Record<string, unknown>\n password: string\n payload: Payload\n req: PayloadRequest\n}\n\nexport const registerLocalStrategy = async ({\n collection,\n doc,\n password,\n payload,\n req,\n}: Args): Promise<Record<string, unknown>> => {\n const loginWithUsername = collection?.auth?.loginWithUsername\n\n const existingUser = await payload.find({\n collection: collection.slug,\n depth: 0,\n limit: 1,\n pagination: false,\n req,\n where: loginWithUsername\n ? {\n username: {\n equals: doc.username,\n },\n }\n : {\n email: {\n equals: doc.email,\n },\n },\n })\n\n if (existingUser.docs.length > 0) {\n throw new ValidationError({\n collection: collection.slug,\n errors: [\n loginWithUsername\n ? {\n field: 'username',\n message: req.t('error:usernameAlreadyRegistered'),\n }\n : { field: 'email', message: req.t('error:userEmailAlreadyRegistered') },\n ],\n })\n }\n\n const { hash, salt } = await generatePasswordSaltHash({ collection, password })\n\n const sanitizedDoc = { ...doc }\n if (sanitizedDoc.password) delete sanitizedDoc.password\n\n return payload.db.create({\n collection: collection.slug,\n data: {\n ...sanitizedDoc,\n hash,\n salt,\n },\n req,\n })\n}\n"],"names":["ValidationError","generatePasswordSaltHash","registerLocalStrategy","collection","doc","password","payload","req","loginWithUsername","auth","existingUser","find","slug","depth","limit","pagination","where","username","equals","email","docs","length","errors","field","message","t","hash","salt","sanitizedDoc","db","create","data"],"mappings":"AAIA,SAASA,eAAe,QAAQ,2BAA0B;AAC1D,SAASC,wBAAwB,QAAQ,gCAA+B;AAUxE,OAAO,MAAMC,wBAAwB,OAAO,EAC1CC,UAAU,EACVC,GAAG,EACHC,QAAQ,EACRC,OAAO,EACPC,GAAG,EACE;IACL,MAAMC,oBAAoBL,YAAYM,MAAMD;IAE5C,MAAME,eAAe,MAAMJ,QAAQK,IAAI,CAAC;QACtCR,YAAYA,WAAWS,IAAI;QAC3BC,OAAO;QACPC,OAAO;QACPC,YAAY;QACZR;QACAS,OAAOR,oBACH;YACES,UAAU;gBACRC,QAAQd,IAAIa,QAAQ;YACtB;QACF,IACA;YACEE,OAAO;gBACLD,QAAQd,IAAIe,KAAK;YACnB;QACF;IACN;IAEA,IAAIT,aAAaU,IAAI,CAACC,MAAM,GAAG,GAAG;QAChC,MAAM,IAAIrB,gBAAgB;YACxBG,YAAYA,WAAWS,IAAI;YAC3BU,QAAQ;gBACNd,oBACI;oBACEe,OAAO;oBACPC,SAASjB,IAAIkB,CAAC,CAAC;gBACjB,IACA;oBAAEF,OAAO;oBAASC,SAASjB,IAAIkB,CAAC,CAAC;gBAAoC;aAC1E;QACH;IACF;IAEA,MAAM,EAAEC,IAAI,EAAEC,IAAI,EAAE,GAAG,MAAM1B,yBAAyB;QAAEE;QAAYE;IAAS;IAE7E,MAAMuB,eAAe;QAAE,GAAGxB,GAAG;IAAC;IAC9B,IAAIwB,aAAavB,QAAQ,EAAE,OAAOuB,aAAavB,QAAQ;IAEvD,OAAOC,QAAQuB,EAAE,CAACC,MAAM,CAAC;QACvB3B,YAAYA,WAAWS,IAAI;QAC3BmB,MAAM;YACJ,GAAGH,YAAY;YACfF;YACAC;QACF;QACApB;IACF;AACF,EAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { SanitizedCollectionConfig, TypeWithID } from '../../../collections/config/types.js';
|
|
2
2
|
import type { Payload } from '../../../index.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PayloadRequest } from '../../../types/index.js';
|
|
4
4
|
type Args = {
|
|
5
5
|
collection: SanitizedCollectionConfig;
|
|
6
6
|
doc: TypeWithID & Record<string, unknown>;
|
|
7
7
|
payload: Payload;
|
|
8
|
-
req:
|
|
8
|
+
req: PayloadRequest;
|
|
9
9
|
};
|
|
10
10
|
export declare const resetLoginAttempts: ({ collection, doc, payload, req, }: Args) => Promise<void>;
|
|
11
11
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resetLoginAttempts.d.ts","sourceRoot":"","sources":["../../../../src/auth/strategies/local/resetLoginAttempts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AACjG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"resetLoginAttempts.d.ts","sourceRoot":"","sources":["../../../../src/auth/strategies/local/resetLoginAttempts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AACjG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAE7D,KAAK,IAAI,GAAG;IACV,UAAU,EAAE,yBAAyB,CAAA;IACrC,GAAG,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACzC,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,kBAAkB,uCAK5B,IAAI,KAAG,OAAO,CAAC,IAAI,CAarB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/auth/strategies/local/resetLoginAttempts.ts"],"sourcesContent":["import type { SanitizedCollectionConfig, TypeWithID } from '../../../collections/config/types.js'\nimport type { Payload } from '../../../index.js'\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../../src/auth/strategies/local/resetLoginAttempts.ts"],"sourcesContent":["import type { SanitizedCollectionConfig, TypeWithID } from '../../../collections/config/types.js'\nimport type { Payload } from '../../../index.js'\nimport type { PayloadRequest } from '../../../types/index.js'\n\ntype Args = {\n collection: SanitizedCollectionConfig\n doc: TypeWithID & Record<string, unknown>\n payload: Payload\n req: PayloadRequest\n}\n\nexport const resetLoginAttempts = async ({\n collection,\n doc,\n payload,\n req,\n}: Args): Promise<void> => {\n if (!('lockUntil' in doc && typeof doc.lockUntil === 'string') || doc.loginAttempts === 0) return\n await payload.update({\n id: doc.id,\n collection: collection.slug,\n data: {\n lockUntil: null,\n loginAttempts: 0,\n },\n depth: 0,\n overrideAccess: true,\n req,\n })\n}\n"],"names":["resetLoginAttempts","collection","doc","payload","req","lockUntil","loginAttempts","update","id","slug","data","depth","overrideAccess"],"mappings":"AAWA,OAAO,MAAMA,qBAAqB,OAAO,EACvCC,UAAU,EACVC,GAAG,EACHC,OAAO,EACPC,GAAG,EACE;IACL,IAAI,CAAE,CAAA,eAAeF,OAAO,OAAOA,IAAIG,SAAS,KAAK,QAAO,KAAMH,IAAII,aAAa,KAAK,GAAG;IAC3F,MAAMH,QAAQI,MAAM,CAAC;QACnBC,IAAIN,IAAIM,EAAE;QACVP,YAAYA,WAAWQ,IAAI;QAC3BC,MAAM;YACJL,WAAW;YACXC,eAAe;QACjB;QACAK,OAAO;QACPC,gBAAgB;QAChBR;IACF;AACF,EAAC"}
|
package/dist/auth/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DeepRequired } from 'ts-essentials';
|
|
2
2
|
import type { Payload } from '../index.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PayloadRequest, Where } from '../types/index.js';
|
|
4
4
|
export type Permission = {
|
|
5
5
|
permission: boolean;
|
|
6
6
|
where?: Record<string, unknown>;
|
|
@@ -57,33 +57,34 @@ export type Permissions = {
|
|
|
57
57
|
export type User = {
|
|
58
58
|
[key: string]: any;
|
|
59
59
|
collection: string;
|
|
60
|
-
email
|
|
60
|
+
email?: string;
|
|
61
61
|
id: number | string;
|
|
62
|
+
username?: string;
|
|
62
63
|
};
|
|
63
64
|
/**
|
|
64
65
|
* `collection` is not available one the client. It's only available on the server (req.user)
|
|
65
66
|
* On the client, you can access the collection via config.admin.user. Config can be accessed using the useConfig() hook
|
|
66
67
|
*/
|
|
67
68
|
export type ClientUser = Omit<User, 'collection'>;
|
|
68
|
-
type GenerateVerifyEmailHTML = (args: {
|
|
69
|
-
req:
|
|
69
|
+
type GenerateVerifyEmailHTML<TUser = any> = (args: {
|
|
70
|
+
req: PayloadRequest;
|
|
70
71
|
token: string;
|
|
71
|
-
user:
|
|
72
|
+
user: TUser;
|
|
72
73
|
}) => Promise<string> | string;
|
|
73
|
-
type GenerateVerifyEmailSubject = (args: {
|
|
74
|
-
req:
|
|
74
|
+
type GenerateVerifyEmailSubject<TUser = any> = (args: {
|
|
75
|
+
req: PayloadRequest;
|
|
75
76
|
token: string;
|
|
76
|
-
user:
|
|
77
|
+
user: TUser;
|
|
77
78
|
}) => Promise<string> | string;
|
|
78
|
-
type GenerateForgotPasswordEmailHTML = (args?: {
|
|
79
|
-
req?:
|
|
79
|
+
type GenerateForgotPasswordEmailHTML<TUser = any> = (args?: {
|
|
80
|
+
req?: PayloadRequest;
|
|
80
81
|
token?: string;
|
|
81
|
-
user?:
|
|
82
|
+
user?: TUser;
|
|
82
83
|
}) => Promise<string> | string;
|
|
83
|
-
type GenerateForgotPasswordEmailSubject = (args?: {
|
|
84
|
-
req?:
|
|
84
|
+
type GenerateForgotPasswordEmailSubject<TUser = any> = (args?: {
|
|
85
|
+
req?: PayloadRequest;
|
|
85
86
|
token?: string;
|
|
86
|
-
user?:
|
|
87
|
+
user?: TUser;
|
|
87
88
|
}) => Promise<string> | string;
|
|
88
89
|
export type AuthStrategyFunctionArgs = {
|
|
89
90
|
headers: Request['headers'];
|
|
@@ -112,6 +113,7 @@ export interface IncomingAuthType {
|
|
|
112
113
|
generateEmailSubject?: GenerateForgotPasswordEmailSubject;
|
|
113
114
|
};
|
|
114
115
|
lockTime?: number;
|
|
116
|
+
loginWithUsername?: boolean;
|
|
115
117
|
maxLoginAttempts?: number;
|
|
116
118
|
removeTokenFromResponses?: true;
|
|
117
119
|
strategies?: AuthStrategy[];
|
package/dist/auth/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/auth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/auth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE9D,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAChC,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,CAAC,EAAE;QACP,CAAC,SAAS,EAAE,MAAM,GAAG;YACnB,MAAM,EAAE;gBACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAA;aACtC,CAAA;SACF,CAAA;KACF,CAAA;IACD,MAAM,EAAE;QACN,UAAU,EAAE,OAAO,CAAA;KACpB,CAAA;IACD,MAAM,CAAC,EAAE;QACP,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAA;KACtC,CAAA;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,OAAO,CAAA;KACpB,CAAA;IACD,MAAM,EAAE;QACN,UAAU,EAAE,OAAO,CAAA;KACpB,CAAA;CACF,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,MAAM,EAAE,UAAU,CAAA;IAClB,MAAM,EAAE,UAAU,CAAA;IAClB,MAAM,EAAE;QACN,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAA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1
|
-
{"version":3,"sources":["../../src/auth/types.ts"],"sourcesContent":["import type { DeepRequired } from 'ts-essentials'\n\nimport type { Payload } from '../index.js'\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../src/auth/types.ts"],"sourcesContent":["import type { DeepRequired } from 'ts-essentials'\n\nimport type { Payload } from '../index.js'\nimport type { PayloadRequest, Where } from '../types/index.js'\n\nexport type Permission = {\n permission: boolean\n where?: Record<string, unknown>\n}\n\nexport type FieldPermissions = {\n blocks?: {\n [blockSlug: string]: {\n fields: {\n [fieldName: string]: FieldPermissions\n }\n }\n }\n create: {\n permission: boolean\n }\n fields?: {\n [fieldName: string]: FieldPermissions\n }\n read: {\n permission: boolean\n }\n update: {\n permission: boolean\n }\n}\n\nexport type CollectionPermission = {\n create: Permission\n delete: Permission\n fields: {\n [fieldName: string]: FieldPermissions\n }\n read: Permission\n readVersions?: Permission\n update: Permission\n}\n\nexport type GlobalPermission = {\n fields: {\n [fieldName: string]: FieldPermissions\n }\n read: Permission\n readVersions?: Permission\n update: Permission\n}\n\nexport type DocumentPermissions = CollectionPermission | GlobalPermission\nexport type Permissions = {\n canAccessAdmin: boolean\n collections: {\n [collectionSlug: string]: CollectionPermission\n }\n globals?: {\n [globalSlug: string]: GlobalPermission\n }\n}\n\nexport type User = {\n [key: string]: any // This NEEDS to be an any, otherwise it breaks the Omit for ClientUser below\n collection: string\n email?: string\n id: number | string\n username?: string\n}\n\n/**\n * `collection` is not available one the client. It's only available on the server (req.user)\n * On the client, you can access the collection via config.admin.user. Config can be accessed using the useConfig() hook\n */\nexport type ClientUser = Omit<User, 'collection'>\n\ntype GenerateVerifyEmailHTML<TUser = any> = (args: {\n req: PayloadRequest\n token: string\n user: TUser\n}) => Promise<string> | string\n\ntype GenerateVerifyEmailSubject<TUser = any> = (args: {\n req: PayloadRequest\n token: string\n user: TUser\n}) => Promise<string> | string\n\ntype GenerateForgotPasswordEmailHTML<TUser = any> = (args?: {\n req?: PayloadRequest\n token?: string\n user?: TUser\n}) => Promise<string> | string\n\ntype GenerateForgotPasswordEmailSubject<TUser = any> = (args?: {\n req?: PayloadRequest\n token?: string\n user?: TUser\n}) => Promise<string> | string\n\nexport type AuthStrategyFunctionArgs = {\n headers: Request['headers']\n isGraphQL?: boolean\n payload: Payload\n}\n\nexport type AuthStrategyResult = {\n responseHeaders?: Headers\n user: User | null\n}\n\nexport type AuthStrategyFunction = (\n args: AuthStrategyFunctionArgs,\n) => AuthStrategyResult | Promise<AuthStrategyResult>\nexport type AuthStrategy = {\n authenticate: AuthStrategyFunction\n name: string\n}\n\nexport interface IncomingAuthType {\n cookies?: {\n domain?: string\n sameSite?: 'Lax' | 'None' | 'Strict' | boolean\n secure?: boolean\n }\n depth?: number\n disableLocalStrategy?: true\n forgotPassword?: {\n generateEmailHTML?: GenerateForgotPasswordEmailHTML\n generateEmailSubject?: GenerateForgotPasswordEmailSubject\n }\n lockTime?: number\n loginWithUsername?: boolean\n maxLoginAttempts?: number\n removeTokenFromResponses?: true\n strategies?: AuthStrategy[]\n tokenExpiration?: number\n useAPIKey?: boolean\n verify?:\n | {\n generateEmailHTML?: GenerateVerifyEmailHTML\n generateEmailSubject?: GenerateVerifyEmailSubject\n }\n | boolean\n}\n\nexport type VerifyConfig = {\n generateEmailHTML?: GenerateVerifyEmailHTML\n generateEmailSubject?: GenerateVerifyEmailSubject\n}\n\nexport interface Auth extends Omit<DeepRequired<IncomingAuthType>, 'forgotPassword' | 'verify'> {\n forgotPassword?: {\n generateEmailHTML?: GenerateForgotPasswordEmailHTML\n generateEmailSubject?: GenerateForgotPasswordEmailSubject\n }\n verify?: VerifyConfig | boolean\n}\n\nexport function hasWhereAccessResult(result: Where | boolean): result is Where {\n return result && typeof result === 'object'\n}\n"],"names":["hasWhereAccessResult","result"],"mappings":"AAgKA,OAAO,SAASA,qBAAqBC,MAAuB;IAC1D,OAAOA,UAAU,OAAOA,WAAW;AACrC"}
|
|
@@ -291,7 +291,7 @@ export declare const createClientCollectionConfig: ({ collection, t, }: {
|
|
|
291
291
|
};
|
|
292
292
|
access: {
|
|
293
293
|
admin: ({ req }: {
|
|
294
|
-
req: import("../../index.js").
|
|
294
|
+
req: import("../../index.js").PayloadRequest;
|
|
295
295
|
}) => Promise<boolean> | boolean;
|
|
296
296
|
create: import("../../config/types.js").Access;
|
|
297
297
|
delete: import("../../config/types.js").Access;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/collections/config/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAA;AAE/F,MAAM,MAAM,8BAA8B,GAAG,MAAM,IAAI,CACrD,yBAAyB,EACzB,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAC5C,CAAA;AAED,MAAM,MAAM,mCAAmC,GAAG,MAAM,IAAI,CAC1D,yBAAyB,CAAC,OAAO,CAAC,EAClC,YAAY,GAAG,QAAQ,GAAG,SAAS,CACpC,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACvC,yBAAyB,EACzB,OAAO,GAAG,QAAQ,GAAG,8BAA8B,CACpD,GAAG;IACF,KAAK,EAAE,IAAI,CACT,yBAAyB,CAAC,OAAO,CAAC,EAClC,QAAQ,GAAG,aAAa,GAAG,mCAAmC,CAC/D,GAAG;QACF,WAAW,CAAC,EAAE,IAAI,CAAC,iBAAiB,EAAE,+BAA+B,CAAC,CAAA;KACvE,CAAA;IACD,MAAM,EAAE,iBAAiB,EAAE,CAAA;CAC5B,CAAA;AAED,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACtE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAI3D,eAAO,MAAM,4BAA4B,uBAGtC;IACD,UAAU,EAAE,yBAAyB,CAAA;IAC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