payload 4.0.0-beta.0 → 4.0.0-beta.2
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/collections/config/types.d.ts +4 -1
- package/dist/collections/config/types.d.ts.map +1 -1
- package/dist/collections/config/types.js.map +1 -1
- package/dist/globals/config/types.d.ts +2 -1
- package/dist/globals/config/types.d.ts.map +1 -1
- package/dist/globals/config/types.js.map +1 -1
- package/dist/hierarchy/addHierarchyToCollection.d.ts.map +1 -1
- package/dist/hierarchy/addHierarchyToCollection.js +32 -21
- package/dist/hierarchy/addHierarchyToCollection.js.map +1 -1
- package/dist/hierarchy/resolveHierarchyCollections.js +7 -1
- package/dist/hierarchy/resolveHierarchyCollections.js.map +1 -1
- package/dist/index.bundled.d.ts +6 -2
- package/dist/llm-instructions/getInstructionsCollection.d.ts.map +1 -1
- package/dist/llm-instructions/getInstructionsCollection.js +2 -0
- package/dist/llm-instructions/getInstructionsCollection.js.map +1 -1
- package/dist/uploads/formatFilesize.js +1 -1
- package/dist/uploads/formatFilesize.js.map +1 -1
- package/package.json +3 -3
- package/skills/payload/reference/PLUGIN-DEVELOPMENT.md +3 -3
|
@@ -368,7 +368,10 @@ export type CollectionAdminOptions = {
|
|
|
368
368
|
* Specify a navigational group for collections in the admin sidebar.
|
|
369
369
|
* - Provide a string to place the entity in a custom group.
|
|
370
370
|
* - Provide a record to define localized group names.
|
|
371
|
-
* - Set to `false` to exclude the
|
|
371
|
+
* - Set to `false` to exclude the collection from the sidebar, command palette, dashboard collection cards,
|
|
372
|
+
* and pin picker, and its documents from both the Pinned and Recently viewed dashboard tabs, including existing pins.
|
|
373
|
+
* This does not disable routes or change access control or rich text link and relationship eligibility.
|
|
374
|
+
* Use `enableRichTextLink` and `enableRichTextRelationship` to configure rich text eligibility separately.
|
|
372
375
|
*/
|
|
373
376
|
group?: false | Record<string, string> | string;
|
|
374
377
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/collections/config/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AACxF,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC3E,OAAO,KAAK,EACV,SAAS,IAAI,gBAAgB,EAC7B,MAAM,IAAI,aAAa,EACxB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,KAAK,EACV,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,EACjB,WAAW,EACZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAA;AAClG,OAAO,KAAK,EACV,KAAK,EACL,cAAc,EACd,SAAS,EACT,iBAAiB,EACjB,WAAW,EACZ,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EACV,eAAe,EACf,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,WAAW,EACZ,MAAM,gB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E,MAAM,EAAE,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE;QACN,KAAK,EAAE,cAAc,CAAA;QACrB,aAAa,EAAE,MAAM,CAAA;QACrB,IAAI,EAAE,MAAM,CAAA;QACZ,gBAAgB,EAAE,OAAO,CAAA;KAC1B,EAAE,CAAA;IACH,MAAM,EAAE,OAAO,CAAA;CAChB,CAAA"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/collections/config/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AACxF,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC3E,OAAO,KAAK,EACV,SAAS,IAAI,gBAAgB,EAC7B,MAAM,IAAI,aAAa,EACxB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACjE,OAAO,KAAK,EACV,MAAM,EACN,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,qBAAqB,EACrB,wBAAwB,EACxB,iBAAiB,EACjB,WAAW,EACZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAA;AAClG,OAAO,KAAK,EACV,K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,GAAG,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;IACzB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE;QACN,KAAK,EAAE,cAAc,CAAA;QACrB,aAAa,EAAE,MAAM,CAAA;QACrB,IAAI,EAAE,MAAM,CAAA;QACZ,gBAAgB,EAAE,OAAO,CAAA;KAC1B,EAAE,CAAA;IACH,MAAM,EAAE,OAAO,CAAA;CAChB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/collections/config/types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { GraphQLInputObjectType, GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { IsAny, MarkOptional } from 'ts-essentials'\n\nimport type { CustomUpload, ViewTypes } from '../../admin/types.js'\nimport type { Arguments as MeArguments } from '../../auth/operations/me.js'\nimport type {\n Arguments as RefreshArguments,\n Result as RefreshResult,\n} from '../../auth/operations/refresh.js'\nimport type { Auth, IncomingAuthType } from '../../auth/types.js'\nimport type {\n Access,\n AfterErrorHookArgs,\n AfterErrorResult,\n CustomComponent,\n Endpoint,\n EntityDescription,\n GeneratePreviewURL,\n LabelFunction,\n LivePreviewConfig,\n MetaConfig,\n PayloadComponent,\n SharedAdminComponents,\n SharedEditViewComponents,\n SharedEntityViews,\n StaticLabel,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type { Authorship, SanitizedAuthorship } from '../../fields/baseFields/authorship/types.js'\nimport type {\n Field,\n FlattenedField,\n JoinField,\n RelationshipField,\n UploadField,\n} from '../../fields/config/types.js'\nimport type {\n HierarchyConfig,\n HierarchyJoinFieldConfig,\n SanitizedHierarchyConfig,\n} from '../../hierarchy/types.js'\nimport type {\n CollectionAdminCustom,\n CollectionCustom,\n CollectionSlug,\n GeneratedTypes,\n JsonObject,\n RequestContext,\n TypedAuthOperations,\n TypedCollection,\n TypedCollectionSelect,\n TypedLocale,\n} from '../../index.js'\nimport type {\n PayloadRequest,\n SelectIncludeType,\n SelectType,\n Sort,\n TransformCollectionWithSelect,\n Where,\n WithSelectFn,\n} from '../../types/index.js'\nimport type { SanitizedUploadConfig, UploadConfig } from '../../uploads/types.js'\nimport type {\n IncomingCollectionVersions,\n SanitizedCollectionVersions,\n} from '../../versions/types.js'\nimport type {\n AfterOperationArg,\n BeforeOperationArg,\n OperationMap,\n} from '../operations/utilities/types.js'\n\nexport type DataFromCollectionSlug<TSlug extends CollectionSlug> =\n TypedCollection[string extends CollectionSlug ? CollectionSlug : TSlug]\n\n/**\n * The ID type of a given collection (e.g. `string` or `number`), taken from its generated type.\n * Use this instead of the project-wide {@link DefaultDocumentIDType} when the collection slug is\n * known, since each collection can have its own ID type.\n */\nexport type IDTypeForCollectionSlug<TSlug extends CollectionSlug> =\n DataFromCollectionSlug<TSlug>['id']\n\nexport type SelectFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollectionSelect[TSlug]\n\n/**\n * Collection slugs that do not have drafts enabled.\n * Detects collections without drafts by checking for the absence of the `_status` field.\n */\nexport type CollectionsWithoutDrafts = {\n [TSlug in CollectionSlug]: DataFromCollectionSlug<TSlug> extends { _status?: any } ? never : TSlug\n}[CollectionSlug]\n\n/**\n * Conditionally allows or forbids the `draft` property based on collection configuration.\n * When `strictDraftTypes` is enabled, the `draft` property is forbidden on collections without drafts.\n */\nexport type DraftFlagFromCollectionSlug<TSlug extends CollectionSlug> = GeneratedTypes extends {\n strictDraftTypes: true\n}\n ? TSlug extends CollectionsWithoutDrafts\n ? {\n /**\n * The `draft` property is not allowed because this collection does not have `versions.drafts` enabled.\n */\n draft?: never\n }\n : {\n /**\n * Whether the document(s) should be queried from the versions table/collection or not. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: boolean\n }\n : {\n /**\n * Whether the document(s) should be queried from the versions table/collection or not. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: boolean\n }\n\nexport type AuthOperationsFromCollectionSlug<TSlug extends CollectionSlug> =\n TypedAuthOperations[TSlug]\n\nexport type RequiredDataFromCollection<TData extends JsonObject> = MarkOptional<\n TData,\n 'collection' | 'createdAt' | 'deletedAt' | 'id' | 'updatedAt'\n>\n\nexport type RequiredDataFromCollectionSlug<TSlug extends CollectionSlug> =\n RequiredDataFromCollection<DataFromCollectionSlug<TSlug>>\n\n/**\n * Helper type for draft data INPUT (e.g., create operations) - makes all fields optional except system fields\n * When creating a draft, required fields don't need to be provided as validation is skipped\n * The id field is optional since it's auto-generated\n */\nexport type DraftDataFromCollection<TData extends JsonObject> = Partial<\n Omit<TData, 'collection' | 'createdAt' | 'deletedAt' | 'id' | 'updatedAt' | 'variants'>\n> &\n Partial<Pick<TData, 'collection' | 'createdAt' | 'deletedAt' | 'id' | 'updatedAt' | 'variants'>>\n\nexport type DraftDataFromCollectionSlug<TSlug extends CollectionSlug> = DraftDataFromCollection<\n DataFromCollectionSlug<TSlug>\n>\n\n/**\n * Helper type for draft data OUTPUT (e.g., query results) - makes user fields optional but keeps id required\n * When querying drafts, required fields may be null/undefined as validation is skipped, but system fields like id are always present\n */\nexport type QueryDraftDataFromCollection<TData extends JsonObject> = Partial<\n Omit<TData, 'createdAt' | 'deletedAt' | 'id' | 'updatedAt' | 'variants'>\n> &\n Partial<Pick<TData, 'createdAt' | 'deletedAt' | 'updatedAt' | 'variants'>> &\n Pick<TData, 'id'>\n\nexport type QueryDraftDataFromCollectionSlug<TSlug extends CollectionSlug> =\n QueryDraftDataFromCollection<DataFromCollectionSlug<TSlug>>\n\nexport type HookOperationType =\n | 'autosave'\n | 'count'\n | 'countVersions'\n | 'create'\n | 'delete'\n | 'forgotPassword'\n | 'login'\n | 'read'\n | 'readDistinct'\n | 'refresh'\n | 'resetPassword'\n | 'restoreVersion'\n | 'update'\n | 'validate'\n\ntype CreateOrUpdateOperation = Extract<HookOperationType, 'create' | 'update'>\ntype CreateUpdateOrValidateOperation = Extract<HookOperationType, 'create' | 'update' | 'validate'>\n\nexport type BeforeOperationHook<TOperationGeneric extends CollectionSlug = string> = (\n arg: BeforeOperationArg<TOperationGeneric>,\n) =>\n | Parameters<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>[0]\n | Promise<Parameters<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>[0]>\n | Promise<void>\n | void\n\nexport type BeforeValidateHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data?: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateUpdateOrValidateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateUpdateOrValidateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type AfterChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n doc: T\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n previousDoc: T\n req: PayloadRequest\n /** Resolved field selection for the operation's response. */\n select?: SelectType\n}) => any\n\nexport type BeforeReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n query: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type AfterReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n findMany?: boolean\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n query?: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type BeforeDeleteHook = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterDeleteHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterOperationHook<TOperationGeneric extends CollectionSlug = string> = (\n arg: AfterOperationArg<TOperationGeneric>,\n) =>\n | Awaited<ReturnType<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>>\n | Promise<\n Awaited<ReturnType<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>>\n >\n\nexport type BeforeLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n user: T\n}) => any\n\nexport type AfterLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n token: string\n user: T\n}) => any\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterLogoutHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n}) => any\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterMeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n response: unknown\n}) => any\n\nexport type RefreshHook<T extends TypeWithID = any> = (args: {\n args: RefreshArguments\n user: T\n}) => Promise<RefreshResult | void> | (RefreshResult | void)\n\nexport type MeHook<T extends TypeWithID = any> = (args: {\n args: MeArguments\n user: T\n}) => ({ exp: number; user: T } | void) | Promise<{ exp: number; user: T } | void>\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterRefreshHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n exp: number\n req: PayloadRequest\n token: string\n}) => any\n\nexport type AfterErrorHook = (\n args: { collection: SanitizedCollectionConfig } & AfterErrorHookArgs,\n) => AfterErrorResult | Promise<AfterErrorResult>\n\nexport type AfterForgotPasswordHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n}) => any\n\nexport type EnableFoldersOptions = {\n // Displays the folder collection and parentFolder field in the document view\n debug?: boolean\n}\n\n/**\n * Configuration options for folder hierarchy preset.\n * Subset of HierarchyConfig with folder-appropriate defaults applied.\n */\nexport type FoldersConfig = {\n admin?: {\n components?: {\n Icon?: PayloadComponent\n }\n injectSidebarTab?: boolean\n treeLimit?: number\n useHeaderButton?: boolean\n }\n collectionSpecific?:\n | {\n fieldName?: string\n }\n | boolean\n joinField?: HierarchyJoinFieldConfig\n parentFieldName?: string\n slugField?: string\n slugify?: (text: string) => string\n slugPathFieldName?: string\n titlePathFieldName?: string\n}\n\n/**\n * Configuration options for tags hierarchy preset.\n * Same as FoldersConfig but allowHasMany can be overridden.\n */\nexport type TagsConfig = {\n allowHasMany?: boolean\n} & FoldersConfig\n\nexport type BaseFilter = (args: {\n limit: number\n locale?: TypedLocale\n page: number\n req: PayloadRequest\n sort: string\n}) => null | Promise<null | Where> | Where\n\n/**\n * @deprecated Use `BaseFilter` instead.\n */\nexport type BaseListFilter = BaseFilter\n\nexport type CollectionAdminOptions = {\n /**\n * Defines a default base filter which will be applied in the following parts of the admin panel:\n * - List View\n * - Relationship fields for internal links within the Lexical editor\n *\n * This is especially useful for plugins like multi-tenant. For example,\n * a user may have access to multiple tenants, but should only see content\n * related to the currently active or selected tenant in those places.\n */\n baseFilter?: BaseFilter\n /**\n * @deprecated Use `baseFilter` instead. If both are defined,\n * `baseFilter` will take precedence. This property remains only\n * for backward compatibility and may be removed in a future version.\n *\n * Originally, `baseListFilter` was intended to filter only the List View\n * in the admin panel. However, base filtering is often required in other areas\n * such as internal link relationships in the Lexical editor.\n */\n baseListFilter?: BaseListFilter\n /**\n * Custom admin components\n */\n components?: {\n afterList?: CustomComponent[]\n afterListTable?: CustomComponent[]\n beforeList?: CustomComponent[]\n beforeListTable?: CustomComponent[]\n /**\n * Components within the edit view\n */\n edit?: {\n /**\n * Replaces the \"Upload\" section\n * + upload must be enabled\n */\n Upload?: CustomUpload\n } & SharedEditViewComponents\n listMenuItems?: CustomComponent[]\n views?: {\n /**\n * Replace or modify the \"list\" view.\n * @link https://payloadcms.com/docs/custom-components/list-view\n */\n list?: {\n actions?: CustomComponent[]\n Component?: PayloadComponent\n NoResults?: CustomComponent\n }\n } & SharedEntityViews\n } & Omit<SharedAdminComponents, 'edit' | 'views'>\n /** Extension point to add your custom data. Available in server and client. */\n custom?: CollectionAdminCustom\n /**\n * Default columns to show in list view\n */\n defaultColumns?: string[]\n /**\n * Custom description for collection. This will also be used as JSDoc for the generated types\n */\n description?: EntityDescription\n /**\n * Disable the Copy To Locale button in the edit document view\n * @default false\n */\n disableCopyToLocale?: boolean\n enableRichTextLink?: boolean\n enableRichTextRelationship?: boolean\n /**\n * Function to format the URL for document links in the list view.\n * Return null to disable linking for that document.\n * Return a string to customize the link destination.\n * If not provided, uses the default admin edit URL.\n */\n formatDocURL?: (args: {\n collectionSlug: string\n /**\n * The default URL that would normally be used for this document link.\n * You can return this as-is, modify it, or completely replace it.\n */\n defaultURL: string\n doc: Record<string, unknown>\n req: PayloadRequest\n /**\n * The current view context where the link is being generated.\n * Most relevant values for document linking are 'list' and 'trash'.\n */\n viewType?: ViewTypes\n }) => null | string\n /**\n * Specify a navigational group for collections in the admin sidebar.\n * - Provide a string to place the entity in a custom group.\n * - Provide a record to define localized group names.\n * - Set to `false` to exclude the entity from the sidebar / dashboard without disabling its routes.\n */\n group?: false | Record<string, string> | string\n /**\n * Exclude the collection from the admin nav and routes\n */\n hidden?: ((args: { user: PayloadRequest['user'] }) => boolean) | boolean\n /**\n * Additional fields to be searched via the full text search\n */\n listSearchableFields?: string[]\n /**\n * Live Preview options.\n *\n * @see https://payloadcms.com/docs/live-preview/overview\n */\n livePreview?: LivePreviewConfig\n meta?: MetaConfig\n pagination?: {\n defaultLimit?: number\n limits?: number[]\n }\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n /**\n * Field to use as the thumbnail image in grid/card views. Defaults to the first field of type `upload`.\n */\n useAsThumbnail?: string\n /**\n * Field to use as title in Edit View and first column in List view\n */\n useAsTitle?: string\n}\n\nexport type CollectionAccess<TData = any> = {\n admin?: ({ slug, req }: { req: PayloadRequest; slug: string }) => boolean | Promise<boolean>\n create?: Access<TData>\n delete?: Access<TData>\n read?: Access<TData>\n readVersions?: Access<TData>\n unlock?: Access<TData>\n update?: Access<TData>\n /**\n * Controls on-demand validation for this collection.\n * Falls back to `update` access when omitted.\n * The access function receives `req.operation === 'validate'`.\n * @see https://payloadcms.com/docs/validation/overview#access-control-and-hooks\n */\n validate?: Access<TData>\n}\n\ntype CollectionHooks<TSlug extends CollectionSlug = any> = {\n afterChange?: AfterChangeHook[]\n afterDelete?: AfterDeleteHook[]\n afterError?: AfterErrorHook[]\n afterForgotPassword?: AfterForgotPasswordHook[]\n afterLogin?: AfterLoginHook[]\n afterLogout?: AfterLogoutHook[]\n afterMe?: AfterMeHook[]\n afterOperation?: AfterOperationHook<TSlug>[]\n afterRead?: AfterReadHook[]\n afterRefresh?: AfterRefreshHook[]\n beforeChange?: BeforeChangeHook[]\n beforeDelete?: BeforeDeleteHook[]\n beforeLogin?: BeforeLoginHook[]\n beforeOperation?: BeforeOperationHook<TSlug>[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n /**\n /**\n * Use the `me` hook to control the `me` operation.\n * Here, you can optionally instruct the me operation to return early,\n * and skip its default logic.\n */\n me?: MeHook[]\n /**\n * Use the `refresh` hook to control the refresh operation.\n * Here, you can optionally instruct the refresh operation to return early,\n * and skip its default logic.\n */\n refresh?: RefreshHook[]\n}\n\n/** Manage all aspects of a data collection */\nexport type CollectionConfig<TSlug extends CollectionSlug = any> = {\n /**\n * Do not set this property manually. This is set to true during sanitization, to avoid\n * sanitizing the same collection multiple times.\n */\n _sanitized?: boolean\n /**\n * Access control\n */\n access?: CollectionAccess\n /**\n * Collection admin options\n */\n admin?: CollectionAdminOptions\n /**\n * Collection login options\n *\n * Use `true` to enable with default options\n */\n auth?: boolean | IncomingAuthType\n /**\n * Automatically track the user that created and last updated each document via\n * polymorphic `createdBy` / `updatedBy` relationship fields to your auth collections.\n *\n * Use `true` (default) to enable both, `false` to disable both, or an object to\n * toggle each field independently, e.g. `{ updatedBy: false }`.\n *\n * @default true\n */\n authorship?: Authorship | boolean\n /**\n * Configuration for bulk operations\n */\n /** Extension point to add your custom data. Server only. */\n custom?: CollectionCustom\n /**\n * Used to override the default naming of the database table or collection with your using a function or string\n * @WARNING: If you change this property with existing data, you will need to handle the renaming of the table in your database or by using migrations\n */\n dbName?: DBIdentifierName\n defaultPopulate?: IsAny<SelectFromCollectionSlug<TSlug>> extends true\n ? SelectType\n : SelectFromCollectionSlug<TSlug>\n /**\n * Default field to sort by in collection list view\n */\n defaultSort?: Sort\n /**\n * Disable the bulk delete operation for the collection in the admin panel and the API\n */\n disableBulkDelete?: boolean\n /**\n * Disable the bulk edit operation for the collection in the admin panel and the API\n */\n disableBulkEdit?: boolean\n /**\n * When true, do not show the \"Duplicate\" button while editing documents within this collection and prevent `duplicate` from all APIs\n */\n disableDuplicate?: boolean\n /**\n * Opt-in to enable query presets for this collection.\n * @see https://payloadcms.com/docs/query-presets/overview\n */\n enableQueryPresets?: boolean\n /**\n * Custom rest api endpoints, set false to disable all rest endpoints for this collection.\n */\n endpoints?: false | Omit<Endpoint, 'root'>[]\n fields: Field[]\n /**\n * Enable folder hierarchy preset for this collection.\n * Sets hierarchy with folder defaults: allowHasMany: false, FolderIcon, useHeaderButton: true\n *\n * Use `true` for defaults, or object for customization.\n * Cannot be used together with `tags` or `hierarchy`.\n */\n folders?: boolean | FoldersConfig\n /**\n * GraphQL configuration\n */\n graphQL?:\n | {\n disableMutations?: true\n disableQueries?: true\n pluralName?: string\n singularName?: string\n }\n | false\n /**\n * Enable hierarchical tree structure for this collection\n *\n * Use `true` to enable with defaults (auto-detects parent field)\n * or provide configuration object\n *\n * @example\n * // Enable with defaults\n * hierarchy: true\n *\n * @example\n * // Customize field names and slugify function\n * hierarchy: {\n * parentFieldName: 'parent',\n * slugify: (text) => customSlugify(text),\n * slugPathFieldName: '_breadcrumbPath'\n * }\n */\n hierarchy?: boolean | HierarchyConfig\n /**\n * Hooks to modify Payload functionality\n */\n hooks?: CollectionHooks<TSlug>\n /**\n * Define compound indexes for this collection.\n * This can be used to either speed up querying/sorting by 2 or more fields at the same time or\n * to ensure uniqueness between several fields.\n * Specify field paths\n * @example\n * [{ unique: true, fields: ['title', 'group.name'] }]\n * @default []\n */\n indexes?: CompoundIndex[]\n /**\n * Label configuration\n */\n labels?: {\n plural?: LabelFunction | StaticLabel\n singular?: LabelFunction | StaticLabel\n }\n /** Read-only Markdown instructions included in this collection's MCP and CLI schema responses. */\n llmInstructions?: string\n /**\n * Enables / Disables the ability to lock documents while editing\n * @default true\n */\n lockDocuments?:\n | {\n duration: number\n }\n | false\n /**\n * If true, enables custom ordering for the collection, and documents in the listView can be reordered via drag and drop.\n * New documents are inserted at the end of the list according to this parameter.\n *\n * Under the hood, a field with {@link https://payloadcms.com/docs/configuration/collections#fractional-indexing|fractional indexing} is used to optimize inserts and reorderings.\n *\n * @default false\n *\n * @experimental There may be frequent breaking changes to this API\n */\n orderable?: boolean\n slug: string\n /**\n * Enable tags hierarchy preset for this collection.\n * Sets hierarchy with tag defaults: allowHasMany: true, TagIcon\n *\n * Use `true` for defaults, or object for customization.\n * Cannot be used together with `folders` or `hierarchy`.\n */\n tags?: boolean | TagsConfig\n /**\n * Add `createdAt`, `deletedAt` and `updatedAt` fields\n *\n * @default true\n */\n timestamps?: boolean\n /**\n * Enables trash support for this collection.\n *\n * When enabled, documents will include a `deletedAt` timestamp field.\n * This allows documents to be marked as deleted without being permanently removed.\n * The `deletedAt` field will be set to the current date and time when a document is trashed.\n *\n * @default false\n */\n trash?: boolean\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n /**\n * Customize the handling of incoming file uploads\n *\n * @default false // disable uploads\n */\n upload?: boolean | UploadConfig\n /**\n * Enable versioning. Set it to true to enable default versions settings,\n * or customize versions options by setting the property equal to an object\n * containing the version options.\n *\n * @default false // disable versioning\n */\n versions?: boolean | IncomingCollectionVersions\n} & Pick<\n WithSelectFn<\n IsAny<SelectFromCollectionSlug<TSlug>> extends true\n ? SelectIncludeType\n : SelectFromCollectionSlug<TSlug>\n >,\n 'select'\n>\n\nexport type SanitizedJoin = {\n /**\n * The field configuration defining the join\n */\n field: JoinField\n getForeignPath?(args: { locale?: TypedLocale }): string\n /**\n * The path of the join field in dot notation\n */\n joinPath: string\n /**\n * `parentIsLocalized` is true if any parent field of the\n * field configuration defining the join is localized\n */\n parentIsLocalized: boolean\n targetField: RelationshipField | UploadField\n}\n\nexport type SanitizedJoins = {\n [collectionSlug: string]: SanitizedJoin[]\n}\n\n/**\n * Properties populated during sanitization are redefined below. All other collection properties\n * preserve their incoming optionality.\n */\nexport interface SanitizedCollectionConfig\n extends Omit<\n CollectionConfig,\n | '_sanitized'\n | 'access'\n | 'admin'\n | 'auth'\n | 'authorship'\n | 'custom'\n | 'endpoints'\n | 'folder'\n | 'folders'\n | 'hierarchy'\n | 'hooks'\n | 'indexes'\n | 'labels'\n | 'slug'\n | 'tags'\n | 'timestamps'\n | 'upload'\n | 'versions'\n >,\n Required<Pick<CollectionConfig, 'admin' | 'custom' | 'indexes' | 'timestamps'>> {\n _sanitized: true\n access: Pick<CollectionAccess, 'admin'> &\n Required<\n Pick<\n CollectionAccess,\n 'create' | 'delete' | 'read' | 'readVersions' | 'unlock' | 'update' | 'validate'\n >\n >\n auth: Auth\n authorship: SanitizedAuthorship\n endpoints: Endpoint[] | false\n /**\n * Fields in the database schema structure\n * Rows / collapsible / tabs w/o name `fields` merged to top, UIs are excluded\n */\n flattenedFields: FlattenedField[]\n /**\n * Hierarchy configuration (when collection is a hierarchy type like folders or tags)\n */\n hierarchy: false | SanitizedHierarchyConfig\n hooks: Required<CollectionHooks>\n /**\n * Object of collections to join 'Join Fields object keyed by collection\n */\n joins: SanitizedJoins\n labels: Required<NonNullable<CollectionConfig['labels']>>\n /**\n * List of all polymorphic join fields\n */\n polymorphicJoins: SanitizedJoin[]\n\n sanitizedIndexes: SanitizedCompoundIndex[]\n\n slug: CollectionSlug\n\n upload: SanitizedUploadConfig\n versions?: SanitizedCollectionVersions\n}\n\nexport type Collection = {\n config: SanitizedCollectionConfig\n customIDType?: 'number' | 'text'\n graphQL?: {\n countType: GraphQLObjectType\n JWT: GraphQLObjectType\n mutationInputType: GraphQLNonNull<any>\n paginatedType: GraphQLObjectType\n type: GraphQLObjectType\n updateMutationInputType: GraphQLNonNull<any>\n versionType: GraphQLObjectType\n whereInputType: GraphQLInputObjectType\n }\n}\n\nexport type BulkOperationResult<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n docs: TransformCollectionWithSelect<TSlug, TSelect>[]\n errors: {\n id: DataFromCollectionSlug<TSlug>['id']\n isPublic: boolean\n message: string\n }[]\n}\n\nexport type AuthCollection = {\n config: SanitizedCollectionConfig\n}\n\nexport type LocalizedMeta = {\n [locale: string]: {\n status: 'draft' | 'published'\n updatedAt: string\n }\n}\n\nexport type TypeWithID = {\n id: number | string\n}\n\nexport type TypeWithTimestamps = {\n [key: string]: unknown\n createdAt: string\n deletedAt?: null | string\n id: number | string\n updatedAt: string\n}\n\nexport type CompoundIndex = {\n fields: string[]\n unique?: boolean\n}\n\nexport type SanitizedCompoundIndex = {\n fields: {\n field: FlattenedField\n localizedPath: string\n path: string\n pathHasLocalized: boolean\n }[]\n unique: boolean\n}\n"],"names":[],"mappings":"AAAA,qDAAqD,GA26BrD,WAQC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/collections/config/types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { GraphQLInputObjectType, GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { IsAny, MarkOptional } from 'ts-essentials'\n\nimport type { CustomUpload, ViewTypes } from '../../admin/types.js'\nimport type { Arguments as MeArguments } from '../../auth/operations/me.js'\nimport type {\n Arguments as RefreshArguments,\n Result as RefreshResult,\n} from '../../auth/operations/refresh.js'\nimport type { Auth, IncomingAuthType } from '../../auth/types.js'\nimport type {\n Access,\n AfterErrorHookArgs,\n AfterErrorResult,\n CustomComponent,\n Endpoint,\n EntityDescription,\n GeneratePreviewURL,\n LabelFunction,\n LivePreviewConfig,\n MetaConfig,\n PayloadComponent,\n SharedAdminComponents,\n SharedEditViewComponents,\n SharedEntityViews,\n StaticLabel,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type { Authorship, SanitizedAuthorship } from '../../fields/baseFields/authorship/types.js'\nimport type {\n Field,\n FlattenedField,\n JoinField,\n RelationshipField,\n UploadField,\n} from '../../fields/config/types.js'\nimport type {\n HierarchyConfig,\n HierarchyJoinFieldConfig,\n SanitizedHierarchyConfig,\n} from '../../hierarchy/types.js'\nimport type {\n CollectionAdminCustom,\n CollectionCustom,\n CollectionSlug,\n GeneratedTypes,\n JsonObject,\n RequestContext,\n TypedAuthOperations,\n TypedCollection,\n TypedCollectionSelect,\n TypedLocale,\n} from '../../index.js'\nimport type {\n PayloadRequest,\n SelectIncludeType,\n SelectType,\n Sort,\n TransformCollectionWithSelect,\n Where,\n WithSelectFn,\n} from '../../types/index.js'\nimport type { SanitizedUploadConfig, UploadConfig } from '../../uploads/types.js'\nimport type {\n IncomingCollectionVersions,\n SanitizedCollectionVersions,\n} from '../../versions/types.js'\nimport type {\n AfterOperationArg,\n BeforeOperationArg,\n OperationMap,\n} from '../operations/utilities/types.js'\n\nexport type DataFromCollectionSlug<TSlug extends CollectionSlug> =\n TypedCollection[string extends CollectionSlug ? CollectionSlug : TSlug]\n\n/**\n * The ID type of a given collection (e.g. `string` or `number`), taken from its generated type.\n * Use this instead of the project-wide {@link DefaultDocumentIDType} when the collection slug is\n * known, since each collection can have its own ID type.\n */\nexport type IDTypeForCollectionSlug<TSlug extends CollectionSlug> =\n DataFromCollectionSlug<TSlug>['id']\n\nexport type SelectFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollectionSelect[TSlug]\n\n/**\n * Collection slugs that do not have drafts enabled.\n * Detects collections without drafts by checking for the absence of the `_status` field.\n */\nexport type CollectionsWithoutDrafts = {\n [TSlug in CollectionSlug]: DataFromCollectionSlug<TSlug> extends { _status?: any } ? never : TSlug\n}[CollectionSlug]\n\n/**\n * Conditionally allows or forbids the `draft` property based on collection configuration.\n * When `strictDraftTypes` is enabled, the `draft` property is forbidden on collections without drafts.\n */\nexport type DraftFlagFromCollectionSlug<TSlug extends CollectionSlug> = GeneratedTypes extends {\n strictDraftTypes: true\n}\n ? TSlug extends CollectionsWithoutDrafts\n ? {\n /**\n * The `draft` property is not allowed because this collection does not have `versions.drafts` enabled.\n */\n draft?: never\n }\n : {\n /**\n * Whether the document(s) should be queried from the versions table/collection or not. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: boolean\n }\n : {\n /**\n * Whether the document(s) should be queried from the versions table/collection or not. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: boolean\n }\n\nexport type AuthOperationsFromCollectionSlug<TSlug extends CollectionSlug> =\n TypedAuthOperations[TSlug]\n\nexport type RequiredDataFromCollection<TData extends JsonObject> = MarkOptional<\n TData,\n 'collection' | 'createdAt' | 'deletedAt' | 'id' | 'updatedAt'\n>\n\nexport type RequiredDataFromCollectionSlug<TSlug extends CollectionSlug> =\n RequiredDataFromCollection<DataFromCollectionSlug<TSlug>>\n\n/**\n * Helper type for draft data INPUT (e.g., create operations) - makes all fields optional except system fields\n * When creating a draft, required fields don't need to be provided as validation is skipped\n * The id field is optional since it's auto-generated\n */\nexport type DraftDataFromCollection<TData extends JsonObject> = Partial<\n Omit<TData, 'collection' | 'createdAt' | 'deletedAt' | 'id' | 'updatedAt' | 'variants'>\n> &\n Partial<Pick<TData, 'collection' | 'createdAt' | 'deletedAt' | 'id' | 'updatedAt' | 'variants'>>\n\nexport type DraftDataFromCollectionSlug<TSlug extends CollectionSlug> = DraftDataFromCollection<\n DataFromCollectionSlug<TSlug>\n>\n\n/**\n * Helper type for draft data OUTPUT (e.g., query results) - makes user fields optional but keeps id required\n * When querying drafts, required fields may be null/undefined as validation is skipped, but system fields like id are always present\n */\nexport type QueryDraftDataFromCollection<TData extends JsonObject> = Partial<\n Omit<TData, 'createdAt' | 'deletedAt' | 'id' | 'updatedAt' | 'variants'>\n> &\n Partial<Pick<TData, 'createdAt' | 'deletedAt' | 'updatedAt' | 'variants'>> &\n Pick<TData, 'id'>\n\nexport type QueryDraftDataFromCollectionSlug<TSlug extends CollectionSlug> =\n QueryDraftDataFromCollection<DataFromCollectionSlug<TSlug>>\n\nexport type HookOperationType =\n | 'autosave'\n | 'count'\n | 'countVersions'\n | 'create'\n | 'delete'\n | 'forgotPassword'\n | 'login'\n | 'read'\n | 'readDistinct'\n | 'refresh'\n | 'resetPassword'\n | 'restoreVersion'\n | 'update'\n | 'validate'\n\ntype CreateOrUpdateOperation = Extract<HookOperationType, 'create' | 'update'>\ntype CreateUpdateOrValidateOperation = Extract<HookOperationType, 'create' | 'update' | 'validate'>\n\nexport type BeforeOperationHook<TOperationGeneric extends CollectionSlug = string> = (\n arg: BeforeOperationArg<TOperationGeneric>,\n) =>\n | Parameters<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>[0]\n | Promise<Parameters<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>[0]>\n | Promise<void>\n | void\n\nexport type BeforeValidateHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data?: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateUpdateOrValidateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateUpdateOrValidateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type AfterChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n doc: T\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n previousDoc: T\n req: PayloadRequest\n /** Resolved field selection for the operation's response. */\n select?: SelectType\n}) => any\n\nexport type BeforeReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n query: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type AfterReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n findMany?: boolean\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n query?: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type BeforeDeleteHook = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterDeleteHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterOperationHook<TOperationGeneric extends CollectionSlug = string> = (\n arg: AfterOperationArg<TOperationGeneric>,\n) =>\n | Awaited<ReturnType<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>>\n | Promise<\n Awaited<ReturnType<OperationMap<TOperationGeneric>[keyof OperationMap<TOperationGeneric>]>>\n >\n\nexport type BeforeLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n user: T\n}) => any\n\nexport type AfterLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n token: string\n user: T\n}) => any\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterLogoutHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n}) => any\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterMeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n response: unknown\n}) => any\n\nexport type RefreshHook<T extends TypeWithID = any> = (args: {\n args: RefreshArguments\n user: T\n}) => Promise<RefreshResult | void> | (RefreshResult | void)\n\nexport type MeHook<T extends TypeWithID = any> = (args: {\n args: MeArguments\n user: T\n}) => ({ exp: number; user: T } | void) | Promise<{ exp: number; user: T } | void>\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type AfterRefreshHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n exp: number\n req: PayloadRequest\n token: string\n}) => any\n\nexport type AfterErrorHook = (\n args: { collection: SanitizedCollectionConfig } & AfterErrorHookArgs,\n) => AfterErrorResult | Promise<AfterErrorResult>\n\nexport type AfterForgotPasswordHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n}) => any\n\nexport type EnableFoldersOptions = {\n // Displays the folder collection and parentFolder field in the document view\n debug?: boolean\n}\n\n/**\n * Configuration options for folder hierarchy preset.\n * Subset of HierarchyConfig with folder-appropriate defaults applied.\n */\nexport type FoldersConfig = {\n admin?: {\n components?: {\n Icon?: PayloadComponent\n }\n injectSidebarTab?: boolean\n treeLimit?: number\n useHeaderButton?: boolean\n }\n collectionSpecific?:\n | {\n fieldName?: string\n }\n | boolean\n joinField?: HierarchyJoinFieldConfig\n parentFieldName?: string\n slugField?: string\n slugify?: (text: string) => string\n slugPathFieldName?: string\n titlePathFieldName?: string\n}\n\n/**\n * Configuration options for tags hierarchy preset.\n * Same as FoldersConfig but allowHasMany can be overridden.\n */\nexport type TagsConfig = {\n allowHasMany?: boolean\n} & FoldersConfig\n\nexport type BaseFilter = (args: {\n limit: number\n locale?: TypedLocale\n page: number\n req: PayloadRequest\n sort: string\n}) => null | Promise<null | Where> | Where\n\n/**\n * @deprecated Use `BaseFilter` instead.\n */\nexport type BaseListFilter = BaseFilter\n\nexport type CollectionAdminOptions = {\n /**\n * Defines a default base filter which will be applied in the following parts of the admin panel:\n * - List View\n * - Relationship fields for internal links within the Lexical editor\n *\n * This is especially useful for plugins like multi-tenant. For example,\n * a user may have access to multiple tenants, but should only see content\n * related to the currently active or selected tenant in those places.\n */\n baseFilter?: BaseFilter\n /**\n * @deprecated Use `baseFilter` instead. If both are defined,\n * `baseFilter` will take precedence. This property remains only\n * for backward compatibility and may be removed in a future version.\n *\n * Originally, `baseListFilter` was intended to filter only the List View\n * in the admin panel. However, base filtering is often required in other areas\n * such as internal link relationships in the Lexical editor.\n */\n baseListFilter?: BaseListFilter\n /**\n * Custom admin components\n */\n components?: {\n afterList?: CustomComponent[]\n afterListTable?: CustomComponent[]\n beforeList?: CustomComponent[]\n beforeListTable?: CustomComponent[]\n /**\n * Components within the edit view\n */\n edit?: {\n /**\n * Replaces the \"Upload\" section\n * + upload must be enabled\n */\n Upload?: CustomUpload\n } & SharedEditViewComponents\n listMenuItems?: CustomComponent[]\n views?: {\n /**\n * Replace or modify the \"list\" view.\n * @link https://payloadcms.com/docs/custom-components/list-view\n */\n list?: {\n actions?: CustomComponent[]\n Component?: PayloadComponent\n NoResults?: CustomComponent\n }\n } & SharedEntityViews\n } & Omit<SharedAdminComponents, 'edit' | 'views'>\n /** Extension point to add your custom data. Available in server and client. */\n custom?: CollectionAdminCustom\n /**\n * Default columns to show in list view\n */\n defaultColumns?: string[]\n /**\n * Custom description for collection. This will also be used as JSDoc for the generated types\n */\n description?: EntityDescription\n /**\n * Disable the Copy To Locale button in the edit document view\n * @default false\n */\n disableCopyToLocale?: boolean\n enableRichTextLink?: boolean\n enableRichTextRelationship?: boolean\n /**\n * Function to format the URL for document links in the list view.\n * Return null to disable linking for that document.\n * Return a string to customize the link destination.\n * If not provided, uses the default admin edit URL.\n */\n formatDocURL?: (args: {\n collectionSlug: string\n /**\n * The default URL that would normally be used for this document link.\n * You can return this as-is, modify it, or completely replace it.\n */\n defaultURL: string\n doc: Record<string, unknown>\n req: PayloadRequest\n /**\n * The current view context where the link is being generated.\n * Most relevant values for document linking are 'list' and 'trash'.\n */\n viewType?: ViewTypes\n }) => null | string\n /**\n * Specify a navigational group for collections in the admin sidebar.\n * - Provide a string to place the entity in a custom group.\n * - Provide a record to define localized group names.\n * - Set to `false` to exclude the collection from the sidebar, command palette, dashboard collection cards,\n * and pin picker, and its documents from both the Pinned and Recently viewed dashboard tabs, including existing pins.\n * This does not disable routes or change access control or rich text link and relationship eligibility.\n * Use `enableRichTextLink` and `enableRichTextRelationship` to configure rich text eligibility separately.\n */\n group?: false | Record<string, string> | string\n /**\n * Exclude the collection from the admin nav and routes\n */\n hidden?: ((args: { user: PayloadRequest['user'] }) => boolean) | boolean\n /**\n * Additional fields to be searched via the full text search\n */\n listSearchableFields?: string[]\n /**\n * Live Preview options.\n *\n * @see https://payloadcms.com/docs/live-preview/overview\n */\n livePreview?: LivePreviewConfig\n meta?: MetaConfig\n pagination?: {\n defaultLimit?: number\n limits?: number[]\n }\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n /**\n * Field to use as the thumbnail image in grid/card views. Defaults to the first field of type `upload`.\n */\n useAsThumbnail?: string\n /**\n * Field to use as title in Edit View and first column in List view\n */\n useAsTitle?: string\n}\n\nexport type CollectionAccess<TData = any> = {\n admin?: ({ slug, req }: { req: PayloadRequest; slug: string }) => boolean | Promise<boolean>\n create?: Access<TData>\n delete?: Access<TData>\n read?: Access<TData>\n readVersions?: Access<TData>\n unlock?: Access<TData>\n update?: Access<TData>\n /**\n * Controls on-demand validation for this collection.\n * Falls back to `update` access when omitted.\n * The access function receives `req.operation === 'validate'`.\n * @see https://payloadcms.com/docs/validation/overview#access-control-and-hooks\n */\n validate?: Access<TData>\n}\n\ntype CollectionHooks<TSlug extends CollectionSlug = any> = {\n afterChange?: AfterChangeHook[]\n afterDelete?: AfterDeleteHook[]\n afterError?: AfterErrorHook[]\n afterForgotPassword?: AfterForgotPasswordHook[]\n afterLogin?: AfterLoginHook[]\n afterLogout?: AfterLogoutHook[]\n afterMe?: AfterMeHook[]\n afterOperation?: AfterOperationHook<TSlug>[]\n afterRead?: AfterReadHook[]\n afterRefresh?: AfterRefreshHook[]\n beforeChange?: BeforeChangeHook[]\n beforeDelete?: BeforeDeleteHook[]\n beforeLogin?: BeforeLoginHook[]\n beforeOperation?: BeforeOperationHook<TSlug>[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n /**\n /**\n * Use the `me` hook to control the `me` operation.\n * Here, you can optionally instruct the me operation to return early,\n * and skip its default logic.\n */\n me?: MeHook[]\n /**\n * Use the `refresh` hook to control the refresh operation.\n * Here, you can optionally instruct the refresh operation to return early,\n * and skip its default logic.\n */\n refresh?: RefreshHook[]\n}\n\n/** Manage all aspects of a data collection */\nexport type CollectionConfig<TSlug extends CollectionSlug = any> = {\n /**\n * Do not set this property manually. This is set to true during sanitization, to avoid\n * sanitizing the same collection multiple times.\n */\n _sanitized?: boolean\n /**\n * Access control\n */\n access?: CollectionAccess\n /**\n * Collection admin options\n */\n admin?: CollectionAdminOptions\n /**\n * Collection login options\n *\n * Use `true` to enable with default options\n */\n auth?: boolean | IncomingAuthType\n /**\n * Automatically track the user that created and last updated each document via\n * polymorphic `createdBy` / `updatedBy` relationship fields to your auth collections.\n *\n * Use `true` (default) to enable both, `false` to disable both, or an object to\n * toggle each field independently, e.g. `{ updatedBy: false }`.\n *\n * @default true\n */\n authorship?: Authorship | boolean\n /**\n * Configuration for bulk operations\n */\n /** Extension point to add your custom data. Server only. */\n custom?: CollectionCustom\n /**\n * Used to override the default naming of the database table or collection with your using a function or string\n * @WARNING: If you change this property with existing data, you will need to handle the renaming of the table in your database or by using migrations\n */\n dbName?: DBIdentifierName\n defaultPopulate?: IsAny<SelectFromCollectionSlug<TSlug>> extends true\n ? SelectType\n : SelectFromCollectionSlug<TSlug>\n /**\n * Default field to sort by in collection list view\n */\n defaultSort?: Sort\n /**\n * Disable the bulk delete operation for the collection in the admin panel and the API\n */\n disableBulkDelete?: boolean\n /**\n * Disable the bulk edit operation for the collection in the admin panel and the API\n */\n disableBulkEdit?: boolean\n /**\n * When true, do not show the \"Duplicate\" button while editing documents within this collection and prevent `duplicate` from all APIs\n */\n disableDuplicate?: boolean\n /**\n * Opt-in to enable query presets for this collection.\n * @see https://payloadcms.com/docs/query-presets/overview\n */\n enableQueryPresets?: boolean\n /**\n * Custom rest api endpoints, set false to disable all rest endpoints for this collection.\n */\n endpoints?: false | Omit<Endpoint, 'root'>[]\n fields: Field[]\n /**\n * Enable folder hierarchy preset for this collection.\n * Sets hierarchy with folder defaults: allowHasMany: false, FolderIcon, useHeaderButton: true\n *\n * Use `true` for defaults, or object for customization.\n * Cannot be used together with `tags` or `hierarchy`.\n */\n folders?: boolean | FoldersConfig\n /**\n * GraphQL configuration\n */\n graphQL?:\n | {\n disableMutations?: true\n disableQueries?: true\n pluralName?: string\n singularName?: string\n }\n | false\n /**\n * Enable hierarchical tree structure for this collection\n *\n * Use `true` to enable with defaults (auto-detects parent field)\n * or provide configuration object\n *\n * @example\n * // Enable with defaults\n * hierarchy: true\n *\n * @example\n * // Customize field names and slugify function\n * hierarchy: {\n * parentFieldName: 'parent',\n * slugify: (text) => customSlugify(text),\n * slugPathFieldName: '_breadcrumbPath'\n * }\n */\n hierarchy?: boolean | HierarchyConfig\n /**\n * Hooks to modify Payload functionality\n */\n hooks?: CollectionHooks<TSlug>\n /**\n * Define compound indexes for this collection.\n * This can be used to either speed up querying/sorting by 2 or more fields at the same time or\n * to ensure uniqueness between several fields.\n * Specify field paths\n * @example\n * [{ unique: true, fields: ['title', 'group.name'] }]\n * @default []\n */\n indexes?: CompoundIndex[]\n /**\n * Label configuration\n */\n labels?: {\n plural?: LabelFunction | StaticLabel\n singular?: LabelFunction | StaticLabel\n }\n /** Read-only Markdown instructions included in this collection's MCP and CLI schema responses. */\n llmInstructions?: string\n /**\n * Enables / Disables the ability to lock documents while editing\n * @default true\n */\n lockDocuments?:\n | {\n duration: number\n }\n | false\n /**\n * If true, enables custom ordering for the collection, and documents in the listView can be reordered via drag and drop.\n * New documents are inserted at the end of the list according to this parameter.\n *\n * Under the hood, a field with {@link https://payloadcms.com/docs/configuration/collections#fractional-indexing|fractional indexing} is used to optimize inserts and reorderings.\n *\n * @default false\n *\n * @experimental There may be frequent breaking changes to this API\n */\n orderable?: boolean\n slug: string\n /**\n * Enable tags hierarchy preset for this collection.\n * Sets hierarchy with tag defaults: allowHasMany: true, TagIcon\n *\n * Use `true` for defaults, or object for customization.\n * Cannot be used together with `folders` or `hierarchy`.\n */\n tags?: boolean | TagsConfig\n /**\n * Add `createdAt`, `deletedAt` and `updatedAt` fields\n *\n * @default true\n */\n timestamps?: boolean\n /**\n * Enables trash support for this collection.\n *\n * When enabled, documents will include a `deletedAt` timestamp field.\n * This allows documents to be marked as deleted without being permanently removed.\n * The `deletedAt` field will be set to the current date and time when a document is trashed.\n *\n * @default false\n */\n trash?: boolean\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n /**\n * Customize the handling of incoming file uploads\n *\n * @default false // disable uploads\n */\n upload?: boolean | UploadConfig\n /**\n * Enable versioning. Set it to true to enable default versions settings,\n * or customize versions options by setting the property equal to an object\n * containing the version options.\n *\n * @default false // disable versioning\n */\n versions?: boolean | IncomingCollectionVersions\n} & Pick<\n WithSelectFn<\n IsAny<SelectFromCollectionSlug<TSlug>> extends true\n ? SelectIncludeType\n : SelectFromCollectionSlug<TSlug>\n >,\n 'select'\n>\n\nexport type SanitizedJoin = {\n /**\n * The field configuration defining the join\n */\n field: JoinField\n getForeignPath?(args: { locale?: TypedLocale }): string\n /**\n * The path of the join field in dot notation\n */\n joinPath: string\n /**\n * `parentIsLocalized` is true if any parent field of the\n * field configuration defining the join is localized\n */\n parentIsLocalized: boolean\n targetField: RelationshipField | UploadField\n}\n\nexport type SanitizedJoins = {\n [collectionSlug: string]: SanitizedJoin[]\n}\n\n/**\n * Properties populated during sanitization are redefined below. All other collection properties\n * preserve their incoming optionality.\n */\nexport interface SanitizedCollectionConfig\n extends Omit<\n CollectionConfig,\n | '_sanitized'\n | 'access'\n | 'admin'\n | 'auth'\n | 'authorship'\n | 'custom'\n | 'endpoints'\n | 'folder'\n | 'folders'\n | 'hierarchy'\n | 'hooks'\n | 'indexes'\n | 'labels'\n | 'slug'\n | 'tags'\n | 'timestamps'\n | 'upload'\n | 'versions'\n >,\n Required<Pick<CollectionConfig, 'admin' | 'custom' | 'indexes' | 'timestamps'>> {\n _sanitized: true\n access: Pick<CollectionAccess, 'admin'> &\n Required<\n Pick<\n CollectionAccess,\n 'create' | 'delete' | 'read' | 'readVersions' | 'unlock' | 'update' | 'validate'\n >\n >\n auth: Auth\n authorship: SanitizedAuthorship\n endpoints: Endpoint[] | false\n /**\n * Fields in the database schema structure\n * Rows / collapsible / tabs w/o name `fields` merged to top, UIs are excluded\n */\n flattenedFields: FlattenedField[]\n /**\n * Hierarchy configuration (when collection is a hierarchy type like folders or tags)\n */\n hierarchy: false | SanitizedHierarchyConfig\n hooks: Required<CollectionHooks>\n /**\n * Object of collections to join 'Join Fields object keyed by collection\n */\n joins: SanitizedJoins\n labels: Required<NonNullable<CollectionConfig['labels']>>\n /**\n * List of all polymorphic join fields\n */\n polymorphicJoins: SanitizedJoin[]\n\n sanitizedIndexes: SanitizedCompoundIndex[]\n\n slug: CollectionSlug\n\n upload: SanitizedUploadConfig\n versions?: SanitizedCollectionVersions\n}\n\nexport type Collection = {\n config: SanitizedCollectionConfig\n customIDType?: 'number' | 'text'\n graphQL?: {\n countType: GraphQLObjectType\n JWT: GraphQLObjectType\n mutationInputType: GraphQLNonNull<any>\n paginatedType: GraphQLObjectType\n type: GraphQLObjectType\n updateMutationInputType: GraphQLNonNull<any>\n versionType: GraphQLObjectType\n whereInputType: GraphQLInputObjectType\n }\n}\n\nexport type BulkOperationResult<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n docs: TransformCollectionWithSelect<TSlug, TSelect>[]\n errors: {\n id: DataFromCollectionSlug<TSlug>['id']\n isPublic: boolean\n message: string\n }[]\n}\n\nexport type AuthCollection = {\n config: SanitizedCollectionConfig\n}\n\nexport type LocalizedMeta = {\n [locale: string]: {\n status: 'draft' | 'published'\n updatedAt: string\n }\n}\n\nexport type TypeWithID = {\n id: number | string\n}\n\nexport type TypeWithTimestamps = {\n [key: string]: unknown\n createdAt: string\n deletedAt?: null | string\n id: number | string\n updatedAt: string\n}\n\nexport type CompoundIndex = {\n fields: string[]\n unique?: boolean\n}\n\nexport type SanitizedCompoundIndex = {\n fields: {\n field: FlattenedField\n localizedPath: string\n path: string\n pathHasLocalized: boolean\n }[]\n unique: boolean\n}\n"],"names":[],"mappings":"AAAA,qDAAqD,GA86BrD,WAQC"}
|
|
@@ -153,7 +153,8 @@ export type GlobalAdminOptions = {
|
|
|
153
153
|
* Specify a navigational group for globals in the admin sidebar.
|
|
154
154
|
* - Provide a string to place the entity in a custom group.
|
|
155
155
|
* - Provide a record to define localized group names.
|
|
156
|
-
* - Set to `false` to exclude the
|
|
156
|
+
* - Set to `false` to exclude the global from the sidebar, command palette, and dashboard collection cards.
|
|
157
|
+
* This does not disable routes or change access control.
|
|
157
158
|
*/
|
|
158
159
|
group?: false | Record<string, string> | string;
|
|
159
160
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/globals/config/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAE1C,OAAO,KAAK,EACV,MAAM,EACN,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,qBAAqB,EACrB,WAAW,EACZ,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,6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AQ,GACR,OAAO,GACP,YAAY,GACZ,QAAQ,GACR,WAAW,GACX,OAAO,GACP,OAAO,GACP,MAAM,GACN,UAAU,CACb,EACD,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,CAAC;IAC5D,UAAU,EAAE,IAAI,CAAA;IAChB,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,cAAc,GAAG,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAA;IACrF,UAAU,EAAE,mBAAmB,CAAA;IAC/B,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAA;IAC7B;;;OAGG;IACH,eAAe,EAAE,cAAc,EAAE,CAAA;IACjC,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAA;IAC5B,IAAI,EAAE,UAAU,CAAA;IAChB,QAAQ,CAAC,EAAE,uBAAuB,CAAA;CACnC;AAED,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,qBAAqB,EAAE,CAAA;IAC/B,OAAO,CAAC,EACJ;QACE,CAAC,IAAI,EAAE,MAAM,GAAG;YACd,iBAAiB,EAAE,cAAc,CAAC,GAAG,CAAC,CAAA;YACtC,IAAI,EAAE,iBAAiB,CAAA;YACvB,WAAW,CAAC,EAAE,iBAAiB,CAAA;SAChC,CAAA;KACF,GACD,KAAK,CAAA;CACV,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/globals/config/types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { IsAny } from 'ts-essentials'\n\nimport type {\n Access,\n Endpoint,\n EntityDescription,\n GeneratePreviewURL,\n LabelFunction,\n LivePreviewConfig,\n MetaConfig,\n SharedAdminComponents,\n StaticLabel,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type { Authorship, SanitizedAuthorship } from '../../fields/baseFields/authorship/types.js'\nimport type { Field, FlattenedField } from '../../fields/config/types.js'\nimport type {\n GeneratedTypes,\n GlobalAdminCustom,\n GlobalCustom,\n GlobalSlug,\n RequestContext,\n TypedGlobal,\n TypedGlobalSelect,\n} from '../../index.js'\nimport type {\n FieldOperation,\n PayloadRequest,\n SelectIncludeType,\n Where,\n WithSelectFn,\n} from '../../types/index.js'\nimport type { IncomingGlobalVersions, SanitizedGlobalVersions } from '../../versions/types.js'\n\nexport type DataFromGlobalSlug<TSlug extends GlobalSlug> = TypedGlobal[TSlug]\n\nexport type SelectFromGlobalSlug<TSlug extends GlobalSlug> = TypedGlobalSelect[TSlug]\n\nexport type GlobalAccess<TData = any> = {\n read?: Access<TData>\n readVersions?: Access<TData>\n update?: Access<TData>\n /**\n * Controls on-demand validation for this global.\n * Falls back to `update` access when omitted.\n * The access function receives `req.operation === 'validate'`.\n * @see https://payloadcms.com/docs/validation/overview#access-control-and-hooks\n */\n validate?: Access<TData>\n}\n\n/**\n * Global slugs that do not have drafts enabled.\n * Detects globals without drafts by checking for the absence of the `_status` field.\n */\nexport type GlobalsWithoutDrafts = {\n [TSlug in GlobalSlug]: DataFromGlobalSlug<TSlug> extends { _status?: any } ? never : TSlug\n}[GlobalSlug]\n\n/**\n * Conditionally allows or forbids the `draft` property based on global configuration.\n * When `strictDraftTypes` is enabled, the `draft` property is forbidden on globals without drafts.\n */\nexport type DraftFlagFromGlobalSlug<TSlug extends GlobalSlug> = GeneratedTypes extends {\n strictDraftTypes: true\n}\n ? TSlug extends GlobalsWithoutDrafts\n ? {\n /**\n * The `draft` property is not allowed because this global does not have `versions.drafts` enabled.\n */\n draft?: never\n }\n : {\n /**\n * Whether the global should be queried from the versions table/collection or not. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: boolean\n }\n : {\n /**\n * Whether the global should be queried from the versions table/collection or not. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: boolean\n }\n\ntype GlobalChangeOperation = Extract<FieldOperation, 'update' | 'validate'>\n\nexport type BeforeValidateHook = (args: {\n context: RequestContext\n data?: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /** Hook operation being performed. */\n operation: GlobalChangeOperation\n originalDoc?: any\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n}) => any\n\nexport type BeforeChangeHook = (args: {\n context: RequestContext\n data: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /** Hook operation being performed. */\n operation: GlobalChangeOperation\n originalDoc?: any\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n}) => any\n\nexport type AfterChangeHook = (args: {\n context: RequestContext\n data: any\n doc: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /** Hook operation being performed. */\n operation: 'update'\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n previousDoc: any\n req: PayloadRequest\n}) => any\n\nexport type BeforeReadHook = (args: {\n context: RequestContext\n doc: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n}) => any\n\nexport type AfterReadHook = (args: {\n context: RequestContext\n doc: any\n findMany?: boolean\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n query?: Where\n req: PayloadRequest\n}) => any\n\nexport type HookOperationType = 'countVersions' | 'read' | 'restoreVersion' | 'update'\n\nexport type BeforeOperationHook = (args: {\n args?: any\n context: RequestContext\n /**\n * The Global which this hook is being run on\n * */\n global: SanitizedGlobalConfig\n /**\n * Hook operation being performed\n */\n operation: HookOperationType\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n}) => any\n\nexport type GlobalAdminOptions = {\n /**\n * Custom admin components\n */\n components?: SharedAdminComponents\n /** Extension point to add your custom data. Available in server and client. */\n custom?: GlobalAdminCustom\n /**\n * Custom description for collection\n */\n description?: EntityDescription\n /**\n * Specify a navigational group for globals in the admin sidebar.\n * - Provide a string to place the entity in a custom group.\n * - Provide a record to define localized group names.\n * - Set to `false` to exclude the
|
|
1
|
+
{"version":3,"sources":["../../../src/globals/config/types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { IsAny } from 'ts-essentials'\n\nimport type {\n Access,\n Endpoint,\n EntityDescription,\n GeneratePreviewURL,\n LabelFunction,\n LivePreviewConfig,\n MetaConfig,\n SharedAdminComponents,\n StaticLabel,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type { Authorship, SanitizedAuthorship } from '../../fields/baseFields/authorship/types.js'\nimport type { Field, FlattenedField } from '../../fields/config/types.js'\nimport type {\n GeneratedTypes,\n GlobalAdminCustom,\n GlobalCustom,\n GlobalSlug,\n RequestContext,\n TypedGlobal,\n TypedGlobalSelect,\n} from '../../index.js'\nimport type {\n FieldOperation,\n PayloadRequest,\n SelectIncludeType,\n Where,\n WithSelectFn,\n} from '../../types/index.js'\nimport type { IncomingGlobalVersions, SanitizedGlobalVersions } from '../../versions/types.js'\n\nexport type DataFromGlobalSlug<TSlug extends GlobalSlug> = TypedGlobal[TSlug]\n\nexport type SelectFromGlobalSlug<TSlug extends GlobalSlug> = TypedGlobalSelect[TSlug]\n\nexport type GlobalAccess<TData = any> = {\n read?: Access<TData>\n readVersions?: Access<TData>\n update?: Access<TData>\n /**\n * Controls on-demand validation for this global.\n * Falls back to `update` access when omitted.\n * The access function receives `req.operation === 'validate'`.\n * @see https://payloadcms.com/docs/validation/overview#access-control-and-hooks\n */\n validate?: Access<TData>\n}\n\n/**\n * Global slugs that do not have drafts enabled.\n * Detects globals without drafts by checking for the absence of the `_status` field.\n */\nexport type GlobalsWithoutDrafts = {\n [TSlug in GlobalSlug]: DataFromGlobalSlug<TSlug> extends { _status?: any } ? never : TSlug\n}[GlobalSlug]\n\n/**\n * Conditionally allows or forbids the `draft` property based on global configuration.\n * When `strictDraftTypes` is enabled, the `draft` property is forbidden on globals without drafts.\n */\nexport type DraftFlagFromGlobalSlug<TSlug extends GlobalSlug> = GeneratedTypes extends {\n strictDraftTypes: true\n}\n ? TSlug extends GlobalsWithoutDrafts\n ? {\n /**\n * The `draft` property is not allowed because this global does not have `versions.drafts` enabled.\n */\n draft?: never\n }\n : {\n /**\n * Whether the global should be queried from the versions table/collection or not. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: boolean\n }\n : {\n /**\n * Whether the global should be queried from the versions table/collection or not. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: boolean\n }\n\ntype GlobalChangeOperation = Extract<FieldOperation, 'update' | 'validate'>\n\nexport type BeforeValidateHook = (args: {\n context: RequestContext\n data?: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /** Hook operation being performed. */\n operation: GlobalChangeOperation\n originalDoc?: any\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n}) => any\n\nexport type BeforeChangeHook = (args: {\n context: RequestContext\n data: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /** Hook operation being performed. */\n operation: GlobalChangeOperation\n originalDoc?: any\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n}) => any\n\nexport type AfterChangeHook = (args: {\n context: RequestContext\n data: any\n doc: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /** Hook operation being performed. */\n operation: 'update'\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n previousDoc: any\n req: PayloadRequest\n}) => any\n\nexport type BeforeReadHook = (args: {\n context: RequestContext\n doc: any\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n}) => any\n\nexport type AfterReadHook = (args: {\n context: RequestContext\n doc: any\n findMany?: boolean\n /** The global which this hook is being run on */\n global: SanitizedGlobalConfig\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n query?: Where\n req: PayloadRequest\n}) => any\n\nexport type HookOperationType = 'countVersions' | 'read' | 'restoreVersion' | 'update'\n\nexport type BeforeOperationHook = (args: {\n args?: any\n context: RequestContext\n /**\n * The Global which this hook is being run on\n * */\n global: SanitizedGlobalConfig\n /**\n * Hook operation being performed\n */\n operation: HookOperationType\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n}) => any\n\nexport type GlobalAdminOptions = {\n /**\n * Custom admin components\n */\n components?: SharedAdminComponents\n /** Extension point to add your custom data. Available in server and client. */\n custom?: GlobalAdminCustom\n /**\n * Custom description for collection\n */\n description?: EntityDescription\n /**\n * Specify a navigational group for globals in the admin sidebar.\n * - Provide a string to place the entity in a custom group.\n * - Provide a record to define localized group names.\n * - Set to `false` to exclude the global from the sidebar, command palette, and dashboard collection cards.\n * This does not disable routes or change access control.\n */\n group?: false | Record<string, string> | string\n /**\n * Exclude the global from the admin nav and routes\n */\n hidden?: ((args: { user: PayloadRequest['user'] }) => boolean) | boolean\n /**\n * Live preview options\n */\n livePreview?: LivePreviewConfig\n meta?: MetaConfig\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n}\n\ntype GlobalHooks = {\n afterChange?: AfterChangeHook[]\n afterRead?: AfterReadHook[]\n beforeChange?: BeforeChangeHook[]\n beforeOperation?: BeforeOperationHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n}\n\nexport type GlobalConfig<TSlug extends GlobalSlug = any> = {\n /**\n * Do not set this property manually. This is set to true during sanitization, to avoid\n * sanitizing the same global multiple times.\n */\n _sanitized?: boolean\n access?: GlobalAccess\n admin?: GlobalAdminOptions\n /**\n * Automatically track the user that created and last updated this global via\n * polymorphic `createdBy` / `updatedBy` relationship fields to your auth collections.\n *\n * Use `true` (default) to enable both, `false` to disable both, or an object to\n * toggle each field independently, e.g. `{ updatedBy: false }`.\n *\n * @default true\n */\n authorship?: Authorship | boolean\n /** Extension point to add your custom data. Server only. */\n custom?: GlobalCustom\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n endpoints?: false | Omit<Endpoint, 'root'>[]\n fields: Field[]\n graphQL?:\n | {\n disableMutations?: true\n disableQueries?: true\n name?: string\n }\n | false\n hooks?: GlobalHooks\n label?: LabelFunction | StaticLabel\n /** Read-only Markdown instructions included in this global's MCP and CLI schema responses. */\n llmInstructions?: string\n /**\n * Enables / Disables the ability to lock documents while editing\n * @default true\n */\n lockDocuments?:\n | {\n duration: number\n }\n | false\n slug: string\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n versions?: boolean | IncomingGlobalVersions\n} & Pick<\n WithSelectFn<\n IsAny<SelectFromGlobalSlug<TSlug>> extends true\n ? SelectIncludeType\n : SelectFromGlobalSlug<TSlug>\n >,\n 'select'\n>\n\nexport interface SanitizedGlobalConfig\n extends Omit<\n GlobalConfig,\n | '_sanitized'\n | 'access'\n | 'admin'\n | 'authorship'\n | 'custom'\n | 'endpoints'\n | 'hooks'\n | 'label'\n | 'slug'\n | 'versions'\n >,\n Required<Pick<GlobalConfig, 'admin' | 'custom' | 'label'>> {\n _sanitized: true\n access: Required<Pick<GlobalAccess, 'read' | 'readVersions' | 'update' | 'validate'>>\n authorship: SanitizedAuthorship\n endpoints: Endpoint[] | false\n /**\n * Fields in the database schema structure\n * Rows / collapsible / tabs w/o name `fields` merged to top, UIs are excluded\n */\n flattenedFields: FlattenedField[]\n hooks: Required<GlobalHooks>\n slug: GlobalSlug\n versions?: SanitizedGlobalVersions\n}\n\nexport type Globals = {\n config: SanitizedGlobalConfig[]\n graphQL?:\n | {\n [slug: string]: {\n mutationInputType: GraphQLNonNull<any>\n type: GraphQLObjectType\n versionType?: GraphQLObjectType\n }\n }\n | false\n}\n"],"names":[],"mappings":"AAAA,qDAAqD,GAgUrD,WAWC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addHierarchyToCollection.d.ts","sourceRoot":"","sources":["../../src/hierarchy/addHierarchyToCollection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"addHierarchyToCollection.d.ts","sourceRoot":"","sources":["../../src/hierarchy/addHierarchyToCollection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAUtE,eAAO,MAAM,wBAAwB,iGAMlC;IACD,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,iBAAiB,EAAE,MAAM,CAAA;IACzB,kBAAkB,EAAE,MAAM,CAAA;CAC3B,SA6EA,CAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fieldAffectsData } from '../fields/config/types.js';
|
|
1
2
|
import { hierarchyCollectionAfterRead } from './hooks/collectionAfterRead.js';
|
|
2
3
|
import { hierarchyCollectionBeforeChange } from './hooks/collectionBeforeChange.js';
|
|
3
4
|
import { hierarchyCollectionBeforeDelete } from './hooks/collectionBeforeDelete.js';
|
|
@@ -8,28 +9,38 @@ export const addHierarchyToCollection = ({ collectionConfig, parentFieldName, sl
|
|
|
8
9
|
// Verify slug field exists if configured
|
|
9
10
|
const slugFieldInfo = slugFieldName ? findFieldByName(collectionConfig, slugFieldName) : undefined;
|
|
10
11
|
const validatedSlugFieldName = slugFieldInfo ? slugFieldName : undefined;
|
|
11
|
-
// Add virtual path fields (computed in afterRead)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
// Add virtual path fields (computed in afterRead). This can run again on the same
|
|
13
|
+
// `fields` array, so skip fields that already exist
|
|
14
|
+
const pathFields = [
|
|
15
|
+
{
|
|
16
|
+
name: slugPathFieldName,
|
|
17
|
+
type: 'text',
|
|
18
|
+
admin: {
|
|
19
|
+
hidden: true,
|
|
20
|
+
readOnly: true
|
|
21
|
+
},
|
|
22
|
+
index: true,
|
|
23
|
+
label: 'Slug Path',
|
|
24
|
+
virtual: true
|
|
18
25
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
{
|
|
27
|
+
name: titlePathFieldName,
|
|
28
|
+
type: 'text',
|
|
29
|
+
admin: {
|
|
30
|
+
hidden: true,
|
|
31
|
+
readOnly: true
|
|
32
|
+
},
|
|
33
|
+
index: true,
|
|
34
|
+
label: 'Title Path',
|
|
35
|
+
virtual: true
|
|
36
|
+
}
|
|
37
|
+
];
|
|
38
|
+
for (const pathField of pathFields){
|
|
39
|
+
const hasPathField = collectionConfig.fields.some((field)=>fieldAffectsData(field) && field.name === pathField.name);
|
|
40
|
+
if (!hasPathField) {
|
|
41
|
+
collectionConfig.fields.push(pathField);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
33
44
|
if (!collectionConfig.admin) {
|
|
34
45
|
collectionConfig.admin = {};
|
|
35
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hierarchy/addHierarchyToCollection.ts"],"sourcesContent":["import type { CollectionConfig } from '../collections/config/types.js'\n\nimport { hierarchyCollectionAfterRead } from './hooks/collectionAfterRead.js'\nimport { hierarchyCollectionBeforeChange } from './hooks/collectionBeforeChange.js'\nimport { hierarchyCollectionBeforeDelete } from './hooks/collectionBeforeDelete.js'\nimport { hierarchyCollectionBeforeOperation } from './hooks/collectionBeforeOperation.js'\nimport { findFieldByName, findUseAsTitleField } from './utils/findUseAsTitle.js'\n\nexport const addHierarchyToCollection = ({\n collectionConfig,\n parentFieldName,\n slugFieldName,\n slugPathFieldName,\n titlePathFieldName,\n}: {\n collectionConfig: CollectionConfig\n parentFieldName: string\n slugFieldName?: string\n slugPathFieldName: string\n titlePathFieldName: string\n}) => {\n const { titleFieldName } = findUseAsTitleField(collectionConfig)\n // Verify slug field exists if configured\n const slugFieldInfo = slugFieldName ? findFieldByName(collectionConfig, slugFieldName) : undefined\n const validatedSlugFieldName = slugFieldInfo ? slugFieldName : undefined\n\n // Add virtual path fields (computed in afterRead)\n
|
|
1
|
+
{"version":3,"sources":["../../src/hierarchy/addHierarchyToCollection.ts"],"sourcesContent":["import type { CollectionConfig } from '../collections/config/types.js'\nimport type { TextField } from '../fields/config/types.js'\n\nimport { fieldAffectsData } from '../fields/config/types.js'\nimport { hierarchyCollectionAfterRead } from './hooks/collectionAfterRead.js'\nimport { hierarchyCollectionBeforeChange } from './hooks/collectionBeforeChange.js'\nimport { hierarchyCollectionBeforeDelete } from './hooks/collectionBeforeDelete.js'\nimport { hierarchyCollectionBeforeOperation } from './hooks/collectionBeforeOperation.js'\nimport { findFieldByName, findUseAsTitleField } from './utils/findUseAsTitle.js'\n\nexport const addHierarchyToCollection = ({\n collectionConfig,\n parentFieldName,\n slugFieldName,\n slugPathFieldName,\n titlePathFieldName,\n}: {\n collectionConfig: CollectionConfig\n parentFieldName: string\n slugFieldName?: string\n slugPathFieldName: string\n titlePathFieldName: string\n}) => {\n const { titleFieldName } = findUseAsTitleField(collectionConfig)\n // Verify slug field exists if configured\n const slugFieldInfo = slugFieldName ? findFieldByName(collectionConfig, slugFieldName) : undefined\n const validatedSlugFieldName = slugFieldInfo ? slugFieldName : undefined\n\n // Add virtual path fields (computed in afterRead). This can run again on the same\n // `fields` array, so skip fields that already exist\n const pathFields: TextField[] = [\n {\n name: slugPathFieldName,\n type: 'text',\n admin: {\n hidden: true,\n readOnly: true,\n },\n index: true,\n label: 'Slug Path',\n virtual: true,\n },\n {\n name: titlePathFieldName,\n type: 'text',\n admin: {\n hidden: true,\n readOnly: true,\n },\n index: true,\n label: 'Title Path',\n virtual: true,\n },\n ]\n\n for (const pathField of pathFields) {\n const hasPathField = collectionConfig.fields.some(\n (field) => fieldAffectsData(field) && field.name === pathField.name,\n )\n\n if (!hasPathField) {\n collectionConfig.fields.push(pathField)\n }\n }\n\n if (!collectionConfig.admin) {\n collectionConfig.admin = {}\n }\n if (!collectionConfig.admin.listSearchableFields) {\n collectionConfig.admin.listSearchableFields = [titleFieldName]\n } else if (!collectionConfig.admin.listSearchableFields.includes(titleFieldName)) {\n collectionConfig.admin.listSearchableFields.push(titleFieldName)\n }\n\n collectionConfig.hooks = {\n ...(collectionConfig.hooks || {}),\n afterRead: [\n ...(collectionConfig.hooks?.afterRead || []),\n hierarchyCollectionAfterRead({ parentFieldName, slugPathFieldName, titlePathFieldName }),\n ],\n beforeChange: [\n ...(collectionConfig.hooks?.beforeChange || []),\n hierarchyCollectionBeforeChange({ parentFieldName }),\n ],\n beforeDelete: [\n ...(collectionConfig.hooks?.beforeDelete || []),\n hierarchyCollectionBeforeDelete({ parentFieldName }),\n ],\n beforeOperation: [\n ...(collectionConfig.hooks?.beforeOperation || []),\n hierarchyCollectionBeforeOperation({\n parentFieldName,\n slugFieldName: validatedSlugFieldName,\n slugPathFieldName,\n titleFieldName,\n titlePathFieldName,\n }),\n ],\n }\n}\n"],"names":["fieldAffectsData","hierarchyCollectionAfterRead","hierarchyCollectionBeforeChange","hierarchyCollectionBeforeDelete","hierarchyCollectionBeforeOperation","findFieldByName","findUseAsTitleField","addHierarchyToCollection","collectionConfig","parentFieldName","slugFieldName","slugPathFieldName","titlePathFieldName","titleFieldName","slugFieldInfo","undefined","validatedSlugFieldName","pathFields","name","type","admin","hidden","readOnly","index","label","virtual","pathField","hasPathField","fields","some","field","push","listSearchableFields","includes","hooks","afterRead","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KAAK,CAACY,oBAAoB,GAAG;YAACnB;SAAe;IAChE,OAAO,IAAI,CAACL,iBAAiBY,KAAK,CAACY,oBAAoB,CAACC,QAAQ,CAACpB,iBAAiB;QAChFL,iBAAiBY,KAAK,CAACY,oBAAoB,CAACD,IAAI,CAAClB;IACnD;IAEAL,iBAAiB0B,KAAK,GAAG;QACvB,GAAI1B,iBAAiB0B,KAAK,IAAI,CAAC,CAAC;QAChCC,WAAW;eACL3B,iBAAiB0B,KAAK,EAAEC,aAAa,EAAE;YAC3ClC,6BAA6B;gBAAEQ;gBAAiBE;gBAAmBC;YAAmB;SACvF;QACDwB,cAAc;eACR5B,iBAAiB0B,KAAK,EAAEE,gBAAgB,EAAE;YAC9ClC,gCAAgC;gBAAEO;YAAgB;SACnD;QACD4B,cAAc;eACR7B,iBAAiB0B,KAAK,EAAEG,gBAAgB,EAAE;YAC9ClC,gCAAgC;gBAAEM;YAAgB;SACnD;QACD6B,iBAAiB;eACX9B,iBAAiB0B,KAAK,EAAEI,mBAAmB,EAAE;YACjDlC,mCAAmC;gBACjCK;gBACAC,eAAeM;gBACfL;gBACAE;gBACAD;YACF;SACD;IACH;AACF,EAAC"}
|
|
@@ -233,7 +233,13 @@ const validateCollectionSpecificHierarchy = async ({ hierarchySlug, options, typ
|
|
|
233
233
|
options: collectionOptions
|
|
234
234
|
};
|
|
235
235
|
hierarchyCollection.fields = hierarchyCollection.fields || [];
|
|
236
|
-
|
|
236
|
+
// This can run again on the same `fields` array, so replace the field if it already exists
|
|
237
|
+
const existingTypeFieldIndex = hierarchyCollection.fields.findIndex((field)=>fieldAffectsData(field) && field.name === typeFieldName);
|
|
238
|
+
if (existingTypeFieldIndex === -1) {
|
|
239
|
+
hierarchyCollection.fields.push(typeField);
|
|
240
|
+
} else {
|
|
241
|
+
hierarchyCollection.fields[existingTypeFieldIndex] = typeField;
|
|
242
|
+
}
|
|
237
243
|
// Recompute flattenedFields since we added a field after initial sanitization
|
|
238
244
|
// This is required for the field to be queryable
|
|
239
245
|
if ('flattenedFields' in hierarchyCollection) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hierarchy/resolveHierarchyCollections.ts"],"sourcesContent":["import type { CollectionConfig, SanitizedCollectionConfig } from '../collections/config/types.js'\nimport type { Config } from '../config/types.js'\nimport type {\n JoinField,\n Option,\n RelationshipField,\n SelectField,\n Validate,\n} from '../fields/config/types.js'\nimport type { Document } from '../types/index.js'\nimport type {\n HierarchyJoinFieldConfig,\n SanitizedHierarchyConfig,\n SanitizedHierarchyRelatedCollection,\n} from './types.js'\n\nimport { sanitizeJoinField } from '../fields/config/sanitizeJoinField.js'\nimport { fieldAffectsData } from '../fields/config/types.js'\nimport { extractID } from '../utilities/extractID.js'\nimport { flattenAllFields } from '../utilities/flattenAllFields.js'\nimport { getHierarchyFieldName } from './constants.js'\nimport { hierarchyCollectionAfterDelete } from './hooks/collectionAfterDelete.js'\nimport { injectHierarchyButton } from './injectHierarchyButton.js'\n\n/**\n * Resolves hierarchy relationships across collections.\n *\n * This function runs after individual collection sanitization to establish\n * cross-collection hierarchy relationships. It discovers which collections\n * reference each hierarchy and configures the necessary fields, components,\n * and hooks.\n *\n * @remarks\n * Must be called after all collections are sanitized.\n *\n * **What it does:**\n * - Discovers related collections by scanning for hierarchy relationship fields\n * - Injects `HierarchyButton` component when `custom.hierarchy.injectHeaderButton` is set\n * - Adds `collectionSpecific` validation to ensure hierarchy items accept the document type\n * - Injects the `hierarchyType` select field when `collectionSpecific` is enabled\n * - Injects join field when `joinField` is configured\n * - Adds `afterDelete` hook to clear hierarchy references when items are deleted\n * - Populates `relatedCollections` in the sanitized hierarchy config\n */\nexport const resolveHierarchyCollections = (config: Config): void => {\n const hierarchyCollections =\n config.collections?.filter((col) => col.hierarchy && typeof col.hierarchy === 'object') || []\n\n for (const hierarchyCollection of hierarchyCollections) {\n const hierarchy = hierarchyCollection.hierarchy\n\n // TypeScript guard - hierarchy is guaranteed to be an object by the filter above\n if (!hierarchy || typeof hierarchy !== 'object') {\n continue\n }\n\n const hierarchyConfig = hierarchy as SanitizedHierarchyConfig\n const defaultFieldName = getHierarchyFieldName(hierarchyCollection.slug)\n const parentFieldName = hierarchyConfig.parentFieldName ?? defaultFieldName\n const isParentFieldNameOverridden = parentFieldName !== defaultFieldName\n const collectionSpecific = hierarchyConfig.collectionSpecific\n const typeFieldName = collectionSpecific ? collectionSpecific.fieldName : undefined\n const allowHasMany = hierarchyConfig.allowHasMany ?? true\n\n // Build relatedCollections by scanning all collections for hierarchy fields\n const sanitizedRelatedCollections: Record<string, SanitizedHierarchyRelatedCollection> = {}\n\n const selfParentField = hierarchyCollection.fields.find(\n (field) =>\n fieldAffectsData(field) &&\n field.name === parentFieldName &&\n field.type === 'relationship' &&\n (field as RelationshipField).relationTo === hierarchyCollection.slug,\n ) as RelationshipField | undefined\n\n // Check if the hierarchy collection's own parent field should be replaced with a header button\n if (selfParentField?.custom?.hierarchy?.injectHeaderButton === true) {\n injectHierarchyButton({\n collection: hierarchyCollection,\n fieldName: parentFieldName,\n hierarchyCollectionSlug: hierarchyCollection.slug,\n parentFieldName: hierarchyConfig.parentFieldName,\n })\n }\n\n for (const collection of config.collections || []) {\n // Skip the hierarchy collection itself (handled above)\n if (collection.slug === hierarchyCollection.slug) {\n continue\n }\n\n // Find hierarchy field by the default name (what createFolderField uses)\n const hierarchyField = collection.fields.find(\n (field) =>\n fieldAffectsData(field) &&\n field.name === defaultFieldName &&\n field.type === 'relationship' &&\n (field as RelationshipField).relationTo === hierarchyCollection.slug,\n ) as RelationshipField | undefined\n\n // If parentFieldName is overridden, rename the field to match\n if (hierarchyField && isParentFieldNameOverridden) {\n hierarchyField.name = parentFieldName\n }\n\n if (!hierarchyField) {\n continue\n }\n\n const fieldHasMany = hierarchyField.hasMany ?? allowHasMany\n\n // If collectionSpecific, inject validation to check hierarchy allows this collection type\n if (collectionSpecific) {\n injectCollectionSpecificValidation({\n hierarchyField,\n hierarchySlug: hierarchyCollection.slug,\n typeFieldName: typeFieldName!,\n })\n }\n\n // Store discovered collection with hasMany info\n sanitizedRelatedCollections[collection.slug] = {\n fieldName: parentFieldName,\n hasMany: fieldHasMany,\n }\n\n // Inject HierarchyButton if field requests it\n if (hierarchyField.custom?.hierarchy?.injectHeaderButton === true) {\n injectHierarchyButton({\n collection,\n fieldName: parentFieldName,\n hierarchyCollectionSlug: hierarchyCollection.slug,\n parentFieldName: hierarchyConfig.parentFieldName,\n })\n }\n }\n\n // If collectionSpecific, add type field to hierarchy collection\n if (hierarchyConfig.collectionSpecific) {\n injectTypeField({\n config,\n hierarchyCollection: hierarchyCollection as SanitizedCollectionConfig,\n parentFieldName: hierarchyConfig.parentFieldName,\n sanitizedRelatedCollections,\n typeFieldName: hierarchyConfig.collectionSpecific.fieldName,\n })\n }\n\n // If joinField is configured, add the join field to query children\n if (hierarchyConfig.joinField) {\n injectJoinField({\n config,\n hierarchyCollection: hierarchyCollection as SanitizedCollectionConfig,\n joinFieldConfig: hierarchyConfig.joinField,\n parentFieldName,\n relatedSlugs: Object.keys(sanitizedRelatedCollections),\n })\n }\n\n // Update hierarchy config with sanitized relatedCollections\n if (hierarchyConfig) {\n hierarchyConfig.relatedCollections = sanitizedRelatedCollections\n }\n\n // Add afterDelete hook to clear folder references from related documents\n if (Object.keys(sanitizedRelatedCollections).length > 0) {\n injectAfterDeleteHook({\n hierarchyCollection: hierarchyCollection as SanitizedCollectionConfig,\n sanitizedRelatedCollections,\n })\n }\n\n // Add sidebar tab for this hierarchy collection (unless explicitly disabled)\n if (hierarchyConfig.admin.injectSidebarTab !== false) {\n injectSidebarTab({\n config,\n hierarchyCollection,\n hierarchyConfig,\n })\n\n // Hide from nav when sidebar tab is injected (unless user explicitly set group)\n if (hierarchyCollection.admin?.group === undefined) {\n hierarchyCollection.admin = {\n ...hierarchyCollection.admin,\n group: false,\n }\n }\n }\n }\n}\n\n/**\n * Injects validation for collectionSpecific hierarchy fields.\n * Ensures the selected hierarchy item allows documents of this collection type.\n */\nfunction injectCollectionSpecificValidation({\n hierarchyField,\n hierarchySlug,\n typeFieldName,\n}: {\n hierarchyField: RelationshipField\n hierarchySlug: string\n typeFieldName: string\n}): void {\n const existingValidate = hierarchyField.validate\n\n const validate: Validate<unknown> = async (value, options) => {\n // Run existing validation first if present\n if (existingValidate) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const existingResult = await existingValidate(value as any, options as any)\n if (existingResult !== true) {\n return existingResult\n }\n }\n\n return validateCollectionSpecificHierarchy({\n hierarchySlug,\n options,\n typeFieldName,\n value,\n })\n }\n\n hierarchyField.validate = validate\n}\n\ntype HierarchyValidationOptions = Parameters<Validate<unknown>>[1]\n\nconst validateCollectionSpecificHierarchy = async ({\n hierarchySlug,\n options,\n typeFieldName,\n value,\n}: {\n hierarchySlug: string\n options: HierarchyValidationOptions\n typeFieldName: string\n value: unknown\n}): Promise<string | true> => {\n if (!value || (Array.isArray(value) && value.length === 0)) {\n return true\n }\n\n const { collectionSlug, overrideAccess, previousValue, req } = options\n const newIDs = (Array.isArray(value) ? value : [value]).map((item) => extractID<Document>(item))\n\n const previousIDs = new Set(\n (Array.isArray(previousValue) ? previousValue : previousValue ? [previousValue] : []).map(\n (item) => extractID<Document>(item),\n ),\n )\n\n for (const newID of newIDs) {\n if (previousIDs.has(newID)) {\n continue\n }\n\n let parentItem: Document | null = null\n if (typeof newID === 'string' || typeof newID === 'number') {\n try {\n parentItem = await req.payload.findByID({\n id: newID,\n collection: hierarchySlug,\n depth: 0,\n overrideAccess: overrideAccess ?? false,\n req,\n select: { [typeFieldName]: true },\n })\n } catch {\n return `Hierarchy item with ID ${newID} not found`\n }\n }\n\n if (!parentItem) {\n return `Hierarchy item with ID ${newID} not found`\n }\n\n const allowedTypes: string[] = (parentItem[typeFieldName] as string[]) || []\n\n if (allowedTypes.length === 0 || (collectionSlug && allowedTypes.includes(collectionSlug))) {\n continue\n }\n\n return `Hierarchy item \"${newID}\" does not allow documents of type \"${collectionSlug}\"`\n }\n\n return true\n}\n\n/**\n * Injects the hierarchyType select field into a hierarchy collection.\n */\nfunction injectTypeField({\n config,\n hierarchyCollection,\n parentFieldName,\n sanitizedRelatedCollections,\n typeFieldName,\n}: {\n config: Config\n hierarchyCollection: CollectionConfig | SanitizedCollectionConfig\n parentFieldName: string\n sanitizedRelatedCollections: Record<string, SanitizedHierarchyRelatedCollection>\n typeFieldName: string\n}): void {\n const collectionOptions: Option[] = Object.keys(sanitizedRelatedCollections).map((slug) => {\n const relatedCollection = config.collections?.find((c) => c.slug === slug)\n\n return {\n label: relatedCollection?.labels?.plural || slug,\n value: slug,\n }\n })\n\n const typeField: SelectField = {\n name: typeFieldName,\n type: 'select',\n admin: {\n components: {\n Field: {\n path: '@payloadcms/ui/rsc#HierarchyTypeFieldServer',\n serverProps: {\n collectionOptions,\n parentFieldName,\n },\n },\n },\n position: 'sidebar',\n },\n hasMany: true,\n label: ({ t }) => t('general:allowedTypes'),\n options: collectionOptions,\n }\n\n hierarchyCollection.fields = hierarchyCollection.fields || []\n hierarchyCollection.fields.push(typeField)\n\n // Recompute flattenedFields since we added a field after initial sanitization\n // This is required for the field to be queryable\n if ('flattenedFields' in hierarchyCollection) {\n hierarchyCollection.flattenedFields = flattenAllFields({\n fields: hierarchyCollection.fields,\n })\n }\n}\n\n/**\n * Injects a join field to query all children of a hierarchy item.\n */\nfunction injectJoinField({\n config,\n hierarchyCollection,\n joinFieldConfig,\n parentFieldName,\n relatedSlugs,\n}: {\n config: Config\n hierarchyCollection: SanitizedCollectionConfig\n joinFieldConfig: HierarchyJoinFieldConfig\n parentFieldName: string\n relatedSlugs: string[]\n}): void {\n const { name, admin: userAdmin, ...userConfig } = joinFieldConfig\n\n const hasJoinField = hierarchyCollection.fields?.some(\n (field) => 'name' in field && field.name === name,\n )\n\n if (hasJoinField) {\n return\n }\n\n const joinField: JoinField = {\n // User config (spread first so auto-generated values take precedence for required fields)\n ...userConfig,\n // Auto-generated values (these cannot be overridden)\n name,\n type: 'join',\n collection: [hierarchyCollection.slug, ...relatedSlugs],\n hasMany: true,\n on: parentFieldName,\n // Merge admin config\n admin: {\n ...userAdmin,\n },\n }\n\n hierarchyCollection.fields = hierarchyCollection.fields || []\n hierarchyCollection.fields.push(joinField)\n\n // Sanitize the join field to register it properly\n sanitizeJoinField({\n config,\n field: joinField,\n joins: hierarchyCollection.joins,\n parentIsLocalized: false,\n polymorphicJoins: hierarchyCollection.polymorphicJoins,\n })\n\n // Recompute flattenedFields since we added a field after initial sanitization\n hierarchyCollection.flattenedFields = flattenAllFields({\n fields: hierarchyCollection.fields,\n })\n}\n\n/**\n * Injects afterDelete hook to clear hierarchy references from related documents.\n */\nfunction injectAfterDeleteHook({\n hierarchyCollection,\n sanitizedRelatedCollections,\n}: {\n hierarchyCollection: CollectionConfig | SanitizedCollectionConfig\n sanitizedRelatedCollections: Record<string, SanitizedHierarchyRelatedCollection>\n}): void {\n // Build map of collection slugs to their field names\n const relatedCollectionFieldMap: Record<string, string> = {}\n for (const [slug, relatedConfig] of Object.entries(sanitizedRelatedCollections)) {\n relatedCollectionFieldMap[slug] = relatedConfig.fieldName\n }\n\n hierarchyCollection.hooks = hierarchyCollection.hooks || {}\n hierarchyCollection.hooks.afterDelete = [\n ...(hierarchyCollection.hooks.afterDelete || []),\n hierarchyCollectionAfterDelete({ relatedCollections: relatedCollectionFieldMap }),\n ]\n}\n\n/**\n * Injects a sidebar tab for a hierarchy collection.\n */\nfunction injectSidebarTab({\n config,\n hierarchyCollection,\n hierarchyConfig,\n}: {\n config: Config\n hierarchyCollection: CollectionConfig\n hierarchyConfig: SanitizedHierarchyConfig\n}): void {\n const tabSlug = `hierarchy-${hierarchyCollection.slug}`\n const Icon = hierarchyConfig.admin.components.Icon\n\n // Initialize admin config structure\n config.admin = config.admin || {}\n config.admin.components = config.admin.components || {}\n config.admin.components.sidebar = config.admin.components.sidebar || {}\n config.admin.components.sidebar.tabs = config.admin.components.sidebar.tabs || []\n\n // Check if tab already exists\n const hasTab = config.admin.components.sidebar.tabs.some((tab) => tab.slug === tabSlug)\n\n if (!hasTab) {\n config.admin.components.sidebar.tabs.push({\n slug: tabSlug,\n components: {\n Content: {\n clientProps: {\n hierarchyCollectionSlug: hierarchyCollection.slug,\n },\n path: '@payloadcms/ui/rsc#HierarchySidebarTabServer',\n },\n Icon,\n },\n label: hierarchyCollection.labels?.plural || hierarchyCollection.slug,\n })\n }\n}\n"],"names":["sanitizeJoinField","fieldAffectsData","extractID","flattenAllFields","getHierarchyFieldName","hierarchyCollectionAfterDelete","injectHierarchyButton","resolveHierarchyCollections","config","hierarchyCollections","collections","filter","col","hierarchy","hierarchyCollection","hierarchyConfig","defaultFieldName","slug","parentFieldName","isParentFieldNameOverridden","collectionSpecific","typeFieldName","fieldName","undefined","allowHasMany","sanitizedRelatedCollections","selfParentField","fields","find","field","name","type","relationTo","custom","injectHeaderButton","collection","hierarchyCollectionSlug","hierarchyField","fieldHasMany","hasMany","injectCollectionSpecificValidation","hierarchySlug","injectTypeField","joinField","injectJoinField","joinFieldConfig","relatedSlugs","Object","keys","relatedCollections","length","injectAfterDeleteHook","admin","injectSidebarTab","group","existingValidate","validate","value","options","existingResult","validateCollectionSpecificHierarchy","Array","isArray","collectionSlug","overrideAccess","previousValue","req","newIDs","map","item","previousIDs","Set","newID","has","parentItem","payload","findByID","id","depth","select","allowedTypes","includes","collectionOptions","relatedCollection","c","label","labels","plural","typeField","components","Field","path","serverProps","position","t","push","flattenedFields","userAdmin","userConfig","hasJoinField","some","on","joins","parentIsLocalized","polymorphicJoins","relatedCollectionFieldMap","relatedConfig","entries","hooks","afterDelete","tabSlug","Icon","sidebar","tabs","hasTab","tab","Content","clientProps"],"mappings":"AAgBA,SAASA,iBAAiB,QAAQ,wCAAuC;AACzE,SAASC,gBAAgB,QAAQ,4BAA2B;AAC5D,SAASC,SAAS,QAAQ,4BAA2B;AACrD,SAASC,gBAAgB,QAAQ,mCAAkC;AACnE,SAASC,qBAAqB,QAAQ,iBAAgB;AACtD,SAASC,8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,UAAU,CAACuB,OAAO,CAACC,IAAI,GAAGzG,OAAO4C,KAAK,CAACqC,UAAU,CAACuB,OAAO,CAACC,IAAI,IAAI,EAAE;IAEjF,8BAA8B;IAC9B,MAAMC,SAAS1G,OAAO4C,KAAK,CAACqC,UAAU,CAACuB,OAAO,CAACC,IAAI,CAACb,IAAI,CAAC,CAACe,MAAQA,IAAIlG,IAAI,KAAK6F;IAE/E,IAAI,CAACI,QAAQ;QACX1G,OAAO4C,KAAK,CAACqC,UAAU,CAACuB,OAAO,CAACC,IAAI,CAAClB,IAAI,CAAC;YACxC9E,MAAM6F;YACNrB,YAAY;gBACV2B,SAAS;oBACPC,aAAa;wBACXjF,yBAAyBtB,oBAAoBG,IAAI;oBACnD;oBACA0E,MAAM;gBACR;gBACAoB;YACF;YACA1B,OAAOvE,oBAAoBwE,MAAM,EAAEC,UAAUzE,oBAAoBG,IAAI;QACvE;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/hierarchy/resolveHierarchyCollections.ts"],"sourcesContent":["import type { CollectionConfig, SanitizedCollectionConfig } from '../collections/config/types.js'\nimport type { Config } from '../config/types.js'\nimport type {\n JoinField,\n Option,\n RelationshipField,\n SelectField,\n Validate,\n} from '../fields/config/types.js'\nimport type { Document } from '../types/index.js'\nimport type {\n HierarchyJoinFieldConfig,\n SanitizedHierarchyConfig,\n SanitizedHierarchyRelatedCollection,\n} from './types.js'\n\nimport { sanitizeJoinField } from '../fields/config/sanitizeJoinField.js'\nimport { fieldAffectsData } from '../fields/config/types.js'\nimport { extractID } from '../utilities/extractID.js'\nimport { flattenAllFields } from '../utilities/flattenAllFields.js'\nimport { getHierarchyFieldName } from './constants.js'\nimport { hierarchyCollectionAfterDelete } from './hooks/collectionAfterDelete.js'\nimport { injectHierarchyButton } from './injectHierarchyButton.js'\n\n/**\n * Resolves hierarchy relationships across collections.\n *\n * This function runs after individual collection sanitization to establish\n * cross-collection hierarchy relationships. It discovers which collections\n * reference each hierarchy and configures the necessary fields, components,\n * and hooks.\n *\n * @remarks\n * Must be called after all collections are sanitized.\n *\n * **What it does:**\n * - Discovers related collections by scanning for hierarchy relationship fields\n * - Injects `HierarchyButton` component when `custom.hierarchy.injectHeaderButton` is set\n * - Adds `collectionSpecific` validation to ensure hierarchy items accept the document type\n * - Injects the `hierarchyType` select field when `collectionSpecific` is enabled\n * - Injects join field when `joinField` is configured\n * - Adds `afterDelete` hook to clear hierarchy references when items are deleted\n * - Populates `relatedCollections` in the sanitized hierarchy config\n */\nexport const resolveHierarchyCollections = (config: Config): void => {\n const hierarchyCollections =\n config.collections?.filter((col) => col.hierarchy && typeof col.hierarchy === 'object') || []\n\n for (const hierarchyCollection of hierarchyCollections) {\n const hierarchy = hierarchyCollection.hierarchy\n\n // TypeScript guard - hierarchy is guaranteed to be an object by the filter above\n if (!hierarchy || typeof hierarchy !== 'object') {\n continue\n }\n\n const hierarchyConfig = hierarchy as SanitizedHierarchyConfig\n const defaultFieldName = getHierarchyFieldName(hierarchyCollection.slug)\n const parentFieldName = hierarchyConfig.parentFieldName ?? defaultFieldName\n const isParentFieldNameOverridden = parentFieldName !== defaultFieldName\n const collectionSpecific = hierarchyConfig.collectionSpecific\n const typeFieldName = collectionSpecific ? collectionSpecific.fieldName : undefined\n const allowHasMany = hierarchyConfig.allowHasMany ?? true\n\n // Build relatedCollections by scanning all collections for hierarchy fields\n const sanitizedRelatedCollections: Record<string, SanitizedHierarchyRelatedCollection> = {}\n\n const selfParentField = hierarchyCollection.fields.find(\n (field) =>\n fieldAffectsData(field) &&\n field.name === parentFieldName &&\n field.type === 'relationship' &&\n (field as RelationshipField).relationTo === hierarchyCollection.slug,\n ) as RelationshipField | undefined\n\n // Check if the hierarchy collection's own parent field should be replaced with a header button\n if (selfParentField?.custom?.hierarchy?.injectHeaderButton === true) {\n injectHierarchyButton({\n collection: hierarchyCollection,\n fieldName: parentFieldName,\n hierarchyCollectionSlug: hierarchyCollection.slug,\n parentFieldName: hierarchyConfig.parentFieldName,\n })\n }\n\n for (const collection of config.collections || []) {\n // Skip the hierarchy collection itself (handled above)\n if (collection.slug === hierarchyCollection.slug) {\n continue\n }\n\n // Find hierarchy field by the default name (what createFolderField uses)\n const hierarchyField = collection.fields.find(\n (field) =>\n fieldAffectsData(field) &&\n field.name === defaultFieldName &&\n field.type === 'relationship' &&\n (field as RelationshipField).relationTo === hierarchyCollection.slug,\n ) as RelationshipField | undefined\n\n // If parentFieldName is overridden, rename the field to match\n if (hierarchyField && isParentFieldNameOverridden) {\n hierarchyField.name = parentFieldName\n }\n\n if (!hierarchyField) {\n continue\n }\n\n const fieldHasMany = hierarchyField.hasMany ?? allowHasMany\n\n // If collectionSpecific, inject validation to check hierarchy allows this collection type\n if (collectionSpecific) {\n injectCollectionSpecificValidation({\n hierarchyField,\n hierarchySlug: hierarchyCollection.slug,\n typeFieldName: typeFieldName!,\n })\n }\n\n // Store discovered collection with hasMany info\n sanitizedRelatedCollections[collection.slug] = {\n fieldName: parentFieldName,\n hasMany: fieldHasMany,\n }\n\n // Inject HierarchyButton if field requests it\n if (hierarchyField.custom?.hierarchy?.injectHeaderButton === true) {\n injectHierarchyButton({\n collection,\n fieldName: parentFieldName,\n hierarchyCollectionSlug: hierarchyCollection.slug,\n parentFieldName: hierarchyConfig.parentFieldName,\n })\n }\n }\n\n // If collectionSpecific, add type field to hierarchy collection\n if (hierarchyConfig.collectionSpecific) {\n injectTypeField({\n config,\n hierarchyCollection: hierarchyCollection as SanitizedCollectionConfig,\n parentFieldName: hierarchyConfig.parentFieldName,\n sanitizedRelatedCollections,\n typeFieldName: hierarchyConfig.collectionSpecific.fieldName,\n })\n }\n\n // If joinField is configured, add the join field to query children\n if (hierarchyConfig.joinField) {\n injectJoinField({\n config,\n hierarchyCollection: hierarchyCollection as SanitizedCollectionConfig,\n joinFieldConfig: hierarchyConfig.joinField,\n parentFieldName,\n relatedSlugs: Object.keys(sanitizedRelatedCollections),\n })\n }\n\n // Update hierarchy config with sanitized relatedCollections\n if (hierarchyConfig) {\n hierarchyConfig.relatedCollections = sanitizedRelatedCollections\n }\n\n // Add afterDelete hook to clear folder references from related documents\n if (Object.keys(sanitizedRelatedCollections).length > 0) {\n injectAfterDeleteHook({\n hierarchyCollection: hierarchyCollection as SanitizedCollectionConfig,\n sanitizedRelatedCollections,\n })\n }\n\n // Add sidebar tab for this hierarchy collection (unless explicitly disabled)\n if (hierarchyConfig.admin.injectSidebarTab !== false) {\n injectSidebarTab({\n config,\n hierarchyCollection,\n hierarchyConfig,\n })\n\n // Hide from nav when sidebar tab is injected (unless user explicitly set group)\n if (hierarchyCollection.admin?.group === undefined) {\n hierarchyCollection.admin = {\n ...hierarchyCollection.admin,\n group: false,\n }\n }\n }\n }\n}\n\n/**\n * Injects validation for collectionSpecific hierarchy fields.\n * Ensures the selected hierarchy item allows documents of this collection type.\n */\nfunction injectCollectionSpecificValidation({\n hierarchyField,\n hierarchySlug,\n typeFieldName,\n}: {\n hierarchyField: RelationshipField\n hierarchySlug: string\n typeFieldName: string\n}): void {\n const existingValidate = hierarchyField.validate\n\n const validate: Validate<unknown> = async (value, options) => {\n // Run existing validation first if present\n if (existingValidate) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const existingResult = await existingValidate(value as any, options as any)\n if (existingResult !== true) {\n return existingResult\n }\n }\n\n return validateCollectionSpecificHierarchy({\n hierarchySlug,\n options,\n typeFieldName,\n value,\n })\n }\n\n hierarchyField.validate = validate\n}\n\ntype HierarchyValidationOptions = Parameters<Validate<unknown>>[1]\n\nconst validateCollectionSpecificHierarchy = async ({\n hierarchySlug,\n options,\n typeFieldName,\n value,\n}: {\n hierarchySlug: string\n options: HierarchyValidationOptions\n typeFieldName: string\n value: unknown\n}): Promise<string | true> => {\n if (!value || (Array.isArray(value) && value.length === 0)) {\n return true\n }\n\n const { collectionSlug, overrideAccess, previousValue, req } = options\n const newIDs = (Array.isArray(value) ? value : [value]).map((item) => extractID<Document>(item))\n\n const previousIDs = new Set(\n (Array.isArray(previousValue) ? previousValue : previousValue ? [previousValue] : []).map(\n (item) => extractID<Document>(item),\n ),\n )\n\n for (const newID of newIDs) {\n if (previousIDs.has(newID)) {\n continue\n }\n\n let parentItem: Document | null = null\n if (typeof newID === 'string' || typeof newID === 'number') {\n try {\n parentItem = await req.payload.findByID({\n id: newID,\n collection: hierarchySlug,\n depth: 0,\n overrideAccess: overrideAccess ?? false,\n req,\n select: { [typeFieldName]: true },\n })\n } catch {\n return `Hierarchy item with ID ${newID} not found`\n }\n }\n\n if (!parentItem) {\n return `Hierarchy item with ID ${newID} not found`\n }\n\n const allowedTypes: string[] = (parentItem[typeFieldName] as string[]) || []\n\n if (allowedTypes.length === 0 || (collectionSlug && allowedTypes.includes(collectionSlug))) {\n continue\n }\n\n return `Hierarchy item \"${newID}\" does not allow documents of type \"${collectionSlug}\"`\n }\n\n return true\n}\n\n/**\n * Injects the hierarchyType select field into a hierarchy collection.\n */\nfunction injectTypeField({\n config,\n hierarchyCollection,\n parentFieldName,\n sanitizedRelatedCollections,\n typeFieldName,\n}: {\n config: Config\n hierarchyCollection: CollectionConfig | SanitizedCollectionConfig\n parentFieldName: string\n sanitizedRelatedCollections: Record<string, SanitizedHierarchyRelatedCollection>\n typeFieldName: string\n}): void {\n const collectionOptions: Option[] = Object.keys(sanitizedRelatedCollections).map((slug) => {\n const relatedCollection = config.collections?.find((c) => c.slug === slug)\n\n return {\n label: relatedCollection?.labels?.plural || slug,\n value: slug,\n }\n })\n\n const typeField: SelectField = {\n name: typeFieldName,\n type: 'select',\n admin: {\n components: {\n Field: {\n path: '@payloadcms/ui/rsc#HierarchyTypeFieldServer',\n serverProps: {\n collectionOptions,\n parentFieldName,\n },\n },\n },\n position: 'sidebar',\n },\n hasMany: true,\n label: ({ t }) => t('general:allowedTypes'),\n options: collectionOptions,\n }\n\n hierarchyCollection.fields = hierarchyCollection.fields || []\n\n // This can run again on the same `fields` array, so replace the field if it already exists\n const existingTypeFieldIndex = hierarchyCollection.fields.findIndex(\n (field) => fieldAffectsData(field) && field.name === typeFieldName,\n )\n\n if (existingTypeFieldIndex === -1) {\n hierarchyCollection.fields.push(typeField)\n } else {\n hierarchyCollection.fields[existingTypeFieldIndex] = typeField\n }\n\n // Recompute flattenedFields since we added a field after initial sanitization\n // This is required for the field to be queryable\n if ('flattenedFields' in hierarchyCollection) {\n hierarchyCollection.flattenedFields = flattenAllFields({\n fields: hierarchyCollection.fields,\n })\n }\n}\n\n/**\n * Injects a join field to query all children of a hierarchy item.\n */\nfunction injectJoinField({\n config,\n hierarchyCollection,\n joinFieldConfig,\n parentFieldName,\n relatedSlugs,\n}: {\n config: Config\n hierarchyCollection: SanitizedCollectionConfig\n joinFieldConfig: HierarchyJoinFieldConfig\n parentFieldName: string\n relatedSlugs: string[]\n}): void {\n const { name, admin: userAdmin, ...userConfig } = joinFieldConfig\n\n const hasJoinField = hierarchyCollection.fields?.some(\n (field) => 'name' in field && field.name === name,\n )\n\n if (hasJoinField) {\n return\n }\n\n const joinField: JoinField = {\n // User config (spread first so auto-generated values take precedence for required fields)\n ...userConfig,\n // Auto-generated values (these cannot be overridden)\n name,\n type: 'join',\n collection: [hierarchyCollection.slug, ...relatedSlugs],\n hasMany: true,\n on: parentFieldName,\n // Merge admin config\n admin: {\n ...userAdmin,\n },\n }\n\n hierarchyCollection.fields = hierarchyCollection.fields || []\n hierarchyCollection.fields.push(joinField)\n\n // Sanitize the join field to register it properly\n sanitizeJoinField({\n config,\n field: joinField,\n joins: hierarchyCollection.joins,\n parentIsLocalized: false,\n polymorphicJoins: hierarchyCollection.polymorphicJoins,\n })\n\n // Recompute flattenedFields since we added a field after initial sanitization\n hierarchyCollection.flattenedFields = flattenAllFields({\n fields: hierarchyCollection.fields,\n })\n}\n\n/**\n * Injects afterDelete hook to clear hierarchy references from related documents.\n */\nfunction injectAfterDeleteHook({\n hierarchyCollection,\n sanitizedRelatedCollections,\n}: {\n hierarchyCollection: CollectionConfig | SanitizedCollectionConfig\n sanitizedRelatedCollections: Record<string, SanitizedHierarchyRelatedCollection>\n}): void {\n // Build map of collection slugs to their field names\n const relatedCollectionFieldMap: Record<string, string> = {}\n for (const [slug, relatedConfig] of Object.entries(sanitizedRelatedCollections)) {\n relatedCollectionFieldMap[slug] = relatedConfig.fieldName\n }\n\n hierarchyCollection.hooks = hierarchyCollection.hooks || {}\n hierarchyCollection.hooks.afterDelete = [\n ...(hierarchyCollection.hooks.afterDelete || []),\n hierarchyCollectionAfterDelete({ relatedCollections: relatedCollectionFieldMap }),\n ]\n}\n\n/**\n * Injects a sidebar tab for a hierarchy collection.\n */\nfunction injectSidebarTab({\n config,\n hierarchyCollection,\n hierarchyConfig,\n}: {\n config: Config\n hierarchyCollection: CollectionConfig\n hierarchyConfig: SanitizedHierarchyConfig\n}): void {\n const tabSlug = `hierarchy-${hierarchyCollection.slug}`\n const Icon = hierarchyConfig.admin.components.Icon\n\n // Initialize admin config structure\n config.admin = config.admin || {}\n config.admin.components = config.admin.components || {}\n config.admin.components.sidebar = config.admin.components.sidebar || {}\n config.admin.components.sidebar.tabs = config.admin.components.sidebar.tabs || []\n\n // Check if tab already exists\n const hasTab = config.admin.components.sidebar.tabs.some((tab) => tab.slug === tabSlug)\n\n if (!hasTab) {\n config.admin.components.sidebar.tabs.push({\n slug: tabSlug,\n components: {\n Content: {\n clientProps: {\n hierarchyCollectionSlug: hierarchyCollection.slug,\n },\n path: '@payloadcms/ui/rsc#HierarchySidebarTabServer',\n },\n Icon,\n },\n label: hierarchyCollection.labels?.plural || hierarchyCollection.slug,\n })\n }\n}\n"],"names":["sanitizeJoinField","fieldAffectsData","extractID","flattenAllFields","getHierarchyFieldName","hierarchyCollectionAfterDelete","injectHierarchyButton","resolveHierarchyCollections","config","hierarchyCollections","collections","filter","col","hierarchy","hierarchyCollection","hierarchyConfig","defaultFieldName","slug","parentFieldName","isParentFieldNameOverridden","collectionSpecific","typeFieldName","fieldName","undefined","allowHasMany","sanitizedRelatedCollections","selfParentField","fields","find","field","name","type","relationTo","custom","injectHeaderButton","collection","hierarchyCollectionSlug","hierarchyField","fieldHasMany","hasMany","injectCollectionSpecificValidation","hierarchySlug","injectTypeField","joinField","injectJoinField","joinFieldConfig","relatedSlugs","Object","keys","relatedCollections","length","injectAfterDeleteHook","admin","injectSidebarTab","group","existingValidate","validate","value","options","existingResult","validateCollectionSpecificHierarchy","Array","isArray","collectionSlug","overrideAccess","previousValue","req","newIDs","map","item","previousIDs","Set","newID","has","parentItem","payload","findByID","id","depth","select","allowedTypes","includes","collectionOptions","relatedCollection","c","label","labels","plural","typeField","components","Field","path","serverProps","position","t","existingTypeFieldIndex","findIndex","push","flattenedFields","userAdmin","userConfig","hasJoinField","some","on","joins","parentIsLocalized","polymorphicJoins","relatedCollectionFieldMap","relatedConfig","entries","hooks","afterDelete","tabSlug","Icon","sidebar","tabs","hasTab","tab","Content","clientProps"],"mappings":"AAgBA,SAASA,iBAAiB,QAAQ,wCAAuC;AACzE,SAASC,gBAAgB,QAAQ,4BAA2B;AAC5D,SAASC,SAAS,QAAQ,4BAA2B;AACrD,SAASC,gBAAgB,QAAQ,mCAAkC;AACnE,SAASC,qBAAqB,QAAQ,iBAAgB;AACtD,SAASC,8BAA8B,QAAQ,mCAAkC;AACjF,SAASC,qBAAqB,QAAQ,6BAA4B;AAElE;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,MAAMC,8BAA8B,CAACC;IAC1C,MAAMC,uBACJD,OAAOE,WAAW,EAAEC,OAAO,CAACC,MAAQA,IAAIC,SAAS,IAAI,OAAOD,IAAIC,SAAS,KAAK,aAAa,EAAE;IAE/F,KAAK,MAAMC,uBAAuBL,qBAAsB;QACtD,MAAMI,YAAYC,oBAAoBD,SAAS;QAE/C,iFAAiF;QACjF,IAAI,CAACA,aAAa,OAAOA,cAAc,UAAU;YAC/C;QACF;QAEA,MAAME,kBAAkBF;QACxB,MAAMG,mBAAmBZ,sBAAsBU,oBAAoBG,IAAI;QACvE,MAAMC,kBAAkBH,gBAAgBG,eAAe,IAAIF;QAC3D,M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AAO4C,KAAK,CAACqC,UAAU,CAACyB,OAAO,CAACC,IAAI,CAAClB,IAAI,CAAC;YACxChF,MAAM+F;YACNvB,YAAY;gBACV6B,SAAS;oBACPC,aAAa;wBACXnF,yBAAyBtB,oBAAoBG,IAAI;oBACnD;oBACA0E,MAAM;gBACR;gBACAsB;YACF;YACA5B,OAAOvE,oBAAoBwE,MAAM,EAAEC,UAAUzE,oBAAoBG,IAAI;QACvE;IACF;AACF"}
|
package/dist/index.bundled.d.ts
CHANGED
|
@@ -2465,7 +2465,8 @@ type GlobalAdminOptions = {
|
|
|
2465
2465
|
* Specify a navigational group for globals in the admin sidebar.
|
|
2466
2466
|
* - Provide a string to place the entity in a custom group.
|
|
2467
2467
|
* - Provide a record to define localized group names.
|
|
2468
|
-
* - Set to `false` to exclude the
|
|
2468
|
+
* - Set to `false` to exclude the global from the sidebar, command palette, and dashboard collection cards.
|
|
2469
|
+
* This does not disable routes or change access control.
|
|
2469
2470
|
*/
|
|
2470
2471
|
group?: false | Record<string, string> | string;
|
|
2471
2472
|
/**
|
|
@@ -10108,7 +10109,10 @@ type CollectionAdminOptions = {
|
|
|
10108
10109
|
* Specify a navigational group for collections in the admin sidebar.
|
|
10109
10110
|
* - Provide a string to place the entity in a custom group.
|
|
10110
10111
|
* - Provide a record to define localized group names.
|
|
10111
|
-
* - Set to `false` to exclude the
|
|
10112
|
+
* - Set to `false` to exclude the collection from the sidebar, command palette, dashboard collection cards,
|
|
10113
|
+
* and pin picker, and its documents from both the Pinned and Recently viewed dashboard tabs, including existing pins.
|
|
10114
|
+
* This does not disable routes or change access control or rich text link and relationship eligibility.
|
|
10115
|
+
* Use `enableRichTextLink` and `enableRichTextRelationship` to configure rich text eligibility separately.
|
|
10112
10116
|
*/
|
|
10113
10117
|
group?: false | Record<string, string> | string;
|
|
10114
10118
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInstructionsCollection.d.ts","sourceRoot":"","sources":["../../src/llm-instructions/getInstructionsCollection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,KAAK,EAAU,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAajE,eAAO,MAAM,yBAAyB,gBAEnC;IACD,MAAM,EAAE,eAAe,CAAA;CACxB,KAAG,
|
|
1
|
+
{"version":3,"file":"getInstructionsCollection.d.ts","sourceRoot":"","sources":["../../src/llm-instructions/getInstructionsCollection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,KAAK,EAAU,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAajE,eAAO,MAAM,yBAAyB,gBAEnC;IACD,MAAM,EAAE,eAAe,CAAA;CACxB,KAAG,gBA+TH,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/llm-instructions/getInstructionsCollection.ts"],"sourcesContent":["import { getTranslation } from '@payloadcms/translations'\n\nimport type { CollectionConfig } from '../collections/config/types.js'\nimport type { Access, SanitizedConfig } from '../config/types.js'\nimport type { PayloadRequest } from '../types/index.js'\nimport type { InstructionTargetFields } from './shared.js'\n\nimport { getDataLoader } from '../collections/dataloader.js'\nimport { ValidationError } from '../errors/ValidationError.js'\nimport { getSelectMode } from '../utilities/getSelectMode.js'\nimport { isolateObjectProperty } from '../utilities/isolateObjectProperty.js'\nimport { getInstructionTargetAccess } from './getInstructionTargetAccess.js'\nimport { instructionsCollectionSlug } from './shared.js'\n\nconst syncContextKey = 'syncLLMInstructions'\n\nexport const getInstructionsCollection = ({\n config,\n}: {\n config: SanitizedConfig\n}): CollectionConfig => {\n const targets = [\n ...config.collections\n .filter(({ slug, admin }) => admin.hidden !== true && slug !== instructionsCollectionSlug)\n .map(({ slug, llmInstructions }) => ({\n slug,\n type: 'collection' as const,\n systemInstructions: llmInstructions,\n })),\n ...config.globals\n .filter(({ admin }) => admin.hidden !== true)\n .map(({ slug, llmInstructions }) => ({\n slug,\n type: 'global' as const,\n systemInstructions: llmInstructions,\n })),\n ]\n const options = config.llmInstructions === false ? undefined : config.llmInstructions\n const editorProvider = options?.editor ?? config.editor?.presets?.llmInstructions\n const configuredEditor = editorProvider?.({ config, isRoot: false, parentIsLocalized: false })\n const editor =\n configuredEditor?.converters?.fromMarkdown && configuredEditor.converters.toMarkdown\n ? configuredEditor\n : undefined\n const getTarget = ({ entitySlug, entityType }: InstructionTargetFields = {}) =>\n targets.find((target) => target.slug === entitySlug && target.type === entityType)\n const getTitle = ({ data, req }: { data?: InstructionTargetFields; req: PayloadRequest }) => {\n const target = getTarget(data)\n\n if (!target) {\n return ''\n }\n\n const label =\n target.type === 'collection'\n ? req.payload.collections[target.slug]?.config.labels.plural\n : req.payload.config.globals.find((global) => global.slug === target.slug)?.label\n\n return getTranslation(label || target.slug, req.i18n)\n }\n const canManage: Access =\n options?.access ||\n (({ req }: { req: PayloadRequest }) =>\n Boolean(req.user && req.user.collection === req.payload.config.admin.user))\n\n return {\n slug: instructionsCollectionSlug,\n access: {\n create: ({ req }) => req.context[syncContextKey] === true,\n delete: () => false,\n read: ({ req }) =>\n req.context[syncContextKey] === true ||\n getInstructionTargetAccess({ operation: 'read', req, targets }),\n update: async (args) => {\n const manageAccess = await canManage(args)\n\n if (!manageAccess) {\n return false\n }\n\n const targetAccess = await getInstructionTargetAccess({\n operation: 'update',\n req: args.req,\n targets,\n })\n\n if (!targetAccess) {\n return false\n }\n\n return manageAccess === true ? targetAccess : { and: [manageAccess, targetAccess] }\n },\n },\n admin: {\n defaultColumns: ['title', 'updatedAt', 'entityType', 'additionalInstructions'],\n group: false,\n listSearchableFields: ['entitySlug'],\n useAsTitle: 'entitySlug',\n },\n disableBulkEdit: true,\n disableDuplicate: true,\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: { hidden: true },\n },\n {\n name: 'entitySlug',\n type: 'text',\n admin: { hidden: true },\n index: true,\n required: true,\n },\n {\n name: 'title',\n type: 'text',\n admin: { hidden: true },\n hooks: {\n afterRead: [({ data, req }) => getTitle({ data, req })],\n },\n label: ({ t }) => t('llmInstructions:title'),\n virtual: true,\n },\n {\n name: 'entityType',\n type: 'select',\n admin: { hidden: true },\n label: ({ t }) => t('version:type'),\n options: [\n { label: ({ t }) => t('general:collection'), value: 'collection' },\n { label: ({ t }) => t('llmInstructions:global'), value: 'global' },\n ],\n required: true,\n },\n {\n type: 'tabs',\n admin: { className: 'llm-instructions' },\n tabs: [\n {\n fields: [\n {\n name: 'additionalInstructionsDescription',\n type: 'ui',\n admin: {\n components: {\n Field: '@payloadcms/ui#LLMInstructionsDescription',\n },\n },\n },\n {\n name: 'additionalInstructions',\n ...(editor ? { type: 'richText' as const, editor } : { type: 'textarea' as const }),\n admin: {\n className: 'llm-instructions__editor',\n components: { Cell: '@payloadcms/ui/rsc#LLMInstructionsCell' },\n },\n label: ({ t }) => t('llmInstructions:additionalInstructions'),\n },\n ],\n label: ({ t }) => t('llmInstructions:additionalInstructions'),\n },\n {\n fields: [\n {\n name: 'systemInstructionsDescription',\n type: 'ui',\n admin: {\n components: {\n Field: {\n clientProps: { isSystem: true },\n path: '@payloadcms/ui#LLMInstructionsDescription',\n },\n },\n },\n },\n {\n name: 'systemInstructions',\n ...(editor ? { type: 'richText' as const, editor } : { type: 'textarea' as const }),\n access: { create: () => false, update: () => false },\n admin: {\n className: 'llm-instructions__editor llm-instructions__editor--system',\n readOnly: true,\n },\n hooks: {\n afterRead: [\n ({ data }) => {\n const markdown = getTarget(data)?.systemInstructions\n\n return markdown\n ? (editor?.converters?.fromMarkdown?.({ markdown }) ?? markdown)\n : null\n },\n ],\n },\n label: ({ t }) => t('llmInstructions:systemInstructions'),\n virtual: true,\n },\n ],\n label: ({ t }) => t('llmInstructions:systemInstructions'),\n },\n ],\n },\n ],\n hooks: {\n beforeOperation: [\n async ({ args, operation, req }) => {\n if (operation !== 'read' || req.context[syncContextKey] || !req.user) {\n return args\n }\n\n // Only configuration-owned identities are created here. Client requests cannot set context.\n const syncReq = isolateObjectProperty(req, [\n 'context',\n 'payloadDataLoader',\n 'transactionID',\n ])\n\n syncReq.context = { ...req.context, [syncContextKey]: true }\n // Initialization must persist even if the caller rolls back its transaction.\n delete syncReq.transactionID\n syncReq.payloadDataLoader = getDataLoader(syncReq)\n\n const { docs } = await req.payload.find({\n collection: instructionsCollectionSlug,\n depth: 0,\n limit: 0,\n overrideAccess: false,\n pagination: false,\n req: syncReq,\n select: { id: true },\n })\n const existingIDs = new Set(docs.map(({ id }) => id))\n\n for (const target of targets) {\n const id = `${target.type}-${target.slug}`\n\n if (existingIDs.has(id)) {\n continue\n }\n\n try {\n await req.payload.create({\n collection: instructionsCollectionSlug,\n data: { id, entitySlug: target.slug, entityType: target.type },\n disableTransaction: true,\n overrideAccess: false,\n req: syncReq,\n user: req.user,\n })\n } catch (error) {\n // The unique ID allows only one concurrent request to create this entry.\n const existingDoc = await req.payload.findByID({\n id,\n collection: instructionsCollectionSlug,\n depth: 0,\n disableErrors: true,\n overrideAccess: false,\n req: syncReq,\n select: { id: true },\n })\n\n if (!existingDoc) {\n throw error\n }\n }\n }\n\n return args\n },\n ],\n beforeValidate: [\n ({ data, operation, originalDoc, req }) => {\n const { entitySlug, entityType } = { ...originalDoc, ...data }\n\n if (!entitySlug || !entityType) {\n return data\n }\n\n if (!getTarget({ entitySlug, entityType })) {\n throw new ValidationError({\n collection: instructionsCollectionSlug,\n errors: [\n {\n message: req.t('validation:invalidInput'),\n path:\n entityType === 'collection' || entityType === 'global'\n ? 'entitySlug'\n : 'entityType',\n },\n ],\n req,\n })\n }\n\n const id = `${entityType}-${entitySlug}`\n\n if (operation === 'update' && originalDoc?.id !== id) {\n throw new ValidationError({\n collection: instructionsCollectionSlug,\n errors: [\n {\n message: req.t('llmInstructions:targetCannotBeChanged'),\n path: originalDoc?.entityType !== entityType ? 'entityType' : 'entitySlug',\n },\n ],\n req,\n })\n }\n\n return { ...data, id }\n },\n ],\n },\n labels: {\n plural: ({ t }) => t('llmInstructions:instructions'),\n singular: ({ t }) => t('llmInstructions:instructions'),\n },\n lockDocuments: false,\n select: ({ select }) => {\n if (!select) {\n return\n }\n\n if (getSelectMode(select) === 'include') {\n return { ...select, entitySlug: true, entityType: true }\n }\n\n const targetSelect = { ...select }\n\n delete targetSelect.entitySlug\n delete targetSelect.entityType\n\n return targetSelect\n },\n versions: false,\n }\n}\n"],"names":["getTranslation","getDataLoader","ValidationError","getSelectMode","isolateObjectProperty","getInstructionTargetAccess","instructionsCollectionSlug","syncContextKey","getInstructionsCollection","config","targets","collections","filter","slug","admin","hidden","map","llmInstructions","type","systemInstructions","globals","options","undefined","editorProvider","editor","presets","configuredEditor","isRoot","parentIsLocalized","converters","fromMarkdown","toMarkdown","getTarget","entitySlug","entityType","find","target","getTitle","data","req","label","payload","labels","plural","global","i18n","canManage","access","Boolean","user","collection","create","context","delete","read","operation","update","args","manageAccess","targetAccess","and","defaultColumns","group","listSearchableFields","useAsTitle","disableBulkEdit","disableDuplicate","fields","name","index","required","hooks","afterRead","t","virtual","value","className","tabs","components","Field","Cell","clientProps","isSystem","path","readOnly","markdown","beforeOperation","syncReq","transactionID","payloadDataLoader","docs","depth","limit","overrideAccess","pagination","select","id","existingIDs","Set","has","disableTransaction","error","existingDoc","findByID","disableErrors","beforeValidate","originalDoc","errors","message","singular","lockDocuments","targetSelect","versions"],"mappings":"AAAA,SAASA,cAAc,QAAQ,2BAA0B;AAOzD,SAASC,aAAa,QAAQ,+BAA8B;AAC5D,SAASC,eAAe,QAAQ,+BAA8B;AAC9D,SAASC,aAAa,QAAQ,gCAA+B;AAC7D,SAASC,qBAAqB,QAAQ,wCAAuC;AAC7E,SAASC,0BAA0B,QAAQ,kCAAiC;AAC5E,SAASC,0BAA0B,QAAQ,cAAa;AAExD,MAAMC,iBAAiB;AAEvB,OAAO,MAAMC,4BAA4B,CAAC,EACxCC,MAAM,EAGP;IACC,MAAMC,UAAU;WACXD,OAAOE,WAAW,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N,UAAU;wBAAEC;wBAAYC;oBAAW,IAAI;wBAC1C,MAAM,IAAIhC,gBAAgB;4BACxBgD,YAAY5C;4BACZqG,QAAQ;gCACN;oCACEC,SAASrE,IAAIkC,CAAC,CAAC;oCACfU,MACEjD,eAAe,gBAAgBA,eAAe,WAC1C,eACA;gCACR;6BACD;4BACDK;wBACF;oBACF;oBAEA,MAAMyD,KAAK,GAAG9D,WAAW,CAAC,EAAED,YAAY;oBAExC,IAAIsB,cAAc,YAAYmD,aAAaV,OAAOA,IAAI;wBACpD,MAAM,IAAI9F,gBAAgB;4BACxBgD,YAAY5C;4BACZqG,QAAQ;gCACN;oCACEC,SAASrE,IAAIkC,CAAC,CAAC;oCACfU,MAAMuB,aAAaxE,eAAeA,aAAa,eAAe;gCAChE;6BACD;4BACDK;wBACF;oBACF;oBAEA,OAAO;wBAAE,GAAGD,IAAI;wBAAE0D;oBAAG;gBACvB;aACD;QACH;QACAtD,QAAQ;YACNC,QAAQ,CAAC,EAAE8B,CAAC,EAAE,GAAKA,EAAE;YACrBoC,UAAU,CAAC,EAAEpC,CAAC,EAAE,GAAKA,EAAE;QACzB;QACAqC,eAAe;QACff,QAAQ,CAAC,EAAEA,MAAM,EAAE;YACjB,IAAI,CAACA,QAAQ;gBACX;YACF;YAEA,IAAI5F,cAAc4F,YAAY,WAAW;gBACvC,OAAO;oBAAE,GAAGA,MAAM;oBAAE9D,YAAY;oBAAMC,YAAY;gBAAK;YACzD;YAEA,MAAM6E,eAAe;gBAAE,GAAGhB,MAAM;YAAC;YAEjC,OAAOgB,aAAa9E,UAAU;YAC9B,OAAO8E,aAAa7E,UAAU;YAE9B,OAAO6E;QACT;QACAC,UAAU;IACZ;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../src/llm-instructions/getInstructionsCollection.ts"],"sourcesContent":["import { getTranslation } from '@payloadcms/translations'\n\nimport type { CollectionConfig } from '../collections/config/types.js'\nimport type { Access, SanitizedConfig } from '../config/types.js'\nimport type { PayloadRequest } from '../types/index.js'\nimport type { InstructionTargetFields } from './shared.js'\n\nimport { getDataLoader } from '../collections/dataloader.js'\nimport { ValidationError } from '../errors/ValidationError.js'\nimport { getSelectMode } from '../utilities/getSelectMode.js'\nimport { isolateObjectProperty } from '../utilities/isolateObjectProperty.js'\nimport { getInstructionTargetAccess } from './getInstructionTargetAccess.js'\nimport { instructionsCollectionSlug } from './shared.js'\n\nconst syncContextKey = 'syncLLMInstructions'\n\nexport const getInstructionsCollection = ({\n config,\n}: {\n config: SanitizedConfig\n}): CollectionConfig => {\n const targets = [\n ...config.collections\n .filter(({ slug, admin }) => admin.hidden !== true && slug !== instructionsCollectionSlug)\n .map(({ slug, llmInstructions }) => ({\n slug,\n type: 'collection' as const,\n systemInstructions: llmInstructions,\n })),\n ...config.globals\n .filter(({ admin }) => admin.hidden !== true)\n .map(({ slug, llmInstructions }) => ({\n slug,\n type: 'global' as const,\n systemInstructions: llmInstructions,\n })),\n ]\n const options = config.llmInstructions === false ? undefined : config.llmInstructions\n const editorProvider = options?.editor ?? config.editor?.presets?.llmInstructions\n const configuredEditor = editorProvider?.({ config, isRoot: false, parentIsLocalized: false })\n const editor =\n configuredEditor?.converters?.fromMarkdown && configuredEditor.converters.toMarkdown\n ? configuredEditor\n : undefined\n const getTarget = ({ entitySlug, entityType }: InstructionTargetFields = {}) =>\n targets.find((target) => target.slug === entitySlug && target.type === entityType)\n const getTitle = ({ data, req }: { data?: InstructionTargetFields; req: PayloadRequest }) => {\n const target = getTarget(data)\n\n if (!target) {\n return ''\n }\n\n const label =\n target.type === 'collection'\n ? req.payload.collections[target.slug]?.config.labels.plural\n : req.payload.config.globals.find((global) => global.slug === target.slug)?.label\n\n return getTranslation(label || target.slug, req.i18n)\n }\n const canManage: Access =\n options?.access ||\n (({ req }: { req: PayloadRequest }) =>\n Boolean(req.user && req.user.collection === req.payload.config.admin.user))\n\n return {\n slug: instructionsCollectionSlug,\n access: {\n create: ({ req }) => req.context[syncContextKey] === true,\n delete: () => false,\n read: ({ req }) =>\n req.context[syncContextKey] === true ||\n getInstructionTargetAccess({ operation: 'read', req, targets }),\n update: async (args) => {\n const manageAccess = await canManage(args)\n\n if (!manageAccess) {\n return false\n }\n\n const targetAccess = await getInstructionTargetAccess({\n operation: 'update',\n req: args.req,\n targets,\n })\n\n if (!targetAccess) {\n return false\n }\n\n return manageAccess === true ? targetAccess : { and: [manageAccess, targetAccess] }\n },\n },\n admin: {\n defaultColumns: ['title', 'updatedAt', 'entityType', 'additionalInstructions'],\n enableRichTextLink: false,\n enableRichTextRelationship: false,\n group: false,\n listSearchableFields: ['entitySlug'],\n useAsTitle: 'entitySlug',\n },\n disableBulkEdit: true,\n disableDuplicate: true,\n fields: [\n {\n name: 'id',\n type: 'text',\n admin: { hidden: true },\n },\n {\n name: 'entitySlug',\n type: 'text',\n admin: { hidden: true },\n index: true,\n required: true,\n },\n {\n name: 'title',\n type: 'text',\n admin: { hidden: true },\n hooks: {\n afterRead: [({ data, req }) => getTitle({ data, req })],\n },\n label: ({ t }) => t('llmInstructions:title'),\n virtual: true,\n },\n {\n name: 'entityType',\n type: 'select',\n admin: { hidden: true },\n label: ({ t }) => t('version:type'),\n options: [\n { label: ({ t }) => t('general:collection'), value: 'collection' },\n { label: ({ t }) => t('llmInstructions:global'), value: 'global' },\n ],\n required: true,\n },\n {\n type: 'tabs',\n admin: { className: 'llm-instructions' },\n tabs: [\n {\n fields: [\n {\n name: 'additionalInstructionsDescription',\n type: 'ui',\n admin: {\n components: {\n Field: '@payloadcms/ui#LLMInstructionsDescription',\n },\n },\n },\n {\n name: 'additionalInstructions',\n ...(editor ? { type: 'richText' as const, editor } : { type: 'textarea' as const }),\n admin: {\n className: 'llm-instructions__editor',\n components: { Cell: '@payloadcms/ui/rsc#LLMInstructionsCell' },\n },\n label: ({ t }) => t('llmInstructions:additionalInstructions'),\n },\n ],\n label: ({ t }) => t('llmInstructions:additionalInstructions'),\n },\n {\n fields: [\n {\n name: 'systemInstructionsDescription',\n type: 'ui',\n admin: {\n components: {\n Field: {\n clientProps: { isSystem: true },\n path: '@payloadcms/ui#LLMInstructionsDescription',\n },\n },\n },\n },\n {\n name: 'systemInstructions',\n ...(editor ? { type: 'richText' as const, editor } : { type: 'textarea' as const }),\n access: { create: () => false, update: () => false },\n admin: {\n className: 'llm-instructions__editor llm-instructions__editor--system',\n readOnly: true,\n },\n hooks: {\n afterRead: [\n ({ data }) => {\n const markdown = getTarget(data)?.systemInstructions\n\n return markdown\n ? (editor?.converters?.fromMarkdown?.({ markdown }) ?? markdown)\n : null\n },\n ],\n },\n label: ({ t }) => t('llmInstructions:systemInstructions'),\n virtual: true,\n },\n ],\n label: ({ t }) => t('llmInstructions:systemInstructions'),\n },\n ],\n },\n ],\n hooks: {\n beforeOperation: [\n async ({ args, operation, req }) => {\n if (operation !== 'read' || req.context[syncContextKey] || !req.user) {\n return args\n }\n\n // Only configuration-owned identities are created here. Client requests cannot set context.\n const syncReq = isolateObjectProperty(req, [\n 'context',\n 'payloadDataLoader',\n 'transactionID',\n ])\n\n syncReq.context = { ...req.context, [syncContextKey]: true }\n // Initialization must persist even if the caller rolls back its transaction.\n delete syncReq.transactionID\n syncReq.payloadDataLoader = getDataLoader(syncReq)\n\n const { docs } = await req.payload.find({\n collection: instructionsCollectionSlug,\n depth: 0,\n limit: 0,\n overrideAccess: false,\n pagination: false,\n req: syncReq,\n select: { id: true },\n })\n const existingIDs = new Set(docs.map(({ id }) => id))\n\n for (const target of targets) {\n const id = `${target.type}-${target.slug}`\n\n if (existingIDs.has(id)) {\n continue\n }\n\n try {\n await req.payload.create({\n collection: instructionsCollectionSlug,\n data: { id, entitySlug: target.slug, entityType: target.type },\n disableTransaction: true,\n overrideAccess: false,\n req: syncReq,\n user: req.user,\n })\n } catch (error) {\n // The unique ID allows only one concurrent request to create this entry.\n const existingDoc = await req.payload.findByID({\n id,\n collection: instructionsCollectionSlug,\n depth: 0,\n disableErrors: true,\n overrideAccess: false,\n req: syncReq,\n select: { id: true },\n })\n\n if (!existingDoc) {\n throw error\n }\n }\n }\n\n return args\n },\n ],\n beforeValidate: [\n ({ data, operation, originalDoc, req }) => {\n const { entitySlug, entityType } = { ...originalDoc, ...data }\n\n if (!entitySlug || !entityType) {\n return data\n }\n\n if (!getTarget({ entitySlug, entityType })) {\n throw new ValidationError({\n collection: instructionsCollectionSlug,\n errors: [\n {\n message: req.t('validation:invalidInput'),\n path:\n entityType === 'collection' || entityType === 'global'\n ? 'entitySlug'\n : 'entityType',\n },\n ],\n req,\n })\n }\n\n const id = `${entityType}-${entitySlug}`\n\n if (operation === 'update' && originalDoc?.id !== id) {\n throw new ValidationError({\n collection: instructionsCollectionSlug,\n errors: [\n {\n message: req.t('llmInstructions:targetCannotBeChanged'),\n path: originalDoc?.entityType !== entityType ? 'entityType' : 'entitySlug',\n },\n ],\n req,\n })\n }\n\n return { ...data, id }\n },\n ],\n },\n labels: {\n plural: ({ t }) => t('llmInstructions:instructions'),\n singular: ({ t }) => t('llmInstructions:instructions'),\n },\n lockDocuments: false,\n select: ({ select }) => {\n if (!select) {\n return\n }\n\n if (getSelectMode(select) === 'include') {\n return { ...select, entitySlug: true, entityType: true }\n }\n\n const targetSelect = { ...select }\n\n delete targetSelect.entitySlug\n delete targetSelect.entityType\n\n return targetSelect\n },\n versions: false,\n }\n}\n"],"names":["getTranslation","getDataLoader","ValidationError","getSelectMode","isolateObjectProperty","getInstructionTargetAccess","instructionsCollectionSlug","syncContextKey","getInstructionsCollection","config","targets","collections","filter","slug","admin","hidden","map","llmInstructions","type","systemInstructions","globals","options","undefined","editorProvider","editor","presets","configuredEditor","isRoot","parentIsLocalized","converters","fromMarkdown","toMarkdown","getTarget","entitySlug","entityType","find","target","getTitle","data","req","label","payload","labels","plural","global","i18n","canManage","access","Boolean","user","collection","create","context","delete","read","operation","update","args","manageAccess","targetAccess","and","defaultColumns","enableRichTextLink","enableRichTextRelationship","group","listSearchableFields","useAsTitle","disableBulkEdit","disableDuplicate","fields","name","index","required","hooks","afterRead","t","virtual","value","className","tabs","components","Field","Cell","clientProps","isSystem","path","readOnly","markdown","beforeOperation","syncReq","transactionID","payloadDataLoader","docs","depth","limit","overrideAccess","pagination","select","id","existingIDs","Set","has","disableTransaction","error","existingDoc","findByID","disableErrors","beforeValidate","originalDoc","errors","message","singular","lockDocuments","targetSelect","versions"],"mappings":"AAAA,SAASA,cAAc,QAAQ,2BAA0B;AAOzD,SAASC,aAAa,QAAQ,+BAA8B;AAC5D,SAASC,eAAe,QAAQ,+BAA8B;AAC9D,SAASC,aAAa,QAAQ,gCAA+B;AAC7D,SAASC,qBAAqB,QAAQ,wCAAuC;AAC7E,SAASC,0BAA0B,QAAQ,kCAAiC;AAC5E,SAASC,0BAA0B,QAAQ,cAAa;AAExD,MAAMC,iBAAiB;AAEvB,OAAO,MAAMC,4BAA4B,CAAC,EACxCC,MAAM,EAGP;IACC,MAAMC,UAAU;WACXD,OAAOE,WAAW,CAClBC,MAAM,CAAC,CAAC,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAKA,MAAMC,MAAM,KAAK,QAAQF,SAASP,4BAC9DU,GAAG,CAAC,CAAC,EAAEH,IAAI,EAAEI,eAAe,EAAE,GAAM,CAAA;gBACnCJ;gBACAK,MAAM;gBACNC,oBAAoBF;YACtB,CAAA;WACCR,OAAOW,OAAO,CACdR,MAAM,CAAC,CAAC,EAAEE,KAAK,EAAE,GAAKA,MAAMC,MAAM,KAAK,MACvCC,GAAG,CAAC,CAAC,EAAEH,IAAI,EAAEI,eAAe,EAAE,GAAM,CAAA;gBACnCJ;gBACAK,MAAM;gBACNC,oBAAoBF;YACtB,CAAA;KACH;IACD,MAAMI,UAAUZ,OAAOQ,eAAe,KAAK,QAAQK,YAAYb,OAAOQ,eAAe;IACrF,MAAMM,iBAAiBF,SAASG,UAAUf,OAAOe,MAAM,EAAEC,SAASR;IAClE,MAAMS,mBAAmBH,iBAAiB;QAAEd;QAAQkB,QAAQ;QAAOC,mBAAmB;IAAM;IAC5F,MAAMJ,S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AAKA,EAAE;YACrBoC,UAAU,CAAC,EAAEpC,CAAC,EAAE,GAAKA,EAAE;QACzB;QACAqC,eAAe;QACff,QAAQ,CAAC,EAAEA,MAAM,EAAE;YACjB,IAAI,CAACA,QAAQ;gBACX;YACF;YAEA,IAAI9F,cAAc8F,YAAY,WAAW;gBACvC,OAAO;oBAAE,GAAGA,MAAM;oBAAEhE,YAAY;oBAAMC,YAAY;gBAAK;YACzD;YAEA,MAAM+E,eAAe;gBAAE,GAAGhB,MAAM;YAAC;YAEjC,OAAOgB,aAAahF,UAAU;YAC9B,OAAOgF,aAAa/E,UAAU;YAE9B,OAAO+E;QACT;QACAC,UAAU;IACZ;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/uploads/formatFilesize.ts"],"sourcesContent":["export function formatFilesize(bytes: number, decimals =
|
|
1
|
+
{"version":3,"sources":["../../src/uploads/formatFilesize.ts"],"sourcesContent":["export function formatFilesize(bytes: number, decimals = 1): string {\n if (bytes === 0) {\n return '0 bytes'\n }\n\n const k = 1024\n const dm = decimals < 0 ? 0 : decimals\n const sizes = [' bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']\n\n const i = Math.floor(Math.log(bytes) / Math.log(k))\n\n return `${parseFloat((bytes / k ** i).toFixed(dm))}${sizes[i]}`\n}\n"],"names":["formatFilesize","bytes","decimals","k","dm","sizes","i","Math","floor","log","parseFloat","toFixed"],"mappings":"AAAA,OAAO,SAASA,eAAeC,KAAa,EAAEC,WAAW,CAAC;IACxD,IAAID,UAAU,GAAG;QACf,OAAO;IACT;IAEA,MAAME,IAAI;IACV,MAAMC,KAAKF,WAAW,IAAI,IAAIA;IAC9B,MAAMG,QAAQ;QAAC;QAAU;QAAM;QAAM;QAAM;QAAM;QAAM;QAAM;QAAM;KAAK;IAExE,MAAMC,IAAIC,KAAKC,KAAK,CAACD,KAAKE,GAAG,CAACR,SAASM,KAAKE,GAAG,CAACN;IAEhD,OAAO,GAAGO,WAAW,AAACT,CAAAA,QAAQE,KAAKG,CAAAA,EAAGK,OAAO,CAACP,OAAOC,KAAK,CAACC,EAAE,EAAE;AACjE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payload",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.2",
|
|
4
4
|
"description": "Node, React, Headless CMS and Application Framework built on Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"admin panel",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"skills"
|
|
110
110
|
],
|
|
111
111
|
"dependencies": {
|
|
112
|
-
"@next/env": "16.4.
|
|
112
|
+
"@next/env": "16.4.2",
|
|
113
113
|
"@standard-schema/spec": "1.1.0",
|
|
114
114
|
"@types/busboy": "1.5.4",
|
|
115
115
|
"bson-objectid": "2.0.4",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"uuid": "14.0.0",
|
|
143
143
|
"ws": "^8.16.0",
|
|
144
144
|
"zod": "^4.6.0",
|
|
145
|
-
"@payloadcms/translations": "4.0.0-beta.
|
|
145
|
+
"@payloadcms/translations": "4.0.0-beta.2"
|
|
146
146
|
},
|
|
147
147
|
"devDependencies": {
|
|
148
148
|
"@hyrious/esbuild-plugin-commonjs": "0.2.6",
|
|
@@ -149,10 +149,10 @@ plugin-<name>/
|
|
|
149
149
|
"copyfiles": "^2.4.1",
|
|
150
150
|
"cross-env": "10.1.0",
|
|
151
151
|
"eslint": "^9.39.2",
|
|
152
|
-
"next": "^16.4.
|
|
152
|
+
"next": "^16.4.2",
|
|
153
153
|
"payload": "^3.82.1",
|
|
154
|
-
"react": "^19.3.
|
|
155
|
-
"react-dom": "^19.3.
|
|
154
|
+
"react": "^19.3.1",
|
|
155
|
+
"react-dom": "^19.3.1",
|
|
156
156
|
"rimraf": "^6.0.1",
|
|
157
157
|
"typescript": "^6.0.3",
|
|
158
158
|
"vitest": "5.0.1"
|