payload 3.0.0-beta.31 → 3.0.0-beta.32

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.
@@ -10,12 +10,12 @@ import type { SanitizedGlobalConfig } from '../../globals/config/types.js';
10
10
  import type { DocumentPreferences } from '../../preferences/types.js';
11
11
  import type { Operation, PayloadRequestWithData, RequestContext, Where } from '../../types/index.js';
12
12
  import type { ClientFieldConfig } from './client.js';
13
- export type FieldHookArgs<T extends TypeWithID = any, P = any, S = any> = {
13
+ export type FieldHookArgs<TData extends TypeWithID = any, TValue = any, TSiblingData = any> = {
14
14
  /** The collection which the field belongs to. If the field belongs to a global, this will be null. */
15
15
  collection: SanitizedCollectionConfig | null;
16
16
  context: RequestContext;
17
17
  /** The data passed to update the document within create and update operations, and the full document itself in the afterRead hook. */
18
- data?: Partial<T>;
18
+ data?: Partial<TData>;
19
19
  /** The field which the hook is running against. */
20
20
  field: FieldAffectingData;
21
21
  /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */
@@ -25,50 +25,50 @@ export type FieldHookArgs<T extends TypeWithID = any, P = any, S = any> = {
25
25
  /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */
26
26
  operation?: 'create' | 'delete' | 'read' | 'update';
27
27
  /** The full original document in `update` operations. In the `afterChange` hook, this is the resulting document of the operation. */
28
- originalDoc?: T;
28
+ originalDoc?: TData;
29
29
  overrideAccess?: boolean;
30
30
  /** The document before changes were applied, only in `afterChange` hooks. */
31
- previousDoc?: T;
31
+ previousDoc?: TData;
32
32
  /** The sibling data of the document before changes being applied, only in `beforeChange` and `afterChange` hook. */
33
- previousSiblingDoc?: T;
33
+ previousSiblingDoc?: TData;
34
34
  /** The previous value of the field, before changes, only in `beforeChange`, `afterChange` and `beforeValidate` hooks. */
35
- previousValue?: P;
35
+ previousValue?: TValue;
36
36
  /** The Express request object. It is mocked for Local API operations. */
37
37
  req: PayloadRequestWithData;
38
38
  /** The sibling data passed to a field that the hook is running against. */
39
- siblingData: Partial<S>;
39
+ siblingData: Partial<TSiblingData>;
40
40
  /** The value of the field. */
41
- value?: P;
41
+ value?: TValue;
42
42
  };
43
- export type FieldHook<T extends TypeWithID = any, P = any, S = any> = (args: FieldHookArgs<T, P, S>) => P | Promise<P>;
44
- export type FieldAccess<T extends TypeWithID = any, P = any, U = any> = (args: {
43
+ export type FieldHook<TData extends TypeWithID = any, TValue = any, TSiblingData = any> = (args: FieldHookArgs<TData, TValue, TSiblingData>) => Promise<TValue> | TValue;
44
+ export type FieldAccess<TData extends TypeWithID = any, TSiblingData = any> = (args: {
45
45
  /**
46
46
  * The incoming data used to `create` or `update` the document with. `data` is undefined during the `read` operation.
47
47
  */
48
- data?: Partial<T>;
48
+ data?: Partial<TData>;
49
49
  /**
50
50
  * The original data of the document before the `update` is applied. `doc` is undefined during the `create` operation.
51
51
  */
52
- doc?: T;
52
+ doc?: TData;
53
53
  /**
54
54
  * The `id` of the current document being read or updated. `id` is undefined during the `create` operation.
55
55
  */
56
56
  id?: number | string;
57
57
  /** The `payload` object to interface with the payload API */
58
- req: PayloadRequestWithData<U>;
58
+ req: PayloadRequestWithData;
59
59
  /**
60
60
  * Immediately adjacent data to this field. For example, if this is a `group` field, then `siblingData` will be the other fields within the group.
61
61
  */
62
- siblingData?: Partial<P>;
62
+ siblingData?: Partial<TSiblingData>;
63
63
  }) => Promise<boolean> | boolean;
64
- export type Condition<T extends TypeWithID = any, P = any> = (data: Partial<T>, siblingData: Partial<P>, { user }: {
64
+ export type Condition<TData extends TypeWithID = any, TSiblingData = any> = (data: Partial<TData>, siblingData: Partial<TSiblingData>, { user }: {
65
65
  user: PayloadRequestWithData['user'];
66
66
  }) => boolean;
67
- export type FilterOptionsProps<T = any> = {
67
+ export type FilterOptionsProps<TData = any> = {
68
68
  /**
69
69
  * An object containing the full collection or global document currently being edited.
70
70
  */
71
- data: T;
71
+ data: TData;
72
72
  /**
73
73
  * The `id` of the current document being edited. `id` is undefined during the `create` operation.
74
74
  */
@@ -86,7 +86,7 @@ export type FilterOptionsProps<T = any> = {
86
86
  */
87
87
  user: Partial<PayloadRequestWithData['user']>;
88
88
  };
89
- export type FilterOptions<T = any> = ((options: FilterOptionsProps<T>) => Promise<Where | boolean> | Where | boolean) | Where | null;
89
+ export type FilterOptions<TData = any> = ((options: FilterOptionsProps<TData>) => Promise<Where | boolean> | Where | boolean) | Where | null;
90
90
  type Admin = {
91
91
  className?: string;
92
92
  components?: {
@@ -298,10 +298,10 @@ export type GroupField = Omit<FieldBase, 'required' | 'validation'> & {
298
298
  };
299
299
  fields: Field[];
300
300
  /** Customize generated GraphQL and Typescript schema names.
301
- * By default it is bound to the collection.
301
+ * By default, it is bound to the collection.
302
302
  *
303
303
  * This is useful if you would like to generate a top level type to share amongst collections/fields.
304
- * **Note**: Top level types can collide, ensure they are unique among collections, arrays, groups, blocks, tabs.
304
+ * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs.
305
305
  */
306
306
  interfaceName?: string;
307
307
  type: 'group';
@@ -341,7 +341,7 @@ export type NamedTab = TabBase & {
341
341
  * The slug is used by default.
342
342
  *
343
343
  * This is useful if you would like to generate a top level type to share amongst collections/fields.
344
- * **Note**: Top level types can collide, ensure they are unique among collections, arrays, groups, blocks, tabs.
344
+ * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs.
345
345
  */
346
346
  interfaceName?: string;
347
347
  };
@@ -561,10 +561,10 @@ export type ArrayField = FieldBase & {
561
561
  dbName?: DBIdentifierName;
562
562
  fields: Field[];
563
563
  /** Customize generated GraphQL and Typescript schema names.
564
- * By default it is bound to the collection.
564
+ * By default, it is bound to the collection.
565
565
  *
566
566
  * This is useful if you would like to generate a top level type to share amongst collections/fields.
567
- * **Note**: Top level types can collide, ensure they are unique among collections, arrays, groups, blocks, tabs.
567
+ * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs.
568
568
  */
569
569
  interfaceName?: string;
570
570
  labels?: Labels;
@@ -613,7 +613,7 @@ export type Block = {
613
613
  * The slug is used by default.
614
614
  *
615
615
  * This is useful if you would like to generate a top level type to share amongst collections/fields.
616
- * **Note**: Top level types can collide, ensure they are unique among collections, arrays, groups, blocks, tabs.
616
+ * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs.
617
617
  */
618
618
  interfaceName?: string;
619
619
  labels?: Labels;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/fields/config/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAI1C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AACvF,OAAO,KAAK,EACV,oBAAoB,EACpB,WAAW,EACX,oBAAoB,EACpB,UAAU,EACV,UAAU,EAEV,iBAAiB,EAClB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAC9F,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,sBAAsB,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACpG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEpD,MAAM,MAAM,aAAa,CAAC,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AAM,EAAE,MAAM,GAAG,MAAM,IAAI,MAAM,CAE9D;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,aAAa,CAEtE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,iBAAiB,CAIzE;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,iBAAiB,GAAG,KAAK,GAAG,UAAU,GAC5C,KAAK,IAAI,OAAO,CAElB;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,iBAAiB,GAAG,KAAK,GAAG,UAAU,GAC5C,KAAK,IAAI,kBAAkB,CAE7B;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,QAAQ,CAEpD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,GAAG,OAAO,CAE5D;AAED,MAAM,MAAM,QAAQ,GAChB,aAAa,GACb,WAAW,GACX,cAAc,GACd,YAAY,GACZ,gBAAgB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/config/types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-use-before-define */\nimport type { EditorProps } from '@monaco-editor/react'\nimport type { CSSProperties } from 'react'\n\n//eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport monacoeditor from 'monaco-editor' // IMPORTANT - DO NOT REMOVE: This is required for pnpm's default isolated mode to work - even though the import is not used. This is due to a typescript bug: https://github.com/microsoft/TypeScript/issues/47663#issuecomment-1519138189. (tsbugisolatedmode)\nimport type React from 'react'\n\nimport type { RichTextAdapter, RichTextAdapterProvider } from '../../admin/RichText.js'\nimport type {\n ConditionalDateProps,\n Description,\n DescriptionComponent,\n ErrorProps,\n LabelProps,\n RowLabel,\n RowLabelComponent,\n} from '../../admin/types.js'\nimport type { SanitizedCollectionConfig, TypeWithID } from '../../collections/config/types.js'\nimport type { CustomComponent, LabelFunction } from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { DocumentPreferences } from '../../preferences/types.js'\nimport type { Operation, PayloadRequestWithData, RequestContext, Where } from '../../types/index.js'\nimport type { ClientFieldConfig } from './client.js'\n\nexport type FieldHookArgs<T extends TypeWithID = any, P = any, S = any> = {\n /** The collection which the field belongs to. If the field belongs to a global, this will be null. */\n collection: SanitizedCollectionConfig | null\n context: RequestContext\n /** The data passed to update the document within create and update operations, and the full document itself in the afterRead hook. */\n data?: Partial<T>\n /** The field which the hook is running against. */\n field: FieldAffectingData\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany?: boolean\n /** The global which the field belongs to. If the field belongs to a collection, this will be null. */\n global: SanitizedGlobalConfig | null\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n /** The full original document in `update` operations. In the `afterChange` hook, this is the resulting document of the operation. */\n originalDoc?: T\n overrideAccess?: boolean\n /** The document before changes were applied, only in `afterChange` hooks. */\n previousDoc?: T\n /** The sibling data of the document before changes being applied, only in `beforeChange` and `afterChange` hook. */\n previousSiblingDoc?: T\n /** The previous value of the field, before changes, only in `beforeChange`, `afterChange` and `beforeValidate` hooks. */\n previousValue?: P\n /** The Express request object. It is mocked for Local API operations. */\n req: PayloadRequestWithData\n /** The sibling data passed to a field that the hook is running against. */\n siblingData: Partial<S>\n /** The value of the field. */\n value?: P\n}\n\nexport type FieldHook<T extends TypeWithID = any, P = any, S = any> = (\n args: FieldHookArgs<T, P, S>,\n) => P | Promise<P>\n\nexport type FieldAccess<T extends TypeWithID = any, P = any, U = any> = (args: {\n /**\n * The incoming data used to `create` or `update` the document with. `data` is undefined during the `read` operation.\n */\n data?: Partial<T>\n /**\n * The original data of the document before the `update` is applied. `doc` is undefined during the `create` operation.\n */\n doc?: T\n /**\n * The `id` of the current document being read or updated. `id` is undefined during the `create` operation.\n */\n id?: number | string\n /** The `payload` object to interface with the payload API */\n req: PayloadRequestWithData<U>\n /**\n * Immediately adjacent data to this field. For example, if this is a `group` field, then `siblingData` will be the other fields within the group.\n */\n siblingData?: Partial<P>\n}) => Promise<boolean> | boolean\n\nexport type Condition<T extends TypeWithID = any, P = any> = (\n data: Partial<T>,\n siblingData: Partial<P>,\n { user }: { user: PayloadRequestWithData['user'] },\n) => boolean\n\nexport type FilterOptionsProps<T = any> = {\n /**\n * An object containing the full collection or global document currently being edited.\n */\n data: T\n /**\n * The `id` of the current document being edited. `id` is undefined during the `create` operation.\n */\n id: number | string\n /**\n * The collection `slug` to filter against, limited to this field's `relationTo` property.\n */\n relationTo: string\n /**\n * An object containing document data that is scoped to only fields within the same parent of this field.\n */\n siblingData: unknown\n /**\n * An object containing the currently authenticated user.\n */\n user: Partial<PayloadRequestWithData['user']>\n}\n\nexport type FilterOptions<T = any> =\n | ((options: FilterOptionsProps<T>) => Promise<Where | boolean> | Where | boolean)\n | Where\n | null\n\ntype Admin = {\n className?: string\n components?: {\n Cell?: CustomComponent\n Description?: DescriptionComponent\n Field?: CustomComponent\n /**\n * The Filter component has to be a client component\n */\n Filter?: React.ComponentType<any>\n }\n /**\n * You can programmatically show / hide fields based on what other fields are doing.\n * This is also run on the server, to determine if the field should be validated.\n */\n condition?: Condition\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n description?: Description\n disableBulkEdit?: boolean\n /**\n * Shows / hides fields from appearing in the list view column selector.\n * @type boolean\n */\n disableListColumn?: boolean\n /**\n * Shows / hides fields from appearing in the list view filter options.\n * @type boolean\n */\n disableListFilter?: boolean\n disabled?: boolean\n hidden?: boolean\n position?: 'sidebar'\n readOnly?: boolean\n style?: CSSProperties\n width?: string\n}\n\nexport type Labels = {\n plural: LabelFunction | Record<string, string> | string\n singular: LabelFunction | Record<string, string> | string\n}\n\nexport type BaseValidateOptions<TData, TSiblingData> = {\n data: Partial<TData>\n id?: number | string\n operation?: Operation\n preferences: DocumentPreferences\n req: PayloadRequestWithData\n siblingData: Partial<TSiblingData>\n}\n\nexport type ValidateOptions<TData, TSiblingData, TFieldConfig extends object> = BaseValidateOptions<\n TData,\n TSiblingData\n> &\n TFieldConfig\n\nexport type Validate<\n TValue = any,\n TData = any,\n TSiblingData = any,\n TFieldConfig extends object = object,\n> = (\n value: TValue,\n options: ValidateOptions<TData, TSiblingData, TFieldConfig>,\n) => Promise<string | true> | string | true\n\nexport type ClientValidate = Omit<Validate, 'req'>\n\nexport type OptionObject = {\n label: LabelFunction | Record<string, string> | string\n value: string\n}\n\nexport type Option = OptionObject | string\n\nexport interface FieldBase {\n access?: {\n create?: FieldAccess\n read?: FieldAccess\n update?: FieldAccess\n }\n admin?: Admin\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n defaultValue?: any\n hidden?: boolean\n hooks?: {\n afterChange?: FieldHook[]\n afterRead?: FieldHook[]\n beforeChange?: FieldHook[]\n /**\n * Runs before a document is duplicated to prevent errors in unique fields or return null to use defaultValue.\n */\n beforeDuplicate?: FieldHook[]\n beforeValidate?: FieldHook[]\n }\n index?: boolean\n label?: LabelFunction | Record<string, string> | false | string\n localized?: boolean\n name: string\n required?: boolean\n saveToJWT?: boolean | string\n unique?: boolean\n validate?: Validate\n}\n\nexport type NumberField = FieldBase & {\n admin?: Admin & {\n /** Set this property to a string that will be used for browser autocomplete. */\n autoComplete?: string\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n }\n /** Set this property to define a placeholder string for the field. */\n placeholder?: Record<string, string> | string\n /** Set a value for the number field to increment / decrement using browser controls. */\n step?: number\n }\n /** Maximum value accepted. Used in the default `validation` function. */\n max?: number\n /** Minimum value accepted. Used in the default `validation` function. */\n min?: number\n type: 'number'\n} & (\n | {\n /** Makes this field an ordered array of numbers instead of just a single number. */\n hasMany: true\n /** Maximum number of numbers in the numbers array, if `hasMany` is set to true. */\n maxRows?: number\n /** Minimum number of numbers in the numbers array, if `hasMany` is set to true. */\n minRows?: number\n }\n | {\n /** Makes this field an ordered array of numbers instead of just a single number. */\n hasMany?: false | undefined\n /** Maximum number of numbers in the numbers array, if `hasMany` is set to true. */\n maxRows?: undefined\n /** Minimum number of numbers in the numbers array, if `hasMany` is set to true. */\n minRows?: undefined\n }\n )\n\nexport type TextField = FieldBase & {\n admin?: Admin & {\n autoComplete?: string\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n }\n placeholder?: Record<string, string> | string\n rtl?: boolean\n }\n maxLength?: number\n minLength?: number\n type: 'text'\n} & (\n | {\n /** Makes this field an ordered array of strings instead of just a single string. */\n hasMany: true\n /** Maximum number of strings in the strings array, if `hasMany` is set to true. */\n maxRows?: number\n /** Minimum number of strings in the strings array, if `hasMany` is set to true. */\n minRows?: number\n }\n | {\n /** Makes this field an ordered array of strings instead of just a single string. */\n hasMany?: false | undefined\n /** Maximum number of strings in the strings array, if `hasMany` is set to true. */\n maxRows?: undefined\n /** Minimum number of strings in the strings array, if `hasMany` is set to true. */\n minRows?: undefined\n }\n )\n\nexport type EmailField = FieldBase & {\n admin?: Admin & {\n autoComplete?: string\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n }\n placeholder?: Record<string, string> | string\n }\n type: 'email'\n}\n\nexport type TextareaField = FieldBase & {\n admin?: Admin & {\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n }\n placeholder?: Record<string, string> | string\n rows?: number\n rtl?: boolean\n }\n maxLength?: number\n minLength?: number\n type: 'textarea'\n}\n\nexport type CheckboxField = FieldBase & {\n admin?: Admin & {\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n }\n }\n type: 'checkbox'\n}\n\nexport type DateField = FieldBase & {\n admin?: Admin & {\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n }\n date?: ConditionalDateProps\n placeholder?: Record<string, string> | string\n }\n type: 'date'\n}\n\nexport type GroupField = Omit<FieldBase, 'required' | 'validation'> & {\n admin?: Admin & {\n hideGutter?: boolean\n }\n fields: Field[]\n /** Customize generated GraphQL and Typescript schema names.\n * By default it is bound to the collection.\n *\n * This is useful if you would like to generate a top level type to share amongst collections/fields.\n * **Note**: Top level types can collide, ensure they are unique among collections, arrays, groups, blocks, tabs.\n */\n interfaceName?: string\n type: 'group'\n}\n\nexport type RowAdmin = Omit<Admin, 'description'>\n\nexport type RowField = Omit<FieldBase, 'admin' | 'label' | 'name'> & {\n admin?: RowAdmin\n fields: Field[]\n type: 'row'\n}\n\nexport type CollapsibleField = Omit<FieldBase, 'label' | 'name'> & {\n fields: Field[]\n type: 'collapsible'\n} & (\n | {\n admin: Admin & {\n components: {\n RowLabel: RowLabelComponent\n } & Admin['components']\n initCollapsed?: boolean\n }\n label?: Required<FieldBase['label']>\n }\n | {\n admin?: Admin & {\n initCollapsed?: boolean\n }\n label: Required<FieldBase['label']>\n }\n )\n\nexport type TabsAdmin = Omit<Admin, 'description'>\n\ntype TabBase = Omit<FieldBase, 'required' | 'validation'> & {\n description?: Description\n fields: Field[]\n interfaceName?: string\n saveToJWT?: boolean | string\n}\n\nexport type NamedTab = TabBase & {\n /** Customize generated GraphQL and Typescript schema names.\n * The slug is used by default.\n *\n * This is useful if you would like to generate a top level type to share amongst collections/fields.\n * **Note**: Top level types can collide, ensure they are unique among collections, arrays, groups, blocks, tabs.\n */\n interfaceName?: string\n}\n\nexport type UnnamedTab = Omit<TabBase, 'name'> & {\n interfaceName?: never\n /**\n * Can be either:\n * - A string, which will be used as the tab's label.\n * - An object, where the key is the language code and the value is the label.\n */\n label:\n | {\n [selectedLanguage: string]: string\n }\n | LabelFunction\n | string\n localized?: never\n}\n\nexport type Tab = NamedTab | UnnamedTab\n\nexport type TabsField = Omit<FieldBase, 'admin' | 'localized' | 'name' | 'saveToJWT'> & {\n admin?: TabsAdmin\n tabs: Tab[]\n type: 'tabs'\n}\n\nexport type TabAsField = Tab & {\n name?: string\n type: 'tab'\n}\n\nexport type UIField = {\n admin: {\n components?: {\n Cell?: CustomComponent\n Field: CustomComponent\n /**\n * The Filter component has to be a client component\n */\n Filter?: React.ComponentType<any>\n }\n condition?: Condition\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n disableBulkEdit?: boolean\n /**\n * Shows / hides fields from appearing in the list view column selector.\n * @type boolean\n */\n disableListColumn?: boolean\n /**\n * Shows / hides fields from appearing in the list view filter options.\n * @type boolean\n */\n disableListFilter?: boolean\n position?: string\n width?: string\n }\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n label?: Record<string, string> | string\n name: string\n type: 'ui'\n}\n\nexport type UploadField = FieldBase & {\n admin?: {\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n }\n }\n filterOptions?: FilterOptions\n /**\n * Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n relationTo: string\n type: 'upload'\n}\n\ntype CodeAdmin = Admin & {\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n }\n editorOptions?: EditorProps['options']\n language?: string\n}\n\nexport type CodeField = Omit<FieldBase, 'admin'> & {\n admin?: CodeAdmin\n maxLength?: number\n minLength?: number\n type: 'code'\n}\n\ntype JSONAdmin = Admin & {\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n }\n editorOptions?: EditorProps['options']\n}\n\nexport type JSONField = Omit<FieldBase, 'admin'> & {\n admin?: JSONAdmin\n jsonSchema?: Record<string, unknown>\n type: 'json'\n}\n\nexport type SelectField = FieldBase & {\n admin?: Admin & {\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n }\n isClearable?: boolean\n isSortable?: boolean\n }\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n /**\n * Customize the DB enum name\n */\n enumName?: DBIdentifierName\n hasMany?: boolean\n options: Option[]\n type: 'select'\n}\n\ntype SharedRelationshipProperties = FieldBase & {\n filterOptions?: FilterOptions\n hasMany?: boolean\n /**\n * Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n type: 'relationship'\n} & (\n | {\n hasMany: true\n /**\n * @deprecated Use 'maxRows' instead\n */\n max?: number\n maxRows?: number\n /**\n * @deprecated Use 'minRows' instead\n */\n min?: number\n minRows?: number\n }\n | {\n hasMany?: false | undefined\n /**\n * @deprecated Use 'maxRows' instead\n */\n max?: undefined\n maxRows?: undefined\n /**\n * @deprecated Use 'minRows' instead\n */\n min?: undefined\n minRows?: undefined\n }\n )\n\ntype RelationshipAdmin = Admin & {\n allowCreate?: boolean\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n }\n isSortable?: boolean\n}\nexport type PolymorphicRelationshipField = SharedRelationshipProperties & {\n admin?: RelationshipAdmin & {\n sortOptions?: { [collectionSlug: string]: string }\n }\n relationTo: string[]\n}\nexport type SingleRelationshipField = SharedRelationshipProperties & {\n admin?: RelationshipAdmin & {\n sortOptions?: string\n }\n relationTo: string\n}\nexport type RelationshipField = PolymorphicRelationshipField | SingleRelationshipField\n\nexport type ValueWithRelation = {\n relationTo: string\n value: number | string\n}\n\nexport function valueIsValueWithRelation(value: unknown): value is ValueWithRelation {\n return value !== null && typeof value === 'object' && 'relationTo' in value && 'value' in value\n}\n\nexport type RelationshipValue =\n | (number | string)[]\n | ValueWithRelation\n | ValueWithRelation[]\n | (number | string)\n\nexport type RichTextField<\n Value extends object = any,\n AdapterProps = any,\n ExtraProperties = object,\n> = FieldBase & {\n admin?: Admin & {\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n }\n }\n editor?:\n | RichTextAdapter<Value, AdapterProps, AdapterProps>\n | RichTextAdapterProvider<Value, AdapterProps, AdapterProps>\n /**\n * Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n type: 'richText'\n} & ExtraProperties\n\nexport type ArrayField = FieldBase & {\n admin?: Admin & {\n components?: {\n RowLabel?: RowLabelComponent\n } & Admin['components']\n initCollapsed?: boolean\n /**\n * Disable drag and drop sorting\n */\n isSortable?: boolean\n }\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n fields: Field[]\n /** Customize generated GraphQL and Typescript schema names.\n * By default it is bound to the collection.\n *\n * This is useful if you would like to generate a top level type to share amongst collections/fields.\n * **Note**: Top level types can collide, ensure they are unique among collections, arrays, groups, blocks, tabs.\n */\n interfaceName?: string\n labels?: Labels\n maxRows?: number\n minRows?: number\n type: 'array'\n}\n\nexport type RadioField = FieldBase & {\n admin?: Admin & {\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n }\n layout?: 'horizontal' | 'vertical'\n }\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n /**\n * Customize the DB enum name\n */\n enumName?: DBIdentifierName\n options: Option[]\n type: 'radio'\n}\n\nexport type Block = {\n admin?: {\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n }\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n fields: Field[]\n /** @deprecated - please migrate to the interfaceName property instead. */\n graphQL?: {\n singularName?: string\n }\n imageAltText?: string\n imageURL?: string\n /** Customize generated GraphQL and Typescript schema names.\n * The slug is used by default.\n *\n * This is useful if you would like to generate a top level type to share amongst collections/fields.\n * **Note**: Top level types can collide, ensure they are unique among collections, arrays, groups, blocks, tabs.\n */\n interfaceName?: string\n labels?: Labels\n slug: string\n}\n\nexport type BlockField = FieldBase & {\n admin?: Admin & {\n initCollapsed?: boolean\n /**\n * Disable drag and drop sorting\n */\n isSortable?: boolean\n }\n blocks: Block[]\n defaultValue?: unknown\n labels?: Labels\n maxRows?: number\n minRows?: number\n type: 'blocks'\n}\n\nexport type PointField = FieldBase & {\n type: 'point'\n}\n\nexport type Field =\n | ArrayField\n | BlockField\n | CheckboxField\n | CodeField\n | CollapsibleField\n | DateField\n | EmailField\n | GroupField\n | JSONField\n | NumberField\n | PointField\n | RadioField\n | RelationshipField\n | RichTextField\n | RowField\n | SelectField\n | TabsField\n | TextField\n | TextareaField\n | UIField\n | UploadField\n\nexport type FieldAffectingData =\n | ArrayField\n | BlockField\n | CheckboxField\n | CodeField\n | DateField\n | EmailField\n | GroupField\n | JSONField\n | NumberField\n | PointField\n | RadioField\n | RelationshipField\n | RichTextField\n | SelectField\n | TabAsField\n | TextField\n | TextareaField\n | UploadField\n\nexport type NonPresentationalField =\n | ArrayField\n | BlockField\n | CheckboxField\n | CodeField\n | CollapsibleField\n | DateField\n | EmailField\n | GroupField\n | JSONField\n | NumberField\n | PointField\n | RadioField\n | RelationshipField\n | RichTextField\n | RowField\n | SelectField\n | TabsField\n | TextField\n | TextareaField\n | UploadField\n\nexport type FieldWithPath = Field & {\n path?: string\n}\n\nexport type FieldWithSubFields = ArrayField | CollapsibleField | GroupField | RowField\n\nexport type FieldPresentationalOnly = UIField\n\nexport type FieldWithMany = RelationshipField | SelectField\n\nexport type FieldWithMaxDepth = RelationshipField | UploadField\n\nexport function fieldHasSubFields(field: ClientFieldConfig | Field): field is FieldWithSubFields {\n return (\n field.type === 'group' ||\n field.type === 'array' ||\n field.type === 'row' ||\n field.type === 'collapsible'\n )\n}\n\nexport function fieldIsArrayType(field: Field): field is ArrayField {\n return field.type === 'array'\n}\n\nexport function fieldIsBlockType(field: Field): field is BlockField {\n return field.type === 'blocks'\n}\n\nexport function fieldIsGroupType(field: Field): field is GroupField {\n return field.type === 'group'\n}\n\nexport function optionIsObject(option: Option): option is OptionObject {\n return typeof option === 'object'\n}\n\nexport function optionsAreObjects(options: Option[]): options is OptionObject[] {\n return Array.isArray(options) && typeof options?.[0] === 'object'\n}\n\nexport function optionIsValue(option: Option): option is string {\n return typeof option === 'string'\n}\n\nexport function fieldSupportsMany(field: Field): field is FieldWithMany {\n return field.type === 'select' || field.type === 'relationship'\n}\n\nexport function fieldHasMaxDepth(field: Field): field is FieldWithMaxDepth {\n return (\n (field.type === 'upload' || field.type === 'relationship') && typeof field.maxDepth === 'number'\n )\n}\n\nexport function fieldIsPresentationalOnly(\n field: ClientFieldConfig | Field | TabAsField,\n): field is UIField {\n return field.type === 'ui'\n}\n\nexport function fieldAffectsData(\n field: ClientFieldConfig | Field | TabAsField,\n): field is FieldAffectingData {\n return 'name' in field && !fieldIsPresentationalOnly(field)\n}\n\nexport function tabHasName(tab: Tab): tab is NamedTab {\n return 'name' in tab\n}\n\nexport function fieldIsLocalized(field: Field | Tab): boolean {\n return 'localized' in field && field.localized\n}\n\nexport type HookName =\n | 'afterChange'\n | 'afterRead'\n | 'beforeChange'\n | 'beforeRead'\n | 'beforeValidate'\n"],"names":["valueIsValueWithRelation","value","fieldHasSubFields","field","type","fieldIsArrayType","fieldIsBlockType","fieldIsGroupType","optionIsObject","option","optionsAreObjects","options","Array","isArray","optionIsValue","fieldSupportsMany","fieldHasMaxDepth","maxDepth","fieldIsPresentationalOnly","fieldAffectsData","tabHasName","tab","fieldIsLocalized","localized"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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O,SAASC,iBAAiBnB,KAAkB;IACjD,OAAO,eAAeA,SAASA,MAAMoB,SAAS;AAChD"}
1
+ {"version":3,"sources":["../../../src/fields/config/types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-use-before-define */\nimport type { EditorProps } from '@monaco-editor/react'\nimport type { CSSProperties } from 'react'\n\n//eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport monacoeditor from 'monaco-editor' // IMPORTANT - DO NOT REMOVE: This is required for pnpm's default isolated mode to work - even though the import is not used. This is due to a typescript bug: https://github.com/microsoft/TypeScript/issues/47663#issuecomment-1519138189. (tsbugisolatedmode)\nimport type React from 'react'\n\nimport type { RichTextAdapter, RichTextAdapterProvider } from '../../admin/RichText.js'\nimport type {\n ConditionalDateProps,\n Description,\n DescriptionComponent,\n ErrorProps,\n LabelProps,\n RowLabelComponent,\n} from '../../admin/types.js'\nimport type { SanitizedCollectionConfig, TypeWithID } from '../../collections/config/types.js'\nimport type { CustomComponent, LabelFunction } from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { DocumentPreferences } from '../../preferences/types.js'\nimport type { Operation, PayloadRequestWithData, RequestContext, Where } from '../../types/index.js'\nimport type { ClientFieldConfig } from './client.js'\n\nexport type FieldHookArgs<TData extends TypeWithID = any, TValue = any, TSiblingData = any> = {\n /** The collection which the field belongs to. If the field belongs to a global, this will be null. */\n collection: SanitizedCollectionConfig | null\n context: RequestContext\n /** The data passed to update the document within create and update operations, and the full document itself in the afterRead hook. */\n data?: Partial<TData>\n /** The field which the hook is running against. */\n field: FieldAffectingData\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany?: boolean\n /** The global which the field belongs to. If the field belongs to a collection, this will be null. */\n global: SanitizedGlobalConfig | null\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n /** The full original document in `update` operations. In the `afterChange` hook, this is the resulting document of the operation. */\n originalDoc?: TData\n overrideAccess?: boolean\n /** The document before changes were applied, only in `afterChange` hooks. */\n previousDoc?: TData\n /** The sibling data of the document before changes being applied, only in `beforeChange` and `afterChange` hook. */\n previousSiblingDoc?: TData\n /** The previous value of the field, before changes, only in `beforeChange`, `afterChange` and `beforeValidate` hooks. */\n previousValue?: TValue\n /** The Express request object. It is mocked for Local API operations. */\n req: PayloadRequestWithData\n /** The sibling data passed to a field that the hook is running against. */\n siblingData: Partial<TSiblingData>\n /** The value of the field. */\n value?: TValue\n}\n\nexport type FieldHook<TData extends TypeWithID = any, TValue = any, TSiblingData = any> = (\n args: FieldHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type FieldAccess<TData extends TypeWithID = any, TSiblingData = any> = (args: {\n /**\n * The incoming data used to `create` or `update` the document with. `data` is undefined during the `read` operation.\n */\n data?: Partial<TData>\n /**\n * The original data of the document before the `update` is applied. `doc` is undefined during the `create` operation.\n */\n doc?: TData\n /**\n * The `id` of the current document being read or updated. `id` is undefined during the `create` operation.\n */\n id?: number | string\n /** The `payload` object to interface with the payload API */\n req: PayloadRequestWithData\n /**\n * Immediately adjacent data to this field. For example, if this is a `group` field, then `siblingData` will be the other fields within the group.\n */\n siblingData?: Partial<TSiblingData>\n}) => Promise<boolean> | boolean\n\nexport type Condition<TData extends TypeWithID = any, TSiblingData = any> = (\n data: Partial<TData>,\n siblingData: Partial<TSiblingData>,\n { user }: { user: PayloadRequestWithData['user'] },\n) => boolean\n\nexport type FilterOptionsProps<TData = any> = {\n /**\n * An object containing the full collection or global document currently being edited.\n */\n data: TData\n /**\n * The `id` of the current document being edited. `id` is undefined during the `create` operation.\n */\n id: number | string\n /**\n * The collection `slug` to filter against, limited to this field's `relationTo` property.\n */\n relationTo: string\n /**\n * An object containing document data that is scoped to only fields within the same parent of this field.\n */\n siblingData: unknown\n /**\n * An object containing the currently authenticated user.\n */\n user: Partial<PayloadRequestWithData['user']>\n}\n\nexport type FilterOptions<TData = any> =\n | ((options: FilterOptionsProps<TData>) => Promise<Where | boolean> | Where | boolean)\n | Where\n | null\n\ntype Admin = {\n className?: string\n components?: {\n Cell?: CustomComponent\n Description?: DescriptionComponent\n Field?: CustomComponent\n /**\n * The Filter component has to be a client component\n */\n Filter?: React.ComponentType<any>\n }\n /**\n * You can programmatically show / hide fields based on what other fields are doing.\n * This is also run on the server, to determine if the field should be validated.\n */\n condition?: Condition\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n description?: Description\n disableBulkEdit?: boolean\n /**\n * Shows / hides fields from appearing in the list view column selector.\n * @type boolean\n */\n disableListColumn?: boolean\n /**\n * Shows / hides fields from appearing in the list view filter options.\n * @type boolean\n */\n disableListFilter?: boolean\n disabled?: boolean\n hidden?: boolean\n position?: 'sidebar'\n readOnly?: boolean\n style?: CSSProperties\n width?: string\n}\n\nexport type Labels = {\n plural: LabelFunction | Record<string, string> | string\n singular: LabelFunction | Record<string, string> | string\n}\n\nexport type BaseValidateOptions<TData, TSiblingData> = {\n data: Partial<TData>\n id?: number | string\n operation?: Operation\n preferences: DocumentPreferences\n req: PayloadRequestWithData\n siblingData: Partial<TSiblingData>\n}\n\nexport type ValidateOptions<TData, TSiblingData, TFieldConfig extends object> = BaseValidateOptions<\n TData,\n TSiblingData\n> &\n TFieldConfig\n\nexport type Validate<\n TValue = any,\n TData = any,\n TSiblingData = any,\n TFieldConfig extends object = object,\n> = (\n value: TValue,\n options: ValidateOptions<TData, TSiblingData, TFieldConfig>,\n) => Promise<string | true> | string | true\n\nexport type ClientValidate = Omit<Validate, 'req'>\n\nexport type OptionObject = {\n label: LabelFunction | Record<string, string> | string\n value: string\n}\n\nexport type Option = OptionObject | string\n\nexport interface FieldBase {\n access?: {\n create?: FieldAccess\n read?: FieldAccess\n update?: FieldAccess\n }\n admin?: Admin\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n defaultValue?: any\n hidden?: boolean\n hooks?: {\n afterChange?: FieldHook[]\n afterRead?: FieldHook[]\n beforeChange?: FieldHook[]\n /**\n * Runs before a document is duplicated to prevent errors in unique fields or return null to use defaultValue.\n */\n beforeDuplicate?: FieldHook[]\n beforeValidate?: FieldHook[]\n }\n index?: boolean\n label?: LabelFunction | Record<string, string> | false | string\n localized?: boolean\n name: string\n required?: boolean\n saveToJWT?: boolean | string\n unique?: boolean\n validate?: Validate\n}\n\nexport type NumberField = FieldBase & {\n admin?: Admin & {\n /** Set this property to a string that will be used for browser autocomplete. */\n autoComplete?: string\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n }\n /** Set this property to define a placeholder string for the field. */\n placeholder?: Record<string, string> | string\n /** Set a value for the number field to increment / decrement using browser controls. */\n step?: number\n }\n /** Maximum value accepted. Used in the default `validation` function. */\n max?: number\n /** Minimum value accepted. Used in the default `validation` function. */\n min?: number\n type: 'number'\n} & (\n | {\n /** Makes this field an ordered array of numbers instead of just a single number. */\n hasMany: true\n /** Maximum number of numbers in the numbers array, if `hasMany` is set to true. */\n maxRows?: number\n /** Minimum number of numbers in the numbers array, if `hasMany` is set to true. */\n minRows?: number\n }\n | {\n /** Makes this field an ordered array of numbers instead of just a single number. */\n hasMany?: false | undefined\n /** Maximum number of numbers in the numbers array, if `hasMany` is set to true. */\n maxRows?: undefined\n /** Minimum number of numbers in the numbers array, if `hasMany` is set to true. */\n minRows?: undefined\n }\n )\n\nexport type TextField = FieldBase & {\n admin?: Admin & {\n autoComplete?: string\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n }\n placeholder?: Record<string, string> | string\n rtl?: boolean\n }\n maxLength?: number\n minLength?: number\n type: 'text'\n} & (\n | {\n /** Makes this field an ordered array of strings instead of just a single string. */\n hasMany: true\n /** Maximum number of strings in the strings array, if `hasMany` is set to true. */\n maxRows?: number\n /** Minimum number of strings in the strings array, if `hasMany` is set to true. */\n minRows?: number\n }\n | {\n /** Makes this field an ordered array of strings instead of just a single string. */\n hasMany?: false | undefined\n /** Maximum number of strings in the strings array, if `hasMany` is set to true. */\n maxRows?: undefined\n /** Minimum number of strings in the strings array, if `hasMany` is set to true. */\n minRows?: undefined\n }\n )\n\nexport type EmailField = FieldBase & {\n admin?: Admin & {\n autoComplete?: string\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n }\n placeholder?: Record<string, string> | string\n }\n type: 'email'\n}\n\nexport type TextareaField = FieldBase & {\n admin?: Admin & {\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n }\n placeholder?: Record<string, string> | string\n rows?: number\n rtl?: boolean\n }\n maxLength?: number\n minLength?: number\n type: 'textarea'\n}\n\nexport type CheckboxField = FieldBase & {\n admin?: Admin & {\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n }\n }\n type: 'checkbox'\n}\n\nexport type DateField = FieldBase & {\n admin?: Admin & {\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n afterInput?: CustomComponent[]\n beforeInput?: CustomComponent[]\n }\n date?: ConditionalDateProps\n placeholder?: Record<string, string> | string\n }\n type: 'date'\n}\n\nexport type GroupField = Omit<FieldBase, 'required' | 'validation'> & {\n admin?: Admin & {\n hideGutter?: boolean\n }\n fields: Field[]\n /** Customize generated GraphQL and Typescript schema names.\n * By default, it is bound to the collection.\n *\n * This is useful if you would like to generate a top level type to share amongst collections/fields.\n * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs.\n */\n interfaceName?: string\n type: 'group'\n}\n\nexport type RowAdmin = Omit<Admin, 'description'>\n\nexport type RowField = Omit<FieldBase, 'admin' | 'label' | 'name'> & {\n admin?: RowAdmin\n fields: Field[]\n type: 'row'\n}\n\nexport type CollapsibleField = Omit<FieldBase, 'label' | 'name'> & {\n fields: Field[]\n type: 'collapsible'\n} & (\n | {\n admin: Admin & {\n components: {\n RowLabel: RowLabelComponent\n } & Admin['components']\n initCollapsed?: boolean\n }\n label?: Required<FieldBase['label']>\n }\n | {\n admin?: Admin & {\n initCollapsed?: boolean\n }\n label: Required<FieldBase['label']>\n }\n )\n\nexport type TabsAdmin = Omit<Admin, 'description'>\n\ntype TabBase = Omit<FieldBase, 'required' | 'validation'> & {\n description?: Description\n fields: Field[]\n interfaceName?: string\n saveToJWT?: boolean | string\n}\n\nexport type NamedTab = TabBase & {\n /** Customize generated GraphQL and Typescript schema names.\n * The slug is used by default.\n *\n * This is useful if you would like to generate a top level type to share amongst collections/fields.\n * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs.\n */\n interfaceName?: string\n}\n\nexport type UnnamedTab = Omit<TabBase, 'name'> & {\n interfaceName?: never\n /**\n * Can be either:\n * - A string, which will be used as the tab's label.\n * - An object, where the key is the language code and the value is the label.\n */\n label:\n | {\n [selectedLanguage: string]: string\n }\n | LabelFunction\n | string\n localized?: never\n}\n\nexport type Tab = NamedTab | UnnamedTab\n\nexport type TabsField = Omit<FieldBase, 'admin' | 'localized' | 'name' | 'saveToJWT'> & {\n admin?: TabsAdmin\n tabs: Tab[]\n type: 'tabs'\n}\n\nexport type TabAsField = Tab & {\n name?: string\n type: 'tab'\n}\n\nexport type UIField = {\n admin: {\n components?: {\n Cell?: CustomComponent\n Field: CustomComponent\n /**\n * The Filter component has to be a client component\n */\n Filter?: React.ComponentType<any>\n }\n condition?: Condition\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n disableBulkEdit?: boolean\n /**\n * Shows / hides fields from appearing in the list view column selector.\n * @type boolean\n */\n disableListColumn?: boolean\n /**\n * Shows / hides fields from appearing in the list view filter options.\n * @type boolean\n */\n disableListFilter?: boolean\n position?: string\n width?: string\n }\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n label?: Record<string, string> | string\n name: string\n type: 'ui'\n}\n\nexport type UploadField = FieldBase & {\n admin?: {\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n }\n }\n filterOptions?: FilterOptions\n /**\n * Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n relationTo: string\n type: 'upload'\n}\n\ntype CodeAdmin = Admin & {\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n }\n editorOptions?: EditorProps['options']\n language?: string\n}\n\nexport type CodeField = Omit<FieldBase, 'admin'> & {\n admin?: CodeAdmin\n maxLength?: number\n minLength?: number\n type: 'code'\n}\n\ntype JSONAdmin = Admin & {\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n }\n editorOptions?: EditorProps['options']\n}\n\nexport type JSONField = Omit<FieldBase, 'admin'> & {\n admin?: JSONAdmin\n jsonSchema?: Record<string, unknown>\n type: 'json'\n}\n\nexport type SelectField = FieldBase & {\n admin?: Admin & {\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n }\n isClearable?: boolean\n isSortable?: boolean\n }\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n /**\n * Customize the DB enum name\n */\n enumName?: DBIdentifierName\n hasMany?: boolean\n options: Option[]\n type: 'select'\n}\n\ntype SharedRelationshipProperties = FieldBase & {\n filterOptions?: FilterOptions\n hasMany?: boolean\n /**\n * Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n type: 'relationship'\n} & (\n | {\n hasMany: true\n /**\n * @deprecated Use 'maxRows' instead\n */\n max?: number\n maxRows?: number\n /**\n * @deprecated Use 'minRows' instead\n */\n min?: number\n minRows?: number\n }\n | {\n hasMany?: false | undefined\n /**\n * @deprecated Use 'maxRows' instead\n */\n max?: undefined\n maxRows?: undefined\n /**\n * @deprecated Use 'minRows' instead\n */\n min?: undefined\n minRows?: undefined\n }\n )\n\ntype RelationshipAdmin = Admin & {\n allowCreate?: boolean\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n }\n isSortable?: boolean\n}\nexport type PolymorphicRelationshipField = SharedRelationshipProperties & {\n admin?: RelationshipAdmin & {\n sortOptions?: { [collectionSlug: string]: string }\n }\n relationTo: string[]\n}\nexport type SingleRelationshipField = SharedRelationshipProperties & {\n admin?: RelationshipAdmin & {\n sortOptions?: string\n }\n relationTo: string\n}\nexport type RelationshipField = PolymorphicRelationshipField | SingleRelationshipField\n\nexport type ValueWithRelation = {\n relationTo: string\n value: number | string\n}\n\nexport function valueIsValueWithRelation(value: unknown): value is ValueWithRelation {\n return value !== null && typeof value === 'object' && 'relationTo' in value && 'value' in value\n}\n\nexport type RelationshipValue =\n | (number | string)[]\n | ValueWithRelation\n | ValueWithRelation[]\n | (number | string)\n\nexport type RichTextField<\n Value extends object = any,\n AdapterProps = any,\n ExtraProperties = object,\n> = FieldBase & {\n admin?: Admin & {\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n }\n }\n editor?:\n | RichTextAdapter<Value, AdapterProps, AdapterProps>\n | RichTextAdapterProvider<Value, AdapterProps, AdapterProps>\n /**\n * Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n type: 'richText'\n} & ExtraProperties\n\nexport type ArrayField = FieldBase & {\n admin?: Admin & {\n components?: {\n RowLabel?: RowLabelComponent\n } & Admin['components']\n initCollapsed?: boolean\n /**\n * Disable drag and drop sorting\n */\n isSortable?: boolean\n }\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n fields: Field[]\n /** Customize generated GraphQL and Typescript schema names.\n * By default, it is bound to the collection.\n *\n * This is useful if you would like to generate a top level type to share amongst collections/fields.\n * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs.\n */\n interfaceName?: string\n labels?: Labels\n maxRows?: number\n minRows?: number\n type: 'array'\n}\n\nexport type RadioField = FieldBase & {\n admin?: Admin & {\n components?: {\n Error?: CustomComponent<ErrorProps>\n Label?: CustomComponent<LabelProps>\n }\n layout?: 'horizontal' | 'vertical'\n }\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n /**\n * Customize the DB enum name\n */\n enumName?: DBIdentifierName\n options: Option[]\n type: 'radio'\n}\n\nexport type Block = {\n admin?: {\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n }\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n /**\n * Customize the SQL table name\n */\n dbName?: DBIdentifierName\n fields: Field[]\n /** @deprecated - please migrate to the interfaceName property instead. */\n graphQL?: {\n singularName?: string\n }\n imageAltText?: string\n imageURL?: string\n /** Customize generated GraphQL and Typescript schema names.\n * The slug is used by default.\n *\n * This is useful if you would like to generate a top level type to share amongst collections/fields.\n * **Note**: Top level types can collide, ensure they are unique amongst collections, arrays, groups, blocks, tabs.\n */\n interfaceName?: string\n labels?: Labels\n slug: string\n}\n\nexport type BlockField = FieldBase & {\n admin?: Admin & {\n initCollapsed?: boolean\n /**\n * Disable drag and drop sorting\n */\n isSortable?: boolean\n }\n blocks: Block[]\n defaultValue?: unknown\n labels?: Labels\n maxRows?: number\n minRows?: number\n type: 'blocks'\n}\n\nexport type PointField = FieldBase & {\n type: 'point'\n}\n\nexport type Field =\n | ArrayField\n | BlockField\n | CheckboxField\n | CodeField\n | CollapsibleField\n | DateField\n | EmailField\n | GroupField\n | JSONField\n | NumberField\n | PointField\n | RadioField\n | RelationshipField\n | RichTextField\n | RowField\n | SelectField\n | TabsField\n | TextField\n | TextareaField\n | UIField\n | UploadField\n\nexport type FieldAffectingData =\n | ArrayField\n | BlockField\n | CheckboxField\n | CodeField\n | DateField\n | EmailField\n | GroupField\n | JSONField\n | NumberField\n | PointField\n | RadioField\n | RelationshipField\n | RichTextField\n | SelectField\n | TabAsField\n | TextField\n | TextareaField\n | UploadField\n\nexport type NonPresentationalField =\n | ArrayField\n | BlockField\n | CheckboxField\n | CodeField\n | CollapsibleField\n | DateField\n | EmailField\n | GroupField\n | JSONField\n | NumberField\n | PointField\n | RadioField\n | RelationshipField\n | RichTextField\n | RowField\n | SelectField\n | TabsField\n | TextField\n | TextareaField\n | UploadField\n\nexport type FieldWithPath = Field & {\n path?: string\n}\n\nexport type FieldWithSubFields = ArrayField | CollapsibleField | GroupField | RowField\n\nexport type FieldPresentationalOnly = UIField\n\nexport type FieldWithMany = RelationshipField | SelectField\n\nexport type FieldWithMaxDepth = RelationshipField | UploadField\n\nexport function fieldHasSubFields(field: ClientFieldConfig | Field): field is FieldWithSubFields {\n return (\n field.type === 'group' ||\n field.type === 'array' ||\n field.type === 'row' ||\n field.type === 'collapsible'\n )\n}\n\nexport function fieldIsArrayType(field: Field): field is ArrayField {\n return field.type === 'array'\n}\n\nexport function fieldIsBlockType(field: Field): field is BlockField {\n return field.type === 'blocks'\n}\n\nexport function fieldIsGroupType(field: Field): field is GroupField {\n return field.type === 'group'\n}\n\nexport function optionIsObject(option: Option): option is OptionObject {\n return typeof option === 'object'\n}\n\nexport function optionsAreObjects(options: Option[]): options is OptionObject[] {\n return Array.isArray(options) && typeof options?.[0] === 'object'\n}\n\nexport function optionIsValue(option: Option): option is string {\n return typeof option === 'string'\n}\n\nexport function fieldSupportsMany(field: Field): field is FieldWithMany {\n return field.type === 'select' || field.type === 'relationship'\n}\n\nexport function fieldHasMaxDepth(field: Field): field is FieldWithMaxDepth {\n return (\n (field.type === 'upload' || field.type === 'relationship') && typeof field.maxDepth === 'number'\n )\n}\n\nexport function fieldIsPresentationalOnly(\n field: ClientFieldConfig | Field | TabAsField,\n): field is UIField {\n return field.type === 'ui'\n}\n\nexport function fieldAffectsData(\n field: ClientFieldConfig | Field | TabAsField,\n): field is FieldAffectingData {\n return 'name' in field && !fieldIsPresentationalOnly(field)\n}\n\nexport function tabHasName(tab: Tab): tab is NamedTab {\n return 'name' in tab\n}\n\nexport function fieldIsLocalized(field: Field | Tab): boolean {\n return 'localized' in field && field.localized\n}\n\nexport type HookName =\n | 'afterChange'\n | 'afterRead'\n | 'beforeChange'\n | 'beforeRead'\n | 'beforeValidate'\n"],"names":["valueIsValueWithRelation","value","fieldHasSubFields","field","type","fieldIsArrayType","fieldIsBlockType","fieldIsGroupType","optionIsObject","option","optionsAreObjects","options","Array","isArray","optionIsValue","fieldSupportsMany","fieldHasMaxDepth","maxDepth","fieldIsPresentationalOnly","fieldAffectsData","tabHasName","tab","fieldIsLocalized","localized"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,qDAAqD,GACrD,uCAAuC,GAumBvC,OAAO,SAASA,yBAAyBC,KAAc;IACrD,OAAOA,UAAU,QAAQ,OAAOA,UAAU,YAAY,gBAAgBA,SAAS,WAAWA;AAC5F;AA8MA,OAAO,SAASC,kBAAkBC,KAAgC;IAChE,OACEA,MAAMC,IAAI,KAAK,WACfD,MAAMC,IAAI,KAAK,WACfD,MAAMC,IAAI,KAAK,SACfD,MAAMC,IAAI,KAAK;AAEnB;AAEA,OAAO,SAASC,iBAAiBF,KAAY;IAC3C,OAAOA,MAAMC,IAAI,KAAK;AACxB;AAEA,OAAO,SAASE,iBAAiBH,KAAY;IAC3C,OAAOA,MAAMC,IAAI,KAAK;AACxB;AAEA,OAAO,SAASG,iBAAiBJ,KAAY;IAC3C,OAAOA,MAAMC,IAAI,KAAK;AACxB;AAEA,OAAO,SAASI,eAAeC,MAAc;IAC3C,OAAO,OAAOA,WAAW;AAC3B;AAEA,OAAO,SAASC,kBAAkBC,OAAiB;IACjD,OAAOC,MAAMC,OAAO,CAACF,YAAY,OAAOA,SAAS,CAAC,EAAE,KAAK;AAC3D;AAEA,OAAO,SAASG,cAAcL,MAAc;IAC1C,OAAO,OAAOA,WAAW;AAC3B;AAEA,OAAO,SAASM,kBAAkBZ,KAAY;IAC5C,OAAOA,MAAMC,IAAI,KAAK,YAAYD,MAAMC,IAAI,KAAK;AACnD;AAEA,OAAO,SAASY,iBAAiBb,KAAY;IAC3C,OACE,AAACA,CAAAA,MAAMC,IAAI,KAAK,YAAYD,MAAMC,IAAI,KAAK,cAAa,KAAM,OAAOD,MAAMc,QAAQ,KAAK;AAE5F;AAEA,OAAO,SAASC,0BACdf,KAA6C;IAE7C,OAAOA,MAAMC,IAAI,KAAK;AACxB;AAEA,OAAO,SAASe,iBACdhB,KAA6C;IAE7C,OAAO,UAAUA,SAAS,CAACe,0BAA0Bf;AACvD;AAEA,OAAO,SAASiB,WAAWC,GAAQ;IACjC,OAAO,UAAUA;AACnB;AAEA,OAAO,SAASC,iBAAiBnB,KAAkB;IACjD,OAAO,eAAeA,SAASA,MAAMoB,SAAS;AAChD"}
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@ import type { Options as UnlockOptions } from './auth/operations/local/unlock.js
10
10
  import type { Options as VerifyEmailOptions } from './auth/operations/local/verifyEmail.js';
11
11
  import type { Result as LoginResult } from './auth/operations/login.js';
12
12
  import type { Result as ResetPasswordResult } from './auth/operations/resetPassword.js';
13
- import type { AuthStrategy } from './auth/types.js';
13
+ import type { AuthStrategy, User } from './auth/types.js';
14
14
  import type { BulkOperationResult, Collection, TypeWithID } from './collections/config/types.js';
15
15
  import type { Options as CountOptions } from './collections/operations/local/count.js';
16
16
  import type { Options as CreateOptions } from './collections/operations/local/create.js';
@@ -181,9 +181,7 @@ type GeneratedTypes = {
181
181
  [slug: number | string | symbol]: GlobalTypeWithID & Record<string, unknown>;
182
182
  };
183
183
  locale: null | string;
184
- user: TypeWithID & Record<string, unknown> & {
185
- collection: string;
186
- };
184
+ user: User;
187
185
  };
188
186
  type Payload = BasePayload<GeneratedTypes>;
189
187
  interface RequestContext {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,cAAc,CAAA;AAC5E,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAI5B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,KAAK,EAAE,MAAM,IAAI,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AACzF,OAAO,KAAK,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,2CAA2C,CAAA;AACjG,OAAO,KAAK,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAC/E,OAAO,KAAK,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,0CAA0C,CAAA;AAC/F,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,mCAAmC,CAAA;AACjF,OAAO,KAAK,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAC3F,OAAO,KAAK,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,MAAM,IAAI,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AACvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAChG,OAAO,KAAK,EAA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CAAA;IACD,MAAM,EAAE,IAAI,GAAG,MAAM,CAAA;IACrB,IAAI,EAAE,IAAI,CAAA;CACX,CAAA;AAED,KAAK,OAAO,GAAG,WAAW,CAAC,cAAc,CAAC,CAAA;AAE1C,UAAU,cAAc;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,KAAK,eAAe,GAAG,mBAAmB,CAAA;AAE1C,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,CAAA"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { ExecutionResult, GraphQLSchema, ValidationRule } from 'graphql'\nimport type { OperationArgs, Request as graphQLRequest } from 'graphql-http'\nimport type pino from 'pino'\n\nimport crypto from 'crypto'\n\nimport type { AuthArgs } from './auth/operations/auth.js'\nimport type { Result as ForgotPasswordResult } from './auth/operations/forgotPassword.js'\nimport type { Options as ForgotPasswordOptions } from './auth/operations/local/forgotPassword.js'\nimport type { Options as LoginOptions } from './auth/operations/local/login.js'\nimport type { Options as ResetPasswordOptions } from './auth/operations/local/resetPassword.js'\nimport type { Options as UnlockOptions } from './auth/operations/local/unlock.js'\nimport type { Options as VerifyEmailOptions } from './auth/operations/local/verifyEmail.js'\nimport type { Result as LoginResult } from './auth/operations/login.js'\nimport type { Result as ResetPasswordResult } from './auth/operations/resetPassword.js'\nimport type { AuthStrategy } from './auth/types.js'\nimport type { BulkOperationResult, Collection, TypeWithID } from './collections/config/types.js'\nimport type { Options as CountOptions } from './collections/operations/local/count.js'\nimport type { Options as CreateOptions } from './collections/operations/local/create.js'\nimport type {\n ByIDOptions as DeleteByIDOptions,\n ManyOptions as DeleteManyOptions,\n Options as DeleteOptions,\n} from './collections/operations/local/delete.js'\nimport type { Options as DuplicateOptions } from './collections/operations/local/duplicate.js'\nimport type { Options as FindOptions } from './collections/operations/local/find.js'\nimport type { Options as FindByIDOptions } from './collections/operations/local/findByID.js'\nimport type { Options as FindVersionByIDOptions } from './collections/operations/local/findVersionByID.js'\nimport type { Options as FindVersionsOptions } from './collections/operations/local/findVersions.js'\nimport type { Options as RestoreVersionOptions } from './collections/operations/local/restoreVersion.js'\nimport type {\n ByIDOptions as UpdateByIDOptions,\n ManyOptions as UpdateManyOptions,\n Options as UpdateOptions,\n} from './collections/operations/local/update.js'\nimport type { InitOptions, SanitizedConfig } from './config/types.js'\nimport type { BaseDatabaseAdapter, PaginatedDocs } from './database/types.js'\nimport type { InitializedEmailAdapter } from './email/types.js'\nimport type { TypeWithID as GlobalTypeWithID, Globals } from './globals/config/types.js'\nimport type { Options as FindGlobalOptions } from './globals/operations/local/findOne.js'\nimport type { Options as FindGlobalVersionByIDOptions } from './globals/operations/local/findVersionByID.js'\nimport type { Options as FindGlobalVersionsOptions } from './globals/operations/local/findVersions.js'\nimport type { Options as RestoreGlobalVersionOptions } from './globals/operations/local/restoreVersion.js'\nimport type { Options as UpdateGlobalOptions } from './globals/operations/local/update.js'\nimport type { TypeWithVersion } from './versions/types.js'\n\nimport { decrypt, encrypt } from './auth/crypto.js'\nimport { APIKeyAuthentication } from './auth/strategies/apiKey.js'\nimport { JWTAuthentication } from './auth/strategies/jwt.js'\nimport localOperations from './collections/operations/local/index.js'\nimport { validateSchema } from './config/validate.js'\nimport { consoleEmailAdapter } from './email/consoleEmailAdapter.js'\nimport { fieldAffectsData } from './fields/config/types.js'\nimport localGlobalOperations from './globals/operations/local/index.js'\nimport flattenFields from './utilities/flattenTopLevelFields.js'\nimport Logger from './utilities/logger.js'\nimport { serverInit as serverInitTelemetry } from './utilities/telemetry/events/serverInit.js'\n\n/**\n * @description Payload\n */\nexport class BasePayload<TGeneratedTypes extends GeneratedTypes> {\n /**\n * @description Authorization and Authentication using headers and cookies to run auth user strategies\n * @returns cookies: Map<string, string>\n * @returns permissions: Permissions\n * @returns user: User\n */\n auth = async (options: AuthArgs) => {\n const { auth } = localOperations.auth\n return auth(this, options)\n }\n\n authStrategies: AuthStrategy[]\n\n collections: {\n [slug: number | string | symbol]: Collection\n } = {}\n\n config: SanitizedConfig\n\n /**\n * @description Performs count operation\n * @param options\n * @returns count of documents satisfying query\n */\n count = async <T extends keyof TGeneratedTypes['collections']>(\n options: CountOptions<T>,\n ): Promise<{ totalDocs: number }> => {\n const { count } = localOperations\n return count(this, options)\n }\n\n /**\n * @description Performs create operation\n * @param options\n * @returns created document\n */\n create = async <T extends keyof TGeneratedTypes['collections']>(\n options: CreateOptions<T>,\n ): Promise<TGeneratedTypes['collections'][T]> => {\n const { create } = localOperations\n return create<T>(this, options)\n }\n db: DatabaseAdapter\n\n decrypt = decrypt\n\n duplicate = async <T extends keyof TGeneratedTypes['collections']>(\n options: DuplicateOptions<T>,\n ): Promise<TGeneratedTypes['collections'][T]> => {\n const { duplicate } = localOperations\n return duplicate<T>(this, options)\n }\n\n email: InitializedEmailAdapter\n\n // TODO: re-implement or remove?\n // errorHandler: ErrorHandler\n\n encrypt = encrypt\n\n extensions: (args: {\n args: OperationArgs<any>\n req: graphQLRequest<unknown, unknown>\n result: ExecutionResult\n }) => Promise<any>\n\n /**\n * @description Find documents with criteria\n * @param options\n * @returns documents satisfying query\n */\n find = async <T extends keyof TGeneratedTypes['collections']>(\n options: FindOptions<T>,\n ): Promise<PaginatedDocs<TGeneratedTypes['collections'][T]>> => {\n const { find } = localOperations\n return find<T>(this, options)\n }\n\n /**\n * @description Find document by ID\n * @param options\n * @returns document with specified ID\n */\n findByID = async <T extends keyof TGeneratedTypes['collections']>(\n options: FindByIDOptions<T>,\n ): Promise<TGeneratedTypes['collections'][T]> => {\n const { findByID } = localOperations\n return findByID<T>(this, options)\n }\n\n findGlobal = async <T extends keyof TGeneratedTypes['globals']>(\n options: FindGlobalOptions<T>,\n ): Promise<TGeneratedTypes['globals'][T]> => {\n const { findOne } = localGlobalOperations\n return findOne<T>(this, options)\n }\n\n /**\n * @description Find global version by ID\n * @param options\n * @returns global version with specified ID\n */\n findGlobalVersionByID = async <T extends keyof TGeneratedTypes['globals']>(\n options: FindGlobalVersionByIDOptions<T>,\n ): Promise<TypeWithVersion<TGeneratedTypes['globals'][T]>> => {\n const { findVersionByID } = localGlobalOperations\n return findVersionByID<T>(this, options)\n }\n\n /**\n * @description Find global versions with criteria\n * @param options\n * @returns versions satisfying query\n */\n findGlobalVersions = async <T extends keyof TGeneratedTypes['globals']>(\n options: FindGlobalVersionsOptions<T>,\n ): Promise<PaginatedDocs<TypeWithVersion<TGeneratedTypes['globals'][T]>>> => {\n const { findVersions } = localGlobalOperations\n return findVersions<T>(this, options)\n }\n\n /**\n * @description Find version by ID\n * @param options\n * @returns version with specified ID\n */\n findVersionByID = async <T extends keyof TGeneratedTypes['collections']>(\n options: FindVersionByIDOptions<T>,\n ): Promise<TypeWithVersion<TGeneratedTypes['collections'][T]>> => {\n const { findVersionByID } = localOperations\n return findVersionByID<T>(this, options)\n }\n\n /**\n * @description Find versions with criteria\n * @param options\n * @returns versions satisfying query\n */\n findVersions = async <T extends keyof TGeneratedTypes['collections']>(\n options: FindVersionsOptions<T>,\n ): Promise<PaginatedDocs<TypeWithVersion<TGeneratedTypes['collections'][T]>>> => {\n const { findVersions } = localOperations\n return findVersions<T>(this, options)\n }\n\n forgotPassword = async <T extends keyof TGeneratedTypes['collections']>(\n options: ForgotPasswordOptions<T>,\n ): Promise<ForgotPasswordResult> => {\n const { forgotPassword } = localOperations.auth\n return forgotPassword<T>(this, options)\n }\n\n getAPIURL = (): string => `${this.config.serverURL}${this.config.routes.api}`\n\n getAdminURL = (): string => `${this.config.serverURL}${this.config.routes.admin}`\n\n globals: Globals\n\n logger: pino.Logger\n\n login = async <T extends keyof TGeneratedTypes['collections']>(\n options: LoginOptions<T>,\n ): Promise<LoginResult & { user: TGeneratedTypes['collections'][T] }> => {\n const { login } = localOperations.auth\n return login<T>(this, options)\n }\n\n resetPassword = async <T extends keyof TGeneratedTypes['collections']>(\n options: ResetPasswordOptions<T>,\n ): Promise<ResetPasswordResult> => {\n const { resetPassword } = localOperations.auth\n return resetPassword<T>(this, options)\n }\n\n /**\n * @description Restore global version by ID\n * @param options\n * @returns version with specified ID\n */\n restoreGlobalVersion = async <T extends keyof TGeneratedTypes['globals']>(\n options: RestoreGlobalVersionOptions<T>,\n ): Promise<TGeneratedTypes['globals'][T]> => {\n const { restoreVersion } = localGlobalOperations\n return restoreVersion<T>(this, options)\n }\n\n /**\n * @description Restore version by ID\n * @param options\n * @returns version with specified ID\n */\n restoreVersion = async <T extends keyof TGeneratedTypes['collections']>(\n options: RestoreVersionOptions<T>,\n ): Promise<TGeneratedTypes['collections'][T]> => {\n const { restoreVersion } = localOperations\n return restoreVersion<T>(this, options)\n }\n\n schema: GraphQLSchema\n\n secret: string\n\n sendEmail: InitializedEmailAdapter['sendEmail']\n\n types: {\n arrayTypes: any\n blockInputTypes: any\n blockTypes: any\n fallbackLocaleInputType?: any\n groupTypes: any\n localeInputType?: any\n tabTypes: any\n }\n\n unlock = async <T extends keyof TGeneratedTypes['collections']>(\n options: UnlockOptions<T>,\n ): Promise<boolean> => {\n const { unlock } = localOperations.auth\n return unlock(this, options)\n }\n\n updateGlobal = async <T extends keyof TGeneratedTypes['globals']>(\n options: UpdateGlobalOptions<T>,\n ): Promise<TGeneratedTypes['globals'][T]> => {\n const { update } = localGlobalOperations\n return update<T>(this, options)\n }\n\n validationRules: (args: OperationArgs<any>) => ValidationRule[]\n\n verifyEmail = async <T extends keyof TGeneratedTypes['collections']>(\n options: VerifyEmailOptions<T>,\n ): Promise<boolean> => {\n const { verifyEmail } = localOperations.auth\n return verifyEmail(this, options)\n }\n\n versions: {\n [slug: string]: any // TODO: Type this\n } = {}\n\n /**\n * @description delete one or more documents\n * @param options\n * @returns Updated document(s)\n */\n delete<T extends keyof TGeneratedTypes['collections']>(\n options: DeleteByIDOptions<T>,\n ): Promise<TGeneratedTypes['collections'][T]>\n\n delete<T extends keyof TGeneratedTypes['collections']>(\n options: DeleteManyOptions<T>,\n ): Promise<BulkOperationResult<T>>\n\n delete<T extends keyof TGeneratedTypes['collections']>(\n options: DeleteOptions<T>,\n ): Promise<BulkOperationResult<T> | TGeneratedTypes['collections'][T]> {\n const { deleteLocal } = localOperations\n return deleteLocal<T>(this, options)\n }\n\n /**\n * @description Initializes Payload\n * @param options\n */\n async init(options: InitOptions): Promise<Payload> {\n if (!options?.config) {\n throw new Error('Error: the payload config is required to initialize payload.')\n }\n\n this.logger = Logger('payload', options.loggerOptions, options.loggerDestination)\n\n this.config = await options.config\n\n if (process.env.NODE_ENV !== 'production') {\n validateSchema(this.config, this.logger)\n }\n\n if (!this.config.secret) {\n throw new Error('Error: missing secret key. A secret key is needed to secure Payload.')\n }\n\n this.secret = crypto.createHash('sha256').update(this.config.secret).digest('hex').slice(0, 32)\n\n this.globals = {\n config: this.config.globals,\n }\n\n this.config.collections.forEach((collection) => {\n const customID = flattenFields(collection.fields).find(\n (field) => fieldAffectsData(field) && field.name === 'id',\n )\n\n let customIDType\n\n if (customID?.type === 'number' || customID?.type === 'text') customIDType = customID.type\n\n this.collections[collection.slug] = {\n config: collection,\n customIDType,\n }\n })\n\n this.db = this.config.db.init({ payload: this })\n this.db.payload = this\n\n if (this.db?.init) {\n await this.db.init()\n }\n\n if (!options.disableDBConnect && this.db.connect) {\n await this.db.connect()\n }\n\n // Load email adapter\n if (this.config.email instanceof Promise) {\n const awaitedAdapter = await this.config.email\n this.email = awaitedAdapter({ payload: this })\n } else if (this.config.email) {\n this.email = this.config.email({ payload: this })\n } else {\n this.logger.warn(\n `No email adapter provided. Email will be written to console. More info at https://payloadcms.com/docs/email/overview.`,\n )\n\n this.email = consoleEmailAdapter({ payload: this })\n }\n\n this.sendEmail = this.email['sendEmail']\n\n serverInitTelemetry(this)\n\n // 1. loop over collections, if collection has auth strategy, initialize and push to array\n let jwtStrategyEnabled = false\n this.authStrategies = this.config.collections.reduce((authStrategies, collection) => {\n if (collection?.auth) {\n if (collection.auth.strategies.length > 0) {\n authStrategies.push(...collection.auth.strategies)\n }\n\n // 2. if api key enabled, push api key strategy into the array\n if (collection.auth?.useAPIKey) {\n authStrategies.push({\n name: `${collection.slug}-api-key`,\n authenticate: APIKeyAuthentication(collection),\n })\n }\n\n // 3. if localStrategy flag is true\n if (!collection.auth.disableLocalStrategy && !jwtStrategyEnabled) {\n jwtStrategyEnabled = true\n }\n }\n\n return authStrategies\n }, [] as AuthStrategy[])\n\n // 4. if enabled, push jwt strategy into authStrategies last\n if (jwtStrategyEnabled) {\n this.authStrategies.push({\n name: 'local-jwt',\n authenticate: JWTAuthentication,\n })\n }\n\n if (!options.disableOnInit) {\n if (typeof options.onInit === 'function') await options.onInit(this)\n if (typeof this.config.onInit === 'function') await this.config.onInit(this)\n }\n\n return this\n }\n\n update<T extends keyof TGeneratedTypes['collections']>(\n options: UpdateManyOptions<T>,\n ): Promise<BulkOperationResult<T>>\n\n /**\n * @description Update one or more documents\n * @param options\n * @returns Updated document(s)\n */\n update<T extends keyof TGeneratedTypes['collections']>(\n options: UpdateByIDOptions<T>,\n ): Promise<TGeneratedTypes['collections'][T]>\n\n update<T extends keyof TGeneratedTypes['collections']>(\n options: UpdateOptions<T>,\n ): Promise<BulkOperationResult<T> | TGeneratedTypes['collections'][T]> {\n const { update } = localOperations\n return update<T>(this, options)\n }\n}\n\nconst initialized = new BasePayload()\n\nexport default initialized\n\nlet cached = global._payload\n\nif (!cached) {\n // eslint-disable-next-line no-multi-assign\n cached = global._payload = { payload: null, promise: null }\n}\n\nexport const getPayload = async (options: InitOptions): Promise<BasePayload<GeneratedTypes>> => {\n if (!options?.config) {\n throw new Error('Error: the payload config is required for getPayload to work.')\n }\n\n if (cached.payload) {\n return cached.payload\n }\n\n if (!cached.promise) {\n cached.promise = new BasePayload<GeneratedTypes>().init(options)\n }\n\n try {\n cached.payload = await cached.promise\n } catch (e) {\n cached.promise = null\n throw e\n }\n\n return cached.payload\n}\n\ntype GeneratedTypes = {\n collections: {\n [slug: number | string | symbol]: TypeWithID & Record<string, unknown>\n }\n globals: {\n [slug: number | string | symbol]: GlobalTypeWithID & Record<string, unknown>\n }\n locale: null | string\n user: TypeWithID & Record<string, unknown> & { collection: string }\n}\n\ntype Payload = BasePayload<GeneratedTypes>\n\ninterface RequestContext {\n [key: string]: unknown\n}\n\ntype DatabaseAdapter = BaseDatabaseAdapter\n\nexport type { DatabaseAdapter, GeneratedTypes, Payload, RequestContext }\n"],"names":["crypto","decrypt","encrypt","APIKeyAuthentication","JWTAuthentication","localOperations","validateSchema","consoleEmailAdapter","fieldAffectsData","localGlobalOperations","flattenFields","Logger","serverInit","serverInitTelemetry","BasePayload","auth","options","authStrategies","collections","config","count","create","db","duplicate","email","extensions","find","findByID","findGlobal","findOne","findGlobalVersionByID","findVersionByID","findGlobalVersions","findVersions","forgotPassword","getAPIURL","serverURL","routes","api","getAdminURL","admin","globals","logger","login","resetPassword","restoreGlobalVersion","restoreVersion","schema","secret","sendEmail","types","unlock","updateGlobal","update","validationRules","verifyEmail","versions","delete","deleteLocal","init","Error","loggerOptions","loggerDestination","process","env","NODE_ENV","createHash","digest","slice","forEach","collection","customID","fields","field","name","customIDType","type","slug","payload","disableDBConnect","connect","Promise","awaitedAdapter","warn","jwtStrategyEnabled","reduce","strategies","length","push","useAPIKey","authenticate","disableLocalStrategy","disableOnInit","onInit","initialized","cached","global","_payload","promise","getPayload","e"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,OAAOA,YAAY,SAAQ;AA0C3B,SAASC,OAAO,EAAEC,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YACtB,IAAI,CAACnE,cAAc,CAACuE,IAAI,CAAC;gBACvBd,MAAM;gBACNgB,cAActF;YAChB;QACF;QAEA,IAAI,CAACY,QAAQ4E,aAAa,EAAE;YAC1B,IAAI,OAAO5E,QAAQ6E,MAAM,KAAK,YAAY,MAAM7E,QAAQ6E,MAAM,CAAC,IAAI;YACnE,IAAI,OAAO,IAAI,CAAC1E,MAAM,CAAC0E,MAAM,KAAK,YAAY,MAAM,IAAI,CAAC1E,MAAM,CAAC0E,MAAM,CAAC,IAAI;QAC7E;QAEA,OAAO,IAAI;IACb;IAeAxC,OACErC,OAAyB,EAC4C;QACrE,MAAM,EAAEqC,MAAM,EAAE,GAAGhD;QACnB,OAAOgD,OAAU,IAAI,EAAErC;IACzB;AACF;AAEA,MAAM8E,cAAc,IAAIhF;AAExB,eAAegF,YAAW;AAE1B,IAAIC,SAASC,OAAOC,QAAQ;AAE5B,IAAI,CAACF,QAAQ;IACX,2CAA2C;IAC3CA,SAASC,OAAOC,QAAQ,GAAG;QAAEnB,SAAS;QAAMoB,SAAS;IAAK;AAC5D;AAEA,OAAO,MAAMC,aAAa,OAAOnF;IAC/B,IAAI,CAACA,SAASG,QAAQ;QACpB,MAAM,IAAIyC,MAAM;IAClB;IAEA,IAAImC,OAAOjB,OAAO,EAAE;QAClB,OAAOiB,OAAOjB,OAAO;IACvB;IAEA,IAAI,CAACiB,OAAOG,OAAO,EAAE;QACnBH,OAAOG,OAAO,GAAG,IAAIpF,cAA8B6C,IAAI,CAAC3C;IAC1D;IAEA,IAAI;QACF+E,OAAOjB,OAAO,GAAG,MAAMiB,OAAOG,OAAO;IACvC,EAAE,OAAOE,GAAG;QACVL,OAAOG,OAAO,GAAG;QACjB,MAAME;IACR;IAEA,OAAOL,OAAOjB,OAAO;AACvB,EAAC"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { ExecutionResult, GraphQLSchema, ValidationRule } from 'graphql'\nimport type { OperationArgs, Request as graphQLRequest } from 'graphql-http'\nimport type pino from 'pino'\n\nimport crypto from 'crypto'\n\nimport type { AuthArgs } from './auth/operations/auth.js'\nimport type { Result as ForgotPasswordResult } from './auth/operations/forgotPassword.js'\nimport type { Options as ForgotPasswordOptions } from './auth/operations/local/forgotPassword.js'\nimport type { Options as LoginOptions } from './auth/operations/local/login.js'\nimport type { Options as ResetPasswordOptions } from './auth/operations/local/resetPassword.js'\nimport type { Options as UnlockOptions } from './auth/operations/local/unlock.js'\nimport type { Options as VerifyEmailOptions } from './auth/operations/local/verifyEmail.js'\nimport type { Result as LoginResult } from './auth/operations/login.js'\nimport type { Result as ResetPasswordResult } from './auth/operations/resetPassword.js'\nimport type { AuthStrategy, User } from './auth/types.js'\nimport type { BulkOperationResult, Collection, TypeWithID } from './collections/config/types.js'\nimport type { Options as CountOptions } from './collections/operations/local/count.js'\nimport type { Options as CreateOptions } from './collections/operations/local/create.js'\nimport type {\n ByIDOptions as DeleteByIDOptions,\n ManyOptions as DeleteManyOptions,\n Options as DeleteOptions,\n} from './collections/operations/local/delete.js'\nimport type { Options as DuplicateOptions } from './collections/operations/local/duplicate.js'\nimport type { Options as FindOptions } from './collections/operations/local/find.js'\nimport type { Options as FindByIDOptions } from './collections/operations/local/findByID.js'\nimport type { Options as FindVersionByIDOptions } from './collections/operations/local/findVersionByID.js'\nimport type { Options as FindVersionsOptions } from './collections/operations/local/findVersions.js'\nimport type { Options as RestoreVersionOptions } from './collections/operations/local/restoreVersion.js'\nimport type {\n ByIDOptions as UpdateByIDOptions,\n ManyOptions as UpdateManyOptions,\n Options as UpdateOptions,\n} from './collections/operations/local/update.js'\nimport type { InitOptions, SanitizedConfig } from './config/types.js'\nimport type { BaseDatabaseAdapter, PaginatedDocs } from './database/types.js'\nimport type { InitializedEmailAdapter } from './email/types.js'\nimport type { TypeWithID as GlobalTypeWithID, Globals } from './globals/config/types.js'\nimport type { Options as FindGlobalOptions } from './globals/operations/local/findOne.js'\nimport type { Options as FindGlobalVersionByIDOptions } from './globals/operations/local/findVersionByID.js'\nimport type { Options as FindGlobalVersionsOptions } from './globals/operations/local/findVersions.js'\nimport type { Options as RestoreGlobalVersionOptions } from './globals/operations/local/restoreVersion.js'\nimport type { Options as UpdateGlobalOptions } from './globals/operations/local/update.js'\nimport type { TypeWithVersion } from './versions/types.js'\n\nimport { decrypt, encrypt } from './auth/crypto.js'\nimport { APIKeyAuthentication } from './auth/strategies/apiKey.js'\nimport { JWTAuthentication } from './auth/strategies/jwt.js'\nimport localOperations from './collections/operations/local/index.js'\nimport { validateSchema } from './config/validate.js'\nimport { consoleEmailAdapter } from './email/consoleEmailAdapter.js'\nimport { fieldAffectsData } from './fields/config/types.js'\nimport localGlobalOperations from './globals/operations/local/index.js'\nimport flattenFields from './utilities/flattenTopLevelFields.js'\nimport Logger from './utilities/logger.js'\nimport { serverInit as serverInitTelemetry } from './utilities/telemetry/events/serverInit.js'\n\n/**\n * @description Payload\n */\nexport class BasePayload<TGeneratedTypes extends GeneratedTypes> {\n /**\n * @description Authorization and Authentication using headers and cookies to run auth user strategies\n * @returns cookies: Map<string, string>\n * @returns permissions: Permissions\n * @returns user: User\n */\n auth = async (options: AuthArgs) => {\n const { auth } = localOperations.auth\n return auth(this, options)\n }\n\n authStrategies: AuthStrategy[]\n\n collections: {\n [slug: number | string | symbol]: Collection\n } = {}\n\n config: SanitizedConfig\n\n /**\n * @description Performs count operation\n * @param options\n * @returns count of documents satisfying query\n */\n count = async <T extends keyof TGeneratedTypes['collections']>(\n options: CountOptions<T>,\n ): Promise<{ totalDocs: number }> => {\n const { count } = localOperations\n return count(this, options)\n }\n\n /**\n * @description Performs create operation\n * @param options\n * @returns created document\n */\n create = async <T extends keyof TGeneratedTypes['collections']>(\n options: CreateOptions<T>,\n ): Promise<TGeneratedTypes['collections'][T]> => {\n const { create } = localOperations\n return create<T>(this, options)\n }\n db: DatabaseAdapter\n\n decrypt = decrypt\n\n duplicate = async <T extends keyof TGeneratedTypes['collections']>(\n options: DuplicateOptions<T>,\n ): Promise<TGeneratedTypes['collections'][T]> => {\n const { duplicate } = localOperations\n return duplicate<T>(this, options)\n }\n\n email: InitializedEmailAdapter\n\n // TODO: re-implement or remove?\n // errorHandler: ErrorHandler\n\n encrypt = encrypt\n\n extensions: (args: {\n args: OperationArgs<any>\n req: graphQLRequest<unknown, unknown>\n result: ExecutionResult\n }) => Promise<any>\n\n /**\n * @description Find documents with criteria\n * @param options\n * @returns documents satisfying query\n */\n find = async <T extends keyof TGeneratedTypes['collections']>(\n options: FindOptions<T>,\n ): Promise<PaginatedDocs<TGeneratedTypes['collections'][T]>> => {\n const { find } = localOperations\n return find<T>(this, options)\n }\n\n /**\n * @description Find document by ID\n * @param options\n * @returns document with specified ID\n */\n findByID = async <T extends keyof TGeneratedTypes['collections']>(\n options: FindByIDOptions<T>,\n ): Promise<TGeneratedTypes['collections'][T]> => {\n const { findByID } = localOperations\n return findByID<T>(this, options)\n }\n\n findGlobal = async <T extends keyof TGeneratedTypes['globals']>(\n options: FindGlobalOptions<T>,\n ): Promise<TGeneratedTypes['globals'][T]> => {\n const { findOne } = localGlobalOperations\n return findOne<T>(this, options)\n }\n\n /**\n * @description Find global version by ID\n * @param options\n * @returns global version with specified ID\n */\n findGlobalVersionByID = async <T extends keyof TGeneratedTypes['globals']>(\n options: FindGlobalVersionByIDOptions<T>,\n ): Promise<TypeWithVersion<TGeneratedTypes['globals'][T]>> => {\n const { findVersionByID } = localGlobalOperations\n return findVersionByID<T>(this, options)\n }\n\n /**\n * @description Find global versions with criteria\n * @param options\n * @returns versions satisfying query\n */\n findGlobalVersions = async <T extends keyof TGeneratedTypes['globals']>(\n options: FindGlobalVersionsOptions<T>,\n ): Promise<PaginatedDocs<TypeWithVersion<TGeneratedTypes['globals'][T]>>> => {\n const { findVersions } = localGlobalOperations\n return findVersions<T>(this, options)\n }\n\n /**\n * @description Find version by ID\n * @param options\n * @returns version with specified ID\n */\n findVersionByID = async <T extends keyof TGeneratedTypes['collections']>(\n options: FindVersionByIDOptions<T>,\n ): Promise<TypeWithVersion<TGeneratedTypes['collections'][T]>> => {\n const { findVersionByID } = localOperations\n return findVersionByID<T>(this, options)\n }\n\n /**\n * @description Find versions with criteria\n * @param options\n * @returns versions satisfying query\n */\n findVersions = async <T extends keyof TGeneratedTypes['collections']>(\n options: FindVersionsOptions<T>,\n ): Promise<PaginatedDocs<TypeWithVersion<TGeneratedTypes['collections'][T]>>> => {\n const { findVersions } = localOperations\n return findVersions<T>(this, options)\n }\n\n forgotPassword = async <T extends keyof TGeneratedTypes['collections']>(\n options: ForgotPasswordOptions<T>,\n ): Promise<ForgotPasswordResult> => {\n const { forgotPassword } = localOperations.auth\n return forgotPassword<T>(this, options)\n }\n\n getAPIURL = (): string => `${this.config.serverURL}${this.config.routes.api}`\n\n getAdminURL = (): string => `${this.config.serverURL}${this.config.routes.admin}`\n\n globals: Globals\n\n logger: pino.Logger\n\n login = async <T extends keyof TGeneratedTypes['collections']>(\n options: LoginOptions<T>,\n ): Promise<LoginResult & { user: TGeneratedTypes['collections'][T] }> => {\n const { login } = localOperations.auth\n return login<T>(this, options)\n }\n\n resetPassword = async <T extends keyof TGeneratedTypes['collections']>(\n options: ResetPasswordOptions<T>,\n ): Promise<ResetPasswordResult> => {\n const { resetPassword } = localOperations.auth\n return resetPassword<T>(this, options)\n }\n\n /**\n * @description Restore global version by ID\n * @param options\n * @returns version with specified ID\n */\n restoreGlobalVersion = async <T extends keyof TGeneratedTypes['globals']>(\n options: RestoreGlobalVersionOptions<T>,\n ): Promise<TGeneratedTypes['globals'][T]> => {\n const { restoreVersion } = localGlobalOperations\n return restoreVersion<T>(this, options)\n }\n\n /**\n * @description Restore version by ID\n * @param options\n * @returns version with specified ID\n */\n restoreVersion = async <T extends keyof TGeneratedTypes['collections']>(\n options: RestoreVersionOptions<T>,\n ): Promise<TGeneratedTypes['collections'][T]> => {\n const { restoreVersion } = localOperations\n return restoreVersion<T>(this, options)\n }\n\n schema: GraphQLSchema\n\n secret: string\n\n sendEmail: InitializedEmailAdapter['sendEmail']\n\n types: {\n arrayTypes: any\n blockInputTypes: any\n blockTypes: any\n fallbackLocaleInputType?: any\n groupTypes: any\n localeInputType?: any\n tabTypes: any\n }\n\n unlock = async <T extends keyof TGeneratedTypes['collections']>(\n options: UnlockOptions<T>,\n ): Promise<boolean> => {\n const { unlock } = localOperations.auth\n return unlock(this, options)\n }\n\n updateGlobal = async <T extends keyof TGeneratedTypes['globals']>(\n options: UpdateGlobalOptions<T>,\n ): Promise<TGeneratedTypes['globals'][T]> => {\n const { update } = localGlobalOperations\n return update<T>(this, options)\n }\n\n validationRules: (args: OperationArgs<any>) => ValidationRule[]\n\n verifyEmail = async <T extends keyof TGeneratedTypes['collections']>(\n options: VerifyEmailOptions<T>,\n ): Promise<boolean> => {\n const { verifyEmail } = localOperations.auth\n return verifyEmail(this, options)\n }\n\n versions: {\n [slug: string]: any // TODO: Type this\n } = {}\n\n /**\n * @description delete one or more documents\n * @param options\n * @returns Updated document(s)\n */\n delete<T extends keyof TGeneratedTypes['collections']>(\n options: DeleteByIDOptions<T>,\n ): Promise<TGeneratedTypes['collections'][T]>\n\n delete<T extends keyof TGeneratedTypes['collections']>(\n options: DeleteManyOptions<T>,\n ): Promise<BulkOperationResult<T>>\n\n delete<T extends keyof TGeneratedTypes['collections']>(\n options: DeleteOptions<T>,\n ): Promise<BulkOperationResult<T> | TGeneratedTypes['collections'][T]> {\n const { deleteLocal } = localOperations\n return deleteLocal<T>(this, options)\n }\n\n /**\n * @description Initializes Payload\n * @param options\n */\n async init(options: InitOptions): Promise<Payload> {\n if (!options?.config) {\n throw new Error('Error: the payload config is required to initialize payload.')\n }\n\n this.logger = Logger('payload', options.loggerOptions, options.loggerDestination)\n\n this.config = await options.config\n\n if (process.env.NODE_ENV !== 'production') {\n validateSchema(this.config, this.logger)\n }\n\n if (!this.config.secret) {\n throw new Error('Error: missing secret key. A secret key is needed to secure Payload.')\n }\n\n this.secret = crypto.createHash('sha256').update(this.config.secret).digest('hex').slice(0, 32)\n\n this.globals = {\n config: this.config.globals,\n }\n\n this.config.collections.forEach((collection) => {\n const customID = flattenFields(collection.fields).find(\n (field) => fieldAffectsData(field) && field.name === 'id',\n )\n\n let customIDType\n\n if (customID?.type === 'number' || customID?.type === 'text') customIDType = customID.type\n\n this.collections[collection.slug] = {\n config: collection,\n customIDType,\n }\n })\n\n this.db = this.config.db.init({ payload: this })\n this.db.payload = this\n\n if (this.db?.init) {\n await this.db.init()\n }\n\n if (!options.disableDBConnect && this.db.connect) {\n await this.db.connect()\n }\n\n // Load email adapter\n if (this.config.email instanceof Promise) {\n const awaitedAdapter = await this.config.email\n this.email = awaitedAdapter({ payload: this })\n } else if (this.config.email) {\n this.email = this.config.email({ payload: this })\n } else {\n this.logger.warn(\n `No email adapter provided. Email will be written to console. More info at https://payloadcms.com/docs/email/overview.`,\n )\n\n this.email = consoleEmailAdapter({ payload: this })\n }\n\n this.sendEmail = this.email['sendEmail']\n\n serverInitTelemetry(this)\n\n // 1. loop over collections, if collection has auth strategy, initialize and push to array\n let jwtStrategyEnabled = false\n this.authStrategies = this.config.collections.reduce((authStrategies, collection) => {\n if (collection?.auth) {\n if (collection.auth.strategies.length > 0) {\n authStrategies.push(...collection.auth.strategies)\n }\n\n // 2. if api key enabled, push api key strategy into the array\n if (collection.auth?.useAPIKey) {\n authStrategies.push({\n name: `${collection.slug}-api-key`,\n authenticate: APIKeyAuthentication(collection),\n })\n }\n\n // 3. if localStrategy flag is true\n if (!collection.auth.disableLocalStrategy && !jwtStrategyEnabled) {\n jwtStrategyEnabled = true\n }\n }\n\n return authStrategies\n }, [] as AuthStrategy[])\n\n // 4. if enabled, push jwt strategy into authStrategies last\n if (jwtStrategyEnabled) {\n this.authStrategies.push({\n name: 'local-jwt',\n authenticate: JWTAuthentication,\n })\n }\n\n if (!options.disableOnInit) {\n if (typeof options.onInit === 'function') await options.onInit(this)\n if (typeof this.config.onInit === 'function') await this.config.onInit(this)\n }\n\n return this\n }\n\n update<T extends keyof TGeneratedTypes['collections']>(\n options: UpdateManyOptions<T>,\n ): Promise<BulkOperationResult<T>>\n\n /**\n * @description Update one or more documents\n * @param options\n * @returns Updated document(s)\n */\n update<T extends keyof TGeneratedTypes['collections']>(\n options: UpdateByIDOptions<T>,\n ): Promise<TGeneratedTypes['collections'][T]>\n\n update<T extends keyof TGeneratedTypes['collections']>(\n options: UpdateOptions<T>,\n ): Promise<BulkOperationResult<T> | TGeneratedTypes['collections'][T]> {\n const { update } = localOperations\n return update<T>(this, options)\n }\n}\n\nconst initialized = new BasePayload()\n\nexport default initialized\n\nlet cached = global._payload\n\nif (!cached) {\n // eslint-disable-next-line no-multi-assign\n cached = global._payload = { payload: null, promise: null }\n}\n\nexport const getPayload = async (options: InitOptions): Promise<BasePayload<GeneratedTypes>> => {\n if (!options?.config) {\n throw new Error('Error: the payload config is required for getPayload to work.')\n }\n\n if (cached.payload) {\n return cached.payload\n }\n\n if (!cached.promise) {\n cached.promise = new BasePayload<GeneratedTypes>().init(options)\n }\n\n try {\n cached.payload = await cached.promise\n } catch (e) {\n cached.promise = null\n throw e\n }\n\n return cached.payload\n}\n\ntype GeneratedTypes = {\n collections: {\n [slug: number | string | symbol]: TypeWithID & Record<string, unknown>\n }\n globals: {\n [slug: number | string | symbol]: GlobalTypeWithID & Record<string, unknown>\n }\n locale: null | string\n user: User\n}\n\ntype Payload = BasePayload<GeneratedTypes>\n\ninterface RequestContext {\n [key: string]: unknown\n}\n\ntype DatabaseAdapter = BaseDatabaseAdapter\n\nexport type { DatabaseAdapter, GeneratedTypes, Payload, RequestContext }\n"],"names":["crypto","decrypt","encrypt","APIKeyAuthentication","JWTAuthentication","localOperations","validateSchema","consoleEmailAdapter","fieldAffectsData","localGlobalOperations","flattenFields","Logger","serverInit","serverInitTelemetry","BasePayload","auth","options","authStrategies","collections","config","count","create","db","duplicate","email","extensions","find","findByID","findGlobal","findOne","findGlobalVersionByID","findVersionByID","findGlobalVersions","findVersions","forgotPassword","getAPIURL","serverURL","routes","api","getAdminURL","admin","globals","logger","login","resetPassword","restoreGlobalVersion","restoreVersion","schema","secret","sendEmail","types","unlock","updateGlobal","update","validationRules","verifyEmail","versions","delete","deleteLocal","init","Error","loggerOptions","loggerDestination","process","env","NODE_ENV","createHash","digest","slice","forEach","collection","customID","fields","field","name","customIDType","type","slug","payload","disableDBConnect","connect","Promise","awaitedAdapter","warn","jwtStrategyEnabled","reduce","strategies","length","push","useAPIKey","authenticate","disableLocalStrategy","disableOnInit","onInit","initialized","cached","global","_payload","promise","getPayload","e"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,OAAOA,YAAY,SAAQ;AA0C3B,SAASC,OAAO,EAAEC,OAAO,QAAQ,mBAAkB;AACnD,SAASC,oBAAoB,QAAQ,8BAA6B;AAClE,SAASC,iBAAiB,QAAQ,2BAA0B;AAC5D,OAAOC,qBAAqB,0CAAyC;AACrE,SAASC,cAAc,QAAQ,uBAAsB;AACrD,SAASC,mBAAmB,QAAQ,iCAAgC;AACpE,SAASC,gBAAgB,QAAQ,2BAA0B;AAC3D,OAAOC,2BAA2B,sCAAqC;AACvE,OAAOC,mBAAmB,uCAAsC;AAChE,OAAOC,YAAY,wBAAuB;AAC1C,SAASC,cAAcC,mBAAmB,QAAQ,6CAA4C;AAE9F;;CAEC,GACD,OAAO,MAAMC;IACX;;;;;GAKC,GACDC,OAAO,OAAOC;QACZ,MAAM,EAAED,IAAI,EAAE,GAAGV,gBAAgBU,IAAI;QACrC,OAAOA,KAA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AExB,eAAegF,YAAW;AAE1B,IAAIC,SAASC,OAAOC,QAAQ;AAE5B,IAAI,CAACF,QAAQ;IACX,2CAA2C;IAC3CA,SAASC,OAAOC,QAAQ,GAAG;QAAEnB,SAAS;QAAMoB,SAAS;IAAK;AAC5D;AAEA,OAAO,MAAMC,aAAa,OAAOnF;IAC/B,IAAI,CAACA,SAASG,QAAQ;QACpB,MAAM,IAAIyC,MAAM;IAClB;IAEA,IAAImC,OAAOjB,OAAO,EAAE;QAClB,OAAOiB,OAAOjB,OAAO;IACvB;IAEA,IAAI,CAACiB,OAAOG,OAAO,EAAE;QACnBH,OAAOG,OAAO,GAAG,IAAIpF,cAA8B6C,IAAI,CAAC3C;IAC1D;IAEA,IAAI;QACF+E,OAAOjB,OAAO,GAAG,MAAMiB,OAAOG,OAAO;IACvC,EAAE,OAAOE,GAAG;QACVL,OAAOG,OAAO,GAAG;QACjB,MAAME;IACR;IAEA,OAAOL,OAAOjB,OAAO;AACvB,EAAC"}
@@ -18,7 +18,7 @@ export type UploadEdits = {
18
18
  y?: number;
19
19
  };
20
20
  };
21
- export type CustomPayloadRequestProperties<U = unknown> = {
21
+ export type CustomPayloadRequestProperties = {
22
22
  context: RequestContext;
23
23
  /** The locale that should be used for a field when it is not translated to the requested locale */
24
24
  fallbackLocale?: string;
@@ -58,8 +58,8 @@ export type CustomPayloadRequestProperties<U = unknown> = {
58
58
  * Used to ensure consistency when multiple operations try to create a transaction concurrently on the same request
59
59
  */
60
60
  transactionIDPromise?: Promise<void>;
61
- /** The signed in user */
62
- user: (U & GeneratedTypes['user']) | null;
61
+ /** The signed-in user */
62
+ user: GeneratedTypes['user'] | null;
63
63
  } & Pick<URL, 'hash' | 'host' | 'href' | 'origin' | 'pathname' | 'port' | 'protocol' | 'search' | 'searchParams'>;
64
64
  export type PayloadRequestData = {
65
65
  /** Data from the request body */
@@ -73,8 +73,8 @@ export type PayloadRequestData = {
73
73
  tempFilePath?: string;
74
74
  };
75
75
  };
76
- export type PayloadRequest<U = unknown> = Partial<Request> & Required<Pick<Request, 'headers'>> & CustomPayloadRequestProperties<U>;
77
- export type PayloadRequestWithData<U = unknown> = PayloadRequest<U> & PayloadRequestData;
76
+ export type PayloadRequest = Partial<Request> & Required<Pick<Request, 'headers'>> & CustomPayloadRequestProperties;
77
+ export type PayloadRequestWithData = PayloadRequest & PayloadRequestData;
78
78
  export interface RequestContext {
79
79
  [key: string]: unknown;
80
80
  }