payload 4.0.0-internal.2fddfc0 → 4.0.0-internal.31ba7ee
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/LICENSE.md +1 -1
- package/bin.js +17 -13
- package/dist/__testing__/predefinedMigration.d.ts +4 -3
- package/dist/__testing__/predefinedMigration.d.ts.map +1 -1
- package/dist/admin/RichText.d.ts +2 -22
- package/dist/admin/RichText.d.ts.map +1 -1
- package/dist/admin/RichText.js.map +1 -1
- package/dist/admin/adapters/devReload.d.ts +13 -0
- package/dist/admin/adapters/devReload.d.ts.map +1 -1
- package/dist/admin/adapters/devReload.js +14 -1
- package/dist/admin/adapters/devReload.js.map +1 -1
- package/dist/admin/adapters/router.d.ts +8 -0
- package/dist/admin/adapters/router.d.ts.map +1 -1
- package/dist/admin/adapters/router.js.map +1 -1
- package/dist/admin/fields/Array.d.ts +11 -13
- package/dist/admin/fields/Array.d.ts.map +1 -1
- package/dist/admin/fields/Array.js.map +1 -1
- package/dist/admin/fields/Blocks.d.ts +13 -16
- package/dist/admin/fields/Blocks.d.ts.map +1 -1
- package/dist/admin/fields/Blocks.js.map +1 -1
- package/dist/admin/fields/Checkbox.d.ts +11 -13
- package/dist/admin/fields/Checkbox.d.ts.map +1 -1
- package/dist/admin/fields/Checkbox.js.map +1 -1
- package/dist/admin/fields/Code.d.ts +11 -13
- package/dist/admin/fields/Code.d.ts.map +1 -1
- package/dist/admin/fields/Code.js.map +1 -1
- package/dist/admin/fields/Collapsible.d.ts +11 -13
- package/dist/admin/fields/Collapsible.d.ts.map +1 -1
- package/dist/admin/fields/Collapsible.js.map +1 -1
- package/dist/admin/fields/Date.d.ts +11 -13
- package/dist/admin/fields/Date.d.ts.map +1 -1
- package/dist/admin/fields/Date.js.map +1 -1
- package/dist/admin/fields/Email.d.ts +11 -13
- package/dist/admin/fields/Email.d.ts.map +1 -1
- package/dist/admin/fields/Email.js.map +1 -1
- package/dist/admin/fields/Group.d.ts +11 -13
- package/dist/admin/fields/Group.d.ts.map +1 -1
- package/dist/admin/fields/Group.js.map +1 -1
- package/dist/admin/fields/JSON.d.ts +11 -13
- package/dist/admin/fields/JSON.d.ts.map +1 -1
- package/dist/admin/fields/JSON.js.map +1 -1
- package/dist/admin/fields/Join.d.ts +12 -14
- package/dist/admin/fields/Join.d.ts.map +1 -1
- package/dist/admin/fields/Join.js.map +1 -1
- package/dist/admin/fields/Number.d.ts +11 -13
- package/dist/admin/fields/Number.d.ts.map +1 -1
- package/dist/admin/fields/Number.js.map +1 -1
- package/dist/admin/fields/Point.d.ts +11 -13
- package/dist/admin/fields/Point.d.ts.map +1 -1
- package/dist/admin/fields/Point.js.map +1 -1
- package/dist/admin/fields/Radio.d.ts +11 -13
- package/dist/admin/fields/Radio.d.ts.map +1 -1
- package/dist/admin/fields/Radio.js.map +1 -1
- package/dist/admin/fields/Relationship.d.ts +11 -13
- package/dist/admin/fields/Relationship.d.ts.map +1 -1
- package/dist/admin/fields/Relationship.js.map +1 -1
- package/dist/admin/fields/RichText.d.ts +13 -15
- package/dist/admin/fields/RichText.d.ts.map +1 -1
- package/dist/admin/fields/RichText.js.map +1 -1
- package/dist/admin/fields/Row.d.ts +10 -12
- package/dist/admin/fields/Row.d.ts.map +1 -1
- package/dist/admin/fields/Row.js.map +1 -1
- package/dist/admin/fields/Select.d.ts +11 -13
- package/dist/admin/fields/Select.d.ts.map +1 -1
- package/dist/admin/fields/Select.js.map +1 -1
- package/dist/admin/fields/Tabs.d.ts +11 -13
- package/dist/admin/fields/Tabs.d.ts.map +1 -1
- package/dist/admin/fields/Tabs.js.map +1 -1
- package/dist/admin/fields/Text.d.ts +11 -13
- package/dist/admin/fields/Text.d.ts.map +1 -1
- package/dist/admin/fields/Text.js.map +1 -1
- package/dist/admin/fields/Textarea.d.ts +11 -13
- package/dist/admin/fields/Textarea.d.ts.map +1 -1
- package/dist/admin/fields/Textarea.js.map +1 -1
- package/dist/admin/fields/UI.d.ts +3 -5
- package/dist/admin/fields/UI.d.ts.map +1 -1
- package/dist/admin/fields/UI.js.map +1 -1
- package/dist/admin/fields/Upload.d.ts +11 -13
- package/dist/admin/fields/Upload.d.ts.map +1 -1
- package/dist/admin/fields/Upload.js.map +1 -1
- package/dist/admin/forms/Description.d.ts +0 -2
- package/dist/admin/forms/Description.d.ts.map +1 -1
- package/dist/admin/forms/Description.js.map +1 -1
- package/dist/admin/forms/Diff.d.ts +0 -2
- package/dist/admin/forms/Diff.d.ts.map +1 -1
- package/dist/admin/forms/Diff.js.map +1 -1
- package/dist/admin/forms/Error.d.ts +0 -2
- package/dist/admin/forms/Error.d.ts.map +1 -1
- package/dist/admin/forms/Error.js.map +1 -1
- package/dist/admin/forms/Field.d.ts +6 -4
- package/dist/admin/forms/Field.d.ts.map +1 -1
- package/dist/admin/forms/Field.js.map +1 -1
- package/dist/admin/forms/Form.d.ts +2 -29
- package/dist/admin/forms/Form.d.ts.map +1 -1
- package/dist/admin/forms/Form.js.map +1 -1
- package/dist/admin/forms/Label.d.ts +0 -2
- package/dist/admin/forms/Label.d.ts.map +1 -1
- package/dist/admin/forms/Label.js.map +1 -1
- package/dist/admin/functions/index.d.ts +16 -12
- package/dist/admin/functions/index.d.ts.map +1 -1
- package/dist/admin/functions/index.js.map +1 -1
- package/dist/admin/getRequestLocale.d.ts +6 -0
- package/dist/admin/getRequestLocale.d.ts.map +1 -0
- package/dist/admin/getRequestLocale.js +38 -0
- package/dist/admin/getRequestLocale.js.map +1 -0
- package/dist/admin/initAdminContext.d.ts +39 -0
- package/dist/admin/initAdminContext.d.ts.map +1 -0
- package/dist/admin/initAdminContext.js +154 -0
- package/dist/admin/initAdminContext.js.map +1 -0
- package/dist/admin/types.d.ts +31 -30
- package/dist/admin/types.d.ts.map +1 -1
- package/dist/admin/types.js.map +1 -1
- package/dist/admin/views/dashboard.d.ts +2 -2
- package/dist/admin/views/dashboard.d.ts.map +1 -1
- package/dist/admin/views/dashboard.js.map +1 -1
- package/dist/admin/views/index.d.ts +2 -2
- package/dist/admin/views/index.d.ts.map +1 -1
- package/dist/admin/views/index.js.map +1 -1
- package/dist/auth/applyUserReadAccess.d.ts +13 -0
- package/dist/auth/applyUserReadAccess.d.ts.map +1 -0
- package/dist/auth/applyUserReadAccess.js +41 -0
- package/dist/auth/applyUserReadAccess.js.map +1 -0
- package/dist/auth/baseFields/apiKey/canCreateOrUpdateAPIKey.d.ts +4 -0
- package/dist/auth/baseFields/apiKey/canCreateOrUpdateAPIKey.d.ts.map +1 -0
- package/dist/auth/baseFields/apiKey/canCreateOrUpdateAPIKey.js +20 -0
- package/dist/auth/baseFields/apiKey/canCreateOrUpdateAPIKey.js.map +1 -0
- package/dist/auth/baseFields/apiKey/encryptAPIKey.d.ts +4 -0
- package/dist/auth/baseFields/apiKey/encryptAPIKey.d.ts.map +1 -0
- package/dist/auth/baseFields/apiKey/encryptAPIKey.js +11 -0
- package/dist/auth/baseFields/apiKey/encryptAPIKey.js.map +1 -0
- package/dist/auth/baseFields/apiKey/getAPIKeyLast4.d.ts +3 -0
- package/dist/auth/baseFields/apiKey/getAPIKeyLast4.d.ts.map +1 -0
- package/dist/auth/baseFields/apiKey/getAPIKeyLast4.js +5 -0
- package/dist/auth/baseFields/apiKey/getAPIKeyLast4.js.map +1 -0
- package/dist/auth/baseFields/apiKey/omitAPIKey.d.ts +5 -0
- package/dist/auth/baseFields/apiKey/omitAPIKey.d.ts.map +1 -0
- package/dist/auth/baseFields/apiKey/omitAPIKey.js +11 -0
- package/dist/auth/baseFields/apiKey/omitAPIKey.js.map +1 -0
- package/dist/auth/baseFields/apiKey/omitAPIKeyIndex.d.ts +4 -0
- package/dist/auth/baseFields/apiKey/omitAPIKeyIndex.d.ts.map +1 -0
- package/dist/auth/baseFields/apiKey/omitAPIKeyIndex.js +5 -0
- package/dist/auth/baseFields/apiKey/omitAPIKeyIndex.js.map +1 -0
- package/dist/auth/baseFields/apiKey/omitEncryptedAPIKey.d.ts +4 -0
- package/dist/auth/baseFields/apiKey/omitEncryptedAPIKey.d.ts.map +1 -0
- package/dist/auth/baseFields/apiKey/omitEncryptedAPIKey.js +5 -0
- package/dist/auth/baseFields/apiKey/omitEncryptedAPIKey.js.map +1 -0
- package/dist/auth/baseFields/apiKey/setAPIKeyIndex.d.ts +4 -0
- package/dist/auth/baseFields/apiKey/setAPIKeyIndex.d.ts.map +1 -0
- package/dist/auth/baseFields/apiKey/setAPIKeyIndex.js +12 -0
- package/dist/auth/baseFields/apiKey/setAPIKeyIndex.js.map +1 -0
- package/dist/auth/baseFields/apiKey/setKeyLast4.d.ts +4 -0
- package/dist/auth/baseFields/apiKey/setKeyLast4.d.ts.map +1 -0
- package/dist/auth/baseFields/apiKey/setKeyLast4.js +12 -0
- package/dist/auth/baseFields/apiKey/setKeyLast4.js.map +1 -0
- package/dist/auth/baseFields/apiKey.d.ts +6 -6
- package/dist/auth/baseFields/apiKey.d.ts.map +1 -1
- package/dist/auth/baseFields/apiKey.js +88 -57
- package/dist/auth/baseFields/apiKey.js.map +1 -1
- package/dist/auth/baseFields/auth.d.ts +1 -0
- package/dist/auth/baseFields/auth.d.ts.map +1 -1
- package/dist/auth/baseFields/auth.js +9 -0
- package/dist/auth/baseFields/auth.js.map +1 -1
- package/dist/auth/cookies.d.ts +2 -2
- package/dist/auth/cookies.d.ts.map +1 -1
- package/dist/auth/crypto.d.ts +73 -2
- package/dist/auth/crypto.d.ts.map +1 -1
- package/dist/auth/crypto.js +90 -13
- package/dist/auth/crypto.js.map +1 -1
- package/dist/auth/defaultAccess.d.ts.map +1 -1
- package/dist/auth/defaultUnlockAccess.d.ts +3 -0
- package/dist/auth/defaultUnlockAccess.d.ts.map +1 -0
- package/dist/auth/defaultUnlockAccess.js +8 -0
- package/dist/auth/defaultUnlockAccess.js.map +1 -0
- package/dist/auth/endpoints/index.d.ts +1 -0
- package/dist/auth/endpoints/index.d.ts.map +1 -1
- package/dist/auth/endpoints/index.js +8 -0
- package/dist/auth/endpoints/index.js.map +1 -1
- package/dist/auth/endpoints/login.d.ts.map +1 -1
- package/dist/auth/endpoints/login.js +2 -11
- package/dist/auth/endpoints/login.js.map +1 -1
- package/dist/auth/endpoints/refresh.d.ts.map +1 -1
- package/dist/auth/endpoints/refresh.js +4 -6
- package/dist/auth/endpoints/refresh.js.map +1 -1
- package/dist/auth/endpoints/revealAPIKey.d.ts +7 -0
- package/dist/auth/endpoints/revealAPIKey.d.ts.map +1 -0
- package/dist/auth/endpoints/revealAPIKey.js +122 -0
- package/dist/auth/endpoints/revealAPIKey.js.map +1 -0
- package/dist/auth/ensureUsernameOrEmail.d.ts.map +1 -1
- package/dist/auth/executeAccess.d.ts +2 -1
- package/dist/auth/executeAccess.d.ts.map +1 -1
- package/dist/auth/executeAccess.js +2 -1
- package/dist/auth/executeAccess.js.map +1 -1
- package/dist/auth/executeAuthStrategies.d.ts.map +1 -1
- package/dist/auth/extractAccessFromPermission.d.ts.map +1 -1
- package/dist/auth/extractJWT.d.ts +1 -1
- package/dist/auth/extractJWT.d.ts.map +1 -1
- package/dist/auth/getAccessResults.js +1 -0
- package/dist/auth/getAccessResults.js.map +1 -1
- package/dist/auth/getAuthFields.d.ts +1 -1
- package/dist/auth/getAuthFields.d.ts.map +1 -1
- package/dist/auth/getAuthFields.js +7 -4
- package/dist/auth/getAuthFields.js.map +1 -1
- package/dist/auth/getFieldsToSign.d.ts +1 -1
- package/dist/auth/getFieldsToSign.d.ts.map +1 -1
- package/dist/auth/getFieldsToSign.js +20 -10
- package/dist/auth/getFieldsToSign.js.map +1 -1
- package/dist/auth/getLoginOptions.d.ts +1 -1
- package/dist/auth/getLoginOptions.d.ts.map +1 -1
- package/dist/auth/getLoginOptions.js.map +1 -1
- package/dist/auth/isUserLocked.d.ts.map +1 -1
- package/dist/auth/jwt.d.ts.map +1 -1
- package/dist/auth/jwt.js +2 -0
- package/dist/auth/jwt.js.map +1 -1
- package/dist/auth/jwtAuth.d.ts +9 -0
- package/dist/auth/jwtAuth.d.ts.map +1 -0
- package/dist/auth/jwtAuth.js +8 -0
- package/dist/auth/jwtAuth.js.map +1 -0
- package/dist/auth/loginWithCookie.d.ts +33 -0
- package/dist/auth/loginWithCookie.d.ts.map +1 -0
- package/dist/auth/loginWithCookie.js +34 -0
- package/dist/auth/loginWithCookie.js.map +1 -0
- package/dist/auth/operations/access.d.ts.map +1 -1
- package/dist/auth/operations/access.js +3 -9
- package/dist/auth/operations/access.js.map +1 -1
- package/dist/auth/operations/auth.d.ts +2 -2
- package/dist/auth/operations/auth.d.ts.map +1 -1
- package/dist/auth/operations/auth.js +16 -21
- package/dist/auth/operations/auth.js.map +1 -1
- package/dist/auth/operations/forgotPassword.d.ts.map +1 -1
- package/dist/auth/operations/forgotPassword.js +97 -14
- package/dist/auth/operations/forgotPassword.js.map +1 -1
- package/dist/auth/operations/init.d.ts.map +1 -1
- package/dist/auth/operations/local/auth.d.ts.map +1 -1
- package/dist/auth/operations/local/auth.js +7 -4
- package/dist/auth/operations/local/auth.js.map +1 -1
- package/dist/auth/operations/local/forgotPassword.d.ts +2 -2
- package/dist/auth/operations/local/forgotPassword.d.ts.map +1 -1
- package/dist/auth/operations/local/forgotPassword.js +6 -3
- package/dist/auth/operations/local/forgotPassword.js.map +1 -1
- package/dist/auth/operations/local/login.d.ts +2 -2
- package/dist/auth/operations/local/login.d.ts.map +1 -1
- package/dist/auth/operations/local/login.js +6 -3
- package/dist/auth/operations/local/login.js.map +1 -1
- package/dist/auth/operations/local/resetPassword.js +5 -2
- package/dist/auth/operations/local/resetPassword.js.map +1 -1
- package/dist/auth/operations/local/unlock.d.ts +2 -2
- package/dist/auth/operations/local/unlock.d.ts.map +1 -1
- package/dist/auth/operations/local/unlock.js +6 -3
- package/dist/auth/operations/local/unlock.js.map +1 -1
- package/dist/auth/operations/local/verifyEmail.js +5 -2
- package/dist/auth/operations/local/verifyEmail.js.map +1 -1
- package/dist/auth/operations/login.d.ts +2 -1
- package/dist/auth/operations/login.d.ts.map +1 -1
- package/dist/auth/operations/login.js +48 -26
- package/dist/auth/operations/login.js.map +1 -1
- package/dist/auth/operations/logout.d.ts.map +1 -1
- package/dist/auth/operations/me.d.ts +2 -9
- package/dist/auth/operations/me.d.ts.map +1 -1
- package/dist/auth/operations/me.js +0 -6
- package/dist/auth/operations/me.js.map +1 -1
- package/dist/auth/operations/refresh.d.ts +0 -7
- package/dist/auth/operations/refresh.d.ts.map +1 -1
- package/dist/auth/operations/refresh.js +41 -18
- package/dist/auth/operations/refresh.js.map +1 -1
- package/dist/auth/operations/registerFirstUser.d.ts.map +1 -1
- package/dist/auth/operations/registerFirstUser.js +4 -4
- package/dist/auth/operations/registerFirstUser.js.map +1 -1
- package/dist/auth/operations/resetPassword.d.ts.map +1 -1
- package/dist/auth/operations/resetPassword.js +31 -22
- package/dist/auth/operations/resetPassword.js.map +1 -1
- package/dist/auth/operations/unlock.d.ts.map +1 -1
- package/dist/auth/operations/unlock.js +1 -0
- package/dist/auth/operations/unlock.js.map +1 -1
- package/dist/auth/operations/verifyEmail.d.ts.map +1 -1
- package/dist/auth/rotateSecret.d.ts +51 -0
- package/dist/auth/rotateSecret.d.ts.map +1 -0
- package/dist/auth/rotateSecret.js +131 -0
- package/dist/auth/rotateSecret.js.map +1 -0
- package/dist/auth/sendVerificationEmail.d.ts +2 -2
- package/dist/auth/sendVerificationEmail.d.ts.map +1 -1
- package/dist/auth/sendVerificationEmail.js +1 -1
- package/dist/auth/sendVerificationEmail.js.map +1 -1
- package/dist/auth/serverFunctions/cookies.d.ts +47 -0
- package/dist/auth/serverFunctions/cookies.d.ts.map +1 -0
- package/dist/auth/serverFunctions/cookies.js +52 -0
- package/dist/auth/serverFunctions/cookies.js.map +1 -0
- package/dist/auth/serverFunctions/login.d.ts +29 -0
- package/dist/auth/serverFunctions/login.d.ts.map +1 -0
- package/dist/auth/serverFunctions/login.js +65 -0
- package/dist/auth/serverFunctions/login.js.map +1 -0
- package/dist/auth/serverFunctions/logout.d.ts +17 -0
- package/dist/auth/serverFunctions/logout.d.ts.map +1 -0
- package/dist/auth/serverFunctions/logout.js +59 -0
- package/dist/auth/serverFunctions/logout.js.map +1 -0
- package/dist/auth/serverFunctions/refresh.d.ts +17 -0
- package/dist/auth/serverFunctions/refresh.d.ts.map +1 -0
- package/dist/auth/serverFunctions/refresh.js +62 -0
- package/dist/auth/serverFunctions/refresh.js.map +1 -0
- package/dist/auth/sessions.d.ts +4 -5
- package/dist/auth/sessions.d.ts.map +1 -1
- package/dist/auth/sessions.js +5 -3
- package/dist/auth/sessions.js.map +1 -1
- package/dist/auth/strategies/apiKey.d.ts.map +1 -1
- package/dist/auth/strategies/apiKey.js +42 -4
- package/dist/auth/strategies/apiKey.js.map +1 -1
- package/dist/auth/strategies/jwt.d.ts.map +1 -1
- package/dist/auth/strategies/jwt.js +83 -11
- package/dist/auth/strategies/jwt.js.map +1 -1
- package/dist/auth/strategies/local/authenticate.d.ts +5 -1
- package/dist/auth/strategies/local/authenticate.d.ts.map +1 -1
- package/dist/auth/strategies/local/authenticate.js +8 -3
- package/dist/auth/strategies/local/authenticate.js.map +1 -1
- package/dist/auth/strategies/local/generatePasswordSaltHash.d.ts +9 -1
- package/dist/auth/strategies/local/generatePasswordSaltHash.d.ts.map +1 -1
- package/dist/auth/strategies/local/generatePasswordSaltHash.js +61 -34
- package/dist/auth/strategies/local/generatePasswordSaltHash.js.map +1 -1
- package/dist/auth/strategies/local/incrementLoginAttempts.d.ts +2 -2
- package/dist/auth/strategies/local/incrementLoginAttempts.d.ts.map +1 -1
- package/dist/auth/strategies/local/incrementLoginAttempts.js +1 -1
- package/dist/auth/strategies/local/incrementLoginAttempts.js.map +1 -1
- package/dist/auth/strategies/local/register.d.ts.map +1 -1
- package/dist/auth/strategies/local/register.js +1 -0
- package/dist/auth/strategies/local/register.js.map +1 -1
- package/dist/auth/strategies/local/resetLoginAttempts.d.ts.map +1 -1
- package/dist/auth/types.d.ts +58 -38
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/auth/types.js.map +1 -1
- package/dist/auth/withBaseAccess.d.ts +22 -0
- package/dist/auth/withBaseAccess.d.ts.map +1 -0
- package/dist/auth/withBaseAccess.js +61 -0
- package/dist/auth/withBaseAccess.js.map +1 -0
- package/dist/cli/commands/build/build.d.ts +44 -0
- package/dist/cli/commands/build/build.d.ts.map +1 -0
- package/dist/cli/commands/build/build.js +225 -0
- package/dist/cli/commands/build/build.js.map +1 -0
- package/dist/cli/commands/build/index.d.ts +2 -0
- package/dist/cli/commands/build/index.d.ts.map +1 -0
- package/dist/cli/commands/build/index.js +26 -0
- package/dist/cli/commands/build/index.js.map +1 -0
- package/dist/cli/commands/collections/countDocuments.d.ts +2 -0
- package/dist/cli/commands/collections/countDocuments.d.ts.map +1 -0
- package/dist/cli/commands/collections/countDocuments.js +37 -0
- package/dist/cli/commands/collections/countDocuments.js.map +1 -0
- package/dist/cli/commands/collections/countVersions.d.ts +2 -0
- package/dist/cli/commands/collections/countVersions.d.ts.map +1 -0
- package/dist/cli/commands/collections/countVersions.js +36 -0
- package/dist/cli/commands/collections/countVersions.js.map +1 -0
- package/dist/cli/commands/collections/createDocuments.d.ts +2 -0
- package/dist/cli/commands/collections/createDocuments.d.ts.map +1 -0
- package/dist/cli/commands/collections/createDocuments.js +132 -0
- package/dist/cli/commands/collections/createDocuments.js.map +1 -0
- package/dist/cli/commands/collections/deleteDocuments.d.ts +2 -0
- package/dist/cli/commands/collections/deleteDocuments.d.ts.map +1 -0
- package/dist/cli/commands/collections/deleteDocuments.js +64 -0
- package/dist/cli/commands/collections/deleteDocuments.js.map +1 -0
- package/dist/cli/commands/collections/duplicateDocument.d.ts +2 -0
- package/dist/cli/commands/collections/duplicateDocument.d.ts.map +1 -0
- package/dist/cli/commands/collections/duplicateDocument.js +109 -0
- package/dist/cli/commands/collections/duplicateDocument.js.map +1 -0
- package/dist/cli/commands/collections/findDistinct.d.ts +2 -0
- package/dist/cli/commands/collections/findDistinct.d.ts.map +1 -0
- package/dist/cli/commands/collections/findDistinct.js +52 -0
- package/dist/cli/commands/collections/findDistinct.js.map +1 -0
- package/dist/cli/commands/collections/findDocuments.d.ts +2 -0
- package/dist/cli/commands/collections/findDocuments.d.ts.map +1 -0
- package/dist/cli/commands/collections/findDocuments.js +79 -0
- package/dist/cli/commands/collections/findDocuments.js.map +1 -0
- package/dist/cli/commands/collections/findVersionByID.d.ts +2 -0
- package/dist/cli/commands/collections/findVersionByID.d.ts.map +1 -0
- package/dist/cli/commands/collections/findVersionByID.js +48 -0
- package/dist/cli/commands/collections/findVersionByID.js.map +1 -0
- package/dist/cli/commands/collections/findVersions.d.ts +2 -0
- package/dist/cli/commands/collections/findVersions.d.ts.map +1 -0
- package/dist/cli/commands/collections/findVersions.js +57 -0
- package/dist/cli/commands/collections/findVersions.js.map +1 -0
- package/dist/cli/commands/collections/getCollectionSchema.d.ts +2 -0
- package/dist/cli/commands/collections/getCollectionSchema.d.ts.map +1 -0
- package/dist/cli/commands/collections/getCollectionSchema.js +51 -0
- package/dist/cli/commands/collections/getCollectionSchema.js.map +1 -0
- package/dist/cli/commands/collections/restoreVersion.d.ts +2 -0
- package/dist/cli/commands/collections/restoreVersion.d.ts.map +1 -0
- package/dist/cli/commands/collections/restoreVersion.js +47 -0
- package/dist/cli/commands/collections/restoreVersion.js.map +1 -0
- package/dist/cli/commands/collections/updateDocument.d.ts +2 -0
- package/dist/cli/commands/collections/updateDocument.d.ts.map +1 -0
- package/dist/cli/commands/collections/updateDocument.js +192 -0
- package/dist/cli/commands/collections/updateDocument.js.map +1 -0
- package/dist/cli/commands/data/input.d.ts +28 -0
- package/dist/cli/commands/data/input.d.ts.map +1 -0
- package/dist/cli/commands/data/input.js +76 -0
- package/dist/cli/commands/data/input.js.map +1 -0
- package/dist/cli/commands/data/utilities.d.ts +65 -0
- package/dist/cli/commands/data/utilities.d.ts.map +1 -0
- package/dist/cli/commands/data/utilities.js +67 -0
- package/dist/cli/commands/data/utilities.js.map +1 -0
- package/dist/cli/commands/generateDBSchema.d.ts +2 -0
- package/dist/cli/commands/generateDBSchema.d.ts.map +1 -0
- package/dist/cli/commands/generateDBSchema.js +29 -0
- package/dist/cli/commands/generateDBSchema.js.map +1 -0
- package/dist/cli/commands/generateImportMap/frameworkConventions.d.ts +8 -0
- package/dist/cli/commands/generateImportMap/frameworkConventions.d.ts.map +1 -0
- package/dist/cli/commands/generateImportMap/frameworkConventions.js +8 -0
- package/dist/cli/commands/generateImportMap/frameworkConventions.js.map +1 -0
- package/dist/{bin/generateImportMap/index.d.ts → cli/commands/generateImportMap/generateImportMap.d.ts} +8 -4
- package/dist/cli/commands/generateImportMap/generateImportMap.d.ts.map +1 -0
- package/dist/{bin/generateImportMap/index.js → cli/commands/generateImportMap/generateImportMap.js} +9 -4
- package/dist/cli/commands/generateImportMap/generateImportMap.js.map +1 -0
- package/dist/cli/commands/generateImportMap/index.d.ts +2 -0
- package/dist/cli/commands/generateImportMap/index.d.ts.map +1 -0
- package/dist/cli/commands/generateImportMap/index.js +18 -0
- package/dist/cli/commands/generateImportMap/index.js.map +1 -0
- package/dist/{bin → cli/commands}/generateImportMap/iterateCollections.d.ts +3 -3
- package/dist/cli/commands/generateImportMap/iterateCollections.d.ts.map +1 -0
- package/dist/{bin → cli/commands}/generateImportMap/iterateCollections.js +10 -0
- package/dist/cli/commands/generateImportMap/iterateCollections.js.map +1 -0
- package/dist/{bin → cli/commands}/generateImportMap/iterateConfig.d.ts +2 -2
- package/dist/cli/commands/generateImportMap/iterateConfig.d.ts.map +1 -0
- package/dist/{bin → cli/commands}/generateImportMap/iterateConfig.js +1 -1
- package/dist/cli/commands/generateImportMap/iterateConfig.js.map +1 -0
- package/dist/{bin → cli/commands}/generateImportMap/iterateFields.d.ts +3 -3
- package/dist/cli/commands/generateImportMap/iterateFields.d.ts.map +1 -0
- package/dist/cli/commands/generateImportMap/iterateFields.js.map +1 -0
- package/dist/{bin → cli/commands}/generateImportMap/iterateGlobals.d.ts +3 -3
- package/dist/cli/commands/generateImportMap/iterateGlobals.d.ts.map +1 -0
- package/dist/cli/commands/generateImportMap/iterateGlobals.js.map +1 -0
- package/dist/{bin → cli/commands}/generateImportMap/utilities/addPayloadComponentToImportMap.d.ts +2 -2
- package/dist/cli/commands/generateImportMap/utilities/addPayloadComponentToImportMap.d.ts.map +1 -0
- package/dist/cli/commands/generateImportMap/utilities/addPayloadComponentToImportMap.js.map +1 -0
- package/dist/{bin → cli/commands}/generateImportMap/utilities/getFromImportMap.d.ts +2 -2
- package/dist/cli/commands/generateImportMap/utilities/getFromImportMap.d.ts.map +1 -0
- package/dist/cli/commands/generateImportMap/utilities/getFromImportMap.js.map +1 -0
- package/dist/cli/commands/generateImportMap/utilities/getImportMapToBaseDirPath.d.ts.map +1 -0
- package/dist/cli/commands/generateImportMap/utilities/getImportMapToBaseDirPath.js.map +1 -0
- package/dist/{bin → cli/commands}/generateImportMap/utilities/parsePayloadComponent.d.ts +1 -1
- package/dist/cli/commands/generateImportMap/utilities/parsePayloadComponent.d.ts.map +1 -0
- package/dist/cli/commands/generateImportMap/utilities/parsePayloadComponent.js.map +1 -0
- package/dist/cli/commands/generateImportMap/utilities/resolveImportMapFilePath.d.ts.map +1 -0
- package/dist/{bin → cli/commands}/generateImportMap/utilities/resolveImportMapFilePath.js +13 -4
- package/dist/cli/commands/generateImportMap/utilities/resolveImportMapFilePath.js.map +1 -0
- package/dist/cli/commands/generateTypes.d.ts +12 -0
- package/dist/cli/commands/generateTypes.d.ts.map +1 -0
- package/dist/{bin → cli/commands}/generateTypes.js +33 -7
- package/dist/cli/commands/generateTypes.js.map +1 -0
- package/dist/cli/commands/getConfigInfo.d.ts +2 -0
- package/dist/cli/commands/getConfigInfo.d.ts.map +1 -0
- package/dist/cli/commands/getConfigInfo.js +23 -0
- package/dist/cli/commands/getConfigInfo.js.map +1 -0
- package/dist/cli/commands/globals/countGlobalVersions.d.ts +2 -0
- package/dist/cli/commands/globals/countGlobalVersions.d.ts.map +1 -0
- package/dist/cli/commands/globals/countGlobalVersions.js +36 -0
- package/dist/cli/commands/globals/countGlobalVersions.js.map +1 -0
- package/dist/cli/commands/globals/findGlobal.d.ts +2 -0
- package/dist/cli/commands/globals/findGlobal.d.ts.map +1 -0
- package/dist/cli/commands/globals/findGlobal.js +42 -0
- package/dist/cli/commands/globals/findGlobal.js.map +1 -0
- package/dist/cli/commands/globals/findGlobalVersionByID.d.ts +2 -0
- package/dist/cli/commands/globals/findGlobalVersionByID.d.ts.map +1 -0
- package/dist/cli/commands/globals/findGlobalVersionByID.js +46 -0
- package/dist/cli/commands/globals/findGlobalVersionByID.js.map +1 -0
- package/dist/cli/commands/globals/findGlobalVersions.d.ts +2 -0
- package/dist/cli/commands/globals/findGlobalVersions.d.ts.map +1 -0
- package/dist/cli/commands/globals/findGlobalVersions.js +55 -0
- package/dist/cli/commands/globals/findGlobalVersions.js.map +1 -0
- package/dist/cli/commands/globals/getGlobalSchema.d.ts +2 -0
- package/dist/cli/commands/globals/getGlobalSchema.d.ts.map +1 -0
- package/dist/cli/commands/globals/getGlobalSchema.js +36 -0
- package/dist/cli/commands/globals/getGlobalSchema.js.map +1 -0
- package/dist/cli/commands/globals/restoreGlobalVersion.d.ts +2 -0
- package/dist/cli/commands/globals/restoreGlobalVersion.d.ts.map +1 -0
- package/dist/cli/commands/globals/restoreGlobalVersion.js +46 -0
- package/dist/cli/commands/globals/restoreGlobalVersion.js.map +1 -0
- package/dist/cli/commands/globals/updateGlobal.d.ts +2 -0
- package/dist/cli/commands/globals/updateGlobal.d.ts.map +1 -0
- package/dist/cli/commands/globals/updateGlobal.js +95 -0
- package/dist/cli/commands/globals/updateGlobal.js.map +1 -0
- package/dist/cli/commands/help.d.ts +2 -0
- package/dist/cli/commands/help.d.ts.map +1 -0
- package/dist/cli/commands/help.js +42 -0
- package/dist/cli/commands/help.js.map +1 -0
- package/dist/cli/commands/info.d.ts +2 -0
- package/dist/cli/commands/info.d.ts.map +1 -0
- package/dist/cli/commands/info.js +78 -0
- package/dist/cli/commands/info.js.map +1 -0
- package/dist/cli/commands/jobs/handleSchedules.d.ts +2 -0
- package/dist/cli/commands/jobs/handleSchedules.d.ts.map +1 -0
- package/dist/cli/commands/jobs/handleSchedules.js +17 -0
- package/dist/cli/commands/jobs/handleSchedules.js.map +1 -0
- package/dist/cli/commands/jobs/run.d.ts +2 -0
- package/dist/cli/commands/jobs/run.d.ts.map +1 -0
- package/dist/cli/commands/jobs/run.js +30 -0
- package/dist/cli/commands/jobs/run.js.map +1 -0
- package/dist/cli/commands/migrate/create.d.ts +2 -0
- package/dist/cli/commands/migrate/create.d.ts.map +1 -0
- package/dist/cli/commands/migrate/create.js +44 -0
- package/dist/cli/commands/migrate/create.js.map +1 -0
- package/dist/cli/commands/migrate/down.d.ts +2 -0
- package/dist/cli/commands/migrate/down.d.ts.map +1 -0
- package/dist/cli/commands/migrate/down.js +22 -0
- package/dist/cli/commands/migrate/down.js.map +1 -0
- package/dist/cli/commands/migrate/fresh.d.ts +2 -0
- package/dist/cli/commands/migrate/fresh.d.ts.map +1 -0
- package/dist/cli/commands/migrate/fresh.js +28 -0
- package/dist/cli/commands/migrate/fresh.js.map +1 -0
- package/dist/cli/commands/migrate/initialize.d.ts +11 -0
- package/dist/cli/commands/migrate/initialize.d.ts.map +1 -0
- package/dist/cli/commands/migrate/initialize.js +17 -0
- package/dist/cli/commands/migrate/initialize.js.map +1 -0
- package/dist/cli/commands/migrate/refresh.d.ts +2 -0
- package/dist/cli/commands/migrate/refresh.d.ts.map +1 -0
- package/dist/cli/commands/migrate/refresh.js +22 -0
- package/dist/cli/commands/migrate/refresh.js.map +1 -0
- package/dist/cli/commands/migrate/reset.d.ts +2 -0
- package/dist/cli/commands/migrate/reset.d.ts.map +1 -0
- package/dist/cli/commands/migrate/reset.js +22 -0
- package/dist/cli/commands/migrate/reset.js.map +1 -0
- package/dist/cli/commands/migrate/run.d.ts +2 -0
- package/dist/cli/commands/migrate/run.d.ts.map +1 -0
- package/dist/cli/commands/migrate/run.js +28 -0
- package/dist/cli/commands/migrate/run.js.map +1 -0
- package/dist/cli/commands/migrate/status.d.ts +2 -0
- package/dist/cli/commands/migrate/status.d.ts.map +1 -0
- package/dist/cli/commands/migrate/status.js +22 -0
- package/dist/cli/commands/migrate/status.js.map +1 -0
- package/dist/cli/commands/run.d.ts +2 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +45 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/defineCLICommand.d.ts +32 -0
- package/dist/cli/defineCLICommand.d.ts.map +1 -0
- package/dist/cli/defineCLICommand.js +26 -0
- package/dist/cli/defineCLICommand.js.map +1 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +95 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/program/createHelp.d.ts +8 -0
- package/dist/cli/program/createHelp.d.ts.map +1 -0
- package/dist/cli/program/createHelp.js +26 -0
- package/dist/cli/program/createHelp.js.map +1 -0
- package/dist/cli/program/loadCommands.d.ts +12 -0
- package/dist/cli/program/loadCommands.d.ts.map +1 -0
- package/dist/cli/program/loadCommands.js +62 -0
- package/dist/cli/program/loadCommands.js.map +1 -0
- package/dist/cli/program/normalizeHelpArguments.d.ts +12 -0
- package/dist/cli/program/normalizeHelpArguments.d.ts.map +1 -0
- package/dist/cli/program/normalizeHelpArguments.js +34 -0
- package/dist/cli/program/normalizeHelpArguments.js.map +1 -0
- package/dist/cli/program/registerCommand.d.ts +10 -0
- package/dist/cli/program/registerCommand.d.ts.map +1 -0
- package/dist/cli/program/registerCommand.js +185 -0
- package/dist/cli/program/registerCommand.js.map +1 -0
- package/dist/cli/runtime/createRuntime.d.ts +9 -0
- package/dist/cli/runtime/createRuntime.d.ts.map +1 -0
- package/dist/cli/runtime/createRuntime.js +81 -0
- package/dist/cli/runtime/createRuntime.js.map +1 -0
- package/dist/cli/runtime/getCommandInput.d.ts +17 -0
- package/dist/cli/runtime/getCommandInput.d.ts.map +1 -0
- package/dist/cli/runtime/getCommandInput.js +86 -0
- package/dist/cli/runtime/getCommandInput.js.map +1 -0
- package/dist/cli/runtime/invokeCommand.d.ts +23 -0
- package/dist/cli/runtime/invokeCommand.d.ts.map +1 -0
- package/dist/cli/runtime/invokeCommand.js +107 -0
- package/dist/cli/runtime/invokeCommand.js.map +1 -0
- package/dist/cli/runtime/loadEnv.d.ts.map +1 -0
- package/dist/{bin → cli/runtime}/loadEnv.js +1 -1
- package/dist/cli/runtime/loadEnv.js.map +1 -0
- package/dist/cli/runtime/output.d.ts +50 -0
- package/dist/cli/runtime/output.d.ts.map +1 -0
- package/dist/cli/runtime/output.js +125 -0
- package/dist/cli/runtime/output.js.map +1 -0
- package/dist/cli/runtime/redirectOutputToStderr.d.ts +8 -0
- package/dist/cli/runtime/redirectOutputToStderr.d.ts.map +1 -0
- package/dist/cli/runtime/redirectOutputToStderr.js +31 -0
- package/dist/cli/runtime/redirectOutputToStderr.js.map +1 -0
- package/dist/collections/config/client.d.ts +12 -5
- package/dist/collections/config/client.d.ts.map +1 -1
- package/dist/collections/config/client.js +10 -1
- package/dist/collections/config/client.js.map +1 -1
- package/dist/collections/config/defaults.d.ts +6 -8
- package/dist/collections/config/defaults.d.ts.map +1 -1
- package/dist/collections/config/defaults.js +49 -48
- package/dist/collections/config/defaults.js.map +1 -1
- package/dist/collections/config/sanitize.d.ts +4 -8
- package/dist/collections/config/sanitize.d.ts.map +1 -1
- package/dist/collections/config/sanitize.js +89 -27
- package/dist/collections/config/sanitize.js.map +1 -1
- package/dist/collections/config/sanitizeCompoundIndexes.d.ts.map +1 -1
- package/dist/collections/config/types.d.ts +76 -51
- package/dist/collections/config/types.d.ts.map +1 -1
- package/dist/collections/config/types.js.map +1 -1
- package/dist/collections/config/useAsTitle.d.ts.map +1 -1
- package/dist/collections/dataloader.d.ts +1 -1
- package/dist/collections/dataloader.d.ts.map +1 -1
- package/dist/collections/endpoints/index.d.ts +1 -0
- package/dist/collections/endpoints/index.d.ts.map +1 -1
- package/dist/collections/endpoints/index.js +6 -5
- package/dist/collections/endpoints/index.js.map +1 -1
- package/dist/collections/operations/count.d.ts.map +1 -1
- package/dist/collections/operations/count.js +65 -70
- package/dist/collections/operations/count.js.map +1 -1
- package/dist/collections/operations/countVersions.d.ts.map +1 -1
- package/dist/collections/operations/countVersions.js +61 -66
- package/dist/collections/operations/countVersions.js.map +1 -1
- package/dist/collections/operations/create.d.ts.map +1 -1
- package/dist/collections/operations/create.js +144 -13
- package/dist/collections/operations/create.js.map +1 -1
- package/dist/collections/operations/delete.d.ts.map +1 -1
- package/dist/collections/operations/delete.js +215 -129
- package/dist/collections/operations/delete.js.map +1 -1
- package/dist/collections/operations/deleteByID.d.ts.map +1 -1
- package/dist/collections/operations/deleteByID.js +14 -13
- package/dist/collections/operations/deleteByID.js.map +1 -1
- package/dist/collections/operations/docAccess.d.ts.map +1 -1
- package/dist/collections/operations/docAccess.js +19 -25
- package/dist/collections/operations/docAccess.js.map +1 -1
- package/dist/collections/operations/duplicate.d.ts.map +1 -1
- package/dist/collections/operations/find.d.ts.map +1 -1
- package/dist/collections/operations/find.js +248 -246
- package/dist/collections/operations/find.js.map +1 -1
- package/dist/collections/operations/findByID.d.ts.map +1 -1
- package/dist/collections/operations/findByID.js +258 -215
- package/dist/collections/operations/findByID.js.map +1 -1
- package/dist/collections/operations/findDistinct.d.ts.map +1 -1
- package/dist/collections/operations/findDistinct.js +235 -153
- package/dist/collections/operations/findDistinct.js.map +1 -1
- package/dist/collections/operations/findVersionByID.d.ts.map +1 -1
- package/dist/collections/operations/findVersionByID.js +145 -128
- package/dist/collections/operations/findVersionByID.js.map +1 -1
- package/dist/collections/operations/findVersions.d.ts.map +1 -1
- package/dist/collections/operations/findVersions.js +152 -149
- package/dist/collections/operations/findVersions.js.map +1 -1
- package/dist/collections/operations/inputSchemas.d.ts +877 -0
- package/dist/collections/operations/inputSchemas.d.ts.map +1 -0
- package/dist/collections/operations/inputSchemas.js +217 -0
- package/dist/collections/operations/inputSchemas.js.map +1 -0
- package/dist/collections/operations/local/count.d.ts +5 -10
- package/dist/collections/operations/local/count.d.ts.map +1 -1
- package/dist/collections/operations/local/count.js +6 -3
- package/dist/collections/operations/local/count.js.map +1 -1
- package/dist/collections/operations/local/countVersions.d.ts +5 -10
- package/dist/collections/operations/local/countVersions.d.ts.map +1 -1
- package/dist/collections/operations/local/countVersions.js +6 -3
- package/dist/collections/operations/local/countVersions.js.map +1 -1
- package/dist/collections/operations/local/create.d.ts +5 -10
- package/dist/collections/operations/local/create.d.ts.map +1 -1
- package/dist/collections/operations/local/create.js +6 -3
- package/dist/collections/operations/local/create.js.map +1 -1
- package/dist/collections/operations/local/delete.d.ts +5 -10
- package/dist/collections/operations/local/delete.d.ts.map +1 -1
- package/dist/collections/operations/local/delete.js +6 -3
- package/dist/collections/operations/local/delete.js.map +1 -1
- package/dist/collections/operations/local/duplicate.d.ts +5 -10
- package/dist/collections/operations/local/duplicate.d.ts.map +1 -1
- package/dist/collections/operations/local/duplicate.js +6 -3
- package/dist/collections/operations/local/duplicate.js.map +1 -1
- package/dist/collections/operations/local/find.d.ts +5 -10
- package/dist/collections/operations/local/find.d.ts.map +1 -1
- package/dist/collections/operations/local/find.js +6 -3
- package/dist/collections/operations/local/find.js.map +1 -1
- package/dist/collections/operations/local/findByID.d.ts +5 -10
- package/dist/collections/operations/local/findByID.d.ts.map +1 -1
- package/dist/collections/operations/local/findByID.js +6 -3
- package/dist/collections/operations/local/findByID.js.map +1 -1
- package/dist/collections/operations/local/findDistinct.d.ts +4 -9
- package/dist/collections/operations/local/findDistinct.d.ts.map +1 -1
- package/dist/collections/operations/local/findDistinct.js +6 -3
- package/dist/collections/operations/local/findDistinct.js.map +1 -1
- package/dist/collections/operations/local/findVersionByID.d.ts +5 -10
- package/dist/collections/operations/local/findVersionByID.d.ts.map +1 -1
- package/dist/collections/operations/local/findVersionByID.js +6 -3
- package/dist/collections/operations/local/findVersionByID.js.map +1 -1
- package/dist/collections/operations/local/findVersions.d.ts +5 -10
- package/dist/collections/operations/local/findVersions.d.ts.map +1 -1
- package/dist/collections/operations/local/findVersions.js +6 -3
- package/dist/collections/operations/local/findVersions.js.map +1 -1
- package/dist/collections/operations/local/restoreVersion.d.ts +5 -10
- package/dist/collections/operations/local/restoreVersion.d.ts.map +1 -1
- package/dist/collections/operations/local/restoreVersion.js +6 -3
- package/dist/collections/operations/local/restoreVersion.js.map +1 -1
- package/dist/collections/operations/local/update.d.ts +5 -10
- package/dist/collections/operations/local/update.d.ts.map +1 -1
- package/dist/collections/operations/local/update.js +6 -3
- package/dist/collections/operations/local/update.js.map +1 -1
- package/dist/collections/operations/restoreVersion.d.ts.map +1 -1
- package/dist/collections/operations/restoreVersion.js +48 -13
- package/dist/collections/operations/restoreVersion.js.map +1 -1
- package/dist/collections/operations/update.d.ts.map +1 -1
- package/dist/collections/operations/update.js +148 -24
- package/dist/collections/operations/update.js.map +1 -1
- package/dist/collections/operations/updateByID.d.ts.map +1 -1
- package/dist/collections/operations/updateByID.js +80 -2
- package/dist/collections/operations/updateByID.js.map +1 -1
- package/dist/collections/operations/utilities/buildAfterOperation.d.ts +1 -1
- package/dist/collections/operations/utilities/buildAfterOperation.d.ts.map +1 -1
- package/dist/collections/operations/utilities/copyDataWithFreshRowIDs.d.ts.map +1 -1
- package/dist/collections/operations/utilities/prefetchVersionForInheritedReadAccess.d.ts +15 -0
- package/dist/collections/operations/utilities/prefetchVersionForInheritedReadAccess.d.ts.map +1 -0
- package/dist/collections/operations/utilities/prefetchVersionForInheritedReadAccess.js +54 -0
- package/dist/collections/operations/utilities/prefetchVersionForInheritedReadAccess.js.map +1 -0
- package/dist/collections/operations/utilities/sanitizeSortQuery.d.ts.map +1 -1
- package/dist/collections/operations/utilities/types.d.ts +20 -29
- package/dist/collections/operations/utilities/types.d.ts.map +1 -1
- package/dist/collections/operations/utilities/types.js.map +1 -1
- package/dist/collections/operations/utilities/update.d.ts +2 -2
- package/dist/collections/operations/utilities/update.d.ts.map +1 -1
- package/dist/collections/operations/utilities/update.js +83 -19
- package/dist/collections/operations/utilities/update.js.map +1 -1
- package/dist/config/build.js +1 -1
- package/dist/config/build.js.map +1 -1
- package/dist/config/client.d.ts +4 -4
- package/dist/config/client.d.ts.map +1 -1
- package/dist/config/client.js +2 -4
- package/dist/config/client.js.map +1 -1
- package/dist/config/defaults.d.ts +0 -4
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +94 -119
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/definePlugin.d.ts +10 -10
- package/dist/config/definePlugin.d.ts.map +1 -1
- package/dist/config/definePlugin.js +7 -11
- package/dist/config/definePlugin.js.map +1 -1
- package/dist/config/orderable/fractional-indexing.d.ts +23 -23
- package/dist/config/orderable/fractional-indexing.d.ts.map +1 -1
- package/dist/config/orderable/index.d.ts +1 -1
- package/dist/config/orderable/index.d.ts.map +1 -1
- package/dist/config/orderable/index.js +73 -16
- package/dist/config/orderable/index.js.map +1 -1
- package/dist/config/orderable/utils/getJoinScopeContext.d.ts.map +1 -1
- package/dist/config/orderable/utils/getJoinScopeContext.js +1 -0
- package/dist/config/orderable/utils/getJoinScopeContext.js.map +1 -1
- package/dist/config/orderable/utils/resolvePendingTargetKey.d.ts.map +1 -1
- package/dist/config/orderable/utils/resolvePendingTargetKey.js +1 -0
- package/dist/config/orderable/utils/resolvePendingTargetKey.js.map +1 -1
- package/dist/config/sanitize.d.ts +1 -1
- package/dist/config/sanitize.d.ts.map +1 -1
- package/dist/config/sanitize.js +175 -40
- package/dist/config/sanitize.js.map +1 -1
- package/dist/config/types.d.ts +516 -408
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js.map +1 -1
- package/dist/database/combineQueries.d.ts.map +1 -1
- package/dist/database/createDatabaseAdapter.d.ts +1 -1
- package/dist/database/createDatabaseAdapter.d.ts.map +1 -1
- package/dist/database/createDatabaseAdapter.js +0 -2
- package/dist/database/createDatabaseAdapter.js.map +1 -1
- package/dist/database/createSchemaBuildContext.d.ts +12 -0
- package/dist/database/createSchemaBuildContext.d.ts.map +1 -0
- package/dist/database/createSchemaBuildContext.js +24 -0
- package/dist/database/createSchemaBuildContext.js.map +1 -0
- package/dist/database/getLocalizedPaths.d.ts +2 -1
- package/dist/database/getLocalizedPaths.d.ts.map +1 -1
- package/dist/database/getLocalizedPaths.js +12 -3
- package/dist/database/getLocalizedPaths.js.map +1 -1
- package/dist/database/isNestedRelationshipQuery.d.ts +14 -0
- package/dist/database/isNestedRelationshipQuery.d.ts.map +1 -0
- package/dist/database/isNestedRelationshipQuery.js +19 -0
- package/dist/database/isNestedRelationshipQuery.js.map +1 -0
- package/dist/database/migrations/createMigration.d.ts.map +1 -1
- package/dist/database/migrations/createMigration.js +4 -0
- package/dist/database/migrations/createMigration.js.map +1 -1
- package/dist/database/migrations/findMigrationDir.d.ts.map +1 -1
- package/dist/database/migrations/getMigrations.d.ts.map +1 -1
- package/dist/database/migrations/getMigrations.js +1 -0
- package/dist/database/migrations/getMigrations.js.map +1 -1
- package/dist/database/migrations/getPredefinedMigration.d.ts.map +1 -1
- package/dist/database/migrations/getPredefinedMigration.js +2 -2
- package/dist/database/migrations/getPredefinedMigration.js.map +1 -1
- package/dist/database/migrations/migrate.d.ts.map +1 -1
- package/dist/database/migrations/migrate.js +14 -2
- package/dist/database/migrations/migrate.js.map +1 -1
- package/dist/database/migrations/migrateDown.d.ts +2 -2
- package/dist/database/migrations/migrateDown.d.ts.map +1 -1
- package/dist/database/migrations/migrateDown.js +17 -4
- package/dist/database/migrations/migrateDown.js.map +1 -1
- package/dist/database/migrations/migrateRefresh.d.ts +2 -2
- package/dist/database/migrations/migrateRefresh.d.ts.map +1 -1
- package/dist/database/migrations/migrateRefresh.js +16 -4
- package/dist/database/migrations/migrateRefresh.js.map +1 -1
- package/dist/database/migrations/migrateReset.d.ts +2 -2
- package/dist/database/migrations/migrateReset.d.ts.map +1 -1
- package/dist/database/migrations/migrateReset.js +17 -3
- package/dist/database/migrations/migrateReset.js.map +1 -1
- package/dist/database/migrations/migrateStatus.d.ts +2 -2
- package/dist/database/migrations/migrateStatus.d.ts.map +1 -1
- package/dist/database/migrations/migrateStatus.js +11 -6
- package/dist/database/migrations/migrateStatus.js.map +1 -1
- package/dist/database/migrations/migrationsCollection.d.ts.map +1 -1
- package/dist/database/migrations/migrationsCollection.js +1 -0
- package/dist/database/migrations/migrationsCollection.js.map +1 -1
- package/dist/database/migrations/readMigrationFiles.d.ts.map +1 -1
- package/dist/database/migrations/writeMigrationIndex.d.ts.map +1 -1
- package/dist/database/prefixWherePaths.d.ts +6 -0
- package/dist/database/prefixWherePaths.d.ts.map +1 -0
- package/dist/database/prefixWherePaths.js +19 -0
- package/dist/database/prefixWherePaths.js.map +1 -0
- package/dist/database/queryValidation/validateQueryPaths.d.ts +2 -1
- package/dist/database/queryValidation/validateQueryPaths.d.ts.map +1 -1
- package/dist/database/queryValidation/validateQueryPaths.js +12 -2
- package/dist/database/queryValidation/validateQueryPaths.js.map +1 -1
- package/dist/database/queryValidation/validateSearchParams.d.ts +2 -1
- package/dist/database/queryValidation/validateSearchParams.d.ts.map +1 -1
- package/dist/database/queryValidation/validateSearchParams.js +88 -7
- package/dist/database/queryValidation/validateSearchParams.js.map +1 -1
- package/dist/database/queryValidation/validateSortQuery.d.ts +23 -0
- package/dist/database/queryValidation/validateSortQuery.d.ts.map +1 -0
- package/dist/database/queryValidation/validateSortQuery.js +54 -0
- package/dist/database/queryValidation/validateSortQuery.js.map +1 -0
- package/dist/database/sanitizeJoinQuery.d.ts.map +1 -1
- package/dist/database/sanitizeJoinQuery.js +7 -0
- package/dist/database/sanitizeJoinQuery.js.map +1 -1
- package/dist/database/sanitizeWhereQuery.d.ts +1 -1
- package/dist/database/sanitizeWhereQuery.d.ts.map +1 -1
- package/dist/database/sanitizeWhereQuery.js +44 -1
- package/dist/database/sanitizeWhereQuery.js.map +1 -1
- package/dist/database/types.d.ts +42 -13
- package/dist/database/types.d.ts.map +1 -1
- package/dist/database/types.js.map +1 -1
- package/dist/duplicateDocument/index.d.ts.map +1 -1
- package/dist/duplicateDocument/index.js +1 -0
- package/dist/duplicateDocument/index.js.map +1 -1
- package/dist/email/getStringifiedToAddress.d.ts.map +1 -1
- package/dist/errors/APIError.d.ts.map +1 -1
- package/dist/errors/AuthenticationError.d.ts.map +1 -1
- package/dist/errors/DuplicateCollection.d.ts.map +1 -1
- package/dist/errors/DuplicateFieldName.d.ts.map +1 -1
- package/dist/errors/DuplicateGlobal.d.ts.map +1 -1
- package/dist/errors/ErrorDeletingFile.d.ts.map +1 -1
- package/dist/errors/FileRetrievalError.d.ts.map +1 -1
- package/dist/errors/FileUploadError.d.ts.map +1 -1
- package/dist/errors/Forbidden.d.ts.map +1 -1
- package/dist/errors/InvalidConfiguration.d.ts.map +1 -1
- package/dist/errors/InvalidFieldJoin.d.ts.map +1 -1
- package/dist/errors/InvalidFieldName.d.ts.map +1 -1
- package/dist/errors/InvalidFieldRelationship.d.ts.map +1 -1
- package/dist/errors/InvalidSchema.d.ts.map +1 -1
- package/dist/errors/Locked.d.ts.map +1 -1
- package/dist/errors/LockedAuth.d.ts.map +1 -1
- package/dist/errors/MissingCollectionLabel.d.ts.map +1 -1
- package/dist/errors/MissingEditorProp.d.ts.map +1 -1
- package/dist/errors/MissingFieldInputOptions.d.ts.map +1 -1
- package/dist/errors/MissingFieldType.d.ts.map +1 -1
- package/dist/errors/MissingFile.d.ts.map +1 -1
- package/dist/errors/NotFound.d.ts.map +1 -1
- package/dist/errors/QueryError.d.ts.map +1 -1
- package/dist/errors/ReservedFieldName.d.ts.map +1 -1
- package/dist/errors/TimestampsRequired.d.ts.map +1 -1
- package/dist/errors/UnauthorizedError.d.ts.map +1 -1
- package/dist/errors/UnverifiedEmail.d.ts.map +1 -1
- package/dist/errors/ValidationError.d.ts.map +1 -1
- package/dist/exports/auth.d.ts +5 -0
- package/dist/exports/auth.d.ts.map +1 -0
- package/dist/exports/auth.js +6 -0
- package/dist/exports/auth.js.map +1 -0
- package/dist/exports/cli.d.ts +4 -0
- package/dist/exports/cli.d.ts.map +1 -0
- package/dist/exports/cli.js +4 -0
- package/dist/exports/cli.js.map +1 -0
- package/dist/exports/cliBuiltin.d.ts +37 -0
- package/dist/exports/cliBuiltin.d.ts.map +1 -0
- package/dist/exports/cliBuiltin.js +38 -0
- package/dist/exports/cliBuiltin.js.map +1 -0
- package/dist/exports/internal.d.ts +18 -1
- package/dist/exports/internal.d.ts.map +1 -1
- package/dist/exports/internal.js +16 -1
- package/dist/exports/internal.js.map +1 -1
- package/dist/exports/node.d.ts +2 -2
- package/dist/exports/node.d.ts.map +1 -1
- package/dist/exports/node.js +2 -2
- package/dist/exports/node.js.map +1 -1
- package/dist/exports/shared.d.ts +12 -6
- package/dist/exports/shared.d.ts.map +1 -1
- package/dist/exports/shared.js +10 -5
- package/dist/exports/shared.js.map +1 -1
- package/dist/fields/baseFields/authorship/index.d.ts +30 -0
- package/dist/fields/baseFields/authorship/index.d.ts.map +1 -0
- package/dist/fields/baseFields/authorship/index.js +151 -0
- package/dist/fields/baseFields/authorship/index.js.map +1 -0
- package/dist/fields/baseFields/authorship/types.d.ts +28 -0
- package/dist/fields/baseFields/authorship/types.d.ts.map +1 -0
- package/dist/fields/baseFields/authorship/types.js +10 -0
- package/dist/fields/baseFields/authorship/types.js.map +1 -0
- package/dist/fields/baseFields/slug/duplicateContext.d.ts +11 -0
- package/dist/fields/baseFields/slug/duplicateContext.d.ts.map +1 -0
- package/dist/fields/baseFields/slug/duplicateContext.js +21 -0
- package/dist/fields/baseFields/slug/duplicateContext.js.map +1 -0
- package/dist/fields/baseFields/slug/fillEmptyLocalizedSlugs.d.ts +23 -0
- package/dist/fields/baseFields/slug/fillEmptyLocalizedSlugs.d.ts.map +1 -0
- package/dist/fields/baseFields/slug/fillEmptyLocalizedSlugs.js +65 -0
- package/dist/fields/baseFields/slug/fillEmptyLocalizedSlugs.js.map +1 -0
- package/dist/fields/baseFields/slug/generateSlug.d.ts +19 -7
- package/dist/fields/baseFields/slug/generateSlug.d.ts.map +1 -1
- package/dist/fields/baseFields/slug/generateSlug.js +111 -74
- package/dist/fields/baseFields/slug/generateSlug.js.map +1 -1
- package/dist/fields/baseFields/slug/generateSlugBeforeDuplicate.d.ts +18 -0
- package/dist/fields/baseFields/slug/generateSlugBeforeDuplicate.d.ts.map +1 -0
- package/dist/fields/baseFields/slug/generateSlugBeforeDuplicate.js +20 -0
- package/dist/fields/baseFields/slug/generateSlugBeforeDuplicate.js.map +1 -0
- package/dist/fields/baseFields/slug/getSlugFallbackValue.d.ts +23 -0
- package/dist/fields/baseFields/slug/getSlugFallbackValue.d.ts.map +1 -0
- package/dist/fields/baseFields/slug/getSlugFallbackValue.js +24 -0
- package/dist/fields/baseFields/slug/getSlugFallbackValue.js.map +1 -0
- package/dist/fields/baseFields/slug/hasValue.d.ts +3 -0
- package/dist/fields/baseFields/slug/hasValue.d.ts.map +1 -0
- package/dist/fields/baseFields/slug/hasValue.js +3 -0
- package/dist/fields/baseFields/slug/hasValue.js.map +1 -0
- package/dist/fields/baseFields/slug/types.d.ts +14 -0
- package/dist/fields/baseFields/slug/types.d.ts.map +1 -0
- package/dist/fields/baseFields/slug/types.js +6 -0
- package/dist/fields/baseFields/slug/types.js.map +1 -0
- package/dist/fields/config/client.d.ts +5 -5
- package/dist/fields/config/client.d.ts.map +1 -1
- package/dist/fields/config/client.js +3 -2
- package/dist/fields/config/client.js.map +1 -1
- package/dist/fields/config/reservedFieldNames.js.map +1 -1
- package/dist/fields/config/sanitize.d.ts +6 -6
- package/dist/fields/config/sanitize.d.ts.map +1 -1
- package/dist/fields/config/sanitize.js +68 -19
- package/dist/fields/config/sanitize.js.map +1 -1
- package/dist/fields/config/sanitizeJoinField.d.ts.map +1 -1
- package/dist/fields/config/types.d.ts +97 -57
- package/dist/fields/config/types.d.ts.map +1 -1
- package/dist/fields/config/types.js +1 -1
- package/dist/fields/config/types.js.map +1 -1
- package/dist/fields/getDefaultValue.d.ts.map +1 -1
- package/dist/fields/hooks/afterChange/index.d.ts.map +1 -1
- package/dist/fields/hooks/afterChange/promise.d.ts.map +1 -1
- package/dist/fields/hooks/afterChange/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/promise.js +11 -1
- package/dist/fields/hooks/afterRead/promise.js.map +1 -1
- package/dist/fields/hooks/afterRead/relationshipPopulationPromise.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/virtualFieldPopulationPromise.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/cloneDataFromOriginalDoc.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/getExistingRowDoc.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/index.d.ts +7 -1
- package/dist/fields/hooks/beforeChange/index.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/index.js +4 -2
- package/dist/fields/hooks/beforeChange/index.js.map +1 -1
- package/dist/fields/hooks/beforeChange/promise.d.ts +2 -1
- package/dist/fields/hooks/beforeChange/promise.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/promise.js +52 -9
- package/dist/fields/hooks/beforeChange/promise.js.map +1 -1
- package/dist/fields/hooks/beforeChange/traverseFields.d.ts +2 -1
- package/dist/fields/hooks/beforeChange/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/traverseFields.js +3 -2
- package/dist/fields/hooks/beforeChange/traverseFields.js.map +1 -1
- package/dist/fields/hooks/beforeDuplicate/index.d.ts.map +1 -1
- package/dist/fields/hooks/beforeDuplicate/promise.d.ts.map +1 -1
- package/dist/fields/hooks/beforeDuplicate/promise.js +4 -0
- package/dist/fields/hooks/beforeDuplicate/promise.js.map +1 -1
- package/dist/fields/hooks/beforeDuplicate/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/getFallbackValue.d.ts +2 -1
- package/dist/fields/hooks/beforeValidate/getFallbackValue.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/getFallbackValue.js +2 -2
- package/dist/fields/hooks/beforeValidate/getFallbackValue.js.map +1 -1
- package/dist/fields/hooks/beforeValidate/index.d.ts +6 -1
- package/dist/fields/hooks/beforeValidate/index.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/index.js +3 -1
- package/dist/fields/hooks/beforeValidate/index.js.map +1 -1
- package/dist/fields/hooks/beforeValidate/promise.d.ts +6 -1
- package/dist/fields/hooks/beforeValidate/promise.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/promise.js +37 -11
- package/dist/fields/hooks/beforeValidate/promise.js.map +1 -1
- package/dist/fields/hooks/beforeValidate/stripNullRows.d.ts +10 -0
- package/dist/fields/hooks/beforeValidate/stripNullRows.d.ts.map +1 -0
- package/dist/fields/hooks/beforeValidate/stripNullRows.js +18 -0
- package/dist/fields/hooks/beforeValidate/stripNullRows.js.map +1 -0
- package/dist/fields/hooks/beforeValidate/traverseFields.d.ts +6 -1
- package/dist/fields/hooks/beforeValidate/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/traverseFields.js +5 -1
- package/dist/fields/hooks/beforeValidate/traverseFields.js.map +1 -1
- package/dist/fields/isFieldDisabled.d.ts.map +1 -1
- package/dist/fields/mergeBaseFields.d.ts.map +1 -1
- package/dist/fields/setDefaultBeforeDuplicate.d.ts.map +1 -1
- package/dist/fields/setDefaultBeforeDuplicate.js +1 -0
- package/dist/fields/setDefaultBeforeDuplicate.js.map +1 -1
- package/dist/fields/sortableFieldTypes.d.ts.map +1 -1
- package/dist/fields/sortableFieldTypes.js +1 -0
- package/dist/fields/sortableFieldTypes.js.map +1 -1
- package/dist/fields/validations.d.ts +4 -1
- package/dist/fields/validations.d.ts.map +1 -1
- package/dist/fields/validations.js +18 -9
- package/dist/fields/validations.js.map +1 -1
- package/dist/globals/config/client.d.ts +5 -5
- package/dist/globals/config/client.d.ts.map +1 -1
- package/dist/globals/config/client.js.map +1 -1
- package/dist/globals/config/sanitize.d.ts +3 -7
- package/dist/globals/config/sanitize.d.ts.map +1 -1
- package/dist/globals/config/sanitize.js +78 -9
- package/dist/globals/config/sanitize.js.map +1 -1
- package/dist/globals/config/types.d.ts +33 -16
- package/dist/globals/config/types.d.ts.map +1 -1
- package/dist/globals/config/types.js.map +1 -1
- package/dist/globals/operations/countGlobalVersions.d.ts.map +1 -1
- package/dist/globals/operations/countGlobalVersions.js +57 -55
- package/dist/globals/operations/countGlobalVersions.js.map +1 -1
- package/dist/globals/operations/docAccess.d.ts.map +1 -1
- package/dist/globals/operations/docAccess.js +19 -25
- package/dist/globals/operations/docAccess.js.map +1 -1
- package/dist/globals/operations/findOne.d.ts.map +1 -1
- package/dist/globals/operations/findOne.js +169 -174
- package/dist/globals/operations/findOne.js.map +1 -1
- package/dist/globals/operations/findVersionByID.d.ts.map +1 -1
- package/dist/globals/operations/findVersionByID.js +112 -108
- package/dist/globals/operations/findVersionByID.js.map +1 -1
- package/dist/globals/operations/findVersions.d.ts.map +1 -1
- package/dist/globals/operations/findVersions.js +118 -109
- package/dist/globals/operations/findVersions.js.map +1 -1
- package/dist/globals/operations/inputSchemas.d.ts +365 -0
- package/dist/globals/operations/inputSchemas.d.ts.map +1 -0
- package/dist/globals/operations/inputSchemas.js +104 -0
- package/dist/globals/operations/inputSchemas.js.map +1 -0
- package/dist/globals/operations/local/countVersions.d.ts +5 -10
- package/dist/globals/operations/local/countVersions.d.ts.map +1 -1
- package/dist/globals/operations/local/countVersions.js +6 -3
- package/dist/globals/operations/local/countVersions.js.map +1 -1
- package/dist/globals/operations/local/findOne.d.ts +5 -10
- package/dist/globals/operations/local/findOne.d.ts.map +1 -1
- package/dist/globals/operations/local/findOne.js +6 -3
- package/dist/globals/operations/local/findOne.js.map +1 -1
- package/dist/globals/operations/local/findVersionByID.d.ts +5 -10
- package/dist/globals/operations/local/findVersionByID.d.ts.map +1 -1
- package/dist/globals/operations/local/findVersionByID.js +6 -3
- package/dist/globals/operations/local/findVersionByID.js.map +1 -1
- package/dist/globals/operations/local/findVersions.d.ts +5 -10
- package/dist/globals/operations/local/findVersions.d.ts.map +1 -1
- package/dist/globals/operations/local/findVersions.js +6 -3
- package/dist/globals/operations/local/findVersions.js.map +1 -1
- package/dist/globals/operations/local/restoreVersion.d.ts +5 -10
- package/dist/globals/operations/local/restoreVersion.d.ts.map +1 -1
- package/dist/globals/operations/local/restoreVersion.js +6 -3
- package/dist/globals/operations/local/restoreVersion.js.map +1 -1
- package/dist/globals/operations/local/update.d.ts +5 -10
- package/dist/globals/operations/local/update.d.ts.map +1 -1
- package/dist/globals/operations/local/update.js +6 -3
- package/dist/globals/operations/local/update.js.map +1 -1
- package/dist/globals/operations/restoreVersion.d.ts.map +1 -1
- package/dist/globals/operations/restoreVersion.js +60 -14
- package/dist/globals/operations/restoreVersion.js.map +1 -1
- package/dist/globals/operations/update.d.ts.map +1 -1
- package/dist/globals/operations/update.js +106 -19
- package/dist/globals/operations/update.js.map +1 -1
- package/dist/hierarchy/addHierarchyToCollection.d.ts.map +1 -1
- package/dist/hierarchy/addHierarchyToCollection.js +2 -0
- package/dist/hierarchy/addHierarchyToCollection.js.map +1 -1
- package/dist/hierarchy/buildParentField.d.ts.map +1 -1
- package/dist/hierarchy/constants.d.ts.map +1 -1
- package/dist/hierarchy/getInitialTreeData.d.ts.map +1 -1
- package/dist/hierarchy/hooks/collectionAfterDelete.d.ts.map +1 -1
- package/dist/hierarchy/hooks/collectionAfterDelete.js +1 -0
- package/dist/hierarchy/hooks/collectionAfterDelete.js.map +1 -1
- package/dist/hierarchy/hooks/collectionAfterRead.d.ts.map +1 -1
- package/dist/hierarchy/hooks/collectionBeforeChange.d.ts.map +1 -1
- package/dist/hierarchy/hooks/collectionBeforeChange.js +1 -0
- package/dist/hierarchy/hooks/collectionBeforeChange.js.map +1 -1
- package/dist/hierarchy/hooks/collectionBeforeDelete.d.ts.map +1 -1
- package/dist/hierarchy/hooks/collectionBeforeDelete.js +1 -0
- package/dist/hierarchy/hooks/collectionBeforeDelete.js.map +1 -1
- package/dist/hierarchy/hooks/collectionBeforeOperation.d.ts.map +1 -1
- package/dist/hierarchy/hooks/ensureSafeCollectionsChange.d.ts.map +1 -1
- package/dist/hierarchy/injectHierarchyButton.d.ts.map +1 -1
- package/dist/hierarchy/resolveHierarchyCollections.d.ts.map +1 -1
- package/dist/hierarchy/sanitizeHierarchyCollection.d.ts.map +1 -1
- package/dist/index.bundled.d.ts +5570 -3818
- package/dist/index.d.ts +170 -67
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +89 -67
- package/dist/index.js.map +1 -1
- package/dist/kv/adapters/DatabaseKVAdapter.d.ts.map +1 -1
- package/dist/kv/adapters/DatabaseKVAdapter.js +2 -1
- package/dist/kv/adapters/DatabaseKVAdapter.js.map +1 -1
- package/dist/kv/adapters/InMemoryKVAdapter.d.ts.map +1 -1
- package/dist/locked-documents/config.d.ts.map +1 -1
- package/dist/locked-documents/config.js +1 -0
- package/dist/locked-documents/config.js.map +1 -1
- package/dist/preferences/config.d.ts.map +1 -1
- package/dist/preferences/config.js +3 -1
- package/dist/preferences/config.js.map +1 -1
- package/dist/preferences/deleteUserPreferences.d.ts.map +1 -1
- package/dist/preferences/keys.d.ts +8 -4
- package/dist/preferences/keys.d.ts.map +1 -1
- package/dist/preferences/keys.js +4 -1
- package/dist/preferences/keys.js.map +1 -1
- package/dist/preferences/types.d.ts +15 -0
- package/dist/preferences/types.d.ts.map +1 -1
- package/dist/preferences/types.js +3 -1
- package/dist/preferences/types.js.map +1 -1
- package/dist/query-presets/access.d.ts.map +1 -1
- package/dist/query-presets/access.js +2 -1
- package/dist/query-presets/access.js.map +1 -1
- package/dist/query-presets/config.d.ts.map +1 -1
- package/dist/query-presets/config.js +1 -0
- package/dist/query-presets/config.js.map +1 -1
- package/dist/query-presets/constraints.d.ts.map +1 -1
- package/dist/query-presets/constraints.js +1 -1
- package/dist/query-presets/constraints.js.map +1 -1
- package/dist/query-presets/preventLockout.js +6 -3
- package/dist/query-presets/preventLockout.js.map +1 -1
- package/dist/query-presets/types.d.ts +1 -1
- package/dist/query-presets/types.d.ts.map +1 -1
- package/dist/queues/config/collection.d.ts.map +1 -1
- package/dist/queues/config/collection.js +44 -43
- package/dist/queues/config/collection.js.map +1 -1
- package/dist/queues/config/global.d.ts +5 -6
- package/dist/queues/config/global.d.ts.map +1 -1
- package/dist/queues/config/global.js +2 -1
- package/dist/queues/config/global.js.map +1 -1
- package/dist/queues/config/types/index.d.ts +33 -25
- package/dist/queues/config/types/index.d.ts.map +1 -1
- package/dist/queues/config/types/index.js.map +1 -1
- package/dist/queues/config/types/taskTypes.d.ts +4 -7
- package/dist/queues/config/types/taskTypes.d.ts.map +1 -1
- package/dist/queues/config/types/taskTypes.js.map +1 -1
- package/dist/queues/config/types/workflowJSONTypes.d.ts +10 -9
- package/dist/queues/config/types/workflowJSONTypes.d.ts.map +1 -1
- package/dist/queues/config/types/workflowJSONTypes.js.map +1 -1
- package/dist/queues/config/types/workflowTypes.d.ts +11 -58
- package/dist/queues/config/types/workflowTypes.d.ts.map +1 -1
- package/dist/queues/config/types/workflowTypes.js.map +1 -1
- package/dist/queues/endpoints/handleSchedules.d.ts.map +1 -1
- package/dist/queues/endpoints/handleSchedules.js +3 -2
- package/dist/queues/endpoints/handleSchedules.js.map +1 -1
- package/dist/queues/endpoints/run.d.ts.map +1 -1
- package/dist/queues/endpoints/run.js +2 -1
- package/dist/queues/endpoints/run.js.map +1 -1
- package/dist/queues/errors/handleTaskError.js +4 -4
- package/dist/queues/errors/handleTaskError.js.map +1 -1
- package/dist/queues/errors/handleWorkflowError.js +1 -1
- package/dist/queues/errors/handleWorkflowError.js.map +1 -1
- package/dist/queues/errors/index.d.ts +6 -0
- package/dist/queues/errors/index.d.ts.map +1 -1
- package/dist/queues/errors/index.js +5 -0
- package/dist/queues/errors/index.js.map +1 -1
- package/dist/queues/localAPI.d.ts +14 -67
- package/dist/queues/localAPI.d.ts.map +1 -1
- package/dist/queues/localAPI.js +87 -78
- package/dist/queues/localAPI.js.map +1 -1
- package/dist/queues/operations/handleSchedules/countRunnableOrActiveJobsForQueue.d.ts +4 -4
- package/dist/queues/operations/handleSchedules/countRunnableOrActiveJobsForQueue.d.ts.map +1 -1
- package/dist/queues/operations/handleSchedules/countRunnableOrActiveJobsForQueue.js.map +1 -1
- package/dist/queues/operations/handleSchedules/getQueuesWithSchedules.d.ts.map +1 -1
- package/dist/queues/operations/handleSchedules/index.d.ts +1 -1
- package/dist/queues/operations/handleSchedules/index.d.ts.map +1 -1
- package/dist/queues/operations/handleSchedules/index.js +2 -1
- package/dist/queues/operations/handleSchedules/index.js.map +1 -1
- package/dist/queues/operations/runJobs/heartbeat.d.ts +13 -0
- package/dist/queues/operations/runJobs/heartbeat.d.ts.map +1 -0
- package/dist/queues/operations/runJobs/heartbeat.js +66 -0
- package/dist/queues/operations/runJobs/heartbeat.js.map +1 -0
- package/dist/queues/operations/runJobs/index.d.ts.map +1 -1
- package/dist/queues/operations/runJobs/index.js +133 -84
- package/dist/queues/operations/runJobs/index.js.map +1 -1
- package/dist/queues/operations/runJobs/runJSONJob/index.d.ts.map +1 -1
- package/dist/queues/operations/runJobs/runJSONJob/index.js +6 -3
- package/dist/queues/operations/runJobs/runJSONJob/index.js.map +1 -1
- package/dist/queues/operations/runJobs/runJob/getRunTaskFunction.d.ts.map +1 -1
- package/dist/queues/operations/runJobs/runJob/getRunTaskFunction.js +5 -5
- package/dist/queues/operations/runJobs/runJob/getRunTaskFunction.js.map +1 -1
- package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.d.ts +2 -1
- package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.d.ts.map +1 -1
- package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.js +39 -8
- package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.js.map +1 -1
- package/dist/queues/operations/runJobs/runJob/importHandlerPath.d.ts +1 -1
- package/dist/queues/operations/runJobs/runJob/importHandlerPath.d.ts.map +1 -1
- package/dist/queues/operations/runJobs/runJob/importHandlerPath.js.map +1 -1
- package/dist/queues/operations/runJobs/runJob/index.d.ts.map +1 -1
- package/dist/queues/operations/runJobs/runJob/index.js +4 -4
- package/dist/queues/operations/runJobs/runJob/index.js.map +1 -1
- package/dist/queues/utilities/getCurrentDate.d.ts.map +1 -1
- package/dist/queues/utilities/getJobTaskStatus.d.ts.map +1 -1
- package/dist/queues/utilities/updateJob.d.ts.map +1 -1
- package/dist/queues/utilities/updateJob.js +3 -0
- package/dist/queues/utilities/updateJob.js.map +1 -1
- package/dist/translations/getLocalI18n.d.ts.map +1 -1
- package/dist/types/constants.d.ts +23 -2
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/constants.js +23 -0
- package/dist/types/constants.js.map +1 -1
- package/dist/types/index.d.ts +13 -10
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/operations.d.ts +9 -0
- package/dist/types/operations.d.ts.map +1 -0
- package/dist/types/operations.js +3 -0
- package/dist/types/operations.js.map +1 -0
- package/dist/uploads/assertClientUploadAccess.d.ts +7 -0
- package/dist/uploads/assertClientUploadAccess.d.ts.map +1 -0
- package/dist/uploads/assertClientUploadAccess.js +29 -0
- package/dist/uploads/assertClientUploadAccess.js.map +1 -0
- package/dist/uploads/assertClientUploadAllowed.d.ts +10 -0
- package/dist/uploads/assertClientUploadAllowed.d.ts.map +1 -0
- package/dist/uploads/assertClientUploadAllowed.js +41 -0
- package/dist/uploads/assertClientUploadAllowed.js.map +1 -0
- package/dist/uploads/checkFileAccess.d.ts.map +1 -1
- package/dist/uploads/checkFileAccess.js +1 -0
- package/dist/uploads/checkFileAccess.js.map +1 -1
- package/dist/uploads/checkFileRestrictions.d.ts +11 -1
- package/dist/uploads/checkFileRestrictions.d.ts.map +1 -1
- package/dist/uploads/checkFileRestrictions.js +91 -26
- package/dist/uploads/checkFileRestrictions.js.map +1 -1
- package/dist/uploads/clientUploadReceipt.d.ts +29 -0
- package/dist/uploads/clientUploadReceipt.d.ts.map +1 -0
- package/dist/uploads/clientUploadReceipt.js +76 -0
- package/dist/uploads/clientUploadReceipt.js.map +1 -0
- package/dist/uploads/cropImage.d.ts +1 -1
- package/dist/uploads/cropImage.d.ts.map +1 -1
- package/dist/uploads/cropImage.js +2 -5
- package/dist/uploads/cropImage.js.map +1 -1
- package/dist/uploads/deleteAssociatedFiles.d.ts.map +1 -1
- package/dist/uploads/deleteAssociatedFiles.js +57 -9
- package/dist/uploads/deleteAssociatedFiles.js.map +1 -1
- package/dist/uploads/detectSvgFromXml.d.ts +1 -4
- package/dist/uploads/detectSvgFromXml.d.ts.map +1 -1
- package/dist/uploads/detectSvgFromXml.js +2 -41
- package/dist/uploads/detectSvgFromXml.js.map +1 -1
- package/dist/uploads/docWithFilenameExists.d.ts +2 -1
- package/dist/uploads/docWithFilenameExists.d.ts.map +1 -1
- package/dist/uploads/docWithFilenameExists.js +27 -10
- package/dist/uploads/docWithFilenameExists.js.map +1 -1
- package/dist/uploads/downloadFileToBuffer.d.ts +11 -0
- package/dist/uploads/downloadFileToBuffer.d.ts.map +1 -0
- package/dist/uploads/downloadFileToBuffer.js +72 -0
- package/dist/uploads/downloadFileToBuffer.js.map +1 -0
- package/dist/uploads/endpoints/getFile.d.ts.map +1 -1
- package/dist/uploads/endpoints/getFile.js +5 -3
- package/dist/uploads/endpoints/getFile.js.map +1 -1
- package/dist/uploads/endpoints/index.js +2 -2
- package/dist/uploads/endpoints/index.js.map +1 -1
- package/dist/uploads/endpoints/pasteURL.d.ts +3 -0
- package/dist/uploads/endpoints/pasteURL.d.ts.map +1 -0
- package/dist/uploads/endpoints/{getFileFromURL.js → pasteURL.js} +19 -55
- package/dist/uploads/endpoints/pasteURL.js.map +1 -0
- package/dist/uploads/endpoints/uploadInstructions.d.ts +15 -0
- package/dist/uploads/endpoints/uploadInstructions.d.ts.map +1 -0
- package/dist/uploads/endpoints/uploadInstructions.js +87 -0
- package/dist/uploads/endpoints/uploadInstructions.js.map +1 -0
- package/dist/uploads/fetchAPI-multipart/handlers.d.ts +2 -2
- package/dist/uploads/fetchAPI-multipart/handlers.d.ts.map +1 -1
- package/dist/uploads/fetchAPI-multipart/handlers.js +18 -5
- package/dist/uploads/fetchAPI-multipart/handlers.js.map +1 -1
- package/dist/uploads/fetchAPI-multipart/index.d.ts.map +1 -1
- package/dist/uploads/fetchAPI-multipart/index.js +24 -2
- package/dist/uploads/fetchAPI-multipart/index.js.map +1 -1
- package/dist/uploads/fetchAPI-multipart/isEligibleRequest.d.ts.map +1 -1
- package/dist/uploads/fetchAPI-multipart/isEligibleRequest.js +1 -2
- package/dist/uploads/fetchAPI-multipart/isEligibleRequest.js.map +1 -1
- package/dist/uploads/fetchAPI-multipart/processMultipart.d.ts +0 -6
- package/dist/uploads/fetchAPI-multipart/processMultipart.d.ts.map +1 -1
- package/dist/uploads/fetchAPI-multipart/processMultipart.js +146 -139
- package/dist/uploads/fetchAPI-multipart/processMultipart.js.map +1 -1
- package/dist/uploads/fetchAPI-multipart/processNested.d.ts.map +1 -1
- package/dist/uploads/fetchAPI-multipart/utilities.d.ts.map +1 -1
- package/dist/uploads/fetchWithRedirects.d.ts +19 -0
- package/dist/uploads/fetchWithRedirects.d.ts.map +1 -0
- package/dist/uploads/fetchWithRedirects.js +53 -0
- package/dist/uploads/fetchWithRedirects.js.map +1 -0
- package/dist/uploads/fileExists.d.ts.map +1 -1
- package/dist/uploads/generateFileData.d.ts +31 -1
- package/dist/uploads/generateFileData.d.ts.map +1 -1
- package/dist/uploads/generateFileData.js +117 -65
- package/dist/uploads/generateFileData.js.map +1 -1
- package/dist/uploads/getBaseFields.d.ts.map +1 -1
- package/dist/uploads/getBaseFields.js +3 -1
- package/dist/uploads/getBaseFields.js.map +1 -1
- package/dist/uploads/getFileByPath.d.ts +1 -1
- package/dist/uploads/getFileByPath.d.ts.map +1 -1
- package/dist/uploads/getFileContentRequirement.d.ts +32 -0
- package/dist/uploads/getFileContentRequirement.d.ts.map +1 -0
- package/dist/uploads/getFileContentRequirement.js +40 -0
- package/dist/uploads/getFileContentRequirement.js.map +1 -0
- package/dist/uploads/getFileFromUploadInstructions.d.ts +8 -0
- package/dist/uploads/getFileFromUploadInstructions.d.ts.map +1 -0
- package/dist/uploads/getFileFromUploadInstructions.js +279 -0
- package/dist/uploads/getFileFromUploadInstructions.js.map +1 -0
- package/dist/uploads/getFileTypeFallback.d.ts.map +1 -1
- package/dist/uploads/getFileTypeFallback.js +3 -1
- package/dist/uploads/getFileTypeFallback.js.map +1 -1
- package/dist/uploads/getFileTypeIdentity.d.ts +19 -0
- package/dist/uploads/getFileTypeIdentity.d.ts.map +1 -0
- package/dist/uploads/getFileTypeIdentity.js +34 -0
- package/dist/uploads/getFileTypeIdentity.js.map +1 -0
- package/dist/uploads/getImageSize.d.ts +12 -1
- package/dist/uploads/getImageSize.d.ts.map +1 -1
- package/dist/uploads/getImageSize.js +20 -18
- package/dist/uploads/getImageSize.js.map +1 -1
- package/dist/uploads/getSafeFilename.d.ts.map +1 -1
- package/dist/uploads/hasCropOrResizeEdit.d.ts +7 -0
- package/dist/uploads/hasCropOrResizeEdit.d.ts.map +1 -0
- package/dist/uploads/hasCropOrResizeEdit.js +6 -0
- package/dist/uploads/hasCropOrResizeEdit.js.map +1 -0
- package/dist/uploads/hasFullFileContents.d.ts +13 -0
- package/dist/uploads/hasFullFileContents.d.ts.map +1 -0
- package/dist/uploads/hasFullFileContents.js +12 -0
- package/dist/uploads/hasFullFileContents.js.map +1 -0
- package/dist/uploads/image-resizing/createImageSize.d.ts.map +1 -1
- package/dist/uploads/image-resizing/createImageSizes.d.ts.map +1 -1
- package/dist/uploads/image-resizing/createImageSizes.js +2 -5
- package/dist/uploads/image-resizing/createImageSizes.js.map +1 -1
- package/dist/uploads/image-resizing/generateImageSizeFilename.d.ts.map +1 -1
- package/dist/uploads/image-resizing/getImageResizeAction.d.ts +1 -1
- package/dist/uploads/image-resizing/getImageResizeAction.d.ts.map +1 -1
- package/dist/uploads/image-resizing/parseFilename.d.ts.map +1 -1
- package/dist/uploads/image-resizing/sanitizeResizeConfig.d.ts.map +1 -1
- package/dist/uploads/isAnimatedImage.d.ts +8 -0
- package/dist/uploads/isAnimatedImage.d.ts.map +1 -0
- package/dist/uploads/isAnimatedImage.js +22 -0
- package/dist/uploads/isAnimatedImage.js.map +1 -0
- package/dist/uploads/isProcessableImage.d.ts +2 -0
- package/dist/uploads/isProcessableImage.d.ts.map +1 -0
- package/dist/uploads/isProcessableImage.js +7 -0
- package/dist/uploads/isProcessableImage.js.map +1 -0
- package/dist/uploads/matchMimeType.d.ts +8 -0
- package/dist/uploads/matchMimeType.d.ts.map +1 -0
- package/dist/uploads/matchMimeType.js +19 -0
- package/dist/uploads/matchMimeType.js.map +1 -0
- package/dist/uploads/mimeTypeValidator.d.ts.map +1 -1
- package/dist/uploads/probeImageSize.d.ts +39 -0
- package/dist/uploads/probeImageSize.d.ts.map +1 -0
- package/dist/uploads/probeImageSize.js +374 -0
- package/dist/uploads/probeImageSize.js.map +1 -0
- package/dist/uploads/resolveURLUploadInput.d.ts +25 -0
- package/dist/uploads/resolveURLUploadInput.d.ts.map +1 -0
- package/dist/uploads/resolveURLUploadInput.js +53 -0
- package/dist/uploads/resolveURLUploadInput.js.map +1 -0
- package/dist/uploads/safeFetch.d.ts.map +1 -1
- package/dist/uploads/safeFetch.js +3 -2
- package/dist/uploads/safeFetch.js.map +1 -1
- package/dist/uploads/sanitizeUploadData.d.ts +26 -0
- package/dist/uploads/sanitizeUploadData.d.ts.map +1 -0
- package/dist/uploads/sanitizeUploadData.js +161 -0
- package/dist/uploads/sanitizeUploadData.js.map +1 -0
- package/dist/uploads/saveBufferToFile.d.ts.map +1 -1
- package/dist/uploads/stagedUpload.d.ts +27 -0
- package/dist/uploads/stagedUpload.d.ts.map +1 -0
- package/dist/uploads/stagedUpload.js +197 -0
- package/dist/uploads/stagedUpload.js.map +1 -0
- package/dist/uploads/types.d.ts +122 -10
- package/dist/uploads/types.d.ts.map +1 -1
- package/dist/uploads/types.js.map +1 -1
- package/dist/uploads/unlinkTempFiles.d.ts.map +1 -1
- package/dist/uploads/unlinkTempFiles.js +6 -2
- package/dist/uploads/unlinkTempFiles.js.map +1 -1
- package/dist/uploads/uploadContentSecurityPolicy.d.ts +2 -0
- package/dist/uploads/uploadContentSecurityPolicy.d.ts.map +1 -0
- package/dist/uploads/uploadContentSecurityPolicy.js +3 -0
- package/dist/uploads/uploadContentSecurityPolicy.js.map +1 -0
- package/dist/uploads/uploadFiles.d.ts.map +1 -1
- package/dist/uploads/uploadFiles.js +7 -2
- package/dist/uploads/uploadFiles.js.map +1 -1
- package/dist/uploads/validateISOBaseMediaFile.d.ts +4 -0
- package/dist/uploads/validateISOBaseMediaFile.d.ts.map +1 -0
- package/dist/uploads/validateISOBaseMediaFile.js +91 -0
- package/dist/uploads/validateISOBaseMediaFile.js.map +1 -0
- package/dist/uploads/validateSvg.d.ts +10 -4
- package/dist/uploads/validateSvg.d.ts.map +1 -1
- package/dist/uploads/validateSvg.js +280 -40
- package/dist/uploads/validateSvg.js.map +1 -1
- package/dist/uploads/validateUploadFilename.d.ts +3 -0
- package/dist/uploads/validateUploadFilename.d.ts.map +1 -0
- package/dist/uploads/validateUploadFilename.js +13 -0
- package/dist/uploads/validateUploadFilename.js.map +1 -0
- package/dist/uploads/validateUploadURL.d.ts +13 -0
- package/dist/uploads/validateUploadURL.d.ts.map +1 -0
- package/dist/uploads/validateUploadURL.js +37 -0
- package/dist/uploads/validateUploadURL.js.map +1 -0
- package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -1
- package/dist/utilities/addDataAndFileToRequest.js +14 -39
- package/dist/utilities/addDataAndFileToRequest.js.map +1 -1
- package/dist/utilities/addLocalesToRequest.d.ts.map +1 -1
- package/dist/utilities/addSelectGenericsToGeneretedTypes.d.ts.map +1 -1
- package/dist/utilities/appendDateTimezoneSelectFields.d.ts.map +1 -1
- package/dist/utilities/appendNonTrashedFilter.d.ts +1 -1
- package/dist/utilities/appendNonTrashedFilter.d.ts.map +1 -1
- package/dist/utilities/appendNonTrashedFilter.js.map +1 -1
- package/dist/utilities/appendUploadSelectFields.d.ts.map +1 -1
- package/dist/utilities/canAccessAdmin.d.ts.map +1 -1
- package/dist/utilities/canAccessAdmin.js +2 -0
- package/dist/utilities/canAccessAdmin.js.map +1 -1
- package/dist/utilities/checkDocumentLockStatus.d.ts +19 -0
- package/dist/utilities/checkDocumentLockStatus.d.ts.map +1 -1
- package/dist/utilities/checkDocumentLockStatus.js +74 -0
- package/dist/utilities/checkDocumentLockStatus.js.map +1 -1
- package/dist/utilities/configToJSONSchema.d.ts +13 -4
- package/dist/utilities/configToJSONSchema.d.ts.map +1 -1
- package/dist/utilities/configToJSONSchema.js +139 -61
- package/dist/utilities/configToJSONSchema.js.map +1 -1
- package/dist/utilities/createPayloadRequest.d.ts +12 -10
- package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
- package/dist/utilities/createPayloadRequest.js +98 -80
- package/dist/utilities/createPayloadRequest.js.map +1 -1
- package/dist/utilities/createPayloadRequestFromWebRequest.d.ts +14 -0
- package/dist/utilities/createPayloadRequestFromWebRequest.d.ts.map +1 -0
- package/dist/utilities/createPayloadRequestFromWebRequest.js +95 -0
- package/dist/utilities/createPayloadRequestFromWebRequest.js.map +1 -0
- package/dist/utilities/deepCopyObject.d.ts.map +1 -1
- package/dist/utilities/deepCopyObject.js +110 -19
- package/dist/utilities/deepCopyObject.js.map +1 -1
- package/dist/utilities/dependencies/resolveFrom.d.ts.map +1 -1
- package/dist/utilities/entityInputSchema/filterFieldsByAccess.d.ts +30 -0
- package/dist/utilities/entityInputSchema/filterFieldsByAccess.d.ts.map +1 -0
- package/dist/utilities/entityInputSchema/filterFieldsByAccess.js +71 -0
- package/dist/utilities/entityInputSchema/filterFieldsByAccess.js.map +1 -0
- package/dist/utilities/entityInputSchema/getEntityInputSchema.d.ts +13 -0
- package/dist/utilities/entityInputSchema/getEntityInputSchema.d.ts.map +1 -0
- package/dist/utilities/entityInputSchema/getEntityInputSchema.js +66 -0
- package/dist/utilities/entityInputSchema/getEntityInputSchema.js.map +1 -0
- package/dist/utilities/entityInputSchema/sanitizeEntitySchema.d.ts +10 -0
- package/dist/utilities/entityInputSchema/sanitizeEntitySchema.d.ts.map +1 -0
- package/dist/utilities/entityInputSchema/sanitizeEntitySchema.js +384 -0
- package/dist/utilities/entityInputSchema/sanitizeEntitySchema.js.map +1 -0
- package/dist/utilities/entityInputSchema/types.d.ts +16 -0
- package/dist/utilities/entityInputSchema/types.d.ts.map +1 -0
- package/dist/utilities/entityInputSchema/types.js +3 -0
- package/dist/utilities/entityInputSchema/types.js.map +1 -0
- package/dist/utilities/entityInputSchema/validateEntityData.d.ts +13 -0
- package/dist/utilities/entityInputSchema/validateEntityData.d.ts.map +1 -0
- package/dist/utilities/entityInputSchema/validateEntityData.js +138 -0
- package/dist/utilities/entityInputSchema/validateEntityData.js.map +1 -0
- package/dist/utilities/escapeRegExp.d.ts.map +1 -1
- package/dist/utilities/extractID.d.ts.map +1 -1
- package/dist/utilities/fieldPath.d.ts +13 -0
- package/dist/utilities/fieldPath.d.ts.map +1 -0
- package/dist/utilities/fieldPath.js +51 -0
- package/dist/utilities/fieldPath.js.map +1 -0
- package/dist/utilities/fieldValueExists.d.ts +29 -0
- package/dist/utilities/fieldValueExists.d.ts.map +1 -0
- package/dist/utilities/fieldValueExists.js +37 -0
- package/dist/utilities/fieldValueExists.js.map +1 -0
- package/dist/utilities/flattenAllFields.d.ts.map +1 -1
- package/dist/utilities/formatAdminURL.d.ts +1 -0
- package/dist/utilities/formatAdminURL.d.ts.map +1 -1
- package/dist/utilities/formatAdminURL.js +22 -4
- package/dist/utilities/formatAdminURL.js.map +1 -1
- package/dist/utilities/formatErrors.d.ts.map +1 -1
- package/dist/utilities/formatLabels.d.ts.map +1 -1
- package/dist/utilities/getBestFitFromSizes.d.ts.map +1 -1
- package/dist/utilities/getBlockSelect.d.ts.map +1 -1
- package/dist/utilities/getDataByPath.d.ts.map +1 -1
- package/dist/utilities/getEntityPermissions/entityDocExists.d.ts.map +1 -1
- package/dist/utilities/getEntityPermissions/entityDocExists.js +36 -5
- package/dist/utilities/getEntityPermissions/entityDocExists.js.map +1 -1
- package/dist/utilities/getEntityPermissions/getEntityPermissions.d.ts.map +1 -1
- package/dist/utilities/getEntityPermissions/getEntityPermissions.js +3 -0
- package/dist/utilities/getEntityPermissions/getEntityPermissions.js.map +1 -1
- package/dist/utilities/getEntityPermissions/populateFieldPermissions.d.ts +7 -1
- package/dist/utilities/getEntityPermissions/populateFieldPermissions.d.ts.map +1 -1
- package/dist/utilities/getEntityPermissions/populateFieldPermissions.js +19 -2
- package/dist/utilities/getEntityPermissions/populateFieldPermissions.js.map +1 -1
- package/dist/utilities/getFieldByPath.d.ts.map +1 -1
- package/dist/utilities/getFieldPermissions.d.ts.map +1 -1
- package/dist/utilities/getNextVersion.d.ts +7 -0
- package/dist/utilities/getNextVersion.d.ts.map +1 -0
- package/dist/utilities/getNextVersion.js +20 -0
- package/dist/utilities/getNextVersion.js.map +1 -0
- package/dist/utilities/getObjectDotNotation.d.ts.map +1 -1
- package/dist/utilities/getObjectDotNotation.js +7 -1
- package/dist/utilities/getObjectDotNotation.js.map +1 -1
- package/dist/utilities/getRequestEntity.d.ts.map +1 -1
- package/dist/utilities/getRequestLanguage.d.ts.map +1 -1
- package/dist/utilities/getRequestOrigin.d.ts +2 -2
- package/dist/utilities/getRequestOrigin.d.ts.map +1 -1
- package/dist/utilities/getRequestOrigin.js.map +1 -1
- package/dist/utilities/getSafeRedirect.d.ts.map +1 -1
- package/dist/utilities/getSafeRedirect.js +16 -9
- package/dist/utilities/getSafeRedirect.js.map +1 -1
- package/dist/utilities/getSelectMode.d.ts.map +1 -1
- package/dist/utilities/getSiblingData.d.ts.map +1 -1
- package/dist/utilities/getTopLevelFieldNames.d.ts +2 -0
- package/dist/utilities/getTopLevelFieldNames.d.ts.map +1 -0
- package/dist/utilities/getTopLevelFieldNames.js +3 -0
- package/dist/utilities/getTopLevelFieldNames.js.map +1 -0
- package/dist/utilities/getTranslatedLabel.d.ts.map +1 -1
- package/dist/utilities/getUniqueFieldValue.d.ts +28 -0
- package/dist/utilities/getUniqueFieldValue.d.ts.map +1 -0
- package/dist/utilities/getUniqueFieldValue.js +27 -0
- package/dist/utilities/getUniqueFieldValue.js.map +1 -0
- package/dist/utilities/getVersionsConfig.d.ts +1 -1
- package/dist/utilities/getVersionsConfig.d.ts.map +1 -1
- package/dist/utilities/getVirtualFieldNames.d.ts +14 -0
- package/dist/utilities/getVirtualFieldNames.d.ts.map +1 -0
- package/dist/utilities/getVirtualFieldNames.js +35 -0
- package/dist/utilities/getVirtualFieldNames.js.map +1 -0
- package/dist/utilities/handleEndpoints.d.ts.map +1 -1
- package/dist/utilities/handleEndpoints.js +8 -7
- package/dist/utilities/handleEndpoints.js.map +1 -1
- package/dist/utilities/headersWithCors.d.ts.map +1 -1
- package/dist/utilities/headersWithCors.js +1 -1
- package/dist/utilities/headersWithCors.js.map +1 -1
- package/dist/utilities/isEntityHidden.d.ts +2 -2
- package/dist/utilities/isEntityHidden.d.ts.map +1 -1
- package/dist/utilities/isURLAllowed.d.ts.map +1 -1
- package/dist/utilities/isURLAllowed.js +9 -3
- package/dist/utilities/isURLAllowed.js.map +1 -1
- package/dist/utilities/isValidID.d.ts +1 -1
- package/dist/utilities/isValidID.d.ts.map +1 -1
- package/dist/utilities/killTransaction.d.ts +7 -0
- package/dist/utilities/killTransaction.d.ts.map +1 -1
- package/dist/utilities/killTransaction.js +7 -0
- package/dist/utilities/killTransaction.js.map +1 -1
- package/dist/utilities/logError.d.ts.map +1 -1
- package/dist/utilities/logError.js +5 -2
- package/dist/utilities/logError.js.map +1 -1
- package/dist/utilities/logger.d.ts +1 -1
- package/dist/utilities/logger.d.ts.map +1 -1
- package/dist/utilities/mergeHeaders.d.ts.map +1 -1
- package/dist/utilities/mergeListSearchAndWhere.d.ts.map +1 -1
- package/dist/utilities/miniChalk.d.ts.map +1 -1
- package/dist/utilities/nextJsDevReloadStrategy.d.ts +7 -0
- package/dist/utilities/nextJsDevReloadStrategy.d.ts.map +1 -0
- package/dist/utilities/nextJsDevReloadStrategy.js +59 -0
- package/dist/utilities/nextJsDevReloadStrategy.js.map +1 -0
- package/dist/utilities/optionsAreEqual.d.ts.map +1 -1
- package/dist/utilities/parseBooleanString.d.ts.map +1 -1
- package/dist/utilities/parseCookies.d.ts +1 -1
- package/dist/utilities/parseCookies.d.ts.map +1 -1
- package/dist/utilities/parseDocumentID.d.ts +4 -1
- package/dist/utilities/parseDocumentID.d.ts.map +1 -1
- package/dist/utilities/parseDocumentID.js +7 -1
- package/dist/utilities/parseDocumentID.js.map +1 -1
- package/dist/utilities/parseParams/index.d.ts.map +1 -1
- package/dist/utilities/parseParams/index.js +3 -1
- package/dist/utilities/parseParams/index.js.map +1 -1
- package/dist/utilities/profiling.d.ts.map +1 -1
- package/dist/utilities/reduceFieldsToValues.d.ts.map +1 -1
- package/dist/utilities/resolveSelect.d.ts.map +1 -1
- package/dist/utilities/routeError.d.ts.map +1 -1
- package/dist/utilities/sanitizeFallbackLocale.d.ts.map +1 -1
- package/dist/utilities/sanitizeInternalFields.d.ts.map +1 -1
- package/dist/utilities/sanitizeJoinParams.d.ts.map +1 -1
- package/dist/utilities/sanitizePopulateParam.d.ts.map +1 -1
- package/dist/utilities/sanitizeSelect.d.ts.map +1 -1
- package/dist/utilities/sanitizeSelectParam.d.ts.map +1 -1
- package/dist/utilities/sanitizeSortParams.d.ts.map +1 -1
- package/dist/utilities/sanitizeUploadPrefix.d.ts +5 -0
- package/dist/utilities/sanitizeUploadPrefix.d.ts.map +1 -0
- package/dist/utilities/sanitizeUploadPrefix.js +18 -0
- package/dist/utilities/sanitizeUploadPrefix.js.map +1 -0
- package/dist/utilities/setsAreEqual.d.ts.map +1 -1
- package/dist/utilities/sharedInputSchemas.d.ts +52 -0
- package/dist/utilities/sharedInputSchemas.d.ts.map +1 -0
- package/dist/utilities/sharedInputSchemas.js +101 -0
- package/dist/utilities/sharedInputSchemas.js.map +1 -0
- package/dist/utilities/slugify.d.ts.map +1 -1
- package/dist/utilities/stripUnselectedFields.d.ts.map +1 -1
- package/dist/utilities/telemetry/conf/envPaths.d.ts.map +1 -1
- package/dist/utilities/telemetry/conf/envPaths.js +40 -31
- package/dist/utilities/telemetry/conf/envPaths.js.map +1 -1
- package/dist/utilities/telemetry/conf/index.d.ts.map +1 -1
- package/dist/utilities/telemetry/events/adminInit.d.ts.map +1 -1
- package/dist/utilities/telemetry/events/adminInit.js +2 -3
- package/dist/utilities/telemetry/events/adminInit.js.map +1 -1
- package/dist/utilities/telemetry/events/serverInit.d.ts.map +1 -1
- package/dist/utilities/telemetry/events/serverInit.js +2 -3
- package/dist/utilities/telemetry/events/serverInit.js.map +1 -1
- package/dist/utilities/telemetry/featureInfo/getFeatureInfo.d.ts +4 -0
- package/dist/utilities/telemetry/featureInfo/getFeatureInfo.d.ts.map +1 -0
- package/dist/utilities/telemetry/featureInfo/getFeatureInfo.js +261 -0
- package/dist/utilities/telemetry/featureInfo/getFeatureInfo.js.map +1 -0
- package/dist/utilities/telemetry/featureInfo/types.d.ts +63 -0
- package/dist/utilities/telemetry/featureInfo/types.d.ts.map +1 -0
- package/dist/utilities/telemetry/featureInfo/types.js +3 -0
- package/dist/utilities/telemetry/featureInfo/types.js.map +1 -0
- package/dist/utilities/telemetry/getProjectContext.d.ts +16 -0
- package/dist/utilities/telemetry/getProjectContext.d.ts.map +1 -0
- package/dist/utilities/telemetry/getProjectContext.js +43 -0
- package/dist/utilities/telemetry/getProjectContext.js.map +1 -0
- package/dist/utilities/telemetry/index.d.ts +21 -5
- package/dist/utilities/telemetry/index.d.ts.map +1 -1
- package/dist/utilities/telemetry/index.js +26 -1
- package/dist/utilities/telemetry/index.js.map +1 -1
- package/dist/utilities/telemetry/oneWayHash.d.ts.map +1 -1
- package/dist/utilities/timestamp.d.ts.map +1 -1
- package/dist/utilities/toKebabCase.d.ts.map +1 -1
- package/dist/utilities/transformColumnPreferences.d.ts.map +1 -1
- package/dist/utilities/transformPointDataToPayload.d.ts +7 -0
- package/dist/utilities/transformPointDataToPayload.d.ts.map +1 -0
- package/dist/utilities/transformPointDataToPayload.js +28 -0
- package/dist/utilities/transformPointDataToPayload.js.map +1 -0
- package/dist/utilities/transformWhereQuery.d.ts.map +1 -1
- package/dist/utilities/traverseFields.d.ts.map +1 -1
- package/dist/utilities/traverseFields.js +25 -36
- package/dist/utilities/traverseFields.js.map +1 -1
- package/dist/utilities/traverseForLocalizedFields.d.ts.map +1 -1
- package/dist/utilities/unflatten.d.ts.map +1 -1
- package/dist/utilities/unflatten.js +21 -9
- package/dist/utilities/unflatten.js.map +1 -1
- package/dist/utilities/unflattenData.d.ts +3 -0
- package/dist/utilities/unflattenData.d.ts.map +1 -0
- package/dist/utilities/unflattenData.js +14 -0
- package/dist/utilities/unflattenData.js.map +1 -0
- package/dist/utilities/validateMimeType.d.ts.map +1 -1
- package/dist/utilities/validateTimezones.d.ts.map +1 -1
- package/dist/utilities/validateWhereQuery.d.ts.map +1 -1
- package/dist/utilities/wordBoundariesRegex.d.ts.map +1 -1
- package/dist/utilities/wrapInternalEndpoints.d.ts.map +1 -1
- package/dist/utilities/zod.d.ts +5 -0
- package/dist/utilities/zod.d.ts.map +1 -0
- package/dist/utilities/zod.js +21 -0
- package/dist/utilities/zod.js.map +1 -0
- package/dist/versions/allLocalesPublicationStatus.d.ts +38 -0
- package/dist/versions/allLocalesPublicationStatus.d.ts.map +1 -0
- package/dist/versions/allLocalesPublicationStatus.js +57 -0
- package/dist/versions/allLocalesPublicationStatus.js.map +1 -0
- package/dist/versions/baseFields.d.ts.map +1 -1
- package/dist/versions/buildCollectionFields.d.ts.map +1 -1
- package/dist/versions/buildGlobalFields.d.ts.map +1 -1
- package/dist/versions/buildVersionCompoundIndexes.d.ts.map +1 -1
- package/dist/versions/defaults.d.ts.map +1 -1
- package/dist/versions/deleteCollectionVersions.d.ts +11 -1
- package/dist/versions/deleteCollectionVersions.d.ts.map +1 -1
- package/dist/versions/deleteCollectionVersions.js +10 -3
- package/dist/versions/deleteCollectionVersions.js.map +1 -1
- package/dist/versions/deleteScheduledPublishJobs.d.ts +5 -1
- package/dist/versions/deleteScheduledPublishJobs.d.ts.map +1 -1
- package/dist/versions/deleteScheduledPublishJobs.js +11 -5
- package/dist/versions/deleteScheduledPublishJobs.js.map +1 -1
- package/dist/versions/drafts/appendVersionToQueryKey.d.ts +1 -0
- package/dist/versions/drafts/appendVersionToQueryKey.d.ts.map +1 -1
- package/dist/versions/drafts/appendVersionToQueryKey.js +6 -12
- package/dist/versions/drafts/appendVersionToQueryKey.js.map +1 -1
- package/dist/versions/drafts/getQueryDraftsSelect.d.ts.map +1 -1
- package/dist/versions/drafts/getQueryDraftsSort.d.ts.map +1 -1
- package/dist/versions/drafts/replaceWithDraftIfAvailable.d.ts.map +1 -1
- package/dist/versions/enforceMaxVersions.d.ts.map +1 -1
- package/dist/versions/getLatestCollectionVersion.d.ts.map +1 -1
- package/dist/versions/getLatestGlobalVersion.d.ts.map +1 -1
- package/dist/versions/getLatestGlobalVersion.js +10 -2
- package/dist/versions/getLatestGlobalVersion.js.map +1 -1
- package/dist/versions/getRestoredStatusesToAuthorize.d.ts +9 -0
- package/dist/versions/getRestoredStatusesToAuthorize.d.ts.map +1 -0
- package/dist/versions/getRestoredStatusesToAuthorize.js +22 -0
- package/dist/versions/getRestoredStatusesToAuthorize.js.map +1 -0
- package/dist/versions/isInheritedReadVersionsAccess.d.ts +6 -0
- package/dist/versions/isInheritedReadVersionsAccess.d.ts.map +1 -0
- package/dist/versions/isInheritedReadVersionsAccess.js +30 -0
- package/dist/versions/isInheritedReadVersionsAccess.js.map +1 -0
- package/dist/versions/migrations/localizeStatus/shared.d.ts.map +1 -1
- package/dist/versions/payloadPackageList.d.ts.map +1 -1
- package/dist/versions/payloadPackageList.js +0 -1
- package/dist/versions/payloadPackageList.js.map +1 -1
- package/dist/versions/schedule/job.d.ts +2 -2
- package/dist/versions/schedule/job.d.ts.map +1 -1
- package/dist/versions/schedule/job.js +16 -9
- package/dist/versions/schedule/job.js.map +1 -1
- package/dist/versions/schedule/types.d.ts +5 -1
- package/dist/versions/schedule/types.d.ts.map +1 -1
- package/dist/versions/schedule/types.js.map +1 -1
- package/package.json +29 -11
- package/skills/payload/SKILL.md +544 -0
- package/skills/payload/reference/ACCESS-CONTROL-ADVANCED.md +718 -0
- package/skills/payload/reference/ACCESS-CONTROL.md +700 -0
- package/skills/payload/reference/ADAPTERS.md +312 -0
- package/skills/payload/reference/ADVANCED.md +393 -0
- package/skills/payload/reference/COLLECTIONS.md +336 -0
- package/skills/payload/reference/ENDPOINTS.md +650 -0
- package/skills/payload/reference/FIELD-TYPE-GUARDS.md +553 -0
- package/skills/payload/reference/FIELDS.md +748 -0
- package/skills/payload/reference/HOOKS.md +186 -0
- package/skills/payload/reference/PLUGIN-DEVELOPMENT.md +1445 -0
- package/skills/payload/reference/QUERIES.md +282 -0
- package/dist/auth/cookies.spec.js +0 -34
- package/dist/auth/cookies.spec.js.map +0 -1
- package/dist/auth/strategies/local/authenticate.spec.js +0 -83
- package/dist/auth/strategies/local/authenticate.spec.js.map +0 -1
- package/dist/bin/build.d.ts +0 -25
- package/dist/bin/build.d.ts.map +0 -1
- package/dist/bin/build.js +0 -80
- package/dist/bin/build.js.map +0 -1
- package/dist/bin/build.spec.js +0 -170
- package/dist/bin/build.spec.js.map +0 -1
- package/dist/bin/generateImportMap/generateImportMap.spec.js +0 -176
- package/dist/bin/generateImportMap/generateImportMap.spec.js.map +0 -1
- package/dist/bin/generateImportMap/index.d.ts.map +0 -1
- package/dist/bin/generateImportMap/index.js.map +0 -1
- package/dist/bin/generateImportMap/iterateCollections.d.ts.map +0 -1
- package/dist/bin/generateImportMap/iterateCollections.js.map +0 -1
- package/dist/bin/generateImportMap/iterateConfig.d.ts.map +0 -1
- package/dist/bin/generateImportMap/iterateConfig.js.map +0 -1
- package/dist/bin/generateImportMap/iterateFields.d.ts.map +0 -1
- package/dist/bin/generateImportMap/iterateFields.js.map +0 -1
- package/dist/bin/generateImportMap/iterateGlobals.d.ts.map +0 -1
- package/dist/bin/generateImportMap/iterateGlobals.js.map +0 -1
- package/dist/bin/generateImportMap/utilities/addPayloadComponentToImportMap.d.ts.map +0 -1
- package/dist/bin/generateImportMap/utilities/addPayloadComponentToImportMap.js.map +0 -1
- package/dist/bin/generateImportMap/utilities/getFromImportMap.d.ts.map +0 -1
- package/dist/bin/generateImportMap/utilities/getFromImportMap.js.map +0 -1
- package/dist/bin/generateImportMap/utilities/getImportMapToBaseDirPath.d.ts.map +0 -1
- package/dist/bin/generateImportMap/utilities/getImportMapToBaseDirPath.js.map +0 -1
- package/dist/bin/generateImportMap/utilities/parsePayloadComponent.d.ts.map +0 -1
- package/dist/bin/generateImportMap/utilities/parsePayloadComponent.js.map +0 -1
- package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.d.ts.map +0 -1
- package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.js.map +0 -1
- package/dist/bin/generateTypes.d.ts +0 -6
- package/dist/bin/generateTypes.d.ts.map +0 -1
- package/dist/bin/generateTypes.js.map +0 -1
- package/dist/bin/index.d.ts +0 -2
- package/dist/bin/index.d.ts.map +0 -1
- package/dist/bin/index.js +0 -200
- package/dist/bin/index.js.map +0 -1
- package/dist/bin/info.d.ts +0 -2
- package/dist/bin/info.d.ts.map +0 -1
- package/dist/bin/info.js +0 -56
- package/dist/bin/info.js.map +0 -1
- package/dist/bin/loadEnv.d.ts.map +0 -1
- package/dist/bin/loadEnv.js.map +0 -1
- package/dist/bin/migrate.d.ts +0 -15
- package/dist/bin/migrate.d.ts.map +0 -1
- package/dist/bin/migrate.js +0 -102
- package/dist/bin/migrate.js.map +0 -1
- package/dist/collections/config/defaults.spec.js +0 -47
- package/dist/collections/config/defaults.spec.js.map +0 -1
- package/dist/collections/config/sanitize.spec.js +0 -120
- package/dist/collections/config/sanitize.spec.js.map +0 -1
- package/dist/collections/config/useAsTitle.spec.js +0 -187
- package/dist/collections/config/useAsTitle.spec.js.map +0 -1
- package/dist/database/defaultUpdateJobs.d.ts +0 -3
- package/dist/database/defaultUpdateJobs.d.ts.map +0 -1
- package/dist/database/defaultUpdateJobs.js +0 -41
- package/dist/database/defaultUpdateJobs.js.map +0 -1
- package/dist/database/migrations/findMigrationDir.spec.js +0 -47
- package/dist/database/migrations/findMigrationDir.spec.js.map +0 -1
- package/dist/fields/baseFields/slug/countVersions.d.ts +0 -13
- package/dist/fields/baseFields/slug/countVersions.d.ts.map +0 -1
- package/dist/fields/baseFields/slug/countVersions.js +0 -29
- package/dist/fields/baseFields/slug/countVersions.js.map +0 -1
- package/dist/fields/baseFields/slug/index.d.ts +0 -89
- package/dist/fields/baseFields/slug/index.d.ts.map +0 -1
- package/dist/fields/baseFields/slug/index.js +0 -81
- package/dist/fields/baseFields/slug/index.js.map +0 -1
- package/dist/fields/config/reservedFieldNames.spec.js +0 -149
- package/dist/fields/config/reservedFieldNames.spec.js.map +0 -1
- package/dist/fields/config/sanitize.spec.js +0 -745
- package/dist/fields/config/sanitize.spec.js.map +0 -1
- package/dist/fields/isFieldDisabled.spec.js +0 -134
- package/dist/fields/isFieldDisabled.spec.js.map +0 -1
- package/dist/fields/validations.spec.js +0 -990
- package/dist/fields/validations.spec.js.map +0 -1
- package/dist/globals/config/sanitize.spec.js +0 -43
- package/dist/globals/config/sanitize.spec.js.map +0 -1
- package/dist/hierarchy/utils/getLocalizedValue.spec.js +0 -250
- package/dist/hierarchy/utils/getLocalizedValue.spec.js.map +0 -1
- package/dist/locked-documents/config.spec.js +0 -298
- package/dist/locked-documents/config.spec.js.map +0 -1
- package/dist/uploads/checkFileAccess.spec.js +0 -109
- package/dist/uploads/checkFileAccess.spec.js.map +0 -1
- package/dist/uploads/endpoints/getFileFromURL.d.ts +0 -3
- package/dist/uploads/endpoints/getFileFromURL.d.ts.map +0 -1
- package/dist/uploads/endpoints/getFileFromURL.js.map +0 -1
- package/dist/uploads/fetchAPI-multipart/isEligibleRequest.spec.js +0 -29
- package/dist/uploads/fetchAPI-multipart/isEligibleRequest.spec.js.map +0 -1
- package/dist/uploads/getExternalFile.d.ts +0 -10
- package/dist/uploads/getExternalFile.d.ts.map +0 -1
- package/dist/uploads/getExternalFile.js +0 -73
- package/dist/uploads/getExternalFile.js.map +0 -1
- package/dist/uploads/getSafeFilename.spec.js +0 -274
- package/dist/uploads/getSafeFilename.spec.js.map +0 -1
- package/dist/uploads/mimeTypeValidator.spec.js +0 -84
- package/dist/uploads/mimeTypeValidator.spec.js.map +0 -1
- package/dist/uploads/tempFile.d.ts +0 -7
- package/dist/uploads/tempFile.d.ts.map +0 -1
- package/dist/uploads/tempFile.js +0 -39
- package/dist/uploads/tempFile.js.map +0 -1
- package/dist/utilities/addDataAndFileToRequest.spec.js +0 -41
- package/dist/utilities/addDataAndFileToRequest.spec.js.map +0 -1
- package/dist/utilities/addSelectGenericsToGeneratedTypes.spec.js +0 -563
- package/dist/utilities/addSelectGenericsToGeneratedTypes.spec.js.map +0 -1
- package/dist/utilities/combineWhereConstraints.spec.js +0 -131
- package/dist/utilities/combineWhereConstraints.spec.js.map +0 -1
- package/dist/utilities/configToJSONSchema.spec.js +0 -806
- package/dist/utilities/configToJSONSchema.spec.js.map +0 -1
- package/dist/utilities/createLocalReq.d.ts +0 -15
- package/dist/utilities/createLocalReq.d.ts.map +0 -1
- package/dist/utilities/createLocalReq.js +0 -110
- package/dist/utilities/createLocalReq.js.map +0 -1
- package/dist/utilities/createLocalReq.spec.js +0 -125
- package/dist/utilities/createLocalReq.spec.js.map +0 -1
- package/dist/utilities/filterDataToSelectedLocales.spec.js +0 -529
- package/dist/utilities/filterDataToSelectedLocales.spec.js.map +0 -1
- package/dist/utilities/flattenTopLevelFields.spec.js +0 -659
- package/dist/utilities/flattenTopLevelFields.spec.js.map +0 -1
- package/dist/utilities/formatAdminURL.spec.js +0 -168
- package/dist/utilities/formatAdminURL.spec.js.map +0 -1
- package/dist/utilities/formatErrors.spec.js +0 -101
- package/dist/utilities/formatErrors.spec.js.map +0 -1
- package/dist/utilities/formatLabels.spec.js +0 -38
- package/dist/utilities/formatLabels.spec.js.map +0 -1
- package/dist/utilities/getFieldByPath.spec.js +0 -157
- package/dist/utilities/getFieldByPath.spec.js.map +0 -1
- package/dist/utilities/getFieldPermissions.spec.js +0 -78
- package/dist/utilities/getFieldPermissions.spec.js.map +0 -1
- package/dist/utilities/getRequestOrigin.spec.js +0 -151
- package/dist/utilities/getRequestOrigin.spec.js.map +0 -1
- package/dist/utilities/getSafeRedirect.spec.js +0 -84
- package/dist/utilities/getSafeRedirect.spec.js.map +0 -1
- package/dist/utilities/isRSCEnabled.d.ts +0 -12
- package/dist/utilities/isRSCEnabled.d.ts.map +0 -1
- package/dist/utilities/isRSCEnabled.js +0 -14
- package/dist/utilities/isRSCEnabled.js.map +0 -1
- package/dist/utilities/isolateObjectProperty.spec.js +0 -120
- package/dist/utilities/isolateObjectProperty.spec.js.map +0 -1
- package/dist/utilities/mergeLocalizedData.spec.js +0 -1108
- package/dist/utilities/mergeLocalizedData.spec.js.map +0 -1
- package/dist/utilities/optionsAreEqual.spec.js +0 -319
- package/dist/utilities/optionsAreEqual.spec.js.map +0 -1
- package/dist/utilities/parseParams/index.spec.js +0 -384
- package/dist/utilities/parseParams/index.spec.js.map +0 -1
- package/dist/utilities/profiling.spec.js +0 -53
- package/dist/utilities/profiling.spec.js.map +0 -1
- package/dist/utilities/sanitizePermissions.spec.js +0 -1639
- package/dist/utilities/sanitizePermissions.spec.js.map +0 -1
- package/dist/utilities/sanitizeUserDataForEmail.spec.js +0 -134
- package/dist/utilities/sanitizeUserDataForEmail.spec.js.map +0 -1
- package/dist/utilities/traverseFields.spec.js +0 -53
- package/dist/utilities/traverseFields.spec.js.map +0 -1
- package/dist/utilities/validateTimezones.spec.js +0 -493
- package/dist/utilities/validateTimezones.spec.js.map +0 -1
- /package/dist/{bin → cli/commands}/generateImportMap/iterateFields.js +0 -0
- /package/dist/{bin → cli/commands}/generateImportMap/iterateGlobals.js +0 -0
- /package/dist/{bin → cli/commands}/generateImportMap/utilities/addPayloadComponentToImportMap.js +0 -0
- /package/dist/{bin → cli/commands}/generateImportMap/utilities/getFromImportMap.js +0 -0
- /package/dist/{bin → cli/commands}/generateImportMap/utilities/getImportMapToBaseDirPath.d.ts +0 -0
- /package/dist/{bin → cli/commands}/generateImportMap/utilities/getImportMapToBaseDirPath.js +0 -0
- /package/dist/{bin → cli/commands}/generateImportMap/utilities/parsePayloadComponent.js +0 -0
- /package/dist/{bin → cli/commands}/generateImportMap/utilities/resolveImportMapFilePath.d.ts +0 -0
- /package/dist/{bin → cli/runtime}/loadEnv.d.ts +0 -0
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refines Payload's `input`-variant JSON Schema into an agent-friendly create/update input schema.
|
|
3
|
+
* The variant already covers correctness (ID-only relationships, no managed/virtual/join fields);
|
|
4
|
+
* the passes here reshape fields for models and shrink the result while keeping every node valid
|
|
5
|
+
* JSON Schema draft 2020-12. Each is tagged **Correctness**, **Size**, or **LLM ergonomics**, with a
|
|
6
|
+
* before/after example on its definition.
|
|
7
|
+
*/ export const sanitizeEntitySchema = (schema)=>{
|
|
8
|
+
// Work on a copy — the caller reuses the original schema elsewhere (e.g. when listing tools).
|
|
9
|
+
let result = structuredClone(schema);
|
|
10
|
+
// LLM ergonomics — drop the redundant `'null'` from optional arrays/objects (`['array','null']` → `'array'`).
|
|
11
|
+
result = collapseOptionalContainerTypes(result);
|
|
12
|
+
// LLM ergonomics — rewrite point fields from a `[number, number]` tuple into a `{ longitude, latitude }` object.
|
|
13
|
+
result = pointFieldsToObjects(result);
|
|
14
|
+
// Size — strip inert type-gen leftovers that only bloat the schema (`tsType`, block-collision notes).
|
|
15
|
+
result = removeTypeGenArtifacts(result);
|
|
16
|
+
// Size — where a `const` already pins a value, the sibling `type` is redundant; remove it.
|
|
17
|
+
result = dropRedundantConstType(result);
|
|
18
|
+
// Size — fold per-collection relationship/upload variants (identical but for `relationTo`) into one `enum`.
|
|
19
|
+
result = mergeConstDiscriminatedUnions(result);
|
|
20
|
+
// Size — pull any subschema that appears more than once into a single shared `$defs` entry.
|
|
21
|
+
result = deduplicateIntoDefinitions(result);
|
|
22
|
+
// LLM ergonomics — give `$defs` short, readable names (`Code`, `paragraph`, `node`) so the `$ref`s read nicely.
|
|
23
|
+
result = shortenDefinitionNames(result);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Rebuilds a schema bottom-up, calling `visit` on each node after its children. Shared by the
|
|
28
|
+
* transforms that need to touch every node in the tree.
|
|
29
|
+
*/ const mapNodes = (node, visit)=>{
|
|
30
|
+
if (Array.isArray(node)) {
|
|
31
|
+
return node.map((child)=>mapNodes(child, visit));
|
|
32
|
+
}
|
|
33
|
+
if (!node || typeof node !== 'object') {
|
|
34
|
+
return node;
|
|
35
|
+
}
|
|
36
|
+
const out = {};
|
|
37
|
+
for (const [key, value] of Object.entries(node)){
|
|
38
|
+
out[key] = mapNodes(value, visit);
|
|
39
|
+
}
|
|
40
|
+
return visit(out);
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* **LLM ergonomics.** Collapses optional array/object types (`['array', 'null']` → `'array'`) via
|
|
44
|
+
* {@link collapseNullableType}, recursing through `properties` and array items. The `required` list
|
|
45
|
+
* already conveys optionality, so the `'null'` is redundant noise for the model.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* { properties: { tags: { type: ['array', 'null'], items: {} } }, required: [] }
|
|
49
|
+
* → { properties: { tags: { type: 'array', items: {} } }, required: [] }
|
|
50
|
+
*/ const collapseOptionalContainerTypes = (schema)=>{
|
|
51
|
+
if (schema.properties && typeof schema.properties === 'object') {
|
|
52
|
+
for (const key of Object.keys(schema.properties)){
|
|
53
|
+
const prop = schema.properties[key];
|
|
54
|
+
if (!prop || typeof prop !== 'object') {
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
const isRequired = Array.isArray(schema.required) && schema.required.includes(key);
|
|
58
|
+
collapseNullableType(prop, isRequired);
|
|
59
|
+
if (prop.properties) {
|
|
60
|
+
collapseOptionalContainerTypes(prop);
|
|
61
|
+
}
|
|
62
|
+
if (prop.items && typeof prop.items === 'object' && !Array.isArray(prop.items)) {
|
|
63
|
+
collapseOptionalContainerTypes(prop.items);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return schema;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Drops the `'null'` from an optional array/object type (`['array', 'null']` → `'array'`, likewise
|
|
71
|
+
* `'object'`). Payload marks a field optional by unioning its type with `'null'`, but a create/update
|
|
72
|
+
* tool already conveys "optional" through the `required` list - the client just omits the field - so the
|
|
73
|
+
* `'null'` is redundant here. Dropping it shows the model a plain `type: 'array'` instead of implying it
|
|
74
|
+
* should send a literal `null`.
|
|
75
|
+
*
|
|
76
|
+
* We never touch the `required` list, so this can't change whether a field is required. And we skip fields
|
|
77
|
+
* that ARE required (`isRequired`): there a `'null'` is a value the field genuinely accepts, not optionality
|
|
78
|
+
* encoding. Nullable scalars (`['string', 'null']`) are also left alone - they read fine as `string | null`.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* optional { type: ['array', 'null'] } → { type: 'array' } (still optional, just no longer null-valued)
|
|
82
|
+
* required { type: ['array', 'null'] } → unchanged
|
|
83
|
+
* { type: ['string', 'null'] } → unchanged
|
|
84
|
+
*/ const collapseNullableType = (schema, isRequired)=>{
|
|
85
|
+
if (isRequired || !Array.isArray(schema.type)) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const nonNullTypes = schema.type.filter((t)=>t !== 'null');
|
|
89
|
+
if (nonNullTypes.length === 1 && (nonNullTypes[0] === 'array' || nonNullTypes[0] === 'object')) {
|
|
90
|
+
schema.type = nonNullTypes[0];
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* **LLM ergonomics.** Rewrites a point field (stored as a two-number tuple) into a `{ longitude, latitude }` object, which
|
|
95
|
+
* is far easier for the model to fill in than a positional array. This is input-only and lossless: the
|
|
96
|
+
* create/update handler converts the object back to the `[longitude, latitude]` tuple Payload stores,
|
|
97
|
+
* via `transformPointDataToPayload`.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* { type: 'array', items: [{ type: 'number' }, { type: 'number' }] }
|
|
101
|
+
* → { type: 'object', properties: { longitude: { type: 'number' }, latitude: { type: 'number' } }, required: ['longitude', 'latitude'] }
|
|
102
|
+
*/ const pointFieldsToObjects = (schema)=>{
|
|
103
|
+
if (!schema || typeof schema !== 'object') {
|
|
104
|
+
return schema;
|
|
105
|
+
}
|
|
106
|
+
const transformed = {
|
|
107
|
+
...schema
|
|
108
|
+
};
|
|
109
|
+
if (transformed.properties && typeof transformed.properties === 'object') {
|
|
110
|
+
transformed.properties = Object.fromEntries(Object.entries(transformed.properties).map(([key, value])=>{
|
|
111
|
+
if (!value || typeof value !== 'object') {
|
|
112
|
+
return [
|
|
113
|
+
key,
|
|
114
|
+
value
|
|
115
|
+
];
|
|
116
|
+
}
|
|
117
|
+
const isArrayType = value.type === 'array' || Array.isArray(value.type) && value.type.includes('array');
|
|
118
|
+
const isPointField = isArrayType && Array.isArray(value.items) && value.items.length === 2 && value.items.every((item)=>item && typeof item === 'object' && item.type === 'number');
|
|
119
|
+
if (isPointField) {
|
|
120
|
+
const isNullable = Array.isArray(value.type) && value.type.includes('null');
|
|
121
|
+
return [
|
|
122
|
+
key,
|
|
123
|
+
{
|
|
124
|
+
type: isNullable ? [
|
|
125
|
+
'object',
|
|
126
|
+
'null'
|
|
127
|
+
] : 'object',
|
|
128
|
+
description: value.description || 'Geographic coordinates (longitude, latitude)',
|
|
129
|
+
properties: {
|
|
130
|
+
latitude: {
|
|
131
|
+
type: 'number',
|
|
132
|
+
description: 'Latitude coordinate'
|
|
133
|
+
},
|
|
134
|
+
longitude: {
|
|
135
|
+
type: 'number',
|
|
136
|
+
description: 'Longitude coordinate'
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
required: [
|
|
140
|
+
'longitude',
|
|
141
|
+
'latitude'
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
];
|
|
145
|
+
}
|
|
146
|
+
return [
|
|
147
|
+
key,
|
|
148
|
+
pointFieldsToObjects(value)
|
|
149
|
+
];
|
|
150
|
+
}));
|
|
151
|
+
}
|
|
152
|
+
if (transformed.items && typeof transformed.items === 'object' && !Array.isArray(transformed.items)) {
|
|
153
|
+
transformed.items = pointFieldsToObjects(transformed.items);
|
|
154
|
+
}
|
|
155
|
+
return transformed;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* **Size.** Strips type-generation leftovers that bloat the schema without helping the model: the `tsType`
|
|
159
|
+
* hint (a `json-schema-to-typescript` extension; JSON Schema validators just ignore it, they don't reject it)
|
|
160
|
+
* and the block-interface-collision note Payload adds to some block descriptions (the
|
|
161
|
+
* `block-interface-name-collisions` docs link set in `registerBlockInterface`, see configToJSONSchema.ts).
|
|
162
|
+
* Both are inert here - removing them only shrinks the schema (and spares the model irrelevant noise).
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* { type: 'object', tsType: 'SerializedBlockNode', description: 'see …#block-interface-name-collisions' }
|
|
166
|
+
* → { type: 'object' }
|
|
167
|
+
*/ const removeTypeGenArtifacts = (schema)=>mapNodes(schema, (node)=>{
|
|
168
|
+
delete node.tsType;
|
|
169
|
+
const { description } = node;
|
|
170
|
+
if (typeof description === 'string' && description.includes('block-interface-name-collisions')) {
|
|
171
|
+
delete node.description;
|
|
172
|
+
}
|
|
173
|
+
return node;
|
|
174
|
+
});
|
|
175
|
+
/**
|
|
176
|
+
* **Size.** Removes `type` whenever a `const` sits next to it — the constant already fixes the value.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* { type: 'string', const: 'paragraph' } → { const: 'paragraph' }
|
|
180
|
+
*/ const dropRedundantConstType = (schema)=>mapNodes(schema, (node)=>{
|
|
181
|
+
if ('const' in node && 'type' in node) {
|
|
182
|
+
delete node.type;
|
|
183
|
+
}
|
|
184
|
+
return node;
|
|
185
|
+
});
|
|
186
|
+
/**
|
|
187
|
+
* **Size.** Merges the members of a `oneOf`/`anyOf` that are identical except for one `const`-valued property
|
|
188
|
+
* into a single member with that property as an `enum`. Since the members differ only by that one
|
|
189
|
+
* constant, the `enum` form accepts exactly the same values - it's just smaller. This folds the
|
|
190
|
+
* per-collection relationship and upload variants, which differ only in their `relationTo` constant.
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* { oneOf: [
|
|
194
|
+
* { properties: { relationTo: { const: 'posts' }, value: { type: 'string' } } },
|
|
195
|
+
* { properties: { relationTo: { const: 'pages' }, value: { type: 'string' } } },
|
|
196
|
+
* ] }
|
|
197
|
+
* → { properties: { relationTo: { enum: ['posts', 'pages'] }, value: { type: 'string' } } }
|
|
198
|
+
*/ const mergeConstDiscriminatedUnions = (schema)=>mapNodes(schema, (node)=>{
|
|
199
|
+
for (const keyword of [
|
|
200
|
+
'oneOf',
|
|
201
|
+
'anyOf'
|
|
202
|
+
]){
|
|
203
|
+
const members = node[keyword];
|
|
204
|
+
if (Array.isArray(members) && members.length > 1) {
|
|
205
|
+
const merged = mergeMembersByConst(members);
|
|
206
|
+
if (merged) {
|
|
207
|
+
delete node[keyword];
|
|
208
|
+
Object.assign(node, merged);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return node;
|
|
213
|
+
});
|
|
214
|
+
/** Returns the merged member for {@link mergeConstDiscriminatedUnions}, or `null` if they can't merge. */ const mergeMembersByConst = (members)=>{
|
|
215
|
+
const objects = members.filter((member)=>typeof member === 'object' && member !== null && typeof member.properties === 'object');
|
|
216
|
+
if (objects.length < 2 || objects.length !== members.length) {
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
for (const discriminator of Object.keys(objects[0].properties)){
|
|
220
|
+
// Each member must pin this property to a `const`...
|
|
221
|
+
const constValues = [];
|
|
222
|
+
const everyMemberPinsConst = objects.every((member)=>{
|
|
223
|
+
const prop = member.properties[discriminator];
|
|
224
|
+
if (prop && typeof prop === 'object' && 'const' in prop) {
|
|
225
|
+
constValues.push(prop.const);
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
return false;
|
|
229
|
+
});
|
|
230
|
+
if (!everyMemberPinsConst) {
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
// ...and be otherwise identical (compare each member with the discriminator removed).
|
|
234
|
+
const fingerprintWithoutDiscriminator = (member)=>{
|
|
235
|
+
const { [discriminator]: _discriminator, ...otherProperties } = member.properties;
|
|
236
|
+
return JSON.stringify({
|
|
237
|
+
...member,
|
|
238
|
+
properties: otherProperties
|
|
239
|
+
});
|
|
240
|
+
};
|
|
241
|
+
if (new Set(objects.map(fingerprintWithoutDiscriminator)).size !== 1) {
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
const uniqueConstValues = [
|
|
245
|
+
...new Set(constValues)
|
|
246
|
+
];
|
|
247
|
+
if (uniqueConstValues.length < 2) {
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
// Replace the per-member `const` with a single `enum` of every value.
|
|
251
|
+
const merged = structuredClone(objects[0]);
|
|
252
|
+
const discriminatorProp = merged.properties[discriminator];
|
|
253
|
+
if (discriminatorProp && typeof discriminatorProp === 'object') {
|
|
254
|
+
delete discriminatorProp.const;
|
|
255
|
+
discriminatorProp.enum = uniqueConstValues;
|
|
256
|
+
}
|
|
257
|
+
return merged;
|
|
258
|
+
}
|
|
259
|
+
return null;
|
|
260
|
+
};
|
|
261
|
+
// A `$ref` costs ~30 characters once names are shortened, so sharing a subschema only pays off when
|
|
262
|
+
// it's larger than that and appears more than once.
|
|
263
|
+
const MIN_SHARED_SIZE = 64;
|
|
264
|
+
/** A subschema worth sharing: a standalone object/union/described schema, not a `$ref` or a primitive. */ const isShareable = (node)=>{
|
|
265
|
+
if (!node || typeof node !== 'object' || Array.isArray(node) || '$ref' in node) {
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
const schema = node;
|
|
269
|
+
return Array.isArray(schema.oneOf) || Array.isArray(schema.anyOf) || Boolean(schema.properties) || Boolean(schema.items) || typeof schema.description === 'string';
|
|
270
|
+
};
|
|
271
|
+
/**
|
|
272
|
+
* **Size.** Replaces any subschema that appears more than once with a single shared `$defs` entry referenced by
|
|
273
|
+
* `$ref`. Lossless — only the serialized size shrinks. A collection with several rich-text fields, for
|
|
274
|
+
* example, inlines the same large lexical node schema once per field; this collapses them into one.
|
|
275
|
+
*
|
|
276
|
+
* @example
|
|
277
|
+
* { properties: { billing: address, shipping: address } }
|
|
278
|
+
* → { properties: { billing: { $ref: '#/$defs/shared_0' }, shipping: { $ref: '#/$defs/shared_0' } }, $defs: { shared_0: address } }
|
|
279
|
+
*/ const deduplicateIntoDefinitions = (schema)=>{
|
|
280
|
+
// Count how often each shareable subschema appears, keyed by its serialized form.
|
|
281
|
+
const counts = new Map();
|
|
282
|
+
const count = (node)=>{
|
|
283
|
+
if (isShareable(node)) {
|
|
284
|
+
const key = JSON.stringify(node);
|
|
285
|
+
if (key.length >= MIN_SHARED_SIZE) {
|
|
286
|
+
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
if (Array.isArray(node)) {
|
|
290
|
+
node.forEach(count);
|
|
291
|
+
} else if (node && typeof node === 'object') {
|
|
292
|
+
Object.values(node).forEach(count);
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
count(schema);
|
|
296
|
+
if (![
|
|
297
|
+
...counts.values()
|
|
298
|
+
].some((n)=>n >= 2)) {
|
|
299
|
+
return schema;
|
|
300
|
+
}
|
|
301
|
+
// Replace each subschema seen 2+ times with a `$ref`. The first time we meet one it becomes a shared
|
|
302
|
+
// entry; we never descend into a stored entry, so shared entries never reference one another.
|
|
303
|
+
const sharedEntries = {};
|
|
304
|
+
const nameByKey = new Map();
|
|
305
|
+
const share = (node)=>{
|
|
306
|
+
if (isShareable(node)) {
|
|
307
|
+
const key = JSON.stringify(node);
|
|
308
|
+
if ((counts.get(key) ?? 0) >= 2) {
|
|
309
|
+
let name = nameByKey.get(key);
|
|
310
|
+
if (!name) {
|
|
311
|
+
name = `shared_${nameByKey.size}`;
|
|
312
|
+
nameByKey.set(key, name);
|
|
313
|
+
sharedEntries[name] = node;
|
|
314
|
+
}
|
|
315
|
+
return {
|
|
316
|
+
$ref: `#/$defs/${name}`
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
if (Array.isArray(node)) {
|
|
321
|
+
return node.map(share);
|
|
322
|
+
}
|
|
323
|
+
if (node && typeof node === 'object') {
|
|
324
|
+
return Object.fromEntries(Object.entries(node).map(([childKey, value])=>[
|
|
325
|
+
childKey,
|
|
326
|
+
share(value)
|
|
327
|
+
]));
|
|
328
|
+
}
|
|
329
|
+
return node;
|
|
330
|
+
};
|
|
331
|
+
const result = share(schema);
|
|
332
|
+
result.$defs = {
|
|
333
|
+
...result.$defs,
|
|
334
|
+
...sharedEntries
|
|
335
|
+
};
|
|
336
|
+
return result;
|
|
337
|
+
};
|
|
338
|
+
/**
|
|
339
|
+
* **LLM ergonomics.** Renames `$defs` entries to short, readable names so the `$ref`s stay legible to the model: a block's
|
|
340
|
+
* `blockType` (`Code`), a node's `type` (`paragraph`), `node` for a rich-text node union, otherwise the
|
|
341
|
+
* generated name with its disambiguating hash dropped. A numeric suffix keeps collisions unique.
|
|
342
|
+
*
|
|
343
|
+
* @example
|
|
344
|
+
* { properties: { body: { $ref: '#/$defs/LexicalNodes_9FBEC708' } }, $defs: { LexicalNodes_9FBEC708: {} } }
|
|
345
|
+
* → { properties: { body: { $ref: '#/$defs/node' } }, $defs: { node: {} } }
|
|
346
|
+
*/ const shortenDefinitionNames = (schema)=>{
|
|
347
|
+
const definitions = schema.$defs;
|
|
348
|
+
if (!definitions || Object.keys(definitions).length === 0) {
|
|
349
|
+
return schema;
|
|
350
|
+
}
|
|
351
|
+
const shortNameFor = (name, definition)=>{
|
|
352
|
+
const properties = typeof definition === 'object' && definition.properties || {};
|
|
353
|
+
const constString = (key)=>{
|
|
354
|
+
const prop = properties[key];
|
|
355
|
+
return prop && typeof prop === 'object' && typeof prop.const === 'string' ? prop.const : undefined;
|
|
356
|
+
};
|
|
357
|
+
const members = typeof definition === 'object' ? definition.anyOf ?? definition.oneOf : undefined;
|
|
358
|
+
const isNodeUnion = Array.isArray(members) && members.some((m)=>typeof m === 'object' && Boolean(m.$ref || m.properties?.type));
|
|
359
|
+
return constString('blockType') ?? constString('type') ?? (isNodeUnion ? 'node' : undefined) ?? name.replace(/_[0-9A-F]{6,}$/i, '');
|
|
360
|
+
};
|
|
361
|
+
const prefix = '#/$defs/';
|
|
362
|
+
const usedNames = new Map();
|
|
363
|
+
const rename = new Map();
|
|
364
|
+
for (const [name, definition] of Object.entries(definitions)){
|
|
365
|
+
const shortName = shortNameFor(name, definition);
|
|
366
|
+
const used = usedNames.get(shortName) ?? 0;
|
|
367
|
+
usedNames.set(shortName, used + 1);
|
|
368
|
+
rename.set(name, used === 0 ? shortName : `${shortName}${used + 1}`);
|
|
369
|
+
}
|
|
370
|
+
const result = mapNodes(schema, (node)=>{
|
|
371
|
+
if (typeof node.$ref === 'string' && node.$ref.startsWith(prefix)) {
|
|
372
|
+
const name = node.$ref.slice(prefix.length);
|
|
373
|
+
node.$ref = `${prefix}${rename.get(name) ?? name}`;
|
|
374
|
+
}
|
|
375
|
+
return node;
|
|
376
|
+
});
|
|
377
|
+
result.$defs = Object.fromEntries(Object.entries(result.$defs).map(([name, body])=>[
|
|
378
|
+
rename.get(name) ?? name,
|
|
379
|
+
body
|
|
380
|
+
]));
|
|
381
|
+
return result;
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
//# sourceMappingURL=sanitizeEntitySchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utilities/entityInputSchema/sanitizeEntitySchema.ts"],"sourcesContent":["import type { EntityInputSchema as JsonSchemaType } from './types.js'\n\n/**\n * Refines Payload's `input`-variant JSON Schema into an agent-friendly create/update input schema.\n * The variant already covers correctness (ID-only relationships, no managed/virtual/join fields);\n * the passes here reshape fields for models and shrink the result while keeping every node valid\n * JSON Schema draft 2020-12. Each is tagged **Correctness**, **Size**, or **LLM ergonomics**, with a\n * before/after example on its definition.\n */\nexport const sanitizeEntitySchema = (schema: JsonSchemaType): JsonSchemaType => {\n // Work on a copy — the caller reuses the original schema elsewhere (e.g. when listing tools).\n let result = structuredClone(schema)\n\n // LLM ergonomics — drop the redundant `'null'` from optional arrays/objects (`['array','null']` → `'array'`).\n result = collapseOptionalContainerTypes(result)\n\n // LLM ergonomics — rewrite point fields from a `[number, number]` tuple into a `{ longitude, latitude }` object.\n result = pointFieldsToObjects(result)\n\n // Size — strip inert type-gen leftovers that only bloat the schema (`tsType`, block-collision notes).\n result = removeTypeGenArtifacts(result)\n\n // Size — where a `const` already pins a value, the sibling `type` is redundant; remove it.\n result = dropRedundantConstType(result)\n\n // Size — fold per-collection relationship/upload variants (identical but for `relationTo`) into one `enum`.\n result = mergeConstDiscriminatedUnions(result)\n\n // Size — pull any subschema that appears more than once into a single shared `$defs` entry.\n result = deduplicateIntoDefinitions(result)\n\n // LLM ergonomics — give `$defs` short, readable names (`Code`, `paragraph`, `node`) so the `$ref`s read nicely.\n result = shortenDefinitionNames(result)\n\n return result\n}\n\n/**\n * Rebuilds a schema bottom-up, calling `visit` on each node after its children. Shared by the\n * transforms that need to touch every node in the tree.\n */\nconst mapNodes = (node: unknown, visit: (node: JsonSchemaType) => JsonSchemaType): unknown => {\n if (Array.isArray(node)) {\n return node.map((child) => mapNodes(child, visit))\n }\n if (!node || typeof node !== 'object') {\n return node\n }\n const out: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(node)) {\n out[key] = mapNodes(value, visit)\n }\n return visit(out)\n}\n\n/**\n * **LLM ergonomics.** Collapses optional array/object types (`['array', 'null']` → `'array'`) via\n * {@link collapseNullableType}, recursing through `properties` and array items. The `required` list\n * already conveys optionality, so the `'null'` is redundant noise for the model.\n *\n * @example\n * { properties: { tags: { type: ['array', 'null'], items: {} } }, required: [] }\n * → { properties: { tags: { type: 'array', items: {} } }, required: [] }\n */\nconst collapseOptionalContainerTypes = (schema: JsonSchemaType): JsonSchemaType => {\n if (schema.properties && typeof schema.properties === 'object') {\n for (const key of Object.keys(schema.properties)) {\n const prop = schema.properties[key] as JsonSchemaType\n if (!prop || typeof prop !== 'object') {\n continue\n }\n const isRequired = Array.isArray(schema.required) && schema.required.includes(key)\n collapseNullableType(prop, isRequired)\n if (prop.properties) {\n collapseOptionalContainerTypes(prop)\n }\n if (prop.items && typeof prop.items === 'object' && !Array.isArray(prop.items)) {\n collapseOptionalContainerTypes(prop.items)\n }\n }\n }\n\n return schema\n}\n\n/**\n * Drops the `'null'` from an optional array/object type (`['array', 'null']` → `'array'`, likewise\n * `'object'`). Payload marks a field optional by unioning its type with `'null'`, but a create/update\n * tool already conveys \"optional\" through the `required` list - the client just omits the field - so the\n * `'null'` is redundant here. Dropping it shows the model a plain `type: 'array'` instead of implying it\n * should send a literal `null`.\n *\n * We never touch the `required` list, so this can't change whether a field is required. And we skip fields\n * that ARE required (`isRequired`): there a `'null'` is a value the field genuinely accepts, not optionality\n * encoding. Nullable scalars (`['string', 'null']`) are also left alone - they read fine as `string | null`.\n *\n * @example\n * optional { type: ['array', 'null'] } → { type: 'array' } (still optional, just no longer null-valued)\n * required { type: ['array', 'null'] } → unchanged\n * { type: ['string', 'null'] } → unchanged\n */\nconst collapseNullableType = (schema: JsonSchemaType, isRequired: boolean): void => {\n if (isRequired || !Array.isArray(schema.type)) {\n return\n }\n const nonNullTypes = schema.type.filter((t) => t !== 'null')\n if (nonNullTypes.length === 1 && (nonNullTypes[0] === 'array' || nonNullTypes[0] === 'object')) {\n schema.type = nonNullTypes[0]\n }\n}\n\n/**\n * **LLM ergonomics.** Rewrites a point field (stored as a two-number tuple) into a `{ longitude, latitude }` object, which\n * is far easier for the model to fill in than a positional array. This is input-only and lossless: the\n * create/update handler converts the object back to the `[longitude, latitude]` tuple Payload stores,\n * via `transformPointDataToPayload`.\n *\n * @example\n * { type: 'array', items: [{ type: 'number' }, { type: 'number' }] }\n * → { type: 'object', properties: { longitude: { type: 'number' }, latitude: { type: 'number' } }, required: ['longitude', 'latitude'] }\n */\nconst pointFieldsToObjects = (schema: JsonSchemaType): JsonSchemaType => {\n if (!schema || typeof schema !== 'object') {\n return schema\n }\n\n const transformed = { ...schema }\n\n if (transformed.properties && typeof transformed.properties === 'object') {\n transformed.properties = Object.fromEntries(\n Object.entries(transformed.properties).map(([key, value]) => {\n if (!value || typeof value !== 'object') {\n return [key, value]\n }\n const isArrayType =\n value.type === 'array' || (Array.isArray(value.type) && value.type.includes('array'))\n const isPointField =\n isArrayType &&\n Array.isArray(value.items) &&\n value.items.length === 2 &&\n value.items.every((item) => item && typeof item === 'object' && item.type === 'number')\n\n if (isPointField) {\n const isNullable = Array.isArray(value.type) && value.type.includes('null')\n return [\n key,\n {\n type: isNullable ? ['object', 'null'] : 'object',\n description: value.description || 'Geographic coordinates (longitude, latitude)',\n properties: {\n latitude: { type: 'number', description: 'Latitude coordinate' },\n longitude: { type: 'number', description: 'Longitude coordinate' },\n },\n required: ['longitude', 'latitude'],\n },\n ]\n }\n\n return [key, pointFieldsToObjects(value)]\n }),\n )\n }\n\n if (\n transformed.items &&\n typeof transformed.items === 'object' &&\n !Array.isArray(transformed.items)\n ) {\n transformed.items = pointFieldsToObjects(transformed.items)\n }\n\n return transformed\n}\n\n/**\n * **Size.** Strips type-generation leftovers that bloat the schema without helping the model: the `tsType`\n * hint (a `json-schema-to-typescript` extension; JSON Schema validators just ignore it, they don't reject it)\n * and the block-interface-collision note Payload adds to some block descriptions (the\n * `block-interface-name-collisions` docs link set in `registerBlockInterface`, see configToJSONSchema.ts).\n * Both are inert here - removing them only shrinks the schema (and spares the model irrelevant noise).\n *\n * @example\n * { type: 'object', tsType: 'SerializedBlockNode', description: 'see …#block-interface-name-collisions' }\n * → { type: 'object' }\n */\nconst removeTypeGenArtifacts = (schema: JsonSchemaType): JsonSchemaType =>\n mapNodes(schema, (node) => {\n delete (node as { tsType?: unknown }).tsType\n const { description } = node as { description?: string }\n if (\n typeof description === 'string' &&\n description.includes('block-interface-name-collisions')\n ) {\n delete (node as { description?: unknown }).description\n }\n return node\n }) as JsonSchemaType\n\n/**\n * **Size.** Removes `type` whenever a `const` sits next to it — the constant already fixes the value.\n *\n * @example\n * { type: 'string', const: 'paragraph' } → { const: 'paragraph' }\n */\nconst dropRedundantConstType = (schema: JsonSchemaType): JsonSchemaType =>\n mapNodes(schema, (node) => {\n if ('const' in node && 'type' in node) {\n delete (node as { type?: unknown }).type\n }\n return node\n }) as JsonSchemaType\n\n/**\n * **Size.** Merges the members of a `oneOf`/`anyOf` that are identical except for one `const`-valued property\n * into a single member with that property as an `enum`. Since the members differ only by that one\n * constant, the `enum` form accepts exactly the same values - it's just smaller. This folds the\n * per-collection relationship and upload variants, which differ only in their `relationTo` constant.\n *\n * @example\n * { oneOf: [\n * { properties: { relationTo: { const: 'posts' }, value: { type: 'string' } } },\n * { properties: { relationTo: { const: 'pages' }, value: { type: 'string' } } },\n * ] }\n * → { properties: { relationTo: { enum: ['posts', 'pages'] }, value: { type: 'string' } } }\n */\nconst mergeConstDiscriminatedUnions = (schema: JsonSchemaType): JsonSchemaType =>\n mapNodes(schema, (node) => {\n for (const keyword of ['oneOf', 'anyOf'] as const) {\n const members = node[keyword]\n if (Array.isArray(members) && members.length > 1) {\n const merged = mergeMembersByConst(members)\n if (merged) {\n delete node[keyword]\n Object.assign(node, merged)\n }\n }\n }\n return node\n }) as JsonSchemaType\n\n/** Returns the merged member for {@link mergeConstDiscriminatedUnions}, or `null` if they can't merge. */\nconst mergeMembersByConst = (members: Array<boolean | JsonSchemaType>): JsonSchemaType | null => {\n const objects = members.filter(\n (member): member is JsonSchemaType =>\n typeof member === 'object' && member !== null && typeof member.properties === 'object',\n )\n if (objects.length < 2 || objects.length !== members.length) {\n return null\n }\n\n for (const discriminator of Object.keys(objects[0]!.properties!)) {\n // Each member must pin this property to a `const`...\n const constValues: unknown[] = []\n const everyMemberPinsConst = objects.every((member) => {\n const prop = member.properties![discriminator]\n if (prop && typeof prop === 'object' && 'const' in prop) {\n constValues.push(prop.const)\n return true\n }\n return false\n })\n if (!everyMemberPinsConst) {\n continue\n }\n\n // ...and be otherwise identical (compare each member with the discriminator removed).\n const fingerprintWithoutDiscriminator = (member: JsonSchemaType): string => {\n const { [discriminator]: _discriminator, ...otherProperties } = member.properties!\n return JSON.stringify({ ...member, properties: otherProperties })\n }\n if (new Set(objects.map(fingerprintWithoutDiscriminator)).size !== 1) {\n continue\n }\n\n const uniqueConstValues = [...new Set(constValues)]\n if (uniqueConstValues.length < 2) {\n continue\n }\n\n // Replace the per-member `const` with a single `enum` of every value.\n const merged = structuredClone(objects[0]!)\n const discriminatorProp = merged.properties![discriminator]\n if (discriminatorProp && typeof discriminatorProp === 'object') {\n delete discriminatorProp.const\n discriminatorProp.enum = uniqueConstValues\n }\n return merged\n }\n return null\n}\n\n// A `$ref` costs ~30 characters once names are shortened, so sharing a subschema only pays off when\n// it's larger than that and appears more than once.\nconst MIN_SHARED_SIZE = 64\n\n/** A subschema worth sharing: a standalone object/union/described schema, not a `$ref` or a primitive. */\nconst isShareable = (node: unknown): node is Record<string, unknown> => {\n if (!node || typeof node !== 'object' || Array.isArray(node) || '$ref' in node) {\n return false\n }\n const schema = node as JsonSchemaType\n return (\n Array.isArray(schema.oneOf) ||\n Array.isArray(schema.anyOf) ||\n Boolean(schema.properties) ||\n Boolean(schema.items) ||\n typeof schema.description === 'string'\n )\n}\n\n/**\n * **Size.** Replaces any subschema that appears more than once with a single shared `$defs` entry referenced by\n * `$ref`. Lossless — only the serialized size shrinks. A collection with several rich-text fields, for\n * example, inlines the same large lexical node schema once per field; this collapses them into one.\n *\n * @example\n * { properties: { billing: address, shipping: address } }\n * → { properties: { billing: { $ref: '#/$defs/shared_0' }, shipping: { $ref: '#/$defs/shared_0' } }, $defs: { shared_0: address } }\n */\nconst deduplicateIntoDefinitions = (schema: JsonSchemaType): JsonSchemaType => {\n // Count how often each shareable subschema appears, keyed by its serialized form.\n const counts = new Map<string, number>()\n const count = (node: unknown): void => {\n if (isShareable(node)) {\n const key = JSON.stringify(node)\n if (key.length >= MIN_SHARED_SIZE) {\n counts.set(key, (counts.get(key) ?? 0) + 1)\n }\n }\n if (Array.isArray(node)) {\n node.forEach(count)\n } else if (node && typeof node === 'object') {\n Object.values(node).forEach(count)\n }\n }\n count(schema)\n\n if (![...counts.values()].some((n) => n >= 2)) {\n return schema\n }\n\n // Replace each subschema seen 2+ times with a `$ref`. The first time we meet one it becomes a shared\n // entry; we never descend into a stored entry, so shared entries never reference one another.\n const sharedEntries: Record<string, JsonSchemaType> = {}\n const nameByKey = new Map<string, string>()\n const share = (node: unknown): unknown => {\n if (isShareable(node)) {\n const key = JSON.stringify(node)\n if ((counts.get(key) ?? 0) >= 2) {\n let name = nameByKey.get(key)\n if (!name) {\n name = `shared_${nameByKey.size}`\n nameByKey.set(key, name)\n sharedEntries[name] = node\n }\n return { $ref: `#/$defs/${name}` }\n }\n }\n if (Array.isArray(node)) {\n return node.map(share)\n }\n if (node && typeof node === 'object') {\n return Object.fromEntries(\n Object.entries(node).map(([childKey, value]) => [childKey, share(value)]),\n )\n }\n return node\n }\n\n const result = share(schema) as JsonSchemaType\n result.$defs = { ...result.$defs, ...sharedEntries }\n return result\n}\n\n/**\n * **LLM ergonomics.** Renames `$defs` entries to short, readable names so the `$ref`s stay legible to the model: a block's\n * `blockType` (`Code`), a node's `type` (`paragraph`), `node` for a rich-text node union, otherwise the\n * generated name with its disambiguating hash dropped. A numeric suffix keeps collisions unique.\n *\n * @example\n * { properties: { body: { $ref: '#/$defs/LexicalNodes_9FBEC708' } }, $defs: { LexicalNodes_9FBEC708: {} } }\n * → { properties: { body: { $ref: '#/$defs/node' } }, $defs: { node: {} } }\n */\nconst shortenDefinitionNames = (schema: JsonSchemaType): JsonSchemaType => {\n const definitions = schema.$defs\n if (!definitions || Object.keys(definitions).length === 0) {\n return schema\n }\n\n const shortNameFor = (name: string, definition: boolean | JsonSchemaType): string => {\n const properties = (typeof definition === 'object' && definition.properties) || {}\n const constString = (key: string): string | undefined => {\n const prop = properties[key]\n return prop && typeof prop === 'object' && typeof prop.const === 'string'\n ? prop.const\n : undefined\n }\n const members =\n typeof definition === 'object' ? (definition.anyOf ?? definition.oneOf) : undefined\n const isNodeUnion =\n Array.isArray(members) &&\n members.some((m) => typeof m === 'object' && Boolean(m.$ref || m.properties?.type))\n return (\n constString('blockType') ??\n constString('type') ??\n (isNodeUnion ? 'node' : undefined) ??\n name.replace(/_[0-9A-F]{6,}$/i, '')\n )\n }\n\n const prefix = '#/$defs/'\n const usedNames = new Map<string, number>()\n const rename = new Map<string, string>()\n for (const [name, definition] of Object.entries(definitions)) {\n const shortName = shortNameFor(name, definition)\n const used = usedNames.get(shortName) ?? 0\n usedNames.set(shortName, used + 1)\n rename.set(name, used === 0 ? shortName : `${shortName}${used + 1}`)\n }\n\n const result = mapNodes(schema, (node) => {\n if (typeof node.$ref === 'string' && node.$ref.startsWith(prefix)) {\n const name = node.$ref.slice(prefix.length)\n node.$ref = `${prefix}${rename.get(name) ?? name}`\n }\n return node\n }) as JsonSchemaType\n result.$defs = Object.fromEntries(\n Object.entries(result.$defs!).map(([name, body]) => [rename.get(name) ?? name, body]),\n )\n return result\n}\n"],"names":["sanitizeEntitySchema","schema","result","structuredClone","collapseOptionalContainerTypes","pointFieldsToObjects","removeTypeGenArtifacts","dropRedundantConstType","mergeConstDiscriminatedUnions","deduplicateIntoDefinitions","shortenDefinitionNames","mapNodes","node","visit","Array","isArray","map","child","out","key","value","Object","entries","properties","keys","prop","isRequired","required","includes","collapseNullableType","items","type","nonNullTypes","filter","t","length","transformed","fromEntries","isArrayType","isPointField","every","item","isNullable","description","latitude","longitude","tsType","keyword","members","merged","mergeMembersByConst","assign","objects","member","discriminator","constValues","everyMemberPinsConst","push","const","fingerprintWithoutDiscriminator","_discriminator","otherProperties","JSON","stringify","Set","size","uniqueConstValues","discriminatorProp","enum","MIN_SHARED_SIZE","isShareable","oneOf","anyOf","Boolean","counts","Map","count","set","get","forEach","values","some","n","sharedEntries","nameByKey","share","name","$ref","childKey","$defs","definitions","shortNameFor","definition","constString","undefined","isNodeUnion","m","replace","prefix","usedNames","rename","shortName","used","startsWith","slice","body"],"mappings":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type EntityInputSchema = {
|
|
2
|
+
$defs?: Record<string, boolean | EntityInputSchema>;
|
|
3
|
+
$ref?: string;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
additionalProperties?: boolean | EntityInputSchema;
|
|
6
|
+
anyOf?: Array<boolean | EntityInputSchema>;
|
|
7
|
+
const?: unknown;
|
|
8
|
+
description?: string;
|
|
9
|
+
enum?: unknown[];
|
|
10
|
+
items?: EntityInputSchema | EntityInputSchema[];
|
|
11
|
+
oneOf?: Array<boolean | EntityInputSchema>;
|
|
12
|
+
properties?: Record<string, EntityInputSchema>;
|
|
13
|
+
required?: string[];
|
|
14
|
+
type?: string | string[];
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utilities/entityInputSchema/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,iBAAiB,CAAC,CAAA;IACnD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,oBAAoB,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAA;IAClD,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,iBAAiB,CAAC,CAAA;IAC1C,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAA;IAChB,KAAK,CAAC,EAAE,iBAAiB,GAAG,iBAAiB,EAAE,CAAA;IAC/C,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,iBAAiB,CAAC,CAAA;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IAC9C,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CACzB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utilities/entityInputSchema/types.ts"],"sourcesContent":["export type EntityInputSchema = {\n $defs?: Record<string, boolean | EntityInputSchema>\n $ref?: string\n [key: string]: unknown\n additionalProperties?: boolean | EntityInputSchema\n anyOf?: Array<boolean | EntityInputSchema>\n const?: unknown\n description?: string\n enum?: unknown[]\n items?: EntityInputSchema | EntityInputSchema[]\n oneOf?: Array<boolean | EntityInputSchema>\n properties?: Record<string, EntityInputSchema>\n required?: string[]\n type?: string | string[]\n}\n"],"names":[],"mappings":"AAAA,WAcC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CollectionSlug, GlobalSlug, PayloadRequest } from '../../index.js';
|
|
2
|
+
export declare const validateCollectionData: ({ slug, data, partial, req, }: {
|
|
3
|
+
data: Record<string, unknown>;
|
|
4
|
+
partial?: boolean;
|
|
5
|
+
req: PayloadRequest;
|
|
6
|
+
slug: CollectionSlug;
|
|
7
|
+
}) => void;
|
|
8
|
+
export declare const validateGlobalData: ({ slug, data, req, }: {
|
|
9
|
+
data: Record<string, unknown>;
|
|
10
|
+
req: PayloadRequest;
|
|
11
|
+
slug: GlobalSlug;
|
|
12
|
+
}) => void;
|
|
13
|
+
//# sourceMappingURL=validateEntityData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateEntityData.d.ts","sourceRoot":"","sources":["../../../src/utilities/entityInputSchema/validateEntityData.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAMhF,eAAO,MAAM,sBAAsB,kCAKhC;IACD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,GAAG,EAAE,cAAc,CAAA;IACnB,IAAI,EAAE,cAAc,CAAA;CACrB,KAAG,IAIH,CAAA;AAED,eAAO,MAAM,kBAAkB,yBAI5B;IACD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,GAAG,EAAE,cAAc,CAAA;IACnB,IAAI,EAAE,UAAU,CAAA;CACjB,KAAG,IAIH,CAAA"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { fromJSONSchema } from 'zod';
|
|
2
|
+
import { ValidationError } from '../../errors/ValidationError.js';
|
|
3
|
+
import { getCollectionInputSchema, getGlobalInputSchema } from './getEntityInputSchema.js';
|
|
4
|
+
export const validateCollectionData = ({ slug, data, partial, req })=>{
|
|
5
|
+
const schema = getCollectionInputSchema({
|
|
6
|
+
collectionSlug: slug,
|
|
7
|
+
req
|
|
8
|
+
});
|
|
9
|
+
validateEntityData({
|
|
10
|
+
slug,
|
|
11
|
+
data,
|
|
12
|
+
entity: 'collection',
|
|
13
|
+
partial,
|
|
14
|
+
req,
|
|
15
|
+
schema
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
export const validateGlobalData = ({ slug, data, req })=>{
|
|
19
|
+
const schema = getGlobalInputSchema({
|
|
20
|
+
globalSlug: slug,
|
|
21
|
+
req
|
|
22
|
+
});
|
|
23
|
+
validateEntityData({
|
|
24
|
+
slug,
|
|
25
|
+
data,
|
|
26
|
+
entity: 'global',
|
|
27
|
+
partial: true,
|
|
28
|
+
req,
|
|
29
|
+
schema
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
const validateEntityData = ({ slug, data, entity, partial, req, schema })=>{
|
|
33
|
+
if (!schema) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const validationSchema = partial ? withoutRequired(schema) : schema;
|
|
37
|
+
const result = fromJSONSchema(validationSchema).safeParse(data);
|
|
38
|
+
if (result.success) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
throw new ValidationError({
|
|
42
|
+
[entity]: slug,
|
|
43
|
+
errors: getUsefulIssues(result.error.issues).map(({ message, path })=>({
|
|
44
|
+
message,
|
|
45
|
+
path: formatDataPath(path)
|
|
46
|
+
})),
|
|
47
|
+
req
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
/** Updates and drafts accept partial data, including partial nested objects and array rows. */ const withoutRequired = (schema)=>{
|
|
51
|
+
const { $defs, additionalProperties, anyOf, items, oneOf, properties, required: _required, ...partialSchema } = schema;
|
|
52
|
+
return {
|
|
53
|
+
...partialSchema,
|
|
54
|
+
...$defs ? {
|
|
55
|
+
$defs: mapSchemaRecord($defs)
|
|
56
|
+
} : {},
|
|
57
|
+
...typeof additionalProperties === 'object' ? {
|
|
58
|
+
additionalProperties: withoutRequired(additionalProperties)
|
|
59
|
+
} : additionalProperties !== undefined ? {
|
|
60
|
+
additionalProperties
|
|
61
|
+
} : {},
|
|
62
|
+
...anyOf ? {
|
|
63
|
+
anyOf: anyOf.map(makeSchemaPartial)
|
|
64
|
+
} : {},
|
|
65
|
+
...items ? {
|
|
66
|
+
items: Array.isArray(items) ? items.map((item)=>withoutRequired(item)) : withoutRequired(items)
|
|
67
|
+
} : {},
|
|
68
|
+
...oneOf ? {
|
|
69
|
+
oneOf: oneOf.map(makeSchemaPartial)
|
|
70
|
+
} : {},
|
|
71
|
+
...properties ? {
|
|
72
|
+
properties: mapSchemaRecord(properties)
|
|
73
|
+
} : {}
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
const makeSchemaPartial = (schema)=>typeof schema === 'boolean' ? schema : withoutRequired(schema);
|
|
77
|
+
const mapSchemaRecord = (schemas)=>Object.fromEntries(Object.entries(schemas).map(([name, schema])=>[
|
|
78
|
+
name,
|
|
79
|
+
makeSchemaPartial(schema)
|
|
80
|
+
]));
|
|
81
|
+
/**
|
|
82
|
+
* Zod keeps every failed recursive-union branch. Select the closest matching branch instead of
|
|
83
|
+
* returning a very large error tree to CLI and MCP clients.
|
|
84
|
+
*/ const getUsefulIssues = (issues, parentPath = [])=>{
|
|
85
|
+
const selectedIssues = issues.flatMap((issue)=>{
|
|
86
|
+
if (issue.code !== 'invalid_union') {
|
|
87
|
+
return [
|
|
88
|
+
{
|
|
89
|
+
...issue,
|
|
90
|
+
path: [
|
|
91
|
+
...parentPath,
|
|
92
|
+
...issue.path
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
];
|
|
96
|
+
}
|
|
97
|
+
const unionPath = [
|
|
98
|
+
...parentPath,
|
|
99
|
+
...issue.path
|
|
100
|
+
];
|
|
101
|
+
const closestBranch = issue.errors.filter((branch)=>branch.length > 0).sort(compareIssueBranches)[0];
|
|
102
|
+
return closestBranch ? getUsefulIssues(closestBranch, unionPath) : [
|
|
103
|
+
{
|
|
104
|
+
...issue,
|
|
105
|
+
path: unionPath
|
|
106
|
+
}
|
|
107
|
+
];
|
|
108
|
+
});
|
|
109
|
+
const uniqueIssues = new Map();
|
|
110
|
+
for (const issue of selectedIssues){
|
|
111
|
+
const key = `${issue.path.map(String).join('.')}:${issue.message}`;
|
|
112
|
+
if (!uniqueIssues.has(key)) {
|
|
113
|
+
uniqueIssues.set(key, issue);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return [
|
|
117
|
+
...uniqueIssues.values()
|
|
118
|
+
].slice(0, 10);
|
|
119
|
+
};
|
|
120
|
+
const compareIssueBranches = (left, right)=>{
|
|
121
|
+
const discriminatorDifference = countDiscriminatorIssues(left) - countDiscriminatorIssues(right);
|
|
122
|
+
if (discriminatorDifference !== 0) {
|
|
123
|
+
return discriminatorDifference;
|
|
124
|
+
}
|
|
125
|
+
const pathDepthDifference = getDeepestPath(right) - getDeepestPath(left);
|
|
126
|
+
if (pathDepthDifference !== 0) {
|
|
127
|
+
return pathDepthDifference;
|
|
128
|
+
}
|
|
129
|
+
return left.length - right.length;
|
|
130
|
+
};
|
|
131
|
+
const countDiscriminatorIssues = (issues)=>issues.filter((issue)=>{
|
|
132
|
+
const field = issue.path.at(-1);
|
|
133
|
+
return field === 'blockType' || field === 'relationTo' || field === 'type';
|
|
134
|
+
}).length;
|
|
135
|
+
const getDeepestPath = (issues)=>Math.max(0, ...issues.map((issue)=>issue.path.length));
|
|
136
|
+
const formatDataPath = (path)=>path.reduce((result, segment)=>typeof segment === 'number' ? `${result}[${segment}]` : `${result}.${String(segment)}`, 'data');
|
|
137
|
+
|
|
138
|
+
//# sourceMappingURL=validateEntityData.js.map
|