payload 3.0.0-alpha.9 → 3.0.0-beta.0
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/auth.d.ts +5 -5
- package/auth.js +5 -44
- package/bin.js +17 -1
- package/config.d.ts +13 -10
- package/config.js +13 -59
- package/database.d.ts +22 -22
- package/database.js +21 -108
- package/dist/admin/RichText.d.ts +14 -11
- package/dist/admin/RichText.d.ts.map +1 -1
- package/dist/admin/RichText.js +2 -5
- package/dist/admin/RichText.js.map +1 -0
- package/dist/admin/elements/Cell.d.ts +8 -8
- package/dist/admin/elements/Cell.d.ts.map +1 -1
- package/dist/admin/elements/Cell.js +2 -5
- package/dist/admin/elements/Cell.js.map +1 -0
- package/dist/admin/elements/DatePicker.js +2 -5
- package/dist/admin/elements/DatePicker.js.map +1 -0
- package/dist/admin/elements/PreviewButton.d.ts +1 -8
- package/dist/admin/elements/PreviewButton.d.ts.map +1 -1
- package/dist/admin/elements/PreviewButton.js +2 -5
- package/dist/admin/elements/PreviewButton.js.map +1 -0
- package/dist/admin/elements/PublishButton.d.ts +1 -10
- package/dist/admin/elements/PublishButton.d.ts.map +1 -1
- package/dist/admin/elements/PublishButton.js +2 -5
- package/dist/admin/elements/PublishButton.js.map +1 -0
- package/dist/admin/elements/SaveButton.d.ts +1 -7
- package/dist/admin/elements/SaveButton.d.ts.map +1 -1
- package/dist/admin/elements/SaveButton.js +2 -5
- package/dist/admin/elements/SaveButton.js.map +1 -0
- package/dist/admin/elements/SaveDraftButton.d.ts +1 -8
- package/dist/admin/elements/SaveDraftButton.d.ts.map +1 -1
- package/dist/admin/elements/SaveDraftButton.js +2 -5
- package/dist/admin/elements/SaveDraftButton.js.map +1 -0
- package/dist/admin/elements/Tab.d.ts +3 -3
- package/dist/admin/elements/Tab.d.ts.map +1 -1
- package/dist/admin/elements/Tab.js +2 -5
- package/dist/admin/elements/Tab.js.map +1 -0
- package/dist/admin/forms/Error.d.ts +1 -0
- package/dist/admin/forms/Error.d.ts.map +1 -1
- package/dist/admin/forms/Error.js +2 -5
- package/dist/admin/forms/Error.js.map +1 -0
- package/dist/admin/forms/FieldDescription.d.ts +10 -6
- package/dist/admin/forms/FieldDescription.d.ts.map +1 -1
- package/dist/admin/forms/FieldDescription.js +2 -5
- package/dist/admin/forms/FieldDescription.js.map +1 -0
- package/dist/admin/forms/FieldTypes.js +2 -5
- package/dist/admin/forms/FieldTypes.js.map +1 -0
- package/dist/admin/forms/Form.d.ts +26 -0
- package/dist/admin/forms/Form.d.ts.map +1 -1
- package/dist/admin/forms/Form.js +2 -5
- package/dist/admin/forms/Form.js.map +1 -0
- package/dist/admin/forms/Label.d.ts +5 -1
- package/dist/admin/forms/Label.d.ts.map +1 -1
- package/dist/admin/forms/Label.js +2 -5
- package/dist/admin/forms/Label.js.map +1 -0
- package/dist/admin/forms/RowLabel.d.ts +2 -9
- package/dist/admin/forms/RowLabel.d.ts.map +1 -1
- package/dist/admin/forms/RowLabel.js +2 -5
- package/dist/admin/forms/RowLabel.js.map +1 -0
- package/dist/admin/types.d.ts +15 -18
- package/dist/admin/types.d.ts.map +1 -1
- package/dist/admin/types.js +2 -5
- package/dist/admin/types.js.map +1 -0
- package/dist/admin/views/types.d.ts +55 -0
- package/dist/admin/views/types.d.ts.map +1 -0
- package/dist/admin/views/types.js +3 -0
- package/dist/admin/views/types.js.map +1 -0
- package/dist/assets/assets.d.js +1 -2
- package/dist/assets/assets.d.js.map +1 -0
- package/dist/auth/baseFields/accountLock.d.ts +1 -1
- package/dist/auth/baseFields/accountLock.d.ts.map +1 -1
- package/dist/auth/baseFields/accountLock.js +6 -16
- package/dist/auth/baseFields/accountLock.js.map +1 -0
- package/dist/auth/baseFields/apiKey.d.ts +1 -1
- package/dist/auth/baseFields/apiKey.d.ts.map +1 -1
- package/dist/auth/baseFields/apiKey.js +8 -27
- package/dist/auth/baseFields/apiKey.js.map +1 -0
- package/dist/auth/baseFields/auth.d.ts +1 -1
- package/dist/auth/baseFields/auth.d.ts.map +1 -1
- package/dist/auth/baseFields/auth.js +5 -19
- package/dist/auth/baseFields/auth.js.map +1 -0
- package/dist/auth/baseFields/verification.d.ts +1 -1
- package/dist/auth/baseFields/verification.d.ts.map +1 -1
- package/dist/auth/baseFields/verification.js +6 -20
- package/dist/auth/baseFields/verification.js.map +1 -0
- package/dist/auth/cookies.d.ts +6 -2
- package/dist/auth/cookies.d.ts.map +1 -1
- package/dist/auth/cookies.js +7 -34
- package/dist/auth/cookies.js.map +1 -0
- package/dist/auth/crypto.js +7 -30
- package/dist/auth/crypto.js.map +1 -0
- package/dist/auth/defaultAccess.d.ts +1 -1
- package/dist/auth/defaultAccess.d.ts.map +1 -1
- package/dist/auth/defaultAccess.js +2 -12
- package/dist/auth/defaultAccess.js.map +1 -0
- package/dist/auth/defaultUser.d.ts +1 -1
- package/dist/auth/defaultUser.d.ts.map +1 -1
- package/dist/auth/defaultUser.js +6 -21
- package/dist/auth/defaultUser.js.map +1 -0
- package/dist/auth/executeAccess.d.ts +2 -2
- package/dist/auth/executeAccess.d.ts.map +1 -1
- package/dist/auth/executeAccess.js +5 -15
- package/dist/auth/executeAccess.js.map +1 -0
- package/dist/auth/executeAuthStrategies.d.ts +3 -0
- package/dist/auth/executeAuthStrategies.d.ts.map +1 -0
- package/dist/auth/executeAuthStrategies.js +11 -0
- package/dist/auth/executeAuthStrategies.js.map +1 -0
- package/dist/auth/extractJWT.d.ts +1 -1
- package/dist/auth/extractJWT.d.ts.map +1 -1
- package/dist/auth/extractJWT.js +4 -14
- package/dist/auth/extractJWT.js.map +1 -0
- package/dist/auth/getAccessResults.d.ts +2 -2
- package/dist/auth/getAccessResults.d.ts.map +1 -1
- package/dist/auth/getAccessResults.js +15 -21
- package/dist/auth/getAccessResults.js.map +1 -0
- package/dist/auth/getFieldsToSign.d.ts +2 -2
- package/dist/auth/getFieldsToSign.d.ts.map +1 -1
- package/dist/auth/getFieldsToSign.js +5 -15
- package/dist/auth/getFieldsToSign.js.map +1 -0
- package/dist/auth/index.d.ts +3 -3
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +4 -27
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/isLocked.js +2 -12
- package/dist/auth/isLocked.js.map +1 -0
- 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 +12 -22
- package/dist/auth/operations/access.js.map +1 -0
- package/dist/auth/operations/auth.d.ts +13 -0
- package/dist/auth/operations/auth.d.ts.map +1 -0
- package/dist/auth/operations/auth.js +35 -0
- package/dist/auth/operations/auth.js.map +1 -0
- package/dist/auth/operations/forgotPassword.d.ts +2 -2
- package/dist/auth/operations/forgotPassword.d.ts.map +1 -1
- package/dist/auth/operations/forgotPassword.js +21 -32
- package/dist/auth/operations/forgotPassword.js.map +1 -0
- package/dist/auth/operations/init.d.ts +1 -1
- package/dist/auth/operations/init.d.ts.map +1 -1
- package/dist/auth/operations/init.js +2 -12
- package/dist/auth/operations/init.js.map +1 -0
- package/dist/auth/operations/local/auth.d.ts +4 -0
- package/dist/auth/operations/local/auth.d.ts.map +1 -0
- package/dist/auth/operations/local/auth.js +13 -0
- package/dist/auth/operations/local/auth.js.map +1 -0
- package/dist/auth/operations/local/forgotPassword.d.ts +3 -3
- package/dist/auth/operations/local/forgotPassword.d.ts.map +1 -1
- package/dist/auth/operations/local/forgotPassword.js +8 -18
- package/dist/auth/operations/local/forgotPassword.js.map +1 -0
- package/dist/auth/operations/local/index.d.ts +6 -5
- package/dist/auth/operations/local/index.d.ts.map +1 -1
- package/dist/auth/operations/local/index.js +14 -27
- package/dist/auth/operations/local/index.js.map +1 -0
- package/dist/auth/operations/local/login.d.ts +4 -4
- package/dist/auth/operations/local/login.d.ts.map +1 -1
- package/dist/auth/operations/local/login.js +8 -18
- package/dist/auth/operations/local/login.js.map +1 -0
- package/dist/auth/operations/local/resetPassword.d.ts +4 -4
- package/dist/auth/operations/local/resetPassword.d.ts.map +1 -1
- package/dist/auth/operations/local/resetPassword.js +8 -18
- package/dist/auth/operations/local/resetPassword.js.map +1 -0
- package/dist/auth/operations/local/unlock.d.ts +3 -3
- package/dist/auth/operations/local/unlock.d.ts.map +1 -1
- package/dist/auth/operations/local/unlock.js +8 -18
- package/dist/auth/operations/local/unlock.js.map +1 -0
- package/dist/auth/operations/local/verifyEmail.d.ts +3 -3
- package/dist/auth/operations/local/verifyEmail.d.ts.map +1 -1
- package/dist/auth/operations/local/verifyEmail.js +8 -18
- package/dist/auth/operations/local/verifyEmail.js.map +1 -0
- package/dist/auth/operations/login.d.ts +5 -9
- package/dist/auth/operations/login.d.ts.map +1 -1
- package/dist/auth/operations/login.js +32 -50
- package/dist/auth/operations/login.js.map +1 -0
- 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 +6 -21
- package/dist/auth/operations/logout.js.map +1 -0
- package/dist/auth/operations/me.d.ts +6 -6
- package/dist/auth/operations/me.d.ts.map +1 -1
- package/dist/auth/operations/me.js +4 -19
- package/dist/auth/operations/me.js.map +1 -0
- package/dist/auth/operations/refresh.d.ts +3 -3
- package/dist/auth/operations/refresh.d.ts.map +1 -1
- package/dist/auth/operations/refresh.js +19 -34
- package/dist/auth/operations/refresh.js.map +1 -0
- package/dist/auth/operations/registerFirstUser.d.ts +4 -12
- package/dist/auth/operations/registerFirstUser.d.ts.map +1 -1
- package/dist/auth/operations/registerFirstUser.js +11 -21
- package/dist/auth/operations/registerFirstUser.js.map +1 -0
- 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 +21 -43
- package/dist/auth/operations/resetPassword.js.map +1 -0
- 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 +17 -39
- package/dist/auth/operations/unlock.js.map +1 -0
- 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 +14 -37
- package/dist/auth/operations/verifyEmail.js.map +1 -0
- package/dist/auth/sendVerificationEmail.d.ts +5 -5
- package/dist/auth/sendVerificationEmail.d.ts.map +1 -1
- package/dist/auth/sendVerificationEmail.js +4 -14
- package/dist/auth/sendVerificationEmail.js.map +1 -0
- package/dist/auth/strategies/apiKey.d.ts +2 -2
- package/dist/auth/strategies/apiKey.d.ts.map +1 -1
- package/dist/auth/strategies/apiKey.js +6 -19
- package/dist/auth/strategies/apiKey.js.map +1 -0
- package/dist/auth/strategies/jwt.d.ts +1 -1
- package/dist/auth/strategies/jwt.d.ts.map +1 -1
- package/dist/auth/strategies/jwt.js +6 -21
- package/dist/auth/strategies/jwt.js.map +1 -0
- package/dist/auth/strategies/local/authenticate.d.ts +1 -1
- package/dist/auth/strategies/local/authenticate.d.ts.map +1 -1
- package/dist/auth/strategies/local/authenticate.js +6 -21
- package/dist/auth/strategies/local/authenticate.js.map +1 -0
- package/dist/auth/strategies/local/generatePasswordSaltHash.d.ts.map +1 -1
- package/dist/auth/strategies/local/generatePasswordSaltHash.js +7 -22
- package/dist/auth/strategies/local/generatePasswordSaltHash.js.map +1 -0
- package/dist/auth/strategies/local/incrementLoginAttempts.d.ts +3 -3
- package/dist/auth/strategies/local/incrementLoginAttempts.d.ts.map +1 -1
- package/dist/auth/strategies/local/incrementLoginAttempts.js +4 -12
- package/dist/auth/strategies/local/incrementLoginAttempts.js.map +1 -0
- package/dist/auth/strategies/local/register.d.ts +3 -3
- package/dist/auth/strategies/local/register.d.ts.map +1 -1
- package/dist/auth/strategies/local/register.js +9 -16
- package/dist/auth/strategies/local/register.js.map +1 -0
- package/dist/auth/strategies/local/resetLoginAttempts.d.ts +3 -3
- package/dist/auth/strategies/local/resetLoginAttempts.d.ts.map +1 -1
- package/dist/auth/strategies/local/resetLoginAttempts.js +3 -12
- package/dist/auth/strategies/local/resetLoginAttempts.js.map +1 -0
- package/dist/auth/types.d.ts +8 -3
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/auth/types.js +2 -12
- package/dist/auth/types.js.map +1 -0
- package/dist/bin/generateTypes.d.ts +1 -1
- package/dist/bin/generateTypes.d.ts.map +1 -1
- package/dist/bin/generateTypes.js +10 -34
- package/dist/bin/generateTypes.js.map +1 -0
- package/dist/bin/index.d.ts +1 -1
- package/dist/bin/index.d.ts.map +1 -1
- package/dist/bin/index.js +25 -69
- package/dist/bin/index.js.map +1 -0
- package/dist/bin/loadEnv.js +13 -26
- package/dist/bin/loadEnv.js.map +1 -0
- package/dist/bin/loader/clientExtensions.d.ts +2 -0
- package/dist/bin/loader/clientExtensions.d.ts.map +1 -0
- package/dist/bin/loader/clientExtensions.js +13 -0
- package/dist/bin/loader/clientExtensions.js.map +1 -0
- package/dist/bin/loader/compile.d.ts +5 -0
- package/dist/bin/loader/compile.d.ts.map +1 -0
- package/dist/bin/loader/compile.js +27 -0
- package/dist/bin/loader/compile.js.map +1 -0
- package/dist/bin/loader/index.d.ts +34 -0
- package/dist/bin/loader/index.d.ts.map +1 -0
- package/dist/bin/loader/index.js +113 -0
- package/dist/bin/loader/index.js.map +1 -0
- package/dist/bin/loader/read-default-tsconfig.d.ts +4 -0
- package/dist/bin/loader/read-default-tsconfig.d.ts.map +1 -0
- package/dist/bin/loader/read-default-tsconfig.js +92 -0
- package/dist/bin/loader/read-default-tsconfig.js.map +1 -0
- package/dist/bin/migrate.d.ts +7 -1
- package/dist/bin/migrate.d.ts.map +1 -1
- package/dist/bin/migrate.js +12 -37
- package/dist/bin/migrate.js.map +1 -0
- package/dist/collections/config/build.d.ts +1 -1
- package/dist/collections/config/build.d.ts.map +1 -1
- package/dist/collections/config/build.js +2 -12
- package/dist/collections/config/build.js.map +1 -0
- package/dist/collections/config/client.d.ts +322 -0
- package/dist/collections/config/client.d.ts.map +1 -0
- package/dist/collections/config/client.js +72 -0
- package/dist/collections/config/client.js.map +1 -0
- package/dist/collections/config/defaults.d.ts +5 -5
- package/dist/collections/config/defaults.js +9 -32
- package/dist/collections/config/defaults.js.map +1 -0
- package/dist/collections/config/sanitize.d.ts +2 -2
- package/dist/collections/config/sanitize.d.ts.map +1 -1
- package/dist/collections/config/sanitize.js +38 -54
- package/dist/collections/config/sanitize.js.map +1 -0
- package/dist/collections/config/schema.d.ts.map +1 -1
- package/dist/collections/config/schema.js +152 -176
- package/dist/collections/config/schema.js.map +1 -0
- package/dist/collections/config/types.d.ts +25 -52
- package/dist/collections/config/types.d.ts.map +1 -1
- package/dist/collections/config/types.js +2 -5
- package/dist/collections/config/types.js.map +1 -0
- package/dist/collections/dataloader.d.ts +2 -2
- package/dist/collections/dataloader.d.ts.map +1 -1
- package/dist/collections/dataloader.js +8 -23
- package/dist/collections/dataloader.js.map +1 -0
- package/dist/collections/operations/create.d.ts +4 -12
- package/dist/collections/operations/create.d.ts.map +1 -1
- package/dist/collections/operations/create.js +38 -53
- package/dist/collections/operations/create.js.map +1 -0
- package/dist/collections/operations/delete.d.ts +5 -14
- package/dist/collections/operations/delete.d.ts.map +1 -1
- package/dist/collections/operations/delete.js +27 -42
- package/dist/collections/operations/delete.js.map +1 -0
- package/dist/collections/operations/deleteByID.d.ts +2 -3
- package/dist/collections/operations/deleteByID.d.ts.map +1 -1
- package/dist/collections/operations/deleteByID.js +27 -42
- package/dist/collections/operations/deleteByID.js.map +1 -0
- package/dist/collections/operations/docAccess.d.ts +3 -3
- package/dist/collections/operations/docAccess.d.ts.map +1 -1
- package/dist/collections/operations/docAccess.js +12 -22
- package/dist/collections/operations/docAccess.js.map +1 -0
- package/dist/collections/operations/duplicate.d.ts +14 -0
- package/dist/collections/operations/duplicate.d.ts.map +1 -0
- package/dist/collections/operations/duplicate.js +257 -0
- package/dist/collections/operations/duplicate.js.map +1 -0
- package/dist/collections/operations/find.d.ts +3 -4
- package/dist/collections/operations/find.d.ts.map +1 -1
- package/dist/collections/operations/find.js +25 -40
- package/dist/collections/operations/find.js.map +1 -0
- 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 +21 -36
- package/dist/collections/operations/findByID.js.map +1 -0
- package/dist/collections/operations/findVersionByID.d.ts +3 -3
- package/dist/collections/operations/findVersionByID.d.ts.map +1 -1
- package/dist/collections/operations/findVersionByID.js +19 -34
- package/dist/collections/operations/findVersionByID.js.map +1 -0
- package/dist/collections/operations/findVersions.d.ts +4 -5
- package/dist/collections/operations/findVersions.d.ts.map +1 -1
- package/dist/collections/operations/findVersions.js +20 -35
- package/dist/collections/operations/findVersions.js.map +1 -0
- package/dist/collections/operations/local/create.d.ts +4 -5
- package/dist/collections/operations/local/create.d.ts.map +1 -1
- package/dist/collections/operations/local/create.js +11 -25
- package/dist/collections/operations/local/create.js.map +1 -0
- package/dist/collections/operations/local/delete.d.ts +5 -5
- package/dist/collections/operations/local/delete.d.ts.map +1 -1
- package/dist/collections/operations/local/delete.js +10 -20
- package/dist/collections/operations/local/delete.js.map +1 -0
- package/dist/collections/operations/local/duplicate.d.ts +21 -0
- package/dist/collections/operations/local/duplicate.d.ts.map +1 -0
- package/dist/collections/operations/local/duplicate.js +25 -0
- package/dist/collections/operations/local/duplicate.js.map +1 -0
- package/dist/collections/operations/local/find.d.ts +3 -4
- package/dist/collections/operations/local/find.d.ts.map +1 -1
- package/dist/collections/operations/local/find.js +8 -18
- package/dist/collections/operations/local/find.js.map +1 -0
- package/dist/collections/operations/local/findByID.d.ts +2 -4
- package/dist/collections/operations/local/findByID.d.ts.map +1 -1
- package/dist/collections/operations/local/findByID.js +8 -18
- package/dist/collections/operations/local/findByID.js.map +1 -0
- package/dist/collections/operations/local/findVersionByID.d.ts +3 -4
- package/dist/collections/operations/local/findVersionByID.d.ts.map +1 -1
- package/dist/collections/operations/local/findVersionByID.js +8 -18
- package/dist/collections/operations/local/findVersionByID.js.map +1 -0
- package/dist/collections/operations/local/findVersions.d.ts +4 -5
- package/dist/collections/operations/local/findVersions.d.ts.map +1 -1
- package/dist/collections/operations/local/findVersions.js +8 -18
- package/dist/collections/operations/local/findVersions.js.map +1 -0
- package/dist/collections/operations/local/index.d.ts +16 -13
- package/dist/collections/operations/local/index.d.ts.map +1 -1
- package/dist/collections/operations/local/index.js +22 -35
- package/dist/collections/operations/local/index.js.map +1 -0
- package/dist/collections/operations/local/restoreVersion.d.ts +2 -3
- package/dist/collections/operations/local/restoreVersion.d.ts.map +1 -1
- package/dist/collections/operations/local/restoreVersion.js +8 -18
- package/dist/collections/operations/local/restoreVersion.js.map +1 -0
- package/dist/collections/operations/local/update.d.ts +4 -5
- package/dist/collections/operations/local/update.d.ts.map +1 -1
- package/dist/collections/operations/local/update.js +12 -27
- package/dist/collections/operations/local/update.js.map +1 -0
- 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 +26 -41
- package/dist/collections/operations/restoreVersion.js.map +1 -0
- package/dist/collections/operations/update.d.ts +5 -10
- package/dist/collections/operations/update.d.ts.map +1 -1
- package/dist/collections/operations/update.js +43 -58
- package/dist/collections/operations/update.js.map +1 -0
- package/dist/collections/operations/updateByID.d.ts +4 -12
- package/dist/collections/operations/updateByID.d.ts.map +1 -1
- package/dist/collections/operations/updateByID.js +44 -59
- package/dist/collections/operations/updateByID.js.map +1 -0
- package/dist/collections/operations/utils.d.ts +13 -13
- package/dist/collections/operations/utils.d.ts.map +1 -1
- package/dist/collections/operations/utils.js +3 -12
- package/dist/collections/operations/utils.js.map +1 -0
- package/dist/config/build.d.ts +1 -1
- package/dist/config/build.d.ts.map +1 -1
- package/dist/config/build.js +9 -15
- package/dist/config/build.js.map +1 -0
- package/dist/config/client.d.ts +18 -0
- package/dist/config/client.d.ts.map +1 -0
- package/dist/config/client.js +65 -0
- package/dist/config/client.js.map +1 -0
- package/dist/config/defaults.d.ts +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +3 -21
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/find.d.ts +1 -2
- package/dist/config/find.d.ts.map +1 -1
- package/dist/config/find.js +18 -34
- package/dist/config/find.js.map +1 -0
- package/dist/config/sanitize.d.ts +1 -1
- package/dist/config/sanitize.d.ts.map +1 -1
- package/dist/config/sanitize.js +27 -40
- package/dist/config/sanitize.js.map +1 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +113 -133
- package/dist/config/schema.js.map +1 -0
- package/dist/config/shared/adminViewSchema.js +9 -24
- package/dist/config/shared/adminViewSchema.js.map +1 -0
- package/dist/config/shared/componentSchema.js +21 -50
- package/dist/config/shared/componentSchema.js.map +1 -0
- package/dist/config/types.d.ts +56 -52
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js +9 -21
- package/dist/config/types.js.map +1 -0
- package/dist/config/validate.d.ts +2 -3
- package/dist/config/validate.d.ts.map +1 -1
- package/dist/config/validate.js +17 -74
- package/dist/config/validate.js.map +1 -0
- package/dist/database/combineQueries.d.ts +1 -1
- package/dist/database/combineQueries.d.ts.map +1 -1
- package/dist/database/combineQueries.js +4 -14
- package/dist/database/combineQueries.js.map +1 -0
- package/dist/database/createDatabaseAdapter.d.ts +1 -1
- package/dist/database/createDatabaseAdapter.d.ts.map +1 -1
- package/dist/database/createDatabaseAdapter.js +14 -24
- package/dist/database/createDatabaseAdapter.js.map +1 -0
- package/dist/database/flattenWhereToOperators.d.ts +1 -1
- package/dist/database/flattenWhereToOperators.d.ts.map +1 -1
- package/dist/database/flattenWhereToOperators.js +2 -12
- package/dist/database/flattenWhereToOperators.js.map +1 -0
- package/dist/database/getLocalizedPaths.d.ts +3 -3
- package/dist/database/getLocalizedPaths.d.ts.map +1 -1
- package/dist/database/getLocalizedPaths.js +7 -22
- package/dist/database/getLocalizedPaths.js.map +1 -0
- package/dist/database/migrations/createMigration.d.ts +1 -1
- package/dist/database/migrations/createMigration.d.ts.map +1 -1
- package/dist/database/migrations/createMigration.js +7 -22
- package/dist/database/migrations/createMigration.js.map +1 -0
- package/dist/database/migrations/getMigrations.d.ts +2 -2
- package/dist/database/migrations/getMigrations.d.ts.map +1 -1
- package/dist/database/migrations/getMigrations.js +4 -12
- package/dist/database/migrations/getMigrations.js.map +1 -0
- package/dist/database/migrations/migrate.d.ts +1 -1
- package/dist/database/migrations/migrate.d.ts.map +1 -1
- package/dist/database/migrations/migrate.js +12 -22
- package/dist/database/migrations/migrate.js.map +1 -0
- package/dist/database/migrations/migrateDown.d.ts +1 -1
- package/dist/database/migrations/migrateDown.d.ts.map +1 -1
- package/dist/database/migrations/migrateDown.js +12 -22
- package/dist/database/migrations/migrateDown.js.map +1 -0
- package/dist/database/migrations/migrateRefresh.d.ts +1 -1
- package/dist/database/migrations/migrateRefresh.d.ts.map +1 -1
- package/dist/database/migrations/migrateRefresh.js +16 -24
- package/dist/database/migrations/migrateRefresh.js.map +1 -0
- package/dist/database/migrations/migrateReset.d.ts +1 -1
- package/dist/database/migrations/migrateReset.d.ts.map +1 -1
- package/dist/database/migrations/migrateReset.js +12 -22
- package/dist/database/migrations/migrateReset.js.map +1 -0
- package/dist/database/migrations/migrateStatus.d.ts +1 -1
- package/dist/database/migrations/migrateStatus.d.ts.map +1 -1
- package/dist/database/migrations/migrateStatus.js +8 -18
- package/dist/database/migrations/migrateStatus.js.map +1 -0
- package/dist/database/migrations/migrationTemplate.js +2 -12
- package/dist/database/migrations/migrationTemplate.js.map +1 -0
- package/dist/database/migrations/migrationsCollection.d.ts +1 -1
- package/dist/database/migrations/migrationsCollection.d.ts.map +1 -1
- package/dist/database/migrations/migrationsCollection.js +2 -12
- package/dist/database/migrations/migrationsCollection.js.map +1 -0
- package/dist/database/migrations/readMigrationFiles.d.ts +2 -2
- package/dist/database/migrations/readMigrationFiles.d.ts.map +1 -1
- package/dist/database/migrations/readMigrationFiles.js +18 -25
- package/dist/database/migrations/readMigrationFiles.js.map +1 -0
- package/dist/database/queryValidation/types.d.ts +2 -2
- package/dist/database/queryValidation/types.d.ts.map +1 -1
- package/dist/database/queryValidation/types.js +2 -5
- package/dist/database/queryValidation/types.js.map +1 -0
- package/dist/database/queryValidation/validateQueryPaths.d.ts +5 -5
- package/dist/database/queryValidation/validateQueryPaths.d.ts.map +1 -1
- package/dist/database/queryValidation/validateQueryPaths.js +13 -28
- package/dist/database/queryValidation/validateQueryPaths.js.map +1 -0
- package/dist/database/queryValidation/validateSearchParams.d.ts +5 -5
- package/dist/database/queryValidation/validateSearchParams.d.ts.map +1 -1
- package/dist/database/queryValidation/validateSearchParams.js +18 -25
- package/dist/database/queryValidation/validateSearchParams.js.map +1 -0
- package/dist/database/types.d.ts +16 -10
- package/dist/database/types.d.ts.map +1 -1
- package/dist/database/types.js +2 -5
- package/dist/database/types.js.map +1 -0
- package/dist/email/build.d.ts +2 -2
- package/dist/email/build.d.ts.map +1 -1
- package/dist/email/build.js +11 -26
- package/dist/email/build.js.map +1 -0
- package/dist/email/defaults.d.ts +1 -1
- package/dist/email/defaults.d.ts.map +1 -1
- package/dist/email/defaults.js +2 -12
- package/dist/email/defaults.js.map +1 -0
- package/dist/email/mockHandler.d.ts +2 -2
- package/dist/email/mockHandler.d.ts.map +1 -1
- package/dist/email/mockHandler.js +8 -23
- package/dist/email/mockHandler.js.map +1 -0
- package/dist/email/sendEmail.js +2 -12
- package/dist/email/sendEmail.js.map +1 -0
- package/dist/email/types.js +2 -5
- package/dist/email/types.js.map +1 -0
- package/dist/errors/APIError.js +4 -19
- package/dist/errors/APIError.js.map +1 -0
- package/dist/errors/AuthenticationError.d.ts +1 -1
- package/dist/errors/AuthenticationError.d.ts.map +1 -1
- package/dist/errors/AuthenticationError.js +7 -22
- package/dist/errors/AuthenticationError.js.map +1 -0
- package/dist/errors/DuplicateCollection.d.ts +1 -1
- package/dist/errors/DuplicateCollection.d.ts.map +1 -1
- package/dist/errors/DuplicateCollection.js +4 -19
- package/dist/errors/DuplicateCollection.js.map +1 -0
- package/dist/errors/DuplicateFieldName.d.ts +1 -1
- package/dist/errors/DuplicateFieldName.d.ts.map +1 -1
- package/dist/errors/DuplicateFieldName.js +4 -19
- package/dist/errors/DuplicateFieldName.js.map +1 -0
- package/dist/errors/DuplicateGlobal.d.ts +2 -2
- package/dist/errors/DuplicateGlobal.d.ts.map +1 -1
- package/dist/errors/DuplicateGlobal.js +4 -19
- package/dist/errors/DuplicateGlobal.js.map +1 -0
- package/dist/errors/ErrorDeletingFile.d.ts +1 -1
- package/dist/errors/ErrorDeletingFile.d.ts.map +1 -1
- package/dist/errors/ErrorDeletingFile.js +7 -22
- package/dist/errors/ErrorDeletingFile.js.map +1 -0
- package/dist/errors/FileUploadError.d.ts +1 -1
- package/dist/errors/FileUploadError.d.ts.map +1 -1
- package/dist/errors/FileUploadError.js +7 -22
- package/dist/errors/FileUploadError.js.map +1 -0
- package/dist/errors/Forbidden.d.ts +1 -1
- package/dist/errors/Forbidden.d.ts.map +1 -1
- package/dist/errors/Forbidden.js +7 -22
- package/dist/errors/Forbidden.js.map +1 -0
- package/dist/errors/InvalidConfiguration.d.ts +1 -1
- package/dist/errors/InvalidConfiguration.d.ts.map +1 -1
- package/dist/errors/InvalidConfiguration.js +6 -21
- package/dist/errors/InvalidConfiguration.js.map +1 -0
- package/dist/errors/InvalidFieldName.d.ts +2 -2
- package/dist/errors/InvalidFieldName.d.ts.map +1 -1
- package/dist/errors/InvalidFieldName.js +4 -19
- package/dist/errors/InvalidFieldName.js.map +1 -0
- package/dist/errors/InvalidFieldRelationship.d.ts +2 -2
- package/dist/errors/InvalidFieldRelationship.d.ts.map +1 -1
- package/dist/errors/InvalidFieldRelationship.js +4 -19
- package/dist/errors/InvalidFieldRelationship.js.map +1 -0
- package/dist/errors/InvalidSchema.d.ts +1 -1
- package/dist/errors/InvalidSchema.d.ts.map +1 -1
- package/dist/errors/InvalidSchema.js +6 -21
- package/dist/errors/InvalidSchema.js.map +1 -0
- package/dist/errors/LockedAuth.d.ts +1 -1
- package/dist/errors/LockedAuth.d.ts.map +1 -1
- package/dist/errors/LockedAuth.js +7 -22
- package/dist/errors/LockedAuth.js.map +1 -0
- package/dist/errors/MissingCollectionLabel.d.ts +1 -1
- package/dist/errors/MissingCollectionLabel.d.ts.map +1 -1
- package/dist/errors/MissingCollectionLabel.js +4 -19
- package/dist/errors/MissingCollectionLabel.js.map +1 -0
- package/dist/errors/MissingEditorProp.d.ts +7 -0
- package/dist/errors/MissingEditorProp.d.ts.map +1 -0
- package/dist/errors/MissingEditorProp.js +10 -0
- package/dist/errors/MissingEditorProp.js.map +1 -0
- package/dist/errors/MissingFieldInputOptions.d.ts +2 -2
- package/dist/errors/MissingFieldInputOptions.d.ts.map +1 -1
- package/dist/errors/MissingFieldInputOptions.js +4 -19
- package/dist/errors/MissingFieldInputOptions.js.map +1 -0
- package/dist/errors/MissingFieldType.d.ts +2 -2
- package/dist/errors/MissingFieldType.d.ts.map +1 -1
- package/dist/errors/MissingFieldType.js +6 -21
- package/dist/errors/MissingFieldType.js.map +1 -0
- package/dist/errors/MissingFile.d.ts +1 -1
- package/dist/errors/MissingFile.d.ts.map +1 -1
- package/dist/errors/MissingFile.js +7 -22
- package/dist/errors/MissingFile.js.map +1 -0
- package/dist/errors/NotFound.d.ts +1 -1
- package/dist/errors/NotFound.d.ts.map +1 -1
- package/dist/errors/NotFound.js +7 -22
- package/dist/errors/NotFound.js.map +1 -0
- package/dist/errors/QueryError.d.ts +1 -1
- package/dist/errors/QueryError.d.ts.map +1 -1
- package/dist/errors/QueryError.js +6 -21
- package/dist/errors/QueryError.js.map +1 -0
- package/dist/errors/TimestampsRequired.d.ts +2 -2
- package/dist/errors/TimestampsRequired.d.ts.map +1 -1
- package/dist/errors/TimestampsRequired.js +4 -19
- package/dist/errors/TimestampsRequired.js.map +1 -0
- package/dist/errors/UnathorizedError.d.ts +1 -1
- package/dist/errors/UnathorizedError.d.ts.map +1 -1
- package/dist/errors/UnathorizedError.js +7 -22
- package/dist/errors/UnathorizedError.js.map +1 -0
- package/dist/errors/ValidationError.d.ts +1 -1
- package/dist/errors/ValidationError.d.ts.map +1 -1
- package/dist/errors/ValidationError.js +8 -23
- package/dist/errors/ValidationError.js.map +1 -0
- package/dist/errors/index.d.ts +19 -19
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +20 -94
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/types.d.ts +1 -1
- package/dist/errors/types.d.ts.map +1 -1
- package/dist/errors/types.js +2 -19
- package/dist/errors/types.js.map +1 -0
- package/dist/exports/auth.d.ts +5 -5
- package/dist/exports/auth.d.ts.map +1 -1
- package/dist/exports/auth.js +5 -44
- package/dist/exports/auth.js.map +1 -0
- package/dist/exports/components/utilities.js +1 -2
- package/dist/exports/components/utilities.js.map +1 -0
- package/dist/exports/config.d.ts +13 -10
- package/dist/exports/config.d.ts.map +1 -1
- package/dist/exports/config.js +13 -59
- package/dist/exports/config.js.map +1 -0
- package/dist/exports/database.d.ts +22 -22
- package/dist/exports/database.d.ts.map +1 -1
- package/dist/exports/database.js +21 -108
- package/dist/exports/database.js.map +1 -0
- package/dist/exports/errors.d.ts +1 -1
- package/dist/exports/errors.d.ts.map +1 -1
- package/dist/exports/errors.js +2 -68
- package/dist/exports/errors.js.map +1 -0
- package/dist/exports/fields/index.d.ts +2 -2
- package/dist/exports/fields/index.d.ts.map +1 -1
- package/dist/exports/fields/index.js +3 -26
- package/dist/exports/fields/index.js.map +1 -0
- package/dist/exports/fields/validations.d.ts +1 -1
- package/dist/exports/fields/validations.d.ts.map +1 -1
- package/dist/exports/fields/validations.js +2 -19
- package/dist/exports/fields/validations.js.map +1 -0
- package/dist/exports/node.d.ts +3 -0
- package/dist/exports/node.d.ts.map +1 -0
- package/dist/exports/node.js +4 -0
- package/dist/exports/node.js.map +1 -0
- package/dist/exports/operations.d.ts +29 -28
- package/dist/exports/operations.d.ts.map +1 -1
- package/dist/exports/operations.js +30 -125
- package/dist/exports/operations.js.map +1 -0
- package/dist/exports/types.d.ts +16 -11
- package/dist/exports/types.d.ts.map +1 -1
- package/dist/exports/types.js +4 -74
- package/dist/exports/types.js.map +1 -0
- package/dist/exports/uploads.d.ts +2 -0
- package/dist/exports/uploads.d.ts.map +1 -0
- package/dist/exports/uploads.js +3 -0
- package/dist/exports/uploads.js.map +1 -0
- package/dist/exports/utilities.d.ts +31 -27
- package/dist/exports/utilities.d.ts.map +1 -1
- package/dist/exports/utilities.js +32 -141
- package/dist/exports/utilities.js.map +1 -0
- package/dist/exports/versions.d.ts +8 -9
- package/dist/exports/versions.d.ts.map +1 -1
- package/dist/exports/versions.js +8 -45
- package/dist/exports/versions.js.map +1 -0
- package/dist/fields/baseFields/baseBlockFields.d.ts +2 -2
- package/dist/fields/baseFields/baseBlockFields.d.ts.map +1 -1
- package/dist/fields/baseFields/baseBlockFields.js +6 -16
- package/dist/fields/baseFields/baseBlockFields.js.map +1 -0
- package/dist/fields/baseFields/baseIDField.d.ts +2 -2
- package/dist/fields/baseFields/baseIDField.d.ts.map +1 -1
- package/dist/fields/baseFields/baseIDField.js +17 -23
- package/dist/fields/baseFields/baseIDField.js.map +1 -0
- package/dist/fields/config/client.d.ts +1289 -0
- package/dist/fields/config/client.d.ts.map +1 -0
- package/dist/fields/config/client.js +79 -0
- package/dist/fields/config/client.js.map +1 -0
- package/dist/fields/config/sanitize.d.ts +9 -3
- package/dist/fields/config/sanitize.d.ts.map +1 -1
- package/dist/fields/config/sanitize.js +40 -45
- package/dist/fields/config/sanitize.js.map +1 -0
- package/dist/fields/config/sanitize.spec.js +25 -29
- package/dist/fields/config/sanitize.spec.js.map +1 -0
- package/dist/fields/config/schema.d.ts.map +1 -1
- package/dist/fields/config/schema.js +349 -432
- package/dist/fields/config/schema.js.map +1 -0
- package/dist/fields/config/types.d.ts +82 -20
- package/dist/fields/config/types.d.ts.map +1 -1
- package/dist/fields/config/types.js +15 -69
- package/dist/fields/config/types.js.map +1 -0
- package/dist/fields/getDefaultValue.d.ts +2 -2
- package/dist/fields/getDefaultValue.d.ts.map +1 -1
- package/dist/fields/getDefaultValue.js +8 -13
- package/dist/fields/getDefaultValue.js.map +1 -0
- package/dist/fields/hooks/afterChange/index.d.ts +7 -3
- package/dist/fields/hooks/afterChange/index.d.ts.map +1 -1
- package/dist/fields/hooks/afterChange/index.js +9 -16
- package/dist/fields/hooks/afterChange/index.js.map +1 -0
- package/dist/fields/hooks/afterChange/promise.d.ts +4 -4
- package/dist/fields/hooks/afterChange/promise.d.ts.map +1 -1
- package/dist/fields/hooks/afterChange/promise.js +14 -22
- package/dist/fields/hooks/afterChange/promise.js.map +1 -0
- package/dist/fields/hooks/afterChange/traverseFields.d.ts +4 -4
- package/dist/fields/hooks/afterChange/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/afterChange/traverseFields.js +4 -14
- package/dist/fields/hooks/afterChange/traverseFields.js.map +1 -0
- package/dist/fields/hooks/afterRead/index.d.ts +12 -3
- package/dist/fields/hooks/afterRead/index.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/index.js +14 -16
- package/dist/fields/hooks/afterRead/index.js.map +1 -0
- package/dist/fields/hooks/afterRead/promise.d.ts +4 -4
- package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/promise.js +28 -38
- package/dist/fields/hooks/afterRead/promise.js.map +1 -0
- 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 +5 -15
- package/dist/fields/hooks/afterRead/relationshipPopulationPromise.js.map +1 -0
- package/dist/fields/hooks/afterRead/traverseFields.d.ts +4 -4
- package/dist/fields/hooks/afterRead/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/traverseFields.js +4 -14
- package/dist/fields/hooks/afterRead/traverseFields.js.map +1 -0
- package/dist/fields/hooks/beforeChange/beforeDuplicate.d.ts +3 -0
- package/dist/fields/hooks/beforeChange/beforeDuplicate.d.ts.map +1 -0
- package/dist/fields/hooks/beforeChange/beforeDuplicate.js +6 -0
- package/dist/fields/hooks/beforeChange/beforeDuplicate.js.map +1 -0
- package/dist/fields/hooks/beforeChange/cloneDataFromOriginalDoc.js +2 -12
- package/dist/fields/hooks/beforeChange/cloneDataFromOriginalDoc.js.map +1 -0
- package/dist/fields/hooks/beforeChange/getExistingRowDoc.js +2 -12
- package/dist/fields/hooks/beforeChange/getExistingRowDoc.js.map +1 -0
- package/dist/fields/hooks/beforeChange/index.d.ts +14 -5
- package/dist/fields/hooks/beforeChange/index.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/index.js +21 -19
- package/dist/fields/hooks/beforeChange/index.js.map +1 -0
- package/dist/fields/hooks/beforeChange/promise.d.ts +7 -7
- package/dist/fields/hooks/beforeChange/promise.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/promise.js +71 -54
- package/dist/fields/hooks/beforeChange/promise.js.map +1 -0
- package/dist/fields/hooks/beforeChange/traverseFields.d.ts +15 -7
- package/dist/fields/hooks/beforeChange/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/traverseFields.js +12 -14
- package/dist/fields/hooks/beforeChange/traverseFields.js.map +1 -0
- package/dist/fields/hooks/beforeValidate/index.d.ts +12 -3
- package/dist/fields/hooks/beforeValidate/index.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/index.js +13 -16
- package/dist/fields/hooks/beforeValidate/index.js.map +1 -0
- package/dist/fields/hooks/beforeValidate/promise.d.ts +4 -4
- package/dist/fields/hooks/beforeValidate/promise.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/promise.js +30 -39
- package/dist/fields/hooks/beforeValidate/promise.js.map +1 -0
- package/dist/fields/hooks/beforeValidate/traverseFields.d.ts +4 -4
- package/dist/fields/hooks/beforeValidate/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/traverseFields.js +4 -14
- package/dist/fields/hooks/beforeValidate/traverseFields.js.map +1 -0
- package/dist/fields/mergeBaseFields.d.ts +1 -1
- package/dist/fields/mergeBaseFields.d.ts.map +1 -1
- package/dist/fields/mergeBaseFields.js +8 -23
- package/dist/fields/mergeBaseFields.js.map +1 -0
- package/dist/fields/setDefaultBeforeDuplicate.d.ts +3 -0
- package/dist/fields/setDefaultBeforeDuplicate.d.ts.map +1 -0
- package/dist/fields/setDefaultBeforeDuplicate.js +20 -0
- package/dist/fields/setDefaultBeforeDuplicate.js.map +1 -0
- package/dist/fields/sortableFieldTypes.js +2 -12
- package/dist/fields/sortableFieldTypes.js.map +1 -0
- package/dist/fields/validations.d.ts +6 -6
- package/dist/fields/validations.d.ts.map +1 -1
- package/dist/fields/validations.js +36 -101
- package/dist/fields/validations.js.map +1 -0
- package/dist/fields/validations.spec.js +73 -77
- package/dist/fields/validations.spec.js.map +1 -0
- package/dist/globals/config/client.d.ts +21 -0
- package/dist/globals/config/client.d.ts.map +1 -0
- package/dist/globals/config/client.js +48 -0
- package/dist/globals/config/client.js.map +1 -0
- package/dist/globals/config/sanitize.d.ts +2 -2
- package/dist/globals/config/sanitize.d.ts.map +1 -1
- package/dist/globals/config/sanitize.js +18 -34
- package/dist/globals/config/sanitize.js.map +1 -0
- package/dist/globals/config/schema.d.ts.map +1 -1
- package/dist/globals/config/schema.js +56 -70
- package/dist/globals/config/schema.js.map +1 -0
- package/dist/globals/config/types.d.ts +18 -32
- package/dist/globals/config/types.d.ts.map +1 -1
- package/dist/globals/config/types.js +2 -5
- package/dist/globals/config/types.js.map +1 -0
- package/dist/globals/operations/docAccess.d.ts +3 -3
- package/dist/globals/operations/docAccess.d.ts.map +1 -1
- package/dist/globals/operations/docAccess.js +12 -22
- package/dist/globals/operations/docAccess.js.map +1 -0
- 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 +14 -29
- package/dist/globals/operations/findOne.js.map +1 -0
- package/dist/globals/operations/findVersionByID.d.ts +3 -3
- package/dist/globals/operations/findVersionByID.d.ts.map +1 -1
- package/dist/globals/operations/findVersionByID.js +18 -33
- package/dist/globals/operations/findVersionByID.js.map +1 -0
- package/dist/globals/operations/findVersions.d.ts +4 -5
- package/dist/globals/operations/findVersions.d.ts.map +1 -1
- package/dist/globals/operations/findVersions.js +20 -35
- package/dist/globals/operations/findVersions.js.map +1 -0
- package/dist/globals/operations/local/findOne.d.ts +2 -4
- package/dist/globals/operations/local/findOne.d.ts.map +1 -1
- package/dist/globals/operations/local/findOne.js +11 -21
- package/dist/globals/operations/local/findOne.js.map +1 -0
- package/dist/globals/operations/local/findVersionByID.d.ts +3 -5
- package/dist/globals/operations/local/findVersionByID.d.ts.map +1 -1
- package/dist/globals/operations/local/findVersionByID.js +10 -19
- package/dist/globals/operations/local/findVersionByID.js.map +1 -0
- package/dist/globals/operations/local/findVersions.d.ts +4 -6
- package/dist/globals/operations/local/findVersions.d.ts.map +1 -1
- package/dist/globals/operations/local/findVersions.js +9 -19
- package/dist/globals/operations/local/findVersions.js.map +1 -0
- package/dist/globals/operations/local/index.d.ts +5 -5
- package/dist/globals/operations/local/index.d.ts.map +1 -1
- package/dist/globals/operations/local/index.js +12 -27
- package/dist/globals/operations/local/index.js.map +1 -0
- package/dist/globals/operations/local/restoreVersion.d.ts +2 -4
- package/dist/globals/operations/local/restoreVersion.d.ts.map +1 -1
- package/dist/globals/operations/local/restoreVersion.js +9 -19
- package/dist/globals/operations/local/restoreVersion.js.map +1 -0
- package/dist/globals/operations/local/update.d.ts +2 -4
- package/dist/globals/operations/local/update.d.ts.map +1 -1
- package/dist/globals/operations/local/update.js +9 -19
- package/dist/globals/operations/local/update.js.map +1 -0
- package/dist/globals/operations/restoreVersion.d.ts +3 -3
- package/dist/globals/operations/restoreVersion.d.ts.map +1 -1
- package/dist/globals/operations/restoreVersion.js +16 -31
- package/dist/globals/operations/restoreVersion.js.map +1 -0
- package/dist/globals/operations/update.d.ts +4 -12
- package/dist/globals/operations/update.d.ts.map +1 -1
- package/dist/globals/operations/update.js +23 -38
- package/dist/globals/operations/update.js.map +1 -0
- package/dist/index.d.ts +60 -49
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +76 -79
- package/dist/index.js.map +1 -0
- package/dist/preferences/deleteUserPreferences.d.ts +3 -3
- package/dist/preferences/deleteUserPreferences.d.ts.map +1 -1
- package/dist/preferences/deleteUserPreferences.js +2 -12
- package/dist/preferences/deleteUserPreferences.js.map +1 -0
- package/dist/preferences/operations/delete.d.ts +2 -2
- package/dist/preferences/operations/delete.d.ts.map +1 -1
- package/dist/preferences/operations/delete.js +14 -31
- package/dist/preferences/operations/delete.js.map +1 -0
- package/dist/preferences/operations/findOne.d.ts +2 -2
- package/dist/preferences/operations/findOne.d.ts.map +1 -1
- package/dist/preferences/operations/findOne.js +5 -19
- package/dist/preferences/operations/findOne.js.map +1 -0
- package/dist/preferences/operations/update.d.ts +1 -1
- package/dist/preferences/operations/update.d.ts.map +1 -1
- package/dist/preferences/operations/update.js +8 -23
- package/dist/preferences/operations/update.js.map +1 -0
- package/dist/preferences/preferencesCollection.d.ts +2 -2
- package/dist/preferences/preferencesCollection.d.ts.map +1 -1
- package/dist/preferences/preferencesCollection.js +8 -18
- package/dist/preferences/preferencesCollection.js.map +1 -0
- package/dist/preferences/requestHandlers/delete.d.ts +1 -1
- package/dist/preferences/requestHandlers/delete.d.ts.map +1 -1
- package/dist/preferences/requestHandlers/delete.js +6 -21
- package/dist/preferences/requestHandlers/delete.js.map +1 -0
- package/dist/preferences/requestHandlers/findOne.d.ts +1 -1
- package/dist/preferences/requestHandlers/findOne.d.ts.map +1 -1
- package/dist/preferences/requestHandlers/findOne.js +6 -21
- package/dist/preferences/requestHandlers/findOne.js.map +1 -0
- package/dist/preferences/requestHandlers/update.d.ts +1 -1
- package/dist/preferences/requestHandlers/update.d.ts.map +1 -1
- package/dist/preferences/requestHandlers/update.js +6 -21
- package/dist/preferences/requestHandlers/update.js.map +1 -0
- package/dist/preferences/types.d.ts +7 -6
- package/dist/preferences/types.d.ts.map +1 -1
- package/dist/preferences/types.js +2 -5
- package/dist/preferences/types.js.map +1 -0
- package/dist/translations/getLocalI18n.d.ts +3 -2
- package/dist/translations/getLocalI18n.d.ts.map +1 -1
- package/dist/translations/getLocalI18n.js +4 -16
- package/dist/translations/getLocalI18n.js.map +1 -0
- package/dist/types/constants.js +2 -12
- package/dist/types/constants.js.map +1 -0
- package/dist/types/index.d.ts +8 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -12
- package/dist/types/index.js.map +1 -0
- package/dist/uploads/canResizeImage.js +4 -13
- package/dist/uploads/canResizeImage.js.map +1 -0
- package/dist/uploads/cropImage.d.ts +3 -7
- package/dist/uploads/cropImage.d.ts.map +1 -1
- package/dist/uploads/cropImage.js +4 -28
- package/dist/uploads/cropImage.js.map +1 -0
- package/dist/uploads/deleteAssociatedFiles.d.ts +4 -4
- package/dist/uploads/deleteAssociatedFiles.d.ts.map +1 -1
- package/dist/uploads/deleteAssociatedFiles.js +11 -26
- package/dist/uploads/deleteAssociatedFiles.js.map +1 -0
- package/dist/uploads/docWithFilenameExists.d.ts +1 -1
- package/dist/uploads/docWithFilenameExists.d.ts.map +1 -1
- package/dist/uploads/docWithFilenameExists.js +2 -12
- package/dist/uploads/docWithFilenameExists.js.map +1 -0
- package/dist/uploads/fileExists.js +4 -19
- package/dist/uploads/fileExists.js.map +1 -0
- package/dist/uploads/formatFilesize.js +2 -12
- package/dist/uploads/formatFilesize.js.map +1 -0
- package/dist/uploads/generateFileData.d.ts +4 -4
- package/dist/uploads/generateFileData.d.ts.map +1 -1
- package/dist/uploads/generateFileData.js +42 -55
- package/dist/uploads/generateFileData.js.map +1 -0
- package/dist/uploads/getBaseFields.d.ts +5 -5
- package/dist/uploads/getBaseFields.d.ts.map +1 -1
- package/dist/uploads/getBaseFields.js +52 -36
- package/dist/uploads/getBaseFields.js.map +1 -0
- package/dist/uploads/getExternalFile.d.ts +2 -2
- package/dist/uploads/getExternalFile.d.ts.map +1 -1
- package/dist/uploads/getExternalFile.js +5 -15
- package/dist/uploads/getExternalFile.js.map +1 -0
- package/dist/uploads/getFileByPath.d.ts +2 -3
- package/dist/uploads/getFileByPath.d.ts.map +1 -1
- package/dist/uploads/getFileByPath.js +11 -26
- package/dist/uploads/getFileByPath.js.map +1 -0
- package/dist/uploads/getImageSize.d.ts +3 -3
- package/dist/uploads/getImageSize.d.ts.map +1 -1
- package/dist/uploads/getImageSize.js +7 -22
- package/dist/uploads/getImageSize.js.map +1 -0
- package/dist/uploads/getSafeFilename.d.ts +1 -1
- package/dist/uploads/getSafeFilename.d.ts.map +1 -1
- package/dist/uploads/getSafeFilename.js +8 -23
- package/dist/uploads/getSafeFilename.js.map +1 -0
- package/dist/uploads/imageResizer.d.ts +6 -5
- package/dist/uploads/imageResizer.d.ts.map +1 -1
- package/dist/uploads/imageResizer.js +29 -44
- package/dist/uploads/imageResizer.js.map +1 -0
- package/dist/uploads/isImage.d.ts.map +1 -1
- package/dist/uploads/isImage.js +4 -13
- package/dist/uploads/isImage.js.map +1 -0
- package/dist/uploads/mimeTypeValidator.d.ts +1 -1
- package/dist/uploads/mimeTypeValidator.d.ts.map +1 -1
- package/dist/uploads/mimeTypeValidator.js +2 -12
- package/dist/uploads/mimeTypeValidator.js.map +1 -0
- package/dist/uploads/mimeTypeValidator.spec.js +11 -15
- package/dist/uploads/mimeTypeValidator.spec.js.map +1 -0
- package/dist/uploads/saveBufferToFile.d.ts +1 -1
- package/dist/uploads/saveBufferToFile.js +6 -21
- package/dist/uploads/saveBufferToFile.js.map +1 -0
- package/dist/uploads/types.d.ts +9 -5
- package/dist/uploads/types.d.ts.map +1 -1
- package/dist/uploads/types.js +2 -5
- package/dist/uploads/types.js.map +1 -0
- package/dist/uploads/unlinkTempFiles.d.ts +3 -3
- package/dist/uploads/unlinkTempFiles.d.ts.map +1 -1
- package/dist/uploads/unlinkTempFiles.js +9 -22
- package/dist/uploads/unlinkTempFiles.js.map +1 -0
- package/dist/uploads/uploadFiles.d.ts +3 -3
- package/dist/uploads/uploadFiles.d.ts.map +1 -1
- package/dist/uploads/uploadFiles.js +6 -21
- package/dist/uploads/uploadFiles.js.map +1 -0
- package/dist/utilities/checkDuplicateCollections.d.ts +1 -1
- package/dist/utilities/checkDuplicateCollections.d.ts.map +1 -1
- package/dist/utilities/checkDuplicateCollections.js +4 -14
- package/dist/utilities/checkDuplicateCollections.js.map +1 -0
- package/dist/utilities/combineMerge.js +4 -19
- package/dist/utilities/combineMerge.js.map +1 -0
- package/dist/utilities/commitTransaction.d.ts +1 -1
- package/dist/utilities/commitTransaction.d.ts.map +1 -1
- package/dist/utilities/commitTransaction.js +4 -12
- package/dist/utilities/commitTransaction.js.map +1 -0
- package/dist/utilities/configToJSONSchema.d.ts +12 -6
- package/dist/utilities/configToJSONSchema.d.ts.map +1 -1
- package/dist/utilities/configToJSONSchema.js +82 -97
- package/dist/utilities/configToJSONSchema.js.map +1 -0
- package/dist/utilities/configToJSONSchema.spec.js +5 -9
- package/dist/utilities/configToJSONSchema.spec.js.map +1 -0
- package/dist/utilities/convertData.js +3 -23
- package/dist/utilities/convertData.js.map +1 -0
- package/dist/utilities/createArrayFromCommaDelineated.js +2 -12
- package/dist/utilities/createArrayFromCommaDelineated.js.map +1 -0
- package/dist/utilities/createLocalReq.d.ts +3 -3
- package/dist/utilities/createLocalReq.d.ts.map +1 -1
- package/dist/utilities/createLocalReq.js +26 -38
- package/dist/utilities/createLocalReq.js.map +1 -0
- package/dist/utilities/deepCopyObject.js +2 -12
- package/dist/utilities/deepCopyObject.js.map +1 -0
- package/dist/utilities/deepMerge.js +2 -12
- package/dist/utilities/deepMerge.js.map +1 -0
- package/dist/utilities/fieldSchemaToJSON.d.ts +3 -3
- package/dist/utilities/fieldSchemaToJSON.d.ts.map +1 -1
- package/dist/utilities/fieldSchemaToJSON.js +22 -22
- package/dist/utilities/fieldSchemaToJSON.js.map +1 -0
- package/dist/utilities/flattenTopLevelFields.d.ts +3 -2
- package/dist/utilities/flattenTopLevelFields.d.ts.map +1 -1
- package/dist/utilities/flattenTopLevelFields.js +7 -17
- package/dist/utilities/flattenTopLevelFields.js.map +1 -0
- package/dist/utilities/formatLabels.d.ts +0 -1
- package/dist/utilities/formatLabels.d.ts.map +1 -1
- package/dist/utilities/formatLabels.js +10 -70
- package/dist/utilities/formatLabels.js.map +1 -0
- package/dist/utilities/formatLabels.spec.js +8 -12
- package/dist/utilities/formatLabels.spec.js.map +1 -0
- package/dist/utilities/getCSSVariable.js +2 -12
- package/dist/utilities/getCSSVariable.js.map +1 -0
- package/dist/utilities/getCollectionIDFieldTypes.d.ts +13 -0
- package/dist/utilities/getCollectionIDFieldTypes.d.ts.map +1 -0
- package/dist/utilities/getCollectionIDFieldTypes.js +16 -0
- package/dist/utilities/getCollectionIDFieldTypes.js.map +1 -0
- package/dist/utilities/getEntityPolicies.d.ts +4 -4
- package/dist/utilities/getEntityPolicies.d.ts.map +1 -1
- package/dist/utilities/getEntityPolicies.js +7 -17
- package/dist/utilities/getEntityPolicies.js.map +1 -0
- package/dist/utilities/getIDType.d.ts +2 -2
- package/dist/utilities/getIDType.d.ts.map +1 -1
- package/dist/utilities/getIDType.js +2 -12
- package/dist/utilities/getIDType.js.map +1 -0
- package/dist/utilities/getObjectDotNotation.d.ts.map +1 -1
- package/dist/utilities/getObjectDotNotation.js +2 -12
- package/dist/utilities/getObjectDotNotation.js.map +1 -0
- package/dist/utilities/getUniqueListBy.js +2 -12
- package/dist/utilities/getUniqueListBy.js.map +1 -0
- package/dist/utilities/importWithoutClientFiles.d.ts +7 -0
- package/dist/utilities/importWithoutClientFiles.d.ts.map +1 -0
- package/dist/utilities/importWithoutClientFiles.js +41 -0
- package/dist/utilities/importWithoutClientFiles.js.map +1 -0
- package/dist/utilities/initTransaction.d.ts +1 -1
- package/dist/utilities/initTransaction.d.ts.map +1 -1
- package/dist/utilities/initTransaction.js +5 -12
- package/dist/utilities/initTransaction.js.map +1 -0
- package/dist/utilities/isEntityHidden.d.ts +2 -2
- package/dist/utilities/isEntityHidden.d.ts.map +1 -1
- package/dist/utilities/isEntityHidden.js +2 -12
- package/dist/utilities/isEntityHidden.js.map +1 -0
- package/dist/utilities/isNumber.js +2 -12
- package/dist/utilities/isNumber.js.map +1 -0
- package/dist/utilities/isPlainObject.d.ts +2 -0
- package/dist/utilities/isPlainObject.d.ts.map +1 -0
- package/dist/utilities/isPlainObject.js +25 -0
- package/dist/utilities/isPlainObject.js.map +1 -0
- package/dist/utilities/isReactComponent.d.ts +4 -0
- package/dist/utilities/isReactComponent.d.ts.map +1 -0
- package/dist/utilities/isReactComponent.js +11 -0
- package/dist/utilities/isReactComponent.js.map +1 -0
- package/dist/utilities/isValidID.d.ts.map +1 -1
- package/dist/utilities/isValidID.js +6 -20
- package/dist/utilities/isValidID.js.map +1 -0
- package/dist/utilities/isolateObjectProperty.js +2 -12
- package/dist/utilities/isolateObjectProperty.js.map +1 -0
- package/dist/utilities/killTransaction.d.ts +1 -1
- package/dist/utilities/killTransaction.d.ts.map +1 -1
- package/dist/utilities/killTransaction.js +4 -12
- package/dist/utilities/killTransaction.js.map +1 -0
- package/dist/utilities/logger.d.ts +6 -6
- package/dist/utilities/logger.d.ts.map +1 -1
- package/dist/utilities/logger.js +18 -37
- package/dist/utilities/logger.js.map +1 -0
- package/dist/utilities/mapAsync.js +2 -12
- package/dist/utilities/mapAsync.js.map +1 -0
- package/dist/utilities/mergeListSearchAndWhere.d.ts +12 -0
- package/dist/utilities/mergeListSearchAndWhere.d.ts.map +1 -0
- package/dist/utilities/mergeListSearchAndWhere.js +57 -0
- package/dist/utilities/mergeListSearchAndWhere.js.map +1 -0
- package/dist/utilities/overwriteMerge.js +2 -12
- package/dist/utilities/overwriteMerge.js.map +1 -0
- package/dist/utilities/parseCookies.js +4 -14
- package/dist/utilities/parseCookies.js.map +1 -0
- package/dist/utilities/sanitizeInternalFields.d.ts.map +1 -1
- package/dist/utilities/sanitizeInternalFields.js +2 -12
- package/dist/utilities/sanitizeInternalFields.js.map +1 -0
- package/dist/utilities/setsAreEqual.js +2 -12
- package/dist/utilities/setsAreEqual.js.map +1 -0
- 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 +8 -18
- package/dist/utilities/telemetry/events/adminInit.js.map +1 -0
- package/dist/utilities/telemetry/events/serverInit.d.ts +1 -1
- package/dist/utilities/telemetry/events/serverInit.d.ts.map +1 -1
- package/dist/utilities/telemetry/events/serverInit.js +4 -14
- package/dist/utilities/telemetry/events/serverInit.js.map +1 -0
- package/dist/utilities/telemetry/index.d.ts +3 -3
- package/dist/utilities/telemetry/index.d.ts.map +1 -1
- package/dist/utilities/telemetry/index.js +23 -41
- package/dist/utilities/telemetry/index.js.map +1 -0
- package/dist/utilities/telemetry/oneWayHash.d.ts +1 -0
- package/dist/utilities/telemetry/oneWayHash.d.ts.map +1 -1
- package/dist/utilities/telemetry/oneWayHash.js +4 -14
- package/dist/utilities/telemetry/oneWayHash.js.map +1 -0
- package/dist/utilities/timestamp.js +2 -12
- package/dist/utilities/timestamp.js.map +1 -0
- package/dist/utilities/toKebabCase.js +2 -12
- package/dist/utilities/toKebabCase.js.map +1 -0
- package/dist/utilities/wait.d.ts +1 -2
- package/dist/utilities/wait.d.ts.map +1 -1
- package/dist/utilities/wait.js +2 -13
- package/dist/utilities/wait.js.map +1 -0
- package/dist/utilities/wordBoundariesRegex.js +3 -13
- package/dist/utilities/wordBoundariesRegex.js.map +1 -0
- package/dist/versions/baseFields.d.ts +4 -2
- package/dist/versions/baseFields.d.ts.map +1 -1
- package/dist/versions/baseFields.js +8 -32
- package/dist/versions/baseFields.js.map +1 -0
- package/dist/versions/buildCollectionFields.d.ts +2 -2
- package/dist/versions/buildCollectionFields.d.ts.map +1 -1
- package/dist/versions/buildCollectionFields.js +2 -12
- package/dist/versions/buildCollectionFields.js.map +1 -0
- package/dist/versions/buildGlobalFields.d.ts +2 -2
- package/dist/versions/buildGlobalFields.d.ts.map +1 -1
- package/dist/versions/buildGlobalFields.js +12 -22
- package/dist/versions/buildGlobalFields.js.map +1 -0
- package/dist/versions/deleteCollectionVersions.d.ts +3 -3
- package/dist/versions/deleteCollectionVersions.d.ts.map +1 -1
- package/dist/versions/deleteCollectionVersions.js +2 -12
- package/dist/versions/deleteCollectionVersions.js.map +1 -0
- package/dist/versions/drafts/appendVersionToQueryKey.d.ts +1 -1
- package/dist/versions/drafts/appendVersionToQueryKey.d.ts.map +1 -1
- package/dist/versions/drafts/appendVersionToQueryKey.js +2 -12
- package/dist/versions/drafts/appendVersionToQueryKey.js.map +1 -0
- package/dist/versions/drafts/getQueryDraftsSort.js +2 -12
- package/dist/versions/drafts/getQueryDraftsSort.js.map +1 -0
- package/dist/versions/drafts/replaceWithDraftIfAvailable.d.ts +4 -4
- package/dist/versions/drafts/replaceWithDraftIfAvailable.d.ts.map +1 -1
- package/dist/versions/drafts/replaceWithDraftIfAvailable.js +13 -27
- package/dist/versions/drafts/replaceWithDraftIfAvailable.js.map +1 -0
- package/dist/versions/enforceMaxVersions.d.ts +3 -3
- package/dist/versions/enforceMaxVersions.d.ts.map +1 -1
- package/dist/versions/enforceMaxVersions.js +3 -12
- package/dist/versions/enforceMaxVersions.js.map +1 -0
- package/dist/versions/getLatestCollectionVersion.d.ts +3 -3
- package/dist/versions/getLatestCollectionVersion.d.ts.map +1 -1
- package/dist/versions/getLatestCollectionVersion.js +6 -14
- package/dist/versions/getLatestCollectionVersion.js.map +1 -0
- package/dist/versions/getLatestGlobalVersion.d.ts +3 -3
- package/dist/versions/getLatestGlobalVersion.d.ts.map +1 -1
- package/dist/versions/getLatestGlobalVersion.js +6 -15
- package/dist/versions/getLatestGlobalVersion.js.map +1 -0
- package/dist/versions/saveVersion.d.ts +4 -4
- package/dist/versions/saveVersion.d.ts.map +1 -1
- package/dist/versions/saveVersion.js +9 -23
- package/dist/versions/saveVersion.js.map +1 -0
- package/dist/versions/types.js +2 -5
- package/dist/versions/types.js.map +1 -0
- package/errors.d.ts +1 -1
- package/errors.js +2 -68
- package/node.d.ts +3 -0
- package/node.js +4 -0
- package/operations.d.ts +29 -28
- package/operations.js +30 -125
- package/package.json +13 -18
- package/src/index.ts +486 -0
- package/types.d.ts +16 -11
- package/types.js +4 -74
- package/uploads.d.ts +2 -0
- package/uploads.js +3 -0
- package/utilities.d.ts +31 -27
- package/utilities.js +32 -141
- package/versions.d.ts +8 -9
- package/versions.js +8 -45
- package/.eslintrc.js +0 -58
- package/.release-it.js +0 -51
- package/dist/auth/getAuthenticatedUser.d.ts +0 -3
- package/dist/auth/getAuthenticatedUser.d.ts.map +0 -1
- package/dist/auth/getAuthenticatedUser.js +0 -21
- package/dist/bundlers/mocks/db-mongodb.js +0 -3
- package/dist/bundlers/mocks/db-postgres.js +0 -13
- package/dist/bundlers/mocks/dotENV.js +0 -15
- package/dist/bundlers/mocks/emptyModule.js +0 -13
- package/dist/bundlers/mocks/fileMock.js +0 -13
- package/dist/bundlers/types.d.ts +0 -8
- package/dist/bundlers/types.d.ts.map +0 -1
- package/dist/bundlers/types.js +0 -6
- package/dist/config/clientFiles.d.ts +0 -2
- package/dist/config/clientFiles.d.ts.map +0 -1
- package/dist/config/clientFiles.js +0 -23
- package/dist/config/createClientConfig.d.ts +0 -6
- package/dist/config/createClientConfig.d.ts.map +0 -1
- package/dist/config/createClientConfig.js +0 -132
- package/dist/config/load.d.ts +0 -6
- package/dist/config/load.d.ts.map +0 -1
- package/dist/config/load.js +0 -45
- package/dist/express/middleware/errorHandler.d.ts +0 -2
- package/dist/express/middleware/errorHandler.d.ts.map +0 -1
- package/dist/express/middleware/errorHandler.js +0 -3
- package/dist/express/middleware/index.d.ts +0 -2
- package/dist/express/middleware/index.d.ts.map +0 -1
- package/dist/express/middleware/index.js +0 -3
- package/dist/globals/config/build.d.ts +0 -2
- package/dist/globals/config/build.d.ts.map +0 -1
- package/dist/globals/config/build.js +0 -3
- package/dist/globals/graphql/resolvers/docAccess.d.ts +0 -2
- package/dist/globals/graphql/resolvers/docAccess.d.ts.map +0 -1
- package/dist/globals/graphql/resolvers/docAccess.js +0 -3
- package/dist/localization/middleware.d.ts +0 -5
- package/dist/localization/middleware.d.ts.map +0 -1
- package/dist/localization/middleware.js +0 -47
- package/dist/localization/sanitizeFallbackLocale.d.ts +0 -3
- package/dist/localization/sanitizeFallbackLocale.d.ts.map +0 -1
- package/dist/localization/sanitizeFallbackLocale.js +0 -19
- package/dist/translations/extractTranslations.d.ts +0 -2
- package/dist/translations/extractTranslations.d.ts.map +0 -1
- package/dist/translations/extractTranslations.js +0 -30
- package/dist/versions/getVersionsModelName.d.ts +0 -4
- package/dist/versions/getVersionsModelName.d.ts.map +0 -1
- package/dist/versions/getVersionsModelName.js +0 -13
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "combineQueries", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return combineQueries;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _auth = require("../auth");
|
|
12
|
-
const combineQueries = (where, access)=>{
|
|
1
|
+
import { hasWhereAccessResult } from '../auth/index.js';
|
|
2
|
+
export const combineQueries = (where, access)=>{
|
|
13
3
|
if (!where && !access) return {};
|
|
14
4
|
const result = {
|
|
15
5
|
and: []
|
|
16
6
|
};
|
|
17
7
|
if (where) result.and.push(where);
|
|
18
|
-
if (
|
|
8
|
+
if (hasWhereAccessResult(access)) result.and.push(access);
|
|
19
9
|
return result;
|
|
20
10
|
};
|
|
21
11
|
|
|
22
|
-
//# sourceMappingURL=
|
|
12
|
+
//# sourceMappingURL=combineQueries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/database/combineQueries.ts"],"sourcesContent":["import type { Where } from '../types/index.js'\n\nimport { hasWhereAccessResult } from '../auth/index.js'\n\nexport const combineQueries = (where: Where, access: Where | boolean): Where => {\n if (!where && !access) return {}\n\n const result: Where = {\n and: [],\n }\n\n if (where) result.and.push(where)\n if (hasWhereAccessResult(access)) result.and.push(access)\n\n return result\n}\n"],"names":["hasWhereAccessResult","combineQueries","where","access","result","and","push"],"rangeMappings":";;;;;;;;;","mappings":"AAEA,SAASA,oBAAoB,QAAQ,mBAAkB;AAEvD,OAAO,MAAMC,iBAAiB,CAACC,OAAcC;IAC3C,IAAI,CAACD,SAAS,CAACC,QAAQ,OAAO,CAAC;IAE/B,MAAMC,SAAgB;QACpBC,KAAK,EAAE;IACT;IAEA,IAAIH,OAAOE,OAAOC,GAAG,CAACC,IAAI,CAACJ;IAC3B,IAAIF,qBAAqBG,SAASC,OAAOC,GAAG,CAACC,IAAI,CAACH;IAElD,OAAOC;AACT,EAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { MarkOptional } from 'ts-essentials';
|
|
2
|
-
import type { BaseDatabaseAdapter } from './types';
|
|
2
|
+
import type { BaseDatabaseAdapter } from './types.js';
|
|
3
3
|
export declare function createDatabaseAdapter<T extends BaseDatabaseAdapter>(args: MarkOptional<T, 'createMigration' | 'migrate' | 'migrateDown' | 'migrateFresh' | 'migrateRefresh' | 'migrateReset' | 'migrateStatus' | 'migrationDir'>): T;
|
|
4
4
|
//# sourceMappingURL=createDatabaseAdapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDatabaseAdapter.d.ts","sourceRoot":"","sources":["../../src/database/createDatabaseAdapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EACV,mBAAmB,EAIpB,MAAM,
|
|
1
|
+
{"version":3,"file":"createDatabaseAdapter.d.ts","sourceRoot":"","sources":["../../src/database/createDatabaseAdapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EACV,mBAAmB,EAIpB,MAAM,YAAY,CAAA;AAanB,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,mBAAmB,EACjE,IAAI,EAAE,YAAY,CAChB,CAAC,EACC,iBAAiB,GACjB,SAAS,GACT,aAAa,GACb,cAAc,GACd,gBAAgB,GAChB,cAAc,GACd,eAAe,GACf,cAAc,CACjB,GACA,CAAC,CAmBH"}
|
|
@@ -1,34 +1,24 @@
|
|
|
1
|
-
/* eslint-disable no-param-reassign */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
get: function() {
|
|
8
|
-
return createDatabaseAdapter;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _createMigration = require("./migrations/createMigration");
|
|
12
|
-
const _migrate = require("./migrations/migrate");
|
|
13
|
-
const _migrateDown = require("./migrations/migrateDown");
|
|
14
|
-
const _migrateRefresh = require("./migrations/migrateRefresh");
|
|
15
|
-
const _migrateReset = require("./migrations/migrateReset");
|
|
16
|
-
const _migrateStatus = require("./migrations/migrateStatus");
|
|
1
|
+
/* eslint-disable no-param-reassign */ import { createMigration } from './migrations/createMigration.js';
|
|
2
|
+
import { migrate } from './migrations/migrate.js';
|
|
3
|
+
import { migrateDown } from './migrations/migrateDown.js';
|
|
4
|
+
import { migrateRefresh } from './migrations/migrateRefresh.js';
|
|
5
|
+
import { migrateReset } from './migrations/migrateReset.js';
|
|
6
|
+
import { migrateStatus } from './migrations/migrateStatus.js';
|
|
17
7
|
const beginTransaction = async ()=>null;
|
|
18
8
|
const rollbackTransaction = async ()=>null;
|
|
19
9
|
const commitTransaction = async ()=>null;
|
|
20
|
-
function createDatabaseAdapter(args) {
|
|
10
|
+
export function createDatabaseAdapter(args) {
|
|
21
11
|
return {
|
|
22
12
|
// Default 'null' transaction functions
|
|
23
13
|
beginTransaction,
|
|
24
14
|
commitTransaction,
|
|
25
|
-
createMigration
|
|
26
|
-
migrate
|
|
27
|
-
migrateDown
|
|
15
|
+
createMigration,
|
|
16
|
+
migrate,
|
|
17
|
+
migrateDown,
|
|
28
18
|
migrateFresh: async ({ forceAcceptWarning = null })=>null,
|
|
29
|
-
migrateRefresh
|
|
30
|
-
migrateReset
|
|
31
|
-
migrateStatus
|
|
19
|
+
migrateRefresh,
|
|
20
|
+
migrateReset,
|
|
21
|
+
migrateStatus,
|
|
32
22
|
rollbackTransaction,
|
|
33
23
|
...args,
|
|
34
24
|
// Ensure migrationDir is set
|
|
@@ -36,4 +26,4 @@ function createDatabaseAdapter(args) {
|
|
|
36
26
|
};
|
|
37
27
|
}
|
|
38
28
|
|
|
39
|
-
//# sourceMappingURL=
|
|
29
|
+
//# sourceMappingURL=createDatabaseAdapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/database/createDatabaseAdapter.ts"],"sourcesContent":["/* eslint-disable no-param-reassign */\nimport type { MarkOptional } from 'ts-essentials'\n\nimport type {\n BaseDatabaseAdapter,\n BeginTransaction,\n CommitTransaction,\n RollbackTransaction,\n} from './types.js'\n\nimport { createMigration } from './migrations/createMigration.js'\nimport { migrate } from './migrations/migrate.js'\nimport { migrateDown } from './migrations/migrateDown.js'\nimport { migrateRefresh } from './migrations/migrateRefresh.js'\nimport { migrateReset } from './migrations/migrateReset.js'\nimport { migrateStatus } from './migrations/migrateStatus.js'\n\nconst beginTransaction: BeginTransaction = async () => null\nconst rollbackTransaction: RollbackTransaction = async () => null\nconst commitTransaction: CommitTransaction = async () => null\n\nexport function createDatabaseAdapter<T extends BaseDatabaseAdapter>(\n args: MarkOptional<\n T,\n | 'createMigration'\n | 'migrate'\n | 'migrateDown'\n | 'migrateFresh'\n | 'migrateRefresh'\n | 'migrateReset'\n | 'migrateStatus'\n | 'migrationDir'\n >,\n): T {\n return {\n // Default 'null' transaction functions\n beginTransaction,\n commitTransaction,\n createMigration,\n migrate,\n migrateDown,\n migrateFresh: async ({ forceAcceptWarning = null }) => null,\n migrateRefresh,\n migrateReset,\n migrateStatus,\n rollbackTransaction,\n\n ...args,\n\n // Ensure migrationDir is set\n migrationDir: args.migrationDir || 'migrations',\n } as T\n}\n"],"names":["createMigration","migrate","migrateDown","migrateRefresh","migrateReset","migrateStatus","beginTransaction","rollbackTransaction","commitTransaction","createDatabaseAdapter","args","migrateFresh","forceAcceptWarning","migrationDir"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,oCAAoC,GAUpC,SAASA,eAAe,QAAQ,kCAAiC;AACjE,SAASC,OAAO,QAAQ,0BAAyB;AACjD,SAASC,WAAW,QAAQ,8BAA6B;AACzD,SAASC,cAAc,QAAQ,iCAAgC;AAC/D,SAASC,YAAY,QAAQ,+BAA8B;AAC3D,SAASC,aAAa,QAAQ,gCAA+B;AAE7D,MAAMC,mBAAqC,UAAY;AACvD,MAAMC,sBAA2C,UAAY;AAC7D,MAAMC,oBAAuC,UAAY;AAEzD,OAAO,SAASC,sBACdC,IAUC;IAED,OAAO;QACL,uCAAuC;QACvCJ;QACAE;QACAR;QACAC;QACAC;QACAS,cAAc,OAAO,EAAEC,qBAAqB,IAAI,EAAE,GAAK;QACvDT;QACAC;QACAC;QACAE;QAEA,GAAGG,IAAI;QAEP,6BAA6B;QAC7BG,cAAcH,KAAKG,YAAY,IAAI;IACrC;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Where, WhereField } from '../types';
|
|
1
|
+
import type { Where, WhereField } from '../types/index.js';
|
|
2
2
|
declare const flattenWhereToOperators: (query: Where) => WhereField[];
|
|
3
3
|
export default flattenWhereToOperators;
|
|
4
4
|
//# sourceMappingURL=flattenWhereToOperators.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flattenWhereToOperators.d.ts","sourceRoot":"","sources":["../../src/database/flattenWhereToOperators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"flattenWhereToOperators.d.ts","sourceRoot":"","sources":["../../src/database/flattenWhereToOperators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAG1D,QAAA,MAAM,uBAAuB,UAAW,KAAK,KAAG,UAAU,EAYlD,CAAA;AAER,eAAe,uBAAuB,CAAA"}
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
1
|
// Take a where query and flatten it to all top-level operators
|
|
12
2
|
const flattenWhereToOperators = (query)=>Object.entries(query).reduce((flattenedConstraints, [key, val])=>{
|
|
13
3
|
if ((key === 'and' || key === 'or') && Array.isArray(val)) {
|
|
@@ -26,6 +16,6 @@ const flattenWhereToOperators = (query)=>Object.entries(query).reduce((flattened
|
|
|
26
16
|
val
|
|
27
17
|
];
|
|
28
18
|
}, []);
|
|
29
|
-
|
|
19
|
+
export default flattenWhereToOperators;
|
|
30
20
|
|
|
31
|
-
//# sourceMappingURL=
|
|
21
|
+
//# sourceMappingURL=flattenWhereToOperators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/database/flattenWhereToOperators.ts"],"sourcesContent":["import type { Where, WhereField } from '../types/index.js'\n\n// Take a where query and flatten it to all top-level operators\nconst flattenWhereToOperators = (query: Where): WhereField[] =>\n Object.entries(query).reduce((flattenedConstraints, [key, val]) => {\n if ((key === 'and' || key === 'or') && Array.isArray(val)) {\n return [\n ...flattenedConstraints,\n ...val.reduce((subVals, subVal) => {\n return [...subVals, ...flattenWhereToOperators(subVal)]\n }, []),\n ]\n }\n\n return [...flattenedConstraints, val]\n }, [])\n\nexport default flattenWhereToOperators\n"],"names":["flattenWhereToOperators","query","Object","entries","reduce","flattenedConstraints","key","val","Array","isArray","subVals","subVal"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAEA,+DAA+D;AAC/D,MAAMA,0BAA0B,CAACC,QAC/BC,OAAOC,OAAO,CAACF,OAAOG,MAAM,CAAC,CAACC,sBAAsB,CAACC,KAAKC,IAAI;QAC5D,IAAI,AAACD,CAAAA,QAAQ,SAASA,QAAQ,IAAG,KAAME,MAAMC,OAAO,CAACF,MAAM;YACzD,OAAO;mBACFF;mBACAE,IAAIH,MAAM,CAAC,CAACM,SAASC;oBACtB,OAAO;2BAAID;2BAAYV,wBAAwBW;qBAAQ;gBACzD,GAAG,EAAE;aACN;QACH;QAEA,OAAO;eAAIN;YAAsBE;SAAI;IACvC,GAAG,EAAE;AAEP,eAAeP,wBAAuB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type { PathToQuery } from './queryValidation/types';
|
|
1
|
+
import type { Field } from '../fields/config/types.js';
|
|
2
|
+
import type { Payload } from '../index.js';
|
|
3
|
+
import type { PathToQuery } from './queryValidation/types.js';
|
|
4
4
|
export declare function getLocalizedPaths({ collectionSlug, fields, globalSlug, incomingPath, locale, overrideAccess, payload, }: {
|
|
5
5
|
collectionSlug?: string;
|
|
6
6
|
fields: Field[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocalizedPaths.d.ts","sourceRoot":"","sources":["../../src/database/getLocalizedPaths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"getLocalizedPaths.d.ts","sourceRoot":"","sources":["../../src/database/getLocalizedPaths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAK7D,wBAAsB,iBAAiB,CAAC,EACtC,cAAc,EACd,MAAM,EACN,UAAU,EACV,YAAY,EACZ,MAAM,EACN,cAAsB,EACtB,OAAO,GACR,EAAE;IACD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAiJzB"}
|
|
@@ -1,21 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "getLocalizedPaths", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return getLocalizedPaths;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _types = require("../fields/config/types");
|
|
12
|
-
const _flattenTopLevelFields = /*#__PURE__*/ _interop_require_default(require("../utilities/flattenTopLevelFields"));
|
|
13
|
-
function _interop_require_default(obj) {
|
|
14
|
-
return obj && obj.__esModule ? obj : {
|
|
15
|
-
default: obj
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
async function getLocalizedPaths({ collectionSlug, fields, globalSlug, incomingPath, locale, overrideAccess = false, payload }) {
|
|
1
|
+
import { fieldAffectsData } from '../fields/config/types.js';
|
|
2
|
+
import flattenFields from '../utilities/flattenTopLevelFields.js';
|
|
3
|
+
export async function getLocalizedPaths({ collectionSlug, fields, globalSlug, incomingPath, locale, overrideAccess = false, payload }) {
|
|
19
4
|
const pathSegments = incomingPath.split('.');
|
|
20
5
|
const localizationConfig = payload.config.localization;
|
|
21
6
|
let paths = [
|
|
@@ -23,7 +8,7 @@ async function getLocalizedPaths({ collectionSlug, fields, globalSlug, incomingP
|
|
|
23
8
|
collectionSlug,
|
|
24
9
|
complete: false,
|
|
25
10
|
field: undefined,
|
|
26
|
-
fields: (
|
|
11
|
+
fields: flattenFields(fields, false),
|
|
27
12
|
globalSlug,
|
|
28
13
|
invalid: false,
|
|
29
14
|
path: ''
|
|
@@ -35,7 +20,7 @@ async function getLocalizedPaths({ collectionSlug, fields, globalSlug, incomingP
|
|
|
35
20
|
if (lastIncompletePath) {
|
|
36
21
|
const { path } = lastIncompletePath;
|
|
37
22
|
let currentPath = path ? `${path}.${segment}` : segment;
|
|
38
|
-
const matchedField = lastIncompletePath.fields.find((field)=>
|
|
23
|
+
const matchedField = lastIncompletePath.fields.find((field)=>fieldAffectsData(field) && field.name === segment);
|
|
39
24
|
lastIncompletePath.field = matchedField;
|
|
40
25
|
if (currentPath === 'globalType' && globalSlug) {
|
|
41
26
|
lastIncompletePath.path = currentPath;
|
|
@@ -123,7 +108,7 @@ async function getLocalizedPaths({ collectionSlug, fields, globalSlug, incomingP
|
|
|
123
108
|
default:
|
|
124
109
|
{
|
|
125
110
|
if ('fields' in lastIncompletePath.field) {
|
|
126
|
-
lastIncompletePath.fields = (
|
|
111
|
+
lastIncompletePath.fields = flattenFields(lastIncompletePath.field.fields, false);
|
|
127
112
|
}
|
|
128
113
|
if (i + 1 === pathSegments.length) lastIncompletePath.complete = true;
|
|
129
114
|
lastIncompletePath.path = currentPath;
|
|
@@ -139,4 +124,4 @@ async function getLocalizedPaths({ collectionSlug, fields, globalSlug, incomingP
|
|
|
139
124
|
return paths;
|
|
140
125
|
}
|
|
141
126
|
|
|
142
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kYXRhYmFzZS9nZXRMb2NhbGl6ZWRQYXRocy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQg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ChuZXh0U2VnbWVudElzTG9jYWxlKSB7XG4gICAgICAgICAgLy8gU2tpcCB0aGUgbmV4dCBpdGVyYXRpb24sIGJlY2F1c2UgaXQncyBhIGxvY2FsZVxuICAgICAgICAgIGkgKz0gMVxuICAgICAgICAgIGN1cnJlbnRQYXRoID0gYCR7Y3VycmVudFBhdGh9LiR7bmV4dFNlZ21lbnR9YFxuICAgICAgICB9IGVsc2UgaWYgKGxvY2FsaXphdGlvbkNvbmZpZyAmJiAnbG9jYWxpemVkJyBpbiBtYXRjaGVkRmllbGQgJiYgbWF0Y2hlZEZpZWxkLmxvY2FsaXplZCkge1xuICAgICAgICAgIGN1cnJlbnRQYXRoID0gYCR7Y3VycmVudFBhdGh9LiR7bG9jYWxlfWBcbiAgICAgICAgfVxuXG4gICAgICAgIHN3aXRjaCAobWF0Y2hlZEZpZWxkLnR5cGUpIHtcbiAgICAgICAgICBjYXNlICdibG9ja3MnOlxuICAgICAgICAgIGNhc2UgJ3JpY2hUZXh0JzpcbiAgICAgICAgICBjYXNlICdqc29uJzoge1xuICAgICAgICAgICAgY29uc3QgdXBjb21pbmdTZWdtZW50cyA9IHBhdGhTZWdtZW50cy5zbGljZShpICsgMSkuam9pbignLicpXG4gICAgICAgICAgICBsYXN0SW5jb21wbGV0ZVBhdGguY29tcGxldGUgPSB0cnVlXG4gICAgICAgICAgICBsYXN0SW5jb21wbGV0ZVBhdGgucGF0aCA9IHVwY29taW5nU2VnbWVudHNcbiAgICAgICAgICAgICAgPyBgJHtjdXJyZW50UGF0aH0uJHt1cGNvbWluZ1NlZ21lbnRzfWBcbiAgICAgICAgICAgICAgOiBjdXJyZW50UGF0aFxuICAgICAgICAgICAgcmV0dXJuIHBhdGhzXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY2FzZSAncmVsYXRpb25zaGlwJzpcbiAgICAgICAgICBjYXNlICd1cGxvYWQnOiB7XG4gICAgICAgICAgICAvLyBJZiB0aGlzIGlzIGEgcG9seW1vcnBoaWMgcmVsYXRpb24sXG4gICAgICAgICAgICAvLyBXZSBvbmx5IHN1cHBvcnQgcXVlcnlpbmcgZGlyZWN0bHkgKG5vIG5lc3RlZCBxdWVyeWluZylcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbWF0Y2hlZEZpZWxkLnJlbGF0aW9uVG8gIT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgIGNvbnN0IGxhc3RTZWdtZW50SXNWYWxpZCA9XG4gICAgICAgICAgICAgICAgWydyZWxhdGlvblRvJywgJ3ZhbHVlJ10uaW5jbHVkZXMocGF0aFNlZ21lbnRzW3BhdGhTZWdtZW50cy5sZW5ndGggLSAxXSkgfHxcbiAgICAgICAgICAgICAgICBwYXRoU2VnbWVudHMubGVuZ3RoID09PSAxXG5cbiAgICAgICAgICAgICAgaWYgKGxhc3RTZWdtZW50SXNWYWxpZCkge1xuICAgICAgICAgICAgICAgIGxhc3RJbmNvbXBsZXRlUGF0aC5jb21wbGV0ZSA9IHRydWVcbiAgICAgICAgICAgICAgICBsYXN0SW5jb21wbGV0ZVBhdGgucGF0aCA9IHBhdGhTZWdtZW50cy5qb2luKCcuJylcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsYXN0SW5jb21wbGV0ZVBhdGguaW52YWxpZCA9IHRydWVcbiAgICAgICAgICAgICAgICByZXR1cm4gcGF0aHNcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgbGFzdEluY29tcGxldGVQYXRoLmNvbXBsZXRlID0gdHJ1ZVxuICAgICAgICAgICAgICBsYXN0SW5jb21wbGV0ZVBhdGgucGF0aCA9IGN1cnJlbnRQYXRoXG5cbiAgICAgICAgICAgICAgY29uc3QgbmVzdGVkUGF0aFRvUXVlcnkgPSBwYXRoU2VnbWVudHNcbiAgICAgICAgICAgICAgICAuc2xpY2UobmV4dFNlZ21lbnRJc0xvY2FsZSA/IGkgKyAyIDogaSArIDEpXG4gICAgICAgICAgICAgICAgLmpvaW4oJy4nKVxuXG4gICAgICAgICAgICAgIGlmIChuZXN0ZWRQYXRoVG9RdWVyeSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHJlbGF0ZWRDb2xsZWN0aW9uID0gcGF5bG9hZC5jb2xsZWN0aW9uc1ttYXRjaGVkRmllbGQucmVsYXRpb25Ub10uY29uZmlnXG5cbiAgICAgICAgICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tYXdhaXQtaW4tbG9vcFxuICAgICAgICAgICAgICAgIGNvbnN0IHJlbWFpbmluZ1BhdGhzID0gYXdhaXQgZ2V0TG9jYWxpemVkUGF0aHMoe1xuICAgICAgICAgICAgICAgICAgY29sbGVjdGlvblNsdWc6IHJlbGF0ZWRDb2xsZWN0aW9uLnNsdWcsXG4gICAgICAgICAgICAgICAgICBmaWVsZHM6IHJlbGF0ZWRDb2xsZWN0aW9uLmZpZWxkcyxcbiAgICAgICAgICAgICAgICAgIGdsb2JhbFNsdWcsXG4gICAgICAgICAgICAgICAgICBpbmNvbWluZ1BhdGg6IG5lc3RlZFBhdGhUb1F1ZXJ5LFxuICAgICAgICAgICAgICAgICAgbG9jYWxlLFxuICAgICAgICAgICAgICAgICAgcGF5bG9hZCxcbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgcGF0aHMgPSBbLi4ucGF0aHMsIC4uLnJlbWFpbmluZ1BhdGhzXVxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgcmV0dXJuIHBhdGhzXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGJyZWFrXG4gICAgICAgICAgfVxuXG4gICAgICAgICAgZGVmYXVsdDoge1xuICAgICAgICAgICAgaWYgKCdmaWVsZHMnIGluIGxhc3RJbmNvbXBsZXRlUGF0aC5maWVsZCkge1xuICAgICAgICAgICAgICBsYXN0SW5jb21wbGV0ZVBhdGguZmllbGRzID0gZmxhdHRlbkZpZWxk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0JLLG1CQUFtQkosSUFBSSxHQUFHTTtnQkFDMUIsT0FBT1o7WUFDVDtRQUNGO0lBQ0Y7SUFFQSxPQUFPQTtBQUNUIn0=
|
|
127
|
+
//# sourceMappingURL=getLocalizedPaths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/database/getLocalizedPaths.ts"],"sourcesContent":["import type { Field } from '../fields/config/types.js'\nimport type { Payload } from '../index.js'\nimport type { PathToQuery } from './queryValidation/types.js'\n\nimport { fieldAffectsData } from '../fields/config/types.js'\nimport flattenFields from '../utilities/flattenTopLevelFields.js'\n\nexport async function getLocalizedPaths({\n collectionSlug,\n fields,\n globalSlug,\n incomingPath,\n locale,\n overrideAccess = false,\n payload,\n}: {\n collectionSlug?: string\n fields: Field[]\n globalSlug?: string\n incomingPath: string\n locale?: string\n overrideAccess?: boolean\n payload: Payload\n}): Promise<PathToQuery[]> {\n const pathSegments = incomingPath.split('.')\n const localizationConfig = payload.config.localization\n\n let paths: PathToQuery[] = [\n {\n collectionSlug,\n complete: false,\n field: undefined,\n fields: flattenFields(fields, false),\n globalSlug,\n invalid: false,\n path: '',\n },\n ]\n\n for (let i = 0; i < pathSegments.length; i += 1) {\n const segment = pathSegments[i]\n\n const lastIncompletePath = paths.find(({ complete }) => !complete)\n\n if (lastIncompletePath) {\n const { path } = lastIncompletePath\n let currentPath = path ? `${path}.${segment}` : segment\n\n const matchedField = lastIncompletePath.fields.find(\n (field) => fieldAffectsData(field) && field.name === segment,\n )\n lastIncompletePath.field = matchedField\n\n if (currentPath === 'globalType' && globalSlug) {\n lastIncompletePath.path = currentPath\n lastIncompletePath.complete = true\n lastIncompletePath.field = {\n name: 'globalType',\n type: 'text',\n }\n\n return paths\n }\n\n if (!matchedField && currentPath === 'id' && i === pathSegments.length - 1) {\n lastIncompletePath.path = currentPath\n const idField: Field = {\n name: 'id',\n type: payload.db.defaultIDType as 'text',\n }\n lastIncompletePath.field = idField\n lastIncompletePath.complete = true\n return paths\n }\n\n if (matchedField) {\n if ('hidden' in matchedField && matchedField.hidden && !overrideAccess) {\n lastIncompletePath.invalid = true\n }\n\n const nextSegment = pathSegments[i + 1]\n const nextSegmentIsLocale =\n localizationConfig && localizationConfig.localeCodes.includes(nextSegment)\n\n if (nextSegmentIsLocale) {\n // Skip the next iteration, because it's a locale\n i += 1\n currentPath = `${currentPath}.${nextSegment}`\n } else if (localizationConfig && 'localized' in matchedField && matchedField.localized) {\n currentPath = `${currentPath}.${locale}`\n }\n\n switch (matchedField.type) {\n case 'blocks':\n case 'richText':\n case 'json': {\n const upcomingSegments = pathSegments.slice(i + 1).join('.')\n lastIncompletePath.complete = true\n lastIncompletePath.path = upcomingSegments\n ? `${currentPath}.${upcomingSegments}`\n : currentPath\n return paths\n }\n\n case 'relationship':\n case 'upload': {\n // If this is a polymorphic relation,\n // We only support querying directly (no nested querying)\n if (typeof matchedField.relationTo !== 'string') {\n const lastSegmentIsValid =\n ['relationTo', 'value'].includes(pathSegments[pathSegments.length - 1]) ||\n pathSegments.length === 1\n\n if (lastSegmentIsValid) {\n lastIncompletePath.complete = true\n lastIncompletePath.path = pathSegments.join('.')\n } else {\n lastIncompletePath.invalid = true\n return paths\n }\n } else {\n lastIncompletePath.complete = true\n lastIncompletePath.path = currentPath\n\n const nestedPathToQuery = pathSegments\n .slice(nextSegmentIsLocale ? i + 2 : i + 1)\n .join('.')\n\n if (nestedPathToQuery) {\n const relatedCollection = payload.collections[matchedField.relationTo].config\n\n // eslint-disable-next-line no-await-in-loop\n const remainingPaths = await getLocalizedPaths({\n collectionSlug: relatedCollection.slug,\n fields: relatedCollection.fields,\n globalSlug,\n incomingPath: nestedPathToQuery,\n locale,\n payload,\n })\n\n paths = [...paths, ...remainingPaths]\n }\n\n return paths\n }\n\n break\n }\n\n default: {\n if ('fields' in lastIncompletePath.field) {\n lastIncompletePath.fields = flattenFields(lastIncompletePath.field.fields, false)\n }\n\n if (i + 1 === pathSegments.length) lastIncompletePath.complete = true\n lastIncompletePath.path = currentPath\n }\n }\n } else {\n lastIncompletePath.invalid = true\n lastIncompletePath.path = currentPath\n return paths\n }\n }\n }\n\n return paths\n}\n"],"names":["fieldAffectsData","flattenFields","getLocalizedPaths","collectionSlug","fields","globalSlug","incomingPath","locale","overrideAccess","payload","pathSegments","split","localizationConfig","config","localization","paths","complete","field","undefined","invalid","path","i","length","segment","lastIncompletePath","find","currentPath","matchedField","name","type","idField","db","defaultIDType","hidden","nextSegment","nextSegmentIsLocale","localeCodes","includes","localized","upcomingSegments","slice","join","relationTo","lastSegmentIsValid","nestedPathToQuery","relatedCollection","collections","remainingPaths","slug"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,gBAAgB,QAAQ,4BAA2B;AAC5D,OAAOC,mBAAmB,wCAAuC;AAEjE,OAAO,eAAeC,kBAAkB,EACtCC,cAAc,EACdC,MAAM,EACNC,UAAU,EACVC,YAAY,EACZC,MAAM,EACNC,iBAAiB,KAAK,EACtBC,OAAO,EASR;IACC,MAAMC,eAAeJ,aAAaK,KAAK,CAAC;IACxC,MAAMC,qBAAqBH,QAAQI,MAAM,CAACC,YAAY;IAEtD,IAAIC,QAAuB;QACzB;YACEZ;YACAa,UAAU;YACVC,OAAOC;YACPd,QAAQH,cAAcG,QAAQ;YAC9BC;YACAc,SAAS;YACTC,MAAM;QACR;KACD;IAED,IAAK,IAAIC,IAAI,GAAGA,IAAIX,aAAaY,MAAM,EAAED,KAAK,EAAG;QAC/C,MAAME,UAAUb,YAAY,CAACW,EAAE;QAE/B,MAAMG,qBAAqBT,MAAMU,IAAI,CAAC,CAAC,EAAET,QAAQ,EAAE,GAAK,CAACA;QAEzD,IAAIQ,oBAAoB;YACtB,MAAM,EAAEJ,IAAI,EAAE,GAAGI;YACjB,I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P,KAAK,EAAE;gCACxCO,mBAAmBpB,MAAM,GAAGH,cAAcuB,mBAAmBP,KAAK,CAACb,MAAM,EAAE;4BAC7E;4BAEA,IAAIiB,IAAI,MAAMX,aAAaY,MAAM,EAAEE,mBAAmBR,QAAQ,GAAG;4BACjEQ,mBAAmBJ,IAAI,GAAGM;wBAC5B;gBACF;YACF,OAAO;gBACLF,mBAAmBL,OAAO,GAAG;gBAC7BK,mBAAmBJ,IAAI,GAAGM;gBAC1B,OAAOX;YACT;QACF;IACF;IAEA,OAAOA;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMigration.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/createMigration.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"createMigration.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/createMigration.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAIlD,eAAO,MAAM,eAAe,EAAE,eAoB7B,CAAA"}
|
|
@@ -1,24 +1,9 @@
|
|
|
1
|
-
/* eslint-disable no-restricted-syntax, no-await-in-loop */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "createMigration", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return createMigration;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
12
|
-
const _migrationTemplate = require("./migrationTemplate");
|
|
13
|
-
function _interop_require_default(obj) {
|
|
14
|
-
return obj && obj.__esModule ? obj : {
|
|
15
|
-
default: obj
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
const createMigration = async function createMigration({ migrationName, payload }) {
|
|
1
|
+
/* eslint-disable no-restricted-syntax, no-await-in-loop */ import fs from 'fs';
|
|
2
|
+
import { migrationTemplate } from './migrationTemplate.js';
|
|
3
|
+
export const createMigration = async function createMigration({ migrationName, payload }) {
|
|
19
4
|
const dir = payload.db.migrationDir;
|
|
20
|
-
if (!
|
|
21
|
-
|
|
5
|
+
if (!fs.existsSync(dir)) {
|
|
6
|
+
fs.mkdirSync(dir);
|
|
22
7
|
}
|
|
23
8
|
const [yyymmdd, hhmmss] = new Date().toISOString().split('T');
|
|
24
9
|
const formattedDate = yyymmdd.replace(/\D/g, '');
|
|
@@ -27,10 +12,10 @@ const createMigration = async function createMigration({ migrationName, payload
|
|
|
27
12
|
const formattedName = migrationName.replace(/\W/g, '_');
|
|
28
13
|
const fileName = `${timestamp}_${formattedName}.ts`;
|
|
29
14
|
const filePath = `${dir}/${fileName}`;
|
|
30
|
-
|
|
15
|
+
fs.writeFileSync(filePath, migrationTemplate);
|
|
31
16
|
payload.logger.info({
|
|
32
17
|
msg: `Migration created at ${filePath}`
|
|
33
18
|
});
|
|
34
19
|
};
|
|
35
20
|
|
|
36
|
-
//# sourceMappingURL=
|
|
21
|
+
//# sourceMappingURL=createMigration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/database/migrations/createMigration.ts"],"sourcesContent":["/* eslint-disable no-restricted-syntax, no-await-in-loop */\nimport fs from 'fs'\n\nimport type { CreateMigration } from '../types.js'\n\nimport { migrationTemplate } from './migrationTemplate.js'\n\nexport const createMigration: CreateMigration = async function createMigration({\n migrationName,\n payload,\n}) {\n const dir = payload.db.migrationDir\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir)\n }\n\n const [yyymmdd, hhmmss] = new Date().toISOString().split('T')\n const formattedDate = yyymmdd.replace(/\\D/g, '')\n const formattedTime = hhmmss.split('.')[0].replace(/\\D/g, '')\n\n const timestamp = `${formattedDate}_${formattedTime}`\n\n const formattedName = migrationName.replace(/\\W/g, '_')\n const fileName = `${timestamp}_${formattedName}.ts`\n const filePath = `${dir}/${fileName}`\n fs.writeFileSync(filePath, migrationTemplate)\n payload.logger.info({ msg: `Migration created at ${filePath}` })\n}\n"],"names":["fs","migrationTemplate","createMigration","migrationName","payload","dir","db","migrationDir","existsSync","mkdirSync","yyymmdd","hhmmss","Date","toISOString","split","formattedDate","replace","formattedTime","timestamp","formattedName","fileName","filePath","writeFileSync","logger","info","msg"],"rangeMappings":";;;;;;;;;;;;;;;;;;","mappings":"AAAA,yDAAyD,GACzD,OAAOA,QAAQ,KAAI;AAInB,SAASC,iBAAiB,QAAQ,yBAAwB;AAE1D,OAAO,MAAMC,kBAAmC,eAAeA,gBAAgB,EAC7EC,aAAa,EACbC,OAAO,EACR;IACC,MAAMC,MAAMD,QAAQE,EAAE,CAACC,YAAY;IACnC,IAAI,CAACP,GAAGQ,UAAU,CAACH,MAAM;QACvBL,GAAGS,SAAS,CAACJ;IACf;IAEA,MAAM,CAACK,SAASC,OAAO,GAAG,IAAIC,OAAOC,WAAW,GAAGC,KAAK,CAAC;IACzD,MAAMC,gBAAgBL,QAAQM,OAAO,CAAC,OAAO;IAC7C,MAAMC,gBAAgBN,OAAOG,KAAK,CAAC,IAAI,CAAC,EAAE,CAACE,OAAO,CAAC,OAAO;IAE1D,MAAME,YAAY,CAAC,EAAEH,cAAc,CAAC,EAAEE,cAAc,CAAC;IAErD,MAAME,gBAAgBhB,cAAca,OAAO,CAAC,OAAO;IACnD,MAAMI,WAAW,CAAC,EAAEF,UAAU,CAAC,EAAEC,cAAc,GAAG,CAAC;IACnD,MAAME,WAAW,CAAC,EAAEhB,IAAI,CAAC,EAAEe,SAAS,CAAC;IACrCpB,GAAGsB,aAAa,CAACD,UAAUpB;IAC3BG,QAAQmB,MAAM,CAACC,IAAI,CAAC;QAAEC,KAAK,CAAC,qBAAqB,EAAEJ,SAAS,CAAC;IAAC;AAChE,EAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Payload } from '
|
|
2
|
-
import type { MigrationData } from '../types';
|
|
1
|
+
import type { Payload } from '../../index.js';
|
|
2
|
+
import type { MigrationData } from '../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Gets all existing migrations from the database, excluding the dev migration
|
|
5
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMigrations.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/getMigrations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"getMigrations.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/getMigrations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD;;GAEG;AACH,wBAAsB,aAAa,CAAC,EAClC,OAAO,GACR,EAAE;IACD,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,OAAO,CAAC;IAAE,kBAAkB,EAAE,aAAa,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,CAqBxE"}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "getMigrations", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return getMigrations;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
async function getMigrations({ payload }) {
|
|
1
|
+
/**
|
|
2
|
+
* Gets all existing migrations from the database, excluding the dev migration
|
|
3
|
+
*/ export async function getMigrations({ payload }) {
|
|
12
4
|
const migrationQuery = await payload.find({
|
|
13
5
|
collection: 'payload-migrations',
|
|
14
6
|
limit: 0,
|
|
@@ -28,4 +20,4 @@ async function getMigrations({ payload }) {
|
|
|
28
20
|
};
|
|
29
21
|
}
|
|
30
22
|
|
|
31
|
-
//# sourceMappingURL=
|
|
23
|
+
//# sourceMappingURL=getMigrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/database/migrations/getMigrations.ts"],"sourcesContent":["import type { Payload } from '../../index.js'\nimport type { MigrationData } from '../types.js'\n\n/**\n * Gets all existing migrations from the database, excluding the dev migration\n */\nexport async function getMigrations({\n payload,\n}: {\n payload: Payload\n}): Promise<{ existingMigrations: MigrationData[]; latestBatch: number }> {\n const migrationQuery = await payload.find({\n collection: 'payload-migrations',\n limit: 0,\n sort: '-name',\n where: {\n batch: {\n not_equals: -1,\n },\n },\n })\n\n const existingMigrations = migrationQuery.docs as unknown as MigrationData[]\n\n // Get the highest batch number from existing migrations\n const latestBatch = Number(existingMigrations?.[0]?.batch) || 0\n\n return {\n existingMigrations,\n latestBatch,\n }\n}\n"],"names":["getMigrations","payload","migrationQuery","find","collection","limit","sort","where","batch","not_equals","existingMigrations","docs","latestBatch","Number"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAGA;;CAEC,GACD,OAAO,eAAeA,cAAc,EAClCC,OAAO,EAGR;IACC,MAAMC,iBAAiB,MAAMD,QAAQE,IAAI,CAAC;QACxCC,YAAY;QACZC,OAAO;QACPC,MAAM;QACNC,OAAO;YACLC,OAAO;gBACLC,YAAY,CAAC;YACf;QACF;IACF;IAEA,MAAMC,qBAAqBR,eAAeS,IAAI;IAE9C,wDAAwD;IACxD,MAAMC,cAAcC,OAAOH,oBAAoB,CAAC,EAAE,EAAEF,UAAU;IAE9D,OAAO;QACLE;QACAE;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/migrate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/migrate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAQtD,wBAAsB,OAAO,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0CtE"}
|
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
/* eslint-disable no-restricted-syntax, no-await-in-loop */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
get: function() {
|
|
8
|
-
return migrate;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _commitTransaction = require("../../utilities/commitTransaction");
|
|
12
|
-
const _initTransaction = require("../../utilities/initTransaction");
|
|
13
|
-
const _killTransaction = require("../../utilities/killTransaction");
|
|
14
|
-
const _getMigrations = require("./getMigrations");
|
|
15
|
-
const _readMigrationFiles = require("./readMigrationFiles");
|
|
16
|
-
async function migrate() {
|
|
1
|
+
/* eslint-disable no-restricted-syntax, no-await-in-loop */ import { commitTransaction } from '../../utilities/commitTransaction.js';
|
|
2
|
+
import { initTransaction } from '../../utilities/initTransaction.js';
|
|
3
|
+
import { killTransaction } from '../../utilities/killTransaction.js';
|
|
4
|
+
import { getMigrations } from './getMigrations.js';
|
|
5
|
+
import { readMigrationFiles } from './readMigrationFiles.js';
|
|
6
|
+
export async function migrate() {
|
|
17
7
|
const { payload } = this;
|
|
18
|
-
const migrationFiles = await
|
|
8
|
+
const migrationFiles = await readMigrationFiles({
|
|
19
9
|
payload
|
|
20
10
|
});
|
|
21
|
-
const { existingMigrations, latestBatch } = await
|
|
11
|
+
const { existingMigrations, latestBatch } = await getMigrations({
|
|
22
12
|
payload
|
|
23
13
|
});
|
|
24
14
|
const newBatch = latestBatch + 1;
|
|
@@ -37,7 +27,7 @@ async function migrate() {
|
|
|
37
27
|
msg: `Migrating: ${migration.name}`
|
|
38
28
|
});
|
|
39
29
|
try {
|
|
40
|
-
await
|
|
30
|
+
await initTransaction(req);
|
|
41
31
|
await migration.up({
|
|
42
32
|
payload,
|
|
43
33
|
req
|
|
@@ -53,9 +43,9 @@ async function migrate() {
|
|
|
53
43
|
},
|
|
54
44
|
req
|
|
55
45
|
});
|
|
56
|
-
await
|
|
46
|
+
await commitTransaction(req);
|
|
57
47
|
} catch (err) {
|
|
58
|
-
await
|
|
48
|
+
await killTransaction(req);
|
|
59
49
|
payload.logger.error({
|
|
60
50
|
err,
|
|
61
51
|
msg: `Error running migration ${migration.name}`
|
|
@@ -65,4 +55,4 @@ async function migrate() {
|
|
|
65
55
|
}
|
|
66
56
|
}
|
|
67
57
|
|
|
68
|
-
//# sourceMappingURL=
|
|
58
|
+
//# sourceMappingURL=migrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/database/migrations/migrate.ts"],"sourcesContent":["/* eslint-disable no-restricted-syntax, no-await-in-loop */\nimport type { PayloadRequest } from '../../types/index.js'\nimport type { BaseDatabaseAdapter } from '../types.js'\n\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { getMigrations } from './getMigrations.js'\nimport { readMigrationFiles } from './readMigrationFiles.js'\n\nexport async function migrate(this: BaseDatabaseAdapter): Promise<void> {\n const { payload } = this\n const migrationFiles = await readMigrationFiles({ payload })\n const { existingMigrations, latestBatch } = await getMigrations({ payload })\n\n const newBatch = latestBatch + 1\n\n // Execute 'up' function for each migration sequentially\n for (const migration of migrationFiles) {\n const existingMigration = existingMigrations.find(\n (existing) => existing.name === migration.name,\n )\n\n // Run migration if not found in database\n if (existingMigration) {\n continue // eslint-disable-line no-continue\n }\n\n const start = Date.now()\n const req = { payload } as PayloadRequest\n\n payload.logger.info({ msg: `Migrating: ${migration.name}` })\n\n try {\n await initTransaction(req)\n await migration.up({ payload, req })\n payload.logger.info({ msg: `Migrated: ${migration.name} (${Date.now() - start}ms)` })\n await payload.create({\n collection: 'payload-migrations',\n data: {\n name: migration.name,\n batch: newBatch,\n },\n req,\n })\n await commitTransaction(req)\n } catch (err: unknown) {\n await killTransaction(req)\n payload.logger.error({ err, msg: `Error running migration ${migration.name}` })\n throw err\n }\n }\n}\n"],"names":["commitTransaction","initTransaction","killTransaction","getMigrations","readMigrationFiles","migrate","payload","migrationFiles","existingMigrations","latestBatch","newBatch","migration","existingMigration","find","existing","name","start","Date","now","req","logger","info","msg","up","create","collection","data","batch","err","error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,yDAAyD,GAIzD,SAASA,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,aAAa,QAAQ,qBAAoB;AAClD,SAASC,kBAAkB,QAAQ,0BAAyB;AAE5D,OAAO,eAAeC;IACpB,MAAM,EAAEC,OAAO,EAAE,GAAG,IAAI;IACxB,MAAMC,iBAAiB,MAAMH,mBAAmB;QAAEE;IAAQ;IAC1D,MAAM,EAAEE,kBAAkB,EAAEC,WAAW,EAAE,GAAG,MAAMN,cAAc;QAAEG;IAAQ;IAE1E,MAAMI,WAAWD,cAAc;IAE/B,wDAAwD;IACxD,KAAK,MAAME,aAAaJ,eAAgB;QACtC,MAAMK,oBAAoBJ,mBAAmBK,IAAI,CAC/C,CAACC,WAAaA,SAASC,IAAI,KAAKJ,UAAUI,IAAI;QAGhD,yCAAyC;QACzC,IAAIH,mBAAmB;YACrB,UAAS,kCAAkC;QAC7C;QAEA,MAAMI,QAAQC,KAAKC,GAAG;QACtB,MAAMC,MAAM;YAAEb;QAAQ;QAEtBA,QAAQc,MAAM,CAACC,IAAI,CAAC;YAAEC,KAAK,CAAC,WAAW,EAAEX,UAAUI,IAAI,CAAC,CAAC;QAAC;QAE1D,IAAI;YACF,MAAMd,gBAAgBkB;YACtB,MAAMR,UAAUY,EAAE,CAAC;gBAAEjB;gBAASa;YAAI;YAClCb,QAAQc,MAAM,CAACC,IAAI,CAAC;gBAAEC,KAAK,CAAC,WAAW,EAAEX,UAAUI,IAAI,CAAC,EAAE,EAAEE,KAAKC,GAAG,KAAKF,MAAM,GAAG,CAAC;YAAC;YACpF,MAAMV,QAAQkB,MAAM,CAAC;gBACnBC,YAAY;gBACZC,MAAM;oBACJX,MAAMJ,UAAUI,IAAI;oBACpBY,OAAOjB;gBACT;gBACAS;YACF;YACA,MAAMnB,kBAAkBmB;QAC1B,EAAE,OAAOS,KAAc;YACrB,MAAM1B,gBAAgBiB;YACtBb,QAAQc,MAAM,CAACS,KAAK,CAAC;gBAAED;gBAAKN,KAAK,CAAC,wBAAwB,EAAEX,UAAUI,IAAI,CAAC,CAAC;YAAC;YAC7E,MAAMa;QACR;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrateDown.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/migrateDown.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"migrateDown.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/migrateDown.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAQtD,wBAAsB,WAAW,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoD1E"}
|
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
/* eslint-disable no-restricted-syntax, no-await-in-loop */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
get: function() {
|
|
8
|
-
return migrateDown;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _commitTransaction = require("../../utilities/commitTransaction");
|
|
12
|
-
const _initTransaction = require("../../utilities/initTransaction");
|
|
13
|
-
const _killTransaction = require("../../utilities/killTransaction");
|
|
14
|
-
const _getMigrations = require("./getMigrations");
|
|
15
|
-
const _readMigrationFiles = require("./readMigrationFiles");
|
|
16
|
-
async function migrateDown() {
|
|
1
|
+
/* eslint-disable no-restricted-syntax, no-await-in-loop */ import { commitTransaction } from '../../utilities/commitTransaction.js';
|
|
2
|
+
import { initTransaction } from '../../utilities/initTransaction.js';
|
|
3
|
+
import { killTransaction } from '../../utilities/killTransaction.js';
|
|
4
|
+
import { getMigrations } from './getMigrations.js';
|
|
5
|
+
import { readMigrationFiles } from './readMigrationFiles.js';
|
|
6
|
+
export async function migrateDown() {
|
|
17
7
|
const { payload } = this;
|
|
18
|
-
const migrationFiles = await
|
|
8
|
+
const migrationFiles = await readMigrationFiles({
|
|
19
9
|
payload
|
|
20
10
|
});
|
|
21
|
-
const { existingMigrations, latestBatch } = await
|
|
11
|
+
const { existingMigrations, latestBatch } = await getMigrations({
|
|
22
12
|
payload
|
|
23
13
|
});
|
|
24
14
|
if (!existingMigrations?.length) {
|
|
@@ -44,7 +34,7 @@ async function migrateDown() {
|
|
|
44
34
|
payload.logger.info({
|
|
45
35
|
msg: `Migrating down: ${migrationFile.name}`
|
|
46
36
|
});
|
|
47
|
-
await
|
|
37
|
+
await initTransaction(req);
|
|
48
38
|
await migrationFile.down({
|
|
49
39
|
payload,
|
|
50
40
|
req
|
|
@@ -58,9 +48,9 @@ async function migrateDown() {
|
|
|
58
48
|
collection: 'payload-migrations',
|
|
59
49
|
req
|
|
60
50
|
});
|
|
61
|
-
await
|
|
51
|
+
await commitTransaction(req);
|
|
62
52
|
} catch (err) {
|
|
63
|
-
await
|
|
53
|
+
await killTransaction(req);
|
|
64
54
|
payload.logger.error({
|
|
65
55
|
err,
|
|
66
56
|
msg: `Error running migration ${migrationFile.name}`
|
|
@@ -70,4 +60,4 @@ async function migrateDown() {
|
|
|
70
60
|
}
|
|
71
61
|
}
|
|
72
62
|
|
|
73
|
-
//# sourceMappingURL=
|
|
63
|
+
//# sourceMappingURL=migrateDown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/database/migrations/migrateDown.ts"],"sourcesContent":["/* eslint-disable no-restricted-syntax, no-await-in-loop */\nimport type { PayloadRequest } from '../../types/index.js'\nimport type { BaseDatabaseAdapter } from '../types.js'\n\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { getMigrations } from './getMigrations.js'\nimport { readMigrationFiles } from './readMigrationFiles.js'\n\nexport async function migrateDown(this: BaseDatabaseAdapter): Promise<void> {\n const { payload } = this\n const migrationFiles = await readMigrationFiles({ payload })\n\n const { existingMigrations, latestBatch } = await getMigrations({\n payload,\n })\n\n if (!existingMigrations?.length) {\n payload.logger.info({ msg: 'No migrations to rollback.' })\n return\n }\n\n payload.logger.info({\n msg: `Rolling back batch ${latestBatch} consisting of ${existingMigrations.length} migration(s).`,\n })\n\n const latestBatchMigrations = existingMigrations.filter(({ batch }) => batch === latestBatch)\n\n for (const migration of latestBatchMigrations) {\n const migrationFile = migrationFiles.find((m) => m.name === migration.name)\n if (!migrationFile) {\n throw new Error(`Migration ${migration.name} not found locally.`)\n }\n\n const start = Date.now()\n const req = { payload } as PayloadRequest\n\n try {\n payload.logger.info({ msg: `Migrating down: ${migrationFile.name}` })\n await initTransaction(req)\n await migrationFile.down({ payload, req })\n payload.logger.info({\n msg: `Migrated down: ${migrationFile.name} (${Date.now() - start}ms)`,\n })\n // Waiting for implementation here\n await payload.delete({\n id: migration.id,\n collection: 'payload-migrations',\n req,\n })\n\n await commitTransaction(req)\n } catch (err: unknown) {\n await killTransaction(req)\n payload.logger.error({\n err,\n msg: `Error running migration ${migrationFile.name}`,\n })\n process.exit(1)\n }\n }\n}\n"],"names":["commitTransaction","initTransaction","killTransaction","getMigrations","readMigrationFiles","migrateDown","payload","migrationFiles","existingMigrations","latestBatch","length","logger","info","msg","latestBatchMigrations","filter","batch","migration","migrationFile","find","m","name","Error","start","Date","now","req","down","delete","id","collection","err","error","process","exit"],"rangeMappings":";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