payload 3.10.0 → 3.11.1-canary.053fca8

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 (43) hide show
  1. package/dist/admin/types.d.ts +5 -0
  2. package/dist/admin/types.d.ts.map +1 -1
  3. package/dist/admin/types.js.map +1 -1
  4. package/dist/bin/generateTypes.d.ts.map +1 -1
  5. package/dist/bin/generateTypes.js +3 -1
  6. package/dist/bin/generateTypes.js.map +1 -1
  7. package/dist/database/getLocalizedPaths.d.ts.map +1 -1
  8. package/dist/database/getLocalizedPaths.js +21 -5
  9. package/dist/database/getLocalizedPaths.js.map +1 -1
  10. package/dist/errors/{UnathorizedError.d.ts → UnauthorizedError.d.ts} +1 -1
  11. package/dist/errors/UnauthorizedError.d.ts.map +1 -0
  12. package/dist/errors/{UnathorizedError.js → UnauthorizedError.js} +1 -1
  13. package/dist/errors/UnauthorizedError.js.map +1 -0
  14. package/dist/fields/baseFields/baseIDField.d.ts.map +1 -1
  15. package/dist/fields/baseFields/baseIDField.js +2 -12
  16. package/dist/fields/baseFields/baseIDField.js.map +1 -1
  17. package/dist/fields/config/client.d.ts.map +1 -1
  18. package/dist/fields/config/client.js +6 -1
  19. package/dist/fields/config/client.js.map +1 -1
  20. package/dist/fields/hooks/beforeValidate/promise.d.ts.map +1 -1
  21. package/dist/fields/hooks/beforeValidate/promise.js +0 -4
  22. package/dist/fields/hooks/beforeValidate/promise.js.map +1 -1
  23. package/dist/fields/validations.d.ts.map +1 -1
  24. package/dist/fields/validations.js +4 -8
  25. package/dist/fields/validations.js.map +1 -1
  26. package/dist/index.d.ts +3 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +1 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/preferences/operations/delete.js +1 -1
  31. package/dist/preferences/operations/delete.js.map +1 -1
  32. package/dist/preferences/operations/update.js +1 -1
  33. package/dist/preferences/operations/update.js.map +1 -1
  34. package/dist/utilities/configToJSONSchema.d.ts.map +1 -1
  35. package/dist/utilities/configToJSONSchema.js +3 -6
  36. package/dist/utilities/configToJSONSchema.js.map +1 -1
  37. package/dist/utilities/traverseFields.d.ts +4 -34
  38. package/dist/utilities/traverseFields.d.ts.map +1 -1
  39. package/dist/utilities/traverseFields.js +6 -15
  40. package/dist/utilities/traverseFields.js.map +1 -1
  41. package/package.json +4 -4
  42. package/dist/errors/UnathorizedError.d.ts.map +0 -1
  43. package/dist/errors/UnathorizedError.js.map +0 -1
@@ -120,4 +120,9 @@ export type FieldSchemaMap = Map<SchemaPath, {
120
120
  export type ClientFieldSchemaMap = Map<SchemaPath, {
121
121
  fields: ClientField[];
122
122
  } | ClientBlock | ClientField | ClientTab>;
123
+ export type DocumentEvent = {
124
+ entitySlug: string;
125
+ id?: number | string;
126
+ updatedAt: string;
127
+ };
123
128
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/admin/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,WAAW,EACX,KAAK,EACL,UAAU,EACV,GAAG,EACJ,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EACV,kBAAkB,EAClB,IAAI,EACJ,UAAU,EACV,2BAA2B,EAC3B,mBAAmB,EACnB,SAAS,EACT,0BAA0B,EAC1B,GAAG,EACJ,MAAM,iBAAiB,CAAA;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KAAK,CAAC,SAAS,CAAA;IACjC,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB,CAAA;AAED,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,YAAY,EAAE,eAAe,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAE5F,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,eAAe,GAChB,MAAM,kBAAkB,CAAA;AAEzB,KAAK,UAAU,GAAG,EAAE,GAAG,MAAM,CAAA;AAC7B,MAAM,MAAM,cAAc,GAAG,GAAG,CAC9B,UAAU,EACR;IACE,MAAM,EAAE,KAAK,EAAE,CAAA;CAChB,GACD,KAAK,GACL,KAAK,GACL,GAAG,CACN,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,GAAG,CACpC,UAAU,EACR;IACE,MAAM,EAAE,WAAW,EAAE,CAAA;CACtB,GACD,WAAW,GACX,WAAW,GACX,SAAS,CACZ,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/admin/types.ts"],"sourcesContent":["import type { AcceptedLanguages, I18nClient } from '@payloadcms/translations'\nimport type React from 'react'\n\nimport type { ImportMap } from '../bin/generateImportMap/index.js'\nimport type { SanitizedConfig } from '../config/types.js'\nimport type {\n Block,\n ClientBlock,\n ClientField,\n Field,\n FieldTypes,\n Tab,\n} from '../fields/config/types.js'\nimport type { JsonObject } from '../types/index.js'\nimport type { ClientTab } from './fields/Tabs.js'\nimport type {\n BuildFormStateArgs,\n Data,\n FieldState,\n FieldStateWithoutComponents,\n FilterOptionsResult,\n FormState,\n FormStateWithoutComponents,\n Row,\n} from './forms/Form.js'\n\nexport type { DefaultCellComponentProps, DefaultServerCellComponentProps } from './elements/Cell.js'\nexport type { ConditionalDateProps } from './elements/DatePicker.js'\nexport type { DayPickerProps, SharedProps, TimePickerProps } from './elements/DatePicker.js'\nexport type { NavGroupPreferences, NavPreferences } from './elements/Nav.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'\n\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 BlocksFieldClientComponent,\n BlocksFieldClientProps,\n BlocksFieldDescriptionClientComponent,\n BlocksFieldDescriptionServerComponent,\n BlocksFieldErrorClientComponent,\n BlocksFieldErrorServerComponent,\n BlocksFieldLabelClientComponent,\n BlocksFieldLabelServerComponent,\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 JoinFieldClientComponent,\n JoinFieldClientProps,\n JoinFieldDescriptionClientComponent,\n JoinFieldDescriptionServerComponent,\n JoinFieldErrorClientComponent,\n JoinFieldErrorServerComponent,\n JoinFieldLabelClientComponent,\n JoinFieldLabelServerComponent,\n JoinFieldServerComponent,\n JoinFieldServerProps,\n} from './fields/Join.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 UIFieldClientComponent,\n UIFieldClientProps,\n UIFieldServerComponent,\n UIFieldServerProps,\n} from './fields/UI.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 {\n BuildFormStateArgs,\n Data,\n FieldState as FormField,\n FieldStateWithoutComponents as FormFieldWithoutComponents,\n FilterOptionsResult,\n FormState,\n FormStateWithoutComponents,\n Row,\n}\n\nexport type {\n ClientComponentProps,\n ClientFieldBase,\n ClientFieldWithOptionalType,\n FieldClientComponent,\n FieldPaths,\n FieldServerComponent,\n ServerComponentProps,\n ServerFieldBase,\n} from './forms/Field.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 {\n BuildTableStateArgs,\n DefaultServerFunctionArgs,\n ListQuery,\n ServerFunction,\n ServerFunctionArgs,\n ServerFunctionClient,\n ServerFunctionClientArgs,\n ServerFunctionConfig,\n ServerFunctionHandler,\n} from './functions/index.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 enum Action {\n RenderConfig = 'render-config',\n}\n\nexport type RenderEntityConfigArgs = {\n collectionSlug?: string\n data?: Data\n globalSlug?: string\n}\n\nexport type RenderRootConfigArgs = {}\n\nexport type RenderFieldConfigArgs = {\n collectionSlug?: string\n formState?: FormState\n globalSlug?: string\n schemaPath: string\n}\n\nexport type RenderConfigArgs = {\n action: Action.RenderConfig\n config: Promise<SanitizedConfig> | SanitizedConfig\n i18n: I18nClient\n importMap: ImportMap\n languageCode: AcceptedLanguages\n serverProps?: any\n} & (RenderEntityConfigArgs | RenderFieldConfigArgs | RenderRootConfigArgs)\n\nexport type PayloadServerAction = (\n args:\n | {\n [key: string]: any\n action: Action\n i18n: I18nClient\n }\n | RenderConfigArgs,\n) => Promise<string>\n\nexport type RenderedField = {\n Field: React.ReactNode\n indexPath?: string\n initialSchemaPath?: string\n isSidebar: boolean\n path: string\n schemaPath: string\n type: FieldTypes\n}\n\nexport type FieldRow = {\n RowLabel?: React.ReactNode\n}\n\nexport type DocumentSlots = {\n Description?: React.ReactNode\n PreviewButton?: React.ReactNode\n PublishButton?: React.ReactNode\n SaveButton?: React.ReactNode\n SaveDraftButton?: React.ReactNode\n Upload?: React.ReactNode\n}\n\nexport type { LanguageOptions } from './LanguageOptions.js'\n\nexport type { RichTextAdapter, RichTextAdapterProvider, RichTextHooks } from './RichText.js'\n\nexport type {\n AdminViewComponent,\n AdminViewConfig,\n AdminViewProps,\n ClientSideEditViewProps,\n EditViewProps,\n InitPageResult,\n ServerSideEditViewProps,\n VisibleEntities,\n} from './views/types.js'\n\ntype SchemaPath = {} & string\nexport type FieldSchemaMap = Map<\n SchemaPath,\n | {\n fields: Field[]\n }\n | Block\n | Field\n | Tab\n>\n\nexport type ClientFieldSchemaMap = Map<\n SchemaPath,\n | {\n fields: ClientField[]\n }\n | ClientBlock\n | ClientField\n | ClientTab\n>\n"],"names":["Action"],"mappings":"AA6ZA,OAAO,IAAA,AAAKA,gCAAAA;;WAAAA;MAEX"}
1
+ {"version":3,"sources":["../../src/admin/types.ts"],"sourcesContent":["import type { AcceptedLanguages, I18nClient } from '@payloadcms/translations'\nimport type React from 'react'\n\nimport type { ImportMap } from '../bin/generateImportMap/index.js'\nimport type { SanitizedConfig } from '../config/types.js'\nimport type {\n Block,\n ClientBlock,\n ClientField,\n Field,\n FieldTypes,\n Tab,\n} from '../fields/config/types.js'\nimport type { JsonObject } from '../types/index.js'\nimport type { ClientTab } from './fields/Tabs.js'\nimport type {\n BuildFormStateArgs,\n Data,\n FieldState,\n FieldStateWithoutComponents,\n FilterOptionsResult,\n FormState,\n FormStateWithoutComponents,\n Row,\n} from './forms/Form.js'\n\nexport type { DefaultCellComponentProps, DefaultServerCellComponentProps } from './elements/Cell.js'\nexport type { ConditionalDateProps } from './elements/DatePicker.js'\nexport type { DayPickerProps, SharedProps, TimePickerProps } from './elements/DatePicker.js'\nexport type { NavGroupPreferences, NavPreferences } from './elements/Nav.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'\n\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 BlocksFieldClientComponent,\n BlocksFieldClientProps,\n BlocksFieldDescriptionClientComponent,\n BlocksFieldDescriptionServerComponent,\n BlocksFieldErrorClientComponent,\n BlocksFieldErrorServerComponent,\n BlocksFieldLabelClientComponent,\n BlocksFieldLabelServerComponent,\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 JoinFieldClientComponent,\n JoinFieldClientProps,\n JoinFieldDescriptionClientComponent,\n JoinFieldDescriptionServerComponent,\n JoinFieldErrorClientComponent,\n JoinFieldErrorServerComponent,\n JoinFieldLabelClientComponent,\n JoinFieldLabelServerComponent,\n JoinFieldServerComponent,\n JoinFieldServerProps,\n} from './fields/Join.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 UIFieldClientComponent,\n UIFieldClientProps,\n UIFieldServerComponent,\n UIFieldServerProps,\n} from './fields/UI.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 {\n BuildFormStateArgs,\n Data,\n FieldState as FormField,\n FieldStateWithoutComponents as FormFieldWithoutComponents,\n FilterOptionsResult,\n FormState,\n FormStateWithoutComponents,\n Row,\n}\n\nexport type {\n ClientComponentProps,\n ClientFieldBase,\n ClientFieldWithOptionalType,\n FieldClientComponent,\n FieldPaths,\n FieldServerComponent,\n ServerComponentProps,\n ServerFieldBase,\n} from './forms/Field.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 {\n BuildTableStateArgs,\n DefaultServerFunctionArgs,\n ListQuery,\n ServerFunction,\n ServerFunctionArgs,\n ServerFunctionClient,\n ServerFunctionClientArgs,\n ServerFunctionConfig,\n ServerFunctionHandler,\n} from './functions/index.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 enum Action {\n RenderConfig = 'render-config',\n}\n\nexport type RenderEntityConfigArgs = {\n collectionSlug?: string\n data?: Data\n globalSlug?: string\n}\n\nexport type RenderRootConfigArgs = {}\n\nexport type RenderFieldConfigArgs = {\n collectionSlug?: string\n formState?: FormState\n globalSlug?: string\n schemaPath: string\n}\n\nexport type RenderConfigArgs = {\n action: Action.RenderConfig\n config: Promise<SanitizedConfig> | SanitizedConfig\n i18n: I18nClient\n importMap: ImportMap\n languageCode: AcceptedLanguages\n serverProps?: any\n} & (RenderEntityConfigArgs | RenderFieldConfigArgs | RenderRootConfigArgs)\n\nexport type PayloadServerAction = (\n args:\n | {\n [key: string]: any\n action: Action\n i18n: I18nClient\n }\n | RenderConfigArgs,\n) => Promise<string>\n\nexport type RenderedField = {\n Field: React.ReactNode\n indexPath?: string\n initialSchemaPath?: string\n isSidebar: boolean\n path: string\n schemaPath: string\n type: FieldTypes\n}\n\nexport type FieldRow = {\n RowLabel?: React.ReactNode\n}\n\nexport type DocumentSlots = {\n Description?: React.ReactNode\n PreviewButton?: React.ReactNode\n PublishButton?: React.ReactNode\n SaveButton?: React.ReactNode\n SaveDraftButton?: React.ReactNode\n Upload?: React.ReactNode\n}\n\nexport type { LanguageOptions } from './LanguageOptions.js'\n\nexport type { RichTextAdapter, RichTextAdapterProvider, RichTextHooks } from './RichText.js'\n\nexport type {\n AdminViewComponent,\n AdminViewConfig,\n AdminViewProps,\n ClientSideEditViewProps,\n EditViewProps,\n InitPageResult,\n ServerSideEditViewProps,\n VisibleEntities,\n} from './views/types.js'\n\ntype SchemaPath = {} & string\nexport type FieldSchemaMap = Map<\n SchemaPath,\n | {\n fields: Field[]\n }\n | Block\n | Field\n | Tab\n>\n\nexport type ClientFieldSchemaMap = Map<\n SchemaPath,\n | {\n fields: ClientField[]\n }\n | ClientBlock\n | ClientField\n | ClientTab\n>\n\nexport type DocumentEvent = {\n entitySlug: string\n id?: number | string\n updatedAt: string\n}\n"],"names":["Action"],"mappings":"AA6ZA,OAAO,IAAA,AAAKA,gCAAAA;;WAAAA;MAEX"}
@@ -1 +1 @@
1
- {"version":3,"file":"generateTypes.d.ts","sourceRoot":"","sources":["../../src/bin/generateTypes.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAMzD,wBAAsB,aAAa,CACjC,MAAM,EAAE,eAAe,EACvB,OAAO,CAAC,EAAE;IAAE,GAAG,EAAE,OAAO,CAAA;CAAE,GACzB,OAAO,CAAC,IAAI,CAAC,CAqDf"}
1
+ {"version":3,"file":"generateTypes.d.ts","sourceRoot":"","sources":["../../src/bin/generateTypes.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAMzD,wBAAsB,aAAa,CACjC,MAAM,EAAE,eAAe,EACvB,OAAO,CAAC,EAAE;IAAE,GAAG,EAAE,OAAO,CAAA;CAAE,GACzB,OAAO,CAAC,IAAI,CAAC,CA0Df"}
@@ -11,10 +11,12 @@ export async function generateTypes(config, options) {
11
11
  if (shouldLog) {
12
12
  logger.info('Compiling TS types for Collections and Globals...');
13
13
  }
14
+ const languages = Object.keys(config.i18n.supportedLanguages);
15
+ const language = languages.includes('en') ? 'en' : config.i18n.fallbackLanguage;
14
16
  const i18n = await initI18n({
15
17
  config: config.i18n,
16
18
  context: 'api',
17
- language: 'en'
19
+ language
18
20
  });
19
21
  const jsonSchema = configToJSONSchema(config, config.db.defaultIDType, i18n);
20
22
  const declare = `declare module 'payload' {\n export interface GeneratedTypes extends Config {}\n}`;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/bin/generateTypes.ts"],"sourcesContent":["import { initI18n } from '@payloadcms/translations'\nimport fs from 'fs'\nimport { compile } from 'json-schema-to-typescript'\n\nimport type { SanitizedConfig } from '../config/types.js'\n\nimport { addSelectGenericsToGeneratedTypes } from '../utilities/addSelectGenericsToGeneretedTypes.js'\nimport { configToJSONSchema } from '../utilities/configToJSONSchema.js'\nimport { getLogger } from '../utilities/logger.js'\n\nexport async function generateTypes(\n config: SanitizedConfig,\n options?: { log: boolean },\n): Promise<void> {\n const logger = getLogger('payload', 'sync')\n const outputFile = process.env.PAYLOAD_TS_OUTPUT_PATH || config.typescript.outputFile\n\n const shouldLog = options?.log ?? true\n\n if (shouldLog) {\n logger.info('Compiling TS types for Collections and Globals...')\n }\n const i18n = await initI18n({ config: config.i18n, context: 'api', language: 'en' })\n\n const jsonSchema = configToJSONSchema(config, config.db.defaultIDType, i18n)\n\n const declare = `declare module 'payload' {\\n export interface GeneratedTypes extends Config {}\\n}`\n const declareWithTSIgnoreError = `declare module 'payload' {\\n // @ts-ignore \\n export interface GeneratedTypes extends Config {}\\n}`\n\n let compiled = await compile(jsonSchema, 'Config', {\n bannerComment:\n '/* tslint:disable */\\n/* eslint-disable */\\n/**\\n* This file was automatically generated by Payload.\\n* DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,\\n* and re-run `payload generate:types` to regenerate this file.\\n*/',\n style: {\n singleQuote: true,\n },\n // Generates code for $defs that aren't referenced by the schema. Reason:\n // If a field defines an interfaceName, it should be included in the generated types\n // even if it's not used by another type. Reason: the user might want to use it in their own code.\n unreachableDefinitions: true,\n })\n\n compiled = addSelectGenericsToGeneratedTypes({ compiledGeneratedTypes: compiled })\n\n if (config.typescript.declare !== false) {\n if (config.typescript.declare?.ignoreTSError) {\n compiled += `\\n\\n${declareWithTSIgnoreError}`\n } else {\n compiled += `\\n\\n${declare}`\n }\n }\n\n // Diff the compiled types against the existing types file\n try {\n const existingTypes = fs.readFileSync(outputFile, 'utf-8')\n\n if (compiled === existingTypes) {\n return\n }\n } catch (_) {\n // swallow err\n }\n\n fs.writeFileSync(outputFile, compiled)\n if (shouldLog) {\n logger.info(`Types written to ${outputFile}`)\n }\n}\n"],"names":["initI18n","fs","compile","addSelectGenericsToGeneratedTypes","configToJSONSchema","getLogger","generateTypes","config","options","logger","outputFile","process","env","PAYLOAD_TS_OUTPUT_PATH","typescript","shouldLog","log","info","i18n","context","language","jsonSchema","db","defaultIDType","declare","declareWithTSIgnoreError","compiled","bannerComment","style","singleQuote","unreachableDefinitions","compiledGeneratedTypes","ignoreTSError","existingTypes","readFileSync","_","writeFileSync"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,OAAOC,QAAQ,KAAI;AACnB,SAASC,OAAO,QAAQ,4B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AAW;QACbN,OAAOQ,IAAI,CAAC,CAAC,iBAAiB,EAAEP,YAAY;IAC9C;AACF"}
1
+ {"version":3,"sources":["../../src/bin/generateTypes.ts"],"sourcesContent":["import type { AcceptedLanguages } from '@payloadcms/translations'\n\nimport { initI18n } from '@payloadcms/translations'\nimport fs from 'fs'\nimport { compile } from 'json-schema-to-typescript'\n\nimport type { SanitizedConfig } from '../config/types.js'\n\nimport { addSelectGenericsToGeneratedTypes } from '../utilities/addSelectGenericsToGeneretedTypes.js'\nimport { configToJSONSchema } from '../utilities/configToJSONSchema.js'\nimport { getLogger } from '../utilities/logger.js'\n\nexport async function generateTypes(\n config: SanitizedConfig,\n options?: { log: boolean },\n): Promise<void> {\n const logger = getLogger('payload', 'sync')\n const outputFile = process.env.PAYLOAD_TS_OUTPUT_PATH || config.typescript.outputFile\n\n const shouldLog = options?.log ?? true\n\n if (shouldLog) {\n logger.info('Compiling TS types for Collections and Globals...')\n }\n\n const languages = Object.keys(config.i18n.supportedLanguages) as AcceptedLanguages[]\n\n const language = languages.includes('en') ? 'en' : config.i18n.fallbackLanguage\n\n const i18n = await initI18n({ config: config.i18n, context: 'api', language })\n\n const jsonSchema = configToJSONSchema(config, config.db.defaultIDType, i18n)\n\n const declare = `declare module 'payload' {\\n export interface GeneratedTypes extends Config {}\\n}`\n const declareWithTSIgnoreError = `declare module 'payload' {\\n // @ts-ignore \\n export interface GeneratedTypes extends Config {}\\n}`\n\n let compiled = await compile(jsonSchema, 'Config', {\n bannerComment:\n '/* tslint:disable */\\n/* eslint-disable */\\n/**\\n* This file was automatically generated by Payload.\\n* DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,\\n* and re-run `payload generate:types` to regenerate this file.\\n*/',\n style: {\n singleQuote: true,\n },\n // Generates code for $defs that aren't referenced by the schema. Reason:\n // If a field defines an interfaceName, it should be included in the generated types\n // even if it's not used by another type. Reason: the user might want to use it in their own code.\n unreachableDefinitions: true,\n })\n\n compiled = addSelectGenericsToGeneratedTypes({ compiledGeneratedTypes: compiled })\n\n if (config.typescript.declare !== false) {\n if (config.typescript.declare?.ignoreTSError) {\n compiled += `\\n\\n${declareWithTSIgnoreError}`\n } else {\n compiled += `\\n\\n${declare}`\n }\n }\n\n // Diff the compiled types against the existing types file\n try {\n const existingTypes = fs.readFileSync(outputFile, 'utf-8')\n\n if (compiled === existingTypes) {\n return\n }\n } catch (_) {\n // swallow err\n }\n\n fs.writeFileSync(outputFile, compiled)\n if (shouldLog) {\n logger.info(`Types written to ${outputFile}`)\n }\n}\n"],"names":["initI18n","fs","compile","addSelectGenericsToGeneratedTypes","configToJSONSchema","getLogger","generateTypes","config","options","logger","outputFile","process","env","PAYLOAD_TS_OUTPUT_PATH","typescript","shouldLog","log","info","languages","Object","keys","i18n","supportedLanguages","language","includes","fallbackLanguage","context","jsonSchema","db","defaultIDType","declare","declareWithTSIgnoreError","compiled","bannerComment","style","singleQuote","unreachableDefinitions","compiledGeneratedTypes","ignoreTSError","existingTypes","readFileSync","_","writeFileSync"],"mappings":"AAEA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,OAAOC,QAAQ,KAAI;AACnB,SAASC,OAAO,QAAQ,4BAA2B;AAInD,SAASC,iCAAiC,QAAQ,oDAAmD;AACrG,SAASC,kBAAkB,QAAQ,qCAAoC;AACvE,SAASC,SAAS,QAAQ,yBAAwB;AAElD,OAAO,eAAeC,cACpBC,MAAuB,EACvBC,OAA0B;IAE1B,MAAMC,SAASJ,UAAU,WAAW;IACpC,MAAMK,aAAaC,QAAQC,GAAG,CAACC,sBAAsB,IAAIN,OAAOO,UAAU,CAACJ,UAAU;IAErF,MAAMK,YAAYP,SAASQ,OAAO;IAElC,IAAID,WAAW;QACbN,OAAOQ,IAAI,CAAC;IACd;IAEA,MAAMC,YAAYC,OAAOC,IAAI,CAACb,OAAOc,IAAI,CAACC,kBAAkB;IAE5D,MAAMC,WAAWL,UAAUM,QAAQ,CAAC,QAAQ,OAAOjB,OAAOc,IAAI,CAACI,gBAAg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AAgB,iBAAiB,CAAC,EAChC,cAAc,EACd,MAAM,EACN,UAAU,EACV,YAAY,EACZ,MAAM,EACN,cAAsB,EACtB,OAAO,GACR,EAAE;IACD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,WAAW,EAAE,CAsJhB"}
1
+ {"version":3,"file":"getLocalizedPaths.d.ts","sourceRoot":"","sources":["../../src/database/getLocalizedPaths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,cAAc,EAAE,MAAM,2BAA2B,CAAA;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAE7D,wBAAgB,iBAAiB,CAAC,EAChC,cAAc,EACd,MAAM,EACN,UAAU,EACV,YAAY,EACZ,MAAM,EACN,cAAsB,EACtB,OAAO,GACR,EAAE;IACD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,WAAW,EAAE,CAwKhB"}
@@ -19,12 +19,29 @@ export function getLocalizedPaths({ collectionSlug, fields, globalSlug, incoming
19
19
  const { path } = lastIncompletePath;
20
20
  let currentPath = path ? `${path}.${segment}` : segment;
21
21
  let fieldsToSearch;
22
- if (lastIncompletePath?.field && 'flattenedFields' in lastIncompletePath.field) {
23
- fieldsToSearch = lastIncompletePath.field.flattenedFields;
22
+ let matchedField;
23
+ if (lastIncompletePath?.field?.type === 'blocks') {
24
+ if (segment === 'blockType') {
25
+ matchedField = {
26
+ name: 'blockType',
27
+ type: 'text'
28
+ };
29
+ } else {
30
+ for (const block of lastIncompletePath.field.blocks){
31
+ matchedField = block.flattenedFields.find((field)=>field.name === segment);
32
+ if (matchedField) {
33
+ break;
34
+ }
35
+ }
36
+ }
24
37
  } else {
25
- fieldsToSearch = lastIncompletePath.fields;
38
+ if (lastIncompletePath?.field && 'flattenedFields' in lastIncompletePath.field) {
39
+ fieldsToSearch = lastIncompletePath.field.flattenedFields;
40
+ } else {
41
+ fieldsToSearch = lastIncompletePath.fields;
42
+ }
43
+ matchedField = fieldsToSearch.find((field)=>field.name === segment);
26
44
  }
27
- const matchedField = fieldsToSearch.find((field)=>field.name === segment);
28
45
  lastIncompletePath.field = matchedField;
29
46
  if (currentPath === 'globalType' && globalSlug) {
30
47
  lastIncompletePath.path = currentPath;
@@ -59,7 +76,6 @@ export function getLocalizedPaths({ collectionSlug, fields, globalSlug, incoming
59
76
  currentPath = `${currentPath}.${locale}`;
60
77
  }
61
78
  switch(matchedField.type){
62
- case 'blocks':
63
79
  case 'json':
64
80
  case 'richText':
65
81
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/database/getLocalizedPaths.ts"],"sourcesContent":["import type { Field, FlattenedField } from '../fields/config/types.js'\nimport type { Payload } from '../index.js'\nimport type { PathToQuery } from './queryValidation/types.js'\n\nexport function getLocalizedPaths({\n collectionSlug,\n fields,\n globalSlug,\n incomingPath,\n locale,\n overrideAccess = false,\n payload,\n}: {\n collectionSlug?: string\n fields: FlattenedField[]\n globalSlug?: string\n incomingPath: string\n locale?: string\n overrideAccess?: boolean\n payload: Payload\n}): PathToQuery[] {\n const pathSegments = incomingPath.split('.')\n const localizationConfig = payload.config.localization\n\n let paths: PathToQuery[] = [\n {\n collectionSlug,\n complete: false,\n field: undefined,\n fields,\n globalSlug,\n invalid: false,\n path: '',\n },\n ]\n\n for (let i = 0; i < pathSegments.length; i += 1) {\n const segment = pathSegments[i]\n\n const lastIncompletePath = paths.find(({ complete }) => !complete)\n\n if (lastIncompletePath) {\n const { path } = lastIncompletePath\n let currentPath = path ? `${path}.${segment}` : segment\n\n let fieldsToSearch: FlattenedField[]\n\n if (lastIncompletePath?.field && 'flattenedFields' in lastIncompletePath.field) {\n fieldsToSearch = lastIncompletePath.field.flattenedFields\n } else {\n fieldsToSearch = lastIncompletePath.fields\n }\n\n const matchedField = fieldsToSearch.find((field) => field.name === segment)\n lastIncompletePath.field = matchedField\n\n if (currentPath === 'globalType' && globalSlug) {\n lastIncompletePath.path = currentPath\n lastIncompletePath.complete = true\n lastIncompletePath.field = {\n name: 'globalType',\n type: 'text',\n }\n\n return paths\n }\n\n if (!matchedField && currentPath === 'id' && i === pathSegments.length - 1) {\n lastIncompletePath.path = currentPath\n const idField: Field = {\n name: 'id',\n type: payload.db.defaultIDType as 'text',\n }\n lastIncompletePath.field = idField\n lastIncompletePath.complete = true\n return paths\n }\n\n if (matchedField) {\n if ('hidden' in matchedField && matchedField.hidden && !overrideAccess) {\n lastIncompletePath.invalid = true\n }\n\n const nextSegment = pathSegments[i + 1]\n const nextSegmentIsLocale =\n localizationConfig && localizationConfig.localeCodes.includes(nextSegment)\n\n if (nextSegmentIsLocale) {\n // Skip the next iteration, because it's a locale\n i += 1\n currentPath = `${currentPath}.${nextSegment}`\n } else if (localizationConfig && 'localized' in matchedField && matchedField.localized) {\n currentPath = `${currentPath}.${locale}`\n }\n\n switch (matchedField.type) {\n case 'blocks':\n case 'json':\n case 'richText': {\n const upcomingSegments = pathSegments.slice(i + 1).join('.')\n lastIncompletePath.complete = true\n lastIncompletePath.path = upcomingSegments\n ? `${currentPath}.${upcomingSegments}`\n : currentPath\n return paths\n }\n\n case 'relationship':\n case 'upload': {\n // If this is a polymorphic relation,\n // We only support querying directly (no nested querying)\n if (typeof matchedField.relationTo !== 'string') {\n const lastSegmentIsValid =\n ['relationTo', 'value'].includes(pathSegments[pathSegments.length - 1]) ||\n pathSegments.length === 1 ||\n (pathSegments.length === 2 && pathSegments[0] === 'version')\n\n lastIncompletePath.path = pathSegments.join('.')\n\n if (lastSegmentIsValid) {\n lastIncompletePath.complete = true\n } else {\n lastIncompletePath.invalid = true\n return paths\n }\n } else {\n lastIncompletePath.complete = true\n lastIncompletePath.path = currentPath\n\n const nestedPathToQuery = pathSegments\n .slice(nextSegmentIsLocale ? i + 2 : i + 1)\n .join('.')\n\n if (nestedPathToQuery) {\n const relatedCollection = payload.collections[matchedField.relationTo].config\n\n const remainingPaths = getLocalizedPaths({\n collectionSlug: relatedCollection.slug,\n fields: relatedCollection.flattenedFields,\n globalSlug,\n incomingPath: nestedPathToQuery,\n locale,\n payload,\n })\n\n paths = [...paths, ...remainingPaths]\n }\n\n return paths\n }\n\n break\n }\n\n default: {\n if (i + 1 === pathSegments.length) {\n lastIncompletePath.complete = true\n }\n lastIncompletePath.path = currentPath\n }\n }\n } else {\n lastIncompletePath.invalid = true\n lastIncompletePath.path = currentPath\n return paths\n }\n }\n }\n\n return paths\n}\n"],"names":["getLocalizedPaths","collectionSlug","fields","globalSlug","incomingPath","locale","overrideAccess","payload","pathSegments","split","localizationConfig","config","localization","paths","complete","field","undefined","invalid","path","i","length","segment","lastIncompletePath","find","currentPath","fieldsToSearch","flattenedFields","matchedField","name","type","idField","db","defaultIDType","hidden","nextSegment","nextSegmentIsLocale","localeCodes","includes","localized","upcomingSegments","slice","join","relationTo","lastSegmentIsValid","nestedPathToQuery","relatedCollection","collections","remainingPaths","slug"],"mappings":"AAIA,OAAO,SAASA,kBAAkB,EAChCC,cAAc,EACdC,MAAM,EACNC,UAAU,EACVC,YAAY,EACZC,MAAM,EACNC,iBAAiB,KAAK,EACtBC,OAAO,EASR;IACC,MAAMC,eAAeJ,aAAaK,KAAK,CAAC;IACxC,MAAMC,qBAAqBH,QAAQI,MAAM,CAACC,YAAY;IAEtD,IAAIC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GAAGM;gCAE1B,MAAMoB,oBAAoBpC,aACvBgC,KAAK,CAACL,sBAAsBhB,IAAI,IAAIA,IAAI,GACxCsB,IAAI,CAAC;gCAER,IAAIG,mBAAmB;oCACrB,MAAMC,oBAAoBtC,QAAQuC,WAAW,CAACnB,aAAae,UAAU,CAAC,CAAC/B,MAAM;oCAE7E,MAAMoC,iBAAiB/C,kBAAkB;wCACvCC,gBAAgB4C,kBAAkBG,IAAI;wCACtC9C,QAAQ2C,kBAAkBnB,eAAe;wCACzCvB;wCACAC,cAAcwC;wCACdvC;wCACAE;oCACF;oCAEAM,QAAQ;2CAAIA;2CAAUkC;qCAAe;gCACvC;gCAEA,OAAOlC;4BACT;4BAEA;wBACF;oBAEA;wBAAS;4BACP,IAAIM,IAAI,MAAMX,aAAaY,MAAM,EAAE;gCACjCE,mBAAmBR,QAAQ,GAAG;4BAChC;4BACAQ,mBAAmBJ,IAAI,GAAGM;wBAC5B;gBACF;YACF,OAAO;gBACLF,mBAAmBL,OAAO,GAAG;gBAC7BK,mBAAmBJ,IAAI,GAAGM;gBAC1B,OAAOX;YACT;QACF;IACF;IAEA,OAAOA;AACT"}
1
+ {"version":3,"sources":["../../src/database/getLocalizedPaths.ts"],"sourcesContent":["import type { Field, FlattenedField } from '../fields/config/types.js'\nimport type { Payload } from '../index.js'\nimport type { PathToQuery } from './queryValidation/types.js'\n\nexport function getLocalizedPaths({\n collectionSlug,\n fields,\n globalSlug,\n incomingPath,\n locale,\n overrideAccess = false,\n payload,\n}: {\n collectionSlug?: string\n fields: FlattenedField[]\n globalSlug?: string\n incomingPath: string\n locale?: string\n overrideAccess?: boolean\n payload: Payload\n}): PathToQuery[] {\n const pathSegments = incomingPath.split('.')\n const localizationConfig = payload.config.localization\n\n let paths: PathToQuery[] = [\n {\n collectionSlug,\n complete: false,\n field: undefined,\n fields,\n globalSlug,\n invalid: false,\n path: '',\n },\n ]\n\n for (let i = 0; i < pathSegments.length; i += 1) {\n const segment = pathSegments[i]\n\n const lastIncompletePath = paths.find(({ complete }) => !complete)\n\n if (lastIncompletePath) {\n const { path } = lastIncompletePath\n let currentPath = path ? `${path}.${segment}` : segment\n\n let fieldsToSearch: FlattenedField[]\n\n let matchedField: FlattenedField\n\n if (lastIncompletePath?.field?.type === 'blocks') {\n if (segment === 'blockType') {\n matchedField = {\n name: 'blockType',\n type: 'text',\n }\n } else {\n for (const block of lastIncompletePath.field.blocks) {\n matchedField = block.flattenedFields.find((field) => field.name === segment)\n if (matchedField) {\n break\n }\n }\n }\n } else {\n if (lastIncompletePath?.field && 'flattenedFields' in lastIncompletePath.field) {\n fieldsToSearch = lastIncompletePath.field.flattenedFields\n } else {\n fieldsToSearch = lastIncompletePath.fields\n }\n\n matchedField = fieldsToSearch.find((field) => field.name === segment)\n }\n\n lastIncompletePath.field = matchedField\n\n if (currentPath === 'globalType' && globalSlug) {\n lastIncompletePath.path = currentPath\n lastIncompletePath.complete = true\n lastIncompletePath.field = {\n name: 'globalType',\n type: 'text',\n }\n\n return paths\n }\n\n if (!matchedField && currentPath === 'id' && i === pathSegments.length - 1) {\n lastIncompletePath.path = currentPath\n const idField: Field = {\n name: 'id',\n type: payload.db.defaultIDType as 'text',\n }\n lastIncompletePath.field = idField\n lastIncompletePath.complete = true\n return paths\n }\n\n if (matchedField) {\n if ('hidden' in matchedField && matchedField.hidden && !overrideAccess) {\n lastIncompletePath.invalid = true\n }\n\n const nextSegment = pathSegments[i + 1]\n const nextSegmentIsLocale =\n localizationConfig && localizationConfig.localeCodes.includes(nextSegment)\n\n if (nextSegmentIsLocale) {\n // Skip the next iteration, because it's a locale\n i += 1\n currentPath = `${currentPath}.${nextSegment}`\n } else if (localizationConfig && 'localized' in matchedField && matchedField.localized) {\n currentPath = `${currentPath}.${locale}`\n }\n\n switch (matchedField.type) {\n case 'json':\n case 'richText': {\n const upcomingSegments = pathSegments.slice(i + 1).join('.')\n lastIncompletePath.complete = true\n lastIncompletePath.path = upcomingSegments\n ? `${currentPath}.${upcomingSegments}`\n : currentPath\n return paths\n }\n\n case 'relationship':\n case 'upload': {\n // If this is a polymorphic relation,\n // We only support querying directly (no nested querying)\n if (typeof matchedField.relationTo !== 'string') {\n const lastSegmentIsValid =\n ['relationTo', 'value'].includes(pathSegments[pathSegments.length - 1]) ||\n pathSegments.length === 1 ||\n (pathSegments.length === 2 && pathSegments[0] === 'version')\n\n lastIncompletePath.path = pathSegments.join('.')\n\n if (lastSegmentIsValid) {\n lastIncompletePath.complete = true\n } else {\n lastIncompletePath.invalid = true\n return paths\n }\n } else {\n lastIncompletePath.complete = true\n lastIncompletePath.path = currentPath\n\n const nestedPathToQuery = pathSegments\n .slice(nextSegmentIsLocale ? i + 2 : i + 1)\n .join('.')\n\n if (nestedPathToQuery) {\n const relatedCollection = payload.collections[matchedField.relationTo].config\n\n const remainingPaths = getLocalizedPaths({\n collectionSlug: relatedCollection.slug,\n fields: relatedCollection.flattenedFields,\n globalSlug,\n incomingPath: nestedPathToQuery,\n locale,\n payload,\n })\n\n paths = [...paths, ...remainingPaths]\n }\n\n return paths\n }\n\n break\n }\n\n default: {\n if (i + 1 === pathSegments.length) {\n lastIncompletePath.complete = true\n }\n lastIncompletePath.path = currentPath\n }\n }\n } else {\n lastIncompletePath.invalid = true\n lastIncompletePath.path = currentPath\n return paths\n }\n }\n }\n\n return paths\n}\n"],"names":["getLocalizedPaths","collectionSlug","fields","globalSlug","incomingPath","locale","overrideAccess","payload","pathSegments","split","localizationConfig","config","localization","paths","complete","field","undefined","invalid","path","i","length","segment","lastIncompletePath","find","currentPath","fieldsToSearch","matchedField","type","name","block","blocks","flattenedFields","idField","db","defaultIDType","hidden","nextSegment","nextSegmentIsLocale","localeCodes","includes","localized","upcomingSegments","slice","join","relationTo","lastSegmentIsValid","nestedPathToQuery","relatedCollection","collections","remainingPaths","slug"],"mappings":"AAIA,OAAO,SAASA,kBAAkB,EAChCC,cAAc,EACdC,MAAM,EACNC,UAAU,EACVC,YAAY,EACZC,MAAM,EACNC,iBAAiB,KAA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ends APIError {
4
4
  constructor(t?: TFunction);
5
5
  }
6
- //# sourceMappingURL=UnathorizedError.d.ts.map
6
+ //# sourceMappingURL=UnauthorizedError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnauthorizedError.d.ts","sourceRoot":"","sources":["../../src/errors/UnauthorizedError.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAKzD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,qBAAa,iBAAkB,SAAQ,QAAQ;gBACjC,CAAC,CAAC,EAAE,SAAS;CAG1B"}
@@ -7,4 +7,4 @@ export class UnauthorizedError extends APIError {
7
7
  }
8
8
  }
9
9
 
10
- //# sourceMappingURL=UnathorizedError.js.map
10
+ //# sourceMappingURL=UnauthorizedError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/errors/UnauthorizedError.ts"],"sourcesContent":["import type { TFunction } from '@payloadcms/translations'\n\nimport { en } from '@payloadcms/translations/languages/en'\nimport httpStatus from 'http-status'\n\nimport { APIError } from './APIError.js'\n\nexport class UnauthorizedError extends APIError {\n constructor(t?: TFunction) {\n super(t ? t('error:unauthorized') : en.translations.error.unauthorized, httpStatus.UNAUTHORIZED)\n }\n}\n"],"names":["en","httpStatus","APIError","UnauthorizedError","constructor","t","translations","error","unauthorized","UNAUTHORIZED"],"mappings":"AAEA,SAASA,EAAE,QAAQ,wCAAuC;AAC1D,OAAOC,gBAAgB,cAAa;AAEpC,SAASC,QAAQ,QAAQ,gBAAe;AAExC,OAAO,MAAMC,0BAA0BD;IACrCE,YAAYC,CAAa,CAAE;QACzB,KAAK,CAACA,IAAIA,EAAE,wBAAwBL,GAAGM,YAAY,CAACC,KAAK,CAACC,YAAY,EAAEP,WAAWQ,YAAY;IACjG;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"baseIDField.d.ts","sourceRoot":"","sources":["../../../src/fields/baseFields/baseIDField.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAKnD,eAAO,MAAM,WAAW,EAAE,SA2BzB,CAAA"}
1
+ {"version":3,"file":"baseIDField.d.ts","sourceRoot":"","sources":["../../../src/fields/baseFields/baseIDField.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAKnD,eAAO,MAAM,WAAW,EAAE,SAYzB,CAAA"}
@@ -9,20 +9,10 @@ export const baseIDField = {
9
9
  defaultValue: ()=>new ObjectId().toHexString(),
10
10
  hooks: {
11
11
  beforeChange: [
12
- ({ operation, value })=>{
13
- // If creating new doc, need to disregard any
14
- // ids that have been passed in because they will cause
15
- // primary key unique conflicts in relational DBs
16
- if (!value || operation === 'create' && value) {
17
- return new ObjectId().toHexString();
18
- }
19
- return value;
20
- }
12
+ ({ value })=>value || new ObjectId().toHexString()
21
13
  ],
22
14
  beforeDuplicate: [
23
- ()=>{
24
- return new ObjectId().toHexString();
25
- }
15
+ ()=>new ObjectId().toHexString()
26
16
  ]
27
17
  },
28
18
  label: 'ID'
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/baseFields/baseIDField.ts"],"sourcesContent":["import ObjectIdImport from 'bson-objectid'\n\nimport type { TextField } from '../config/types.js'\n\nconst ObjectId = (ObjectIdImport.default ||\n ObjectIdImport) as unknown as typeof ObjectIdImport.default\n\nexport const baseIDField: TextField = {\n name: 'id',\n type: 'text',\n admin: {\n hidden: true,\n },\n defaultValue: () => new ObjectId().toHexString(),\n hooks: {\n beforeChange: [\n ({ operation, value }) => {\n // If creating new doc, need to disregard any\n // ids that have been passed in because they will cause\n // primary key unique conflicts in relational DBs\n if (!value || (operation === 'create' && value)) {\n return new ObjectId().toHexString()\n }\n\n return value\n },\n ],\n beforeDuplicate: [\n () => {\n return new ObjectId().toHexString()\n },\n ],\n },\n label: 'ID',\n}\n"],"names":["ObjectIdImport","ObjectId","default","baseIDField","name","type","admin","hidden","defaultValue","toHexString","hooks","beforeChange","operation","value","beforeDuplicate","label"],"mappings":"AAAA,OAAOA,oBAAoB,gBAAe;AAI1C,MAAMC,WAAYD,eAAeE,OAAO,IACtCF;AAEF,OAAO,MAAMG,cAAyB;IACpCC,MAAM;IACNC,MAAM;IACNC,OAAO;QACLC,QAAQ;IACV;IACAC,cAAc,IAAM,IAAIP,WAAWQ,WAAW;IAC9CC,OAAO;QACLC,cAAc;YACZ,CAAC,EAAEC,SAAS,EAAEC,KAAK,EAAE;gBACnB,6CAA6C;gBAC7C,uDAAuD;gBACvD,iDAAiD;gBACjD,IAAI,CAACA,SAAUD,cAAc,YAAYC,OAAQ;oBAC/C,OAAO,IAAIZ,WAAWQ,WAAW;gBACnC;gBAEA,OAAOI;YACT;SACD;QACDC,iBAAiB;YACf;gBACE,OAAO,IAAIb,WAAWQ,WAAW;YACnC;SACD;IACH;IACAM,OAAO;AACT,EAAC"}
1
+ {"version":3,"sources":["../../../src/fields/baseFields/baseIDField.ts"],"sourcesContent":["import ObjectIdImport from 'bson-objectid'\n\nimport type { TextField } from '../config/types.js'\n\nconst ObjectId = (ObjectIdImport.default ||\n ObjectIdImport) as unknown as typeof ObjectIdImport.default\n\nexport const baseIDField: TextField = {\n name: 'id',\n type: 'text',\n admin: {\n hidden: true,\n },\n defaultValue: () => new ObjectId().toHexString(),\n hooks: {\n beforeChange: [({ value }) => value || new ObjectId().toHexString()],\n beforeDuplicate: [() => new ObjectId().toHexString()],\n },\n label: 'ID',\n}\n"],"names":["ObjectIdImport","ObjectId","default","baseIDField","name","type","admin","hidden","defaultValue","toHexString","hooks","beforeChange","value","beforeDuplicate","label"],"mappings":"AAAA,OAAOA,oBAAoB,gBAAe;AAI1C,MAAMC,WAAYD,eAAeE,OAAO,IACtCF;AAEF,OAAO,MAAMG,cAAyB;IACpCC,MAAM;IACNC,MAAM;IACNC,OAAO;QACLC,QAAQ;IACV;IACAC,cAAc,IAAM,IAAIP,WAAWQ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AAe,CAAC,EAAE,OAAO,CAAA;IACzB,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,IAAI,EAAE,UAAU,CAAA;IAChB,SAAS,EAAE,SAAS,CAAA;CACrB,KAAG,WAAW,EAkCd,CAAA"}
@@ -202,6 +202,7 @@ export const createClientField = ({ defaultIDType, field: incomingField, i18n, i
202
202
  if (serverOnlyFieldProperties.includes(key)) {
203
203
  continue;
204
204
  }
205
+ const tabProp = tab[key];
205
206
  if (key === 'fields') {
206
207
  clientTab.fields = createClientFields({
207
208
  defaultIDType,
@@ -210,8 +211,12 @@ export const createClientField = ({ defaultIDType, field: incomingField, i18n, i
210
211
  i18n,
211
212
  importMap
212
213
  });
214
+ } else if ((key === 'label' || key === 'description') && typeof tabProp === 'function') {
215
+ clientTab[key] = tabProp({
216
+ t: i18n.t
217
+ });
213
218
  } else {
214
- clientTab[key] = tab[key];
219
+ clientTab[key] = tabProp;
215
220
  }
216
221
  }
217
222
  field.tabs[i] = clientTab;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/fields/config/client.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\n\nimport type {\n AdminClient,\n BlockJSX,\n BlocksFieldClient,\n ClientBlock,\n ClientField,\n Field,\n FieldBase,\n JoinFieldClient,\n LabelsClient,\n RadioFieldClient,\n RowFieldClient,\n SelectFieldClient,\n TabsFieldClient,\n} from '../../fields/config/types.js'\nimport type { Payload } from '../../types/index.js'\n\nimport { getFromImportMap } from '../../bin/generateImportMap/getFromImportMap.js'\nimport { MissingEditorProp } from '../../errors/MissingEditorProp.js'\nimport { fieldAffectsData } from '../../fields/config/types.js'\nimport { flattenTopLevelFields, type ImportMap } from '../../index.js'\nimport { removeUndefined } from '../../utilities/removeUndefined.js'\n\n// Should not be used - ClientField should be used instead. This is why we don't export ClientField, we don't want people\n// to accidentally use it instead of ClientField and get confused\n\nexport { ClientField }\n\nexport type ServerOnlyFieldProperties =\n | 'dbName' // can be a function\n | 'editor' // This is a `richText` only property\n | 'enumName' // can be a function\n | 'filterOptions' // This is a `relationship` and `upload` only property\n | 'graphQL'\n | 'label'\n | 'typescriptSchema'\n | 'validate'\n | keyof Pick<FieldBase, 'access' | 'custom' | 'defaultValue' | 'hooks'>\n\nexport type ServerOnlyFieldAdminProperties = keyof Pick<\n FieldBase['admin'],\n 'components' | 'condition'\n>\n\nconst serverOnlyFieldProperties: Partial<ServerOnlyFieldProperties>[] = [\n 'hooks',\n 'access',\n 'validate',\n 'defaultValue',\n 'filterOptions', // This is a `relationship` and `upload` only property\n 'editor', // This is a `richText` only property\n 'custom',\n 'typescriptSchema',\n 'dbName', // can be a function\n 'enumName', // can be a function\n 'graphQL', // client does not need graphQL\n // the following props are handled separately (see below):\n // `label`\n // `fields`\n // `blocks`\n // `tabs`\n // `admin`\n]\nconst serverOnlyFieldAdminProperties: Partial<ServerOnlyFieldAdminProperties>[] = [\n 'condition',\n 'components',\n]\ntype FieldWithDescription = {\n admin: AdminClient\n} & ClientField\n\nexport const createClientField = ({\n defaultIDType,\n field: incomingField,\n i18n,\n importMap,\n}: {\n defaultIDType: Payload['config']['db']['defaultIDType']\n field: Field\n i18n: I18nClient\n importMap: ImportMap\n}): ClientField => {\n const clientField: ClientField = {} as ClientField\n\n for (const key in incomingField) {\n if (serverOnlyFieldProperties.includes(key as any)) {\n continue\n }\n\n switch (key) {\n case 'admin':\n if (!incomingField.admin) {\n break\n }\n\n clientField.admin = {} as AdminClient\n\n for (const adminKey in incomingField.admin) {\n if (serverOnlyFieldAdminProperties.includes(adminKey as any)) {\n continue\n }\n\n switch (adminKey) {\n case 'description':\n if ('description' in incomingField.admin) {\n if (typeof incomingField.admin?.description !== 'function') {\n ;(clientField as FieldWithDescription).admin.description =\n incomingField.admin.description\n }\n }\n\n break\n\n default:\n clientField.admin[adminKey] = incomingField.admin[adminKey]\n }\n }\n\n break\n\n case 'blocks':\n case 'fields':\n case 'tabs':\n // Skip - we handle sub-fields in the switch below\n break\n\n case 'label':\n //@ts-expect-error - would need to type narrow\n if (typeof incomingField.label === 'function') {\n //@ts-expect-error - would need to type narrow\n clientField.label = incomingField.label({ t: i18n.t })\n } else {\n //@ts-expect-error - would need to type narrow\n clientField.label = incomingField.label\n }\n\n break\n\n default:\n clientField[key] = incomingField[key]\n }\n }\n\n switch (incomingField.type) {\n case 'array':\n case 'collapsible':\n case 'group':\n case 'row': {\n const field = clientField as unknown as RowFieldClient\n\n if (!field.fields) {\n field.fields = []\n }\n\n field.fields = createClientFields({\n defaultIDType,\n disableAddingID: incomingField.type !== 'array',\n fields: incomingField.fields,\n i18n,\n importMap,\n })\n\n break\n }\n\n case 'blocks': {\n const field = clientField as unknown as BlocksFieldClient\n\n if (incomingField.blocks?.length) {\n for (let i = 0; i < incomingField.blocks.length; i++) {\n const block = incomingField.blocks[i]\n\n // prevent $undefined from being passed through the rsc requests\n const clientBlock = removeUndefined<ClientBlock>({\n slug: block.slug,\n fields: field.blocks?.[i]?.fields || [],\n imageAltText: block.imageAltText,\n imageURL: block.imageURL,\n }) satisfies ClientBlock\n\n if (block.admin?.custom) {\n clientBlock.admin = {\n custom: block.admin.custom,\n }\n }\n\n if (block?.admin?.jsx) {\n const jsxResolved = getFromImportMap<BlockJSX>({\n importMap,\n PayloadComponent: block.admin.jsx,\n schemaPath: '',\n })\n clientBlock.jsx = jsxResolved\n }\n\n if (block.labels) {\n clientBlock.labels = {} as unknown as LabelsClient\n\n if (block.labels.singular) {\n if (typeof block.labels.singular === 'function') {\n clientBlock.labels.singular = block.labels.singular({ t: i18n.t })\n } else {\n clientBlock.labels.singular = block.labels.singular\n }\n if (typeof block.labels.plural === 'function') {\n clientBlock.labels.plural = block.labels.plural({ t: i18n.t })\n } else {\n clientBlock.labels.plural = block.labels.plural\n }\n }\n }\n\n clientBlock.fields = createClientFields({\n defaultIDType,\n fields: block.fields,\n i18n,\n importMap,\n })\n\n if (!field.blocks) {\n field.blocks = []\n }\n\n field.blocks[i] = clientBlock\n }\n }\n\n break\n }\n\n case 'join': {\n const field = clientField as JoinFieldClient\n\n field.targetField = {\n relationTo: field.targetField.relationTo,\n }\n\n break\n }\n\n case 'radio':\n // falls through\n case 'select': {\n const field = clientField as RadioFieldClient | SelectFieldClient\n\n if (incomingField.options?.length) {\n for (let i = 0; i < incomingField.options.length; i++) {\n const option = incomingField.options[i]\n\n if (typeof option === 'object' && typeof option.label === 'function') {\n if (!field.options) {\n field.options = []\n }\n\n field.options[i] = {\n label: option.label({ t: i18n.t }),\n value: option.value,\n }\n }\n }\n }\n\n break\n }\n\n case 'richText': {\n if (!incomingField?.editor) {\n throw new MissingEditorProp(incomingField) // while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor\n }\n\n if (typeof incomingField?.editor === 'function') {\n throw new Error('Attempted to access unsanitized rich text editor.')\n }\n\n break\n }\n\n case 'tabs': {\n const field = clientField as unknown as TabsFieldClient\n\n if (incomingField.tabs?.length) {\n field.tabs = []\n\n for (let i = 0; i < incomingField.tabs.length; i++) {\n const tab = incomingField.tabs[i]\n const clientTab = {} as unknown as TabsFieldClient['tabs'][0]\n\n for (const key in tab) {\n if (serverOnlyFieldProperties.includes(key as any)) {\n continue\n }\n\n if (key === 'fields') {\n clientTab.fields = createClientFields({\n defaultIDType,\n disableAddingID: true,\n fields: tab.fields,\n i18n,\n importMap,\n })\n } else {\n clientTab[key] = tab[key]\n }\n }\n field.tabs[i] = clientTab\n }\n }\n\n break\n }\n\n default:\n break\n }\n\n return clientField\n}\n\nexport const createClientFields = ({\n defaultIDType,\n disableAddingID,\n fields,\n i18n,\n importMap,\n}: {\n defaultIDType: Payload['config']['db']['defaultIDType']\n disableAddingID?: boolean\n fields: Field[]\n i18n: I18nClient\n importMap: ImportMap\n}): ClientField[] => {\n const clientFields: ClientField[] = []\n\n for (let i = 0; i < fields.length; i++) {\n const field = fields[i]\n\n const clientField = createClientField({\n defaultIDType,\n field,\n i18n,\n importMap,\n })\n\n clientFields.push(clientField)\n }\n\n const hasID = flattenTopLevelFields(fields).some((f) => fieldAffectsData(f) && f.name === 'id')\n\n if (!disableAddingID && !hasID) {\n clientFields.push({\n name: 'id',\n type: defaultIDType,\n admin: {\n description: 'The unique identifier for this document',\n disableBulkEdit: true,\n disabled: true,\n hidden: true,\n },\n hidden: true,\n label: 'ID',\n })\n }\n\n return clientFields\n}\n"],"names":["getFromImportMap","MissingEditorProp","fieldAffectsData","flattenTopLevelFields","removeUndefined","serverOnlyFieldProperties","serverOnlyFieldAdminProperties","createClientField","defaultIDType","field","incomingField","i18n","importMap","clientField","key","includes","admin","adminKey","description","label","t","type","fields","createClientFields","disableAddingID","blocks","length","i","block","clientBlock","slug","imageAltText","imageURL","custom","jsx","jsxResolved","PayloadComponent","schemaPath","labels","singular","plural","targetField","relationTo","options","option","value","editor","Error","tabs","tab","clientTab","clientFields","push","hasID","some","f","name","disableBulkEdit","disabled","hidden"],"mappings":"AAmBA,SAASA,gBAAgB,QAAQ,kDAAiD;AAClF,SAASC,iBAAiB,QAAQ,oCAAmC;AACrE,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,qBAAqB,QAAwB,iBAAgB;AACtE,SAASC,eAAe,QAAQ,qCAAoC;AAuBpE,MAAMC,4BAAkE;IACtE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CAOD;AACD,MAAMC,iCAA4E;IAChF;IACA;CACD;AAKD,OAAO,MAAMC,oBAAoB,CAAC,EAChCC,aAAa,EACbC,OAAOC,aAAa,EACpBC,IAAI,EACJC,SAAS,EAMV;IACC,MAAMC,cAA2B,CAAC;IAElC,IAAK,MAAMC,OAAOJ,cAAe;QAC/B,IAAIL,0BAA0BU,QAAQ,CAACD,MAAa;YAClD;QACF;QAEA,OAAQA;YACN,KAAK;gBACH,IAAI,CAACJ,cAAcM,KAAK,EAAE;oBACxB;gBACF;gBAEAH,YAAYG,KAAK,GAAG,CAAC;gBAErB,IAAK,MAAMC,YAAYP,cAAcM,KAAK,CAAE;oBAC1C,IAAIV,+BAA+BS,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;IACF;IAEA,OAAOgC;AACT,EAAC"}
1
+ {"version":3,"sources":["../../../src/fields/config/client.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\n\nimport type {\n AdminClient,\n BlockJSX,\n BlocksFieldClient,\n ClientBlock,\n ClientField,\n Field,\n FieldBase,\n JoinFieldClient,\n LabelsClient,\n RadioFieldClient,\n RowFieldClient,\n SelectFieldClient,\n TabsFieldClient,\n} from '../../fields/config/types.js'\nimport type { Payload } from '../../types/index.js'\n\nimport { getFromImportMap } from '../../bin/generateImportMap/getFromImportMap.js'\nimport { MissingEditorProp } from '../../errors/MissingEditorProp.js'\nimport { fieldAffectsData } from '../../fields/config/types.js'\nimport { flattenTopLevelFields, type ImportMap } from '../../index.js'\nimport { removeUndefined } from '../../utilities/removeUndefined.js'\n\n// Should not be used - ClientField should be used instead. This is why we don't export ClientField, we don't want people\n// to accidentally use it instead of ClientField and get confused\n\nexport { ClientField }\n\nexport type ServerOnlyFieldProperties =\n | 'dbName' // can be a function\n | 'editor' // This is a `richText` only property\n | 'enumName' // can be a function\n | 'filterOptions' // This is a `relationship` and `upload` only property\n | 'graphQL'\n | 'label'\n | 'typescriptSchema'\n | 'validate'\n | keyof Pick<FieldBase, 'access' | 'custom' | 'defaultValue' | 'hooks'>\n\nexport type ServerOnlyFieldAdminProperties = keyof Pick<\n FieldBase['admin'],\n 'components' | 'condition'\n>\n\nconst serverOnlyFieldProperties: Partial<ServerOnlyFieldProperties>[] = [\n 'hooks',\n 'access',\n 'validate',\n 'defaultValue',\n 'filterOptions', // This is a `relationship` and `upload` only property\n 'editor', // This is a `richText` only property\n 'custom',\n 'typescriptSchema',\n 'dbName', // can be a function\n 'enumName', // can be a function\n 'graphQL', // client does not need graphQL\n // the following props are handled separately (see below):\n // `label`\n // `fields`\n // `blocks`\n // `tabs`\n // `admin`\n]\nconst serverOnlyFieldAdminProperties: Partial<ServerOnlyFieldAdminProperties>[] = [\n 'condition',\n 'components',\n]\ntype FieldWithDescription = {\n admin: AdminClient\n} & ClientField\n\nexport const createClientField = ({\n defaultIDType,\n field: incomingField,\n i18n,\n importMap,\n}: {\n defaultIDType: Payload['config']['db']['defaultIDType']\n field: Field\n i18n: I18nClient\n importMap: ImportMap\n}): ClientField => {\n const clientField: ClientField = {} as ClientField\n\n for (const key in incomingField) {\n if (serverOnlyFieldProperties.includes(key as any)) {\n continue\n }\n\n switch (key) {\n case 'admin':\n if (!incomingField.admin) {\n break\n }\n\n clientField.admin = {} as AdminClient\n\n for (const adminKey in incomingField.admin) {\n if (serverOnlyFieldAdminProperties.includes(adminKey as any)) {\n continue\n }\n\n switch (adminKey) {\n case 'description':\n if ('description' in incomingField.admin) {\n if (typeof incomingField.admin?.description !== 'function') {\n ;(clientField as FieldWithDescription).admin.description =\n incomingField.admin.description\n }\n }\n\n break\n\n default:\n clientField.admin[adminKey] = incomingField.admin[adminKey]\n }\n }\n\n break\n\n case 'blocks':\n case 'fields':\n case 'tabs':\n // Skip - we handle sub-fields in the switch below\n break\n\n case 'label':\n //@ts-expect-error - would need to type narrow\n if (typeof incomingField.label === 'function') {\n //@ts-expect-error - would need to type narrow\n clientField.label = incomingField.label({ t: i18n.t })\n } else {\n //@ts-expect-error - would need to type narrow\n clientField.label = incomingField.label\n }\n\n break\n\n default:\n clientField[key] = incomingField[key]\n }\n }\n\n switch (incomingField.type) {\n case 'array':\n case 'collapsible':\n case 'group':\n case 'row': {\n const field = clientField as unknown as RowFieldClient\n\n if (!field.fields) {\n field.fields = []\n }\n\n field.fields = createClientFields({\n defaultIDType,\n disableAddingID: incomingField.type !== 'array',\n fields: incomingField.fields,\n i18n,\n importMap,\n })\n\n break\n }\n\n case 'blocks': {\n const field = clientField as unknown as BlocksFieldClient\n\n if (incomingField.blocks?.length) {\n for (let i = 0; i < incomingField.blocks.length; i++) {\n const block = incomingField.blocks[i]\n\n // prevent $undefined from being passed through the rsc requests\n const clientBlock = removeUndefined<ClientBlock>({\n slug: block.slug,\n fields: field.blocks?.[i]?.fields || [],\n imageAltText: block.imageAltText,\n imageURL: block.imageURL,\n }) satisfies ClientBlock\n\n if (block.admin?.custom) {\n clientBlock.admin = {\n custom: block.admin.custom,\n }\n }\n\n if (block?.admin?.jsx) {\n const jsxResolved = getFromImportMap<BlockJSX>({\n importMap,\n PayloadComponent: block.admin.jsx,\n schemaPath: '',\n })\n clientBlock.jsx = jsxResolved\n }\n\n if (block.labels) {\n clientBlock.labels = {} as unknown as LabelsClient\n\n if (block.labels.singular) {\n if (typeof block.labels.singular === 'function') {\n clientBlock.labels.singular = block.labels.singular({ t: i18n.t })\n } else {\n clientBlock.labels.singular = block.labels.singular\n }\n if (typeof block.labels.plural === 'function') {\n clientBlock.labels.plural = block.labels.plural({ t: i18n.t })\n } else {\n clientBlock.labels.plural = block.labels.plural\n }\n }\n }\n\n clientBlock.fields = createClientFields({\n defaultIDType,\n fields: block.fields,\n i18n,\n importMap,\n })\n\n if (!field.blocks) {\n field.blocks = []\n }\n\n field.blocks[i] = clientBlock\n }\n }\n\n break\n }\n\n case 'join': {\n const field = clientField as JoinFieldClient\n\n field.targetField = {\n relationTo: field.targetField.relationTo,\n }\n\n break\n }\n\n case 'radio':\n // falls through\n case 'select': {\n const field = clientField as RadioFieldClient | SelectFieldClient\n\n if (incomingField.options?.length) {\n for (let i = 0; i < incomingField.options.length; i++) {\n const option = incomingField.options[i]\n\n if (typeof option === 'object' && typeof option.label === 'function') {\n if (!field.options) {\n field.options = []\n }\n\n field.options[i] = {\n label: option.label({ t: i18n.t }),\n value: option.value,\n }\n }\n }\n }\n\n break\n }\n\n case 'richText': {\n if (!incomingField?.editor) {\n throw new MissingEditorProp(incomingField) // while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor\n }\n\n if (typeof incomingField?.editor === 'function') {\n throw new Error('Attempted to access unsanitized rich text editor.')\n }\n\n break\n }\n\n case 'tabs': {\n const field = clientField as unknown as TabsFieldClient\n\n if (incomingField.tabs?.length) {\n field.tabs = []\n\n for (let i = 0; i < incomingField.tabs.length; i++) {\n const tab = incomingField.tabs[i]\n const clientTab = {} as unknown as TabsFieldClient['tabs'][0]\n\n for (const key in tab) {\n if (serverOnlyFieldProperties.includes(key as any)) {\n continue\n }\n\n const tabProp = tab[key]\n\n if (key === 'fields') {\n clientTab.fields = createClientFields({\n defaultIDType,\n disableAddingID: true,\n fields: tab.fields,\n i18n,\n importMap,\n })\n } else if (\n (key === 'label' || key === 'description') &&\n typeof tabProp === 'function'\n ) {\n clientTab[key] = tabProp({ t: i18n.t })\n } else {\n clientTab[key] = tabProp\n }\n }\n field.tabs[i] = clientTab\n }\n }\n\n break\n }\n\n default:\n break\n }\n\n return clientField\n}\n\nexport const createClientFields = ({\n defaultIDType,\n disableAddingID,\n fields,\n i18n,\n importMap,\n}: {\n defaultIDType: Payload['config']['db']['defaultIDType']\n disableAddingID?: boolean\n fields: Field[]\n i18n: I18nClient\n importMap: ImportMap\n}): ClientField[] => {\n const clientFields: ClientField[] = []\n\n for (let i = 0; i < fields.length; i++) {\n const field = fields[i]\n\n const clientField = createClientField({\n defaultIDType,\n field,\n i18n,\n importMap,\n })\n\n clientFields.push(clientField)\n }\n\n const hasID = flattenTopLevelFields(fields).some((f) => fieldAffectsData(f) && f.name === 'id')\n\n if (!disableAddingID && !hasID) {\n clientFields.push({\n name: 'id',\n type: defaultIDType,\n admin: {\n description: 'The unique identifier for this document',\n disableBulkEdit: true,\n disabled: true,\n hidden: true,\n },\n hidden: true,\n label: 'ID',\n })\n }\n\n return clientFields\n}\n"],"names":["getFromImportMap","MissingEditorProp","fieldAffectsData","flattenTopLevelFields","removeUndefined","serverOnlyFieldProperties","serverOnlyFieldAdminProperties","createClientField","defaultIDType","field","incomingField","i18n","importMap","clientField","key","includes","admin","adminKey","description","label","t","type","fields","createClientFields","disableAddingID","blocks","length","i","block","clientBlock","slug","imageAltText","imageURL","custom","jsx","jsxResolved","PayloadComponent","schemaPath","labels","singular","plural","targetField","relationTo","options","option","value","editor","Error","tabs","tab","clientTab","tabProp","clientFields","push","hasID","some","f","name","disableBulkEdit","disabled","hidden"],"mappings":"AAmBA,SAASA,gBAAgB,QAAQ,kDAAiD;AAClF,SAASC,iBAAiB,QAAQ,oCAAmC;AACrE,SAASC,gBAAgB,QAAQ,+BAA8B;AAC/D,SAASC,qBAAqB,QAAwB,iBAAgB;AACtE,SAASC,eAAe,QAAQ,qCAAoC;AAuBpE,MAAMC,4BAAkE;IACtE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CAOD;AACD,MAAMC,iCAA4E;IAChF;IACA;CACD;AAKD,OAAO,MAAMC,oBAAoB,CAAC,EAChCC,aAAa,EACbC,OAAOC,aAAa,EACpBC,IAAI,EACJC,SAAS,EAMV;IACC,MAAMC,cAA2B,CAAC;IAElC,IAAK,MAAMC,OAAOJ,cAAe;QAC/B,IAAIL,0BAA0BU,QAAQ,CAACD,MAAa;YAClD;QACF;QAEA,OAAQA;YACN,KAAK;gBACH,IAAI,CAACJ,cAAcM,KAAK,EAAE;oBACxB;gBACF;gBAEAH,YAAYG,KAAK,GAAG,CAAC;gBAErB,IAAK,MAAMC,YAAYP,cAAcM,KAAK,CAAE;oBAC1C,IAAIV,+BAA+BS,QAAQ,CAACE,WAAkB;wBAC5D;oBACF;oBAEA,OAAQA;wBACN,KAAK;4BACH,IAAI,iBAAiBP,cAAcM,KAAK,EAAE;gCACxC,IAAI,OAAON,cAAcM,KAAK,EAAEE,gBAAgB,YAAY;;oCACxDL,YAAqCG,KAAK,CAACE,WAAW,GACtDR,cAAcM,KAAK,CAACE,WAAW;gCACnC;4BACF;4BAEA;wBAEF;4BACEL,YAAYG,KAAK,CAACC,SAAS,GAAGP,cAAcM,KAAK,CAACC,SAAS;oBAC/D;gBACF;gBAEA;YAEF,KAAK;YACL,KAAK;YACL,KAAK;gBAEH;YAEF,KAAK;gBACH,8CAA8C;gBAC9C,IAAI,OAAOP,cAAcS,KAAK,KAAK,YAAY;oBAC7C,8CAA8C;oBAC9CN,YAAYM,K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,aAAY,KACxC,OAAOqC,YAAY,YACnB;gCACAD,SAAS,CAACpC,IAAI,GAAGqC,QAAQ;oCAAE/B,GAAGT,KAAKS,CAAC;gCAAC;4BACvC,OAAO;gCACL8B,SAAS,CAACpC,IAAI,GAAGqC;4BACnB;wBACF;wBACA1C,MAAMuC,IAAI,CAACrB,EAAE,GAAGuB;oBAClB;gBACF;gBAEA;YACF;QAEA;YACE;IACJ;IAEA,OAAOrC;AACT,EAAC;AAED,OAAO,MAAMU,qBAAqB,CAAC,EACjCf,aAAa,EACbgB,eAAe,EACfF,MAAM,EACNX,IAAI,EACJC,SAAS,EAOV;IACC,MAAMwC,eAA8B,EAAE;IAEtC,IAAK,IAAIzB,IAAI,GAAGA,IAAIL,OAAOI,MAAM,EAAEC,IAAK;QACtC,MAAMlB,QAAQa,MAAM,CAACK,EAAE;QAEvB,MAAMd,cAAcN,kBAAkB;YACpCC;YACAC;YACAE;YACAC;QACF;QAEAwC,aAAaC,IAAI,CAACxC;IACpB;IAEA,MAAMyC,QAAQnD,sBAAsBmB,QAAQiC,IAAI,CAAC,CAACC,IAAMtD,iBAAiBsD,MAAMA,EAAEC,IAAI,KAAK;IAE1F,IAAI,CAACjC,mBAAmB,CAAC8B,OAAO;QAC9BF,aAAaC,IAAI,CAAC;YAChBI,MAAM;YACNpC,MAAMb;YACNQ,OAAO;gBACLE,aAAa;gBACbwC,iBAAiB;gBACjBC,UAAU;gBACVC,QAAQ;YACV;YACAA,QAAQ;YACRzC,OAAO;QACT;IACF;IAEA,OAAOiC;AACT,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../../../../src/fields/hooks/beforeValidate/promise.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAc,MAAM,sCAAsC,CAAA;AACjG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAm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O,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAU9D,KAAK,IAAI,CAAC,CAAC,IAAI;IACb,UAAU,EAAE,IAAI,GAAG,yBAAyB,CAAA;IAC5C,OAAO,EAAE,cAAc,CAAA;IACvB,IAAI,EAAE,CAAC,CAAA;IACP;;OAEG;IACH,GAAG,EAAE,CAAC,CAAA;IACN,KAAK,EAAE,KAAK,GAAG,UAAU,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,IAAI,GAAG,qBAAqB,CAAA;IACpC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,SAAS,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAC9B,cAAc,EAAE,OAAO,CAAA;IACvB,UAAU,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;IAC/B,gBAAgB,EAAE,MAAM,EAAE,CAAA;IAC1B,GAAG,EAAE,cAAc,CAAA;IACnB,WAAW,EAAE,UAAU,CAAA;IACvB;;OAEG;IACH,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AASD,eAAO,MAAM,OAAO,GAAU,CAAC,6JAgB5B,IAAI,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,IAAI,CA0exB,CAAA"}
@@ -67,10 +67,6 @@ export const promise = async ({ id, collection, context, data, doc, field, field
67
67
  case 'point':
68
68
  {
69
69
  if (Array.isArray(siblingData[field.name])) {
70
- if (siblingData[field.name].some((val)=>val === null || val === '')) {
71
- siblingData[field.name] = null;
72
- break;
73
- }
74
70
  siblingData[field.name] = siblingData[field.name].map((coordinate, i)=>{
75
71
  if (typeof coordinate === 'string') {
76
72
  const value = siblingData[field.name][i];