payload 3.0.0-beta.100 → 3.0.0-beta.102

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.
Files changed (124) hide show
  1. package/dist/admin/RichText.d.ts +2 -2
  2. package/dist/admin/RichText.d.ts.map +1 -1
  3. package/dist/admin/RichText.js.map +1 -1
  4. package/dist/admin/fields/Array.d.ts +8 -3
  5. package/dist/admin/fields/Array.d.ts.map +1 -1
  6. package/dist/admin/fields/Array.js.map +1 -1
  7. package/dist/admin/fields/Blocks.d.ts +8 -3
  8. package/dist/admin/fields/Blocks.d.ts.map +1 -1
  9. package/dist/admin/fields/Blocks.js.map +1 -1
  10. package/dist/admin/fields/Checkbox.d.ts +8 -3
  11. package/dist/admin/fields/Checkbox.d.ts.map +1 -1
  12. package/dist/admin/fields/Checkbox.js.map +1 -1
  13. package/dist/admin/fields/Code.d.ts +9 -4
  14. package/dist/admin/fields/Code.d.ts.map +1 -1
  15. package/dist/admin/fields/Code.js.map +1 -1
  16. package/dist/admin/fields/Collapsible.d.ts +6 -2
  17. package/dist/admin/fields/Collapsible.d.ts.map +1 -1
  18. package/dist/admin/fields/Collapsible.js.map +1 -1
  19. package/dist/admin/fields/Date.d.ts +8 -3
  20. package/dist/admin/fields/Date.d.ts.map +1 -1
  21. package/dist/admin/fields/Date.js.map +1 -1
  22. package/dist/admin/fields/Email.d.ts +8 -3
  23. package/dist/admin/fields/Email.d.ts.map +1 -1
  24. package/dist/admin/fields/Email.js.map +1 -1
  25. package/dist/admin/fields/Group.d.ts +6 -2
  26. package/dist/admin/fields/Group.d.ts.map +1 -1
  27. package/dist/admin/fields/Group.js.map +1 -1
  28. package/dist/admin/fields/JSON.d.ts +8 -3
  29. package/dist/admin/fields/JSON.d.ts.map +1 -1
  30. package/dist/admin/fields/JSON.js.map +1 -1
  31. package/dist/admin/fields/Number.d.ts +8 -3
  32. package/dist/admin/fields/Number.d.ts.map +1 -1
  33. package/dist/admin/fields/Number.js.map +1 -1
  34. package/dist/admin/fields/Point.d.ts +8 -3
  35. package/dist/admin/fields/Point.d.ts.map +1 -1
  36. package/dist/admin/fields/Point.js.map +1 -1
  37. package/dist/admin/fields/Radio.d.ts +8 -3
  38. package/dist/admin/fields/Radio.d.ts.map +1 -1
  39. package/dist/admin/fields/Radio.js.map +1 -1
  40. package/dist/admin/fields/Relationship.d.ts +8 -3
  41. package/dist/admin/fields/Relationship.d.ts.map +1 -1
  42. package/dist/admin/fields/Relationship.js.map +1 -1
  43. package/dist/admin/fields/RichText.d.ts +8 -3
  44. package/dist/admin/fields/RichText.d.ts.map +1 -1
  45. package/dist/admin/fields/RichText.js.map +1 -1
  46. package/dist/admin/fields/Row.d.ts +8 -3
  47. package/dist/admin/fields/Row.d.ts.map +1 -1
  48. package/dist/admin/fields/Row.js.map +1 -1
  49. package/dist/admin/fields/Select.d.ts +8 -3
  50. package/dist/admin/fields/Select.d.ts.map +1 -1
  51. package/dist/admin/fields/Select.js.map +1 -1
  52. package/dist/admin/fields/Tabs.d.ts +8 -3
  53. package/dist/admin/fields/Tabs.d.ts.map +1 -1
  54. package/dist/admin/fields/Tabs.js.map +1 -1
  55. package/dist/admin/fields/Text.d.ts +8 -3
  56. package/dist/admin/fields/Text.d.ts.map +1 -1
  57. package/dist/admin/fields/Text.js.map +1 -1
  58. package/dist/admin/fields/Textarea.d.ts +8 -3
  59. package/dist/admin/fields/Textarea.d.ts.map +1 -1
  60. package/dist/admin/fields/Textarea.js.map +1 -1
  61. package/dist/admin/fields/Upload.d.ts +8 -3
  62. package/dist/admin/fields/Upload.d.ts.map +1 -1
  63. package/dist/admin/fields/Upload.js.map +1 -1
  64. package/dist/admin/forms/Description.d.ts +2 -4
  65. package/dist/admin/forms/Description.d.ts.map +1 -1
  66. package/dist/admin/forms/Description.js.map +1 -1
  67. package/dist/admin/forms/Error.d.ts +2 -4
  68. package/dist/admin/forms/Error.d.ts.map +1 -1
  69. package/dist/admin/forms/Error.js.map +1 -1
  70. package/dist/admin/forms/Field.d.ts +18 -7
  71. package/dist/admin/forms/Field.d.ts.map +1 -1
  72. package/dist/admin/forms/Field.js.map +1 -1
  73. package/dist/admin/forms/Label.d.ts +1 -3
  74. package/dist/admin/forms/Label.d.ts.map +1 -1
  75. package/dist/admin/forms/Label.js.map +1 -1
  76. package/dist/admin/types.d.ts +20 -20
  77. package/dist/admin/types.d.ts.map +1 -1
  78. package/dist/admin/types.js.map +1 -1
  79. package/dist/auth/operations/auth.d.ts.map +1 -1
  80. package/dist/auth/operations/auth.js +0 -6
  81. package/dist/auth/operations/auth.js.map +1 -1
  82. package/dist/auth/operations/login.d.ts.map +1 -1
  83. package/dist/auth/operations/login.js +0 -9
  84. package/dist/auth/operations/login.js.map +1 -1
  85. package/dist/collections/config/sanitize.d.ts.map +1 -1
  86. package/dist/collections/config/sanitize.js +2 -0
  87. package/dist/collections/config/sanitize.js.map +1 -1
  88. package/dist/collections/config/useAsTitle.d.ts +6 -0
  89. package/dist/collections/config/useAsTitle.d.ts.map +1 -0
  90. package/dist/collections/config/useAsTitle.js +33 -0
  91. package/dist/collections/config/useAsTitle.js.map +1 -0
  92. package/dist/collections/config/useAsTitle.spec.js +186 -0
  93. package/dist/collections/config/useAsTitle.spec.js.map +1 -0
  94. package/dist/collections/dataloader.js +2 -2
  95. package/dist/collections/dataloader.js.map +1 -1
  96. package/dist/fields/baseFields/baseBeforeDuplicateArrays.d.ts +6 -0
  97. package/dist/fields/baseFields/baseBeforeDuplicateArrays.d.ts.map +1 -0
  98. package/dist/fields/baseFields/baseBeforeDuplicateArrays.js +15 -0
  99. package/dist/fields/baseFields/baseBeforeDuplicateArrays.js.map +1 -0
  100. package/dist/fields/config/sanitize.d.ts.map +1 -1
  101. package/dist/fields/config/sanitize.js +19 -0
  102. package/dist/fields/config/sanitize.js.map +1 -1
  103. package/dist/fields/config/types.d.ts +2 -2
  104. package/dist/fields/config/types.d.ts.map +1 -1
  105. package/dist/fields/config/types.js.map +1 -1
  106. package/dist/preferences/operations/delete.d.ts +1 -2
  107. package/dist/preferences/operations/delete.d.ts.map +1 -1
  108. package/dist/preferences/operations/delete.js +2 -10
  109. package/dist/preferences/operations/delete.js.map +1 -1
  110. package/dist/preferences/operations/findOne.d.ts +1 -2
  111. package/dist/preferences/operations/findOne.d.ts.map +1 -1
  112. package/dist/preferences/operations/findOne.js +6 -3
  113. package/dist/preferences/operations/findOne.js.map +1 -1
  114. package/dist/preferences/operations/update.d.ts +1 -9
  115. package/dist/preferences/operations/update.d.ts.map +1 -1
  116. package/dist/preferences/operations/update.js +25 -24
  117. package/dist/preferences/operations/update.js.map +1 -1
  118. package/dist/preferences/requestHandlers/delete.js +1 -1
  119. package/dist/preferences/requestHandlers/delete.js.map +1 -1
  120. package/dist/preferences/requestHandlers/findOne.js +1 -1
  121. package/dist/preferences/requestHandlers/findOne.js.map +1 -1
  122. package/dist/preferences/requestHandlers/update.js +1 -1
  123. package/dist/preferences/requestHandlers/update.js.map +1 -1
  124. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/admin/forms/Field.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAA;AACnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AACvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAEvD,MAAM,MAAM,aAAa,CACvB,YAAY,SAAS,YAAY,CAAC,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AAY,SAAS,2BAA2B,GAAG,2BAA2B,EAC9E,eAAe,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IACvE,KAAK,CAAC,aAAa,CAAC,eAAe,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC,CAAA;AAExE,MAAM,MAAM,oBAAoB,CAC9B,YAAY,SAAS,KAAK,GAAG,KAAK,EAClC,eAAe,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IACvE,KAAK,CAAC,aAAa,CAAC,eAAe,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/admin/forms/Field.ts"],"sourcesContent":["import type { MarkOptional } from 'ts-essentials'\n\nimport type { User } from '../../auth/types.js'\nimport type { Locale } from '../../config/types.js'\nimport type { ClientField, Validate } from '../../fields/config/types.js'\nimport type { DocumentPreferences } from '../../preferences/types.js'\nimport type { FieldDescriptionClientProps } from './Description.js'\nimport type { FieldErrorClientProps } from './Error.js'\nimport type { FieldLabelClientProps } from './Label.js'\n\nexport type FormFieldBase<\n TFieldClient extends MarkOptional<ClientField, 'type'> = MarkOptional<ClientField, 'type'>,\n> = {\n readonly descriptionProps?: FieldDescriptionClientProps<TFieldClient>\n readonly docPreferences?: DocumentPreferences\n readonly errorProps?: FieldErrorClientProps<TFieldClient>\n readonly field: TFieldClient\n /**\n * `forceRender` is added by RenderField automatically.\n */\n readonly forceRender?: boolean\n readonly labelProps?: FieldLabelClientProps<TFieldClient>\n readonly locale?: Locale\n /**\n * `readOnly` is added by RenderField automatically. This should be used instead of `field.admin.readOnly`.\n */\n readonly readOnly?: boolean\n readonly user?: User\n readonly validate?: Validate\n}\n"],"names":[],"mappings":"AAUA,WAmBC"}
1
+ {"version":3,"sources":["../../../src/admin/forms/Field.ts"],"sourcesContent":["import type { MarkOptional } from 'ts-essentials'\n\nimport type { User } from '../../auth/types.js'\nimport type { Locale } from '../../config/types.js'\nimport type { ClientField, Field, Validate } from '../../fields/config/types.js'\nimport type { DocumentPreferences } from '../../preferences/types.js'\nimport type { FieldDescriptionClientProps, FieldDescriptionServerProps } from './Description.js'\nimport type { FieldErrorClientProps, FieldErrorServerProps } from './Error.js'\nimport type { FieldLabelClientProps, FieldLabelServerProps } from './Label.js'\n\nexport type ClientFieldWithOptionalType = MarkOptional<ClientField, 'type'>\n\nexport type ClientFieldBase<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n readonly descriptionProps?: FieldDescriptionClientProps<TFieldClient>\n readonly errorProps?: FieldErrorClientProps<TFieldClient>\n readonly field: TFieldClient\n readonly labelProps?: FieldLabelClientProps<TFieldClient>\n} & FormFieldBase\n\nexport type ServerFieldBase<TFieldServer extends Field = Field> = {\n readonly descriptionProps?: FieldDescriptionServerProps<TFieldServer>\n readonly errorProps?: FieldErrorServerProps<TFieldServer>\n readonly field: TFieldServer\n readonly labelProps?: FieldLabelServerProps<TFieldServer>\n} & FormFieldBase\n\nexport type FormFieldBase = {\n readonly docPreferences?: DocumentPreferences\n /**\n * `forceRender` is added by RenderField automatically.\n */\n readonly forceRender?: boolean\n readonly locale?: Locale\n /**\n * `readOnly` is added by RenderField automatically. This should be used instead of `field.admin.readOnly`.\n */\n readonly readOnly?: boolean\n readonly user?: User\n readonly validate?: Validate\n}\n\nexport type FieldClientComponent<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n AdditionalProps extends Record<string, unknown> = Record<string, unknown>,\n> = React.ComponentType<AdditionalProps & ClientFieldBase<TFieldClient>>\n\nexport type FieldServerComponent<\n TFieldServer extends Field = Field,\n AdditionalProps extends Record<string, unknown> = Record<string, unknown>,\n> = React.ComponentType<AdditionalProps & ServerFieldBase<TFieldServer>>\n"],"names":[],"mappings":"AAgDA,WAGwE"}
@@ -1,7 +1,7 @@
1
- import type { MarkOptional } from 'ts-essentials';
2
1
  import type { ServerProps, StaticLabel } from '../../config/types.js';
3
2
  import type { ClientField, Field } from '../../fields/config/types.js';
4
3
  import type { MappedComponent } from '../types.js';
4
+ import type { ClientFieldWithOptionalType } from './Field.js';
5
5
  export type GenericLabelProps = {
6
6
  readonly as?: 'label' | 'span';
7
7
  readonly htmlFor?: string;
@@ -10,7 +10,6 @@ export type GenericLabelProps = {
10
10
  readonly required?: boolean;
11
11
  readonly unstyled?: boolean;
12
12
  };
13
- type ClientFieldWithOptionalType = MarkOptional<ClientField, 'type'>;
14
13
  export type FieldLabelClientProps<TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType> = {
15
14
  field: TFieldClient;
16
15
  } & GenericLabelProps;
@@ -20,5 +19,4 @@ export type FieldLabelServerProps<TFieldServer extends Field> = {
20
19
  export type SanitizedLabelProps<TFieldClient extends ClientField> = Omit<FieldLabelClientProps<TFieldClient>, 'label' | 'required'>;
21
20
  export type FieldLabelClientComponent<TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType> = React.ComponentType<FieldLabelClientProps<TFieldClient>>;
22
21
  export type FieldLabelServerComponent<TFieldServer extends Field = Field> = React.ComponentType<FieldLabelServerProps<TFieldServer>>;
23
- export {};
24
22
  //# sourceMappingURL=Label.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Label.d.ts","sourceRoot":"","sources":["../../../src/admin/forms/Label.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,CAAC,EAAE,OAAO,GAAG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Optional } from 'ts-essentials'\n\nimport type { ServerProps, StaticLabel } from '../../config/types.js'\nimport type { ClientField, Field } from '../../fields/config/types.js'\nimport type { MappedComponent } from '../types.js'\n\nexport type GenericLabelProps = {\n readonly as?: 'label' | 'span'\n readonly htmlFor?: string\n readonly Label?: MappedComponent\n readonly label?: StaticLabel\n readonly required?: boolean\n readonly unstyled?: boolean\n}\n\ntype ClientFieldWithOptionalType = MarkOptional<ClientField, 'type'>\n\nexport type FieldLabelClientProps<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n field: TFieldClient\n} & GenericLabelProps\n\nexport type FieldLabelServerProps<TFieldServer extends Field> = {\n field: TFieldServer\n} & GenericLabelProps &\n Partial<ServerProps>\n\nexport type SanitizedLabelProps<TFieldClient extends ClientField> = Omit<\n FieldLabelClientProps<TFieldClient>,\n 'label' | 'required'\n>\n\nexport type FieldLabelClientComponent<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = React.ComponentType<FieldLabelClientProps<TFieldClient>>\n\nexport type FieldLabelServerComponent<TFieldServer extends Field = Field> = React.ComponentType<\n FieldLabelServerProps<TFieldServer>\n>\n"],"names":[],"mappings":"AAqCA,WAEC"}
1
+ {"version":3,"sources":["../../../src/admin/forms/Label.ts"],"sourcesContent":["import type { ServerProps, StaticLabel } from '../../config/types.js'\nimport type { ClientField, Field } from '../../fields/config/types.js'\nimport type { MappedComponent } from '../types.js'\nimport type { ClientFieldWithOptionalType } from './Field.js'\n\nexport type GenericLabelProps = {\n readonly as?: 'label' | 'span'\n readonly htmlFor?: string\n readonly Label?: MappedComponent\n readonly label?: StaticLabel\n readonly required?: boolean\n readonly unstyled?: boolean\n}\n\nexport type FieldLabelClientProps<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n field: TFieldClient\n} & GenericLabelProps\n\nexport type FieldLabelServerProps<TFieldServer extends Field> = {\n field: TFieldServer\n} & GenericLabelProps &\n Partial<ServerProps>\n\nexport type SanitizedLabelProps<TFieldClient extends ClientField> = Omit<\n FieldLabelClientProps<TFieldClient>,\n 'label' | 'required'\n>\n\nexport type FieldLabelClientComponent<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = React.ComponentType<FieldLabelClientProps<TFieldClient>>\n\nexport type FieldLabelServerComponent<TFieldServer extends Field = Field> = React.ComponentType<\n FieldLabelServerProps<TFieldServer>\n>\n"],"names":[],"mappings":"AAkCA,WAEC"}
@@ -11,27 +11,27 @@ export type { CustomSaveDraftButton } from './elements/SaveDraftButton.js';
11
11
  export type { DocumentTabComponent, DocumentTabCondition, DocumentTabConfig, DocumentTabProps, } from './elements/Tab.js';
12
12
  export type { CustomUpload } from './elements/Upload.js';
13
13
  export type { WithServerSidePropsComponent, WithServerSidePropsComponentProps, } from './elements/WithServerSideProps.js';
14
- export type { ArrayFieldDescriptionClientComponent, ArrayFieldDescriptionServerComponent, ArrayFieldErrorClientComponent, ArrayFieldErrorServerComponent, ArrayFieldLabelClientComponent, ArrayFieldLabelServerComponent, ArrayFieldProps, } from './fields/Array.js';
15
- export type { BlockFieldDescriptionClientComponent, BlockFieldDescriptionServerComponent, BlockFieldErrorClientComponent, BlockFieldErrorServerComponent, BlockFieldLabelClientComponent, BlockFieldLabelServerComponent, BlockFieldProps, } from './fields/Blocks.js';
16
- export type { CheckboxFieldDescriptionClientComponent, CheckboxFieldDescriptionServerComponent, CheckboxFieldErrorClientComponent, CheckboxFieldErrorServerComponent, CheckboxFieldLabelClientComponent, CheckboxFieldLabelServerComponent, CheckboxFieldProps, } from './fields/Checkbox.js';
17
- export type { CodeFieldDescriptionClientComponent, CodeFieldDescriptionServerComponent, CodeFieldErrorClientComponent, CodeFieldErrorServerComponent, CodeFieldLabelClientComponent, CodeFieldLabelServerComponent, CodeFieldProps, } from './fields/Code.js';
18
- export type { CollapsibleFieldDescriptionClientComponent, CollapsibleFieldDescriptionServerComponent, CollapsibleFieldErrorClientComponent, CollapsibleFieldErrorServerComponent, CollapsibleFieldLabelClientComponent, CollapsibleFieldLabelServerComponent, CollapsibleFieldProps, } from './fields/Collapsible.js';
19
- export type { DateFieldDescriptionClientComponent, DateFieldDescriptionServerComponent, DateFieldErrorClientComponent, DateFieldErrorServerComponent, DateFieldLabelClientComponent, DateFieldLabelServerComponent, DateFieldProps, } from './fields/Date.js';
20
- export type { EmailFieldDescriptionClientComponent, EmailFieldDescriptionServerComponent, EmailFieldErrorClientComponent, EmailFieldErrorServerComponent, EmailFieldLabelClientComponent, EmailFieldLabelServerComponent, EmailFieldProps, } from './fields/Email.js';
21
- export type { GroupFieldDescriptionClientComponent, GroupFieldDescriptionServerComponent, GroupFieldErrorClientComponent, GroupFieldErrorServerComponent, GroupFieldLabelClientComponent, GroupFieldLabelServerComponent, GroupFieldProps, } from './fields/Group.js';
14
+ export type { ArrayFieldClientComponent, ArrayFieldClientProps, ArrayFieldDescriptionClientComponent, ArrayFieldDescriptionServerComponent, ArrayFieldErrorClientComponent, ArrayFieldErrorServerComponent, ArrayFieldLabelClientComponent, ArrayFieldLabelServerComponent, ArrayFieldServerComponent, ArrayFieldServerProps, } from './fields/Array.js';
15
+ export type { BlockFieldDescriptionClientComponent, BlockFieldDescriptionServerComponent, BlockFieldErrorClientComponent, BlockFieldErrorServerComponent, BlockFieldLabelClientComponent, BlockFieldLabelServerComponent, BlocksFieldClientComponent, BlocksFieldClientProps, BlocksFieldServerComponent, BlocksFieldServerProps, } from './fields/Blocks.js';
16
+ export type { CheckboxFieldClientComponent, CheckboxFieldClientProps, CheckboxFieldDescriptionClientComponent, CheckboxFieldDescriptionServerComponent, CheckboxFieldErrorClientComponent, CheckboxFieldErrorServerComponent, CheckboxFieldLabelClientComponent, CheckboxFieldLabelServerComponent, CheckboxFieldServerComponent, CheckboxFieldServerProps, } from './fields/Checkbox.js';
17
+ export type { CodeFieldClientComponent, CodeFieldClientProps, CodeFieldDescriptionClientComponent, CodeFieldDescriptionServerComponent, CodeFieldErrorClientComponent, CodeFieldErrorServerComponent, CodeFieldLabelClientComponent, CodeFieldLabelServerComponent, CodeFieldServerComponent, CodeFieldServerProps, } from './fields/Code.js';
18
+ export type { CollapsibleFieldClientComponent, CollapsibleFieldClientProps, CollapsibleFieldDescriptionClientComponent, CollapsibleFieldDescriptionServerComponent, CollapsibleFieldErrorClientComponent, CollapsibleFieldErrorServerComponent, CollapsibleFieldLabelClientComponent, CollapsibleFieldLabelServerComponent, CollapsibleFieldServerComponent, CollapsibleFieldServerProps, } from './fields/Collapsible.js';
19
+ export type { DateFieldClientComponent, DateFieldClientProps, DateFieldDescriptionClientComponent, DateFieldDescriptionServerComponent, DateFieldErrorClientComponent, DateFieldErrorServerComponent, DateFieldLabelClientComponent, DateFieldLabelServerComponent, DateFieldServerComponent, DateFieldServerProps, } from './fields/Date.js';
20
+ export type { EmailFieldClientComponent, EmailFieldClientProps, EmailFieldDescriptionClientComponent, EmailFieldDescriptionServerComponent, EmailFieldErrorClientComponent, EmailFieldErrorServerComponent, EmailFieldLabelClientComponent, EmailFieldLabelServerComponent, EmailFieldServerComponent, EmailFieldServerProps, } from './fields/Email.js';
21
+ export type { GroupFieldClientComponent, GroupFieldClientProps, GroupFieldDescriptionClientComponent, GroupFieldDescriptionServerComponent, GroupFieldErrorClientComponent, GroupFieldErrorServerComponent, GroupFieldLabelClientComponent, GroupFieldLabelServerComponent, GroupFieldServerComponent, GroupFieldServerProps, } from './fields/Group.js';
22
22
  export type { HiddenFieldProps } from './fields/Hidden.js';
23
- export type { JSONFieldDescriptionClientComponent, JSONFieldDescriptionServerComponent, JSONFieldErrorClientComponent, JSONFieldErrorServerComponent, JSONFieldLabelClientComponent, JSONFieldLabelServerComponent, JSONFieldProps, } from './fields/JSON.js';
24
- export type { NumberFieldDescriptionClientComponent, NumberFieldDescriptionServerComponent, NumberFieldErrorClientComponent, NumberFieldErrorServerComponent, NumberFieldLabelClientComponent, NumberFieldLabelServerComponent, NumberFieldProps, } from './fields/Number.js';
25
- export type { PointFieldDescriptionClientComponent, PointFieldDescriptionServerComponent, PointFieldErrorClientComponent, PointFieldErrorServerComponent, PointFieldLabelClientComponent, PointFieldLabelServerComponent, PointFieldProps, } from './fields/Point.js';
26
- export type { RadioFieldDescriptionClientComponent, RadioFieldDescriptionServerComponent, RadioFieldErrorClientComponent, RadioFieldErrorServerComponent, RadioFieldLabelClientComponent, RadioFieldLabelServerComponent, RadioFieldProps, } from './fields/Radio.js';
27
- export type { RelationshipFieldDescriptionClientComponent, RelationshipFieldDescriptionServerComponent, RelationshipFieldErrorClientComponent, RelationshipFieldErrorServerComponent, RelationshipFieldLabelClientComponent, RelationshipFieldLabelServerComponent, RelationshipFieldProps, } from './fields/Relationship.js';
28
- export type { RichTextFieldDescriptionClientComponent, RichTextFieldDescriptionServerComponent, RichTextFieldErrorClientComponent, RichTextFieldErrorServerComponent, RichTextFieldLabelClientComponent, RichTextFieldLabelServerComponent, RichTextFieldProps, } from './fields/RichText.js';
29
- export type { RowFieldDescriptionClientComponent, RowFieldDescriptionServerComponent, RowFieldErrorClientComponent, RowFieldErrorServerComponent, RowFieldLabelClientComponent, RowFieldLabelServerComponent, RowFieldProps, } from './fields/Row.js';
30
- export type { SelectFieldDescriptionClientComponent, SelectFieldDescriptionServerComponent, SelectFieldErrorClientComponent, SelectFieldErrorServerComponent, SelectFieldLabelClientComponent, SelectFieldLabelServerComponent, SelectFieldProps, } from './fields/Select.js';
31
- export type { ClientTab, TabsFieldDescriptionClientComponent, TabsFieldDescriptionServerComponent, TabsFieldErrorClientComponent, TabsFieldErrorServerComponent, TabsFieldLabelClientComponent, TabsFieldLabelServerComponent, TabsFieldProps, } from './fields/Tabs.js';
32
- export type { TextFieldDescriptionClientComponent, TextFieldDescriptionServerComponent, TextFieldErrorClientComponent, TextFieldErrorServerComponent, TextFieldLabelClientComponent, TextFieldLabelServerComponent, TextFieldProps, } from './fields/Text.js';
33
- export type { TextareaFieldDescriptionClientComponent, TextareaFieldDescriptionServerComponent, TextareaFieldErrorClientComponent, TextareaFieldErrorServerComponent, TextareaFieldLabelClientComponent, TextareaFieldLabelServerComponent, TextareaFieldProps, } from './fields/Textarea.js';
34
- export type { UploadFieldDescriptionClientComponent, UploadFieldDescriptionServerComponent, UploadFieldErrorClientComponent, UploadFieldErrorServerComponent, UploadFieldLabelClientComponent, UploadFieldLabelServerComponent, UploadFieldProps, } from './fields/Upload.js';
23
+ export type { JSONFieldClientComponent, JSONFieldClientProps, JSONFieldDescriptionClientComponent, JSONFieldDescriptionServerComponent, JSONFieldErrorClientComponent, JSONFieldErrorServerComponent, JSONFieldLabelClientComponent, JSONFieldLabelServerComponent, JSONFieldServerComponent, JSONFieldServerProps, } from './fields/JSON.js';
24
+ export type { NumberFieldClientComponent, NumberFieldClientProps, NumberFieldDescriptionClientComponent, NumberFieldDescriptionServerComponent, NumberFieldErrorClientComponent, NumberFieldErrorServerComponent, NumberFieldLabelClientComponent, NumberFieldLabelServerComponent, NumberFieldServerComponent, NumberFieldServerProps, } from './fields/Number.js';
25
+ export type { PointFieldClientComponent, PointFieldClientProps, PointFieldDescriptionClientComponent, PointFieldDescriptionServerComponent, PointFieldErrorClientComponent, PointFieldErrorServerComponent, PointFieldLabelClientComponent, PointFieldLabelServerComponent, PointFieldServerComponent, PointFieldServerProps, } from './fields/Point.js';
26
+ export type { RadioFieldClientComponent, RadioFieldClientProps, RadioFieldDescriptionClientComponent, RadioFieldDescriptionServerComponent, RadioFieldErrorClientComponent, RadioFieldErrorServerComponent, RadioFieldLabelClientComponent, RadioFieldLabelServerComponent, RadioFieldServerComponent, RadioFieldServerProps, } from './fields/Radio.js';
27
+ export type { RelationshipFieldClientComponent, RelationshipFieldClientProps, RelationshipFieldDescriptionClientComponent, RelationshipFieldDescriptionServerComponent, RelationshipFieldErrorClientComponent, RelationshipFieldErrorServerComponent, RelationshipFieldLabelClientComponent, RelationshipFieldLabelServerComponent, RelationshipFieldServerComponent, RelationshipFieldServerProps, } from './fields/Relationship.js';
28
+ export type { RichTextFieldClientComponent, RichTextFieldClientProps, RichTextFieldDescriptionClientComponent, RichTextFieldDescriptionServerComponent, RichTextFieldErrorClientComponent, RichTextFieldErrorServerComponent, RichTextFieldLabelClientComponent, RichTextFieldLabelServerComponent, RichTextFieldServerComponent, RichTextFieldServerProps, } from './fields/RichText.js';
29
+ export type { RowFieldClientComponent, RowFieldClientProps, RowFieldDescriptionClientComponent, RowFieldDescriptionServerComponent, RowFieldErrorClientComponent, RowFieldErrorServerComponent, RowFieldLabelClientComponent, RowFieldLabelServerComponent, RowFieldServerComponent, RowFieldServerProps, } from './fields/Row.js';
30
+ export type { SelectFieldClientComponent, SelectFieldClientProps, SelectFieldDescriptionClientComponent, SelectFieldDescriptionServerComponent, SelectFieldErrorClientComponent, SelectFieldErrorServerComponent, SelectFieldLabelClientComponent, SelectFieldLabelServerComponent, SelectFieldServerComponent, SelectFieldServerProps, } from './fields/Select.js';
31
+ export type { ClientTab, TabsFieldClientComponent, TabsFieldClientProps, TabsFieldDescriptionClientComponent, TabsFieldDescriptionServerComponent, TabsFieldErrorClientComponent, TabsFieldErrorServerComponent, TabsFieldLabelClientComponent, TabsFieldLabelServerComponent, TabsFieldServerComponent, TabsFieldServerProps, } from './fields/Tabs.js';
32
+ export type { TextFieldClientComponent, TextFieldClientProps, TextFieldDescriptionClientComponent, TextFieldDescriptionServerComponent, TextFieldErrorClientComponent, TextFieldErrorServerComponent, TextFieldLabelClientComponent, TextFieldLabelServerComponent, TextFieldServerComponent, TextFieldServerProps, } from './fields/Text.js';
33
+ export type { TextareaFieldClientComponent, TextareaFieldClientProps, TextareaFieldDescriptionClientComponent, TextareaFieldDescriptionServerComponent, TextareaFieldErrorClientComponent, TextareaFieldErrorServerComponent, TextareaFieldLabelClientComponent, TextareaFieldLabelServerComponent, TextareaFieldServerComponent, TextareaFieldServerProps, } from './fields/Textarea.js';
34
+ export type { UploadFieldClientComponent, UploadFieldClientProps, UploadFieldDescriptionClientComponent, UploadFieldDescriptionServerComponent, UploadFieldErrorClientComponent, UploadFieldErrorServerComponent, UploadFieldLabelClientComponent, UploadFieldLabelServerComponent, UploadFieldServerComponent, UploadFieldServerProps, } from './fields/Upload.js';
35
35
  export type { Description, DescriptionFunction, FieldDescriptionClientComponent, FieldDescriptionClientProps, FieldDescriptionServerComponent, FieldDescriptionServerProps, GenericDescriptionProps, StaticDescription, } from './forms/Description.js';
36
36
  export type { FieldErrorClientComponent, FieldErrorClientProps, FieldErrorServerComponent, FieldErrorServerProps, GenericErrorProps, } from './forms/Error.js';
37
37
  export type { FormFieldBase } from './forms/Field.js';
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/admin/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,YAAY,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AACvF,YAAY,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC5F,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACtE,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACtE,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAChE,YAAY,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAC1E,YAAY,EACV,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,YAAY,EACV,4BAA4B,EAC5B,iCAAiC,GAClC,MAAM,mCAAmC,CAAA;AAE1C,YAAY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KAAK,CAAC,EAAE,EAClB,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,CAAC,CAAC,EAAE,CAAA;CACxB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/admin/types.ts"],"sourcesContent":["import type React from 'react'\n\nimport type { PayloadComponent } from '../config/types.js'\nimport type { JsonObject } from '../types/index.js'\n\nexport type { CellComponentProps, DefaultCellComponentProps } from './elements/Cell.js'\nexport type { ConditionalDateProps } from './elements/DatePicker.js'\nexport type { DayPickerProps, SharedProps, TimePickerProps } from './elements/DatePicker.js'\nexport type { CustomPreviewButton } from './elements/PreviewButton.js'\nexport type { CustomPublishButton } from './elements/PublishButton.js'\nexport type { CustomSaveButton } from './elements/SaveButton.js'\nexport type { CustomSaveDraftButton } from './elements/SaveDraftButton.js'\nexport type {\n DocumentTabComponent,\n DocumentTabCondition,\n DocumentTabConfig,\n DocumentTabProps,\n} from './elements/Tab.js'\nexport type { CustomUpload } from './elements/Upload.js'\n\nexport type {\n WithServerSidePropsComponent,\n WithServerSidePropsComponentProps,\n} from './elements/WithServerSideProps.js'\n\nexport type {\n ArrayFieldDescriptionClientComponent,\n ArrayFieldDescriptionServerComponent,\n ArrayFieldErrorClientComponent,\n ArrayFieldErrorServerComponent,\n ArrayFieldLabelClientComponent,\n ArrayFieldLabelServerComponent,\n ArrayFieldProps,\n} from './fields/Array.js'\n\nexport type {\n BlockFieldDescriptionClientComponent,\n BlockFieldDescriptionServerComponent,\n BlockFieldErrorClientComponent,\n BlockFieldErrorServerComponent,\n BlockFieldLabelClientComponent,\n BlockFieldLabelServerComponent,\n BlockFieldProps,\n} from './fields/Blocks.js'\n\nexport type {\n CheckboxFieldDescriptionClientComponent,\n CheckboxFieldDescriptionServerComponent,\n CheckboxFieldErrorClientComponent,\n CheckboxFieldErrorServerComponent,\n CheckboxFieldLabelClientComponent,\n CheckboxFieldLabelServerComponent,\n CheckboxFieldProps,\n} from './fields/Checkbox.js'\n\nexport type {\n CodeFieldDescriptionClientComponent,\n CodeFieldDescriptionServerComponent,\n CodeFieldErrorClientComponent,\n CodeFieldErrorServerComponent,\n CodeFieldLabelClientComponent,\n CodeFieldLabelServerComponent,\n CodeFieldProps,\n} from './fields/Code.js'\n\nexport type {\n CollapsibleFieldDescriptionClientComponent,\n CollapsibleFieldDescriptionServerComponent,\n CollapsibleFieldErrorClientComponent,\n CollapsibleFieldErrorServerComponent,\n CollapsibleFieldLabelClientComponent,\n CollapsibleFieldLabelServerComponent,\n CollapsibleFieldProps,\n} from './fields/Collapsible.js'\n\nexport type {\n DateFieldDescriptionClientComponent,\n DateFieldDescriptionServerComponent,\n DateFieldErrorClientComponent,\n DateFieldErrorServerComponent,\n DateFieldLabelClientComponent,\n DateFieldLabelServerComponent,\n DateFieldProps,\n} from './fields/Date.js'\n\nexport type {\n EmailFieldDescriptionClientComponent,\n EmailFieldDescriptionServerComponent,\n EmailFieldErrorClientComponent,\n EmailFieldErrorServerComponent,\n EmailFieldLabelClientComponent,\n EmailFieldLabelServerComponent,\n EmailFieldProps,\n} from './fields/Email.js'\n\nexport type {\n GroupFieldDescriptionClientComponent,\n GroupFieldDescriptionServerComponent,\n GroupFieldErrorClientComponent,\n GroupFieldErrorServerComponent,\n GroupFieldLabelClientComponent,\n GroupFieldLabelServerComponent,\n GroupFieldProps,\n} from './fields/Group.js'\n\nexport type { HiddenFieldProps } from './fields/Hidden.js'\n\nexport type {\n JSONFieldDescriptionClientComponent,\n JSONFieldDescriptionServerComponent,\n JSONFieldErrorClientComponent,\n JSONFieldErrorServerComponent,\n JSONFieldLabelClientComponent,\n JSONFieldLabelServerComponent,\n JSONFieldProps,\n} from './fields/JSON.js'\n\nexport type {\n NumberFieldDescriptionClientComponent,\n NumberFieldDescriptionServerComponent,\n NumberFieldErrorClientComponent,\n NumberFieldErrorServerComponent,\n NumberFieldLabelClientComponent,\n NumberFieldLabelServerComponent,\n NumberFieldProps,\n} from './fields/Number.js'\n\nexport type {\n PointFieldDescriptionClientComponent,\n PointFieldDescriptionServerComponent,\n PointFieldErrorClientComponent,\n PointFieldErrorServerComponent,\n PointFieldLabelClientComponent,\n PointFieldLabelServerComponent,\n PointFieldProps,\n} from './fields/Point.js'\n\nexport type {\n RadioFieldDescriptionClientComponent,\n RadioFieldDescriptionServerComponent,\n RadioFieldErrorClientComponent,\n RadioFieldErrorServerComponent,\n RadioFieldLabelClientComponent,\n RadioFieldLabelServerComponent,\n RadioFieldProps,\n} from './fields/Radio.js'\n\nexport type {\n RelationshipFieldDescriptionClientComponent,\n RelationshipFieldDescriptionServerComponent,\n RelationshipFieldErrorClientComponent,\n RelationshipFieldErrorServerComponent,\n RelationshipFieldLabelClientComponent,\n RelationshipFieldLabelServerComponent,\n RelationshipFieldProps,\n} from './fields/Relationship.js'\n\nexport type {\n RichTextFieldDescriptionClientComponent,\n RichTextFieldDescriptionServerComponent,\n RichTextFieldErrorClientComponent,\n RichTextFieldErrorServerComponent,\n RichTextFieldLabelClientComponent,\n RichTextFieldLabelServerComponent,\n RichTextFieldProps,\n} from './fields/RichText.js'\n\nexport type {\n RowFieldDescriptionClientComponent,\n RowFieldDescriptionServerComponent,\n RowFieldErrorClientComponent,\n RowFieldErrorServerComponent,\n RowFieldLabelClientComponent,\n RowFieldLabelServerComponent,\n RowFieldProps,\n} from './fields/Row.js'\n\nexport type {\n SelectFieldDescriptionClientComponent,\n SelectFieldDescriptionServerComponent,\n SelectFieldErrorClientComponent,\n SelectFieldErrorServerComponent,\n SelectFieldLabelClientComponent,\n SelectFieldLabelServerComponent,\n SelectFieldProps,\n} from './fields/Select.js'\n\nexport type {\n ClientTab,\n TabsFieldDescriptionClientComponent,\n TabsFieldDescriptionServerComponent,\n TabsFieldErrorClientComponent,\n TabsFieldErrorServerComponent,\n TabsFieldLabelClientComponent,\n TabsFieldLabelServerComponent,\n TabsFieldProps,\n} from './fields/Tabs.js'\n\nexport type {\n TextFieldDescriptionClientComponent,\n TextFieldDescriptionServerComponent,\n TextFieldErrorClientComponent,\n TextFieldErrorServerComponent,\n TextFieldLabelClientComponent,\n TextFieldLabelServerComponent,\n TextFieldProps,\n} from './fields/Text.js'\n\nexport type {\n TextareaFieldDescriptionClientComponent,\n TextareaFieldDescriptionServerComponent,\n TextareaFieldErrorClientComponent,\n TextareaFieldErrorServerComponent,\n TextareaFieldLabelClientComponent,\n TextareaFieldLabelServerComponent,\n TextareaFieldProps,\n} from './fields/Textarea.js'\n\nexport type {\n UploadFieldDescriptionClientComponent,\n UploadFieldDescriptionServerComponent,\n UploadFieldErrorClientComponent,\n UploadFieldErrorServerComponent,\n UploadFieldLabelClientComponent,\n UploadFieldLabelServerComponent,\n UploadFieldProps,\n} from './fields/Upload.js'\n\nexport type {\n Description,\n DescriptionFunction,\n FieldDescriptionClientComponent,\n FieldDescriptionClientProps,\n FieldDescriptionServerComponent,\n FieldDescriptionServerProps,\n GenericDescriptionProps,\n StaticDescription,\n} from './forms/Description.js'\n\nexport type {\n FieldErrorClientComponent,\n FieldErrorClientProps,\n FieldErrorServerComponent,\n FieldErrorServerProps,\n GenericErrorProps,\n} from './forms/Error.js'\n\nexport type { FormFieldBase } from './forms/Field.js'\n\nexport type { Data, FilterOptionsResult, FormField, FormState, Row } from './forms/Form.js'\n\nexport type {\n FieldLabelClientComponent,\n FieldLabelClientProps,\n FieldLabelServerComponent,\n FieldLabelServerProps,\n GenericLabelProps,\n SanitizedLabelProps,\n} from './forms/Label.js'\n\nexport type { RowLabel, RowLabelComponent } from './forms/RowLabel.js'\n\nexport type { LanguageOptions } from './LanguageOptions.js'\n\nexport type {\n RichTextAdapter,\n RichTextAdapterProvider,\n RichTextGenerateComponentMap,\n RichTextHooks,\n} from './RichText.js'\n\nexport type {\n AdminViewComponent,\n AdminViewConfig,\n AdminViewProps,\n EditViewProps,\n InitPageResult,\n ServerSideEditViewProps,\n VisibleEntities,\n} from './views/types.js'\n\nexport type MappedServerComponent<TComponentClientProps extends JsonObject = JsonObject> = {\n Component: React.ComponentType<TComponentClientProps>\n props?: Partial<any>\n RenderedComponent: React.ReactNode\n type: 'server'\n}\n\nexport type MappedClientComponent<TComponentClientProps extends JsonObject = JsonObject> = {\n Component: React.ComponentType<TComponentClientProps>\n props?: Partial<TComponentClientProps>\n RenderedComponent?: React.ReactNode\n type: 'client'\n}\n\nexport type MappedEmptyComponent = {\n type: 'empty'\n}\n\nexport type MappedComponent<TComponentClientProps extends JsonObject = JsonObject> =\n | MappedClientComponent<TComponentClientProps>\n | MappedEmptyComponent\n | MappedServerComponent<TComponentClientProps>\n | undefined\n\nexport type CreateMappedComponent = {\n <T extends JsonObject>(\n component: { Component: React.FC<T> } | null | PayloadComponent<T>,\n props: {\n clientProps?: JsonObject\n serverProps?: object\n },\n fallback: React.FC,\n identifier: string,\n ): MappedComponent<T>\n\n <T extends JsonObject>(\n components: ({ Component: React.FC<T> } | PayloadComponent<T>)[],\n props: {\n clientProps?: JsonObject\n serverProps?: object\n },\n fallback: React.FC,\n identifier: string,\n ): MappedComponent<T>[]\n}\n"],"names":[],"mappings":"AAiTA,WAoBC"}
1
+ {"version":3,"sources":["../../src/admin/types.ts"],"sourcesContent":["import type React from 'react'\n\nimport type { PayloadComponent } from '../config/types.js'\nimport type { JsonObject } from '../types/index.js'\n\nexport type { CellComponentProps, DefaultCellComponentProps } from './elements/Cell.js'\nexport type { ConditionalDateProps } from './elements/DatePicker.js'\nexport type { DayPickerProps, SharedProps, TimePickerProps } from './elements/DatePicker.js'\nexport type { CustomPreviewButton } from './elements/PreviewButton.js'\nexport type { CustomPublishButton } from './elements/PublishButton.js'\nexport type { CustomSaveButton } from './elements/SaveButton.js'\nexport type { CustomSaveDraftButton } from './elements/SaveDraftButton.js'\nexport type {\n DocumentTabComponent,\n DocumentTabCondition,\n DocumentTabConfig,\n DocumentTabProps,\n} from './elements/Tab.js'\nexport type { CustomUpload } from './elements/Upload.js'\n\nexport type {\n WithServerSidePropsComponent,\n WithServerSidePropsComponentProps,\n} from './elements/WithServerSideProps.js'\n\nexport type {\n ArrayFieldClientComponent,\n ArrayFieldClientProps,\n ArrayFieldDescriptionClientComponent,\n ArrayFieldDescriptionServerComponent,\n ArrayFieldErrorClientComponent,\n ArrayFieldErrorServerComponent,\n ArrayFieldLabelClientComponent,\n ArrayFieldLabelServerComponent,\n ArrayFieldServerComponent,\n ArrayFieldServerProps,\n} from './fields/Array.js'\n\nexport type {\n BlockFieldDescriptionClientComponent,\n BlockFieldDescriptionServerComponent,\n BlockFieldErrorClientComponent,\n BlockFieldErrorServerComponent,\n BlockFieldLabelClientComponent,\n BlockFieldLabelServerComponent,\n BlocksFieldClientComponent,\n BlocksFieldClientProps,\n BlocksFieldServerComponent,\n BlocksFieldServerProps,\n} from './fields/Blocks.js'\n\nexport type {\n CheckboxFieldClientComponent,\n CheckboxFieldClientProps,\n CheckboxFieldDescriptionClientComponent,\n CheckboxFieldDescriptionServerComponent,\n CheckboxFieldErrorClientComponent,\n CheckboxFieldErrorServerComponent,\n CheckboxFieldLabelClientComponent,\n CheckboxFieldLabelServerComponent,\n CheckboxFieldServerComponent,\n CheckboxFieldServerProps,\n} from './fields/Checkbox.js'\n\nexport type {\n CodeFieldClientComponent,\n CodeFieldClientProps,\n CodeFieldDescriptionClientComponent,\n CodeFieldDescriptionServerComponent,\n CodeFieldErrorClientComponent,\n CodeFieldErrorServerComponent,\n CodeFieldLabelClientComponent,\n CodeFieldLabelServerComponent,\n CodeFieldServerComponent,\n CodeFieldServerProps,\n} from './fields/Code.js'\n\nexport type {\n CollapsibleFieldClientComponent,\n CollapsibleFieldClientProps,\n CollapsibleFieldDescriptionClientComponent,\n CollapsibleFieldDescriptionServerComponent,\n CollapsibleFieldErrorClientComponent,\n CollapsibleFieldErrorServerComponent,\n CollapsibleFieldLabelClientComponent,\n CollapsibleFieldLabelServerComponent,\n CollapsibleFieldServerComponent,\n CollapsibleFieldServerProps,\n} from './fields/Collapsible.js'\n\nexport type {\n DateFieldClientComponent,\n DateFieldClientProps,\n DateFieldDescriptionClientComponent,\n DateFieldDescriptionServerComponent,\n DateFieldErrorClientComponent,\n DateFieldErrorServerComponent,\n DateFieldLabelClientComponent,\n DateFieldLabelServerComponent,\n DateFieldServerComponent,\n DateFieldServerProps,\n} from './fields/Date.js'\n\nexport type {\n EmailFieldClientComponent,\n EmailFieldClientProps,\n EmailFieldDescriptionClientComponent,\n EmailFieldDescriptionServerComponent,\n EmailFieldErrorClientComponent,\n EmailFieldErrorServerComponent,\n EmailFieldLabelClientComponent,\n EmailFieldLabelServerComponent,\n EmailFieldServerComponent,\n EmailFieldServerProps,\n} from './fields/Email.js'\n\nexport type {\n GroupFieldClientComponent,\n GroupFieldClientProps,\n GroupFieldDescriptionClientComponent,\n GroupFieldDescriptionServerComponent,\n GroupFieldErrorClientComponent,\n GroupFieldErrorServerComponent,\n GroupFieldLabelClientComponent,\n GroupFieldLabelServerComponent,\n GroupFieldServerComponent,\n GroupFieldServerProps,\n} from './fields/Group.js'\n\nexport type { HiddenFieldProps } from './fields/Hidden.js'\n\nexport type {\n JSONFieldClientComponent,\n JSONFieldClientProps,\n JSONFieldDescriptionClientComponent,\n JSONFieldDescriptionServerComponent,\n JSONFieldErrorClientComponent,\n JSONFieldErrorServerComponent,\n JSONFieldLabelClientComponent,\n JSONFieldLabelServerComponent,\n JSONFieldServerComponent,\n JSONFieldServerProps,\n} from './fields/JSON.js'\n\nexport type {\n NumberFieldClientComponent,\n NumberFieldClientProps,\n NumberFieldDescriptionClientComponent,\n NumberFieldDescriptionServerComponent,\n NumberFieldErrorClientComponent,\n NumberFieldErrorServerComponent,\n NumberFieldLabelClientComponent,\n NumberFieldLabelServerComponent,\n NumberFieldServerComponent,\n NumberFieldServerProps,\n} from './fields/Number.js'\n\nexport type {\n PointFieldClientComponent,\n PointFieldClientProps,\n PointFieldDescriptionClientComponent,\n PointFieldDescriptionServerComponent,\n PointFieldErrorClientComponent,\n PointFieldErrorServerComponent,\n PointFieldLabelClientComponent,\n PointFieldLabelServerComponent,\n PointFieldServerComponent,\n PointFieldServerProps,\n} from './fields/Point.js'\n\nexport type {\n RadioFieldClientComponent,\n RadioFieldClientProps,\n RadioFieldDescriptionClientComponent,\n RadioFieldDescriptionServerComponent,\n RadioFieldErrorClientComponent,\n RadioFieldErrorServerComponent,\n RadioFieldLabelClientComponent,\n RadioFieldLabelServerComponent,\n RadioFieldServerComponent,\n RadioFieldServerProps,\n} from './fields/Radio.js'\n\nexport type {\n RelationshipFieldClientComponent,\n RelationshipFieldClientProps,\n RelationshipFieldDescriptionClientComponent,\n RelationshipFieldDescriptionServerComponent,\n RelationshipFieldErrorClientComponent,\n RelationshipFieldErrorServerComponent,\n RelationshipFieldLabelClientComponent,\n RelationshipFieldLabelServerComponent,\n RelationshipFieldServerComponent,\n RelationshipFieldServerProps,\n} from './fields/Relationship.js'\n\nexport type {\n RichTextFieldClientComponent,\n RichTextFieldClientProps,\n RichTextFieldDescriptionClientComponent,\n RichTextFieldDescriptionServerComponent,\n RichTextFieldErrorClientComponent,\n RichTextFieldErrorServerComponent,\n RichTextFieldLabelClientComponent,\n RichTextFieldLabelServerComponent,\n RichTextFieldServerComponent,\n RichTextFieldServerProps,\n} from './fields/RichText.js'\n\nexport type {\n RowFieldClientComponent,\n RowFieldClientProps,\n RowFieldDescriptionClientComponent,\n RowFieldDescriptionServerComponent,\n RowFieldErrorClientComponent,\n RowFieldErrorServerComponent,\n RowFieldLabelClientComponent,\n RowFieldLabelServerComponent,\n RowFieldServerComponent,\n RowFieldServerProps,\n} from './fields/Row.js'\n\nexport type {\n SelectFieldClientComponent,\n SelectFieldClientProps,\n SelectFieldDescriptionClientComponent,\n SelectFieldDescriptionServerComponent,\n SelectFieldErrorClientComponent,\n SelectFieldErrorServerComponent,\n SelectFieldLabelClientComponent,\n SelectFieldLabelServerComponent,\n SelectFieldServerComponent,\n SelectFieldServerProps,\n} from './fields/Select.js'\n\nexport type {\n ClientTab,\n TabsFieldClientComponent,\n TabsFieldClientProps,\n TabsFieldDescriptionClientComponent,\n TabsFieldDescriptionServerComponent,\n TabsFieldErrorClientComponent,\n TabsFieldErrorServerComponent,\n TabsFieldLabelClientComponent,\n TabsFieldLabelServerComponent,\n TabsFieldServerComponent,\n TabsFieldServerProps,\n} from './fields/Tabs.js'\n\nexport type {\n TextFieldClientComponent,\n TextFieldClientProps,\n TextFieldDescriptionClientComponent,\n TextFieldDescriptionServerComponent,\n TextFieldErrorClientComponent,\n TextFieldErrorServerComponent,\n TextFieldLabelClientComponent,\n TextFieldLabelServerComponent,\n TextFieldServerComponent,\n TextFieldServerProps,\n} from './fields/Text.js'\n\nexport type {\n TextareaFieldClientComponent,\n TextareaFieldClientProps,\n TextareaFieldDescriptionClientComponent,\n TextareaFieldDescriptionServerComponent,\n TextareaFieldErrorClientComponent,\n TextareaFieldErrorServerComponent,\n TextareaFieldLabelClientComponent,\n TextareaFieldLabelServerComponent,\n TextareaFieldServerComponent,\n TextareaFieldServerProps,\n} from './fields/Textarea.js'\n\nexport type {\n UploadFieldClientComponent,\n UploadFieldClientProps,\n UploadFieldDescriptionClientComponent,\n UploadFieldDescriptionServerComponent,\n UploadFieldErrorClientComponent,\n UploadFieldErrorServerComponent,\n UploadFieldLabelClientComponent,\n UploadFieldLabelServerComponent,\n UploadFieldServerComponent,\n UploadFieldServerProps,\n} from './fields/Upload.js'\n\nexport type {\n Description,\n DescriptionFunction,\n FieldDescriptionClientComponent,\n FieldDescriptionClientProps,\n FieldDescriptionServerComponent,\n FieldDescriptionServerProps,\n GenericDescriptionProps,\n StaticDescription,\n} from './forms/Description.js'\n\nexport type {\n FieldErrorClientComponent,\n FieldErrorClientProps,\n FieldErrorServerComponent,\n FieldErrorServerProps,\n GenericErrorProps,\n} from './forms/Error.js'\n\nexport type { FormFieldBase } from './forms/Field.js'\n\nexport type { Data, FilterOptionsResult, FormField, FormState, Row } from './forms/Form.js'\n\nexport type {\n FieldLabelClientComponent,\n FieldLabelClientProps,\n FieldLabelServerComponent,\n FieldLabelServerProps,\n GenericLabelProps,\n SanitizedLabelProps,\n} from './forms/Label.js'\n\nexport type { RowLabel, RowLabelComponent } from './forms/RowLabel.js'\n\nexport type { LanguageOptions } from './LanguageOptions.js'\n\nexport type {\n RichTextAdapter,\n RichTextAdapterProvider,\n RichTextGenerateComponentMap,\n RichTextHooks,\n} from './RichText.js'\n\nexport type {\n AdminViewComponent,\n AdminViewConfig,\n AdminViewProps,\n EditViewProps,\n InitPageResult,\n ServerSideEditViewProps,\n VisibleEntities,\n} from './views/types.js'\n\nexport type MappedServerComponent<TComponentClientProps extends JsonObject = JsonObject> = {\n Component: React.ComponentType<TComponentClientProps>\n props?: Partial<any>\n RenderedComponent: React.ReactNode\n type: 'server'\n}\n\nexport type MappedClientComponent<TComponentClientProps extends JsonObject = JsonObject> = {\n Component: React.ComponentType<TComponentClientProps>\n props?: Partial<TComponentClientProps>\n RenderedComponent?: React.ReactNode\n type: 'client'\n}\n\nexport type MappedEmptyComponent = {\n type: 'empty'\n}\n\nexport type MappedComponent<TComponentClientProps extends JsonObject = JsonObject> =\n | MappedClientComponent<TComponentClientProps>\n | MappedEmptyComponent\n | MappedServerComponent<TComponentClientProps>\n | undefined\n\nexport type CreateMappedComponent = {\n <T extends JsonObject>(\n component: { Component: React.FC<T> } | null | PayloadComponent<T>,\n props: {\n clientProps?: JsonObject\n serverProps?: object\n },\n fallback: React.FC,\n identifier: string,\n ): MappedComponent<T>\n\n <T extends JsonObject>(\n components: ({ Component: React.FC<T> } | PayloadComponent<T>)[],\n props: {\n clientProps?: JsonObject\n serverProps?: object\n },\n fallback: React.FC,\n identifier: string,\n ): MappedComponent<T>[]\n}\n"],"names":[],"mappings":"AA6WA,WAoBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAQ9C,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IAC3B,GAAG,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,WAAW,EAAE,WAAW,CAAA;IACxB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,IAAI,EAAE,IAAI,GAAG,SAAS,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,IAAI,SAAgB,QAAQ,CAAC,QAAQ,CAAC,KAAG,OAAO,CAAC,UAAU,CAiCvE,CAAA"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAM9C,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IAC3B,GAAG,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,WAAW,EAAE,WAAW,CAAA;IACxB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,IAAI,EAAE,IAAI,GAAG,SAAS,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,IAAI,SAAgB,QAAQ,CAAC,QAAQ,CAAC,KAAG,OAAO,CAAC,UAAU,CA2BvE,CAAA"}
@@ -1,5 +1,3 @@
1
- import { commitTransaction } from '../../utilities/commitTransaction.js';
2
- import { initTransaction } from '../../utilities/initTransaction.js';
3
1
  import { killTransaction } from '../../utilities/killTransaction.js';
4
2
  import { executeAuthStrategies } from '../executeAuthStrategies.js';
5
3
  import { getAccessResults } from '../getAccessResults.js';
@@ -8,7 +6,6 @@ export const auth = async (args)=>{
8
6
  const req = args.req;
9
7
  const { payload } = req;
10
8
  try {
11
- const shouldCommit = await initTransaction(req);
12
9
  const { responseHeaders, user } = await executeAuthStrategies({
13
10
  headers,
14
11
  payload
@@ -18,9 +15,6 @@ export const auth = async (args)=>{
18
15
  const permissions = await getAccessResults({
19
16
  req
20
17
  });
21
- if (shouldCommit) {
22
- await commitTransaction(req);
23
- }
24
18
  return {
25
19
  permissions,
26
20
  responseHeaders,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/auth/operations/auth.ts"],"sourcesContent":["import type { TypedUser } from '../../index.js'\nimport type { PayloadRequest } from '../../types/index.js'\nimport type { Permissions } from '../types.js'\n\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { executeAuthStrategies } from '../executeAuthStrategies.js'\nimport { getAccessResults } from '../getAccessResults.js'\n\nexport type AuthArgs = {\n headers: Request['headers']\n req?: Omit<PayloadRequest, 'user'>\n}\n\nexport type AuthResult = {\n permissions: Permissions\n responseHeaders?: Headers\n user: null | TypedUser\n}\n\nexport const auth = async (args: Required<AuthArgs>): Promise<AuthResult> => {\n const { headers } = args\n const req = args.req as PayloadRequest\n const { payload } = req\n\n try {\n const shouldCommit = await initTransaction(req)\n\n const { responseHeaders, user } = await executeAuthStrategies({\n headers,\n payload,\n })\n\n req.user = user\n req.responseHeaders = responseHeaders\n\n const permissions = await getAccessResults({\n req,\n })\n\n if (shouldCommit) {\n await commitTransaction(req)\n }\n\n return {\n permissions,\n responseHeaders,\n user,\n }\n } catch (error: unknown) {\n await killTransaction(req)\n throw error\n }\n}\n"],"names":["commitTransaction","initTransaction","killTransaction","executeAuthStrategies","getAccessResults","auth","args","headers","req","payload","shouldCommit","responseHeaders","user","permissions","error"],"mappings":"AAIA,SAASA,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,gBAAgB,QAAQ,yBAAwB;AAazD,OAAO,MAAMC,OAAO,OAAOC;IACzB,MAAM,EAAEC,OAAO,EAAE,GAAGD;IACpB,MAAME,MAAMF,KAAKE,GAAG;IACpB,MAAM,EAAEC,OAAO,EAAE,GAAGD;IAEpB,IAAI;QACF,MAAME,eAAe,MAAMT,gBAAgBO;QAE3C,MAAM,EAAEG,eAAe,EAAEC,IAAI,EAAE,GAAG,MAAMT,sBAAsB;YAC5DI;YACAE;QACF;QAEAD,IAAII,IAAI,GAAGA;QACXJ,IAAIG,eAAe,GAAGA;QAEtB,MAAME,cAAc,MAAMT,iBAAiB;YACzCI;QACF;QAEA,IAAIE,cAAc;YAChB,MAAMV,kBAAkBQ;QAC1B;QAEA,OAAO;YACLK;YACAF;YACAC;QACF;IACF,EAAE,OAAOE,OAAgB;QACvB,MAAMZ,gBAAgBM;QACtB,MAAMM;IACR;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../src/auth/operations/auth.ts"],"sourcesContent":["import type { TypedUser } from '../../index.js'\nimport type { PayloadRequest } from '../../types/index.js'\nimport type { Permissions } from '../types.js'\n\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { executeAuthStrategies } from '../executeAuthStrategies.js'\nimport { getAccessResults } from '../getAccessResults.js'\n\nexport type AuthArgs = {\n headers: Request['headers']\n req?: Omit<PayloadRequest, 'user'>\n}\n\nexport type AuthResult = {\n permissions: Permissions\n responseHeaders?: Headers\n user: null | TypedUser\n}\n\nexport const auth = async (args: Required<AuthArgs>): Promise<AuthResult> => {\n const { headers } = args\n const req = args.req as PayloadRequest\n const { payload } = req\n\n try {\n const { responseHeaders, user } = await executeAuthStrategies({\n headers,\n payload,\n })\n\n req.user = user\n req.responseHeaders = responseHeaders\n\n const permissions = await getAccessResults({\n req,\n })\n\n return {\n permissions,\n responseHeaders,\n user,\n }\n } catch (error: unknown) {\n await killTransaction(req)\n throw error\n }\n}\n"],"names":["killTransaction","executeAuthStrategies","getAccessResults","auth","args","headers","req","payload","responseHeaders","user","permissions","error"],"mappings":"AAIA,SAASA,eAAe,QAAQ,qCAAoC;AACpE,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,gBAAgB,QAAQ,yBAAwB;AAazD,OAAO,MAAMC,OAAO,OAAOC;IACzB,MAAM,EAAEC,OAAO,EAAE,GAAGD;IACpB,MAAME,MAAMF,KAAKE,GAAG;IACpB,MAAM,EAAEC,OAAO,EAAE,GAAGD;IAEpB,IAAI;QACF,MAAM,EAAEE,eAAe,EAAEC,IAAI,EAAE,GAAG,MAAMR,sBAAsB;YAC5DI;YACAE;QACF;QAEAD,IAAIG,IAAI,GAAGA;QACXH,IAAIE,eAAe,GAAGA;QAEtB,MAAME,cAAc,MAAMR,iBAAiB;YACzCI;QACF;QAEA,OAAO;YACLI;YACAF;YACAC;QACF;IACF,EAAE,OAAOE,OAAgB;QACvB,MAAMX,gBAAgBM;QACtB,MAAMK;IACR;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/login.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gCAAgC,EAChC,UAAU,EACV,sBAAsB,EACvB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAS,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAevC,MAAM,MAAM,MAAM,GAAG;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ,CAAA;AAED,MAAM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OAAO,CAAA;CAC3B,CAAA;AAED,eAAO,MAAM,cAAc,GAAU,KAAK,SAAS,cAAc,gBACjD,SAAS,CAAC,KAAK,CAAC,KAC7B,OAAO,CAAC;IAAE,IAAI,EAAE,sBAAsB,CAAC,KAAK,CAAC,CAAA;CAAE,GAAG,MAAM,CAsS1D,CAAA"}
@@ -2,8 +2,6 @@ import jwt from 'jsonwebtoken';
2
2
  import { buildAfterOperation } from '../../collections/operations/utils.js';
3
3
  import { AuthenticationError, LockedAuth, ValidationError } from '../../errors/index.js';
4
4
  import { afterRead } from '../../fields/hooks/afterRead/index.js';
5
- import { commitTransaction } from '../../utilities/commitTransaction.js';
6
- import { initTransaction } from '../../utilities/initTransaction.js';
7
5
  import { killTransaction } from '../../utilities/killTransaction.js';
8
6
  import sanitizeInternalFields from '../../utilities/sanitizeInternalFields.js';
9
7
  import { getFieldsToSign } from '../getFieldsToSign.js';
@@ -14,7 +12,6 @@ import { resetLoginAttempts } from '../strategies/local/resetLoginAttempts.js';
14
12
  export const loginOperation = async (incomingArgs)=>{
15
13
  let args = incomingArgs;
16
14
  try {
17
- const shouldCommit = await initTransaction(args.req);
18
15
  // /////////////////////////////////////
19
16
  // beforeOperation - Collection
20
17
  // /////////////////////////////////////
@@ -157,9 +154,6 @@ export const loginOperation = async (incomingArgs)=>{
157
154
  req
158
155
  });
159
156
  }
160
- if (shouldCommit) {
161
- await commitTransaction(req);
162
- }
163
157
  throw new AuthenticationError(req.t);
164
158
  }
165
159
  if (maxLoginAttemptsEnabled) {
@@ -261,9 +255,6 @@ export const loginOperation = async (incomingArgs)=>{
261
255
  // /////////////////////////////////////
262
256
  // Return results
263
257
  // /////////////////////////////////////
264
- if (shouldCommit) {
265
- await commitTransaction(req);
266
- }
267
258
  return result;
268
259
  } catch (error) {
269
260
  await killTransaction(args.req);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/auth/operations/login.ts"],"sourcesContent":["import jwt from 'jsonwebtoken'\n\nimport type {\n AuthOperationsFromCollectionSlug,\n Collection,\n DataFromCollectionSlug,\n} from '../../collections/config/types.js'\nimport type { CollectionSlug } from '../../index.js'\nimport type { PayloadRequest, Where } from '../../types/index.js'\nimport type { User } from '../types.js'\n\nimport { buildAfterOperation } from '../../collections/operations/utils.js'\nimport { AuthenticationError, LockedAuth, ValidationError } from '../../errors/index.js'\nimport { afterRead } from '../../fields/hooks/afterRead/index.js'\nimport { commitTransaction } from '../../utilities/commitTransaction.js'\nimport { initTransaction } from '../../utilities/initTransaction.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport sanitizeInternalFields from '../../utilities/sanitizeInternalFields.js'\nimport { getFieldsToSign } from '../getFieldsToSign.js'\nimport isLocked from '../isLocked.js'\nimport { authenticateLocalStrategy } from '../strategies/local/authenticate.js'\nimport { incrementLoginAttempts } from '../strategies/local/incrementLoginAttempts.js'\nimport { resetLoginAttempts } from '../strategies/local/resetLoginAttempts.js'\n\nexport type Result = {\n exp?: number\n token?: string\n user?: User\n}\n\nexport type Arguments<TSlug extends CollectionSlug> = {\n collection: Collection\n data: AuthOperationsFromCollectionSlug<TSlug>['login']\n depth?: number\n overrideAccess?: boolean\n req: PayloadRequest\n showHiddenFields?: boolean\n}\n\nexport const loginOperation = async <TSlug extends CollectionSlug>(\n incomingArgs: Arguments<TSlug>,\n): Promise<{ user: DataFromCollectionSlug<TSlug> } & Result> => {\n let args = incomingArgs\n\n try {\n const shouldCommit = await initTransaction(args.req)\n\n // /////////////////////////////////////\n // beforeOperation - Collection\n // /////////////////////////////////////\n\n await args.collection.config.hooks.beforeOperation.reduce(async (priorHook, hook) => {\n await priorHook\n\n args =\n (await hook({\n args,\n collection: args.collection?.config,\n context: args.req.context,\n operation: 'login',\n req: args.req,\n })) || args\n }, Promise.resolve())\n\n const {\n collection: { config: collectionConfig },\n data,\n depth,\n overrideAccess,\n req,\n req: {\n fallbackLocale,\n locale,\n payload,\n payload: { secret },\n },\n showHiddenFields,\n } = args\n\n // /////////////////////////////////////\n // Login\n // /////////////////////////////////////\n\n let user\n const { email: unsanitizedEmail, password } = data\n const loginWithUsername = collectionConfig.auth.loginWithUsername\n\n const sanitizedEmail =\n typeof unsanitizedEmail === 'string' ? unsanitizedEmail.toLowerCase().trim() : null\n const sanitizedUsername =\n 'username' in data && typeof data?.username === 'string'\n ? data.username.toLowerCase().trim()\n : null\n\n const canLoginWithUsername = Boolean(loginWithUsername)\n const canLoginWithEmail = !loginWithUsername || loginWithUsername.allowEmailLogin\n\n // cannot login with email, did not provide username\n if (!canLoginWithEmail && !sanitizedUsername) {\n throw new ValidationError({\n collection: collectionConfig.slug,\n errors: [{ field: 'username', message: req.i18n.t('validation:required') }],\n })\n }\n\n // cannot login with username, did not provide email\n if (!canLoginWithUsername && !sanitizedEmail) {\n throw new ValidationError({\n collection: collectionConfig.slug,\n errors: [{ field: 'email', message: req.i18n.t('validation:required') }],\n })\n }\n\n // can login with either email or username, did not provide either\n if (!sanitizedUsername && !sanitizedEmail) {\n throw new ValidationError({\n collection: collectionConfig.slug,\n errors: [\n { field: 'email', message: req.i18n.t('validation:required') },\n { field: 'username', message: req.i18n.t('validation:required') },\n ],\n })\n }\n\n // did not provide password for login\n if (typeof password !== 'string' || password.trim() === '') {\n throw new ValidationError({\n collection: collectionConfig.slug,\n errors: [{ field: 'password', message: req.i18n.t('validation:required') }],\n })\n }\n\n let whereConstraint: Where = {}\n const emailConstraint: Where = {\n email: {\n equals: sanitizedEmail,\n },\n }\n const usernameConstraint: Where = {\n username: {\n equals: sanitizedUsername,\n },\n }\n\n if (canLoginWithEmail && canLoginWithUsername && (sanitizedUsername || sanitizedEmail)) {\n if (sanitizedUsername) {\n whereConstraint = {\n or: [\n usernameConstraint,\n {\n email: {\n equals: sanitizedUsername,\n },\n },\n ],\n }\n } else {\n whereConstraint = {\n or: [\n emailConstraint,\n {\n username: {\n equals: sanitizedEmail,\n },\n },\n ],\n }\n }\n } else if (canLoginWithEmail && sanitizedEmail) {\n whereConstraint = emailConstraint\n } else if (canLoginWithUsername && sanitizedUsername) {\n whereConstraint = usernameConstraint\n }\n\n user = await payload.db.findOne<any>({\n collection: collectionConfig.slug,\n req,\n where: whereConstraint,\n })\n\n if (!user || (args.collection.config.auth.verify && user._verified === false)) {\n throw new AuthenticationError(req.t, Boolean(canLoginWithUsername && sanitizedUsername))\n }\n\n if (user && isLocked(new Date(user.lockUntil).getTime())) {\n throw new LockedAuth(req.t)\n }\n\n const authResult = await authenticateLocalStrategy({ doc: user, password })\n\n user = sanitizeInternalFields(user)\n\n const maxLoginAttemptsEnabled = args.collection.config.auth.maxLoginAttempts > 0\n\n if (!authResult) {\n if (maxLoginAttemptsEnabled) {\n await incrementLoginAttempts({\n collection: collectionConfig,\n doc: user,\n payload: req.payload,\n req,\n })\n }\n\n if (shouldCommit) {\n await commitTransaction(req)\n }\n\n throw new AuthenticationError(req.t)\n }\n\n if (maxLoginAttemptsEnabled) {\n await resetLoginAttempts({\n collection: collectionConfig,\n doc: user,\n payload: req.payload,\n req,\n })\n }\n\n const fieldsToSign = getFieldsToSign({\n collectionConfig,\n email: sanitizedEmail,\n user,\n })\n\n // /////////////////////////////////////\n // beforeLogin - Collection\n // /////////////////////////////////////\n\n await collectionConfig.hooks.beforeLogin.reduce(async (priorHook, hook) => {\n await priorHook\n\n user =\n (await hook({\n collection: args.collection?.config,\n context: args.req.context,\n req: args.req,\n user,\n })) || user\n }, Promise.resolve())\n\n const token = jwt.sign(fieldsToSign, secret, {\n expiresIn: collectionConfig.auth.tokenExpiration,\n })\n\n req.user = user\n\n // /////////////////////////////////////\n // afterLogin - Collection\n // /////////////////////////////////////\n\n await collectionConfig.hooks.afterLogin.reduce(async (priorHook, hook) => {\n await priorHook\n\n user =\n (await hook({\n collection: args.collection?.config,\n context: args.req.context,\n req: args.req,\n token,\n user,\n })) || user\n }, Promise.resolve())\n\n // /////////////////////////////////////\n // afterRead - Fields\n // /////////////////////////////////////\n\n user = await afterRead({\n collection: collectionConfig,\n context: req.context,\n depth,\n doc: user,\n draft: undefined,\n fallbackLocale,\n global: null,\n locale,\n overrideAccess,\n req,\n showHiddenFields,\n })\n\n // /////////////////////////////////////\n // afterRead - Collection\n // /////////////////////////////////////\n\n await collectionConfig.hooks.afterRead.reduce(async (priorHook, hook) => {\n await priorHook\n\n user =\n (await hook({\n collection: args.collection?.config,\n context: req.context,\n doc: user,\n req,\n })) || user\n }, Promise.resolve())\n\n // /////////////////////////////////////\n // afterRead - Collection\n // /////////////////////////////////////\n\n await collectionConfig.hooks.afterRead.reduce(async (priorHook, hook) => {\n await priorHook\n\n user =\n (await hook({\n collection: args.collection?.config,\n context: req.context,\n doc: user,\n req,\n })) || user\n }, Promise.resolve())\n\n let result: { user: DataFromCollectionSlug<TSlug> } & Result = {\n exp: (jwt.decode(token) as jwt.JwtPayload).exp,\n token,\n user,\n }\n\n // /////////////////////////////////////\n // afterOperation - Collection\n // /////////////////////////////////////\n\n result = await buildAfterOperation({\n args,\n collection: args.collection?.config,\n operation: 'login',\n result,\n })\n\n // /////////////////////////////////////\n // Return results\n // /////////////////////////////////////\n\n if (shouldCommit) {\n await commitTransaction(req)\n }\n\n return result\n } catch (error: unknown) {\n await killTransaction(args.req)\n throw error\n }\n}\n"],"names":["jwt","buildAfterOperation","AuthenticationError","LockedAuth","ValidationError","afterRead","commitTransaction","initTransaction","killTransaction","sanitizeInternalFields","getFieldsToSign","isLocked","authenticateLocalStrategy","incrementLoginAttempts","resetLoginAttempts","loginOperation","incomingArgs","args","shouldCommit","req","collection","config","hooks","beforeOperation","reduce","priorHook","hook","context","operation","Promise","resolve","collectionConfig","data","depth","overrideAccess","fallbackLocale","locale","payload","secret","showHiddenFields","user","email","unsanitizedEmail","password","loginWithUsername","auth","sanitizedEmail","toLowerCase","trim","sanitizedUsername","username","canLoginWithUsername","Boolean","canLoginWithEmail","allowEmailLogin","slug","errors","field","message","i18n","t","whereConstraint","emailConstraint","equals","usernameConstraint","or","db","findOne","where","verify","_verified","Date","lockUntil","getTime","authResult","doc","maxLoginAttemptsEnabled","maxLoginAttempts","fieldsToSign","beforeLogin","token","sign","expiresIn","tokenExpiration","afterLogin","draft","undefined","global","result","exp","decode","error"],"mappings":"AAAA,OAAOA,SAAS,eAAc;AAW9B,SAASC,mBAAmB,QAAQ,wCAAuC;AAC3E,SAASC,mBAAmB,EAAEC,UAAU,EAAEC,eAAe,QAAQ,wBAAuB;AACxF,SAASC,SAAS,QAAQ,wCAAuC;AACjE,SAASC,iBAAiB,QAAQ,uCAAsC;AACxE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,OAAOC,4BAA4B,4CAA2C;AAC9E,SAASC,eAAe,QAAQ,wBAAuB;AACvD,OAAOC,cAAc,iBAAgB;AACrC,SAASC,yBAAyB,QAAQ,sCAAqC;AAC/E,SAASC,sBAAsB,QAAQ,gDAA+C;AACtF,SAASC,kBAAkB,QAAQ,4CAA2C;AAiB9E,OAAO,MAAMC,iBAAiB,OAC5BC;IAEA,IAAIC,OAAOD;IAEX,IAAI;QACF,MAAME,eAAe,MAAMX,gBAAgBU,KAAKE,GAAG;QAEnD,wCAAwC;QACxC,+BAA+B;QAC/B,wCAAwC;QAExC,MAAMF,KAAKG,UAAU,CAACC,MAAM,CAACC,KAAK,CAACC,eAAe,CAACC,MAAM,CAAC,OAAOC,WAAWC;YAC1E,MAAMD;YAENR,OACE,AAAC,MAAMS,KAAK;gBACVT;gBACAG,YAAYH,KAAKG,UAAU,EAAEC;gBAC7BM,SAASV,KAAKE,GAAG,CAACQ,OAAO;gBACzBC,WAAW;gBACXT,KAAKF,KAAKE,GAAG;YACf,MAAOF;QACX,GAAGY,QAAQC,OAAO;QAElB,MAAM,EACJV,YAAY,EAAEC,QAAQU,gBAAgB,EAAE,EACxCC,IAAI,EACJC,KAAK,EACLC,cAAc,EACdf,GAAG,EACHA,KAAK,EACHgB,cAAc,EACdC,MAAM,EACNC,OAAO,EACPA,SAAS,EAAEC,MAAM,EAAE,EACpB,EACDC,gBA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ACF;QAEA,wCAAwC;QACxC,iBAAiB;QACjB,wCAAwC;QAExC,IAAItE,cAAc;YAChB,MAAMZ,kBAAkBa;QAC1B;QAEA,OAAOqE;IACT,EAAE,OAAOG,OAAgB;QACvB,MAAMnF,gBAAgBS,KAAKE,GAAG;QAC9B,MAAMwE;IACR;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../src/auth/operations/login.ts"],"sourcesContent":["import jwt from 'jsonwebtoken'\n\nimport type {\n AuthOperationsFromCollectionSlug,\n Collection,\n DataFromCollectionSlug,\n} from '../../collections/config/types.js'\nimport type { CollectionSlug } from '../../index.js'\nimport type { PayloadRequest, Where } from '../../types/index.js'\nimport type { User } from '../types.js'\n\nimport { buildAfterOperation } from '../../collections/operations/utils.js'\nimport { AuthenticationError, LockedAuth, ValidationError } from '../../errors/index.js'\nimport { afterRead } from '../../fields/hooks/afterRead/index.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport sanitizeInternalFields from '../../utilities/sanitizeInternalFields.js'\nimport { getFieldsToSign } from '../getFieldsToSign.js'\nimport isLocked from '../isLocked.js'\nimport { authenticateLocalStrategy } from '../strategies/local/authenticate.js'\nimport { incrementLoginAttempts } from '../strategies/local/incrementLoginAttempts.js'\nimport { resetLoginAttempts } from '../strategies/local/resetLoginAttempts.js'\n\nexport type Result = {\n exp?: number\n token?: string\n user?: User\n}\n\nexport type Arguments<TSlug extends CollectionSlug> = {\n collection: Collection\n data: AuthOperationsFromCollectionSlug<TSlug>['login']\n depth?: number\n overrideAccess?: boolean\n req: PayloadRequest\n showHiddenFields?: boolean\n}\n\nexport const loginOperation = async <TSlug extends CollectionSlug>(\n incomingArgs: Arguments<TSlug>,\n): Promise<{ user: DataFromCollectionSlug<TSlug> } & Result> => {\n let args = incomingArgs\n\n try {\n // /////////////////////////////////////\n // beforeOperation - Collection\n // /////////////////////////////////////\n\n await args.collection.config.hooks.beforeOperation.reduce(async (priorHook, hook) => {\n await priorHook\n\n args =\n (await hook({\n args,\n collection: args.collection?.config,\n context: args.req.context,\n operation: 'login',\n req: args.req,\n })) || args\n }, Promise.resolve())\n\n const {\n collection: { config: collectionConfig },\n data,\n depth,\n overrideAccess,\n req,\n req: {\n fallbackLocale,\n locale,\n payload,\n payload: { secret },\n },\n showHiddenFields,\n } = args\n\n // /////////////////////////////////////\n // Login\n // /////////////////////////////////////\n\n let user\n const { email: unsanitizedEmail, password } = data\n const loginWithUsername = collectionConfig.auth.loginWithUsername\n\n const sanitizedEmail =\n typeof unsanitizedEmail === 'string' ? unsanitizedEmail.toLowerCase().trim() : null\n const sanitizedUsername =\n 'username' in data && typeof data?.username === 'string'\n ? data.username.toLowerCase().trim()\n : null\n\n const canLoginWithUsername = Boolean(loginWithUsername)\n const canLoginWithEmail = !loginWithUsername || loginWithUsername.allowEmailLogin\n\n // cannot login with email, did not provide username\n if (!canLoginWithEmail && !sanitizedUsername) {\n throw new ValidationError({\n collection: collectionConfig.slug,\n errors: [{ field: 'username', message: req.i18n.t('validation:required') }],\n })\n }\n\n // cannot login with username, did not provide email\n if (!canLoginWithUsername && !sanitizedEmail) {\n throw new ValidationError({\n collection: collectionConfig.slug,\n errors: [{ field: 'email', message: req.i18n.t('validation:required') }],\n })\n }\n\n // can login with either email or username, did not provide either\n if (!sanitizedUsername && !sanitizedEmail) {\n throw new ValidationError({\n collection: collectionConfig.slug,\n errors: [\n { field: 'email', message: req.i18n.t('validation:required') },\n { field: 'username', message: req.i18n.t('validation:required') },\n ],\n })\n }\n\n // did not provide password for login\n if (typeof password !== 'string' || password.trim() === '') {\n throw new ValidationError({\n collection: collectionConfig.slug,\n errors: [{ field: 'password', message: req.i18n.t('validation:required') }],\n })\n }\n\n let whereConstraint: Where = {}\n const emailConstraint: Where = {\n email: {\n equals: sanitizedEmail,\n },\n }\n const usernameConstraint: Where = {\n username: {\n equals: sanitizedUsername,\n },\n }\n\n if (canLoginWithEmail && canLoginWithUsername && (sanitizedUsername || sanitizedEmail)) {\n if (sanitizedUsername) {\n whereConstraint = {\n or: [\n usernameConstraint,\n {\n email: {\n equals: sanitizedUsername,\n },\n },\n ],\n }\n } else {\n whereConstraint = {\n or: [\n emailConstraint,\n {\n username: {\n equals: sanitizedEmail,\n },\n },\n ],\n }\n }\n } else if (canLoginWithEmail && sanitizedEmail) {\n whereConstraint = emailConstraint\n } else if (canLoginWithUsername && sanitizedUsername) {\n whereConstraint = usernameConstraint\n }\n\n user = await payload.db.findOne<any>({\n collection: collectionConfig.slug,\n req,\n where: whereConstraint,\n })\n\n if (!user || (args.collection.config.auth.verify && user._verified === false)) {\n throw new AuthenticationError(req.t, Boolean(canLoginWithUsername && sanitizedUsername))\n }\n\n if (user && isLocked(new Date(user.lockUntil).getTime())) {\n throw new LockedAuth(req.t)\n }\n\n const authResult = await authenticateLocalStrategy({ doc: user, password })\n\n user = sanitizeInternalFields(user)\n\n const maxLoginAttemptsEnabled = args.collection.config.auth.maxLoginAttempts > 0\n\n if (!authResult) {\n if (maxLoginAttemptsEnabled) {\n await incrementLoginAttempts({\n collection: collectionConfig,\n doc: user,\n payload: req.payload,\n req,\n })\n }\n\n throw new AuthenticationError(req.t)\n }\n\n if (maxLoginAttemptsEnabled) {\n await resetLoginAttempts({\n collection: collectionConfig,\n doc: user,\n payload: req.payload,\n req,\n })\n }\n\n const fieldsToSign = getFieldsToSign({\n collectionConfig,\n email: sanitizedEmail,\n user,\n })\n\n // /////////////////////////////////////\n // beforeLogin - Collection\n // /////////////////////////////////////\n\n await collectionConfig.hooks.beforeLogin.reduce(async (priorHook, hook) => {\n await priorHook\n\n user =\n (await hook({\n collection: args.collection?.config,\n context: args.req.context,\n req: args.req,\n user,\n })) || user\n }, Promise.resolve())\n\n const token = jwt.sign(fieldsToSign, secret, {\n expiresIn: collectionConfig.auth.tokenExpiration,\n })\n\n req.user = user\n\n // /////////////////////////////////////\n // afterLogin - Collection\n // /////////////////////////////////////\n\n await collectionConfig.hooks.afterLogin.reduce(async (priorHook, hook) => {\n await priorHook\n\n user =\n (await hook({\n collection: args.collection?.config,\n context: args.req.context,\n req: args.req,\n token,\n user,\n })) || user\n }, Promise.resolve())\n\n // /////////////////////////////////////\n // afterRead - Fields\n // /////////////////////////////////////\n\n user = await afterRead({\n collection: collectionConfig,\n context: req.context,\n depth,\n doc: user,\n draft: undefined,\n fallbackLocale,\n global: null,\n locale,\n overrideAccess,\n req,\n showHiddenFields,\n })\n\n // /////////////////////////////////////\n // afterRead - Collection\n // /////////////////////////////////////\n\n await collectionConfig.hooks.afterRead.reduce(async (priorHook, hook) => {\n await priorHook\n\n user =\n (await hook({\n collection: args.collection?.config,\n context: req.context,\n doc: user,\n req,\n })) || user\n }, Promise.resolve())\n\n // /////////////////////////////////////\n // afterRead - Collection\n // /////////////////////////////////////\n\n await collectionConfig.hooks.afterRead.reduce(async (priorHook, hook) => {\n await priorHook\n\n user =\n (await hook({\n collection: args.collection?.config,\n context: req.context,\n doc: user,\n req,\n })) || user\n }, Promise.resolve())\n\n let result: { user: DataFromCollectionSlug<TSlug> } & Result = {\n exp: (jwt.decode(token) as jwt.JwtPayload).exp,\n token,\n user,\n }\n\n // /////////////////////////////////////\n // afterOperation - Collection\n // /////////////////////////////////////\n\n result = await buildAfterOperation({\n args,\n collection: args.collection?.config,\n operation: 'login',\n result,\n })\n\n // /////////////////////////////////////\n // Return results\n // /////////////////////////////////////\n\n return result\n } catch (error: unknown) {\n await killTransaction(args.req)\n throw error\n }\n}\n"],"names":["jwt","buildAfterOperation","AuthenticationError","LockedAuth","ValidationError","afterRead","killTransaction","sanitizeInternalFields","getFieldsToSign","isLocked","authenticateLocalStrategy","incrementLoginAttempts","resetLoginAttempts","loginOperation","incomingArgs","args","collection","config","hooks","beforeOperation","reduce","priorHook","hook","context","req","operation","Promise","resolve","collectionConfig","data","depth","overrideAccess","fallbackLocale","locale","payload","secret","showHiddenFields","user","email","unsanitizedEmail","password","loginWithUsername","auth","sanitizedEmail","toLowerCase","trim","sanitizedUsername","username","canLoginWithUsername","Boolean","canLoginWithEmail","allowEmailLogin","slug","errors","field","message","i18n","t","whereConstraint","emailConstraint","equals","usernameConstraint","or","db","findOne","where","verify","_verified","Date","lockUntil","getTime","authResult","doc","maxLoginAttemptsEnabled","maxLoginAttempts","fieldsToSign","beforeLogin","token","sign","expiresIn","tokenExpiration","afterLogin","draft","undefined","global","result","exp","decode","error"],"mappings":"AAAA,OAAOA,SAAS,eAAc;AAW9B,SAASC,mBAAmB,QAAQ,wCAAuC;AAC3E,SAASC,mBAAmB,EAAEC,UAAU,EAAEC,eAAe,QAAQ,wBAAuB;AACxF,SAASC,SAAS,QAAQ,wCAAuC;AACjE,SAASC,eAAe,QAAQ,qCAAoC;AACpE,OAAOC,4BAA4B,4CAA2C;AAC9E,SAASC,eAAe,QAAQ,wBAAuB;AACvD,OAAOC,cAAc,iBAAgB;AACrC,SAASC,yBAAyB,QAAQ,sCAAqC;AAC/E,SAASC,sBAAsB,QAAQ,gDAA+C;AACtF,SAASC,kBAAkB,QAAQ,4CAA2C;AAiB9E,OAAO,MAAMC,iBAAiB,OAC5BC;IAEA,IAAIC,OAAOD;IAEX,IAAI;QACF,wCAAwC;QACxC,+BAA+B;QAC/B,wCAAwC;QAExC,MAAMC,KAAKC,UAAU,CAACC,MAAM,CAACC,KAAK,CAACC,eAAe,CAACC,MAAM,CAAC,OAAOC,WAAWC;YAC1E,MAAMD;YAENN,OACE,AAAC,MAAMO,KAAK;gBACVP;gBACAC,YAAYD,KAAKC,UAAU,EAAEC;gBAC7BM,SAASR,KAAKS,GAAG,CAACD,OAAO;gBACzBE,WAAW;gBACXD,KAAKT,KAAKS,GAAG;YACf,MAAOT;QACX,GAAGW,QAAQC,OAAO;QAElB,MAAM,EACJX,YAAY,EAAEC,QAAQW,gBAAgB,EAAE,EACxCC,IAAI,EACJC,KAAK,EACLC,cAAc,EACdP,GAAG,EACHA,KAAK,EACHQ,cAAc,EACdC,MAAM,EACNC,OAAO,EACPA,SAAS,EAAEC,MAAM,EAAE,EACpB,EACDC,gBAAgB,EACjB,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vB,MAAMlF,gBAAgBS,KAAKS,GAAG;QAC9B,MAAMgE;IACR;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../src/collections/config/sanitize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAe7E,eAAO,MAAM,kBAAkB,WACrB,MAAM,cACF,gBAAgB,iCAKG,KAAK,CAAC,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,KAC/E,OAAO,CAAC,yBAAyB,CAwKnC,CAAA"}
1
+ {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../src/collections/config/sanitize.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAA;AAgB7E,eAAO,MAAM,kBAAkB,WACrB,MAAM,cACF,gBAAgB,iCAKG,KAAK,CAAC,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,KAC/E,OAAO,CAAC,yBAAyB,CA0KnC,CAAA"}
@@ -10,6 +10,7 @@ import baseVersionFields from '../../versions/baseFields.js';
10
10
  import { versionDefaults } from '../../versions/defaults.js';
11
11
  import { authDefaults, defaults, loginWithUsernameDefaults } from './defaults.js';
12
12
  import { sanitizeAuthFields, sanitizeUploadFields } from './reservedFieldNames.js';
13
+ import { validateUseAsTitle } from './useAsTitle.js';
13
14
  export const sanitizeCollection = async (config, collection, /**
14
15
  * If this property is set, RichText fields won't be sanitized immediately. Instead, they will be added to this array as promises
15
16
  * so that you can sanitize them together, after the config has been sanitized.
@@ -30,6 +31,7 @@ export const sanitizeCollection = async (config, collection, /**
30
31
  richTextSanitizationPromises,
31
32
  validRelationships
32
33
  });
34
+ validateUseAsTitle(sanitized);
33
35
  if (sanitized.timestamps !== false) {
34
36
  // add default timestamps fields only as needed
35
37
  let hasUpdatedAt = null;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/collections/config/sanitize.ts"],"sourcesContent":["import type { LoginWithUsernameOptions } from '../../auth/types.js'\nimport type { Config, SanitizedConfig } from '../../config/types.js'\nimport type { CollectionConfig, SanitizedCollectionConfig } from './types.js'\n\nimport { getBaseAuthFields } from '../../auth/getAuthFields.js'\nimport { TimestampsRequired } from '../../errors/TimestampsRequired.js'\nimport { sanitizeFields } from '../../fields/config/sanitize.js'\nimport { fieldAffectsData } from '../../fields/config/types.js'\nimport mergeBaseFields from '../../fields/mergeBaseFields.js'\nimport { getBaseUploadFields } from '../../uploads/getBaseFields.js'\nimport { deepMergeWithReactComponents } from '../../utilities/deepMerge.js'\nimport { formatLabels } from '../../utilities/formatLabels.js'\nimport baseVersionFields from '../../versions/baseFields.js'\nimport { versionDefaults } from '../../versions/defaults.js'\nimport { authDefaults, defaults, loginWithUsernameDefaults } from './defaults.js'\nimport { sanitizeAuthFields, sanitizeUploadFields } from './reservedFieldNames.js'\n\nexport const sanitizeCollection = async (\n config: Config,\n collection: CollectionConfig,\n /**\n * If this property is set, RichText fields won't be sanitized immediately. Instead, they will be added to this array as promises\n * so that you can sanitize them together, after the config has been sanitized.\n */\n richTextSanitizationPromises?: Array<(config: SanitizedConfig) => Promise<void>>,\n): Promise<SanitizedCollectionConfig> => {\n // /////////////////////////////////\n // Make copy of collection config\n // /////////////////////////////////\n\n const sanitized: CollectionConfig = deepMergeWithReactComponents(defaults, collection)\n\n // /////////////////////////////////\n // Sanitize fields\n // /////////////////////////////////\n\n const validRelationships = config.collections.map((c) => c.slug) || []\n sanitized.fields = await sanitizeFields({\n collectionConfig: sanitized,\n config,\n fields: sanitized.fields,\n parentIsLocalized: false,\n richTextSanitizationPromises,\n validRelationships,\n })\n\n if (sanitized.timestamps !== false) {\n // add default timestamps fields only as needed\n let hasUpdatedAt = null\n let hasCreatedAt = null\n sanitized.fields.some((field) => {\n if (fieldAffectsData(field)) {\n if (field.name === 'updatedAt') {\n hasUpdatedAt = true\n }\n if (field.name === 'createdAt') {\n hasCreatedAt = true\n }\n }\n return hasCreatedAt && hasUpdatedAt\n })\n if (!hasUpdatedAt) {\n sanitized.fields.push({\n name: 'updatedAt',\n type: 'date',\n admin: {\n disableBulkEdit: true,\n hidden: true,\n },\n label: ({ t }) => t('general:updatedAt'),\n })\n }\n if (!hasCreatedAt) {\n sanitized.fields.push({\n name: 'createdAt',\n admin: {\n disableBulkEdit: true,\n hidden: true,\n },\n // The default sort for list view is createdAt. Thus, enabling indexing by default, is a major performance improvement, especially for large or a large amount of collections.\n type: 'date',\n index: true,\n label: ({ t }) => t('general:createdAt'),\n })\n }\n }\n\n sanitized.labels = sanitized.labels || formatLabels(sanitized.slug)\n\n if (sanitized.versions) {\n if (sanitized.versions === true) {\n sanitized.versions = { drafts: false }\n }\n\n if (sanitized.timestamps === false) {\n throw new TimestampsRequired(collection)\n }\n\n if (sanitized.versions.drafts) {\n if (sanitized.versions.drafts === true) {\n sanitized.versions.drafts = {\n autosave: false,\n validate: false,\n }\n }\n\n if (sanitized.versions.drafts.autosave === true) {\n sanitized.versions.drafts.autosave = {\n interval: versionDefaults.autosaveInterval,\n }\n }\n\n if (sanitized.versions.drafts.validate === undefined) {\n sanitized.versions.drafts.validate = false\n }\n\n sanitized.fields = mergeBaseFields(sanitized.fields, baseVersionFields)\n }\n }\n\n if (sanitized.upload) {\n if (sanitized.upload === true) {\n sanitized.upload = {}\n }\n\n // sanitize fields for reserved names\n sanitizeUploadFields(sanitized.fields, sanitized)\n\n // disable duplicate for uploads by default\n sanitized.disableDuplicate = sanitized.disableDuplicate || true\n\n sanitized.upload.bulkUpload = sanitized.upload?.bulkUpload ?? true\n sanitized.upload.staticDir = sanitized.upload.staticDir || sanitized.slug\n sanitized.admin.useAsTitle =\n sanitized.admin.useAsTitle && sanitized.admin.useAsTitle !== 'id'\n ? sanitized.admin.useAsTitle\n : 'filename'\n\n const uploadFields = getBaseUploadFields({\n collection: sanitized,\n config,\n })\n\n sanitized.fields = mergeBaseFields(sanitized.fields, uploadFields)\n }\n\n if (sanitized.auth) {\n // sanitize fields for reserved names\n sanitizeAuthFields(sanitized.fields, sanitized)\n\n sanitized.auth = deepMergeWithReactComponents(\n authDefaults,\n typeof sanitized.auth === 'object' ? sanitized.auth : {},\n )\n\n if (!sanitized.auth.disableLocalStrategy && sanitized.auth.verify === true) {\n sanitized.auth.verify = {}\n }\n\n // disable duplicate for auth enabled collections by default\n sanitized.disableDuplicate = sanitized.disableDuplicate || true\n\n if (!sanitized.auth.strategies) {\n sanitized.auth.strategies = []\n }\n\n if (sanitized.auth.loginWithUsername) {\n if (sanitized.auth.loginWithUsername === true) {\n sanitized.auth.loginWithUsername = loginWithUsernameDefaults\n } else {\n const loginWithUsernameWithDefaults = {\n ...loginWithUsernameDefaults,\n ...sanitized.auth.loginWithUsername,\n } as LoginWithUsernameOptions\n\n // if allowEmailLogin is false, requireUsername must be true\n if (loginWithUsernameWithDefaults.allowEmailLogin === false) {\n loginWithUsernameWithDefaults.requireUsername = true\n }\n sanitized.auth.loginWithUsername = loginWithUsernameWithDefaults\n }\n } else {\n sanitized.auth.loginWithUsername = false\n }\n\n sanitized.fields = mergeBaseFields(sanitized.fields, getBaseAuthFields(sanitized.auth))\n }\n\n if (collection?.admin?.pagination?.limits?.length) {\n sanitized.admin.pagination.limits = collection.admin.pagination.limits\n }\n\n return sanitized as SanitizedCollectionConfig\n}\n"],"names":["getBaseAuthFields","TimestampsRequired","sanitizeFields","fieldAffectsData","mergeBaseFields","getBaseUploadFields","deepMergeWithReactComponents","formatLabels","baseVersionFields","versionDefaults","authDefaults","defaults","loginWithUsernameDefaults","sanitizeAuthFields","sanitizeUploadFields","sanitizeCollection","config","collection","richTextSanitizationPromises","sanitized","validRelationships","collections","map","c","slug","fields","collectionConfig","parentIsLocalized","timestamps","hasUpdatedAt","hasCreatedAt","some","field","name","push","type","admin","disableBulkEdit","hidden","label","t","index","labels","versions","drafts","autosave","validate","interval","autosaveInterval","undefined","upload","disableDuplicate","bulkUpload","staticDir","useAsTitle","uploadFields","auth","disableLocalStrategy","verify","strategies","loginWithUsername","loginWithUsernameWithDefaults","allowEmailLogin","requireUsername","pagination","limits","length"],"mappings":"AAIA,SAASA,iBAAiB,QAAQ,8BAA6B;AAC/D,SAASC,kBAAkB,QAAQ,qCAAoC;AACvE,SAASC,cAAc,QAAQ,kCAAiC;AAChE,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,OAAOC,qBAAqB,kCAAiC;AAC7D,SAASC,mBAAmB,QAAQ,iCAAgC;AACpE,SAASC,4BAA4B,QAAQ,+BAA8B;AAC3E,SAASC,YAAY,QAAQ,kCAAiC;AAC9D,OAAOC,uBAAuB,+BAA8B;AAC5D,SAASC,eAAe,QAAQ,6BAA4B;AAC5D,SAASC,YAAY,EAAEC,QAAQ,EAAEC,yBAAyB,QAAQ,gBAAe;AACjF,SAASC,kBAAkB,EAAEC,oBAAoB,QAAQ,0BAAyB;AAElF,OAAO,MAAMC,qBAAqB,OAChCC,QACAC,YACA;;;GAGC,GACDC;IAEA,oCAAoC;IACpC,iCAAiC;IACjC,oCAAoC;IAEpC,MAAMC,YAA8Bb,6BAA6BK,UAAUM;IAE3E,oCAAoC;IACpC,kBAAkB;IAClB,oCAAoC;IAEpC,MAAMG,qBAAqBJ,OAAOK,WAAW,CAACC,GAAG,CAAC,CAACC,IAAMA,EAAEC,IAAI,KAAK,EAAE;IACtEL,UAAUM,MAAM,GAAG,MAAMvB,eAAe;QACtCwB,kBAAkBP;QAClBH;QACAS,QAAQN,UAAUM,MAAM;QACxBE,mBAAmB;QACnBT;QACAE;IACF;IAEA,IAAID,UAAUS,UAAU,KAAK,OAAO;QAClC,+CAA+C;QAC/C,IAAIC,eA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oBAAoB,IAAItC,UAAUqC,IAAI,CAACE,MAAM,KAAK,MAAM;YAC1EvC,UAAUqC,IAAI,CAACE,MAAM,GAAG,CAAC;QAC3B;QAEA,4DAA4D;QAC5DvC,UAAUgC,gBAAgB,GAAGhC,UAAUgC,gBAAgB,IAAI;QAE3D,IAAI,CAAChC,UAAUqC,IAAI,CAACG,UAAU,EAAE;YAC9BxC,UAAUqC,IAAI,CAACG,UAAU,GAAG,EAAE;QAChC;QAEA,IAAIxC,UAAUqC,IAAI,CAACI,iBAAiB,EAAE;YACpC,IAAIzC,UAAUqC,IAAI,CAACI,iBAAiB,KAAK,MAAM;gBAC7CzC,UAAUqC,IAAI,CAACI,iBAAiB,GAAGhD;YACrC,OAAO;gBACL,MAAMiD,gCAAgC;oBACpC,GAAGjD,yBAAyB;oBAC5B,GAAGO,UAAUqC,IAAI,CAACI,iBAAiB;gBACrC;gBAEA,4DAA4D;gBAC5D,IAAIC,8BAA8BC,eAAe,KAAK,OAAO;oBAC3DD,8BAA8BE,eAAe,GAAG;gBAClD;gBACA5C,UAAUqC,IAAI,CAACI,iBAAiB,GAAGC;YACrC;QACF,OAAO;YACL1C,UAAUqC,IAAI,CAACI,iBAAiB,GAAG;QACrC;QAEAzC,UAAUM,MAAM,GAAGrB,gBAAgBe,UAAUM,MAAM,EAAEzB,kBAAkBmB,UAAUqC,IAAI;IACvF;IAEA,IAAIvC,YAAYmB,OAAO4B,YAAYC,QAAQC,QAAQ;QACjD/C,UAAUiB,KAAK,CAAC4B,UAAU,CAACC,MAAM,GAAGhD,WAAWmB,KAAK,CAAC4B,UAAU,CAACC,MAAM;IACxE;IAEA,OAAO9C;AACT,EAAC"}
1
+ {"version":3,"sources":["../../../src/collections/config/sanitize.ts"],"sourcesContent":["import type { LoginWithUsernameOptions } from '../../auth/types.js'\nimport type { Config, SanitizedConfig } from '../../config/types.js'\nimport type { CollectionConfig, SanitizedCollectionConfig } from './types.js'\n\nimport { getBaseAuthFields } from '../../auth/getAuthFields.js'\nimport { TimestampsRequired } from '../../errors/TimestampsRequired.js'\nimport { sanitizeFields } from '../../fields/config/sanitize.js'\nimport { fieldAffectsData } from '../../fields/config/types.js'\nimport mergeBaseFields from '../../fields/mergeBaseFields.js'\nimport { getBaseUploadFields } from '../../uploads/getBaseFields.js'\nimport { deepMergeWithReactComponents } from '../../utilities/deepMerge.js'\nimport { formatLabels } from '../../utilities/formatLabels.js'\nimport baseVersionFields from '../../versions/baseFields.js'\nimport { versionDefaults } from '../../versions/defaults.js'\nimport { authDefaults, defaults, loginWithUsernameDefaults } from './defaults.js'\nimport { sanitizeAuthFields, sanitizeUploadFields } from './reservedFieldNames.js'\nimport { validateUseAsTitle } from './useAsTitle.js'\n\nexport const sanitizeCollection = async (\n config: Config,\n collection: CollectionConfig,\n /**\n * If this property is set, RichText fields won't be sanitized immediately. Instead, they will be added to this array as promises\n * so that you can sanitize them together, after the config has been sanitized.\n */\n richTextSanitizationPromises?: Array<(config: SanitizedConfig) => Promise<void>>,\n): Promise<SanitizedCollectionConfig> => {\n // /////////////////////////////////\n // Make copy of collection config\n // /////////////////////////////////\n\n const sanitized: CollectionConfig = deepMergeWithReactComponents(defaults, collection)\n\n // /////////////////////////////////\n // Sanitize fields\n // /////////////////////////////////\n\n const validRelationships = config.collections.map((c) => c.slug) || []\n sanitized.fields = await sanitizeFields({\n collectionConfig: sanitized,\n config,\n fields: sanitized.fields,\n parentIsLocalized: false,\n richTextSanitizationPromises,\n validRelationships,\n })\n\n validateUseAsTitle(sanitized)\n\n if (sanitized.timestamps !== false) {\n // add default timestamps fields only as needed\n let hasUpdatedAt = null\n let hasCreatedAt = null\n sanitized.fields.some((field) => {\n if (fieldAffectsData(field)) {\n if (field.name === 'updatedAt') {\n hasUpdatedAt = true\n }\n if (field.name === 'createdAt') {\n hasCreatedAt = true\n }\n }\n return hasCreatedAt && hasUpdatedAt\n })\n if (!hasUpdatedAt) {\n sanitized.fields.push({\n name: 'updatedAt',\n type: 'date',\n admin: {\n disableBulkEdit: true,\n hidden: true,\n },\n label: ({ t }) => t('general:updatedAt'),\n })\n }\n if (!hasCreatedAt) {\n sanitized.fields.push({\n name: 'createdAt',\n admin: {\n disableBulkEdit: true,\n hidden: true,\n },\n // The default sort for list view is createdAt. Thus, enabling indexing by default, is a major performance improvement, especially for large or a large amount of collections.\n type: 'date',\n index: true,\n label: ({ t }) => t('general:createdAt'),\n })\n }\n }\n\n sanitized.labels = sanitized.labels || formatLabels(sanitized.slug)\n\n if (sanitized.versions) {\n if (sanitized.versions === true) {\n sanitized.versions = { drafts: false }\n }\n\n if (sanitized.timestamps === false) {\n throw new TimestampsRequired(collection)\n }\n\n if (sanitized.versions.drafts) {\n if (sanitized.versions.drafts === true) {\n sanitized.versions.drafts = {\n autosave: false,\n validate: false,\n }\n }\n\n if (sanitized.versions.drafts.autosave === true) {\n sanitized.versions.drafts.autosave = {\n interval: versionDefaults.autosaveInterval,\n }\n }\n\n if (sanitized.versions.drafts.validate === undefined) {\n sanitized.versions.drafts.validate = false\n }\n\n sanitized.fields = mergeBaseFields(sanitized.fields, baseVersionFields)\n }\n }\n\n if (sanitized.upload) {\n if (sanitized.upload === true) {\n sanitized.upload = {}\n }\n\n // sanitize fields for reserved names\n sanitizeUploadFields(sanitized.fields, sanitized)\n\n // disable duplicate for uploads by default\n sanitized.disableDuplicate = sanitized.disableDuplicate || true\n\n sanitized.upload.bulkUpload = sanitized.upload?.bulkUpload ?? true\n sanitized.upload.staticDir = sanitized.upload.staticDir || sanitized.slug\n sanitized.admin.useAsTitle =\n sanitized.admin.useAsTitle && sanitized.admin.useAsTitle !== 'id'\n ? sanitized.admin.useAsTitle\n : 'filename'\n\n const uploadFields = getBaseUploadFields({\n collection: sanitized,\n config,\n })\n\n sanitized.fields = mergeBaseFields(sanitized.fields, uploadFields)\n }\n\n if (sanitized.auth) {\n // sanitize fields for reserved names\n sanitizeAuthFields(sanitized.fields, sanitized)\n\n sanitized.auth = deepMergeWithReactComponents(\n authDefaults,\n typeof sanitized.auth === 'object' ? sanitized.auth : {},\n )\n\n if (!sanitized.auth.disableLocalStrategy && sanitized.auth.verify === true) {\n sanitized.auth.verify = {}\n }\n\n // disable duplicate for auth enabled collections by default\n sanitized.disableDuplicate = sanitized.disableDuplicate || true\n\n if (!sanitized.auth.strategies) {\n sanitized.auth.strategies = []\n }\n\n if (sanitized.auth.loginWithUsername) {\n if (sanitized.auth.loginWithUsername === true) {\n sanitized.auth.loginWithUsername = loginWithUsernameDefaults\n } else {\n const loginWithUsernameWithDefaults = {\n ...loginWithUsernameDefaults,\n ...sanitized.auth.loginWithUsername,\n } as LoginWithUsernameOptions\n\n // if allowEmailLogin is false, requireUsername must be true\n if (loginWithUsernameWithDefaults.allowEmailLogin === false) {\n loginWithUsernameWithDefaults.requireUsername = true\n }\n sanitized.auth.loginWithUsername = loginWithUsernameWithDefaults\n }\n } else {\n sanitized.auth.loginWithUsername = false\n }\n\n sanitized.fields = mergeBaseFields(sanitized.fields, getBaseAuthFields(sanitized.auth))\n }\n\n if (collection?.admin?.pagination?.limits?.length) {\n sanitized.admin.pagination.limits = collection.admin.pagination.limits\n }\n\n return sanitized as SanitizedCollectionConfig\n}\n"],"names":["getBaseAuthFields","TimestampsRequired","sanitizeFields","fieldAffectsData","mergeBaseFields","getBaseUploadFields","deepMergeWithReactComponents","formatLabels","baseVersionFields","versionDefaults","authDefaults","defaults","loginWithUsernameDefaults","sanitizeAuthFields","sanitizeUploadFields","validateUseAsTitle","sanitizeCollection","config","collection","richTextSanitizationPromises","sanitized","validRelationships","collections","map","c","slug","fields","collectionConfig","parentIsLocalized","timestamps","hasUpdatedAt","hasCreatedAt","some","field","name","push","type","admin","disableBulkEdit","hidden","label","t","index","labels","versions","drafts","autosave","validate","interval","autosaveInterval","undefined","upload","disableDuplicate","bulkUpload","staticDir","useAsTitle","uploadFields","auth","disableLocalStrategy","verify","strategies","loginWithUsername","loginWithUsernameWithDefaults","allowEmailLogin","requireUsername","pagination","limits","length"],"mappings":"AAIA,SAAS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BxC,UAAUqC,IAAI,CAACG,UAAU,GAAG,EAAE;QAChC;QAEA,IAAIxC,UAAUqC,IAAI,CAACI,iBAAiB,EAAE;YACpC,IAAIzC,UAAUqC,IAAI,CAACI,iBAAiB,KAAK,MAAM;gBAC7CzC,UAAUqC,IAAI,CAACI,iBAAiB,GAAGjD;YACrC,OAAO;gBACL,MAAMkD,gCAAgC;oBACpC,GAAGlD,yBAAyB;oBAC5B,GAAGQ,UAAUqC,IAAI,CAACI,iBAAiB;gBACrC;gBAEA,4DAA4D;gBAC5D,IAAIC,8BAA8BC,eAAe,KAAK,OAAO;oBAC3DD,8BAA8BE,eAAe,GAAG;gBAClD;gBACA5C,UAAUqC,IAAI,CAACI,iBAAiB,GAAGC;YACrC;QACF,OAAO;YACL1C,UAAUqC,IAAI,CAACI,iBAAiB,GAAG;QACrC;QAEAzC,UAAUM,MAAM,GAAGtB,gBAAgBgB,UAAUM,MAAM,EAAE1B,kBAAkBoB,UAAUqC,IAAI;IACvF;IAEA,IAAIvC,YAAYmB,OAAO4B,YAAYC,QAAQC,QAAQ;QACjD/C,UAAUiB,KAAK,CAAC4B,UAAU,CAACC,MAAM,GAAGhD,WAAWmB,KAAK,CAAC4B,UAAU,CAACC,MAAM;IACxE;IAEA,OAAO9C;AACT,EAAC"}
@@ -0,0 +1,6 @@
1
+ import type { CollectionConfig } from '../../index.js';
2
+ /**
3
+ * Validate useAsTitle for collections.
4
+ */
5
+ export declare const validateUseAsTitle: (config: CollectionConfig) => void;
6
+ //# sourceMappingURL=useAsTitle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAsTitle.d.ts","sourceRoot":"","sources":["../../../src/collections/config/useAsTitle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAMtD;;GAEG;AACH,eAAO,MAAM,kBAAkB,WAAY,gBAAgB,SAiC1D,CAAA"}
@@ -0,0 +1,33 @@
1
+ import { InvalidConfiguration } from '../../errors/InvalidConfiguration.js';
2
+ import { fieldAffectsData } from '../../fields/config/types.js';
3
+ import flattenFields from '../../utilities/flattenTopLevelFields.js';
4
+ /**
5
+ * Validate useAsTitle for collections.
6
+ */ export const validateUseAsTitle = (config)=>{
7
+ if (config.admin.useAsTitle.includes('.')) {
8
+ throw new InvalidConfiguration(`"useAsTitle" cannot be a nested field. Please specify a top-level field in the collection "${config.slug}"`);
9
+ }
10
+ if (config?.admin && config.admin?.useAsTitle && config.admin.useAsTitle !== 'id') {
11
+ const fields = flattenFields(config.fields);
12
+ const useAsTitleField = fields.find((field)=>{
13
+ if (fieldAffectsData(field) && config.admin) {
14
+ return field.name === config.admin.useAsTitle;
15
+ }
16
+ return false;
17
+ });
18
+ // If auth is enabled then we don't need to
19
+ if (config.auth) {
20
+ if (config.admin.useAsTitle !== 'email') {
21
+ if (!useAsTitleField) {
22
+ throw new InvalidConfiguration(`The field "${config.admin.useAsTitle}" specified in "admin.useAsTitle" does not exist in the collection "${config.slug}"`);
23
+ }
24
+ }
25
+ } else {
26
+ if (!useAsTitleField) {
27
+ throw new InvalidConfiguration(`The field "${config.admin.useAsTitle}" specified in "admin.useAsTitle" does not exist in the collection "${config.slug}"`);
28
+ }
29
+ }
30
+ }
31
+ };
32
+
33
+ //# sourceMappingURL=useAsTitle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/collections/config/useAsTitle.ts"],"sourcesContent":["import type { CollectionConfig } from '../../index.js'\n\nimport { InvalidConfiguration } from '../../errors/InvalidConfiguration.js'\nimport { fieldAffectsData } from '../../fields/config/types.js'\nimport flattenFields from '../../utilities/flattenTopLevelFields.js'\n\n/**\n * Validate useAsTitle for collections.\n */\nexport const validateUseAsTitle = (config: CollectionConfig) => {\n if (config.admin.useAsTitle.includes('.')) {\n throw new InvalidConfiguration(\n `\"useAsTitle\" cannot be a nested field. Please specify a top-level field in the collection \"${config.slug}\"`,\n )\n }\n\n if (config?.admin && config.admin?.useAsTitle && config.admin.useAsTitle !== 'id') {\n const fields = flattenFields(config.fields)\n const useAsTitleField = fields.find((field) => {\n if (fieldAffectsData(field) && config.admin) {\n return field.name === config.admin.useAsTitle\n }\n return false\n })\n\n // If auth is enabled then we don't need to\n if (config.auth) {\n if (config.admin.useAsTitle !== 'email') {\n if (!useAsTitleField) {\n throw new InvalidConfiguration(\n `The field \"${config.admin.useAsTitle}\" specified in \"admin.useAsTitle\" does not exist in the collection \"${config.slug}\"`,\n )\n }\n }\n } else {\n if (!useAsTitleField) {\n throw new InvalidConfiguration(\n `The field \"${config.admin.useAsTitle}\" specified in \"admin.useAsTitle\" does not exist in the collection \"${config.slug}\"`,\n )\n }\n }\n }\n}\n"],"names":["InvalidConfiguration","fieldAffectsData","flattenFields","validateUseAsTitle","config","admin","useAsTitle","includes","slug","fields","useAsTitleField","find","field","name","auth"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ,uCAAsC;AAC3E,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,OAAOC,mBAAmB,2CAA0C;AAEpE;;CAEC,GACD,OAAO,MAAMC,qBAAqB,CAACC;IACjC,IAAIA,OAAOC,KAAK,CAACC,UAAU,CAACC,QAAQ,CAAC,MAAM;QACzC,MAAM,IAAIP,qBACR,CAAC,2FAA2F,EAAEI,OAAOI,IAAI,CAAC,CAAC,CAAC;IAEhH;IAEA,IAAIJ,QAAQC,SAASD,OAAOC,KAAK,EAAEC,cAAcF,OAAOC,KAAK,CAACC,UAAU,KAAK,MAAM;QACjF,MAAMG,SAASP,cAAcE,OAAOK,MAAM;QAC1C,MAAMC,kBAAkBD,OAAOE,IAAI,CAAC,CAACC;YACnC,IAAIX,iBAAiBW,UAAUR,OAAOC,KAAK,EAAE;gBAC3C,OAAOO,MAAMC,IAAI,KAAKT,OAAOC,KAAK,CAACC,UAAU;YAC/C;YACA,OAAO;QACT;QAEA,2CAA2C;QAC3C,IAAIF,OAAOU,IAAI,EAAE;YACf,IAAIV,OAAOC,KAAK,CAACC,UAAU,KAAK,SAAS;gBACvC,IAAI,CAACI,iBAAiB;oBACpB,MAAM,IAAIV,qBACR,CAAC,WAAW,EAAEI,OAAOC,KAAK,CAACC,UAAU,CAAC,oEAAoE,EAAEF,OAAOI,IAAI,CAAC,CAAC,CAAC;gBAE9H;YACF;QACF,OAAO;YACL,IAAI,CAACE,iBAAiB;gBACpB,MAAM,IAAIV,qBACR,CAAC,WAAW,EAAEI,OAAOC,KAAK,CAACC,UAAU,CAAC,oEAAoE,EAAEF,OAAOI,IAAI,CAAC,CAAC,CAAC;YAE9H;QACF;IACF;AACF,EAAC"}