payload 4.0.0-internal.5b1e7cd → 4.0.0-internal.5f0cd13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/RichText.d.ts +3 -16
- package/dist/admin/RichText.d.ts.map +1 -1
- package/dist/admin/RichText.js.map +1 -1
- package/dist/admin/adapters/cookies.d.ts +21 -0
- package/dist/admin/adapters/cookies.d.ts.map +1 -0
- package/dist/admin/adapters/cookies.js +3 -0
- package/dist/admin/adapters/cookies.js.map +1 -0
- package/dist/admin/adapters/index.d.ts +4 -0
- package/dist/admin/adapters/index.d.ts.map +1 -0
- package/dist/admin/adapters/index.js +3 -0
- package/dist/admin/adapters/index.js.map +1 -0
- package/dist/admin/adapters/router.d.ts +56 -0
- package/dist/admin/adapters/router.d.ts.map +1 -0
- package/dist/admin/adapters/router.js +3 -0
- package/dist/admin/adapters/router.js.map +1 -0
- package/dist/admin/adapters/server.d.ts +23 -0
- package/dist/admin/adapters/server.d.ts.map +1 -0
- package/dist/admin/adapters/server.js +6 -0
- package/dist/admin/adapters/server.js.map +1 -0
- package/dist/admin/elements/Nav.d.ts +13 -0
- package/dist/admin/elements/Nav.d.ts.map +1 -1
- package/dist/admin/elements/Nav.js.map +1 -1
- package/dist/admin/elements/Table.d.ts +1 -0
- package/dist/admin/elements/Table.d.ts.map +1 -1
- package/dist/admin/elements/Table.js.map +1 -1
- package/dist/admin/functions/index.d.ts +1 -38
- package/dist/admin/functions/index.d.ts.map +1 -1
- package/dist/admin/functions/index.js.map +1 -1
- package/dist/admin/types.d.ts +5 -4
- package/dist/admin/types.d.ts.map +1 -1
- package/dist/admin/types.js.map +1 -1
- package/dist/admin/views/hierarchyList.d.ts +10 -0
- package/dist/admin/views/hierarchyList.d.ts.map +1 -0
- package/dist/admin/views/hierarchyList.js +3 -0
- package/dist/admin/views/hierarchyList.js.map +1 -0
- package/dist/admin/views/index.d.ts +1 -3
- package/dist/admin/views/index.d.ts.map +1 -1
- package/dist/admin/views/index.js.map +1 -1
- package/dist/admin/views/list.d.ts +47 -2
- package/dist/admin/views/list.d.ts.map +1 -1
- package/dist/admin/views/list.js.map +1 -1
- package/dist/auth/cookies.d.ts.map +1 -1
- package/dist/auth/defaultAccess.d.ts.map +1 -1
- package/dist/auth/ensureUsernameOrEmail.d.ts.map +1 -1
- package/dist/auth/executeAccess.d.ts.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.map +1 -1
- package/dist/auth/getAuthFields.d.ts.map +1 -1
- package/dist/auth/getFieldsToSign.d.ts.map +1 -1
- package/dist/auth/getLoginOptions.d.ts.map +1 -1
- package/dist/auth/isUserLocked.d.ts.map +1 -1
- package/dist/auth/jwt.d.ts.map +1 -1
- package/dist/auth/operations/access.d.ts.map +1 -1
- package/dist/auth/operations/auth.d.ts.map +1 -1
- package/dist/auth/operations/forgotPassword.d.ts.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/login.d.ts.map +1 -1
- package/dist/auth/operations/logout.d.ts.map +1 -1
- package/dist/auth/operations/me.d.ts.map +1 -1
- package/dist/auth/operations/refresh.d.ts.map +1 -1
- package/dist/auth/operations/registerFirstUser.d.ts.map +1 -1
- package/dist/auth/operations/resetPassword.d.ts.map +1 -1
- package/dist/auth/operations/unlock.d.ts.map +1 -1
- package/dist/auth/operations/verifyEmail.d.ts.map +1 -1
- package/dist/auth/sessions.d.ts.map +1 -1
- package/dist/auth/strategies/apiKey.d.ts.map +1 -1
- package/dist/auth/strategies/apiKey.js +6 -17
- package/dist/auth/strategies/apiKey.js.map +1 -1
- package/dist/auth/strategies/local/authenticate.d.ts.map +1 -1
- package/dist/auth/strategies/local/generatePasswordSaltHash.d.ts.map +1 -1
- package/dist/auth/strategies/local/incrementLoginAttempts.d.ts.map +1 -1
- package/dist/auth/strategies/local/register.d.ts.map +1 -1
- package/dist/auth/strategies/local/resetLoginAttempts.d.ts.map +1 -1
- package/dist/bin/generateImportMap/iterateCollections.d.ts.map +1 -1
- package/dist/bin/generateImportMap/iterateCollections.js +1 -0
- package/dist/bin/generateImportMap/iterateCollections.js.map +1 -1
- package/dist/bin/generateImportMap/iterateConfig.d.ts.map +1 -1
- package/dist/bin/generateImportMap/iterateConfig.js +7 -0
- package/dist/bin/generateImportMap/iterateConfig.js.map +1 -1
- package/dist/bin/generateImportMap/iterateFields.d.ts.map +1 -1
- package/dist/bin/generateImportMap/iterateFields.js +4 -1
- package/dist/bin/generateImportMap/iterateFields.js.map +1 -1
- package/dist/bin/generateImportMap/iterateGlobals.d.ts.map +1 -1
- package/dist/bin/generateImportMap/iterateGlobals.js +20 -8
- package/dist/bin/generateImportMap/iterateGlobals.js.map +1 -1
- package/dist/bin/generateImportMap/utilities/getFromImportMap.d.ts.map +1 -1
- package/dist/bin/generateTypes.d.ts.map +1 -1
- package/dist/bin/generateTypes.js +7 -1
- package/dist/bin/generateTypes.js.map +1 -1
- package/dist/bin/index.d.ts.map +1 -1
- package/dist/bin/index.js +1 -3
- package/dist/bin/index.js.map +1 -1
- package/dist/bin/migrate.d.ts.map +1 -1
- package/dist/collections/config/client.d.ts +4 -2
- package/dist/collections/config/client.d.ts.map +1 -1
- package/dist/collections/config/client.js +13 -1
- package/dist/collections/config/client.js.map +1 -1
- package/dist/collections/config/defaults.d.ts.map +1 -1
- package/dist/collections/config/defaults.js +1 -1
- package/dist/collections/config/defaults.js.map +1 -1
- package/dist/collections/config/sanitize.d.ts +10 -1
- package/dist/collections/config/sanitize.d.ts.map +1 -1
- package/dist/collections/config/sanitize.js +51 -10
- 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 -91
- 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.map +1 -1
- package/dist/collections/operations/count.d.ts.map +1 -1
- package/dist/collections/operations/countVersions.d.ts.map +1 -1
- package/dist/collections/operations/create.d.ts.map +1 -1
- package/dist/collections/operations/create.js +24 -19
- 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 +7 -2
- 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 +7 -2
- package/dist/collections/operations/deleteByID.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 +7 -2
- 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 +10 -5
- package/dist/collections/operations/findByID.js.map +1 -1
- package/dist/collections/operations/findDistinct.d.ts.map +1 -1
- package/dist/collections/operations/findVersionByID.d.ts.map +1 -1
- package/dist/collections/operations/findVersionByID.js +6 -4
- 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 +6 -4
- package/dist/collections/operations/findVersions.js.map +1 -1
- package/dist/collections/operations/restoreVersion.d.ts.map +1 -1
- package/dist/collections/operations/restoreVersion.js +7 -2
- 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 +7 -2
- 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 +7 -2
- package/dist/collections/operations/updateByID.js.map +1 -1
- package/dist/collections/operations/utilities/buildAfterOperation.d.ts.map +1 -1
- package/dist/collections/operations/utilities/sanitizeSortQuery.d.ts.map +1 -1
- package/dist/collections/operations/utilities/update.d.ts.map +1 -1
- package/dist/collections/operations/utilities/update.js +5 -4
- package/dist/collections/operations/utilities/update.js.map +1 -1
- package/dist/config/build.d.ts.map +1 -1
- package/dist/config/build.js +8 -0
- package/dist/config/build.js.map +1 -1
- package/dist/config/client.d.ts +1 -1
- package/dist/config/client.d.ts.map +1 -1
- package/dist/config/client.js +2 -11
- package/dist/config/client.js.map +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +0 -15
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/orderable/index.d.ts.map +1 -1
- package/dist/config/orderable/index.js +0 -4
- package/dist/config/orderable/index.js.map +1 -1
- package/dist/config/sanitize.d.ts.map +1 -1
- package/dist/config/sanitize.js +6 -53
- package/dist/config/sanitize.js.map +1 -1
- package/dist/config/types.d.ts +188 -32
- 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/migrations/findMigrationDir.d.ts.map +1 -1
- package/dist/database/migrations/getPredefinedMigration.d.ts.map +1 -1
- package/dist/database/migrations/readMigrationFiles.d.ts.map +1 -1
- package/dist/database/migrations/templates/localizeStatus.d.ts.map +1 -1
- package/dist/database/migrations/writeMigrationIndex.d.ts.map +1 -1
- package/dist/database/sanitizeJoinQuery.d.ts.map +1 -1
- package/dist/database/sanitizeWhereQuery.d.ts.map +1 -1
- package/dist/duplicateDocument/index.d.ts.map +1 -1
- package/dist/email/getStringifiedToAddress.d.ts.map +1 -1
- package/dist/exports/shared.d.ts +6 -3
- package/dist/exports/shared.d.ts.map +1 -1
- package/dist/exports/shared.js +4 -2
- package/dist/exports/shared.js.map +1 -1
- package/dist/fields/baseFields/slug/countVersions.d.ts.map +1 -1
- package/dist/fields/baseFields/slug/generateSlug.d.ts.map +1 -1
- package/dist/fields/baseFields/slug/index.d.ts.map +1 -1
- package/dist/fields/baseFields/slug/index.js +7 -5
- package/dist/fields/baseFields/slug/index.js.map +1 -1
- package/dist/fields/config/client.d.ts +1 -1
- package/dist/fields/config/client.d.ts.map +1 -1
- package/dist/fields/config/client.js +4 -3
- package/dist/fields/config/client.js.map +1 -1
- package/dist/fields/config/sanitize.d.ts.map +1 -1
- package/dist/fields/config/sanitize.js +13 -20
- package/dist/fields/config/sanitize.js.map +1 -1
- package/dist/fields/config/sanitizeJoinField.d.ts.map +1 -1
- package/dist/fields/config/sanitizeJoinField.js +3 -0
- package/dist/fields/config/sanitizeJoinField.js.map +1 -1
- package/dist/fields/config/types.d.ts +44 -118
- package/dist/fields/config/types.d.ts.map +1 -1
- package/dist/fields/config/types.js +12 -2
- 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/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.map +1 -1
- package/dist/fields/hooks/beforeChange/promise.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/traverseFields.d.ts.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/traverseFields.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/index.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/promise.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/traverseFields.d.ts.map +1 -1
- package/dist/fields/isFieldDisabled.d.ts +12 -0
- package/dist/fields/isFieldDisabled.d.ts.map +1 -0
- package/dist/fields/isFieldDisabled.js +15 -0
- package/dist/fields/isFieldDisabled.js.map +1 -0
- package/dist/fields/isFieldDisabled.spec.js +134 -0
- package/dist/fields/isFieldDisabled.spec.js.map +1 -0
- package/dist/fields/mergeBaseFields.d.ts.map +1 -1
- package/dist/fields/setDefaultBeforeDuplicate.d.ts.map +1 -1
- package/dist/fields/validations.js +1 -1
- package/dist/fields/validations.js.map +1 -1
- package/dist/globals/config/client.d.ts +1 -1
- package/dist/globals/config/client.d.ts.map +1 -1
- package/dist/globals/config/client.js +2 -1
- package/dist/globals/config/client.js.map +1 -1
- package/dist/globals/config/sanitize.d.ts +6 -1
- package/dist/globals/config/sanitize.d.ts.map +1 -1
- package/dist/globals/config/sanitize.js +6 -2
- package/dist/globals/config/sanitize.js.map +1 -1
- package/dist/globals/config/types.d.ts +4 -57
- 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/docAccess.d.ts.map +1 -1
- package/dist/globals/operations/findOne.d.ts.map +1 -1
- package/dist/globals/operations/findOne.js +7 -2
- 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 +6 -4
- 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 +6 -4
- package/dist/globals/operations/findVersions.js.map +1 -1
- package/dist/globals/operations/restoreVersion.d.ts.map +1 -1
- package/dist/globals/operations/update.d.ts.map +1 -1
- package/dist/globals/operations/update.js +7 -2
- package/dist/globals/operations/update.js.map +1 -1
- package/dist/hierarchy/addHierarchyToCollection.d.ts +9 -0
- package/dist/hierarchy/addHierarchyToCollection.d.ts.map +1 -0
- package/dist/hierarchy/addHierarchyToCollection.js +76 -0
- package/dist/hierarchy/addHierarchyToCollection.js.map +1 -0
- package/dist/hierarchy/buildParentField.d.ts +11 -0
- package/dist/hierarchy/buildParentField.d.ts.map +1 -0
- package/dist/hierarchy/buildParentField.js +42 -0
- package/dist/hierarchy/buildParentField.js.map +1 -0
- package/dist/hierarchy/constants.d.ts +15 -0
- package/dist/hierarchy/constants.d.ts.map +1 -0
- package/dist/hierarchy/constants.js +11 -0
- package/dist/hierarchy/constants.js.map +1 -0
- package/dist/hierarchy/createFolderField.d.ts +39 -0
- package/dist/hierarchy/createFolderField.d.ts.map +1 -0
- package/dist/hierarchy/createFolderField.js +54 -0
- package/dist/hierarchy/createFolderField.js.map +1 -0
- package/dist/hierarchy/createTagField.d.ts +44 -0
- package/dist/hierarchy/createTagField.d.ts.map +1 -0
- package/dist/hierarchy/createTagField.js +48 -0
- package/dist/hierarchy/createTagField.js.map +1 -0
- package/dist/hierarchy/getInitialTreeData.d.ts +27 -0
- package/dist/hierarchy/getInitialTreeData.d.ts.map +1 -0
- package/dist/hierarchy/getInitialTreeData.js +125 -0
- package/dist/hierarchy/getInitialTreeData.js.map +1 -0
- package/dist/hierarchy/hooks/collectionAfterDelete.d.ts +14 -0
- package/dist/hierarchy/hooks/collectionAfterDelete.d.ts.map +1 -0
- package/dist/hierarchy/hooks/collectionAfterDelete.js +21 -0
- package/dist/hierarchy/hooks/collectionAfterDelete.js.map +1 -0
- package/dist/hierarchy/hooks/collectionAfterRead.d.ts +27 -0
- package/dist/hierarchy/hooks/collectionAfterRead.d.ts.map +1 -0
- package/dist/hierarchy/hooks/collectionAfterRead.js +72 -0
- package/dist/hierarchy/hooks/collectionAfterRead.js.map +1 -0
- package/dist/hierarchy/hooks/collectionBeforeChange.d.ts +19 -0
- package/dist/hierarchy/hooks/collectionBeforeChange.d.ts.map +1 -0
- package/dist/hierarchy/hooks/collectionBeforeChange.js +90 -0
- package/dist/hierarchy/hooks/collectionBeforeChange.js.map +1 -0
- package/dist/hierarchy/hooks/collectionBeforeDelete.d.ts +15 -0
- package/dist/hierarchy/hooks/collectionBeforeDelete.d.ts.map +1 -0
- package/dist/hierarchy/hooks/collectionBeforeDelete.js +20 -0
- package/dist/hierarchy/hooks/collectionBeforeDelete.js.map +1 -0
- package/dist/hierarchy/hooks/collectionBeforeOperation.d.ts +33 -0
- package/dist/hierarchy/hooks/collectionBeforeOperation.d.ts.map +1 -0
- package/dist/hierarchy/hooks/collectionBeforeOperation.js +66 -0
- package/dist/hierarchy/hooks/collectionBeforeOperation.js.map +1 -0
- package/dist/hierarchy/hooks/ensureSafeCollectionsChange.d.ts +8 -0
- package/dist/hierarchy/hooks/ensureSafeCollectionsChange.d.ts.map +1 -0
- package/dist/hierarchy/hooks/ensureSafeCollectionsChange.js +108 -0
- package/dist/hierarchy/hooks/ensureSafeCollectionsChange.js.map +1 -0
- package/dist/hierarchy/injectHierarchyButton.d.ts +14 -0
- package/dist/hierarchy/injectHierarchyButton.d.ts.map +1 -0
- package/dist/hierarchy/injectHierarchyButton.js +37 -0
- package/dist/hierarchy/injectHierarchyButton.js.map +1 -0
- package/dist/hierarchy/presets.d.ts +13 -0
- package/dist/hierarchy/presets.d.ts.map +1 -0
- package/dist/hierarchy/presets.js +52 -0
- package/dist/hierarchy/presets.js.map +1 -0
- package/dist/hierarchy/resolveHierarchyCollections.d.ts +23 -0
- package/dist/hierarchy/resolveHierarchyCollections.d.ts.map +1 -0
- package/dist/hierarchy/resolveHierarchyCollections.js +321 -0
- package/dist/hierarchy/resolveHierarchyCollections.js.map +1 -0
- package/dist/hierarchy/sanitizeHierarchyCollection.d.ts +14 -0
- package/dist/hierarchy/sanitizeHierarchyCollection.d.ts.map +1 -0
- package/dist/hierarchy/sanitizeHierarchyCollection.js +119 -0
- package/dist/hierarchy/sanitizeHierarchyCollection.js.map +1 -0
- package/dist/hierarchy/types.d.ts +162 -0
- package/dist/hierarchy/types.d.ts.map +1 -0
- package/dist/hierarchy/types.js +6 -0
- package/dist/hierarchy/types.js.map +1 -0
- package/dist/hierarchy/utils/buildLocalizedHierarchyPaths.d.ts +77 -0
- package/dist/hierarchy/utils/buildLocalizedHierarchyPaths.d.ts.map +1 -0
- package/dist/hierarchy/utils/buildLocalizedHierarchyPaths.js +77 -0
- package/dist/hierarchy/utils/buildLocalizedHierarchyPaths.js.map +1 -0
- package/dist/hierarchy/utils/computePaths.d.ts +31 -0
- package/dist/hierarchy/utils/computePaths.d.ts.map +1 -0
- package/dist/hierarchy/utils/computePaths.js +445 -0
- package/dist/hierarchy/utils/computePaths.js.map +1 -0
- package/dist/hierarchy/utils/findUseAsTitle.d.ts +14 -0
- package/dist/hierarchy/utils/findUseAsTitle.d.ts.map +1 -0
- package/dist/hierarchy/utils/findUseAsTitle.js +89 -0
- package/dist/hierarchy/utils/findUseAsTitle.js.map +1 -0
- package/dist/hierarchy/utils/getAncestors.d.ts +34 -0
- package/dist/hierarchy/utils/getAncestors.d.ts.map +1 -0
- package/dist/hierarchy/utils/getAncestors.js +94 -0
- package/dist/hierarchy/utils/getAncestors.js.map +1 -0
- package/dist/hierarchy/utils/getLocalizedValue.d.ts +30 -0
- package/dist/hierarchy/utils/getLocalizedValue.d.ts.map +1 -0
- package/dist/hierarchy/utils/getLocalizedValue.js +46 -0
- package/dist/hierarchy/utils/getLocalizedValue.js.map +1 -0
- package/dist/hierarchy/utils/getLocalizedValue.spec.js +250 -0
- package/dist/hierarchy/utils/getLocalizedValue.spec.js.map +1 -0
- package/dist/index.bundled.d.ts +1017 -672
- package/dist/index.d.ts +32 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -8
- package/dist/index.js.map +1 -1
- package/dist/kv/adapters/DatabaseKVAdapter.d.ts.map +1 -1
- package/dist/locked-documents/config.d.ts.map +1 -1
- package/dist/preferences/config.d.ts.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 +7 -4
- package/dist/preferences/keys.js.map +1 -1
- package/dist/preferences/types.d.ts +1 -1
- package/dist/preferences/types.d.ts.map +1 -1
- package/dist/preferences/types.js.map +1 -1
- package/dist/query-presets/access.d.ts.map +1 -1
- package/dist/query-presets/config.d.ts.map +1 -1
- package/dist/query-presets/config.js +11 -7
- 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/queues/config/generateJobsJSONSchemas.d.ts +1 -1
- package/dist/queues/config/generateJobsJSONSchemas.d.ts.map +1 -1
- package/dist/queues/config/generateJobsJSONSchemas.js +31 -10
- package/dist/queues/config/generateJobsJSONSchemas.js.map +1 -1
- package/dist/queues/config/types/index.d.ts +0 -21
- 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 +0 -20
- package/dist/queues/config/types/taskTypes.d.ts.map +1 -1
- package/dist/queues/config/types/taskTypes.js.map +1 -1
- package/dist/queues/endpoints/run.d.ts.map +1 -1
- package/dist/queues/errors/handleWorkflowError.d.ts.map +1 -1
- package/dist/queues/errors/handleWorkflowError.js +9 -1
- package/dist/queues/errors/handleWorkflowError.js.map +1 -1
- package/dist/queues/localAPI.d.ts.map +1 -1
- package/dist/queues/localAPI.js +26 -67
- package/dist/queues/localAPI.js.map +1 -1
- package/dist/queues/operations/handleSchedules/getQueuesWithSchedules.d.ts.map +1 -1
- package/dist/queues/operations/handleSchedules/index.d.ts.map +1 -1
- package/dist/queues/operations/handleSchedules/index.js +1 -4
- package/dist/queues/operations/handleSchedules/index.js.map +1 -1
- package/dist/queues/operations/runJobs/index.d.ts.map +1 -1
- package/dist/queues/operations/runJobs/index.js +40 -37
- 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/runJob/getRunTaskFunction.d.ts.map +1 -1
- package/dist/queues/operations/runJobs/runJob/getRunTaskFunction.js +3 -22
- package/dist/queues/operations/runJobs/runJob/getRunTaskFunction.js.map +1 -1
- package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.d.ts.map +1 -1
- package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.js +0 -2
- package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.js.map +1 -1
- package/dist/queues/operations/runJobs/runJob/index.d.ts.map +1 -1
- package/dist/queues/utilities/getJobTaskStatus.d.ts.map +1 -1
- package/dist/queues/utilities/updateJob.d.ts +1 -3
- package/dist/queues/utilities/updateJob.d.ts.map +1 -1
- package/dist/queues/utilities/updateJob.js +2 -18
- package/dist/queues/utilities/updateJob.js.map +1 -1
- package/dist/translations/getLocalI18n.d.ts.map +1 -1
- package/dist/types/index.d.ts +54 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/uploads/checkFileAccess.d.ts.map +1 -1
- package/dist/uploads/checkFileRestrictions.d.ts.map +1 -1
- package/dist/uploads/docWithFilenameExists.d.ts.map +1 -1
- package/dist/uploads/endpoints/getFileFromURL.d.ts.map +1 -1
- package/dist/uploads/endpoints/getFileFromURL.js +9 -5
- package/dist/uploads/endpoints/getFileFromURL.js.map +1 -1
- package/dist/uploads/fetchAPI-multipart/isEligibleRequest.d.ts.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/fileExists.d.ts.map +1 -1
- package/dist/uploads/generateFileData.d.ts.map +1 -1
- package/dist/uploads/getBaseFields.d.ts.map +1 -1
- package/dist/uploads/getBaseFields.js +24 -70
- package/dist/uploads/getBaseFields.js.map +1 -1
- package/dist/uploads/getExternalFile.d.ts.map +1 -1
- package/dist/uploads/getFileByPath.d.ts.map +1 -1
- package/dist/uploads/getFileTypeFallback.d.ts.map +1 -1
- package/dist/uploads/getSafeFilename.d.ts +9 -4
- package/dist/uploads/getSafeFilename.d.ts.map +1 -1
- package/dist/uploads/getSafeFilename.js +5 -5
- package/dist/uploads/getSafeFilename.js.map +1 -1
- package/dist/uploads/image-resizing/createImageSize.d.ts.map +1 -1
- package/dist/uploads/image-resizing/generateImageSizeFilename.d.ts.map +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/mimeTypeValidator.d.ts.map +1 -1
- package/dist/uploads/safeFetch.d.ts +1 -1
- package/dist/uploads/safeFetch.d.ts.map +1 -1
- package/dist/uploads/saveBufferToFile.d.ts.map +1 -1
- package/dist/uploads/tempFile.d.ts.map +1 -1
- package/dist/uploads/types.d.ts +12 -29
- package/dist/uploads/types.d.ts.map +1 -1
- package/dist/uploads/types.js.map +1 -1
- package/dist/uploads/uploadFiles.d.ts.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 +13 -0
- package/dist/utilities/appendDateTimezoneSelectFields.d.ts.map +1 -0
- package/dist/utilities/appendDateTimezoneSelectFields.js +47 -0
- package/dist/utilities/appendDateTimezoneSelectFields.js.map +1 -0
- package/dist/utilities/appendNonTrashedFilter.d.ts.map +1 -1
- package/dist/utilities/appendUploadSelectFields.d.ts.map +1 -1
- package/dist/utilities/appendUploadSelectFields.js +3 -0
- package/dist/utilities/appendUploadSelectFields.js.map +1 -1
- package/dist/utilities/canAccessAdmin.d.ts.map +1 -1
- package/dist/utilities/checkDocumentLockStatus.d.ts.map +1 -1
- package/dist/utilities/configToJSONSchema.d.ts +34 -16
- package/dist/utilities/configToJSONSchema.d.ts.map +1 -1
- package/dist/utilities/configToJSONSchema.js +127 -52
- package/dist/utilities/configToJSONSchema.js.map +1 -1
- package/dist/utilities/configToJSONSchema.spec.js +94 -65
- package/dist/utilities/configToJSONSchema.spec.js.map +1 -1
- package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
- package/dist/utilities/deepCopyObject.d.ts.map +1 -1
- package/dist/utilities/dependencies/resolveFrom.d.ts.map +1 -1
- package/dist/utilities/escapeRegExp.d.ts.map +1 -1
- package/dist/utilities/extractID.d.ts.map +1 -1
- package/dist/utilities/extractID.js +1 -1
- package/dist/utilities/extractID.js.map +1 -1
- package/dist/utilities/flattenAllFields.d.ts.map +1 -1
- package/dist/utilities/formatAdminURL.d.ts +13 -2
- package/dist/utilities/formatAdminURL.d.ts.map +1 -1
- package/dist/utilities/formatAdminURL.js +3 -15
- package/dist/utilities/formatAdminURL.js.map +1 -1
- package/dist/utilities/formatAdminURL.spec.js +1 -90
- package/dist/utilities/formatAdminURL.spec.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/populateFieldPermissions.d.ts.map +1 -1
- package/dist/utilities/getFieldByPath.d.ts.map +1 -1
- package/dist/utilities/getFieldPermissions.d.ts.map +1 -1
- package/dist/utilities/getObjectDotNotation.d.ts.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.map +1 -1
- package/dist/utilities/getSafeRedirect.d.ts.map +1 -1
- package/dist/utilities/getSelectMode.d.ts.map +1 -1
- package/dist/utilities/getSiblingData.d.ts.map +1 -1
- package/dist/utilities/getTranslatedLabel.d.ts.map +1 -1
- package/dist/utilities/getVersionsConfig.d.ts.map +1 -1
- package/dist/utilities/handleEndpoints.d.ts.map +1 -1
- package/dist/utilities/handleEndpoints.js +2 -6
- package/dist/utilities/handleEndpoints.js.map +1 -1
- package/dist/utilities/headersWithCors.d.ts.map +1 -1
- package/dist/utilities/isEntityHidden.d.ts.map +1 -1
- package/dist/utilities/isURLAllowed.d.ts.map +1 -1
- package/dist/utilities/isValidID.d.ts.map +1 -1
- package/dist/utilities/logError.d.ts.map +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/optionsAreEqual.d.ts.map +1 -1
- package/dist/utilities/parseBooleanString.d.ts.map +1 -1
- package/dist/utilities/parseCookies.d.ts.map +1 -1
- package/dist/utilities/parseParams/index.d.ts.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 +16 -0
- package/dist/utilities/resolveSelect.d.ts.map +1 -0
- package/dist/utilities/resolveSelect.js +19 -0
- package/dist/utilities/resolveSelect.js.map +1 -0
- 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 +1 -2
- package/dist/utilities/sanitizeSelect.d.ts.map +1 -1
- package/dist/utilities/sanitizeSelect.js +19 -25
- package/dist/utilities/sanitizeSelect.js.map +1 -1
- package/dist/utilities/sanitizeSelectParam.d.ts.map +1 -1
- package/dist/utilities/sanitizeSortParams.d.ts.map +1 -1
- package/dist/utilities/setsAreEqual.d.ts.map +1 -1
- package/dist/utilities/slugify.d.ts.map +1 -1
- package/dist/utilities/stripUnselectedFields.d.ts.map +1 -1
- package/dist/utilities/telemetry/events/adminInit.d.ts.map +1 -1
- package/dist/utilities/telemetry/events/serverInit.d.ts.map +1 -1
- package/dist/utilities/telemetry/index.d.ts.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/transformWhereQuery.d.ts.map +1 -1
- package/dist/utilities/traverseFields.d.ts.map +1 -1
- package/dist/utilities/traverseForLocalizedFields.d.ts.map +1 -1
- package/dist/utilities/unflatten.d.ts.map +1 -1
- 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/versions/baseFields.d.ts.map +1 -1
- package/dist/versions/baseFields.js +3 -2
- package/dist/versions/baseFields.js.map +1 -1
- package/dist/versions/buildCollectionFields.d.ts.map +1 -1
- package/dist/versions/buildCollectionFields.js +0 -1
- package/dist/versions/buildCollectionFields.js.map +1 -1
- package/dist/versions/buildGlobalFields.d.ts.map +1 -1
- package/dist/versions/buildGlobalFields.js +0 -1
- package/dist/versions/buildGlobalFields.js.map +1 -1
- package/dist/versions/buildVersionCompoundIndexes.d.ts.map +1 -1
- package/dist/versions/deleteCollectionVersions.d.ts.map +1 -1
- package/dist/versions/deleteScheduledPublishJobs.d.ts.map +1 -1
- package/dist/versions/drafts/appendVersionToQueryKey.d.ts.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/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/saveSnapshot.d.ts.map +1 -1
- package/dist/versions/schedule/job.d.ts.map +1 -1
- package/package.json +20 -20
- package/dist/admin/views/folderList.d.ts +0 -56
- package/dist/admin/views/folderList.d.ts.map +0 -1
- package/dist/admin/views/folderList.js +0 -3
- package/dist/admin/views/folderList.js.map +0 -1
- package/dist/folders/addFolderCollection.d.ts +0 -10
- package/dist/folders/addFolderCollection.d.ts.map +0 -1
- package/dist/folders/addFolderCollection.js +0 -26
- package/dist/folders/addFolderCollection.js.map +0 -1
- package/dist/folders/addFolderFieldToCollection.d.ts +0 -8
- package/dist/folders/addFolderFieldToCollection.d.ts.map +0 -1
- package/dist/folders/addFolderFieldToCollection.js +0 -20
- package/dist/folders/addFolderFieldToCollection.js.map +0 -1
- package/dist/folders/buildFolderField.d.ts +0 -8
- package/dist/folders/buildFolderField.d.ts.map +0 -1
- package/dist/folders/buildFolderField.js +0 -87
- package/dist/folders/buildFolderField.js.map +0 -1
- package/dist/folders/constants.d.ts +0 -3
- package/dist/folders/constants.d.ts.map +0 -1
- package/dist/folders/constants.js +0 -4
- package/dist/folders/constants.js.map +0 -1
- package/dist/folders/createFolderCollection.d.ts +0 -11
- package/dist/folders/createFolderCollection.d.ts.map +0 -1
- package/dist/folders/createFolderCollection.js +0 -115
- package/dist/folders/createFolderCollection.js.map +0 -1
- package/dist/folders/hooks/deleteSubfoldersAfterDelete.d.ts +0 -8
- package/dist/folders/hooks/deleteSubfoldersAfterDelete.d.ts.map +0 -1
- package/dist/folders/hooks/deleteSubfoldersAfterDelete.js +0 -15
- package/dist/folders/hooks/deleteSubfoldersAfterDelete.js.map +0 -1
- package/dist/folders/hooks/dissasociateAfterDelete.d.ts +0 -8
- package/dist/folders/hooks/dissasociateAfterDelete.d.ts.map +0 -1
- package/dist/folders/hooks/dissasociateAfterDelete.js +0 -20
- package/dist/folders/hooks/dissasociateAfterDelete.js.map +0 -1
- package/dist/folders/hooks/ensureSafeCollectionsChange.d.ts +0 -5
- package/dist/folders/hooks/ensureSafeCollectionsChange.d.ts.map +0 -1
- package/dist/folders/hooks/ensureSafeCollectionsChange.js +0 -107
- package/dist/folders/hooks/ensureSafeCollectionsChange.js.map +0 -1
- package/dist/folders/hooks/reparentChildFolder.d.ts +0 -24
- package/dist/folders/hooks/reparentChildFolder.d.ts.map +0 -1
- package/dist/folders/hooks/reparentChildFolder.js +0 -72
- package/dist/folders/hooks/reparentChildFolder.js.map +0 -1
- package/dist/folders/types.d.ts +0 -118
- package/dist/folders/types.d.ts.map +0 -1
- package/dist/folders/types.js +0 -3
- package/dist/folders/types.js.map +0 -1
- package/dist/folders/utils/buildFolderWhereConstraints.d.ts +0 -13
- package/dist/folders/utils/buildFolderWhereConstraints.d.ts.map +0 -1
- package/dist/folders/utils/buildFolderWhereConstraints.js +0 -45
- package/dist/folders/utils/buildFolderWhereConstraints.js.map +0 -1
- package/dist/folders/utils/formatFolderOrDocumentItem.d.ts +0 -12
- package/dist/folders/utils/formatFolderOrDocumentItem.d.ts.map +0 -1
- package/dist/folders/utils/formatFolderOrDocumentItem.js +0 -30
- package/dist/folders/utils/formatFolderOrDocumentItem.js.map +0 -1
- package/dist/folders/utils/getFolderBreadcrumbs.d.ts +0 -14
- package/dist/folders/utils/getFolderBreadcrumbs.d.ts.map +0 -1
- package/dist/folders/utils/getFolderBreadcrumbs.js +0 -45
- package/dist/folders/utils/getFolderBreadcrumbs.js.map +0 -1
- package/dist/folders/utils/getFolderData.d.ts +0 -33
- package/dist/folders/utils/getFolderData.d.ts.map +0 -1
- package/dist/folders/utils/getFolderData.js +0 -88
- package/dist/folders/utils/getFolderData.js.map +0 -1
- package/dist/folders/utils/getFoldersAndDocumentsFromJoin.d.ts +0 -24
- package/dist/folders/utils/getFoldersAndDocumentsFromJoin.d.ts.map +0 -1
- package/dist/folders/utils/getFoldersAndDocumentsFromJoin.js +0 -66
- package/dist/folders/utils/getFoldersAndDocumentsFromJoin.js.map +0 -1
- package/dist/folders/utils/getOrphanedDocs.d.ts +0 -15
- package/dist/folders/utils/getOrphanedDocs.d.ts.map +0 -1
- package/dist/folders/utils/getOrphanedDocs.js +0 -40
- package/dist/folders/utils/getOrphanedDocs.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/preferences/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,EAAE,cAAc,CAAA;IACnB,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,iBAAiB,CAAA;AAE5E,MAAM,MAAM,oBAAoB,GAAG,MAAM,EAAE,CAAA;AAE3C,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC;IAClC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;CACvB,CAAC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,EAAE,oBAAoB,CAAA;IAC/B,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAA;CACvC,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,iBAAiB,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iBAAiB,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC5B,YAAY,CAAC,EAAE,SAAS,GAAG,cAAc,CAAA;IACzC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,WAAW,GAAG,MAAM,CAAA;IACnC,MAAM,CAAC,EAAE,qBAAqB,CAAA;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/preferences/types.ts"],"sourcesContent":["import type { DefaultDocumentIDType } from '../index.js'\nimport type { PayloadRequest } from '../types/index.js'\n\nexport type PreferenceRequest = {\n key: string\n overrideAccess?: boolean\n req: PayloadRequest\n user: PayloadRequest['user']\n}\n\nexport type PreferenceUpdateRequest = { value: unknown } & PreferenceRequest\n\nexport type CollapsedPreferences = string[]\n\nexport type TabsPreferences = Array<{\n [path: string]: number\n}>\n\nexport type InsideFieldsPreferences = {\n collapsed: CollapsedPreferences\n tabIndex: number\n}\n\nexport type FieldsPreferences = {\n [key: string]: InsideFieldsPreferences\n}\n\nexport type DocumentPreferences = {\n fields: FieldsPreferences\n}\n\nexport type ColumnPreference = {\n accessor: string\n active: boolean\n}\n\nexport type CollectionPreferences = {\n columns?: ColumnPreference[]\n editViewType?: 'default' | 'live-preview'\n groupBy?: string\n limit?: number\n listViewType?: '
|
|
1
|
+
{"version":3,"sources":["../../src/preferences/types.ts"],"sourcesContent":["import type { DefaultDocumentIDType } from '../index.js'\nimport type { PayloadRequest } from '../types/index.js'\n\nexport type PreferenceRequest = {\n key: string\n overrideAccess?: boolean\n req: PayloadRequest\n user: PayloadRequest['user']\n}\n\nexport type PreferenceUpdateRequest = { value: unknown } & PreferenceRequest\n\nexport type CollapsedPreferences = string[]\n\nexport type TabsPreferences = Array<{\n [path: string]: number\n}>\n\nexport type InsideFieldsPreferences = {\n collapsed: CollapsedPreferences\n tabIndex: number\n}\n\nexport type FieldsPreferences = {\n [key: string]: InsideFieldsPreferences\n}\n\nexport type DocumentPreferences = {\n fields: FieldsPreferences\n}\n\nexport type ColumnPreference = {\n accessor: string\n active: boolean\n}\n\nexport type CollectionPreferences = {\n columns?: ColumnPreference[]\n editViewType?: 'default' | 'live-preview'\n groupBy?: string\n limit?: number\n listViewType?: 'hierarchy' | 'list'\n preset?: DefaultDocumentIDType\n sort?: string\n}\n"],"names":[],"mappings":"AAoCA,WAQC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"access.d.ts","sourceRoot":"","sources":["../../src/query-presets/access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAclD,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"access.d.ts","sourceRoot":"","sources":["../../src/query-presets/access.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAclD,eAAO,MAAM,SAAS,GAAI,QAAQ,MAAM,KAAG,MAAM,CAAC,SAAS,EAAE,MAAM,CAwFhE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/query-presets/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAShD,eAAO,MAAM,0BAA0B,0BAA0B,CAAA;AAEjE,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/query-presets/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAShD,eAAO,MAAM,0BAA0B,0BAA0B,CAAA;AAEjE,eAAO,MAAM,qBAAqB,GAAI,QAAQ,MAAM,KAAG,gBA6KrD,CAAA"}
|
|
@@ -47,8 +47,8 @@ export const getQueryPresetsConfig = (config)=>({
|
|
|
47
47
|
type: 'json',
|
|
48
48
|
admin: {
|
|
49
49
|
components: {
|
|
50
|
-
Cell: '@payloadcms/
|
|
51
|
-
Field: '@payloadcms/
|
|
50
|
+
Cell: '@payloadcms/ui#QueryPresetsWhereCell',
|
|
51
|
+
Field: '@payloadcms/ui#QueryPresetsWhereField'
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
hooks: {
|
|
@@ -73,8 +73,8 @@ export const getQueryPresetsConfig = (config)=>({
|
|
|
73
73
|
type: 'json',
|
|
74
74
|
admin: {
|
|
75
75
|
components: {
|
|
76
|
-
Cell: '@payloadcms/
|
|
77
|
-
Field: '@payloadcms/
|
|
76
|
+
Cell: '@payloadcms/ui#QueryPresetsColumnsCell',
|
|
77
|
+
Field: '@payloadcms/ui#QueryPresetsColumnField'
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
validate: (value)=>{
|
|
@@ -93,8 +93,8 @@ export const getQueryPresetsConfig = (config)=>({
|
|
|
93
93
|
type: 'text',
|
|
94
94
|
admin: {
|
|
95
95
|
components: {
|
|
96
|
-
Cell: '@payloadcms/
|
|
97
|
-
Field: '@payloadcms/
|
|
96
|
+
Cell: '@payloadcms/ui#QueryPresetsGroupByCell',
|
|
97
|
+
Field: '@payloadcms/ui#QueryPresetsGroupByField'
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
100
|
label: 'Group By'
|
|
@@ -164,7 +164,11 @@ export const getQueryPresetsConfig = (config)=>({
|
|
|
164
164
|
singular: 'Preset',
|
|
165
165
|
...config.queryPresets?.labels || {}
|
|
166
166
|
},
|
|
167
|
-
lockDocuments: false
|
|
167
|
+
lockDocuments: false,
|
|
168
|
+
select: ({ select })=>select ? {
|
|
169
|
+
...select,
|
|
170
|
+
relatedCollection: true
|
|
171
|
+
} : undefined
|
|
168
172
|
});
|
|
169
173
|
|
|
170
174
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/query-presets/config.ts"],"sourcesContent":["import type { CollectionConfig } from '../collections/config/types.js'\nimport type { Config } from '../config/types.js'\nimport type { Option } from '../fields/config/types.js'\n\nimport { transformWhereQuery } from '../utilities/transformWhereQuery.js'\nimport { validateWhereQuery } from '../utilities/validateWhereQuery.js'\nimport { getAccess } from './access.js'\nimport { getConstraints } from './constraints.js'\nimport { operations, type QueryPreset } from './types.js'\n\nexport const queryPresetsCollectionSlug = 'payload-query-presets'\n\nexport const getQueryPresetsConfig = (config: Config): CollectionConfig => ({\n slug: queryPresetsCollectionSlug,\n access: getAccess(config),\n admin: {\n defaultColumns: ['title', 'isShared', 'access', 'where', 'columns', 'groupBy'],\n hidden: true,\n useAsTitle: 'title',\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n },\n {\n name: 'isShared',\n type: 'checkbox',\n defaultValue: false,\n validate: (isShared, { data }) => {\n const typedData = data as QueryPreset\n\n // ensure the `isShared` is only true if all constraints are 'onlyMe'\n if (typedData?.access) {\n const someOperationsAreShared = Object.values(typedData.access).some(\n (operation) => operation.constraint !== 'onlyMe',\n )\n\n if (!isShared && someOperationsAreShared) {\n return 'If any constraint is not \"onlyMe\", the preset must be shared'\n }\n }\n\n return true\n },\n },\n getConstraints(config),\n {\n name: 'where',\n type: 'json',\n admin: {\n components: {\n Cell: '@payloadcms/
|
|
1
|
+
{"version":3,"sources":["../../src/query-presets/config.ts"],"sourcesContent":["import type { CollectionConfig } from '../collections/config/types.js'\nimport type { Config } from '../config/types.js'\nimport type { Option } from '../fields/config/types.js'\n\nimport { transformWhereQuery } from '../utilities/transformWhereQuery.js'\nimport { validateWhereQuery } from '../utilities/validateWhereQuery.js'\nimport { getAccess } from './access.js'\nimport { getConstraints } from './constraints.js'\nimport { operations, type QueryPreset } from './types.js'\n\nexport const queryPresetsCollectionSlug = 'payload-query-presets'\n\nexport const getQueryPresetsConfig = (config: Config): CollectionConfig => ({\n slug: queryPresetsCollectionSlug,\n access: getAccess(config),\n admin: {\n defaultColumns: ['title', 'isShared', 'access', 'where', 'columns', 'groupBy'],\n hidden: true,\n useAsTitle: 'title',\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n },\n {\n name: 'isShared',\n type: 'checkbox',\n defaultValue: false,\n validate: (isShared, { data }) => {\n const typedData = data as QueryPreset\n\n // ensure the `isShared` is only true if all constraints are 'onlyMe'\n if (typedData?.access) {\n const someOperationsAreShared = Object.values(typedData.access).some(\n (operation) => operation.constraint !== 'onlyMe',\n )\n\n if (!isShared && someOperationsAreShared) {\n return 'If any constraint is not \"onlyMe\", the preset must be shared'\n }\n }\n\n return true\n },\n },\n getConstraints(config),\n {\n name: 'where',\n type: 'json',\n admin: {\n components: {\n Cell: '@payloadcms/ui#QueryPresetsWhereCell',\n Field: '@payloadcms/ui#QueryPresetsWhereField',\n },\n },\n hooks: {\n beforeValidate: [\n ({ data }) => {\n // transform the \"where\" query here so that the client-side doesn't have to\n if (data?.where) {\n if (validateWhereQuery(data.where)) {\n return data.where\n } else {\n return transformWhereQuery(data.where)\n }\n }\n\n return data?.where\n },\n ],\n },\n label: 'Filters',\n },\n {\n name: 'columns',\n type: 'json',\n admin: {\n components: {\n Cell: '@payloadcms/ui#QueryPresetsColumnsCell',\n Field: '@payloadcms/ui#QueryPresetsColumnField',\n },\n },\n validate: (value) => {\n if (value) {\n try {\n JSON.parse(JSON.stringify(value))\n } catch {\n return 'Invalid JSON'\n }\n }\n\n return true\n },\n },\n {\n name: 'groupBy',\n type: 'text',\n admin: {\n components: {\n Cell: '@payloadcms/ui#QueryPresetsGroupByCell',\n Field: '@payloadcms/ui#QueryPresetsGroupByField',\n },\n },\n label: 'Group By',\n },\n {\n name: 'relatedCollection',\n type: 'select',\n admin: {\n hidden: true,\n },\n options: config.collections\n ? config.collections.reduce((acc, collection) => {\n if (collection.enableQueryPresets) {\n acc.push({\n label: collection.labels?.plural || collection.slug,\n value: collection.slug,\n })\n }\n return acc\n }, [] as Option[])\n : [],\n required: true,\n },\n {\n name: 'isTemp',\n type: 'checkbox',\n admin: {\n description:\n \"This is a temporary field used to determine if updating the preset would remove the user's access to it. When `true`, this record will be deleted after running the preset's `validate` function.\",\n disabled: true,\n hidden: true,\n },\n },\n ],\n hooks: {\n beforeValidate: [\n ({ data, operation }) => {\n // TODO: type this\n const typedData = data as any\n\n if (operation === 'create' || operation === 'update') {\n // Ensure all operations have a constraint\n operations.forEach((operation) => {\n if (!typedData.access) {\n typedData.access = {}\n }\n\n if (!typedData.access?.[operation]) {\n typedData[operation] = {}\n }\n\n // Ensure all operations have a constraint\n if (!typedData.access[operation]?.constraint) {\n typedData.access[operation] = {\n ...typedData.access[operation],\n constraint: 'onlyMe',\n }\n }\n })\n\n // If at least one constraint is not `onlyMe` then `isShared` must be true\n if (typedData?.access) {\n const someOperationsAreShared = Object.values(typedData.access).some(\n // TODO: remove the `any` here\n (operation: any) => operation.constraint !== 'onlyMe',\n )\n\n typedData.isShared = someOperationsAreShared\n }\n }\n\n return typedData\n },\n ],\n },\n labels: {\n plural: 'Presets',\n singular: 'Preset',\n ...(config.queryPresets?.labels || {}),\n },\n lockDocuments: false,\n select: ({ select }) => (select ? { ...select, relatedCollection: true } : undefined),\n})\n"],"names":["transformWhereQuery","validateWhereQuery","getAccess","getConstraints","operations","queryPresetsCollectionSlug","getQueryPresetsConfig","config","slug","access","admin","defaultColumns","hidden","useAsTitle","fields","name","type","required","defaultValue","validate","isShared","data","typedData","someOperationsAreShared","Object","values","some","operation","constraint","components","Cell","Field","hooks","beforeValidate","where","label","value","JSON","parse","stringify","options","collections","reduce","acc","collection","enableQueryPresets","push","labels","plural","description","disabled","forEach","singular","queryPresets","lockDocuments","select","relatedCollection","undefined"],"mappings":"AAIA,SAASA,mBAAmB,QAAQ,sCAAqC;AACzE,SAASC,kBAAkB,QAAQ,qCAAoC;AACvE,SAASC,SAAS,QAAQ,cAAa;AACvC,SAASC,cAAc,QAAQ,mBAAkB;AACjD,SAASC,UAAU,QAA0B,aAAY;AAEzD,OAAO,MAAMC,6BAA6B,wBAAuB;AAEjE,OAAO,MAAMC,wBAAwB,CAACC,SAAsC,CAAA;QAC1EC,MAAMH;QACNI,QAAQP,UAAUK;QAClBG,OAAO;YACLC,gBAAgB;gBAAC;gBAAS;gBAAY;gBAAU;gBAAS;gBAAW;aAAU;YAC9EC,QAAQ;YACRC,YAAY;QACd;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;gBACNC,UAAU;YACZ;YACA;gBACEF,MAAM;gBACNC,MAAM;gBACNE,cAAc;gBACdC,UAAU,CAACC,UAAU,EAAEC,IAAI,EAAE;oBAC3B,MAAMC,YAAYD;oBAElB,qEAAqE;oBACrE,IAAIC,WAAWb,QAAQ;wBACrB,MAAMc,0BAA0BC,OAAOC,MAAM,CAACH,UAAUb,MAAM,EAAEiB,IAAI,CAClE,CAACC,YAAcA,UAAUC,UAAU,KAAK;wBAG1C,IAAI,CAACR,YAAYG,yBAAyB;4BACxC,OAAO;wBACT;oBACF;oBAEA,OAAO;gBACT;YACF;YACApB,eAAeI;YACf;gBACEQ,MAAM;gBACNC,MAAM;gBACNN,OAAO;oBACLmB,YAAY;wBACVC,MAAM;wBACNC,OAAO;oBACT;gBACF;gBACAC,OAAO;oBACLC,gBAAgB;wBACd,CAAC,EAAEZ,IAA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AIM,cAAc,YAAYA,cAAc,UAAU;wBACpD,0CAA0C;wBAC1CvB,WAAW+C,OAAO,CAAC,CAACxB;4BAClB,IAAI,CAACL,UAAUb,MAAM,EAAE;gCACrBa,UAAUb,MAAM,GAAG,CAAC;4BACtB;4BAEA,IAAI,CAACa,UAAUb,MAAM,EAAE,CAACkB,UAAU,EAAE;gCAClCL,SAAS,CAACK,UAAU,GAAG,CAAC;4BAC1B;4BAEA,0CAA0C;4BAC1C,IAAI,CAACL,UAAUb,MAAM,CAACkB,UAAU,EAAEC,YAAY;gCAC5CN,UAAUb,MAAM,CAACkB,UAAU,GAAG;oCAC5B,GAAGL,UAAUb,MAAM,CAACkB,UAAU;oCAC9BC,YAAY;gCACd;4BACF;wBACF;wBAEA,0EAA0E;wBAC1E,IAAIN,WAAWb,QAAQ;4BACrB,MAAMc,0BAA0BC,OAAOC,MAAM,CAACH,UAAUb,MAAM,EAAEiB,IAAI,CAClE,8BAA8B;4BAC9B,CAACC,YAAmBA,UAAUC,UAAU,KAAK;4BAG/CN,UAAUF,QAAQ,GAAGG;wBACvB;oBACF;oBAEA,OAAOD;gBACT;aACD;QACH;QACAyB,QAAQ;YACNC,QAAQ;YACRI,UAAU;YACV,GAAI7C,OAAO8C,YAAY,EAAEN,UAAU,CAAC,CAAC;QACvC;QACAO,eAAe;QACfC,QAAQ,CAAC,EAAEA,MAAM,EAAE,GAAMA,SAAS;gBAAE,GAAGA,MAAM;gBAAEC,mBAAmB;YAAK,IAAIC;IAC7E,CAAA,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constraints.d.ts","sourceRoot":"","sources":["../../src/query-presets/constraints.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EAAE,KAAK,EAAU,MAAM,2BAA2B,CAAA;AAuB9D,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"constraints.d.ts","sourceRoot":"","sources":["../../src/query-presets/constraints.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EAAE,KAAK,EAAU,MAAM,2BAA2B,CAAA;AAuB9D,eAAO,MAAM,cAAc,GAAI,QAAQ,MAAM,KAAG,KA2F9C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/query-presets/constraints.ts"],"sourcesContent":["import { getTranslation } from '@payloadcms/translations'\n\nimport type { Config } from '../config/types.js'\nimport type { Field, Option } from '../fields/config/types.js'\nimport type { QueryPresetConstraint } from './types.js'\n\nimport { fieldAffectsData } from '../fields/config/types.js'\nimport { toWords } from '../utilities/formatLabels.js'\nimport { preventLockout } from './preventLockout.js'\nimport { operations } from './types.js'\n\nconst defaultConstraintOptions: Option[] = [\n {\n label: 'Everyone',\n value: 'everyone',\n },\n {\n label: 'Only Me',\n value: 'onlyMe',\n },\n {\n label: 'Specific Users',\n value: 'specificUsers',\n },\n]\n\nexport const getConstraints = (config: Config): Field => ({\n name: 'access',\n type: 'group',\n admin: {\n components: {\n Cell: '@payloadcms/
|
|
1
|
+
{"version":3,"sources":["../../src/query-presets/constraints.ts"],"sourcesContent":["import { getTranslation } from '@payloadcms/translations'\n\nimport type { Config } from '../config/types.js'\nimport type { Field, Option } from '../fields/config/types.js'\nimport type { QueryPresetConstraint } from './types.js'\n\nimport { fieldAffectsData } from '../fields/config/types.js'\nimport { toWords } from '../utilities/formatLabels.js'\nimport { preventLockout } from './preventLockout.js'\nimport { operations } from './types.js'\n\nconst defaultConstraintOptions: Option[] = [\n {\n label: 'Everyone',\n value: 'everyone',\n },\n {\n label: 'Only Me',\n value: 'onlyMe',\n },\n {\n label: 'Specific Users',\n value: 'specificUsers',\n },\n]\n\nexport const getConstraints = (config: Config): Field => ({\n name: 'access',\n type: 'group',\n admin: {\n components: {\n Cell: '@payloadcms/ui#QueryPresetsAccessCell',\n },\n condition: (data) => Boolean(data?.isShared),\n },\n fields: operations.map((constraintOperation) => ({\n type: 'collapsible',\n fields: [\n {\n name: constraintOperation,\n type: 'group',\n admin: {\n hideGutter: true,\n },\n fields: [\n {\n name: 'constraint',\n type: 'select',\n defaultValue: 'onlyMe',\n filterOptions: (args) =>\n typeof config?.queryPresets?.filterConstraints === 'function'\n ? config.queryPresets.filterConstraints(args)\n : args.options,\n label: ({ i18n }) =>\n `Specify who can ${constraintOperation} this ${getTranslation(config.queryPresets?.labels?.singular || 'Preset', i18n)}`,\n options: [\n ...defaultConstraintOptions,\n ...(config?.queryPresets?.constraints?.[constraintOperation]?.map(\n (option: QueryPresetConstraint) => ({\n label: option.label,\n value: option.value,\n }),\n ) || []),\n ],\n },\n {\n name: 'users',\n type: 'relationship',\n admin: {\n condition: (data) =>\n Boolean(data?.access?.[constraintOperation]?.constraint === 'specificUsers'),\n },\n hasMany: true,\n hooks: {\n beforeChange: [\n ({ data, req }) => {\n if (data?.access?.[constraintOperation]?.constraint === 'onlyMe' && req.user) {\n return [req.user.id]\n }\n\n if (\n data?.access?.[constraintOperation]?.constraint === 'specificUsers' &&\n req.user\n ) {\n return [...(data?.access?.[constraintOperation]?.users || []), req.user.id]\n }\n },\n ],\n },\n relationTo: config.admin?.user ?? 'users', // TODO: remove this fallback when the args are properly typed as `SanitizedConfig`\n },\n ...(config?.queryPresets?.constraints?.[constraintOperation]?.reduce(\n (acc: Field[], option: QueryPresetConstraint) => {\n option.fields?.forEach((field, index) => {\n acc.push({ ...field })\n\n if (fieldAffectsData(field)) {\n acc[index]!.admin = {\n ...(acc[index]?.admin || {}),\n condition: (data) =>\n Boolean(data?.access?.[constraintOperation]?.constraint === option.value),\n }\n }\n })\n\n return acc\n },\n [] as Field[],\n ) || []),\n ],\n label: false,\n },\n ],\n label: () => toWords(constraintOperation),\n })),\n label: 'Sharing settings',\n validate: preventLockout,\n})\n"],"names":["getTranslation","fieldAffectsData","toWords","preventLockout","operations","defaultConstraintOptions","label","value","getConstraints","config","name","type","admin","components","Cell","condition","data","Boolean","isShared","fields","map","constraintOperation","hideGutter","defaultValue","filterOptions","args","queryPresets","filterConstraints","options","i18n","labels","singular","constraints","option","access","constraint","hasMany","hooks","beforeChange","req","user","id","users","relationTo","reduce","acc","forEach","field","index","push","validate"],"mappings":"AAAA,SAASA,cAAc,QAAQ,2BAA0B;AAMzD,SAASC,gBAAgB,QAAQ,4BAA2B;AAC5D,SAASC,OAAO,QAAQ,+BAA8B;AACtD,SAASC,cAAc,QAAQ,sBAAqB;AACpD,SAASC,UAAU,QAAQ,aAAY;AAEvC,MAAMC,2BAAqC;IACzC;QACEC,OAAO;QACPC,OAAO;IACT;IACA;QACED,OAAO;QACPC,OAAO;IACT;IACA;QACED,OAAO;QACPC,OAAO;IACT;CACD;AAED,OAAO,MAAMC,iBAAiB,CAACC,SAA2B,CAAA;QACxDC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,YAAY;gBACVC,MAAM;YACR;YACAC,WAAW,CAACC,OAASC,QAAQD,MAAME;QACrC;QACAC,QAAQf,WAAWgB,GAAG,CAAC,CAACC,sBAAyB,CAAA;gBAC/CV,MAAM;gBACNQ,QAAQ;oBACN;wBACET,MAAMW;wBACNV,MAAM;wBACNC,OAAO;4BACLU,YAAY;wBACd;wBACAH,QAAQ;4BACN;gCACET,MAAM;gCACNC,MAAM;gCACNY,cAAc;gCACdC,eAAe,CAACC,OACd,OAAOhB,QAAQiB,cAAcC,sBAAsB,aAC/ClB,OAAOiB,YAAY,CAACC,iBAAiB,CAACF,QACtCA,KAAKG,OAAO;gCAClBtB,OAAO,CAAC,EAAEuB,IAAI,EAAE,GACd,CAAC,gBAAgB,EAAER,oBAAoB,MAAM,EAAErB,eAAeS,OAAOiB,YAAY,EAAEI,QAAQC,YAAY,UAAUF,OAAO;gCAC1HD,SAAS;uCACJvB;uCACCI,QAAQiB,cAAcM,aAAa,CAACX,oBAAoB,EAAED,IAC5D,CAACa,SAAmC,CAAA;4CAClC3B,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ACT;iBACD;gBACDA,OAAO,IAAMJ,QAAQmB;YACvB,CAAA;QACAf,OAAO;QACP4C,UAAU/C;IACZ,CAAA,EAAE"}
|
|
@@ -10,7 +10,7 @@ export declare function generateJobsJSONSchemas(config: SanitizedConfig, jobsCon
|
|
|
10
10
|
*/
|
|
11
11
|
collectionIDFieldTypes: {
|
|
12
12
|
[key: string]: 'number' | 'string';
|
|
13
|
-
}, i18n?: I18n): {
|
|
13
|
+
}, typeStringDefinitions: Set<string>, i18n?: I18n): {
|
|
14
14
|
definitions?: Map<string, JSONSchema4>;
|
|
15
15
|
properties?: {
|
|
16
16
|
tasks: JSONSchema4;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateJobsJSONSchemas.d.ts","sourceRoot":"","sources":["../../../src/queues/config/generateJobsJSONSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAIlD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,UAAU,EACtB,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC;AAClD;;;;GAIG;AACH,sBAAsB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAA;CAAE,EAC9D,IAAI,CAAC,EAAE,IAAI,GACV;IACD,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IACtC,UAAU,CAAC,EAAE;QAAE,KAAK,EAAE,WAAW,CAAA;KAAE,CAAA;CACpC,
|
|
1
|
+
{"version":3,"file":"generateJobsJSONSchemas.d.ts","sourceRoot":"","sources":["../../../src/queues/config/generateJobsJSONSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAIlD,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,UAAU,EACtB,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC;AAClD;;;;GAIG;AACH,sBAAsB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAA;CAAE,EAC9D,qBAAqB,EAAE,GAAG,CAAC,MAAM,CAAC,EAClC,IAAI,CAAC,EAAE,IAAI,GACV;IACD,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IACtC,UAAU,CAAC,EAAE;QAAE,KAAK,EAAE,WAAW,CAAA;KAAE,CAAA;CACpC,CA8JA"}
|
|
@@ -4,7 +4,7 @@ export function generateJobsJSONSchemas(config, jobsConfig, interfaceNameDefinit
|
|
|
4
4
|
* Used for relationship fields, to determine whether to use a string or number type for the ID.
|
|
5
5
|
* While there is a default ID field type set by the db adapter, they can differ on a collection-level
|
|
6
6
|
* if they have custom ID fields.
|
|
7
|
-
*/ collectionIDFieldTypes, i18n) {
|
|
7
|
+
*/ collectionIDFieldTypes, typeStringDefinitions, i18n) {
|
|
8
8
|
const properties = {
|
|
9
9
|
tasks: {},
|
|
10
10
|
workflows: {}
|
|
@@ -22,9 +22,16 @@ export function generateJobsJSONSchemas(config, jobsConfig, interfaceNameDefinit
|
|
|
22
22
|
required: []
|
|
23
23
|
};
|
|
24
24
|
if (task?.inputSchema?.length) {
|
|
25
|
-
const inputJsonSchema = fieldsToJSONSchema(
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const inputJsonSchema = fieldsToJSONSchema({
|
|
26
|
+
collectionIDFieldTypes,
|
|
27
|
+
config,
|
|
28
|
+
fields: flattenAllFields({
|
|
29
|
+
fields: task.inputSchema
|
|
30
|
+
}),
|
|
31
|
+
i18n,
|
|
32
|
+
interfaceNameDefinitions,
|
|
33
|
+
typeStringDefinitions
|
|
34
|
+
});
|
|
28
35
|
const fullInputJsonSchema = {
|
|
29
36
|
type: 'object',
|
|
30
37
|
additionalProperties: false,
|
|
@@ -35,9 +42,16 @@ export function generateJobsJSONSchemas(config, jobsConfig, interfaceNameDefinit
|
|
|
35
42
|
fullTaskJsonSchema.required.push('input');
|
|
36
43
|
}
|
|
37
44
|
if (task?.outputSchema?.length) {
|
|
38
|
-
const outputJsonSchema = fieldsToJSONSchema(
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
const outputJsonSchema = fieldsToJSONSchema({
|
|
46
|
+
collectionIDFieldTypes,
|
|
47
|
+
config,
|
|
48
|
+
fields: flattenAllFields({
|
|
49
|
+
fields: task.outputSchema
|
|
50
|
+
}),
|
|
51
|
+
i18n,
|
|
52
|
+
interfaceNameDefinitions,
|
|
53
|
+
typeStringDefinitions
|
|
54
|
+
});
|
|
41
55
|
const fullOutputJsonSchema = {
|
|
42
56
|
type: 'object',
|
|
43
57
|
additionalProperties: false,
|
|
@@ -95,9 +109,16 @@ export function generateJobsJSONSchemas(config, jobsConfig, interfaceNameDefinit
|
|
|
95
109
|
required: []
|
|
96
110
|
};
|
|
97
111
|
if (workflow?.inputSchema?.length) {
|
|
98
|
-
const inputJsonSchema = fieldsToJSONSchema(
|
|
99
|
-
|
|
100
|
-
|
|
112
|
+
const inputJsonSchema = fieldsToJSONSchema({
|
|
113
|
+
collectionIDFieldTypes,
|
|
114
|
+
config,
|
|
115
|
+
fields: flattenAllFields({
|
|
116
|
+
fields: workflow.inputSchema
|
|
117
|
+
}),
|
|
118
|
+
i18n,
|
|
119
|
+
interfaceNameDefinitions,
|
|
120
|
+
typeStringDefinitions
|
|
121
|
+
});
|
|
101
122
|
const fullInputJsonSchema = {
|
|
102
123
|
type: 'object',
|
|
103
124
|
additionalProperties: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/queues/config/generateJobsJSONSchemas.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\n\nimport type { SanitizedConfig } from '../../config/types.js'\nimport type { JobsConfig } from './types/index.js'\n\nimport { fieldsToJSONSchema } from '../../utilities/configToJSONSchema.js'\nimport { flattenAllFields } from '../../utilities/flattenAllFields.js'\nexport function generateJobsJSONSchemas(\n config: SanitizedConfig,\n jobsConfig: JobsConfig,\n interfaceNameDefinitions: Map<string, JSONSchema4>,\n /**\n * Used for relationship fields, to determine whether to use a string or number type for the ID.\n * While there is a default ID field type set by the db adapter, they can differ on a collection-level\n * if they have custom ID fields.\n */\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' },\n i18n?: I18n,\n): {\n definitions?: Map<string, JSONSchema4>\n properties?: { tasks: JSONSchema4 }\n} {\n const properties: { tasks: JSONSchema4; workflows: JSONSchema4 } = {\n tasks: {},\n workflows: {},\n }\n const definitions: Map<string, JSONSchema4> = new Map()\n\n if (jobsConfig?.tasks?.length) {\n for (const task of jobsConfig.tasks) {\n const fullTaskJsonSchema: JSONSchema4 = {\n type: 'object',\n additionalProperties: false,\n properties: {\n input: {},\n output: {},\n },\n required: [],\n }\n if (task?.inputSchema?.length) {\n const inputJsonSchema = fieldsToJSONSchema(\n collectionIDFieldTypes,\n flattenAllFields({ fields: task.inputSchema }),\n
|
|
1
|
+
{"version":3,"sources":["../../../src/queues/config/generateJobsJSONSchemas.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\n\nimport type { SanitizedConfig } from '../../config/types.js'\nimport type { JobsConfig } from './types/index.js'\n\nimport { fieldsToJSONSchema } from '../../utilities/configToJSONSchema.js'\nimport { flattenAllFields } from '../../utilities/flattenAllFields.js'\nexport function generateJobsJSONSchemas(\n config: SanitizedConfig,\n jobsConfig: JobsConfig,\n interfaceNameDefinitions: Map<string, JSONSchema4>,\n /**\n * Used for relationship fields, to determine whether to use a string or number type for the ID.\n * While there is a default ID field type set by the db adapter, they can differ on a collection-level\n * if they have custom ID fields.\n */\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' },\n typeStringDefinitions: Set<string>,\n i18n?: I18n,\n): {\n definitions?: Map<string, JSONSchema4>\n properties?: { tasks: JSONSchema4 }\n} {\n const properties: { tasks: JSONSchema4; workflows: JSONSchema4 } = {\n tasks: {},\n workflows: {},\n }\n const definitions: Map<string, JSONSchema4> = new Map()\n\n if (jobsConfig?.tasks?.length) {\n for (const task of jobsConfig.tasks) {\n const fullTaskJsonSchema: JSONSchema4 = {\n type: 'object',\n additionalProperties: false,\n properties: {\n input: {},\n output: {},\n },\n required: [],\n }\n if (task?.inputSchema?.length) {\n const inputJsonSchema = fieldsToJSONSchema({\n collectionIDFieldTypes,\n config,\n fields: flattenAllFields({ fields: task.inputSchema }),\n i18n,\n interfaceNameDefinitions,\n typeStringDefinitions,\n })\n\n const fullInputJsonSchema: JSONSchema4 = {\n type: 'object',\n additionalProperties: false,\n properties: inputJsonSchema.properties,\n required: inputJsonSchema.required,\n }\n\n fullTaskJsonSchema.properties!.input = fullInputJsonSchema\n ;(fullTaskJsonSchema.required as string[]).push('input')\n }\n if (task?.outputSchema?.length) {\n const outputJsonSchema = fieldsToJSONSchema({\n collectionIDFieldTypes,\n config,\n fields: flattenAllFields({ fields: task.outputSchema }),\n i18n,\n interfaceNameDefinitions,\n typeStringDefinitions,\n })\n\n const fullOutputJsonSchema: JSONSchema4 = {\n type: 'object',\n additionalProperties: false,\n properties: outputJsonSchema.properties,\n required: outputJsonSchema.required,\n }\n\n fullTaskJsonSchema.properties!.output = fullOutputJsonSchema\n ;(fullTaskJsonSchema.required as string[]).push('output')\n }\n\n const normalizedTaskSlug = task.slug[0].toUpperCase() + task.slug.slice(1)\n\n definitions.set(task.interfaceName ?? `Task${normalizedTaskSlug}`, fullTaskJsonSchema)\n }\n // Now add properties.tasks definition that references the types in definitions keyed by task slug:\n properties.tasks = {\n type: 'object',\n additionalProperties: false,\n properties: {\n ...Object.fromEntries(\n (jobsConfig.tasks ?? []).map((task) => {\n const normalizedTaskSlug = task.slug[0].toUpperCase() + task.slug.slice(1)\n\n const toReturn: JSONSchema4 = {\n $ref: task.interfaceName\n ? `#/definitions/${task.interfaceName}`\n : `#/definitions/Task${normalizedTaskSlug}`,\n }\n\n return [task.slug, toReturn]\n }),\n ),\n inline: {\n type: 'object',\n additionalProperties: false,\n properties: {\n input: {},\n output: {},\n },\n required: ['input', 'output'],\n },\n },\n required: [...(jobsConfig.tasks ?? []).map((task) => task.slug), 'inline'],\n }\n }\n\n if (jobsConfig?.workflows?.length) {\n for (const workflow of jobsConfig.workflows) {\n const fullWorkflowJsonSchema: JSONSchema4 = {\n type: 'object',\n additionalProperties: false,\n properties: {\n input: {},\n },\n required: [],\n }\n\n if (workflow?.inputSchema?.length) {\n const inputJsonSchema = fieldsToJSONSchema({\n collectionIDFieldTypes,\n config,\n fields: flattenAllFields({ fields: workflow.inputSchema }),\n i18n,\n interfaceNameDefinitions,\n typeStringDefinitions,\n })\n\n const fullInputJsonSchema: JSONSchema4 = {\n type: 'object',\n additionalProperties: false,\n properties: inputJsonSchema.properties,\n required: inputJsonSchema.required,\n }\n\n fullWorkflowJsonSchema.properties!.input = fullInputJsonSchema\n ;(fullWorkflowJsonSchema.required as string[]).push('input')\n }\n const normalizedWorkflowSlug = workflow.slug[0].toUpperCase() + workflow.slug.slice(1)\n\n definitions.set(\n workflow.interfaceName ?? `Workflow${normalizedWorkflowSlug}`,\n fullWorkflowJsonSchema,\n )\n\n properties.workflows = {\n type: 'object',\n additionalProperties: false,\n properties: Object.fromEntries(\n jobsConfig.workflows.map((workflow) => {\n const normalizedWorkflowSlug = workflow.slug[0].toUpperCase() + workflow.slug.slice(1)\n\n const toReturn: JSONSchema4 = {\n $ref: workflow.interfaceName\n ? `#/definitions/${workflow.interfaceName}`\n : `#/definitions/Workflow${normalizedWorkflowSlug}`,\n }\n\n return [workflow.slug, toReturn]\n }),\n ),\n required: jobsConfig.workflows.map((workflow) => workflow.slug),\n }\n }\n }\n\n return {\n definitions,\n properties,\n }\n}\n"],"names":["fieldsToJSONSchema","flattenAllFields","generateJobsJSONSchemas","config","jobsConfig","interfaceNameDefinitions","collectionIDFieldTypes","typeStringDefinitions","i18n","properties","tasks","workflows","definitions","Map","length","task","fullTaskJsonSchema","type","additionalProperties","input","output","required","inputSchema","inputJsonSchema","fields","fullInputJsonSchema","push","outputSchema","outputJsonSchema","fullOutputJsonSchema","normalizedTaskSlug","slug","toUpperCase","slice","set","interfaceName","Object","fromEntries","map","toReturn","$ref","inline","workflow","fullWorkflowJsonSchema","normalizedWorkflowSlug"],"mappings":"AAMA,SAASA,kBAAkB,QAAQ,wCAAuC;AAC1E,SAASC,gBAAgB,QAAQ,sCAAqC;AACtE,OAAO,SAASC,wBACdC,MAAuB,EACvBC,UAAsB,EACtBC,wBAAkD,EAClD;;;;GAIC,GACDC,sBAA8D,EAC9DC,qBAAkC,EAClCC,IAAW;IAKX,MAAMC,aAA6D;QACjEC,OAAO,CAAC;QACRC,WAAW,CAAC;IACd;IACA,MAAMC,cAAwC,IAAIC;IAElD,IAAIT,YAAYM,OAAOI,QAAQ;QAC7B,KAAK,MAAMC,QAAQX,WAAWM,KAAK,CAAE;YACnC,MAAMM,qBAAkC;gBACtCC,MAAM;gBACNC,sBAAsB;gBACtBT,YAAY;oBACVU,OAAO,CAAC;oBACRC,QAAQ,CAAC;gBACX;gBACAC,UAAU,EAAE;YACd;YACA,IAAIN,MAAMO,aAAaR,QAAQ;gBAC7B,MAAMS,kBAAkBvB,mBAAmB;oBACzCM;oBACAH;oBACAqB,QAAQvB,iBAAiB;wBAAEuB,QAAQ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E,SAAS,GAAG;gBACrBM,MAAM;gBACNC,sBAAsB;gBACtBT,YAAY2B,OAAOC,WAAW,CAC5BjC,WAAWO,SAAS,CAAC2B,GAAG,CAAC,CAACI;oBACxB,MAAME,yBAAyBF,SAASX,IAAI,CAAC,EAAE,CAACC,WAAW,KAAKU,SAASX,IAAI,CAACE,KAAK,CAAC;oBAEpF,MAAMM,WAAwB;wBAC5BC,MAAME,SAASP,aAAa,GACxB,CAAC,cAAc,EAAEO,SAASP,aAAa,EAAE,GACzC,CAAC,sBAAsB,EAAES,wBAAwB;oBACvD;oBAEA,OAAO;wBAACF,SAASX,IAAI;wBAAEQ;qBAAS;gBAClC;gBAEFlB,UAAUjB,WAAWO,SAAS,CAAC2B,GAAG,CAAC,CAACI,WAAaA,SAASX,IAAI;YAChE;QACF;IACF;IAEA,OAAO;QACLnB;QACAH;IACF;AACF"}
|
|
@@ -129,17 +129,6 @@ export type JobsConfig = {
|
|
|
129
129
|
* Determine whether or not to delete a job after it has successfully completed.
|
|
130
130
|
*/
|
|
131
131
|
deleteJobOnComplete?: boolean;
|
|
132
|
-
/**
|
|
133
|
-
* Specify depth for retrieving jobs from the queue.
|
|
134
|
-
* This should be as low as possible in order for job retrieval
|
|
135
|
-
* to be as efficient as possible. Setting it to anything higher than
|
|
136
|
-
* 0 will drastically affect performance, as less efficient database
|
|
137
|
-
* queries will be used.
|
|
138
|
-
*
|
|
139
|
-
* @default 0
|
|
140
|
-
* @deprecated - this will be removed in 4.0
|
|
141
|
-
*/
|
|
142
|
-
depth?: number;
|
|
143
132
|
/**
|
|
144
133
|
* Enable concurrency controls for workflows and tasks.
|
|
145
134
|
* When enabled, adds a `concurrencyKey` field to the jobs collection schema.
|
|
@@ -172,16 +161,6 @@ export type JobsConfig = {
|
|
|
172
161
|
[queue: string]: Sort;
|
|
173
162
|
};
|
|
174
163
|
} | Sort;
|
|
175
|
-
/**
|
|
176
|
-
* By default, the job system uses direct database calls for optimal performance.
|
|
177
|
-
* If you added custom hooks to your jobs collection, you can set this to true to
|
|
178
|
-
* use the standard Payload API for all job operations. This is discouraged, as it will
|
|
179
|
-
* drastically affect performance.
|
|
180
|
-
*
|
|
181
|
-
* @default false
|
|
182
|
-
* @deprecated - this will be removed in 4.0
|
|
183
|
-
*/
|
|
184
|
-
runHooks?: boolean;
|
|
185
164
|
/**
|
|
186
165
|
* A function that will be executed before Payload picks up jobs which are configured by the `jobs.autorun` function.
|
|
187
166
|
* If this function returns true, jobs will be queried and picked up. If it returns false, jobs will not be run.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/queues/config/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAC1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAExD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;;;;OAOG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,aAAa,C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EAAE,KAAK,CAAA;IACb,GAAG,CAAC,EAAE,KAAK,CAAA;IACX;;OAEG;IACH,MAAM,EAAE,SAAS,CAAA;CAClB,CACJ,KACE,YAAY,CAAC,IAAI,CAAC,CAAA;AAEvB,MAAM,MAAM,cAAc,GAAG;IAC3B;;;;;;;;;;;;;;;;;;OAkBG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE;QACN;;;;WAIG;QACH,aAAa,CAAC,EAAE,eAAe,CAAA;QAC/B;;;;;;;;;WASG;QACH,cAAc,CAAC,EAAE,gBAAgB,CAAA;KAClC,CAAA;IACD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;CACd,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queues/config/types/index.ts"],"sourcesContent":["import type { CollectionConfig, Job } from '../../../index.js'\nimport type { MaybePromise, Payload, PayloadRequest, Sort } from '../../../types/index.js'\nimport type { RunJobsSilent } from '../../localAPI.js'\nimport type { RunJobsArgs } from '../../operations/runJobs/index.js'\nimport type { JobStats } from '../global.js'\nimport type { TaskConfig } from './taskTypes.js'\nimport type { WorkflowConfig } from './workflowTypes.js'\n\nexport type AutorunCronConfig = {\n /**\n * If you want to autoRUn jobs from all queues, set this to true.\n * If you set this to true, the `queue` property will be ignored.\n *\n * @default false\n */\n allQueues?: boolean\n /**\n * The cron schedule for the job.\n * @default '* * * * *' (every minute).\n *\n * @example\n * ┌───────────── (optional) second (0 - 59)\n * │ ┌───────────── minute (0 - 59)\n * │ │ ┌───────────── hour (0 - 23)\n * │ │ │ ┌───────────── day of the month (1 - 31)\n * │ │ │ │ ┌───────────── month (1 - 12)\n * │ │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday)\n * │ │ │ │ │ │\n * │ │ │ │ │ │\n * - '* 0 * * * *' every hour at minute 0\n * - '* 0 0 * * *' daily at midnight\n * - '* 0 0 * * 0' weekly at midnight on Sundays\n * - '* 0 0 1 * *' monthly at midnight on the 1st day of the month\n * - '* 0/5 * * * *' every 5 minutes\n * - '* * * * * *' every second\n */\n cron?: string\n /**\n * By default, the autorun will attempt to schedule jobs for tasks and workflows that have a `schedule` property, given\n * the queue name is the same.\n *\n * Set this to `true` to disable the scheduling of jobs automatically.\n *\n * @default false\n */\n disableScheduling?: boolean\n /**\n * The limit for the job. This can be overridden by the user. Defaults to 10.\n */\n limit?: number\n /**\n * The queue name for the job.\n *\n * @default 'default'\n */\n queue?: string\n /**\n * If set to true, the job system will not log any output to the console (for both info and error logs).\n * Can be an option for more granular control over logging.\n *\n * This will not automatically affect user-configured logs (e.g. if you call `console.log` or `payload.logger.info` in your job code).\n *\n * @default false\n */\n silent?: RunJobsSilent\n}\n\nexport type RunJobAccessArgs = {\n req: PayloadRequest\n}\n\nexport type RunJobAccess = (args: RunJobAccessArgs) => MaybePromise<boolean>\n\nexport type QueueJobAccessArgs = {\n req: PayloadRequest\n}\n\nexport type CancelJobAccessArgs = {\n req: PayloadRequest\n}\nexport type CancelJobAccess = (args: CancelJobAccessArgs) => MaybePromise<boolean>\nexport type QueueJobAccess = (args: QueueJobAccessArgs) => MaybePromise<boolean>\n\nexport type SanitizedJobsConfig = {\n /**\n * If set to `true`, the job system is enabled and a payload-jobs collection exists.\n * This property is automatically set during sanitization.\n */\n enabled?: boolean\n /**\n * If set to `true`, at least one task or workflow has scheduling enabled.\n * This property is automatically set during sanitization.\n */\n scheduling?: boolean\n /**\n * If set to `true`, a payload-job-stats global exists.\n * This property is automatically set during sanitization.\n */\n stats?: boolean\n} & JobsConfig\nexport type JobsConfig = {\n /**\n * Specify access control to determine who can interact with jobs.\n */\n access?: {\n /**\n * By default, all logged-in users can cancel jobs.\n */\n cancel?: CancelJobAccess\n /**\n * By default, all logged-in users can queue jobs.\n */\n queue?: QueueJobAccess\n /**\n * By default, all logged-in users can run jobs.\n */\n run?: RunJobAccess\n }\n /** Adds information about the parent job to the task log. This is useful for debugging and tracking the flow of tasks.\n *\n * In 4.0, this will default to `true`.\n *\n * @default false\n */\n addParentToTaskLog?: boolean\n /**\n * Allows you to configure cron jobs that automatically run queued jobs\n * at specified intervals. Note that this does not _queue_ new jobs - only\n * _runs_ jobs that are already in the specified queue.\n *\n * @remark this property should not be used on serverless platforms like Vercel\n */\n autoRun?: ((payload: Payload) => MaybePromise<AutorunCronConfig[]>) | AutorunCronConfig[]\n /**\n * Determine whether or not to delete a job after it has successfully completed.\n */\n deleteJobOnComplete?: boolean\n /**\n * Specify depth for retrieving jobs from the queue.\n * This should be as low as possible in order for job retrieval\n * to be as efficient as possible. Setting it to anything higher than\n * 0 will drastically affect performance, as less efficient database\n * queries will be used.\n *\n * @default 0\n * @deprecated - this will be removed in 4.0\n */\n depth?: number\n /**\n * Enable concurrency controls for workflows and tasks.\n * When enabled, adds a `concurrencyKey` field to the jobs collection schema.\n * This allows workflows and tasks to use the `concurrency` option to prevent race conditions.\n *\n * **Important:** Enabling this may require a database migration depending on your database adapter,\n * as it adds a new indexed field to the jobs collection schema.\n *\n * @default false\n * @todo In 4.0, this will default to `true`.\n */\n enableConcurrencyControl?: boolean\n /**\n * Override any settings on the default Jobs collection. Accepts the default collection and allows you to return\n * a new collection.\n */\n jobsCollectionOverrides?: (args: { defaultJobsCollection: CollectionConfig }) => CollectionConfig\n /**\n * Adjust the job processing order using a Payload sort string. This can be set globally or per queue.\n *\n * FIFO would equal `createdAt` and LIFO would equal `-createdAt`.\n *\n * @default all jobs for all queues will be executed in FIFO order.\n */\n processingOrder?:\n | ((args: RunJobsArgs) => Promise<Sort> | Sort)\n | {\n default?: Sort\n queues: {\n [queue: string]: Sort\n }\n }\n | Sort\n /**\n * By default, the job system uses direct database calls for optimal performance.\n * If you added custom hooks to your jobs collection, you can set this to true to\n * use the standard Payload API for all job operations. This is discouraged, as it will\n * drastically affect performance.\n *\n * @default false\n * @deprecated - this will be removed in 4.0\n */\n runHooks?: boolean\n /**\n * A function that will be executed before Payload picks up jobs which are configured by the `jobs.autorun` function.\n * If this function returns true, jobs will be queried and picked up. If it returns false, jobs will not be run.\n * @default undefined - if this function is not defined, jobs will be run - as if () => true was passed.\n * @param payload\n * @returns boolean\n */\n shouldAutoRun?: (payload: Payload) => MaybePromise<boolean>\n /**\n * Define all possible tasks here\n */\n tasks?: TaskConfig<any>[]\n /**\n * Define all the workflows here. Workflows orchestrate the flow of multiple tasks.\n */\n workflows?: WorkflowConfig<any>[]\n}\n\nexport type Queueable = {\n scheduleConfig: ScheduleConfig\n taskConfig?: TaskConfig\n // If not set, queue it immediately\n waitUntil?: Date\n workflowConfig?: WorkflowConfig\n}\n\nexport type BeforeScheduleFn = (args: {\n defaultBeforeSchedule: BeforeScheduleFn\n /**\n * payload-job-stats global data\n */\n jobStats: JobStats\n queueable: Queueable\n req: PayloadRequest\n}) => MaybePromise<{\n input?: object\n shouldSchedule: boolean\n waitUntil?: Date\n}>\n\nexport type AfterScheduleFn = (\n args: {\n defaultAfterSchedule: AfterScheduleFn\n /**\n * payload-job-stats global data. If the global does not exist, it will be null.\n */\n jobStats: JobStats | null\n queueable: Queueable\n req: PayloadRequest\n } & (\n | {\n error: Error\n job?: never\n status: 'error'\n }\n | {\n error?: never\n job: Job\n status: 'success'\n }\n | {\n error?: never\n job?: never\n /**\n * If the beforeSchedule hook returned `shouldSchedule: false`, this will be called with status `skipped`.\n */\n status: 'skipped'\n }\n ),\n) => MaybePromise<void>\n\nexport type ScheduleConfig = {\n /**\n * The cron for scheduling the job.\n *\n * @example\n * ┌───────────── (optional) second (0 - 59)\n * │ ┌───────────── minute (0 - 59)\n * │ │ ┌───────────── hour (0 - 23)\n * │ │ │ ┌───────────── day of the month (1 - 31)\n * │ │ │ │ ┌───────────── month (1 - 12)\n * │ │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday)\n * │ │ │ │ │ │\n * │ │ │ │ │ │\n * - '* 0 * * * *' every hour at minute 0\n * - '* 0 0 * * *' daily at midnight\n * - '* 0 0 * * 0' weekly at midnight on Sundays\n * - '* 0 0 1 * *' monthly at midnight on the 1st day of the month\n * - '* 0/5 * * * *' every 5 minutes\n * - '* * * * * *' every second\n */\n cron: string\n hooks?: {\n /**\n * Functions that will be executed after the job has been successfully scheduled.\n *\n * @default By default, global update?? Unless global update should happen before\n */\n afterSchedule?: AfterScheduleFn\n /**\n * Functions that will be executed before the job is scheduled.\n * You can use this to control whether or not the job should be scheduled, or what input\n * data should be passed to the job.\n *\n * @default By default, this has one function that returns { shouldSchedule: true } if the following conditions are met:\n * - There currently is no job of the same type in the specified queue that is currently running\n * - There currently is no job of the same type in the specified queue that is scheduled to run in the future\n * - There currently is no job of the same type in the specified queue that failed previously but can be retried\n */\n beforeSchedule?: BeforeScheduleFn\n }\n /**\n * Queue to which the scheduled job will be added.\n */\n queue: string\n}\n"],"names":[],"mappings":"AAsQA,WA4CC"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/queues/config/types/index.ts"],"sourcesContent":["import type { CollectionConfig, Job } from '../../../index.js'\nimport type { MaybePromise, Payload, PayloadRequest, Sort } from '../../../types/index.js'\nimport type { RunJobsSilent } from '../../localAPI.js'\nimport type { RunJobsArgs } from '../../operations/runJobs/index.js'\nimport type { JobStats } from '../global.js'\nimport type { TaskConfig } from './taskTypes.js'\nimport type { WorkflowConfig } from './workflowTypes.js'\n\nexport type AutorunCronConfig = {\n /**\n * If you want to autoRUn jobs from all queues, set this to true.\n * If you set this to true, the `queue` property will be ignored.\n *\n * @default false\n */\n allQueues?: boolean\n /**\n * The cron schedule for the job.\n * @default '* * * * *' (every minute).\n *\n * @example\n * ┌───────────── (optional) second (0 - 59)\n * │ ┌───────────── minute (0 - 59)\n * │ │ ┌───────────── hour (0 - 23)\n * │ │ │ ┌───────────── day of the month (1 - 31)\n * │ │ │ │ ┌───────────── month (1 - 12)\n * │ │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday)\n * │ │ │ │ │ │\n * │ │ │ │ │ │\n * - '* 0 * * * *' every hour at minute 0\n * - '* 0 0 * * *' daily at midnight\n * - '* 0 0 * * 0' weekly at midnight on Sundays\n * - '* 0 0 1 * *' monthly at midnight on the 1st day of the month\n * - '* 0/5 * * * *' every 5 minutes\n * - '* * * * * *' every second\n */\n cron?: string\n /**\n * By default, the autorun will attempt to schedule jobs for tasks and workflows that have a `schedule` property, given\n * the queue name is the same.\n *\n * Set this to `true` to disable the scheduling of jobs automatically.\n *\n * @default false\n */\n disableScheduling?: boolean\n /**\n * The limit for the job. This can be overridden by the user. Defaults to 10.\n */\n limit?: number\n /**\n * The queue name for the job.\n *\n * @default 'default'\n */\n queue?: string\n /**\n * If set to true, the job system will not log any output to the console (for both info and error logs).\n * Can be an option for more granular control over logging.\n *\n * This will not automatically affect user-configured logs (e.g. if you call `console.log` or `payload.logger.info` in your job code).\n *\n * @default false\n */\n silent?: RunJobsSilent\n}\n\nexport type RunJobAccessArgs = {\n req: PayloadRequest\n}\n\nexport type RunJobAccess = (args: RunJobAccessArgs) => MaybePromise<boolean>\n\nexport type QueueJobAccessArgs = {\n req: PayloadRequest\n}\n\nexport type CancelJobAccessArgs = {\n req: PayloadRequest\n}\nexport type CancelJobAccess = (args: CancelJobAccessArgs) => MaybePromise<boolean>\nexport type QueueJobAccess = (args: QueueJobAccessArgs) => MaybePromise<boolean>\n\nexport type SanitizedJobsConfig = {\n /**\n * If set to `true`, the job system is enabled and a payload-jobs collection exists.\n * This property is automatically set during sanitization.\n */\n enabled?: boolean\n /**\n * If set to `true`, at least one task or workflow has scheduling enabled.\n * This property is automatically set during sanitization.\n */\n scheduling?: boolean\n /**\n * If set to `true`, a payload-job-stats global exists.\n * This property is automatically set during sanitization.\n */\n stats?: boolean\n} & JobsConfig\nexport type JobsConfig = {\n /**\n * Specify access control to determine who can interact with jobs.\n */\n access?: {\n /**\n * By default, all logged-in users can cancel jobs.\n */\n cancel?: CancelJobAccess\n /**\n * By default, all logged-in users can queue jobs.\n */\n queue?: QueueJobAccess\n /**\n * By default, all logged-in users can run jobs.\n */\n run?: RunJobAccess\n }\n /** Adds information about the parent job to the task log. This is useful for debugging and tracking the flow of tasks.\n *\n * In 4.0, this will default to `true`.\n *\n * @default false\n */\n addParentToTaskLog?: boolean\n /**\n * Allows you to configure cron jobs that automatically run queued jobs\n * at specified intervals. Note that this does not _queue_ new jobs - only\n * _runs_ jobs that are already in the specified queue.\n *\n * @remark this property should not be used on serverless platforms like Vercel\n */\n autoRun?: ((payload: Payload) => MaybePromise<AutorunCronConfig[]>) | AutorunCronConfig[]\n /**\n * Determine whether or not to delete a job after it has successfully completed.\n */\n deleteJobOnComplete?: boolean\n /**\n * Enable concurrency controls for workflows and tasks.\n * When enabled, adds a `concurrencyKey` field to the jobs collection schema.\n * This allows workflows and tasks to use the `concurrency` option to prevent race conditions.\n *\n * **Important:** Enabling this may require a database migration depending on your database adapter,\n * as it adds a new indexed field to the jobs collection schema.\n *\n * @default false\n * @todo In 4.0, this will default to `true`.\n */\n enableConcurrencyControl?: boolean\n /**\n * Override any settings on the default Jobs collection. Accepts the default collection and allows you to return\n * a new collection.\n */\n jobsCollectionOverrides?: (args: { defaultJobsCollection: CollectionConfig }) => CollectionConfig\n /**\n * Adjust the job processing order using a Payload sort string. This can be set globally or per queue.\n *\n * FIFO would equal `createdAt` and LIFO would equal `-createdAt`.\n *\n * @default all jobs for all queues will be executed in FIFO order.\n */\n processingOrder?:\n | ((args: RunJobsArgs) => Promise<Sort> | Sort)\n | {\n default?: Sort\n queues: {\n [queue: string]: Sort\n }\n }\n | Sort\n /**\n * A function that will be executed before Payload picks up jobs which are configured by the `jobs.autorun` function.\n * If this function returns true, jobs will be queried and picked up. If it returns false, jobs will not be run.\n * @default undefined - if this function is not defined, jobs will be run - as if () => true was passed.\n * @param payload\n * @returns boolean\n */\n shouldAutoRun?: (payload: Payload) => MaybePromise<boolean>\n /**\n * Define all possible tasks here\n */\n tasks?: TaskConfig<any>[]\n /**\n * Define all the workflows here. Workflows orchestrate the flow of multiple tasks.\n */\n workflows?: WorkflowConfig<any>[]\n}\n\nexport type Queueable = {\n scheduleConfig: ScheduleConfig\n taskConfig?: TaskConfig\n // If not set, queue it immediately\n waitUntil?: Date\n workflowConfig?: WorkflowConfig\n}\n\nexport type BeforeScheduleFn = (args: {\n defaultBeforeSchedule: BeforeScheduleFn\n /**\n * payload-job-stats global data\n */\n jobStats: JobStats\n queueable: Queueable\n req: PayloadRequest\n}) => MaybePromise<{\n input?: object\n shouldSchedule: boolean\n waitUntil?: Date\n}>\n\nexport type AfterScheduleFn = (\n args: {\n defaultAfterSchedule: AfterScheduleFn\n /**\n * payload-job-stats global data. If the global does not exist, it will be null.\n */\n jobStats: JobStats | null\n queueable: Queueable\n req: PayloadRequest\n } & (\n | {\n error: Error\n job?: never\n status: 'error'\n }\n | {\n error?: never\n job: Job\n status: 'success'\n }\n | {\n error?: never\n job?: never\n /**\n * If the beforeSchedule hook returned `shouldSchedule: false`, this will be called with status `skipped`.\n */\n status: 'skipped'\n }\n ),\n) => MaybePromise<void>\n\nexport type ScheduleConfig = {\n /**\n * The cron for scheduling the job.\n *\n * @example\n * ┌───────────── (optional) second (0 - 59)\n * │ ┌───────────── minute (0 - 59)\n * │ │ ┌───────────── hour (0 - 23)\n * │ │ │ ┌───────────── day of the month (1 - 31)\n * │ │ │ │ ┌───────────── month (1 - 12)\n * │ │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday)\n * │ │ │ │ │ │\n * │ │ │ │ │ │\n * - '* 0 * * * *' every hour at minute 0\n * - '* 0 0 * * *' daily at midnight\n * - '* 0 0 * * 0' weekly at midnight on Sundays\n * - '* 0 0 1 * *' monthly at midnight on the 1st day of the month\n * - '* 0/5 * * * *' every 5 minutes\n * - '* * * * * *' every second\n */\n cron: string\n hooks?: {\n /**\n * Functions that will be executed after the job has been successfully scheduled.\n *\n * @default By default, global update?? Unless global update should happen before\n */\n afterSchedule?: AfterScheduleFn\n /**\n * Functions that will be executed before the job is scheduled.\n * You can use this to control whether or not the job should be scheduled, or what input\n * data should be passed to the job.\n *\n * @default By default, this has one function that returns { shouldSchedule: true } if the following conditions are met:\n * - There currently is no job of the same type in the specified queue that is currently running\n * - There currently is no job of the same type in the specified queue that is scheduled to run in the future\n * - There currently is no job of the same type in the specified queue that failed previously but can be retried\n */\n beforeSchedule?: BeforeScheduleFn\n }\n /**\n * Queue to which the scheduled job will be added.\n */\n queue: string\n}\n"],"names":[],"mappings":"AAiPA,WA4CC"}
|
|
@@ -6,17 +6,7 @@ export type TaskInputOutput = {
|
|
|
6
6
|
output: object;
|
|
7
7
|
};
|
|
8
8
|
export type TaskHandlerResult<TTaskSlugOrInputOutput extends keyof TypedJobs['tasks'] | TaskInputOutput> = {
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated Returning `state: 'failed'` is deprecated. Throw an error instead.
|
|
11
|
-
*/
|
|
12
|
-
errorMessage?: string;
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Returning `state: 'failed'` is deprecated. Throw an error instead.
|
|
15
|
-
*/
|
|
16
|
-
state: 'failed';
|
|
17
|
-
} | {
|
|
18
9
|
output: TTaskSlugOrInputOutput extends keyof TypedJobs['tasks'] ? TypedJobs['tasks'][TTaskSlugOrInputOutput]['output'] : TTaskSlugOrInputOutput extends TaskInputOutput ? TTaskSlugOrInputOutput['output'] : never;
|
|
19
|
-
state?: 'succeeded';
|
|
20
10
|
};
|
|
21
11
|
export type TaskHandlerArgs<TTaskSlugOrInputOutput extends keyof TypedJobs['tasks'] | TaskInputOutput, TWorkflowSlug extends keyof TypedJobs['workflows'] = string> = {
|
|
22
12
|
/**
|
|
@@ -79,17 +69,7 @@ export type RunInlineTaskFunction = <TTaskInput extends object, TTaskOutput exte
|
|
|
79
69
|
req: PayloadRequest;
|
|
80
70
|
tasks: RunTaskFunctions;
|
|
81
71
|
}) => MaybePromise<{
|
|
82
|
-
/**
|
|
83
|
-
* @deprecated Returning `state: 'failed'` is deprecated. Throw an error instead.
|
|
84
|
-
*/
|
|
85
|
-
errorMessage?: string;
|
|
86
|
-
/**
|
|
87
|
-
* @deprecated Returning `state: 'failed'` is deprecated. Throw an error instead.
|
|
88
|
-
*/
|
|
89
|
-
state: 'failed';
|
|
90
|
-
} | {
|
|
91
72
|
output: TTaskOutput;
|
|
92
|
-
state?: 'succeeded';
|
|
93
73
|
}>;
|
|
94
74
|
}) => Promise<TTaskOutput>;
|
|
95
75
|
export type TaskCallbackArgs = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taskTypes.d.ts","sourceRoot":"","sources":["../../../../src/queues/config/types/taskTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,GAAG,EACH,YAAY,EACZ,cAAc,EACd,WAAW,EACX,SAAS,EACV,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE7E,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AACD,MAAM,MAAM,iBAAiB,CAC3B,sBAAsB,SAAS,MAAM,SAAS,CAAC,OAAO,CAAC,GAAG,eAAe,
|
|
1
|
+
{"version":3,"file":"taskTypes.d.ts","sourceRoot":"","sources":["../../../../src/queues/config/types/taskTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,GAAG,EACH,YAAY,EACZ,cAAc,EACd,WAAW,EACX,SAAS,EACV,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAE7E,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AACD,MAAM,MAAM,i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,CAAA;IACD;;;;;;;;;;;OAWG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,eAAe,CAAA;CAC1C,CAAA;AAED,MAAM,MAAM,UAAU,CACpB,sBAAsB,SAAS,MAAM,SAAS,CAAC,OAAO,CAAC,GAAG,eAAe,GAAG,QAAQ,IAClF;IACF;;;;;OAKG;IACH,WAAW,CAAC,EAAE,iBAAiB,CAC7B,sBAAsB,SAAS,MAAM,SAAS,CAAC,OAAO,CAAC,GACnD,SAAS,CAAC,OAAO,CAAC,CAAC,sBAAsB,CAAC,CAAC,OAAO,CAAC,GACnD,sBAAsB,SAAS,eAAe,GAC5C,sBAAsB,CAAC,OAAO,CAAC,GAC/B,MAAM,CACb,CAAA;IACD;;;;;;;OAOG;IACH,OAAO,EAAE,MAAM,GAAG,WAAW,CAAC,sBAAsB,CAAC,CAAA;IACrD;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,EAAE,CAAA;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,CAAA;IAC1B;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,EAAE,CAAA;IACtB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAAA;IAC1C;;OAEG;IACH,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAA;IAC3B;;OAEG;IACH,IAAI,EAAE,sBAAsB,SAAS,MAAM,SAAS,CAAC,OAAO,CAAC,GAAG,sBAAsB,GAAG,MAAM,CAAA;CAChG,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/queues/config/types/taskTypes.ts"],"sourcesContent":["import type {\n Field,\n Job,\n MaybePromise,\n PayloadRequest,\n StringKeyOf,\n TypedJobs,\n} from '../../../index.js'\nimport type { ScheduleConfig } from './index.js'\nimport type { ConcurrencyConfig, SingleTaskStatus } from './workflowTypes.js'\n\nexport type TaskInputOutput = {\n input: object\n output: object\n}\nexport type TaskHandlerResult<\n TTaskSlugOrInputOutput extends keyof TypedJobs['tasks'] | TaskInputOutput,\n> =\n | {\n /**\n * @deprecated Returning `state: 'failed'` is deprecated. Throw an error instead.\n */\n errorMessage?: string\n /**\n * @deprecated Returning `state: 'failed'` is deprecated. Throw an error instead.\n */\n state: 'failed'\n }\n | {\n output: TTaskSlugOrInputOutput extends keyof TypedJobs['tasks']\n ? TypedJobs['tasks'][TTaskSlugOrInputOutput]['output']\n : TTaskSlugOrInputOutput extends TaskInputOutput // Check if it's actually TaskInputOutput type\n ? TTaskSlugOrInputOutput['output']\n : never\n state?: 'succeeded'\n }\n\nexport type TaskHandlerArgs<\n TTaskSlugOrInputOutput extends keyof TypedJobs['tasks'] | TaskInputOutput,\n TWorkflowSlug extends keyof TypedJobs['workflows'] = string,\n> = {\n /**\n * Use this function to run a sub-task from within another task.\n */\n inlineTask: RunInlineTaskFunction\n input: TTaskSlugOrInputOutput extends keyof TypedJobs['tasks']\n ? TypedJobs['tasks'][TTaskSlugOrInputOutput]['input']\n : TTaskSlugOrInputOutput extends TaskInputOutput // Check if it's actually TaskInputOutput type\n ? TTaskSlugOrInputOutput['input']\n : never\n job: Job<TWorkflowSlug>\n req: PayloadRequest\n tasks: RunTaskFunctions\n}\n\n/**\n * Inline tasks in JSON workflows have no input, as they can just get the input from job.taskStatus\n */\nexport type TaskHandlerArgsNoInput<TWorkflowInput extends false | object = false> = {\n job: Job<TWorkflowInput>\n req: PayloadRequest\n}\n\nexport type TaskHandler<\n TTaskSlugOrInputOutput extends keyof TypedJobs['tasks'] | TaskInputOutput,\n TWorkflowSlug extends keyof TypedJobs['workflows'] = string,\n> = (\n args: TaskHandlerArgs<TTaskSlugOrInputOutput, TWorkflowSlug>,\n) => MaybePromise<TaskHandlerResult<TTaskSlugOrInputOutput>>\n\n/**\n * @todo rename to TaskSlug in 4.0, similar to CollectionSlug\n */\nexport type TaskType = StringKeyOf<TypedJobs['tasks']>\n\n// Extracts the type of `input` corresponding to each task\nexport type TaskInput<T extends keyof TypedJobs['tasks']> = TypedJobs['tasks'][T]['input']\n\nexport type TaskOutput<T extends keyof TypedJobs['tasks']> = TypedJobs['tasks'][T]['output']\n\nexport type TaskHandlerResults = {\n [TTaskSlug in keyof TypedJobs['tasks']]: {\n [id: string]: TaskHandlerResult<TTaskSlug>\n }\n}\n\n// Helper type to create correct argument type for the function corresponding to each task.\nexport type RunTaskFunctionArgs<TTaskSlug extends keyof TypedJobs['tasks']> = {\n input?: TaskInput<TTaskSlug>\n /**\n * Specify the number of times that this task should be retried if it fails for any reason.\n * If this is undefined, the task will either inherit the retries from the workflow or have no retries.\n * If this is 0, the task will not be retried.\n *\n * @default By default, tasks are not retried and `retries` is `undefined`.\n */\n retries?: number | RetryConfig | undefined\n}\n\nexport type RunTaskFunction<TTaskSlug extends keyof TypedJobs['tasks']> = (\n taskID: string,\n taskArgs?: RunTaskFunctionArgs<TTaskSlug>,\n) => Promise<TaskOutput<TTaskSlug>>\n\nexport type RunTaskFunctions = {\n [TTaskSlug in keyof TypedJobs['tasks']]: RunTaskFunction<TTaskSlug>\n}\n\nexport type RunInlineTaskFunction = <TTaskInput extends object, TTaskOutput extends object>(\n taskID: string,\n taskArgs: {\n input?: TTaskInput\n /**\n * Specify the number of times that this task should be retried if it fails for any reason.\n * If this is undefined, the task will either inherit the retries from the workflow or have no retries.\n * If this is 0, the task will not be retried.\n *\n * @default By default, tasks are not retried and `retries` is `undefined`.\n */\n retries?: number | RetryConfig | undefined\n // This is the same as TaskHandler, but typed out explicitly in order to improve type inference\n task: (args: {\n inlineTask: RunInlineTaskFunction\n input: TTaskInput\n job: Job<any>\n req: PayloadRequest\n tasks: RunTaskFunctions\n }) => MaybePromise<\n | {\n /**\n * @deprecated Returning `state: 'failed'` is deprecated. Throw an error instead.\n */\n errorMessage?: string\n /**\n * @deprecated Returning `state: 'failed'` is deprecated. Throw an error instead.\n */\n state: 'failed'\n }\n | {\n output: TTaskOutput\n state?: 'succeeded'\n }\n >\n },\n) => Promise<TTaskOutput>\n\nexport type TaskCallbackArgs = {\n /**\n * Input data passed to the task\n */\n input?: object\n job: Job\n req: PayloadRequest\n taskStatus: null | SingleTaskStatus<string>\n}\n\nexport type ShouldRestoreFn = (\n args: { taskStatus: SingleTaskStatus<string> } & Omit<TaskCallbackArgs, 'taskStatus'>,\n) => MaybePromise<boolean>\nexport type TaskCallbackFn = (args: TaskCallbackArgs) => MaybePromise<void>\n\nexport type RetryConfig = {\n /**\n * This controls how many times the task should be retried if it fails.\n *\n * @default undefined - attempts are either inherited from the workflow retry config or set to 0.\n */\n attempts?: number\n /**\n * The backoff strategy to use when retrying the task. This determines how long to wait before retrying the task.\n *\n * If this is set on a single task, the longest backoff time of a task will determine the time until the entire workflow is retried.\n */\n backoff?: {\n /**\n * Base delay between running jobs in ms\n */\n delay?: number\n /**\n * @default fixed\n *\n * The backoff strategy to use when retrying the task. This determines how long to wait before retrying the task.\n * If fixed (default) is used, the delay will be the same between each retry.\n *\n * If exponential is used, the delay will increase exponentially with each retry.\n *\n * @example\n * delay = 1000\n * attempts = 3\n * type = 'fixed'\n *\n * The task will be retried 3 times with a delay of 1000ms between each retry.\n *\n * @example\n * delay = 1000\n * attempts = 3\n * type = 'exponential'\n *\n * The task will be retried 3 times with a delay of 1000ms, 2000ms, and 4000ms between each retry.\n */\n type: 'exponential' | 'fixed'\n }\n /**\n * This controls whether the task output should be restored if the task previously succeeded and the workflow is being retried.\n *\n * If this is set to false, the task will be re-run even if it previously succeeded, ignoring the maximum number of retries.\n *\n * If this is set to true, the task will only be re-run if it previously failed.\n *\n * If this is a function, the return value of the function will determine whether the task should be re-run. This can be used for more complex restore logic,\n * e.g you may want to re-run a task up until a certain point and then restore it, or only re-run a task if the input has changed.\n *\n * @default true - the task output will be restored if the task previously succeeded.\n */\n shouldRestore?: boolean | ShouldRestoreFn\n}\n\nexport type TaskConfig<\n TTaskSlugOrInputOutput extends keyof TypedJobs['tasks'] | TaskInputOutput = TaskType,\n> = {\n /**\n * Job concurrency controls for preventing race conditions.\n *\n * Can be an object with full options, or a shorthand function that just returns the key\n * (in which case exclusive defaults to true).\n */\n concurrency?: ConcurrencyConfig<\n TTaskSlugOrInputOutput extends keyof TypedJobs['tasks']\n ? TypedJobs['tasks'][TTaskSlugOrInputOutput]['input']\n : TTaskSlugOrInputOutput extends TaskInputOutput\n ? TTaskSlugOrInputOutput['input']\n : object\n >\n /**\n * The function that should be responsible for running the job.\n * You can either pass a string-based path to the job function file, or the job function itself.\n *\n * If you are using large dependencies within your job, you might prefer to pass the string path\n * because that will avoid bundling large dependencies in your Next.js app. Passing a string path is an advanced feature\n * that may require a sophisticated build pipeline in order to work.\n */\n handler: string | TaskHandler<TTaskSlugOrInputOutput>\n /**\n * Define the input field schema - payload will generate a type for this schema.\n */\n inputSchema?: Field[]\n /**\n * You can use interfaceName to change the name of the interface that is generated for this task. By default, this is \"Task\" + the capitalized task slug.\n */\n interfaceName?: string\n /**\n * Define a human-friendly label for this task.\n */\n label?: string\n /**\n * Function to be executed if the task fails.\n */\n onFail?: TaskCallbackFn\n /**\n * Function to be executed if the task succeeds.\n */\n onSuccess?: TaskCallbackFn\n /**\n * Define the output field schema - payload will generate a type for this schema.\n */\n outputSchema?: Field[]\n /**\n * Specify the number of times that this step should be retried if it fails.\n * If this is undefined, the task will either inherit the retries from the workflow or have no retries.\n * If this is 0, the task will not be retried.\n *\n * @default By default, tasks are not retried and `retries` is `undefined`.\n */\n retries?: number | RetryConfig | undefined\n /**\n * Allows automatically scheduling this task to run regularly at a specified interval.\n */\n schedule?: ScheduleConfig[]\n /**\n * Define a slug-based name for this job. This slug needs to be unique among both tasks and workflows.\n */\n slug: TTaskSlugOrInputOutput extends keyof TypedJobs['tasks'] ? TTaskSlugOrInputOutput : string\n}\n"],"names":[],"mappings":"AAyNA,WAiEC"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/queues/config/types/taskTypes.ts"],"sourcesContent":["import type {\n Field,\n Job,\n MaybePromise,\n PayloadRequest,\n StringKeyOf,\n TypedJobs,\n} from '../../../index.js'\nimport type { ScheduleConfig } from './index.js'\nimport type { ConcurrencyConfig, SingleTaskStatus } from './workflowTypes.js'\n\nexport type TaskInputOutput = {\n input: object\n output: object\n}\nexport type TaskHandlerResult<\n TTaskSlugOrInputOutput extends keyof TypedJobs['tasks'] | TaskInputOutput,\n> = {\n output: TTaskSlugOrInputOutput extends keyof TypedJobs['tasks']\n ? TypedJobs['tasks'][TTaskSlugOrInputOutput]['output']\n : TTaskSlugOrInputOutput extends TaskInputOutput // Check if it's actually TaskInputOutput type\n ? TTaskSlugOrInputOutput['output']\n : never\n}\n\nexport type TaskHandlerArgs<\n TTaskSlugOrInputOutput extends keyof TypedJobs['tasks'] | TaskInputOutput,\n TWorkflowSlug extends keyof TypedJobs['workflows'] = string,\n> = {\n /**\n * Use this function to run a sub-task from within another task.\n */\n inlineTask: RunInlineTaskFunction\n input: TTaskSlugOrInputOutput extends keyof TypedJobs['tasks']\n ? TypedJobs['tasks'][TTaskSlugOrInputOutput]['input']\n : TTaskSlugOrInputOutput extends TaskInputOutput // Check if it's actually TaskInputOutput type\n ? TTaskSlugOrInputOutput['input']\n : never\n job: Job<TWorkflowSlug>\n req: PayloadRequest\n tasks: RunTaskFunctions\n}\n\n/**\n * Inline tasks in JSON workflows have no input, as they can just get the input from job.taskStatus\n */\nexport type TaskHandlerArgsNoInput<TWorkflowInput extends false | object = false> = {\n job: Job<TWorkflowInput>\n req: PayloadRequest\n}\n\nexport type TaskHandler<\n TTaskSlugOrInputOutput extends keyof TypedJobs['tasks'] | TaskInputOutput,\n TWorkflowSlug extends keyof TypedJobs['workflows'] = string,\n> = (\n args: TaskHandlerArgs<TTaskSlugOrInputOutput, TWorkflowSlug>,\n) => MaybePromise<TaskHandlerResult<TTaskSlugOrInputOutput>>\n\n/**\n * @todo rename to TaskSlug in 4.0, similar to CollectionSlug\n */\nexport type TaskType = StringKeyOf<TypedJobs['tasks']>\n\n// Extracts the type of `input` corresponding to each task\nexport type TaskInput<T extends keyof TypedJobs['tasks']> = TypedJobs['tasks'][T]['input']\n\nexport type TaskOutput<T extends keyof TypedJobs['tasks']> = TypedJobs['tasks'][T]['output']\n\nexport type TaskHandlerResults = {\n [TTaskSlug in keyof TypedJobs['tasks']]: {\n [id: string]: TaskHandlerResult<TTaskSlug>\n }\n}\n\n// Helper type to create correct argument type for the function corresponding to each task.\nexport type RunTaskFunctionArgs<TTaskSlug extends keyof TypedJobs['tasks']> = {\n input?: TaskInput<TTaskSlug>\n /**\n * Specify the number of times that this task should be retried if it fails for any reason.\n * If this is undefined, the task will either inherit the retries from the workflow or have no retries.\n * If this is 0, the task will not be retried.\n *\n * @default By default, tasks are not retried and `retries` is `undefined`.\n */\n retries?: number | RetryConfig | undefined\n}\n\nexport type RunTaskFunction<TTaskSlug extends keyof TypedJobs['tasks']> = (\n taskID: string,\n taskArgs?: RunTaskFunctionArgs<TTaskSlug>,\n) => Promise<TaskOutput<TTaskSlug>>\n\nexport type RunTaskFunctions = {\n [TTaskSlug in keyof TypedJobs['tasks']]: RunTaskFunction<TTaskSlug>\n}\n\nexport type RunInlineTaskFunction = <TTaskInput extends object, TTaskOutput extends object>(\n taskID: string,\n taskArgs: {\n input?: TTaskInput\n /**\n * Specify the number of times that this task should be retried if it fails for any reason.\n * If this is undefined, the task will either inherit the retries from the workflow or have no retries.\n * If this is 0, the task will not be retried.\n *\n * @default By default, tasks are not retried and `retries` is `undefined`.\n */\n retries?: number | RetryConfig | undefined\n // This is the same as TaskHandler, but typed out explicitly in order to improve type inference\n task: (args: {\n inlineTask: RunInlineTaskFunction\n input: TTaskInput\n job: Job<any>\n req: PayloadRequest\n tasks: RunTaskFunctions\n }) => MaybePromise<{\n output: TTaskOutput\n }>\n },\n) => Promise<TTaskOutput>\n\nexport type TaskCallbackArgs = {\n /**\n * Input data passed to the task\n */\n input?: object\n job: Job\n req: PayloadRequest\n taskStatus: null | SingleTaskStatus<string>\n}\n\nexport type ShouldRestoreFn = (\n args: { taskStatus: SingleTaskStatus<string> } & Omit<TaskCallbackArgs, 'taskStatus'>,\n) => MaybePromise<boolean>\nexport type TaskCallbackFn = (args: TaskCallbackArgs) => MaybePromise<void>\n\nexport type RetryConfig = {\n /**\n * This controls how many times the task should be retried if it fails.\n *\n * @default undefined - attempts are either inherited from the workflow retry config or set to 0.\n */\n attempts?: number\n /**\n * The backoff strategy to use when retrying the task. This determines how long to wait before retrying the task.\n *\n * If this is set on a single task, the longest backoff time of a task will determine the time until the entire workflow is retried.\n */\n backoff?: {\n /**\n * Base delay between running jobs in ms\n */\n delay?: number\n /**\n * @default fixed\n *\n * The backoff strategy to use when retrying the task. This determines how long to wait before retrying the task.\n * If fixed (default) is used, the delay will be the same between each retry.\n *\n * If exponential is used, the delay will increase exponentially with each retry.\n *\n * @example\n * delay = 1000\n * attempts = 3\n * type = 'fixed'\n *\n * The task will be retried 3 times with a delay of 1000ms between each retry.\n *\n * @example\n * delay = 1000\n * attempts = 3\n * type = 'exponential'\n *\n * The task will be retried 3 times with a delay of 1000ms, 2000ms, and 4000ms between each retry.\n */\n type: 'exponential' | 'fixed'\n }\n /**\n * This controls whether the task output should be restored if the task previously succeeded and the workflow is being retried.\n *\n * If this is set to false, the task will be re-run even if it previously succeeded, ignoring the maximum number of retries.\n *\n * If this is set to true, the task will only be re-run if it previously failed.\n *\n * If this is a function, the return value of the function will determine whether the task should be re-run. This can be used for more complex restore logic,\n * e.g you may want to re-run a task up until a certain point and then restore it, or only re-run a task if the input has changed.\n *\n * @default true - the task output will be restored if the task previously succeeded.\n */\n shouldRestore?: boolean | ShouldRestoreFn\n}\n\nexport type TaskConfig<\n TTaskSlugOrInputOutput extends keyof TypedJobs['tasks'] | TaskInputOutput = TaskType,\n> = {\n /**\n * Job concurrency controls for preventing race conditions.\n *\n * Can be an object with full options, or a shorthand function that just returns the key\n * (in which case exclusive defaults to true).\n */\n concurrency?: ConcurrencyConfig<\n TTaskSlugOrInputOutput extends keyof TypedJobs['tasks']\n ? TypedJobs['tasks'][TTaskSlugOrInputOutput]['input']\n : TTaskSlugOrInputOutput extends TaskInputOutput\n ? TTaskSlugOrInputOutput['input']\n : object\n >\n /**\n * The function that should be responsible for running the job.\n * You can either pass a string-based path to the job function file, or the job function itself.\n *\n * If you are using large dependencies within your job, you might prefer to pass the string path\n * because that will avoid bundling large dependencies in your Next.js app. Passing a string path is an advanced feature\n * that may require a sophisticated build pipeline in order to work.\n */\n handler: string | TaskHandler<TTaskSlugOrInputOutput>\n /**\n * Define the input field schema - payload will generate a type for this schema.\n */\n inputSchema?: Field[]\n /**\n * You can use interfaceName to change the name of the interface that is generated for this task. By default, this is \"Task\" + the capitalized task slug.\n */\n interfaceName?: string\n /**\n * Define a human-friendly label for this task.\n */\n label?: string\n /**\n * Function to be executed if the task fails.\n */\n onFail?: TaskCallbackFn\n /**\n * Function to be executed if the task succeeds.\n */\n onSuccess?: TaskCallbackFn\n /**\n * Define the output field schema - payload will generate a type for this schema.\n */\n outputSchema?: Field[]\n /**\n * Specify the number of times that this step should be retried if it fails.\n * If this is undefined, the task will either inherit the retries from the workflow or have no retries.\n * If this is 0, the task will not be retried.\n *\n * @default By default, tasks are not retried and `retries` is `undefined`.\n */\n retries?: number | RetryConfig | undefined\n /**\n * Allows automatically scheduling this task to run regularly at a specified interval.\n */\n schedule?: ScheduleConfig[]\n /**\n * Define a slug-based name for this job. This slug needs to be unique among both tasks and workflows.\n */\n slug: TTaskSlugOrInputOutput extends keyof TypedJobs['tasks'] ? TTaskSlugOrInputOutput : string\n}\n"],"names":[],"mappings":"AAgMA,WAiEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/queues/endpoints/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAInE;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,QAmG7B,CAAA;AAED,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/queues/endpoints/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAInE;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,QAmG7B,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,YAAY,mBAAmB,KAAG,OAE/D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleWorkflowError.d.ts","sourceRoot":"","sources":["../../../src/queues/errors/handleWorkflowError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAA;AAC7F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAK/C;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,KAAK,EACL,GAAG,EACH,MAAc,EACd,SAAS,GACV,EAAE;IACD,KAAK,EAAE,aAAa,CAAA;IACpB,GAAG,EAAE,cAAc,CAAA;IACnB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,SAAS,EAAE,iBAAiB,CAAA;CAC7B,GAAG,OAAO,CAAC;IACV,aAAa,EAAE,OAAO,CAAA;CACvB,CAAC,
|
|
1
|
+
{"version":3,"file":"handleWorkflowError.d.ts","sourceRoot":"","sources":["../../../src/queues/errors/handleWorkflowError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAA;AAC7F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAK/C;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,KAAK,EACL,GAAG,EACH,MAAc,EACd,SAAS,GACV,EAAE;IACD,KAAK,EAAE,aAAa,CAAA;IACpB,GAAG,EAAE,cAAc,CAAA;IACnB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,SAAS,EAAE,iBAAiB,CAAA;CAC7B,GAAG,OAAO,CAAC;IACV,aAAa,EAAE,OAAO,CAAA;CACvB,CAAC,CA6DD"}
|
|
@@ -15,7 +15,15 @@ import { getWorkflowRetryBehavior } from './getWorkflowRetryBehavior.js';
|
|
|
15
15
|
message: error.message,
|
|
16
16
|
stack: error.stack
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
// No retries configured => permanently fail. Errors reaching this handler are
|
|
19
|
+
// workflow-level (task errors are routed to handleTaskError first), so there's
|
|
20
|
+
// nothing else to bound them.
|
|
21
|
+
const hasNoRetriesConfigured = workflowConfig.retries === undefined || workflowConfig.retries === null;
|
|
22
|
+
const { hasFinalError, maxWorkflowRetries, waitUntil } = hasNoRetriesConfigured ? {
|
|
23
|
+
hasFinalError: true,
|
|
24
|
+
maxWorkflowRetries: undefined,
|
|
25
|
+
waitUntil: undefined
|
|
26
|
+
} : getWorkflowRetryBehavior({
|
|
19
27
|
job,
|
|
20
28
|
retriesConfig: workflowConfig.retries
|
|
21
29
|
});
|