payload 4.0.0-internal.1f9ae9a → 4.0.0-internal.203916b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/bin.js +11 -0
- package/dist/admin/RichText.d.ts +2 -10
- package/dist/admin/RichText.d.ts.map +1 -1
- package/dist/admin/RichText.js.map +1 -1
- package/dist/admin/adapters/devReload.d.ts +9 -0
- package/dist/admin/adapters/devReload.d.ts.map +1 -0
- package/dist/admin/adapters/devReload.js +6 -0
- package/dist/admin/adapters/devReload.js.map +1 -0
- package/dist/admin/adapters/index.d.ts +3 -0
- package/dist/admin/adapters/index.d.ts.map +1 -1
- package/dist/admin/adapters/index.js.map +1 -1
- package/dist/admin/adapters/render.d.ts +16 -0
- package/dist/admin/adapters/render.d.ts.map +1 -0
- package/dist/admin/adapters/render.js +7 -0
- package/dist/admin/adapters/render.js.map +1 -0
- package/dist/admin/adapters/views.d.ts +36 -0
- package/dist/admin/adapters/views.d.ts.map +1 -0
- package/dist/admin/adapters/views.js +7 -0
- package/dist/admin/adapters/views.js.map +1 -0
- package/dist/admin/fields/Row.d.ts +2 -2
- package/dist/admin/fields/Row.d.ts.map +1 -1
- package/dist/admin/fields/Row.js.map +1 -1
- package/dist/admin/forms/Description.d.ts +2 -2
- package/dist/admin/forms/Description.d.ts.map +1 -1
- package/dist/admin/forms/Description.js.map +1 -1
- package/dist/admin/forms/Field.d.ts +10 -5
- package/dist/admin/forms/Field.d.ts.map +1 -1
- package/dist/admin/forms/Field.js.map +1 -1
- package/dist/admin/functions/index.d.ts +9 -0
- 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 +3 -2
- package/dist/admin/types.d.ts.map +1 -1
- package/dist/admin/types.js.map +1 -1
- package/dist/admin/views/dashboard.d.ts +7 -0
- package/dist/admin/views/dashboard.d.ts.map +1 -1
- package/dist/admin/views/dashboard.js.map +1 -1
- package/dist/admin/views/document.d.ts +5 -3
- package/dist/admin/views/document.d.ts.map +1 -1
- package/dist/admin/views/document.js.map +1 -1
- package/dist/admin/views/list.d.ts +5 -0
- package/dist/admin/views/list.d.ts.map +1 -1
- package/dist/admin/views/list.js.map +1 -1
- package/dist/auth/baseFields/apiKey.d.ts +10 -2
- package/dist/auth/baseFields/apiKey.d.ts.map +1 -1
- package/dist/auth/baseFields/apiKey.js +35 -24
- package/dist/auth/baseFields/apiKey.js.map +1 -1
- package/dist/auth/defaultAccess.d.ts +1 -1
- package/dist/auth/defaultAccess.d.ts.map +1 -1
- package/dist/auth/defaultAccess.js +1 -1
- package/dist/auth/defaultAccess.js.map +1 -1
- package/dist/auth/defaultUser.d.ts.map +1 -1
- package/dist/auth/defaultUser.js +2 -1
- package/dist/auth/defaultUser.js.map +1 -1
- package/dist/auth/getAuthFields.js +2 -2
- package/dist/auth/getAuthFields.js.map +1 -1
- package/dist/auth/operations/auth.d.ts +2 -2
- package/dist/auth/operations/auth.d.ts.map +1 -1
- package/dist/auth/operations/auth.js.map +1 -1
- package/dist/auth/operations/login.d.ts +2 -1
- package/dist/auth/operations/login.d.ts.map +1 -1
- package/dist/auth/operations/login.js.map +1 -1
- package/dist/auth/operations/me.js.map +1 -1
- package/dist/auth/operations/refresh.d.ts.map +1 -1
- package/dist/auth/operations/refresh.js +9 -3
- package/dist/auth/operations/refresh.js.map +1 -1
- package/dist/auth/operations/resetPassword.d.ts.map +1 -1
- package/dist/auth/operations/resetPassword.js.map +1 -1
- package/dist/auth/sendVerificationEmail.d.ts +2 -2
- package/dist/auth/sendVerificationEmail.d.ts.map +1 -1
- package/dist/auth/sendVerificationEmail.js +1 -1
- package/dist/auth/sendVerificationEmail.js.map +1 -1
- package/dist/auth/sessions.d.ts +4 -5
- package/dist/auth/sessions.d.ts.map +1 -1
- package/dist/auth/sessions.js +5 -3
- package/dist/auth/sessions.js.map +1 -1
- package/dist/auth/strategies/apiKey.js.map +1 -1
- package/dist/auth/strategies/local/incrementLoginAttempts.d.ts +2 -2
- package/dist/auth/strategies/local/incrementLoginAttempts.d.ts.map +1 -1
- package/dist/auth/strategies/local/incrementLoginAttempts.js +1 -1
- package/dist/auth/strategies/local/incrementLoginAttempts.js.map +1 -1
- package/dist/auth/types.d.ts +28 -21
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/auth/types.js.map +1 -1
- package/dist/bin/generateImportMap/index.d.ts.map +1 -1
- package/dist/bin/generateImportMap/index.js +8 -5
- package/dist/bin/generateImportMap/index.js.map +1 -1
- package/dist/bin/generateImportMap/iterateCollections.d.ts.map +1 -1
- package/dist/bin/generateImportMap/iterateCollections.js +11 -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 +12 -0
- package/dist/bin/generateImportMap/iterateConfig.js.map +1 -1
- package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.d.ts +5 -1
- package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.d.ts.map +1 -1
- package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.js +32 -18
- package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.js.map +1 -1
- package/dist/bin/generateTypes.d.ts +3 -2
- package/dist/bin/generateTypes.d.ts.map +1 -1
- package/dist/bin/generateTypes.js +11 -1
- package/dist/bin/generateTypes.js.map +1 -1
- package/dist/bin/loadEnv.d.ts +3 -1
- package/dist/bin/loadEnv.d.ts.map +1 -1
- package/dist/bin/loadEnv.js +40 -10
- package/dist/bin/loadEnv.js.map +1 -1
- package/dist/collections/config/client.d.ts +1 -1
- package/dist/collections/config/client.d.ts.map +1 -1
- package/dist/collections/config/client.js +1 -0
- package/dist/collections/config/client.js.map +1 -1
- package/dist/collections/config/defaults.d.ts +0 -4
- package/dist/collections/config/defaults.d.ts.map +1 -1
- package/dist/collections/config/defaults.js +2 -17
- package/dist/collections/config/defaults.js.map +1 -1
- package/dist/collections/config/defaults.spec.js +47 -0
- package/dist/collections/config/defaults.spec.js.map +1 -0
- package/dist/collections/config/sanitize.d.ts.map +1 -1
- package/dist/collections/config/sanitize.js +1 -11
- package/dist/collections/config/sanitize.js.map +1 -1
- package/dist/collections/config/types.d.ts +11 -7
- package/dist/collections/config/types.d.ts.map +1 -1
- package/dist/collections/config/types.js.map +1 -1
- package/dist/collections/endpoints/create.d.ts.map +1 -1
- package/dist/collections/endpoints/create.js +0 -2
- package/dist/collections/endpoints/create.js.map +1 -1
- package/dist/collections/endpoints/updateByID.d.ts.map +1 -1
- package/dist/collections/endpoints/updateByID.js +1 -2
- package/dist/collections/endpoints/updateByID.js.map +1 -1
- package/dist/collections/operations/count.d.ts.map +1 -1
- package/dist/collections/operations/count.js +1 -0
- package/dist/collections/operations/count.js.map +1 -1
- package/dist/collections/operations/create.d.ts +0 -1
- package/dist/collections/operations/create.d.ts.map +1 -1
- package/dist/collections/operations/create.js +14 -6
- 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 +3 -0
- package/dist/collections/operations/delete.js.map +1 -1
- package/dist/collections/operations/findDistinct.d.ts.map +1 -1
- package/dist/collections/operations/findDistinct.js +1 -0
- package/dist/collections/operations/findDistinct.js.map +1 -1
- package/dist/collections/operations/local/count.d.ts +3 -3
- package/dist/collections/operations/local/count.d.ts.map +1 -1
- package/dist/collections/operations/local/count.js.map +1 -1
- package/dist/collections/operations/local/countVersions.d.ts +3 -3
- package/dist/collections/operations/local/countVersions.d.ts.map +1 -1
- package/dist/collections/operations/local/countVersions.js.map +1 -1
- package/dist/collections/operations/local/create.d.ts +3 -3
- package/dist/collections/operations/local/create.d.ts.map +1 -1
- package/dist/collections/operations/local/create.js.map +1 -1
- package/dist/collections/operations/local/delete.d.ts +3 -3
- package/dist/collections/operations/local/delete.d.ts.map +1 -1
- package/dist/collections/operations/local/delete.js.map +1 -1
- package/dist/collections/operations/local/duplicate.d.ts +3 -3
- package/dist/collections/operations/local/duplicate.d.ts.map +1 -1
- package/dist/collections/operations/local/duplicate.js.map +1 -1
- package/dist/collections/operations/local/find.d.ts +3 -3
- package/dist/collections/operations/local/find.d.ts.map +1 -1
- package/dist/collections/operations/local/find.js.map +1 -1
- package/dist/collections/operations/local/findByID.d.ts +3 -3
- package/dist/collections/operations/local/findByID.d.ts.map +1 -1
- package/dist/collections/operations/local/findByID.js.map +1 -1
- package/dist/collections/operations/local/findDistinct.d.ts +2 -2
- package/dist/collections/operations/local/findDistinct.d.ts.map +1 -1
- package/dist/collections/operations/local/findDistinct.js.map +1 -1
- package/dist/collections/operations/local/findVersionByID.d.ts +3 -3
- package/dist/collections/operations/local/findVersionByID.d.ts.map +1 -1
- package/dist/collections/operations/local/findVersionByID.js.map +1 -1
- package/dist/collections/operations/local/findVersions.d.ts +3 -3
- package/dist/collections/operations/local/findVersions.d.ts.map +1 -1
- package/dist/collections/operations/local/findVersions.js.map +1 -1
- package/dist/collections/operations/local/restoreVersion.d.ts +3 -3
- package/dist/collections/operations/local/restoreVersion.d.ts.map +1 -1
- package/dist/collections/operations/local/restoreVersion.js.map +1 -1
- package/dist/collections/operations/local/update.d.ts +7 -11
- package/dist/collections/operations/local/update.d.ts.map +1 -1
- package/dist/collections/operations/local/update.js +1 -2
- package/dist/collections/operations/local/update.js.map +1 -1
- package/dist/collections/operations/update.d.ts +0 -1
- package/dist/collections/operations/update.d.ts.map +1 -1
- package/dist/collections/operations/update.js +8 -4
- package/dist/collections/operations/update.js.map +1 -1
- package/dist/collections/operations/updateByID.d.ts +0 -1
- package/dist/collections/operations/updateByID.d.ts.map +1 -1
- package/dist/collections/operations/updateByID.js +1 -5
- package/dist/collections/operations/updateByID.js.map +1 -1
- package/dist/collections/operations/utilities/copyDataWithFreshRowIDs.d.ts +9 -0
- package/dist/collections/operations/utilities/copyDataWithFreshRowIDs.d.ts.map +1 -0
- package/dist/collections/operations/utilities/copyDataWithFreshRowIDs.js +170 -0
- package/dist/collections/operations/utilities/copyDataWithFreshRowIDs.js.map +1 -0
- package/dist/collections/operations/utilities/types.d.ts +0 -9
- package/dist/collections/operations/utilities/types.d.ts.map +1 -1
- package/dist/collections/operations/utilities/types.js.map +1 -1
- package/dist/collections/operations/utilities/update.d.ts +1 -2
- package/dist/collections/operations/utilities/update.d.ts.map +1 -1
- package/dist/collections/operations/utilities/update.js +48 -57
- package/dist/collections/operations/utilities/update.js.map +1 -1
- package/dist/config/client.d.ts +2 -2
- package/dist/config/client.d.ts.map +1 -1
- package/dist/config/client.js.map +1 -1
- package/dist/config/defaults.d.ts +0 -4
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +0 -78
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/definePlugin.d.ts +10 -10
- package/dist/config/definePlugin.d.ts.map +1 -1
- package/dist/config/definePlugin.js +7 -11
- package/dist/config/definePlugin.js.map +1 -1
- package/dist/config/orderable/index.d.ts.map +1 -1
- package/dist/config/orderable/index.js +23 -0
- package/dist/config/orderable/index.js.map +1 -1
- package/dist/config/sanitize.d.ts.map +1 -1
- package/dist/config/sanitize.js +137 -13
- package/dist/config/sanitize.js.map +1 -1
- package/dist/config/types.d.ts +57 -19
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js +2 -0
- package/dist/config/types.js.map +1 -1
- package/dist/database/getLocalizedPaths.d.ts.map +1 -1
- package/dist/database/getLocalizedPaths.js +1 -1
- package/dist/database/getLocalizedPaths.js.map +1 -1
- package/dist/database/migrations/migrationsCollection.d.ts.map +1 -1
- package/dist/database/migrations/migrationsCollection.js +2 -1
- package/dist/database/migrations/migrationsCollection.js.map +1 -1
- package/dist/errors/ValidationError.d.ts +1 -0
- package/dist/errors/ValidationError.d.ts.map +1 -1
- package/dist/errors/ValidationError.js.map +1 -1
- package/dist/exports/migrations.d.ts +5 -13
- package/dist/exports/migrations.d.ts.map +1 -1
- package/dist/exports/migrations.js +5 -13
- package/dist/exports/migrations.js.map +1 -1
- package/dist/exports/shared.d.ts +22 -1
- package/dist/exports/shared.d.ts.map +1 -1
- package/dist/exports/shared.js +22 -1
- package/dist/exports/shared.js.map +1 -1
- package/dist/fields/config/client.d.ts +2 -2
- package/dist/fields/config/client.d.ts.map +1 -1
- package/dist/fields/config/client.js +11 -12
- 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 +1 -4
- package/dist/fields/config/sanitize.js.map +1 -1
- package/dist/fields/config/types.d.ts +22 -25
- package/dist/fields/config/types.d.ts.map +1 -1
- package/dist/fields/config/types.js.map +1 -1
- package/dist/fields/hooks/afterChange/promise.js +1 -1
- package/dist/fields/hooks/afterChange/promise.js.map +1 -1
- package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/promise.js +12 -3
- package/dist/fields/hooks/afterRead/promise.js.map +1 -1
- package/dist/fields/hooks/beforeChange/promise.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/promise.js +3 -3
- package/dist/fields/hooks/beforeChange/promise.js.map +1 -1
- package/dist/fields/hooks/beforeDuplicate/promise.js +2 -2
- package/dist/fields/hooks/beforeDuplicate/promise.js.map +1 -1
- package/dist/fields/hooks/beforeValidate/promise.d.ts.map +1 -1
- package/dist/fields/hooks/beforeValidate/promise.js +11 -2
- package/dist/fields/hooks/beforeValidate/promise.js.map +1 -1
- package/dist/fields/validations.d.ts.map +1 -1
- package/dist/fields/validations.js +5 -4
- package/dist/fields/validations.js.map +1 -1
- package/dist/globals/config/sanitize.d.ts.map +1 -1
- package/dist/globals/config/sanitize.js +2 -6
- package/dist/globals/config/sanitize.js.map +1 -1
- package/dist/globals/config/sanitize.spec.js +43 -0
- package/dist/globals/config/sanitize.spec.js.map +1 -0
- package/dist/globals/endpoints/update.d.ts.map +1 -1
- package/dist/globals/endpoints/update.js +0 -2
- package/dist/globals/endpoints/update.js.map +1 -1
- package/dist/globals/operations/local/countVersions.d.ts +3 -3
- package/dist/globals/operations/local/countVersions.d.ts.map +1 -1
- package/dist/globals/operations/local/countVersions.js.map +1 -1
- package/dist/globals/operations/local/findOne.d.ts +3 -3
- package/dist/globals/operations/local/findOne.d.ts.map +1 -1
- package/dist/globals/operations/local/findOne.js.map +1 -1
- package/dist/globals/operations/local/findVersionByID.d.ts +3 -3
- package/dist/globals/operations/local/findVersionByID.d.ts.map +1 -1
- package/dist/globals/operations/local/findVersionByID.js.map +1 -1
- package/dist/globals/operations/local/findVersions.d.ts +3 -3
- package/dist/globals/operations/local/findVersions.d.ts.map +1 -1
- package/dist/globals/operations/local/findVersions.js.map +1 -1
- package/dist/globals/operations/local/restoreVersion.d.ts +3 -3
- package/dist/globals/operations/local/restoreVersion.d.ts.map +1 -1
- package/dist/globals/operations/local/restoreVersion.js.map +1 -1
- package/dist/globals/operations/local/update.d.ts +7 -9
- package/dist/globals/operations/local/update.d.ts.map +1 -1
- package/dist/globals/operations/local/update.js +1 -2
- package/dist/globals/operations/local/update.js.map +1 -1
- package/dist/globals/operations/update.d.ts +0 -1
- package/dist/globals/operations/update.d.ts.map +1 -1
- package/dist/globals/operations/update.js +52 -58
- package/dist/globals/operations/update.js.map +1 -1
- package/dist/index.bundled.d.ts +553 -268
- package/dist/index.d.ts +69 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +54 -36
- package/dist/index.js.map +1 -1
- package/dist/kv/adapters/DatabaseKVAdapter.d.ts.map +1 -1
- package/dist/kv/adapters/DatabaseKVAdapter.js +1 -0
- package/dist/kv/adapters/DatabaseKVAdapter.js.map +1 -1
- package/dist/locked-documents/config.d.ts.map +1 -1
- package/dist/locked-documents/config.js +2 -1
- package/dist/locked-documents/config.js.map +1 -1
- package/dist/preferences/config.d.ts.map +1 -1
- package/dist/preferences/config.js +2 -1
- package/dist/preferences/config.js.map +1 -1
- package/dist/preferences/keys.d.ts +4 -0
- package/dist/preferences/keys.d.ts.map +1 -1
- package/dist/preferences/keys.js +4 -1
- package/dist/preferences/keys.js.map +1 -1
- package/dist/preferences/types.d.ts +15 -0
- package/dist/preferences/types.d.ts.map +1 -1
- package/dist/preferences/types.js +3 -1
- package/dist/preferences/types.js.map +1 -1
- package/dist/query-presets/config.d.ts.map +1 -1
- package/dist/query-presets/config.js +75 -35
- 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 +2 -1
- package/dist/query-presets/constraints.js.map +1 -1
- package/dist/queues/config/collection.d.ts.map +1 -1
- package/dist/queues/config/collection.js +2 -1
- package/dist/queues/config/collection.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 +33 -12
- package/dist/queues/config/generateJobsJSONSchemas.js.map +1 -1
- package/dist/queues/config/global.d.ts.map +1 -1
- package/dist/queues/config/global.js +2 -1
- package/dist/queues/config/global.js.map +1 -1
- package/dist/types/index.d.ts +8 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/uploads/matchMimeType.d.ts +8 -0
- package/dist/uploads/matchMimeType.d.ts.map +1 -0
- package/dist/uploads/matchMimeType.js +19 -0
- package/dist/uploads/matchMimeType.js.map +1 -0
- package/dist/uploads/matchMimeType.spec.js +66 -0
- package/dist/uploads/matchMimeType.spec.js.map +1 -0
- package/dist/uploads/safeFetch.d.ts.map +1 -1
- package/dist/uploads/safeFetch.js +11 -5
- package/dist/uploads/safeFetch.js.map +1 -1
- package/dist/uploads/types.d.ts +21 -0
- package/dist/uploads/types.d.ts.map +1 -1
- package/dist/uploads/types.js.map +1 -1
- package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -1
- package/dist/utilities/addDataAndFileToRequest.js +6 -0
- package/dist/utilities/addDataAndFileToRequest.js.map +1 -1
- package/dist/utilities/appendDateTimezoneSelectFields.js +2 -2
- package/dist/utilities/appendDateTimezoneSelectFields.js.map +1 -1
- package/dist/utilities/configToJSONSchema.d.ts +68 -16
- package/dist/utilities/configToJSONSchema.d.ts.map +1 -1
- package/dist/utilities/configToJSONSchema.js +277 -101
- package/dist/utilities/configToJSONSchema.js.map +1 -1
- package/dist/utilities/configToJSONSchema.spec.js +544 -39
- package/dist/utilities/configToJSONSchema.spec.js.map +1 -1
- package/dist/utilities/createLocalReq.d.ts +2 -2
- package/dist/utilities/createLocalReq.d.ts.map +1 -1
- package/dist/utilities/createLocalReq.js.map +1 -1
- package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
- package/dist/utilities/createPayloadRequest.js +1 -0
- package/dist/utilities/createPayloadRequest.js.map +1 -1
- package/dist/utilities/deepCopyObject.d.ts.map +1 -1
- package/dist/utilities/deepCopyObject.js +8 -0
- package/dist/utilities/deepCopyObject.js.map +1 -1
- package/dist/utilities/dependencies/dependencyChecker.js +1 -1
- package/dist/utilities/dependencies/dependencyChecker.js.map +1 -1
- package/dist/utilities/dependencies/getDependencies.d.ts.map +1 -1
- package/dist/utilities/dependencies/getDependencies.js +5 -5
- package/dist/utilities/dependencies/getDependencies.js.map +1 -1
- package/dist/utilities/dynamicImport.js +1 -1
- package/dist/utilities/dynamicImport.js.map +1 -1
- package/dist/utilities/filterDataToSelectedLocales.d.ts.map +1 -1
- package/dist/utilities/filterDataToSelectedLocales.js +5 -12
- package/dist/utilities/filterDataToSelectedLocales.js.map +1 -1
- package/dist/utilities/filterDataToSelectedLocales.spec.js +1 -2
- package/dist/utilities/filterDataToSelectedLocales.spec.js.map +1 -1
- package/dist/utilities/flattenAllFields.d.ts.map +1 -1
- package/dist/utilities/flattenAllFields.js +7 -22
- package/dist/utilities/flattenAllFields.js.map +1 -1
- package/dist/utilities/formatErrors.d.ts.map +1 -1
- package/dist/utilities/formatErrors.js +3 -1
- package/dist/utilities/formatErrors.js.map +1 -1
- package/dist/utilities/getEntityPermissions/getEntityPermissions.d.ts.map +1 -1
- package/dist/utilities/getEntityPermissions/getEntityPermissions.js +2 -0
- package/dist/utilities/getEntityPermissions/getEntityPermissions.js.map +1 -1
- package/dist/utilities/getEntityPermissions/populateFieldPermissions.d.ts +7 -1
- package/dist/utilities/getEntityPermissions/populateFieldPermissions.d.ts.map +1 -1
- package/dist/utilities/getEntityPermissions/populateFieldPermissions.js +24 -7
- package/dist/utilities/getEntityPermissions/populateFieldPermissions.js.map +1 -1
- package/dist/utilities/getFieldByPath.d.ts.map +1 -1
- package/dist/utilities/getFieldByPath.js +1 -1
- package/dist/utilities/getFieldByPath.js.map +1 -1
- package/dist/utilities/getRequestLanguage.d.ts +2 -2
- package/dist/utilities/getRequestLanguage.d.ts.map +1 -1
- package/dist/utilities/getRequestLanguage.js.map +1 -1
- package/dist/utilities/getVersionsConfig.js.map +1 -1
- package/dist/utilities/handleEndpoints.d.ts.map +1 -1
- package/dist/utilities/handleEndpoints.js +7 -3
- package/dist/utilities/handleEndpoints.js.map +1 -1
- package/dist/utilities/mergeLocalizedData.d.ts +14 -4
- package/dist/utilities/mergeLocalizedData.d.ts.map +1 -1
- package/dist/utilities/mergeLocalizedData.js +54 -46
- package/dist/utilities/mergeLocalizedData.js.map +1 -1
- package/dist/utilities/mergeLocalizedData.spec.js +23 -23
- package/dist/utilities/mergeLocalizedData.spec.js.map +1 -1
- package/dist/utilities/parseParams/index.d.ts +2 -5
- package/dist/utilities/parseParams/index.d.ts.map +1 -1
- package/dist/utilities/parseParams/index.js.map +1 -1
- package/dist/utilities/parseParams/index.spec.js +0 -9
- package/dist/utilities/parseParams/index.spec.js.map +1 -1
- package/dist/utilities/transformColumnPreferences.js +4 -2
- package/dist/utilities/transformColumnPreferences.js.map +1 -1
- package/dist/utilities/traverseFields.d.ts.map +1 -1
- package/dist/utilities/traverseFields.js +2 -4
- package/dist/utilities/traverseFields.js.map +1 -1
- package/dist/utilities/traverseForLocalizedFields.d.ts.map +1 -1
- package/dist/utilities/traverseForLocalizedFields.js +3 -0
- package/dist/utilities/traverseForLocalizedFields.js.map +1 -1
- package/dist/versions/baseFields.d.ts +1 -2
- package/dist/versions/baseFields.d.ts.map +1 -1
- package/dist/versions/baseFields.js +0 -13
- package/dist/versions/baseFields.js.map +1 -1
- package/dist/versions/buildCollectionFields.d.ts.map +1 -1
- package/dist/versions/buildCollectionFields.js +0 -2
- package/dist/versions/buildCollectionFields.js.map +1 -1
- package/dist/versions/buildGlobalFields.d.ts.map +1 -1
- package/dist/versions/buildGlobalFields.js +0 -2
- package/dist/versions/buildGlobalFields.js.map +1 -1
- package/dist/versions/buildSingleLocalePublishData.d.ts +32 -0
- package/dist/versions/buildSingleLocalePublishData.d.ts.map +1 -0
- package/dist/versions/buildSingleLocalePublishData.js +37 -0
- package/dist/versions/buildSingleLocalePublishData.js.map +1 -0
- package/dist/versions/saveVersion.d.ts +0 -2
- package/dist/versions/saveVersion.d.ts.map +1 -1
- package/dist/versions/saveVersion.js +12 -17
- package/dist/versions/saveVersion.js.map +1 -1
- package/dist/versions/schedule/job.d.ts.map +1 -1
- package/dist/versions/schedule/job.js +2 -9
- package/dist/versions/schedule/job.js.map +1 -1
- package/dist/versions/types.d.ts +2 -15
- package/dist/versions/types.d.ts.map +1 -1
- package/dist/versions/types.js.map +1 -1
- package/package.json +8 -5
- package/dist/database/migrations/templates/localizeStatus.d.ts +0 -10
- package/dist/database/migrations/templates/localizeStatus.d.ts.map +0 -1
- package/dist/database/migrations/templates/localizeStatus.js +0 -54
- package/dist/database/migrations/templates/localizeStatus.js.map +0 -1
- package/dist/versions/migrations/localizeStatus/index.d.ts +0 -12
- package/dist/versions/migrations/localizeStatus/index.d.ts.map +0 -1
- package/dist/versions/migrations/localizeStatus/index.js +0 -33
- package/dist/versions/migrations/localizeStatus/index.js.map +0 -1
- package/dist/versions/migrations/localizeStatus/mongo/down.d.ts +0 -9
- package/dist/versions/migrations/localizeStatus/mongo/down.d.ts.map +0 -1
- package/dist/versions/migrations/localizeStatus/mongo/down.js +0 -112
- package/dist/versions/migrations/localizeStatus/mongo/down.js.map +0 -1
- package/dist/versions/migrations/localizeStatus/mongo/index.d.ts +0 -8
- package/dist/versions/migrations/localizeStatus/mongo/index.d.ts.map +0 -1
- package/dist/versions/migrations/localizeStatus/mongo/index.js +0 -8
- package/dist/versions/migrations/localizeStatus/mongo/index.js.map +0 -1
- package/dist/versions/migrations/localizeStatus/mongo/up.d.ts +0 -9
- package/dist/versions/migrations/localizeStatus/mongo/up.d.ts.map +0 -1
- package/dist/versions/migrations/localizeStatus/mongo/up.js +0 -220
- package/dist/versions/migrations/localizeStatus/mongo/up.js.map +0 -1
- package/dist/versions/migrations/localizeStatus/sql/down.d.ts +0 -11
- package/dist/versions/migrations/localizeStatus/sql/down.d.ts.map +0 -1
- package/dist/versions/migrations/localizeStatus/sql/down.js +0 -213
- package/dist/versions/migrations/localizeStatus/sql/down.js.map +0 -1
- package/dist/versions/migrations/localizeStatus/sql/index.d.ts +0 -8
- package/dist/versions/migrations/localizeStatus/sql/index.d.ts.map +0 -1
- package/dist/versions/migrations/localizeStatus/sql/index.js +0 -8
- package/dist/versions/migrations/localizeStatus/sql/index.js.map +0 -1
- package/dist/versions/migrations/localizeStatus/sql/migrateMainCollection.d.ts +0 -13
- package/dist/versions/migrations/localizeStatus/sql/migrateMainCollection.d.ts.map +0 -1
- package/dist/versions/migrations/localizeStatus/sql/migrateMainCollection.js +0 -51
- package/dist/versions/migrations/localizeStatus/sql/migrateMainCollection.js.map +0 -1
- package/dist/versions/migrations/localizeStatus/sql/migrateMainGlobal.d.ts +0 -13
- package/dist/versions/migrations/localizeStatus/sql/migrateMainGlobal.d.ts.map +0 -1
- package/dist/versions/migrations/localizeStatus/sql/migrateMainGlobal.js +0 -54
- package/dist/versions/migrations/localizeStatus/sql/migrateMainGlobal.js.map +0 -1
- package/dist/versions/migrations/localizeStatus/sql/up.d.ts +0 -11
- package/dist/versions/migrations/localizeStatus/sql/up.d.ts.map +0 -1
- package/dist/versions/migrations/localizeStatus/sql/up.js +0 -277
- package/dist/versions/migrations/localizeStatus/sql/up.js.map +0 -1
- package/dist/versions/saveSnapshot.d.ts +0 -18
- package/dist/versions/saveSnapshot.d.ts.map +0 -1
- package/dist/versions/saveSnapshot.js +0 -38
- package/dist/versions/saveSnapshot.js.map +0 -1
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2018-
|
|
3
|
+
Copyright (c) 2018-2026 Payload CMS, LLC <info@payloadcms.com>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
package/bin.js
CHANGED
|
@@ -23,6 +23,17 @@ if (disableTranspile) {
|
|
|
23
23
|
|
|
24
24
|
if (!useSwc) {
|
|
25
25
|
const start = async () => {
|
|
26
|
+
// tsx 4.22.4 uses Node's synchronous `module.registerHooks` API when it is available
|
|
27
|
+
// (Node v23.5+). On those versions that code path leaks tsx's internal `?namespace=...`
|
|
28
|
+
// query string onto resolved specifiers — including Node built-ins like `node:crypto` —
|
|
29
|
+
// which Node then tries to open as a file, failing with ENOENT. Removing `registerHooks`
|
|
30
|
+
// forces tsx to fall back to its older async `module.register()` worker path, which does
|
|
31
|
+
// not have this bug. See https://github.com/payloadcms/payload/issues/16949
|
|
32
|
+
const nodeModule = await import('node:module')
|
|
33
|
+
if (typeof nodeModule.default.registerHooks === 'function') {
|
|
34
|
+
nodeModule.default.registerHooks = undefined
|
|
35
|
+
}
|
|
36
|
+
|
|
26
37
|
// Use tsx
|
|
27
38
|
let tsImport = (await import('tsx/esm/api')).tsImport
|
|
28
39
|
|
package/dist/admin/RichText.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { FieldAffectingData, RichTextField, RichTextFieldClient, Validate }
|
|
|
7
7
|
import type { SanitizedGlobalConfig } from '../globals/config/types.js';
|
|
8
8
|
import type { RequestContext, TypedFallbackLocale } from '../index.js';
|
|
9
9
|
import type { JsonObject, PayloadRequest, PopulateType } from '../types/index.js';
|
|
10
|
+
import type { FieldsToJSONSchemaArgs } from '../utilities/configToJSONSchema.js';
|
|
10
11
|
import type { RichTextFieldClientProps, RichTextFieldServerProps } from './fields/RichText.js';
|
|
11
12
|
import type { FieldDiffClientProps, FieldDiffServerProps, FieldSchemaMap } from './types.js';
|
|
12
13
|
export type AfterReadRichTextHookArgs<TData extends TypeWithID = any, TValue = any, TSiblingData = any> = {
|
|
@@ -163,18 +164,9 @@ type RichTextAdapterBase<Value extends object = object, AdapterProps = any, Extr
|
|
|
163
164
|
* payload-types.ts)
|
|
164
165
|
*/
|
|
165
166
|
jsonSchema?: (args: {
|
|
166
|
-
collectionIDFieldTypes: {
|
|
167
|
-
[key: string]: 'number' | 'string';
|
|
168
|
-
};
|
|
169
|
-
config?: SanitizedConfig;
|
|
170
167
|
field: RichTextField<Value, AdapterProps, ExtraFieldProperties>;
|
|
171
|
-
i18n?: I18n;
|
|
172
|
-
/**
|
|
173
|
-
* Allows you to define new top-level interfaces that can be re-used in the output schema.
|
|
174
|
-
*/
|
|
175
|
-
interfaceNameDefinitions: Map<string, JSONSchema4>;
|
|
176
168
|
isRequired: boolean;
|
|
177
|
-
}) => JSONSchema4;
|
|
169
|
+
} & Pick<FieldsToJSONSchemaArgs, 'collectionIDFieldTypes' | 'config' | 'i18n' | 'interfaceNameDefinitions' | 'typeStringDefinitions' | 'variant'>) => JSONSchema4;
|
|
178
170
|
/**
|
|
179
171
|
* Provide validation function for the richText field. This function is run the same way
|
|
180
172
|
* as other field validation functions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichText.d.ts","sourceRoot":"","sources":["../../src/admin/RichText.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAC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MAAM,uBAAuB,CACjC,KAAK,SAAS,MAAM,GAAG,MAAM,EAC7B,YAAY,GAAG,GAAG,EAClB,oBAAoB,GAAG,EAAE,IACvB,CAAC,EACH,MAAM,EACN,MAAM,EACN,iBAAiB,GAClB,EAAE;IACD,MAAM,EAAE,eAAe,CAAA;IACvB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,iBAAiB,EAAE,OAAO,CAAA;CAC3B,KACG,OAAO,CAAC,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC,GACnE,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/admin/RichText.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { I18n } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\n\nimport type { SanitizedCollectionConfig, TypeWithID } from '../collections/config/types.js'\nimport type { ImportMapGenerators, PayloadComponent, SanitizedConfig } from '../config/types.js'\nimport type { ValidationFieldError } from '../errors/ValidationError.js'\nimport type {\n FieldAffectingData,\n RichTextField,\n RichTextFieldClient,\n Validate,\n} from '../fields/config/types.js'\nimport type { SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { RequestContext, TypedFallbackLocale } from '../index.js'\nimport type { JsonObject, PayloadRequest, PopulateType } from '../types/index.js'\nimport type { RichTextFieldClientProps, RichTextFieldServerProps } from './fields/RichText.js'\nimport type { FieldDiffClientProps, FieldDiffServerProps, FieldSchemaMap } from './types.js'\n\nexport type AfterReadRichTextHookArgs<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TData extends TypeWithID = any,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TValue = any,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TSiblingData = any,\n> = {\n currentDepth?: number\n\n depth?: number\n\n draft?: boolean\n\n fallbackLocale?: TypedFallbackLocale\n fieldPromises?: Promise<void>[]\n\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany?: boolean\n\n flattenLocales?: boolean\n\n locale?: string\n\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n\n overrideAccess?: boolean\n\n populate?: PopulateType\n\n populationPromises?: Promise<void>[]\n showHiddenFields?: boolean\n triggerAccessControl?: boolean\n triggerHooks?: boolean\n}\n\nexport type AfterChangeRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n /** The document before changes were applied. */\n previousDoc?: TData\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TSiblingData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\n\nexport type BeforeValidateRichTextHookArgs<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n overrideAccess?: boolean\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TSiblingData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\n\nexport type BeforeChangeRichTextHookArgs<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /**\n * The original data with locales (not modified by any hooks). Only available in `beforeChange` and `beforeDuplicate` field hooks.\n */\n docWithLocales?: JsonObject\n\n duplicate?: boolean\n\n errors?: ValidationFieldError[]\n /**\n * Built up field label\n *\n * @example \"Group Field > Tab Field > Rich Text Field\"\n */\n fieldLabelPath: string\n /** Only available in `beforeChange` field hooks */\n mergeLocaleActions?: (() => Promise<void> | void)[]\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n overrideAccess: boolean\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TSiblingData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n /**\n * The original siblingData with locales (not modified by any hooks).\n */\n siblingDocWithLocales?: JsonObject\n skipValidation?: boolean\n}\n\nexport type BaseRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** The collection which the field belongs to. If the field belongs to a global, this will be null. */\n collection: null | SanitizedCollectionConfig\n context: RequestContext\n /** The data passed to update the document within create and update operations, and the full document itself in the afterRead hook. */\n data?: Partial<TData>\n /** The field which the hook is running against. */\n field: FieldAffectingData\n /** The global which the field belongs to. If the field belongs to a collection, this will be null. */\n global: null | SanitizedGlobalConfig\n indexPath: number[]\n /** The full original document in `update` operations. In the `afterChange` hook, this is the resulting document of the operation. */\n originalDoc?: TData\n parentIsLocalized: boolean\n /**\n * The path of the field, e.g. [\"group\", \"myArray\", 1, \"textField\"]. The path is the schemaPath but with indexes and would be used in the context of field data, not field schemas.\n */\n path: (number | string)[]\n /** The Express request object. It is mocked for Local API operations. */\n req: PayloadRequest\n /**\n * The schemaPath of the field, e.g. [\"group\", \"myArray\", \"textField\"]. The schemaPath is the path but without indexes and would be used in the context of field schemas, not field data.\n */\n schemaPath: string[]\n /** The sibling data passed to a field that the hook is running against. */\n siblingData: Partial<TSiblingData>\n /** The value of the field. */\n value?: TValue\n}\n\nexport type AfterReadRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: AfterReadRichTextHookArgs<TData, TValue, TSiblingData> &\n BaseRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type AfterChangeRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: AfterChangeRichTextHookArgs<TData, TValue, TSiblingData> &\n BaseRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type BeforeChangeRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: BaseRichTextHookArgs<TData, TValue, TSiblingData> &\n BeforeChangeRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type BeforeValidateRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: BaseRichTextHookArgs<TData, TValue, TSiblingData> &\n BeforeValidateRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type RichTextHooks = {\n afterChange?: AfterChangeRichTextHook[]\n afterRead?: AfterReadRichTextHook[]\n beforeChange?: BeforeChangeRichTextHook[]\n beforeValidate?: BeforeValidateRichTextHook[]\n}\n\ntype RichTextAdapterBase<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = {\n /**\n * Provide a function that can be used to add items to the import map. This is useful for\n * making modules available to the client.\n */\n generateImportMap?: ImportMapGenerators[0]\n /**\n * Provide a function that can be used to add items to the schema map. This is useful for\n * richtext sub-fields the server needs to \"know\" about in order to do things like calculate form state.\n *\n * This function is run within `buildFieldSchemaMap`.\n */\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18n<any, any>\n schemaMap: FieldSchemaMap\n schemaPath: string\n }) => FieldSchemaMap\n /**\n * Like an afterRead hook, but runs only for the GraphQL resolver. For populating data, this should be used, as afterRead hooks do not have a depth in graphQL.\n *\n * To populate stuff / resolve field hooks, mutate the incoming populationPromises or fieldPromises array. They will then be awaited in the correct order within payload itself.\n * @param data\n */\n graphQLPopulationPromises?: (data: {\n context: RequestContext\n currentDepth?: number\n depth: number\n draft: boolean\n field: RichTextField<Value, AdapterProps, ExtraFieldProperties>\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n overrideAccess?: boolean\n parentIsLocalized: boolean\n populateArg?: PopulateType\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n }) => void\n hooks?: RichTextHooks\n /**\n * Return the JSON schema for the field value. The JSON schema is read by\n * `json-schema-to-typescript` which is used to generate types for this richtext field\n * payload-types.ts)\n */\n jsonSchema?: (args: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n field: RichTextField<Value, AdapterProps, ExtraFieldProperties>\n i18n?: I18n\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n /**\n * Provide validation function for the richText field. This function is run the same way\n * as other field validation functions.\n */\n validate: Validate<\n Value,\n Value,\n unknown,\n RichTextField<Value, AdapterProps, ExtraFieldProperties>\n >\n}\n\nexport type RichTextAdapter<\n Value extends object = any,\n AdapterProps = any,\n ExtraFieldProperties = any,\n> = {\n /**\n * Component that will be displayed in the list view. Can be typed as\n * `DefaultCellComponentProps` or `DefaultServerCellComponentProps`.\n */\n CellComponent: PayloadComponent<never>\n /**\n * Component that will be displayed in the version diff view.\n * If not provided, richtext content will be diffed as JSON.\n */\n DiffComponent?: PayloadComponent<\n FieldDiffServerProps<RichTextField, RichTextFieldClient>,\n FieldDiffClientProps<RichTextFieldClient>\n >\n /**\n * Component that will be displayed in the edit view.\n */\n FieldComponent: PayloadComponent<RichTextFieldServerProps, RichTextFieldClientProps>\n} & RichTextAdapterBase<Value, AdapterProps, ExtraFieldProperties>\n\nexport type RichTextAdapterProvider<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = ({\n config,\n isRoot,\n parentIsLocalized,\n}: {\n config: SanitizedConfig\n /**\n * Whether or not this is the root richText editor, defined in the top-level `editor` property\n * of the Payload Config.\n *\n * @default false\n */\n isRoot?: boolean\n parentIsLocalized: boolean\n}) =>\n | Promise<RichTextAdapter<Value, AdapterProps, ExtraFieldProperties>>\n | RichTextAdapter<Value, AdapterProps, ExtraFieldProperties>\n"],"names":[],"mappings":"AAAA,qDAAqD,GA0SrD,WAoB8D"}
|
|
1
|
+
{"version":3,"sources":["../../src/admin/RichText.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { I18n } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\n\nimport type { SanitizedCollectionConfig, TypeWithID } from '../collections/config/types.js'\nimport type { ImportMapGenerators, PayloadComponent, SanitizedConfig } from '../config/types.js'\nimport type { ValidationFieldError } from '../errors/ValidationError.js'\nimport type {\n FieldAffectingData,\n RichTextField,\n RichTextFieldClient,\n Validate,\n} from '../fields/config/types.js'\nimport type { SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { RequestContext, TypedFallbackLocale } from '../index.js'\nimport type { JsonObject, PayloadRequest, PopulateType } from '../types/index.js'\nimport type { FieldsToJSONSchemaArgs } from '../utilities/configToJSONSchema.js'\nimport type { RichTextFieldClientProps, RichTextFieldServerProps } from './fields/RichText.js'\nimport type { FieldDiffClientProps, FieldDiffServerProps, FieldSchemaMap } from './types.js'\n\nexport type AfterReadRichTextHookArgs<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TData extends TypeWithID = any,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TValue = any,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TSiblingData = any,\n> = {\n currentDepth?: number\n\n depth?: number\n\n draft?: boolean\n\n fallbackLocale?: TypedFallbackLocale\n fieldPromises?: Promise<void>[]\n\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany?: boolean\n\n flattenLocales?: boolean\n\n locale?: string\n\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n\n overrideAccess?: boolean\n\n populate?: PopulateType\n\n populationPromises?: Promise<void>[]\n showHiddenFields?: boolean\n triggerAccessControl?: boolean\n triggerHooks?: boolean\n}\n\nexport type AfterChangeRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n /** The document before changes were applied. */\n previousDoc?: TData\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TSiblingData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\n\nexport type BeforeValidateRichTextHookArgs<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n overrideAccess?: boolean\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TSiblingData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\n\nexport type BeforeChangeRichTextHookArgs<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /**\n * The original data with locales (not modified by any hooks). Only available in `beforeChange` and `beforeDuplicate` field hooks.\n */\n docWithLocales?: JsonObject\n\n duplicate?: boolean\n\n errors?: ValidationFieldError[]\n /**\n * Built up field label\n *\n * @example \"Group Field > Tab Field > Rich Text Field\"\n */\n fieldLabelPath: string\n /** Only available in `beforeChange` field hooks */\n mergeLocaleActions?: (() => Promise<void> | void)[]\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n overrideAccess: boolean\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TSiblingData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n /**\n * The original siblingData with locales (not modified by any hooks).\n */\n siblingDocWithLocales?: JsonObject\n skipValidation?: boolean\n}\n\nexport type BaseRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** The collection which the field belongs to. If the field belongs to a global, this will be null. */\n collection: null | SanitizedCollectionConfig\n context: RequestContext\n /** The data passed to update the document within create and update operations, and the full document itself in the afterRead hook. */\n data?: Partial<TData>\n /** The field which the hook is running against. */\n field: FieldAffectingData\n /** The global which the field belongs to. If the field belongs to a collection, this will be null. */\n global: null | SanitizedGlobalConfig\n indexPath: number[]\n /** The full original document in `update` operations. In the `afterChange` hook, this is the resulting document of the operation. */\n originalDoc?: TData\n parentIsLocalized: boolean\n /**\n * The path of the field, e.g. [\"group\", \"myArray\", 1, \"textField\"]. The path is the schemaPath but with indexes and would be used in the context of field data, not field schemas.\n */\n path: (number | string)[]\n /** The Express request object. It is mocked for Local API operations. */\n req: PayloadRequest\n /**\n * The schemaPath of the field, e.g. [\"group\", \"myArray\", \"textField\"]. The schemaPath is the path but without indexes and would be used in the context of field schemas, not field data.\n */\n schemaPath: string[]\n /** The sibling data passed to a field that the hook is running against. */\n siblingData: Partial<TSiblingData>\n /** The value of the field. */\n value?: TValue\n}\n\nexport type AfterReadRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: AfterReadRichTextHookArgs<TData, TValue, TSiblingData> &\n BaseRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type AfterChangeRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: AfterChangeRichTextHookArgs<TData, TValue, TSiblingData> &\n BaseRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type BeforeChangeRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: BaseRichTextHookArgs<TData, TValue, TSiblingData> &\n BeforeChangeRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type BeforeValidateRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: BaseRichTextHookArgs<TData, TValue, TSiblingData> &\n BeforeValidateRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type RichTextHooks = {\n afterChange?: AfterChangeRichTextHook[]\n afterRead?: AfterReadRichTextHook[]\n beforeChange?: BeforeChangeRichTextHook[]\n beforeValidate?: BeforeValidateRichTextHook[]\n}\n\ntype RichTextAdapterBase<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = {\n /**\n * Provide a function that can be used to add items to the import map. This is useful for\n * making modules available to the client.\n */\n generateImportMap?: ImportMapGenerators[0]\n /**\n * Provide a function that can be used to add items to the schema map. This is useful for\n * richtext sub-fields the server needs to \"know\" about in order to do things like calculate form state.\n *\n * This function is run within `buildFieldSchemaMap`.\n */\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18n<any, any>\n schemaMap: FieldSchemaMap\n schemaPath: string\n }) => FieldSchemaMap\n /**\n * Like an afterRead hook, but runs only for the GraphQL resolver. For populating data, this should be used, as afterRead hooks do not have a depth in graphQL.\n *\n * To populate stuff / resolve field hooks, mutate the incoming populationPromises or fieldPromises array. They will then be awaited in the correct order within payload itself.\n * @param data\n */\n graphQLPopulationPromises?: (data: {\n context: RequestContext\n currentDepth?: number\n depth: number\n draft: boolean\n field: RichTextField<Value, AdapterProps, ExtraFieldProperties>\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n overrideAccess?: boolean\n parentIsLocalized: boolean\n populateArg?: PopulateType\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n }) => void\n hooks?: RichTextHooks\n /**\n * Return the JSON schema for the field value. The JSON schema is read by\n * `json-schema-to-typescript` which is used to generate types for this richtext field\n * payload-types.ts)\n */\n jsonSchema?: (\n args: {\n field: RichTextField<Value, AdapterProps, ExtraFieldProperties>\n isRequired: boolean\n } & Pick<\n FieldsToJSONSchemaArgs,\n | 'collectionIDFieldTypes'\n | 'config'\n | 'i18n'\n | 'interfaceNameDefinitions'\n | 'typeStringDefinitions'\n | 'variant'\n >,\n ) => JSONSchema4\n /**\n * Provide validation function for the richText field. This function is run the same way\n * as other field validation functions.\n */\n validate: Validate<\n Value,\n Value,\n unknown,\n RichTextField<Value, AdapterProps, ExtraFieldProperties>\n >\n}\n\nexport type RichTextAdapter<\n Value extends object = any,\n AdapterProps = any,\n ExtraFieldProperties = any,\n> = {\n /**\n * Component that will be displayed in the list view. Can be typed as\n * `DefaultCellComponentProps` or `DefaultServerCellComponentProps`.\n */\n CellComponent: PayloadComponent<never>\n /**\n * Component that will be displayed in the version diff view.\n * If not provided, richtext content will be diffed as JSON.\n */\n DiffComponent?: PayloadComponent<\n FieldDiffServerProps<RichTextField, RichTextFieldClient>,\n FieldDiffClientProps<RichTextFieldClient>\n >\n /**\n * Component that will be displayed in the edit view.\n */\n FieldComponent: PayloadComponent<RichTextFieldServerProps, RichTextFieldClientProps>\n} & RichTextAdapterBase<Value, AdapterProps, ExtraFieldProperties>\n\nexport type RichTextAdapterProvider<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = ({\n config,\n isRoot,\n parentIsLocalized,\n}: {\n config: SanitizedConfig\n /**\n * Whether or not this is the root richText editor, defined in the top-level `editor` property\n * of the Payload Config.\n *\n * @default false\n */\n isRoot?: boolean\n parentIsLocalized: boolean\n}) =>\n | Promise<RichTextAdapter<Value, AdapterProps, ExtraFieldProperties>>\n | RichTextAdapter<Value, AdapterProps, ExtraFieldProperties>\n"],"names":[],"mappings":"AAAA,qDAAqD,GA8SrD,WAoB8D"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strategy for dev-mode HMR/reload detection.
|
|
3
|
+
* Each framework adapter provides its own implementation.
|
|
4
|
+
*/
|
|
5
|
+
export type DevReloadStrategy = {
|
|
6
|
+
connect: (onReload: () => void) => DevReloadCleanup;
|
|
7
|
+
};
|
|
8
|
+
export type DevReloadCleanup = () => void;
|
|
9
|
+
//# sourceMappingURL=devReload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devReload.d.ts","sourceRoot":"","sources":["../../../src/admin/adapters/devReload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,gBAAgB,CAAA;CACpD,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/adapters/devReload.ts"],"sourcesContent":["/**\n * Strategy for dev-mode HMR/reload detection.\n * Each framework adapter provides its own implementation.\n */\nexport type DevReloadStrategy = {\n connect: (onReload: () => void) => DevReloadCleanup\n}\n\nexport type DevReloadCleanup = () => void\n"],"names":[],"mappings":"AAAA;;;CAGC,GAKD,WAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/admin/adapters/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,cAAc,CAAA;AACjC,mBAAmB,aAAa,CAAA;AAChC,mBAAmB,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/admin/adapters/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,cAAc,CAAA;AACjC,mBAAmB,gBAAgB,CAAA;AACnC,mBAAmB,aAAa,CAAA;AAChC,mBAAmB,aAAa,CAAA;AAChC,mBAAmB,aAAa,CAAA;AAChC,mBAAmB,YAAY,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/admin/adapters/index.ts"],"sourcesContent":["export type * from './cookies.js'\nexport type * from './router.js'\nexport type * from './server.js'\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/adapters/index.ts"],"sourcesContent":["export type * from './cookies.js'\nexport type * from './devReload.js'\nexport type * from './render.js'\nexport type * from './router.js'\nexport type * from './server.js'\nexport type * from './views.js'\n"],"names":[],"mappings":"AAKA,WAA+B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { ImportMap, PayloadComponent } from '../../index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Pluggable component renderer.
|
|
5
|
+
* RSC-capable frameworks use the current RenderServerComponent logic.
|
|
6
|
+
* Non-RSC frameworks treat all components as client components.
|
|
7
|
+
*/
|
|
8
|
+
export type ComponentRenderer = (args: {
|
|
9
|
+
readonly clientProps?: object;
|
|
10
|
+
readonly Component?: PayloadComponent | PayloadComponent[] | React.ComponentType | React.ComponentType[];
|
|
11
|
+
readonly Fallback?: React.ComponentType;
|
|
12
|
+
readonly importMap: ImportMap;
|
|
13
|
+
readonly key?: string;
|
|
14
|
+
readonly serverProps?: object;
|
|
15
|
+
}) => React.ReactNode;
|
|
16
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/admin/adapters/render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEjE;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,SAAS,CAAC,EACf,gBAAgB,GAChB,gBAAgB,EAAE,GAClB,KAAK,CAAC,aAAa,GACnB,KAAK,CAAC,aAAa,EAAE,CAAA;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IACvC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B,KAAK,KAAK,CAAC,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/adapters/render.ts"],"sourcesContent":["import type React from 'react'\n\nimport type { ImportMap, PayloadComponent } from '../../index.js'\n\n/**\n * Pluggable component renderer.\n * RSC-capable frameworks use the current RenderServerComponent logic.\n * Non-RSC frameworks treat all components as client components.\n */\nexport type ComponentRenderer = (args: {\n readonly clientProps?: object\n readonly Component?:\n | PayloadComponent\n | PayloadComponent[]\n | React.ComponentType\n | React.ComponentType[]\n readonly Fallback?: React.ComponentType\n readonly importMap: ImportMap\n readonly key?: string\n readonly serverProps?: object\n}) => React.ReactNode\n"],"names":[],"mappings":"AAIA;;;;CAIC,GACD,WAWqB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { I18nClient } from '@payloadcms/translations';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import type { MetaConfig, SanitizedConfig } from '../../config/types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Signature for ui-side view metadata generators. Returns a framework-agnostic
|
|
6
|
+
* `MetaConfig` that adapter-side code formats into framework metadata.
|
|
7
|
+
*/
|
|
8
|
+
export type GenerateViewMetadata = (args: {
|
|
9
|
+
config: SanitizedConfig;
|
|
10
|
+
i18n: I18nClient;
|
|
11
|
+
isEditing?: boolean;
|
|
12
|
+
params?: {
|
|
13
|
+
[key: string]: string | string[];
|
|
14
|
+
};
|
|
15
|
+
}) => Promise<MetaConfig>;
|
|
16
|
+
/**
|
|
17
|
+
* One entry in a framework's `AdminViewAdapter`. Pairs a React component with
|
|
18
|
+
* a metadata generator. `TComponentProps` and `TMetadata` are framework-specific
|
|
19
|
+
* (Next narrows `TMetadata` to `next`'s `Metadata` type).
|
|
20
|
+
*/
|
|
21
|
+
export type AdminView<TComponentProps = any, TMetadata = unknown> = {
|
|
22
|
+
Component: React.ComponentType<TComponentProps>;
|
|
23
|
+
generateMetadata: (args: Parameters<GenerateViewMetadata>[0]) => Promise<TMetadata>;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The canonical set of admin view keys that every framework adapter must implement.
|
|
27
|
+
* Adding a new admin view requires adding its key here so all adapters stay in sync.
|
|
28
|
+
*/
|
|
29
|
+
export type AdminViewKey = 'account' | 'createFirstUser' | 'dashboard' | 'forgot' | 'login' | 'logout' | 'logoutInactivity' | 'notFound' | 'reset' | 'unauthorized' | 'unauthorizedWithGutter' | 'verify';
|
|
30
|
+
/**
|
|
31
|
+
* Keyed map of `AdminView` — exactly one entry per `AdminViewKey`.
|
|
32
|
+
* Framework adapters export an instance of this; missing or misspelled keys are
|
|
33
|
+
* a type error.
|
|
34
|
+
*/
|
|
35
|
+
export type AdminViewAdapter<TComponentProps = any, TMetadata = unknown> = Record<AdminViewKey, AdminView<TComponentProps, TMetadata>>;
|
|
36
|
+
//# sourceMappingURL=views.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"views.d.ts","sourceRoot":"","sources":["../../../src/admin/adapters/views.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAExE;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE;IACxC,MAAM,EAAE,eAAe,CAAA;IACvB,IAAI,EAAE,UAAU,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAA;CAC9C,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;AAEzB;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,eAAe,GAAG,GAAG,EAAE,SAAS,GAAG,OAAO,IAAI;IAClE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,eAAe,CAAC,CAAA;IAC/C,gBAAgB,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,SAAS,CAAC,CAAA;CACpF,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,iBAAiB,GACjB,WAAW,GACX,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,kBAAkB,GAClB,UAAU,GACV,OAAO,GACP,cAAc,GACd,wBAAwB,GACxB,QAAQ,CAAA;AAEZ;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,eAAe,GAAG,GAAG,EAAE,SAAS,GAAG,OAAO,IAAI,MAAM,CAC/E,YAAY,EACZ,SAAS,CAAC,eAAe,EAAE,SAAS,CAAC,CACtC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/adapters/views.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type React from 'react'\n\nimport type { MetaConfig, SanitizedConfig } from '../../config/types.js'\n\n/**\n * Signature for ui-side view metadata generators. Returns a framework-agnostic\n * `MetaConfig` that adapter-side code formats into framework metadata.\n */\nexport type GenerateViewMetadata = (args: {\n config: SanitizedConfig\n i18n: I18nClient\n isEditing?: boolean\n params?: { [key: string]: string | string[] }\n}) => Promise<MetaConfig>\n\n/**\n * One entry in a framework's `AdminViewAdapter`. Pairs a React component with\n * a metadata generator. `TComponentProps` and `TMetadata` are framework-specific\n * (Next narrows `TMetadata` to `next`'s `Metadata` type).\n */\nexport type AdminView<TComponentProps = any, TMetadata = unknown> = {\n Component: React.ComponentType<TComponentProps>\n generateMetadata: (args: Parameters<GenerateViewMetadata>[0]) => Promise<TMetadata>\n}\n\n/**\n * The canonical set of admin view keys that every framework adapter must implement.\n * Adding a new admin view requires adding its key here so all adapters stay in sync.\n */\nexport type AdminViewKey =\n | 'account'\n | 'createFirstUser'\n | 'dashboard'\n | 'forgot'\n | 'login'\n | 'logout'\n | 'logoutInactivity'\n | 'notFound'\n | 'reset'\n | 'unauthorized'\n | 'unauthorizedWithGutter'\n | 'verify'\n\n/**\n * Keyed map of `AdminView` — exactly one entry per `AdminViewKey`.\n * Framework adapters export an instance of this; missing or misspelled keys are\n * a type error.\n */\nexport type AdminViewAdapter<TComponentProps = any, TMetadata = unknown> = Record<\n AdminViewKey,\n AdminView<TComponentProps, TMetadata>\n>\n"],"names":[],"mappings":"AA4CA;;;;CAIC,GACD,WAGC"}
|
|
@@ -3,8 +3,8 @@ import type { RowField, RowFieldClient } from '../../fields/config/types.js';
|
|
|
3
3
|
import type { ClientComponentProps, ClientFieldBase, FieldClientComponent, FieldPaths, FieldServerComponent, ServerFieldBase } from '../forms/Field.js';
|
|
4
4
|
import type { FieldDescriptionClientComponent, FieldDescriptionServerComponent, FieldDiffClientComponent, FieldDiffServerComponent, FieldErrorClientComponent, FieldErrorServerComponent, FieldLabelClientComponent, FieldLabelServerComponent } from '../types.js';
|
|
5
5
|
type RowFieldClientWithoutType = MarkOptional<RowFieldClient, 'type'>;
|
|
6
|
-
type RowFieldBaseClientProps =
|
|
7
|
-
export type RowFieldClientProps =
|
|
6
|
+
type RowFieldBaseClientProps = FieldPaths & Pick<ClientComponentProps, 'forceRender'>;
|
|
7
|
+
export type RowFieldClientProps = ClientFieldBase<RowFieldClientWithoutType> & RowFieldBaseClientProps;
|
|
8
8
|
export type RowFieldServerProps = ServerFieldBase<RowField, RowFieldClientWithoutType>;
|
|
9
9
|
export type RowFieldServerComponent = FieldServerComponent<RowField, RowFieldClientWithoutType>;
|
|
10
10
|
export type RowFieldClientComponent = FieldClientComponent<RowFieldClientWithoutType, RowFieldBaseClientProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../../../src/admin/fields/Row.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC5E,OAAO,KAAK,EAC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,CAAC,CAAA;AAE/F,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,CACxD,yBAAyB,EACzB,uBAAuB,CACxB,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG,yBAAyB,CAClE,QAAQ,EACR,yBAAyB,CAC1B,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG,yBAAyB,CAAC,yBAAyB,CAAC,CAAA;AAE/F,MAAM,MAAM,kCAAkC,GAAG,+BAA+B,CAC9E,QAAQ,EACR,yBAAyB,CAC1B,CAAA;AAED,MAAM,MAAM,kCAAkC,GAC5C,+BAA+B,CAAC,yBAAyB,CAAC,CAAA;AAE5D,MAAM,MAAM,4BAA4B,GAAG,yBAAyB,CAClE,QAAQ,EACR,yBAAyB,CAC1B,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG,yBAAyB,CAAC,yBAAyB,CAAC,CAAA;AAE/F,MAAM,MAAM,2BAA2B,GAAG,wBAAwB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;AAE5F,MAAM,MAAM,2BAA2B,GAAG,wBAAwB,CAAC,cAAc,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/admin/fields/Row.ts"],"sourcesContent":["import type { MarkOptional } from 'ts-essentials'\n\nimport type { RowField, RowFieldClient } from '../../fields/config/types.js'\nimport type {\n ClientComponentProps,\n ClientFieldBase,\n FieldClientComponent,\n FieldPaths,\n FieldServerComponent,\n ServerFieldBase,\n} from '../forms/Field.js'\nimport type {\n FieldDescriptionClientComponent,\n FieldDescriptionServerComponent,\n FieldDiffClientComponent,\n FieldDiffServerComponent,\n FieldErrorClientComponent,\n FieldErrorServerComponent,\n FieldLabelClientComponent,\n FieldLabelServerComponent,\n} from '../types.js'\n\ntype RowFieldClientWithoutType = MarkOptional<RowFieldClient, 'type'>\n\ntype RowFieldBaseClientProps =
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/fields/Row.ts"],"sourcesContent":["import type { MarkOptional } from 'ts-essentials'\n\nimport type { RowField, RowFieldClient } from '../../fields/config/types.js'\nimport type {\n ClientComponentProps,\n ClientFieldBase,\n FieldClientComponent,\n FieldPaths,\n FieldServerComponent,\n ServerFieldBase,\n} from '../forms/Field.js'\nimport type {\n FieldDescriptionClientComponent,\n FieldDescriptionServerComponent,\n FieldDiffClientComponent,\n FieldDiffServerComponent,\n FieldErrorClientComponent,\n FieldErrorServerComponent,\n FieldLabelClientComponent,\n FieldLabelServerComponent,\n} from '../types.js'\n\ntype RowFieldClientWithoutType = MarkOptional<RowFieldClient, 'type'>\n\ntype RowFieldBaseClientProps = FieldPaths & Pick<ClientComponentProps, 'forceRender'>\n\nexport type RowFieldClientProps = ClientFieldBase<RowFieldClientWithoutType> &\n RowFieldBaseClientProps\n\nexport type RowFieldServerProps = ServerFieldBase<RowField, RowFieldClientWithoutType>\n\nexport type RowFieldServerComponent = FieldServerComponent<RowField, RowFieldClientWithoutType>\n\nexport type RowFieldClientComponent = FieldClientComponent<\n RowFieldClientWithoutType,\n RowFieldBaseClientProps\n>\n\nexport type RowFieldLabelServerComponent = FieldLabelServerComponent<\n RowField,\n RowFieldClientWithoutType\n>\n\nexport type RowFieldLabelClientComponent = FieldLabelClientComponent<RowFieldClientWithoutType>\n\nexport type RowFieldDescriptionServerComponent = FieldDescriptionServerComponent<\n RowField,\n RowFieldClientWithoutType\n>\n\nexport type RowFieldDescriptionClientComponent =\n FieldDescriptionClientComponent<RowFieldClientWithoutType>\n\nexport type RowFieldErrorServerComponent = FieldErrorServerComponent<\n RowField,\n RowFieldClientWithoutType\n>\n\nexport type RowFieldErrorClientComponent = FieldErrorClientComponent<RowFieldClientWithoutType>\n\nexport type RowFieldDiffServerComponent = FieldDiffServerComponent<RowField, RowFieldClient>\n\nexport type RowFieldDiffClientComponent = FieldDiffClientComponent<RowFieldClient>\n"],"names":[],"mappings":"AA8DA,WAAkF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { I18nClient, TFunction } from '@payloadcms/translations';
|
|
1
|
+
import type { ClientTranslationKeys, I18nClient, TFunction } from '@payloadcms/translations';
|
|
2
2
|
import type { Field } from '../../fields/config/types.js';
|
|
3
3
|
import type { ClientFieldWithOptionalType, ServerComponentProps } from './Field.js';
|
|
4
4
|
export type DescriptionFunction = (args: {
|
|
5
5
|
i18n: I18nClient;
|
|
6
|
-
t: TFunction
|
|
6
|
+
t: TFunction<ClientTranslationKeys>;
|
|
7
7
|
}) => string;
|
|
8
8
|
export type FieldDescriptionClientComponent<TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType> = React.ComponentType<FieldDescriptionClientProps<TFieldClient>>;
|
|
9
9
|
export type FieldDescriptionServerComponent<TFieldServer extends Field = Field, TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType> = React.ComponentType<FieldDescriptionServerProps<TFieldServer, TFieldClient>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../src/admin/forms/Description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../src/admin/forms/Description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAE5F,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,KAAK,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEnF,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE;IACvC,IAAI,EAAE,UAAU,CAAA;IAChB,CAAC,EAAE,SAAS,CAAC,qBAAqB,CAAC,CAAA;CACpC,KAAK,MAAM,CAAA;AAEZ,MAAM,MAAM,+BAA+B,CACzC,YAAY,SAAS,2BAA2B,GAAG,2BAA2B,IAC5E,KAAK,CAAC,aAAa,CAAC,2BAA2B,CAAC,YAAY,CAAC,CAAC,CAAA;AAElE,MAAM,MAAM,+BAA+B,CACzC,YAAY,SAAS,KAAK,GAAG,KAAK,EAClC,YAAY,SAAS,2BAA2B,GAAG,2BAA2B,IAC5E,KAAK,CAAC,aAAa,CAAC,2BAA2B,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAA;AAEhF,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAA;AAE/D,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG,iBAAiB,CAAA;AAEjE,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,iBAAiB,CAAA;IACxC,QAAQ,CAAC,eAAe,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAA;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,2BAA2B,CACrC,YAAY,SAAS,KAAK,GAAG,KAAK,EAClC,YAAY,SAAS,2BAA2B,GAAG,2BAA2B,IAC5E;IACF,WAAW,EAAE,YAAY,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;CAC7B,GAAG,uBAAuB,GACzB,oBAAoB,CAAA;AAEtB,MAAM,MAAM,2BAA2B,CACrC,YAAY,SAAS,2BAA2B,GAAG,2BAA2B,IAC5E;IACF,KAAK,EAAE,YAAY,CAAA;CACpB,GAAG,uBAAuB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/admin/forms/Description.ts"],"sourcesContent":["import type { I18nClient, TFunction } from '@payloadcms/translations'\n\nimport type { Field } from '../../fields/config/types.js'\nimport type { ClientFieldWithOptionalType, ServerComponentProps } from './Field.js'\n\nexport type DescriptionFunction = (args: {
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/forms/Description.ts"],"sourcesContent":["import type { ClientTranslationKeys, I18nClient, TFunction } from '@payloadcms/translations'\n\nimport type { Field } from '../../fields/config/types.js'\nimport type { ClientFieldWithOptionalType, ServerComponentProps } from './Field.js'\n\nexport type DescriptionFunction = (args: {\n i18n: I18nClient\n t: TFunction<ClientTranslationKeys>\n}) => string\n\nexport type FieldDescriptionClientComponent<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = React.ComponentType<FieldDescriptionClientProps<TFieldClient>>\n\nexport type FieldDescriptionServerComponent<\n TFieldServer extends Field = Field,\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = React.ComponentType<FieldDescriptionServerProps<TFieldServer, TFieldClient>>\n\nexport type StaticDescription = Record<string, string> | string\n\nexport type Description = DescriptionFunction | StaticDescription\n\nexport type GenericDescriptionProps = {\n readonly className?: string\n readonly description?: StaticDescription\n readonly marginPlacement?: 'bottom' | 'top'\n readonly path: string\n}\n\nexport type FieldDescriptionServerProps<\n TFieldServer extends Field = Field,\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n clientField: TFieldClient\n readonly field: TFieldServer\n} & GenericDescriptionProps &\n ServerComponentProps\n\nexport type FieldDescriptionClientProps<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n field: TFieldClient\n} & GenericDescriptionProps\n"],"names":[],"mappings":"AAuCA,WAI2B"}
|
|
@@ -2,9 +2,10 @@ import type { I18nClient } from '@payloadcms/translations';
|
|
|
2
2
|
import type { MarkOptional } from 'ts-essentials';
|
|
3
3
|
import type { SanitizedFieldPermissions } from '../../auth/types.js';
|
|
4
4
|
import type { ClientBlock, ClientField, Field } from '../../fields/config/types.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { User } from '../../index.js';
|
|
6
6
|
import type { DocumentPreferences } from '../../preferences/types.js';
|
|
7
7
|
import type { Operation, Payload, PayloadRequest } from '../../types/index.js';
|
|
8
|
+
import type { ComponentRenderer } from '../adapters/render.js';
|
|
8
9
|
import type { ClientFieldSchemaMap, ClientTab, Data, FieldSchemaMap, FormField, FormState, RenderedField } from '../types.js';
|
|
9
10
|
export type ClientFieldWithOptionalType = MarkOptional<ClientField, 'type'>;
|
|
10
11
|
export type ClientComponentProps = {
|
|
@@ -50,11 +51,9 @@ export type FieldPaths = {
|
|
|
50
51
|
* Nested fields will have a path that includes the parent field names
|
|
51
52
|
* if they are nested within a group, array, block or named tab.
|
|
52
53
|
*
|
|
53
|
-
* Collapsibles and unnamed tabs will have arbitrary paths
|
|
54
|
+
* Collapsibles, rows and unnamed tabs will have arbitrary paths
|
|
54
55
|
* that look like _index-0, _index-1, etc.
|
|
55
56
|
*
|
|
56
|
-
* Row fields will not have a path.
|
|
57
|
-
*
|
|
58
57
|
* @example 'parentGroupField.childTextField'
|
|
59
58
|
*
|
|
60
59
|
* @default field.name
|
|
@@ -85,9 +84,15 @@ export type ServerComponentProps = {
|
|
|
85
84
|
payload: Payload;
|
|
86
85
|
permissions: SanitizedFieldPermissions;
|
|
87
86
|
preferences: DocumentPreferences;
|
|
87
|
+
/**
|
|
88
|
+
* Adapter-injected component renderer. Server components can use this
|
|
89
|
+
* to render other import map components without importing a
|
|
90
|
+
* framework-specific renderer directly.
|
|
91
|
+
*/
|
|
92
|
+
renderComponent?: ComponentRenderer;
|
|
88
93
|
req: PayloadRequest;
|
|
89
94
|
siblingData: Data;
|
|
90
|
-
user:
|
|
95
|
+
user: User;
|
|
91
96
|
value?: unknown;
|
|
92
97
|
};
|
|
93
98
|
export type ClientFieldBase<TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType> = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/admin/forms/Field.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA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BAAoB,EAAE,kBAAkB,GAAG,OAAO,CAAC,CAAA;AAE5D,MAAM,MAAM,eAAe,CACzB,YAAY,SAAS,KAAK,GAAG,KAAK,EAClC,YAAY,SAAS,2BAA2B,GAAG,2BAA2B,IAC5E;IACF,QAAQ,CAAC,WAAW,EAAE,YAAY,CAAA;IAClC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;CAC7B,GAAG,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC,GACrC,IAAI,CAAC,oBAAoB,EAAE,aAAa,GAAG,OAAO,CAAC,CAAA;AAErD,MAAM,MAAM,oBAAoB,CAC9B,YAAY,SAAS,2BAA2B,GAAG,2BAA2B,EAC9E,eAAe,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IACvE,KAAK,CAAC,aAAa,CAAC,eAAe,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC,CAAA;AAExE,MAAM,MAAM,oBAAoB,CAC9B,YAAY,SAAS,KAAK,GAAG,KAAK,EAClC,YAAY,SAAS,2BAA2B,GAAG,2BAA2B,EAC9E,eAAe,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IACvE,KAAK,CAAC,aAAa,CAAC,eAAe,GAAG,eAAe,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/admin/forms/Field.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { MarkOptional } from 'ts-essentials'\n\nimport type { SanitizedFieldPermissions } from '../../auth/types.js'\nimport type { ClientBlock, ClientField, Field } from '../../fields/config/types.js'\nimport type {
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/forms/Field.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { MarkOptional } from 'ts-essentials'\n\nimport type { SanitizedFieldPermissions } from '../../auth/types.js'\nimport type { ClientBlock, ClientField, Field } from '../../fields/config/types.js'\nimport type { User } from '../../index.js'\nimport type { DocumentPreferences } from '../../preferences/types.js'\nimport type { Operation, Payload, PayloadRequest } from '../../types/index.js'\nimport type { ComponentRenderer } from '../adapters/render.js'\nimport type {\n ClientFieldSchemaMap,\n ClientTab,\n Data,\n FieldSchemaMap,\n FormField,\n FormState,\n RenderedField,\n} from '../types.js'\n\nexport type ClientFieldWithOptionalType = MarkOptional<ClientField, 'type'>\n\nexport type ClientComponentProps = {\n customComponents?: FormField['customComponents']\n field: ClientBlock | ClientField | ClientTab\n /**\n * Controls the rendering behavior of the fields, i.e. defers rendering until they intersect with the viewport using the Intersection Observer API.\n *\n * If true, the fields will be rendered immediately, rather than waiting for them to intersect with the viewport.\n *\n * If a number is provided, will immediately render fields _up to that index_.\n */\n forceRender?: boolean\n permissions?: SanitizedFieldPermissions\n readOnly?: boolean\n renderedBlocks?: RenderedField[]\n /**\n * Used to extract field configs from a schemaMap.\n * Does not include indexes.\n *\n * @default field.name\n **/\n schemaPath?: string\n}\n\n// TODO: maybe we can come up with a better name?\nexport type FieldPaths = {\n /**\n * @default ''\n */\n indexPath?: string\n /**\n * @default ''\n */\n parentPath?: string\n /**\n * The path built up to the point of the field\n * excluding the field name.\n *\n * @default ''\n */\n parentSchemaPath?: string\n /**\n * A built up path to access FieldState in the form state.\n * Nested fields will have a path that includes the parent field names\n * if they are nested within a group, array, block or named tab.\n *\n * Collapsibles, rows and unnamed tabs will have arbitrary paths\n * that look like _index-0, _index-1, etc.\n *\n * @example 'parentGroupField.childTextField'\n *\n * @default field.name\n */\n path: string\n}\n\n/**\n * TODO: This should be renamed to `FieldComponentServerProps` or similar\n */\nexport type ServerComponentProps = {\n clientField: ClientFieldWithOptionalType\n clientFieldSchemaMap: ClientFieldSchemaMap\n collectionSlug: string\n data: Data\n field: Field\n /**\n * The fieldSchemaMap that is created before form state is built is made available here.\n */\n fieldSchemaMap: FieldSchemaMap\n /**\n * Server Components will also have available to the entire form state.\n * We cannot add it to ClientComponentProps as that would blow up the size of the props sent to the client.\n */\n formState: FormState\n i18n: I18nClient\n id?: number | string\n operation: Operation\n payload: Payload\n permissions: SanitizedFieldPermissions\n preferences: DocumentPreferences\n /**\n * Adapter-injected component renderer. Server components can use this\n * to render other import map components without importing a\n * framework-specific renderer directly.\n */\n renderComponent?: ComponentRenderer\n req: PayloadRequest\n siblingData: Data\n user: User\n value?: unknown\n}\n\nexport type ClientFieldBase<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n readonly field: TFieldClient\n} & Omit<ClientComponentProps, 'customComponents' | 'field'>\n\nexport type ServerFieldBase<\n TFieldServer extends Field = Field,\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n readonly clientField: TFieldClient\n readonly field: TFieldServer\n} & Omit<ClientComponentProps, 'field'> &\n Omit<ServerComponentProps, 'clientField' | 'field'>\n\nexport type FieldClientComponent<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n AdditionalProps extends Record<string, unknown> = Record<string, unknown>,\n> = React.ComponentType<AdditionalProps & ClientFieldBase<TFieldClient>>\n\nexport type FieldServerComponent<\n TFieldServer extends Field = Field,\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n AdditionalProps extends Record<string, unknown> = Record<string, unknown>,\n> = React.ComponentType<AdditionalProps & ServerFieldBase<TFieldServer, TFieldClient>>\n"],"names":[],"mappings":"AAoIA,WAIsF"}
|
|
@@ -6,6 +6,7 @@ import type { Slugify } from '../../fields/baseFields/slug/index.js';
|
|
|
6
6
|
import type { CollectionSlug, ColumnPreference, FieldPaths, GlobalSlug, SanitizedPermissions } from '../../index.js';
|
|
7
7
|
import type { PayloadRequest, Sort, Where } from '../../types/index.js';
|
|
8
8
|
import type { ColumnsFromURL } from '../../utilities/transformColumnPreferences.js';
|
|
9
|
+
import type { ComponentRenderer } from '../adapters/render.js';
|
|
9
10
|
export type InitReqResult = {
|
|
10
11
|
cookies: Map<string, string>;
|
|
11
12
|
headers: Headers;
|
|
@@ -14,8 +15,16 @@ export type InitReqResult = {
|
|
|
14
15
|
permissions: SanitizedPermissions;
|
|
15
16
|
req: PayloadRequest;
|
|
16
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Determines how server function handlers serialize their return values.
|
|
20
|
+
* - `'rsc'`: Return React nodes (JSX) — requires RSC flight serialization (Next.js)
|
|
21
|
+
* - `'data-only'`: Return JSON-serializable data — for non-RSC adapters (TanStack Start)
|
|
22
|
+
*/
|
|
23
|
+
export type ServerFunctionMode = 'data-only' | 'rsc';
|
|
17
24
|
export type DefaultServerFunctionArgs = {
|
|
18
25
|
importMap: ImportMap;
|
|
26
|
+
mode?: ServerFunctionMode;
|
|
27
|
+
renderComponent?: ComponentRenderer;
|
|
19
28
|
} & Pick<InitReqResult, 'cookies' | 'locale' | 'permissions' | 'req'>;
|
|
20
29
|
export type ServerFunctionArgs = {
|
|
21
30
|
args: Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/admin/functions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAA;AACpE,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,oBAAoB,EACrB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,KAAK,EAAE,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in/functions/index.ts"],"sourcesContent":["import type { AcceptedLanguages } from '@payloadcms/translations'\n\nimport type { ImportMap } from '../../bin/generateImportMap/index.js'\nimport type { Locale, SanitizedConfig } from '../../config/types.js'\nimport type { PaginatedDocs } from '../../database/types.js'\nimport type { Slugify } from '../../fields/baseFields/slug/index.js'\nimport type {\n CollectionSlug,\n ColumnPreference,\n FieldPaths,\n GlobalSlug,\n SanitizedPermissions,\n} from '../../index.js'\nimport type { PayloadRequest, Sort, Where } from '../../types/index.js'\nimport type { ColumnsFromURL } from '../../utilities/transformColumnPreferences.js'\n\nexport type InitReqResult = {\n cookies: Map<string, string>\n // TODO: Remove in 4.0. Duplicative, already available in req.headers\n headers: Headers\n // TODO: Remove in 4.0. Duplicative, already available in req.i18n.language\n languageCode: AcceptedLanguages\n locale?: Locale\n permissions: SanitizedPermissions\n req: PayloadRequest\n}\n\nexport type DefaultServerFunctionArgs = {\n importMap: ImportMap\n} & Pick<InitReqResult, 'cookies' | 'locale' | 'permissions' | 'req'>\n\nexport type ServerFunctionArgs = {\n args: Record<string, unknown>\n name: string\n}\n\nexport type ServerFunctionClientArgs = {\n args: Record<string, unknown>\n name: string\n}\n\nexport type ServerFunctionClient = (args: ServerFunctionClientArgs) => Promise<unknown> | unknown\n\nexport type ServerFunction<\n TArgs extends object = Record<string, unknown>,\n TReturnType = Promise<unknown> | unknown,\n> = (args: DefaultServerFunctionArgs & TArgs) => TReturnType\n\nexport type ServerFunctionConfig = {\n fn: ServerFunction\n name: string\n}\n\nexport type ServerFunctionHandler = (\n args: {\n config: Promise<SanitizedConfig> | SanitizedConfig\n importMap: ImportMap\n /**\n * A map of server function names to their implementations. These are\n * registered alongside the base server functions and can be called\n * using the useServerFunctions() hook.\n *\n * @example\n * const { serverFunction } = useServerFunctions()\n *\n * const callServerFunction = useCallback(() => {\n *\n * async function call() {\n * const result = (await serverFunction({\n * name: 'record-key',\n * args: {\n * // Your args\n * },\n * }))\n *\n * // Do someting with the result\n * }\n *\n * void call()\n * }, [serverFunction])\n */\n serverFunctions?: Record<string, ServerFunction<any, any>>\n } & ServerFunctionClientArgs,\n) => Promise<unknown>\n\nexport type ListQuery = {\n /*\n * This is an of strings, i.e. `['title', '-slug']`\n * Use `transformColumnsToPreferences` and `transformColumnsToSearchParams` to convert it back and forth\n */\n columns?: ColumnsFromURL\n /*\n * A string representing the field to group by, e.g. `category`\n * A leading hyphen represents descending order, e.g. `-category`\n */\n groupBy?: string\n limit?: number\n page?: number\n preset?: number | string\n queryByGroup?: Record<string, ListQuery>\n /*\n When provided, is automatically injected into the `where` object\n */\n search?: string\n sort?: Sort\n where?: Where\n} & Record<string, unknown>\n\nexport type BuildTableStateArgs = {\n /**\n * If an array is provided, the table will be built to support polymorphic collections.\n */\n collectionSlug: string | string[]\n columns?: ColumnPreference[]\n data?: PaginatedDocs\n /**\n * @deprecated Use `data` instead\n */\n docs?: PaginatedDocs['docs']\n enableRowSelections?: boolean\n orderableFieldName: string\n parent?: {\n collectionSlug: CollectionSlug\n id: number | string\n joinPath: string\n }\n query?: ListQuery\n renderRowTypes?: boolean\n tableAppearance?: 'condensed' | 'default'\n}\n\nexport type SlugifyServerFunctionArgs = {\n collectionSlug?: CollectionSlug\n globalSlug?: GlobalSlug\n path?: FieldPaths['path']\n} & Omit<Parameters<Slugify>[0], 'req'>\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/admin/functions/index.ts"],"sourcesContent":["import type { AcceptedLanguages } from '@payloadcms/translations'\n\nimport type { ImportMap } from '../../bin/generateImportMap/index.js'\nimport type { Locale, SanitizedConfig } from '../../config/types.js'\nimport type { PaginatedDocs } from '../../database/types.js'\nimport type { Slugify } from '../../fields/baseFields/slug/index.js'\nimport type {\n CollectionSlug,\n ColumnPreference,\n FieldPaths,\n GlobalSlug,\n SanitizedPermissions,\n} from '../../index.js'\nimport type { PayloadRequest, Sort, Where } from '../../types/index.js'\nimport type { ColumnsFromURL } from '../../utilities/transformColumnPreferences.js'\nimport type { ComponentRenderer } from '../adapters/render.js'\n\nexport type InitReqResult = {\n cookies: Map<string, string>\n // TODO: Remove in 4.0. Duplicative, already available in req.headers\n headers: Headers\n // TODO: Remove in 4.0. Duplicative, already available in req.i18n.language\n languageCode: AcceptedLanguages\n locale?: Locale\n permissions: SanitizedPermissions\n req: PayloadRequest\n}\n\n/**\n * Determines how server function handlers serialize their return values.\n * - `'rsc'`: Return React nodes (JSX) — requires RSC flight serialization (Next.js)\n * - `'data-only'`: Return JSON-serializable data — for non-RSC adapters (TanStack Start)\n */\nexport type ServerFunctionMode = 'data-only' | 'rsc'\n\nexport type DefaultServerFunctionArgs = {\n importMap: ImportMap\n mode?: ServerFunctionMode\n renderComponent?: ComponentRenderer\n} & Pick<InitReqResult, 'cookies' | 'locale' | 'permissions' | 'req'>\n\nexport type ServerFunctionArgs = {\n args: Record<string, unknown>\n name: string\n}\n\nexport type ServerFunctionClientArgs = {\n args: Record<string, unknown>\n name: string\n}\n\nexport type ServerFunctionClient = (args: ServerFunctionClientArgs) => Promise<unknown> | unknown\n\nexport type ServerFunction<\n TArgs extends object = Record<string, unknown>,\n TReturnType = Promise<unknown> | unknown,\n> = (args: DefaultServerFunctionArgs & TArgs) => TReturnType\n\nexport type ServerFunctionConfig = {\n fn: ServerFunction\n name: string\n}\n\nexport type ServerFunctionHandler = (\n args: {\n config: Promise<SanitizedConfig> | SanitizedConfig\n importMap: ImportMap\n /**\n * A map of server function names to their implementations. These are\n * registered alongside the base server functions and can be called\n * using the useServerFunctions() hook.\n *\n * @example\n * const { serverFunction } = useServerFunctions()\n *\n * const callServerFunction = useCallback(() => {\n *\n * async function call() {\n * const result = (await serverFunction({\n * name: 'record-key',\n * args: {\n * // Your args\n * },\n * }))\n *\n * // Do someting with the result\n * }\n *\n * void call()\n * }, [serverFunction])\n */\n serverFunctions?: Record<string, ServerFunction<any, any>>\n } & ServerFunctionClientArgs,\n) => Promise<unknown>\n\nexport type ListQuery = {\n /*\n * This is an of strings, i.e. `['title', '-slug']`\n * Use `transformColumnsToPreferences` and `transformColumnsToSearchParams` to convert it back and forth\n */\n columns?: ColumnsFromURL\n /*\n * A string representing the field to group by, e.g. `category`\n * A leading hyphen represents descending order, e.g. `-category`\n */\n groupBy?: string\n limit?: number\n page?: number\n preset?: number | string\n queryByGroup?: Record<string, ListQuery>\n /*\n When provided, is automatically injected into the `where` object\n */\n search?: string\n sort?: Sort\n where?: Where\n} & Record<string, unknown>\n\nexport type BuildTableStateArgs = {\n /**\n * If an array is provided, the table will be built to support polymorphic collections.\n */\n collectionSlug: string | string[]\n columns?: ColumnPreference[]\n data?: PaginatedDocs\n /**\n * @deprecated Use `data` instead\n */\n docs?: PaginatedDocs['docs']\n enableRowSelections?: boolean\n orderableFieldName: string\n parent?: {\n collectionSlug: CollectionSlug\n id: number | string\n joinPath: string\n }\n query?: ListQuery\n renderRowTypes?: boolean\n tableAppearance?: 'condensed' | 'default'\n}\n\nexport type SlugifyServerFunctionArgs = {\n collectionSlug?: CollectionSlug\n globalSlug?: GlobalSlug\n path?: FieldPaths['path']\n} & Omit<Parameters<Slugify>[0], 'req'>\n"],"names":[],"mappings":"AA6IA,WAIuC"}
|
package/dist/admin/types.d.ts
CHANGED
|
@@ -151,8 +151,9 @@ export type DocumentSlots = {
|
|
|
151
151
|
UnpublishButton?: React.ReactNode;
|
|
152
152
|
Upload?: React.ReactNode;
|
|
153
153
|
UploadControls?: React.ReactNode;
|
|
154
|
+
UploadFilePreview?: React.ReactNode;
|
|
154
155
|
};
|
|
155
|
-
export type { BuildTableStateArgs, DefaultServerFunctionArgs, InitReqResult, ListQuery, ServerFunction, ServerFunctionArgs, ServerFunctionClient, ServerFunctionClientArgs, ServerFunctionConfig, ServerFunctionHandler, SlugifyServerFunctionArgs, } from './functions/index.js';
|
|
156
|
+
export type { BuildTableStateArgs, DefaultServerFunctionArgs, InitReqResult, ListQuery, ServerFunction, ServerFunctionArgs, ServerFunctionClient, ServerFunctionClientArgs, ServerFunctionConfig, ServerFunctionHandler, ServerFunctionMode, SlugifyServerFunctionArgs, } from './functions/index.js';
|
|
156
157
|
export type { LanguageOptions } from './LanguageOptions.js';
|
|
157
158
|
export type { RichTextAdapter, RichTextAdapterProvider, RichTextHooks } from './RichText.js';
|
|
158
159
|
export { type WidgetServerProps } from './views/dashboard.js';
|
|
@@ -195,7 +196,7 @@ AdminViewComponent, AdminViewConfig,
|
|
|
195
196
|
* Use `AdminViewServerProps` instead.
|
|
196
197
|
*/
|
|
197
198
|
AdminViewServerProps as AdminViewProps, AdminViewServerProps, AdminViewServerPropsOnly, InitPageResult, ServerPropsFromView, ViewDescriptionClientProps, ViewDescriptionServerProps, ViewDescriptionServerPropsOnly, ViewTypes, VisibleEntities, } from './views/index.js';
|
|
198
|
-
export type { AfterListClientProps, AfterListServerProps, AfterListServerPropsOnly, AfterListTableClientProps, AfterListTableServerProps, AfterListTableServerPropsOnly, BeforeListClientProps, BeforeListServerProps, BeforeListServerPropsOnly, BeforeListTableClientProps, BeforeListTableServerProps, BeforeListTableServerPropsOnly, HierarchyViewData, ListViewClientProps, ListViewServerProps, ListViewServerPropsOnly, ListViewSlots, ListViewSlotSharedClientProps, } from './views/list.js';
|
|
199
|
+
export type { AfterListClientProps, AfterListServerProps, AfterListServerPropsOnly, AfterListTableClientProps, AfterListTableServerProps, AfterListTableServerPropsOnly, BeforeListClientProps, BeforeListServerProps, BeforeListServerPropsOnly, BeforeListTableClientProps, BeforeListTableServerProps, BeforeListTableServerPropsOnly, HierarchyViewData, ListViewClientProps, ListViewServerProps, ListViewServerPropsOnly, ListViewSlots, ListViewSlotSharedClientProps, NoResultsClientProps, NoResultsServerProps, NoResultsServerPropsOnly, } from './views/list.js';
|
|
199
200
|
type SchemaPath = {} & string;
|
|
200
201
|
export type FieldSchemaMap = Map<SchemaPath, {
|
|
201
202
|
fields: Field[];
|