payload 4.0.0-internal.811e0a4 → 4.0.0-internal.8ba6b5b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/functions/index.d.ts +1 -1
- package/dist/admin/functions/index.js.map +1 -1
- package/dist/exports/internal.d.ts +1 -0
- package/dist/exports/internal.d.ts.map +1 -1
- package/dist/exports/internal.js +1 -0
- package/dist/exports/internal.js.map +1 -1
- package/dist/exports/shared.d.ts +1 -1
- package/dist/exports/shared.js.map +1 -1
- package/dist/fields/baseFields/slug/countVersions.d.ts.map +1 -1
- package/dist/fields/baseFields/slug/countVersions.js +6 -8
- package/dist/fields/baseFields/slug/countVersions.js.map +1 -1
- package/dist/fields/baseFields/slug/generateSlug.d.ts +14 -7
- package/dist/fields/baseFields/slug/generateSlug.d.ts.map +1 -1
- package/dist/fields/baseFields/slug/generateSlug.js +53 -73
- package/dist/fields/baseFields/slug/generateSlug.js.map +1 -1
- package/dist/fields/baseFields/slug/types.d.ts +14 -0
- package/dist/fields/baseFields/slug/types.d.ts.map +1 -0
- package/dist/fields/baseFields/slug/types.js +6 -0
- package/dist/fields/baseFields/slug/types.js.map +1 -0
- package/dist/fields/config/client.d.ts +1 -1
- package/dist/fields/config/client.d.ts.map +1 -1
- package/dist/fields/config/client.js +2 -1
- package/dist/fields/config/client.js.map +1 -1
- package/dist/fields/config/sanitize.d.ts.map +1 -1
- package/dist/fields/config/sanitize.js +39 -0
- package/dist/fields/config/sanitize.js.map +1 -1
- package/dist/fields/config/types.d.ts +31 -7
- package/dist/fields/config/types.d.ts.map +1 -1
- package/dist/fields/config/types.js.map +1 -1
- package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/promise.js +1 -0
- package/dist/fields/hooks/afterRead/promise.js.map +1 -1
- package/dist/fields/setDefaultBeforeDuplicate.js +1 -0
- package/dist/fields/setDefaultBeforeDuplicate.js.map +1 -1
- package/dist/fields/sortableFieldTypes.d.ts.map +1 -1
- package/dist/fields/sortableFieldTypes.js +1 -0
- package/dist/fields/sortableFieldTypes.js.map +1 -1
- package/dist/fields/validations.d.ts +4 -1
- package/dist/fields/validations.d.ts.map +1 -1
- package/dist/fields/validations.js +7 -0
- package/dist/fields/validations.js.map +1 -1
- package/dist/index.bundled.d.ts +46 -95
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/utilities/configToJSONSchema.d.ts.map +1 -1
- package/dist/utilities/configToJSONSchema.js +1 -0
- package/dist/utilities/configToJSONSchema.js.map +1 -1
- package/dist/utilities/isURLAllowed.d.ts.map +1 -1
- package/dist/utilities/isURLAllowed.js +9 -3
- package/dist/utilities/isURLAllowed.js.map +1 -1
- package/dist/utilities/isURLAllowed.spec.js +78 -0
- package/dist/utilities/isURLAllowed.spec.js.map +1 -0
- package/dist/utilities/telemetry/events/adminInit.d.ts.map +1 -1
- package/dist/utilities/telemetry/events/adminInit.js +2 -3
- package/dist/utilities/telemetry/events/adminInit.js.map +1 -1
- package/dist/utilities/telemetry/events/serverInit.d.ts.map +1 -1
- package/dist/utilities/telemetry/events/serverInit.js +2 -3
- package/dist/utilities/telemetry/events/serverInit.js.map +1 -1
- package/dist/utilities/telemetry/index.d.ts +14 -3
- package/dist/utilities/telemetry/index.d.ts.map +1 -1
- package/dist/utilities/telemetry/index.js +6 -1
- package/dist/utilities/telemetry/index.js.map +1 -1
- package/dist/utilities/telemetry/index.spec.js +43 -0
- package/dist/utilities/telemetry/index.spec.js.map +1 -0
- package/dist/versions/schedule/job.d.ts.map +1 -1
- package/dist/versions/schedule/job.js +4 -1
- package/dist/versions/schedule/job.js.map +1 -1
- package/package.json +2 -2
- package/dist/fields/baseFields/slug/index.d.ts +0 -89
- package/dist/fields/baseFields/slug/index.d.ts.map +0 -1
- package/dist/fields/baseFields/slug/index.js +0 -81
- package/dist/fields/baseFields/slug/index.js.map +0 -1
|
@@ -2,7 +2,7 @@ import type { AcceptedLanguages } from '@payloadcms/translations';
|
|
|
2
2
|
import type { ImportMap } from '../../bin/generateImportMap/index.js';
|
|
3
3
|
import type { Locale, SanitizedConfig } from '../../config/types.js';
|
|
4
4
|
import type { PaginatedDocs } from '../../database/types.js';
|
|
5
|
-
import type { Slugify } from '../../fields/baseFields/slug/
|
|
5
|
+
import type { Slugify } from '../../fields/baseFields/slug/types.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';
|
|
@@ -1 +1 @@
|
|
|
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/
|
|
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/types.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"}
|
|
@@ -7,4 +7,5 @@ export { getSafeFileName } from '../uploads/getSafeFilename.js';
|
|
|
7
7
|
export { parseRangeHeader } from '../uploads/parseRangeHeader.js';
|
|
8
8
|
export { getEntityPermissions } from '../utilities/getEntityPermissions/getEntityPermissions.js';
|
|
9
9
|
export { sanitizePermissions } from '../utilities/sanitizePermissions.js';
|
|
10
|
+
export { sendTelemetryEvent } from '../utilities/telemetry/index.js';
|
|
10
11
|
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/exports/internal.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2DAA2D,CAAA;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA"}
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/exports/internal.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAA;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2DAA2D,CAAA;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA"}
|
package/dist/exports/internal.js
CHANGED
|
@@ -6,5 +6,6 @@ export { getSafeFileName } from '../uploads/getSafeFilename.js';
|
|
|
6
6
|
export { parseRangeHeader } from '../uploads/parseRangeHeader.js';
|
|
7
7
|
export { getEntityPermissions } from '../utilities/getEntityPermissions/getEntityPermissions.js';
|
|
8
8
|
export { sanitizePermissions } from '../utilities/sanitizePermissions.js';
|
|
9
|
+
export { sendTelemetryEvent } from '../utilities/telemetry/index.js';
|
|
9
10
|
|
|
10
11
|
//# sourceMappingURL=internal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exports/internal.ts"],"sourcesContent":["/**\n * Modules exported here are not part of the public API and are subject to change without notice and without a major version bump.\n */\n\nexport { getExternalFile } from '../uploads/getExternalFile.js'\nexport { getRangeRequestInfo } from '../uploads/getRangeRequestInfo.js'\nexport { getSafeFileName } from '../uploads/getSafeFilename.js'\nexport { parseRangeHeader } from '../uploads/parseRangeHeader.js'\nexport { getEntityPermissions } from '../utilities/getEntityPermissions/getEntityPermissions.js'\nexport { sanitizePermissions } from '../utilities/sanitizePermissions.js'\n"],"names":["getExternalFile","getRangeRequestInfo","getSafeFileName","parseRangeHeader","getEntityPermissions","sanitizePermissions"],"mappings":"AAAA;;CAEC,GAED,SAASA,eAAe,QAAQ,gCAA+B;AAC/D,SAASC,mBAAmB,QAAQ,oCAAmC;AACvE,SAASC,eAAe,QAAQ,gCAA+B;AAC/D,SAASC,gBAAgB,QAAQ,iCAAgC;AACjE,SAASC,oBAAoB,QAAQ,4DAA2D;AAChG,SAASC,mBAAmB,QAAQ,sCAAqC"}
|
|
1
|
+
{"version":3,"sources":["../../src/exports/internal.ts"],"sourcesContent":["/**\n * Modules exported here are not part of the public API and are subject to change without notice and without a major version bump.\n */\n\nexport { getExternalFile } from '../uploads/getExternalFile.js'\nexport { getRangeRequestInfo } from '../uploads/getRangeRequestInfo.js'\nexport { getSafeFileName } from '../uploads/getSafeFilename.js'\nexport { parseRangeHeader } from '../uploads/parseRangeHeader.js'\nexport { getEntityPermissions } from '../utilities/getEntityPermissions/getEntityPermissions.js'\nexport { sanitizePermissions } from '../utilities/sanitizePermissions.js'\nexport { sendTelemetryEvent } from '../utilities/telemetry/index.js'\n"],"names":["getExternalFile","getRangeRequestInfo","getSafeFileName","parseRangeHeader","getEntityPermissions","sanitizePermissions","sendTelemetryEvent"],"mappings":"AAAA;;CAEC,GAED,SAASA,eAAe,QAAQ,gCAA+B;AAC/D,SAASC,mBAAmB,QAAQ,oCAAmC;AACvE,SAASC,eAAe,QAAQ,gCAA+B;AAC/D,SAASC,gBAAgB,QAAQ,iCAAgC;AACjE,SAASC,oBAAoB,QAAQ,4DAA2D;AAChG,SAASC,mBAAmB,QAAQ,sCAAqC;AACzE,SAASC,kBAAkB,QAAQ,kCAAiC"}
|
package/dist/exports/shared.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export { combineQueries } from '../database/combineQueries.js';
|
|
|
15
15
|
export { APIError, APIErrorName } from '../errors/APIError.js';
|
|
16
16
|
export { MissingEditorProp } from '../errors/MissingEditorProp.js';
|
|
17
17
|
export { UnauthorizedError } from '../errors/UnauthorizedError.js';
|
|
18
|
-
export { type Slugify } from '../fields/baseFields/slug/
|
|
18
|
+
export { type Slugify } from '../fields/baseFields/slug/types.js';
|
|
19
19
|
export { defaultTimezones } from '../fields/baseFields/timezone/defaultTimezones.js';
|
|
20
20
|
export { createClientBlocks, createClientField, createClientFields, } from '../fields/config/client.js';
|
|
21
21
|
export { fieldAffectsData, fieldHasMaxDepth, fieldHasSubFields, fieldIsArrayType, fieldIsBlockType, fieldIsGroupType, fieldIsHiddenOrDisabled, fieldIsID, fieldIsLocalized, fieldIsPresentationalOnly, fieldIsSidebar, fieldIsVirtual, fieldShouldBeLocalized, fieldSupportsMany, groupHasName, optionIsObject, optionIsValue, optionsAreObjects, tabHasName, valueIsValueWithRelation, } from '../fields/config/types.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/exports/shared.ts"],"sourcesContent":["export { EntityType } from '../admin/views/dashboard.js'\n\nexport {\n generateCookie,\n generateExpiredPayloadCookie,\n generatePayloadCookie,\n getCookieExpiration,\n parseCookies,\n} from '../auth/cookies.js'\n\nexport { extractAccessFromPermission } from '../auth/extractAccessFromPermission.js'\nexport { extractJWT } from '../auth/extractJWT.js'\nexport { getLoginOptions } from '../auth/getLoginOptions.js'\nexport { addSessionToUser, removeExpiredSessions } from '../auth/sessions.js'\n\nexport { getFromImportMap } from '../bin/generateImportMap/utilities/getFromImportMap.js'\nexport { parsePayloadComponent } from '../bin/generateImportMap/utilities/parsePayloadComponent.js'\nexport {\n type ClientCollectionConfig,\n createClientCollectionConfig,\n createClientCollectionConfigs,\n type ServerOnlyCollectionAdminProperties,\n type ServerOnlyCollectionProperties,\n type ServerOnlyUploadProperties,\n} from '../collections/config/client.js'\nexport { defaults as collectionDefaults } from '../collections/config/defaults.js'\n\nexport {\n type ClientConfig,\n createClientConfig,\n type CreateClientConfigArgs,\n createUnauthenticatedClientConfig,\n type ServerOnlyRootAdminProperties,\n type ServerOnlyRootProperties,\n type UnauthenticatedClientConfig,\n} from '../config/client.js'\nexport {\n BASE_36_DIGITS,\n generateKeyBetween,\n generateNKeysBetween,\n} from '../config/orderable/fractional-indexing.js'\nexport { isUserMenuSettingsGroup, serverProps } from '../config/types.js'\nexport { combineQueries } from '../database/combineQueries.js'\n\nexport { APIError, APIErrorName } from '../errors/APIError.js'\nexport { MissingEditorProp } from '../errors/MissingEditorProp.js'\n\nexport { UnauthorizedError } from '../errors/UnauthorizedError.js'\n\nexport { type Slugify } from '../fields/baseFields/slug/index.js'\n\nexport { defaultTimezones } from '../fields/baseFields/timezone/defaultTimezones.js'\n\nexport {\n createClientBlocks,\n createClientField,\n createClientFields,\n} from '../fields/config/client.js'\n\nexport {\n fieldAffectsData,\n fieldHasMaxDepth,\n fieldHasSubFields,\n fieldIsArrayType,\n fieldIsBlockType,\n fieldIsGroupType,\n fieldIsHiddenOrDisabled,\n fieldIsID,\n fieldIsLocalized,\n fieldIsPresentationalOnly,\n fieldIsSidebar,\n fieldIsVirtual,\n fieldShouldBeLocalized,\n fieldSupportsMany,\n groupHasName,\n optionIsObject,\n optionIsValue,\n optionsAreObjects,\n tabHasName,\n valueIsValueWithRelation,\n} from '../fields/config/types.js'\nexport { getDefaultValue } from '../fields/getDefaultValue.js'\nexport { getFieldPaths } from '../fields/getFieldPaths.js'\nexport { isFieldDisabled } from '../fields/isFieldDisabled.js'\nexport type { DisabledArea, DisabledOptions } from '../fields/isFieldDisabled.js'\nexport { sortableFieldTypes } from '../fields/sortableFieldTypes.js'\nexport * from '../fields/validations.js'\n\nexport {\n type ClientGlobalConfig,\n createClientGlobalConfig,\n createClientGlobalConfigs,\n type ServerOnlyGlobalAdminProperties,\n type ServerOnlyGlobalProperties,\n} from '../globals/config/client.js'\n\nexport {\n DEFAULT_HIERARCHY_LIST_LIMIT,\n DEFAULT_HIERARCHY_TREE_LIMIT,\n getHierarchyFieldName,\n} from '../hierarchy/constants.js'\n\nexport type { ClientHierarchyConfig, FolderBreadcrumb } from '../hierarchy/types.js'\nexport { PREFERENCE_KEYS } from '../preferences/keys.js'\n\nexport { validOperators, validOperatorSet } from '../types/constants.js'\nexport { formatFilesize } from '../uploads/formatFilesize.js'\nexport { isImage } from '../uploads/isImage.js'\nexport { matchMimeType } from '../uploads/matchMimeType.js'\nexport { appendDateTimezoneSelectFields } from '../utilities/appendDateTimezoneSelectFields.js'\nexport { appendUploadSelectFields } from '../utilities/appendUploadSelectFields.js'\n\nexport { applyLocaleFiltering } from '../utilities/applyLocaleFiltering.js'\n\nexport { canAccessAdmin } from '../utilities/canAccessAdmin.js'\n\nexport { combineWhereConstraints } from '../utilities/combineWhereConstraints.js'\nexport {\n deepCopyObject,\n deepCopyObjectComplex,\n deepCopyObjectSimple,\n deepCopyObjectSimpleWithoutReactComponents,\n} from '../utilities/deepCopyObject.js'\n\nexport {\n deepMerge,\n deepMergeWithCombinedArrays,\n deepMergeWithReactComponents,\n deepMergeWithSourceArrays,\n} from '../utilities/deepMerge.js'\nexport { extractID } from '../utilities/extractID.js'\nexport { flattenAllFields } from '../utilities/flattenAllFields.js'\n\nexport { flattenTopLevelFields } from '../utilities/flattenTopLevelFields.js'\n\nexport { formatAdminURL } from '../utilities/formatAdminURL.js'\nexport { formatErrors } from '../utilities/formatErrors.js'\n\nexport { formatLabels, toWords } from '../utilities/formatLabels.js'\nexport { getBestFitFromSizes } from '../utilities/getBestFitFromSizes.js'\nexport { getBlockSelect } from '../utilities/getBlockSelect.js'\nexport { getDataByPath } from '../utilities/getDataByPath.js'\nexport { getFieldPermissions } from '../utilities/getFieldPermissions.js'\n\nexport { getObjectDotNotation } from '../utilities/getObjectDotNotation.js'\nexport { getSafeRedirect } from '../utilities/getSafeRedirect.js'\nexport { getSelectMode } from '../utilities/getSelectMode.js'\nexport { getSiblingData } from '../utilities/getSiblingData.js'\nexport { getUniqueListBy } from '../utilities/getUniqueListBy.js'\n\nexport {\n getAutosaveInterval,\n getVersionsMax,\n hasAutosaveEnabled,\n hasDraftsEnabled,\n hasDraftValidationEnabled,\n hasLocalizeStatusEnabled,\n hasScheduledPublishEnabled,\n} from '../utilities/getVersionsConfig.js'\n\nexport { isEntityHidden } from '../utilities/isEntityHidden.js'\n\nexport { isNextBuild } from '../utilities/isNextBuild.js'\n\nexport { isNumber } from '../utilities/isNumber.js'\n\nexport { isPlainObject } from '../utilities/isPlainObject.js'\n\nexport {\n isReactClientComponent,\n isReactComponentOrFunction,\n isReactServerComponentOrFunction,\n} from '../utilities/isReactComponent.js'\n\nexport { logError } from '../utilities/logError.js'\n\nexport {\n hoistQueryParamsToAnd,\n mergeListSearchAndWhere,\n} from '../utilities/mergeListSearchAndWhere.js'\n\nexport { parseDocumentID } from '../utilities/parseDocumentID.js'\n\nexport { reduceFieldsToValues } from '../utilities/reduceFieldsToValues.js'\n\nexport { sanitizeFilename } from '../utilities/sanitizeFilename.js'\n\nexport { sanitizeUrl } from '../utilities/sanitizeUrl.js'\n\nexport { sanitizeUserDataForEmail } from '../utilities/sanitizeUserDataForEmail.js'\n\nexport { setsAreEqual } from '../utilities/setsAreEqual.js'\n\nexport { slugify } from '../utilities/slugify.js'\n\nexport { stripUnselectedFields } from '../utilities/stripUnselectedFields.js'\n\nexport { toKebabCase } from '../utilities/toKebabCase.js'\n\nexport {\n transformColumnsToPreferences,\n transformColumnsToSearchParams,\n} from '../utilities/transformColumnPreferences.js'\n\nexport { transformWhereQuery } from '../utilities/transformWhereQuery.js'\n\nexport { traverseFields } from '../utilities/traverseFields.js'\nexport { unflatten } from '../utilities/unflatten.js'\nexport { validateMimeType } from '../utilities/validateMimeType.js'\nexport { validateWhereQuery } from '../utilities/validateWhereQuery.js'\nexport { wait } from '../utilities/wait.js'\nexport { wordBoundariesRegex } from '../utilities/wordBoundariesRegex.js'\nexport { versionDefaults } from '../versions/defaults.js'\n\nexport { deepMergeSimple } from '@payloadcms/translations/utilities'\n"],"names":["EntityType","generateCookie","generateExpiredPayloadCookie","generatePayloadCookie","getCookieExpiration","parseCookies","extractAccessFromPermission","extractJWT","getLoginOptions","addSessionToUser","removeExpiredSessions","getFromImportMap","parsePayloadComponent","createClientCollectionConfig","createClientCollectionConfigs","defaults","collectionDefaults","createClientConfig","createUnauthenticatedClientConfig","BASE_36_DIGITS","generateKeyBetween","generateNKeysBetween","isUserMenuSettingsGroup","serverProps","combineQueries","APIError","APIErrorName","MissingEditorProp","UnauthorizedError","defaultTimezones","createClientBlocks","createClientField","createClientFields","fieldAffectsData","fieldHasMaxDepth","fieldHasSubFields","fieldIsArrayType","fieldIsBlockType","fieldIsGroupType","fieldIsHiddenOrDisabled","fieldIsID","fieldIsLocalized","fieldIsPresentationalOnly","fieldIsSidebar","fieldIsVirtual","fieldShouldBeLocalized","fieldSupportsMany","groupHasName","optionIsObject","optionIsValue","optionsAreObjects","tabHasName","valueIsValueWithRelation","getDefaultValue","getFieldPaths","isFieldDisabled","sortableFieldTypes","createClientGlobalConfig","createClientGlobalConfigs","DEFAULT_HIERARCHY_LIST_LIMIT","DEFAULT_HIERARCHY_TREE_LIMIT","getHierarchyFieldName","PREFERENCE_KEYS","validOperators","validOperatorSet","formatFilesize","isImage","matchMimeType","appendDateTimezoneSelectFields","appendUploadSelectFields","applyLocaleFiltering","canAccessAdmin","combineWhereConstraints","deepCopyObject","deepCopyObjectComplex","deepCopyObjectSimple","deepCopyObjectSimpleWithoutReactComponents","deepMerge","deepMergeWithCombinedArrays","deepMergeWithReactComponents","deepMergeWithSourceArrays","extractID","flattenAllFields","flattenTopLevelFields","formatAdminURL","formatErrors","formatLabels","toWords","getBestFitFromSizes","getBlockSelect","getDataByPath","getFieldPermissions","getObjectDotNotation","getSafeRedirect","getSelectMode","getSiblingData","getUniqueListBy","getAutosaveInterval","getVersionsMax","hasAutosaveEnabled","hasDraftsEnabled","hasDraftValidationEnabled","hasLocalizeStatusEnabled","hasScheduledPublishEnabled","isEntityHidden","isNextBuild","isNumber","isPlainObject","isReactClientComponent","isReactComponentOrFunction","isReactServerComponentOrFunction","logError","hoistQueryParamsToAnd","mergeListSearchAndWhere","parseDocumentID","reduceFieldsToValues","sanitizeFilename","sanitizeUrl","sanitizeUserDataForEmail","setsAreEqual","slugify","stripUnselectedFields","toKebabCase","transformColumnsToPreferences","transformColumnsToSearchParams","transformWhereQuery","traverseFields","unflatten","validateMimeType","validateWhereQuery","wait","wordBoundariesRegex","versionDefaults","deepMergeSimple"],"mappings":"AAAA,SAASA,UAAU,QAAQ,8BAA6B;AAExD,SACEC,cAAc,EACdC,4BAA4B,EAC5BC,qBAAqB,EACrBC,mBAAmB,EACnBC,YAAY,QACP,qBAAoB;AAE3B,SAASC,2BAA2B,QAAQ,yCAAwC;AACpF,SAASC,UAAU,QAAQ,wBAAuB;AAClD,SAASC,eAAe,QAAQ,6BAA4B;AAC5D,SAASC,gBAAgB,EAAEC,qBAAqB,QAAQ,sBAAqB;AAE7E,SAASC,gBAAgB,QAAQ,yDAAwD;AACzF,SAASC,qBAAqB,QAAQ,8DAA6D;AACnG,SAEEC,4BAA4B,EAC5BC,6BAA6B,QAIxB,kCAAiC;AACxC,SAASC,YAAYC,kBAAkB,QAAQ,oCAAmC;AAElF,SAEEC,kBAAkB,EAElBC,iCAAiC,QAI5B,sBAAqB;AAC5B,SACEC,cAAc,EACdC,kBAAkB,EAClBC,oBAAoB,QACf,6CAA4C;AACnD,SAASC,uBAAuB,EAAEC,WAAW,QAAQ,qBAAoB;AACzE,SAASC,cAAc,QAAQ,gCAA+B;AAE9D,SAASC,QAAQ,EAAEC,YAAY,QAAQ,wBAAuB;AAC9D,SAASC,iBAAiB,QAAQ,iCAAgC;AAElE,SAASC,iBAAiB,QAAQ,iCAAgC;AAIlE,SAASC,gBAAgB,QAAQ,oDAAmD;AAEpF,SACEC,kBAAkB,EAClBC,iBAAiB,EACjBC,kBAAkB,QACb,6BAA4B;AAEnC,SACEC,gBAAgB,EAChBC,gBAAgB,EAChBC,iBAAiB,EACjBC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,EAChBC,uBAAuB,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,SAASC,gBAAgB,QAAQ,mCAAkC;AACnE,SAASC,kBAAkB,QAAQ,qCAAoC;AACvE,SAASC,IAAI,QAAQ,uBAAsB;AAC3C,SAASC,mBAAmB,QAAQ,sCAAqC;AACzE,SAASC,eAAe,QAAQ,0BAAyB;AAEzD,SAASC,eAAe,QAAQ,qCAAoC"}
|
|
1
|
+
{"version":3,"sources":["../../src/exports/shared.ts"],"sourcesContent":["export { EntityType } from '../admin/views/dashboard.js'\n\nexport {\n generateCookie,\n generateExpiredPayloadCookie,\n generatePayloadCookie,\n getCookieExpiration,\n parseCookies,\n} from '../auth/cookies.js'\n\nexport { extractAccessFromPermission } from '../auth/extractAccessFromPermission.js'\nexport { extractJWT } from '../auth/extractJWT.js'\nexport { getLoginOptions } from '../auth/getLoginOptions.js'\nexport { addSessionToUser, removeExpiredSessions } from '../auth/sessions.js'\n\nexport { getFromImportMap } from '../bin/generateImportMap/utilities/getFromImportMap.js'\nexport { parsePayloadComponent } from '../bin/generateImportMap/utilities/parsePayloadComponent.js'\nexport {\n type ClientCollectionConfig,\n createClientCollectionConfig,\n createClientCollectionConfigs,\n type ServerOnlyCollectionAdminProperties,\n type ServerOnlyCollectionProperties,\n type ServerOnlyUploadProperties,\n} from '../collections/config/client.js'\nexport { defaults as collectionDefaults } from '../collections/config/defaults.js'\n\nexport {\n type ClientConfig,\n createClientConfig,\n type CreateClientConfigArgs,\n createUnauthenticatedClientConfig,\n type ServerOnlyRootAdminProperties,\n type ServerOnlyRootProperties,\n type UnauthenticatedClientConfig,\n} from '../config/client.js'\nexport {\n BASE_36_DIGITS,\n generateKeyBetween,\n generateNKeysBetween,\n} from '../config/orderable/fractional-indexing.js'\nexport { isUserMenuSettingsGroup, serverProps } from '../config/types.js'\nexport { combineQueries } from '../database/combineQueries.js'\n\nexport { APIError, APIErrorName } from '../errors/APIError.js'\nexport { MissingEditorProp } from '../errors/MissingEditorProp.js'\n\nexport { UnauthorizedError } from '../errors/UnauthorizedError.js'\n\nexport { type Slugify } from '../fields/baseFields/slug/types.js'\n\nexport { defaultTimezones } from '../fields/baseFields/timezone/defaultTimezones.js'\n\nexport {\n createClientBlocks,\n createClientField,\n createClientFields,\n} from '../fields/config/client.js'\n\nexport {\n fieldAffectsData,\n fieldHasMaxDepth,\n fieldHasSubFields,\n fieldIsArrayType,\n fieldIsBlockType,\n fieldIsGroupType,\n fieldIsHiddenOrDisabled,\n fieldIsID,\n fieldIsLocalized,\n fieldIsPresentationalOnly,\n fieldIsSidebar,\n fieldIsVirtual,\n fieldShouldBeLocalized,\n fieldSupportsMany,\n groupHasName,\n optionIsObject,\n optionIsValue,\n optionsAreObjects,\n tabHasName,\n valueIsValueWithRelation,\n} from '../fields/config/types.js'\nexport { getDefaultValue } from '../fields/getDefaultValue.js'\nexport { getFieldPaths } from '../fields/getFieldPaths.js'\nexport { isFieldDisabled } from '../fields/isFieldDisabled.js'\nexport type { DisabledArea, DisabledOptions } from '../fields/isFieldDisabled.js'\nexport { sortableFieldTypes } from '../fields/sortableFieldTypes.js'\nexport * from '../fields/validations.js'\n\nexport {\n type ClientGlobalConfig,\n createClientGlobalConfig,\n createClientGlobalConfigs,\n type ServerOnlyGlobalAdminProperties,\n type ServerOnlyGlobalProperties,\n} from '../globals/config/client.js'\n\nexport {\n DEFAULT_HIERARCHY_LIST_LIMIT,\n DEFAULT_HIERARCHY_TREE_LIMIT,\n getHierarchyFieldName,\n} from '../hierarchy/constants.js'\n\nexport type { ClientHierarchyConfig, FolderBreadcrumb } from '../hierarchy/types.js'\nexport { PREFERENCE_KEYS } from '../preferences/keys.js'\n\nexport { validOperators, validOperatorSet } from '../types/constants.js'\nexport { formatFilesize } from '../uploads/formatFilesize.js'\nexport { isImage } from '../uploads/isImage.js'\nexport { matchMimeType } from '../uploads/matchMimeType.js'\nexport { appendDateTimezoneSelectFields } from '../utilities/appendDateTimezoneSelectFields.js'\nexport { appendUploadSelectFields } from '../utilities/appendUploadSelectFields.js'\n\nexport { applyLocaleFiltering } from '../utilities/applyLocaleFiltering.js'\n\nexport { canAccessAdmin } from '../utilities/canAccessAdmin.js'\n\nexport { combineWhereConstraints } from '../utilities/combineWhereConstraints.js'\nexport {\n deepCopyObject,\n deepCopyObjectComplex,\n deepCopyObjectSimple,\n deepCopyObjectSimpleWithoutReactComponents,\n} from '../utilities/deepCopyObject.js'\n\nexport {\n deepMerge,\n deepMergeWithCombinedArrays,\n deepMergeWithReactComponents,\n deepMergeWithSourceArrays,\n} from '../utilities/deepMerge.js'\nexport { extractID } from '../utilities/extractID.js'\nexport { flattenAllFields } from '../utilities/flattenAllFields.js'\n\nexport { flattenTopLevelFields } from '../utilities/flattenTopLevelFields.js'\n\nexport { formatAdminURL } from '../utilities/formatAdminURL.js'\nexport { formatErrors } from '../utilities/formatErrors.js'\n\nexport { formatLabels, toWords } from '../utilities/formatLabels.js'\nexport { getBestFitFromSizes } from '../utilities/getBestFitFromSizes.js'\nexport { getBlockSelect } from '../utilities/getBlockSelect.js'\nexport { getDataByPath } from '../utilities/getDataByPath.js'\nexport { getFieldPermissions } from '../utilities/getFieldPermissions.js'\n\nexport { getObjectDotNotation } from '../utilities/getObjectDotNotation.js'\nexport { getSafeRedirect } from '../utilities/getSafeRedirect.js'\nexport { getSelectMode } from '../utilities/getSelectMode.js'\nexport { getSiblingData } from '../utilities/getSiblingData.js'\nexport { getUniqueListBy } from '../utilities/getUniqueListBy.js'\n\nexport {\n getAutosaveInterval,\n getVersionsMax,\n hasAutosaveEnabled,\n hasDraftsEnabled,\n hasDraftValidationEnabled,\n hasLocalizeStatusEnabled,\n hasScheduledPublishEnabled,\n} from '../utilities/getVersionsConfig.js'\n\nexport { isEntityHidden } from '../utilities/isEntityHidden.js'\n\nexport { isNextBuild } from '../utilities/isNextBuild.js'\n\nexport { isNumber } from '../utilities/isNumber.js'\n\nexport { isPlainObject } from '../utilities/isPlainObject.js'\n\nexport {\n isReactClientComponent,\n isReactComponentOrFunction,\n isReactServerComponentOrFunction,\n} from '../utilities/isReactComponent.js'\n\nexport { logError } from '../utilities/logError.js'\n\nexport {\n hoistQueryParamsToAnd,\n mergeListSearchAndWhere,\n} from '../utilities/mergeListSearchAndWhere.js'\n\nexport { parseDocumentID } from '../utilities/parseDocumentID.js'\n\nexport { reduceFieldsToValues } from '../utilities/reduceFieldsToValues.js'\n\nexport { sanitizeFilename } from '../utilities/sanitizeFilename.js'\n\nexport { sanitizeUrl } from '../utilities/sanitizeUrl.js'\n\nexport { sanitizeUserDataForEmail } from '../utilities/sanitizeUserDataForEmail.js'\n\nexport { setsAreEqual } from '../utilities/setsAreEqual.js'\n\nexport { slugify } from '../utilities/slugify.js'\n\nexport { stripUnselectedFields } from '../utilities/stripUnselectedFields.js'\n\nexport { toKebabCase } from '../utilities/toKebabCase.js'\n\nexport {\n transformColumnsToPreferences,\n transformColumnsToSearchParams,\n} from '../utilities/transformColumnPreferences.js'\n\nexport { transformWhereQuery } from '../utilities/transformWhereQuery.js'\n\nexport { traverseFields } from '../utilities/traverseFields.js'\nexport { unflatten } from '../utilities/unflatten.js'\nexport { validateMimeType } from '../utilities/validateMimeType.js'\nexport { validateWhereQuery } from '../utilities/validateWhereQuery.js'\nexport { wait } from '../utilities/wait.js'\nexport { wordBoundariesRegex } from '../utilities/wordBoundariesRegex.js'\nexport { versionDefaults } from '../versions/defaults.js'\n\nexport { deepMergeSimple } from '@payloadcms/translations/utilities'\n"],"names":["EntityType","generateCookie","generateExpiredPayloadCookie","generatePayloadCookie","getCookieExpiration","parseCookies","extractAccessFromPermission","extractJWT","getLoginOptions","addSessionToUser","removeExpiredSessions","getFromImportMap","parsePayloadComponent","createClientCollectionConfig","createClientCollectionConfigs","defaults","collectionDefaults","createClientConfig","createUnauthenticatedClientConfig","BASE_36_DIGITS","generateKeyBetween","generateNKeysBetween","isUserMenuSettingsGroup","serverProps","combineQueries","APIError","APIErrorName","MissingEditorProp","UnauthorizedError","defaultTimezones","createClientBlocks","createClientField","createClientFields","fieldAffectsData","fieldHasMaxDepth","fieldHasSubFields","fieldIsArrayType","fieldIsBlockType","fieldIsGroupType","fieldIsHiddenOrDisabled","fieldIsID","fieldIsLocalized","fieldIsPresentationalOnly","fieldIsSidebar","fieldIsVirtual","fieldShouldBeLocalized","fieldSupportsMany","groupHasName","optionIsObject","optionIsValue","optionsAreObjects","tabHasName","valueIsValueWithRelation","getDefaultValue","getFieldPaths","isFieldDisabled","sortableFieldTypes","createClientGlobalConfig","createClientGlobalConfigs","DEFAULT_HIERARCHY_LIST_LIMIT","DEFAULT_HIERARCHY_TREE_LIMIT","getHierarchyFieldName","PREFERENCE_KEYS","validOperators","validOperatorSet","formatFilesize","isImage","matchMimeType","appendDateTimezoneSelectFields","appendUploadSelectFields","applyLocaleFiltering","canAccessAdmin","combineWhereConstraints","deepCopyObject","deepCopyObjectComplex","deepCopyObjectSimple","deepCopyObjectSimpleWithoutReactComponents","deepMerge","deepMergeWithCombinedArrays","deepMergeWithReactComponents","deepMergeWithSourceArrays","extractID","flattenAllFields","flattenTopLevelFields","formatAdminURL","formatErrors","formatLabels","toWords","getBestFitFromSizes","getBlockSelect","getDataByPath","getFieldPermissions","getObjectDotNotation","getSafeRedirect","getSelectMode","getSiblingData","getUniqueListBy","getAutosaveInterval","getVersionsMax","hasAutosaveEnabled","hasDraftsEnabled","hasDraftValidationEnabled","hasLocalizeStatusEnabled","hasScheduledPublishEnabled","isEntityHidden","isNextBuild","isNumber","isPlainObject","isReactClientComponent","isReactComponentOrFunction","isReactServerComponentOrFunction","logError","hoistQueryParamsToAnd","mergeListSearchAndWhere","parseDocumentID","reduceFieldsToValues","sanitizeFilename","sanitizeUrl","sanitizeUserDataForEmail","setsAreEqual","slugify","stripUnselectedFields","toKebabCase","transformColumnsToPreferences","transformColumnsToSearchParams","transformWhereQuery","traverseFields","unflatten","validateMimeType","validateWhereQuery","wait","wordBoundariesRegex","versionDefaults","deepMergeSimple"],"mappings":"AAAA,SAASA,UAAU,QAAQ,8BAA6B;AAExD,SACEC,cAAc,EACdC,4BAA4B,EAC5B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ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,UAAU,EACV,cAAc,
|
|
1
|
+
{"version":3,"file":"countVersions.d.ts","sourceRoot":"","sources":["../../../../src/fields/baseFields/slug/countVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,UAAU,EACV,cAAc,EACf,MAAM,mBAAmB,CAAA;AAE1B;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAU,MAAM;IACxC,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,QAAQ,CAAC,EAAE,qBAAqB,CAAA;IAChC,GAAG,EAAE,cAAc,CAAA;CACpB,KAAG,OAAO,CAAC,MAAM,CA2BjB,CAAA"}
|
|
@@ -5,21 +5,19 @@
|
|
|
5
5
|
*/ export const countVersions = async (args)=>{
|
|
6
6
|
const { collectionSlug, globalSlug, parentID, req } = args;
|
|
7
7
|
let countFn;
|
|
8
|
-
const where = {
|
|
9
|
-
parent: {
|
|
10
|
-
equals: parentID
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
8
|
if (collectionSlug) {
|
|
14
9
|
countFn = ()=>req.payload.countVersions({
|
|
15
10
|
collection: collectionSlug,
|
|
16
|
-
where
|
|
11
|
+
where: {
|
|
12
|
+
parent: {
|
|
13
|
+
equals: parentID
|
|
14
|
+
}
|
|
15
|
+
}
|
|
17
16
|
});
|
|
18
17
|
}
|
|
19
18
|
if (globalSlug) {
|
|
20
19
|
countFn = ()=>req.payload.countGlobalVersions({
|
|
21
|
-
global: globalSlug
|
|
22
|
-
where
|
|
20
|
+
global: globalSlug
|
|
23
21
|
});
|
|
24
22
|
}
|
|
25
23
|
const res = countFn ? await countFn()?.then((res)=>res.totalDocs || 0) || 0 : 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/fields/baseFields/slug/countVersions.ts"],"sourcesContent":["import type {\n CollectionSlug,\n DefaultDocumentIDType,\n GlobalSlug,\n PayloadRequest,\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/fields/baseFields/slug/countVersions.ts"],"sourcesContent":["import type {\n CollectionSlug,\n DefaultDocumentIDType,\n GlobalSlug,\n PayloadRequest,\n} from '../../../index.js'\n\n/**\n * This is a cross-entity way to count the number of versions for any given document.\n * It will work for both collections and globals.\n * @returns number of versions\n */\nexport const countVersions = async (args: {\n collectionSlug?: CollectionSlug\n globalSlug?: GlobalSlug\n parentID?: DefaultDocumentIDType\n req: PayloadRequest\n}): Promise<number> => {\n const { collectionSlug, globalSlug, parentID, req } = args\n\n let countFn\n\n if (collectionSlug) {\n countFn = () =>\n req.payload.countVersions({\n collection: collectionSlug,\n where: {\n parent: {\n equals: parentID,\n },\n },\n })\n }\n\n if (globalSlug) {\n countFn = () =>\n req.payload.countGlobalVersions({\n global: globalSlug,\n })\n }\n\n const res = countFn ? (await countFn()?.then((res) => res.totalDocs || 0)) || 0 : 0\n\n return res\n}\n"],"names":["countVersions","args","collectionSlug","globalSlug","parentID","req","countFn","payload","collection","where","parent","equals","countGlobalVersions","global","res","then","totalDocs"],"mappings":"AAOA;;;;CAIC,GACD,OAAO,MAAMA,gBAAgB,OAAOC;IAMlC,MAAM,EAAEC,cAAc,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,GAAG,EAAE,GAAGJ;IAEtD,IAAIK;IAEJ,IAAIJ,gBAAgB;QAClBI,UAAU,IACRD,IAAIE,OAAO,CAACP,aAAa,CAAC;gBACxBQ,YAAYN;gBACZO,OAAO;oBACLC,QAAQ;wBACNC,QAAQP;oBACV;gBACF;YACF;IACJ;IAEA,IAAID,YAAY;QACdG,UAAU,IACRD,IAAIE,OAAO,CAACK,mBAAmB,CAAC;gBAC9BC,QAAQV;YACV;IACJ;IAEA,MAAMW,MAAMR,UAAU,AAAC,MAAMA,WAAWS,KAAK,CAACD,MAAQA,IAAIE,SAAS,IAAI,MAAO,IAAI;IAElF,OAAOF;AACT,EAAC"}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import type { FieldHook } from '../../config/types.js';
|
|
2
|
-
import type {
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import type { Slugify } from './types.js';
|
|
3
|
+
type Args = {
|
|
4
|
+
name: string;
|
|
5
|
+
slugify?: Slugify;
|
|
6
|
+
useAsSlug: string;
|
|
7
|
+
};
|
|
6
8
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
+
* Field `beforeChange` hook for the native `slug` field. Returns the slug value.
|
|
10
|
+
*
|
|
11
|
+
* Auto-tracking is derived statelessly: the slug follows its source while it is
|
|
12
|
+
* empty or still equals `slugify(storedSource)`. Once it diverges (the admin
|
|
13
|
+
* overwrites it), it freezes — and stays frozen, because the stored value keeps
|
|
14
|
+
* differing from `slugify(source)`. Re-aligning (the UI generate button) resumes
|
|
15
|
+
* tracking.
|
|
9
16
|
*/
|
|
10
|
-
export declare const generateSlug: ({
|
|
17
|
+
export declare const generateSlug: ({ name, slugify: customSlugify, useAsSlug }: Args) => FieldHook;
|
|
11
18
|
export {};
|
|
12
19
|
//# sourceMappingURL=generateSlug.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateSlug.d.ts","sourceRoot":"","sources":["../../../../src/fields/baseFields/slug/generateSlug.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"generateSlug.d.ts","sourceRoot":"","sources":["../../../../src/fields/baseFields/slug/generateSlug.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAMzC,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GACtB,6CAA6C,IAAI,KAAG,SA+DpD,CAAA"}
|
|
@@ -1,84 +1,64 @@
|
|
|
1
1
|
import { hasAutosaveEnabled } from '../../../utilities/getVersionsConfig.js';
|
|
2
2
|
import { slugify as defaultSlugify } from '../../../utilities/slugify.js';
|
|
3
3
|
import { countVersions } from './countVersions.js';
|
|
4
|
-
const slugify = ({ customSlugify, data, req, valueToSlugify })=>{
|
|
5
|
-
if (customSlugify) {
|
|
6
|
-
return customSlugify({
|
|
7
|
-
data,
|
|
8
|
-
req,
|
|
9
|
-
valueToSlugify
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
return defaultSlugify(valueToSlugify);
|
|
13
|
-
};
|
|
14
4
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
|
|
5
|
+
* Field `beforeChange` hook for the native `slug` field. Returns the slug value.
|
|
6
|
+
*
|
|
7
|
+
* Auto-tracking is derived statelessly: the slug follows its source while it is
|
|
8
|
+
* empty or still equals `slugify(storedSource)`. Once it diverges (the admin
|
|
9
|
+
* overwrites it), it freezes — and stays frozen, because the stored value keeps
|
|
10
|
+
* differing from `slugify(source)`. Re-aligning (the UI generate button) resumes
|
|
11
|
+
* tracking.
|
|
12
|
+
*/ export const generateSlug = ({ name, slugify: customSlugify, useAsSlug })=>async ({ collection, data, global, operation, originalDoc, req, value })=>{
|
|
13
|
+
const source = data?.[useAsSlug];
|
|
14
|
+
const slugify = (valueToSlugify)=>customSlugify ? customSlugify({
|
|
15
|
+
data: data ?? {},
|
|
16
|
+
req,
|
|
17
|
+
valueToSlugify
|
|
18
|
+
}) : defaultSlugify(valueToSlugify);
|
|
19
|
+
const entity = collection || global;
|
|
18
20
|
if (operation === 'create') {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
req,
|
|
24
|
-
// Ensure user-defined slugs are not overwritten during create
|
|
25
|
-
// Use a generic falsy check here to include empty strings
|
|
26
|
-
valueToSlugify: data?.[slugFieldName] || data?.[useAsSlug]
|
|
27
|
-
});
|
|
21
|
+
// Autosave drafts: do not auto-generate on the initial draft — the user is still entering content.
|
|
22
|
+
// Keep the explicit non-slugified value (if any); generation begins on a later autosave.
|
|
23
|
+
if (hasAutosaveEnabled(entity) && data?._status === 'draft') {
|
|
24
|
+
return value || null;
|
|
28
25
|
}
|
|
29
|
-
|
|
26
|
+
// Keep an explicitly provided slug; otherwise generate from the source.
|
|
27
|
+
return await slugify(value || source);
|
|
30
28
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}) : null;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (isPublishing || userOverride) {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
// Important: ensure `countVersions` is not called unnecessarily often
|
|
68
|
-
// That is why this is buried beneath all these conditions
|
|
69
|
-
const versionCount = await countVersions({
|
|
70
|
-
collectionSlug: collection?.slug,
|
|
71
|
-
globalSlug: global?.slug,
|
|
72
|
-
parentID: originalDoc?.id,
|
|
73
|
-
req
|
|
74
|
-
});
|
|
75
|
-
if (versionCount <= 2) {
|
|
76
|
-
return true;
|
|
77
|
-
} else {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
29
|
+
const storedSlug = originalDoc?.[name];
|
|
30
|
+
const originalSource = originalDoc?.[useAsSlug];
|
|
31
|
+
// User explicitly edited the slug (or cleared the value): respect it.
|
|
32
|
+
if (value !== undefined && value !== storedSlug) {
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
// No explicit edit this save. If the stored slug doesn't match what its source
|
|
36
|
+
// would generate, it was customized on an earlier save — keep it frozen.
|
|
37
|
+
const storedSlugIsCustom = storedSlug && storedSlug !== await slugify(originalSource);
|
|
38
|
+
if (storedSlugIsCustom) {
|
|
39
|
+
return storedSlug;
|
|
40
|
+
}
|
|
41
|
+
if (!hasAutosaveEnabled(entity)) {
|
|
42
|
+
// Non-autosave: generate once while empty, then freeze.
|
|
43
|
+
return storedSlug || await slugify(source);
|
|
44
|
+
}
|
|
45
|
+
// Autosave / drafts
|
|
46
|
+
const priorVersions = await countVersions({
|
|
47
|
+
collectionSlug: collection?.slug,
|
|
48
|
+
globalSlug: global?.slug,
|
|
49
|
+
parentID: originalDoc?.id,
|
|
50
|
+
req
|
|
51
|
+
});
|
|
52
|
+
// Do not generate on the very first draft (no prior version yet).
|
|
53
|
+
if (priorVersions === 0) {
|
|
54
|
+
return storedSlug ?? null;
|
|
55
|
+
}
|
|
56
|
+
// Stabilize after publish to protect live URLs.
|
|
57
|
+
if (data?._status === 'published' || originalDoc?._status === 'published') {
|
|
58
|
+
return storedSlug;
|
|
81
59
|
}
|
|
60
|
+
// Still auto-tracking an unpublished draft with content.
|
|
61
|
+
return source ? await slugify(source) : null;
|
|
82
62
|
};
|
|
83
63
|
|
|
84
64
|
//# sourceMappingURL=generateSlug.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/fields/baseFields/slug/generateSlug.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"sources":["../../../../src/fields/baseFields/slug/generateSlug.ts"],"sourcesContent":["import type { TypeWithID } from '../../../collections/config/types.js'\nimport type { FieldHook } from '../../config/types.js'\nimport type { Slugify } from './types.js'\n\nimport { hasAutosaveEnabled } from '../../../utilities/getVersionsConfig.js'\nimport { slugify as defaultSlugify } from '../../../utilities/slugify.js'\nimport { countVersions } from './countVersions.js'\n\ntype Args = {\n name: string\n slugify?: Slugify\n useAsSlug: string\n}\n\n/**\n * Field `beforeChange` hook for the native `slug` field. Returns the slug value.\n *\n * Auto-tracking is derived statelessly: the slug follows its source while it is\n * empty or still equals `slugify(storedSource)`. Once it diverges (the admin\n * overwrites it), it freezes — and stays frozen, because the stored value keeps\n * differing from `slugify(source)`. Re-aligning (the UI generate button) resumes\n * tracking.\n */\nexport const generateSlug =\n ({ name, slugify: customSlugify, useAsSlug }: Args): FieldHook =>\n async ({ collection, data, global, operation, originalDoc, req, value }) => {\n const source = data?.[useAsSlug]\n\n const slugify = (valueToSlugify: unknown) =>\n customSlugify\n ? customSlugify({ data: (data ?? {}) as TypeWithID, req, valueToSlugify })\n : defaultSlugify(valueToSlugify as string)\n\n const entity = collection || global!\n\n if (operation === 'create') {\n // Autosave drafts: do not auto-generate on the initial draft — the user is still entering content.\n // Keep the explicit non-slugified value (if any); generation begins on a later autosave.\n if (hasAutosaveEnabled(entity) && data?._status === 'draft') {\n return value || null\n }\n\n // Keep an explicitly provided slug; otherwise generate from the source.\n return await slugify(value || source)\n }\n\n const storedSlug = originalDoc?.[name]\n const originalSource = originalDoc?.[useAsSlug]\n\n // User explicitly edited the slug (or cleared the value): respect it.\n if (value !== undefined && value !== storedSlug) {\n return value\n }\n\n // No explicit edit this save. If the stored slug doesn't match what its source\n // would generate, it was customized on an earlier save — keep it frozen.\n const storedSlugIsCustom = storedSlug && storedSlug !== (await slugify(originalSource))\n\n if (storedSlugIsCustom) {\n return storedSlug\n }\n\n if (!hasAutosaveEnabled(entity)) {\n // Non-autosave: generate once while empty, then freeze.\n return storedSlug || (await slugify(source))\n }\n\n // Autosave / drafts\n const priorVersions = await countVersions({\n collectionSlug: collection?.slug,\n globalSlug: global?.slug,\n parentID: originalDoc?.id,\n req,\n })\n\n // Do not generate on the very first draft (no prior version yet).\n if (priorVersions === 0) {\n return storedSlug ?? null\n }\n\n // Stabilize after publish to protect live URLs.\n if (data?._status === 'published' || originalDoc?._status === 'published') {\n return storedSlug\n }\n\n // Still auto-tracking an unpublished draft with content.\n return source ? await slugify(source) : null\n }\n"],"names":["hasAutosaveEnabled","slugify","defaultSlugify","countVersions","generateSlug","name","customSlugify","useAsSlug","collection","data","global","operation","originalDoc","req","value","source","valueToSlugify","entity","_status","storedSlug","originalSource","undefined","storedSlugIsCustom","priorVersions","collectionSlug","slug","globalSlug","parentID","id"],"mappings":"AAIA,SAASA,kBAAkB,QAAQ,0CAAyC;AAC5E,SAASC,WAAWC,cAAc,QAAQ,gCAA+B;AACzE,SAASC,aAAa,QAAQ,qBAAoB;AAQlD;;;;;;;;CAQC,GACD,OAAO,MAAMC,eACX,CAAC,EAAEC,IAAI,EAAEJ,SAASK,aAAa,EAAEC,SAAS,EAAQ,GAClD,OAAO,EAAEC,UAAU,EAAEC,IAAI,EAAEC,MAAM,EAAEC,SAAS,EAAEC,WAAW,EAAEC,GAAG,EAAEC,KAAK,EAAE;QACrE,MAAMC,SAASN,MAAM,CAACF,UAAU;QAEhC,MAAMN,UAAU,CAACe,iBACfV,gBACIA,cAAc;gBAAEG,MAAOA,QAAQ,CAAC;gBAAkBI;gBAAKG;YAAe,KACtEd,eAAec;QAErB,MAAMC,SAAST,cAAcE;QAE7B,IAAIC,cAAc,UAAU;YAC1B,mGAAmG;YACnG,yFAAyF;YACzF,IAAIX,mBAAmBiB,WAAWR,MAAMS,YAAY,SAAS;gBAC3D,OAAOJ,SAAS;YAClB;YAEA,wEAAwE;YACxE,OAAO,MAAMb,QAAQa,SAASC;QAChC;QAEA,MAAMI,aAAaP,aAAa,CAACP,KAAK;QACtC,MAAMe,iBAAiBR,aAAa,CAACL,UAAU;QAE/C,sEAAsE;QACtE,IAAIO,UAAUO,aAAaP,UAAUK,YAAY;YAC/C,OAAOL;QACT;QAEA,+EAA+E;QAC/E,yEAAyE;QACzE,MAAMQ,qBAAqBH,cAAcA,eAAgB,MAAMlB,QAAQmB;QAEvE,IAAIE,oBAAoB;YACtB,OAAOH;QACT;QAEA,IAAI,CAACnB,mBAAmBiB,SAAS;YAC/B,wDAAwD;YACxD,OAAOE,cAAe,MAAMlB,QAAQc;QACtC;QAEA,oBAAoB;QACpB,MAAMQ,gBAAgB,MAAMpB,cAAc;YACxCqB,gBAAgBhB,YAAYiB;YAC5BC,YAAYhB,QAAQe;YACpBE,UAAUf,aAAagB;YACvBf;QACF;QAEA,kEAAkE;QAClE,IAAIU,kBAAkB,GAAG;YACvB,OAAOJ,cAAc;QACvB;QAEA,gDAAgD;QAChD,IAAIV,MAAMS,YAAY,eAAeN,aAAaM,YAAY,aAAa;YACzE,OAAOC;QACT;QAEA,yDAAyD;QACzD,OAAOJ,SAAS,MAAMd,QAAQc,UAAU;IAC1C,EAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TextFieldClientProps } from '../../../admin/types.js';
|
|
2
|
+
import type { TypeWithID } from '../../../collections/config/types.js';
|
|
3
|
+
import type { PayloadRequest } from '../../../types/index.js';
|
|
4
|
+
export type Slugify<T extends TypeWithID = any> = (args: {
|
|
5
|
+
data: T;
|
|
6
|
+
req: PayloadRequest;
|
|
7
|
+
valueToSlugify?: any;
|
|
8
|
+
}) => Promise<string | undefined> | string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Props the `SlugField` client component receives. The slug-specific `useAsSlug`
|
|
11
|
+
* arrives on the client field config (it is not a server-only property).
|
|
12
|
+
*/
|
|
13
|
+
export type SlugFieldClientProps = TextFieldClientProps;
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/fields/baseFields/slug/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAE7D,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,UAAU,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE;IACvD,IAAI,EAAE,CAAC,CAAA;IACP,GAAG,EAAE,cAAc,CAAA;IACnB,cAAc,CAAC,EAAE,GAAG,CAAA;CACrB,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,GAAG,SAAS,CAAA;AAEtD;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/fields/baseFields/slug/types.ts"],"sourcesContent":["import type { TextFieldClientProps } from '../../../admin/types.js'\nimport type { TypeWithID } from '../../../collections/config/types.js'\nimport type { PayloadRequest } from '../../../types/index.js'\n\nexport type Slugify<T extends TypeWithID = any> = (args: {\n data: T\n req: PayloadRequest\n valueToSlugify?: any\n}) => Promise<string | undefined> | string | undefined\n\n/**\n * Props the `SlugField` client component receives. The slug-specific `useAsSlug`\n * arrives on the client field config (it is not a server-only property).\n */\nexport type SlugFieldClientProps = TextFieldClientProps\n"],"names":[],"mappings":"AAUA;;;CAGC,GACD,WAAuD"}
|
|
@@ -3,7 +3,7 @@ import type { ImportMap } from '../../bin/generateImportMap/index.js';
|
|
|
3
3
|
import type { Block, ClientBlock, ClientField, Field, FieldBase } from '../../fields/config/types.js';
|
|
4
4
|
import type { Payload } from '../../types/index.js';
|
|
5
5
|
export { ClientField };
|
|
6
|
-
export type ServerOnlyFieldProperties = 'dbName' | 'editor' | 'enumName' | 'filterOptions' | 'graphQL' | 'jsonSchema' | 'label' | 'validate' | keyof Pick<FieldBase, 'access' | 'custom' | 'defaultValue' | 'hooks'>;
|
|
6
|
+
export type ServerOnlyFieldProperties = 'dbName' | 'editor' | 'enumName' | 'filterOptions' | 'graphQL' | 'jsonSchema' | 'label' | 'slugify' | 'validate' | keyof Pick<FieldBase, 'access' | 'custom' | 'defaultValue' | 'hooks'>;
|
|
7
7
|
export type ServerOnlyFieldAdminProperties = keyof Pick<FieldBase['admin'], 'components' | 'condition'>;
|
|
8
8
|
export declare const createClientBlocks: ({ blocks, defaultIDType, i18n, importMap, }: {
|
|
9
9
|
blocks: (Block | string)[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/fields/config/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAyB,UAAU,EAAa,MAAM,0BAA0B,CAAA;AAE5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAErE,OAAO,KAAK,EAGV,KAAK,EAGL,WAAW,EACX,WAAW,EAEX,KAAK,EACL,SAAS,EAOV,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAUnD,OAAO,EAAE,WAAW,EAAE,CAAA;AAEtB,MAAM,MAAM,yBAAyB,GACjC,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,eAAe,GACf,SAAS,GACT,YAAY,GACZ,OAAO,GACP,UAAU,GACV,MAAM,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,QAAQ,GAAG,cAAc,GAAG,OAAO,CAAC,CAAA;AAEzE,MAAM,MAAM,8BAA8B,GAAG,MAAM,IAAI,CACrD,SAAS,CAAC,OAAO,CAAC,EAElB,YAAY,GAAG,WAAW,CAC3B,CAAA;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/fields/config/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAyB,UAAU,EAAa,MAAM,0BAA0B,CAAA;AAE5F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AAErE,OAAO,KAAK,EA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