payload 3.0.0-beta.96 → 3.0.0-beta.98

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 (149) 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/elements/Tab.d.ts +1 -1
  5. package/dist/admin/elements/Tab.d.ts.map +1 -1
  6. package/dist/admin/elements/Tab.js.map +1 -1
  7. package/dist/admin/forms/Description.d.ts +1 -1
  8. package/dist/admin/forms/Description.d.ts.map +1 -1
  9. package/dist/admin/forms/Description.js.map +1 -1
  10. package/dist/admin/forms/Error.d.ts +1 -1
  11. package/dist/admin/forms/Error.d.ts.map +1 -1
  12. package/dist/admin/forms/Error.js.map +1 -1
  13. package/dist/admin/forms/Form.d.ts +1 -1
  14. package/dist/admin/forms/Form.d.ts.map +1 -1
  15. package/dist/admin/forms/Form.js.map +1 -1
  16. package/dist/admin/forms/Label.d.ts +1 -1
  17. package/dist/admin/forms/Label.d.ts.map +1 -1
  18. package/dist/admin/forms/Label.js.map +1 -1
  19. package/dist/admin/types.d.ts +5 -5
  20. package/dist/admin/types.d.ts.map +1 -1
  21. package/dist/admin/types.js.map +1 -1
  22. package/dist/admin/views/types.d.ts +1 -1
  23. package/dist/admin/views/types.d.ts.map +1 -1
  24. package/dist/admin/views/types.js.map +1 -1
  25. package/dist/auth/operations/auth.d.ts +1 -1
  26. package/dist/auth/operations/auth.d.ts.map +1 -1
  27. package/dist/auth/operations/auth.js.map +1 -1
  28. package/dist/auth/strategies/jwt.js.map +1 -1
  29. package/dist/auth/types.d.ts +5 -5
  30. package/dist/auth/types.d.ts.map +1 -1
  31. package/dist/auth/types.js.map +1 -1
  32. package/dist/bin/generateImportMap/index.d.ts.map +1 -1
  33. package/dist/bin/generateImportMap/index.js.map +1 -1
  34. package/dist/bin/generateImportMap/iterateFields.js.map +1 -1
  35. package/dist/bin/generateTypes.js +1 -1
  36. package/dist/bin/generateTypes.js.map +1 -1
  37. package/dist/collections/config/client.d.ts +2 -2
  38. package/dist/collections/config/client.d.ts.map +1 -1
  39. package/dist/collections/config/client.js.map +1 -1
  40. package/dist/collections/config/sanitize.d.ts.map +1 -1
  41. package/dist/collections/config/sanitize.js +3 -0
  42. package/dist/collections/config/sanitize.js.map +1 -1
  43. package/dist/collections/config/types.d.ts +9 -9
  44. package/dist/collections/config/types.d.ts.map +1 -1
  45. package/dist/collections/config/types.js.map +1 -1
  46. package/dist/collections/dataloader.d.ts +1 -1
  47. package/dist/collections/dataloader.d.ts.map +1 -1
  48. package/dist/collections/dataloader.js.map +1 -1
  49. package/dist/collections/operations/utils.d.ts +1 -1
  50. package/dist/collections/operations/utils.d.ts.map +1 -1
  51. package/dist/collections/operations/utils.js.map +1 -1
  52. package/dist/config/client.d.ts +2 -2
  53. package/dist/config/client.d.ts.map +1 -1
  54. package/dist/config/client.js.map +1 -1
  55. package/dist/config/sanitize.d.ts.map +1 -1
  56. package/dist/config/sanitize.js.map +1 -1
  57. package/dist/config/types.d.ts +49 -33
  58. package/dist/config/types.d.ts.map +1 -1
  59. package/dist/config/types.js.map +1 -1
  60. package/dist/database/combineQueries.d.ts +1 -1
  61. package/dist/database/combineQueries.d.ts.map +1 -1
  62. package/dist/database/combineQueries.js.map +1 -1
  63. package/dist/database/types.d.ts +3 -3
  64. package/dist/database/types.d.ts.map +1 -1
  65. package/dist/database/types.js.map +1 -1
  66. package/dist/fields/config/sanitize.js +1 -1
  67. package/dist/fields/config/sanitize.js.map +1 -1
  68. package/dist/fields/config/types.d.ts +56 -56
  69. package/dist/fields/config/types.d.ts.map +1 -1
  70. package/dist/fields/config/types.js.map +1 -1
  71. package/dist/fields/hooks/afterChange/index.d.ts +2 -2
  72. package/dist/fields/hooks/afterChange/index.d.ts.map +1 -1
  73. package/dist/fields/hooks/afterChange/index.js.map +1 -1
  74. package/dist/fields/hooks/afterChange/promise.d.ts +2 -2
  75. package/dist/fields/hooks/afterChange/promise.d.ts.map +1 -1
  76. package/dist/fields/hooks/afterChange/promise.js.map +1 -1
  77. package/dist/fields/hooks/afterChange/traverseFields.d.ts +2 -2
  78. package/dist/fields/hooks/afterChange/traverseFields.d.ts.map +1 -1
  79. package/dist/fields/hooks/afterChange/traverseFields.js.map +1 -1
  80. package/dist/fields/hooks/afterRead/index.d.ts +2 -2
  81. package/dist/fields/hooks/afterRead/index.d.ts.map +1 -1
  82. package/dist/fields/hooks/afterRead/index.js.map +1 -1
  83. package/dist/fields/hooks/afterRead/promise.d.ts +2 -2
  84. package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -1
  85. package/dist/fields/hooks/afterRead/promise.js.map +1 -1
  86. package/dist/fields/hooks/afterRead/traverseFields.d.ts +2 -2
  87. package/dist/fields/hooks/afterRead/traverseFields.d.ts.map +1 -1
  88. package/dist/fields/hooks/afterRead/traverseFields.js.map +1 -1
  89. package/dist/fields/hooks/beforeChange/index.d.ts +2 -2
  90. package/dist/fields/hooks/beforeChange/index.d.ts.map +1 -1
  91. package/dist/fields/hooks/beforeChange/index.js.map +1 -1
  92. package/dist/fields/hooks/beforeChange/promise.d.ts +2 -2
  93. package/dist/fields/hooks/beforeChange/promise.d.ts.map +1 -1
  94. package/dist/fields/hooks/beforeChange/promise.js.map +1 -1
  95. package/dist/fields/hooks/beforeChange/traverseFields.d.ts +2 -2
  96. package/dist/fields/hooks/beforeChange/traverseFields.d.ts.map +1 -1
  97. package/dist/fields/hooks/beforeChange/traverseFields.js.map +1 -1
  98. package/dist/fields/hooks/beforeValidate/index.d.ts +2 -2
  99. package/dist/fields/hooks/beforeValidate/index.d.ts.map +1 -1
  100. package/dist/fields/hooks/beforeValidate/index.js.map +1 -1
  101. package/dist/fields/hooks/beforeValidate/promise.d.ts +2 -2
  102. package/dist/fields/hooks/beforeValidate/promise.d.ts.map +1 -1
  103. package/dist/fields/hooks/beforeValidate/promise.js.map +1 -1
  104. package/dist/fields/hooks/beforeValidate/traverseFields.d.ts +2 -2
  105. package/dist/fields/hooks/beforeValidate/traverseFields.d.ts.map +1 -1
  106. package/dist/fields/hooks/beforeValidate/traverseFields.js.map +1 -1
  107. package/dist/fields/validations.d.ts +1 -1
  108. package/dist/fields/validations.d.ts.map +1 -1
  109. package/dist/fields/validations.js.map +1 -1
  110. package/dist/globals/config/types.d.ts +2 -2
  111. package/dist/globals/config/types.d.ts.map +1 -1
  112. package/dist/globals/config/types.js.map +1 -1
  113. package/dist/index.d.ts +7 -7
  114. package/dist/index.d.ts.map +1 -1
  115. package/dist/index.js +4 -4
  116. package/dist/index.js.map +1 -1
  117. package/dist/preferences/types.d.ts.map +1 -1
  118. package/dist/preferences/types.js.map +1 -1
  119. package/dist/types/index.d.ts +3 -3
  120. package/dist/types/index.d.ts.map +1 -1
  121. package/dist/types/index.js.map +1 -1
  122. package/dist/uploads/types.d.ts.map +1 -1
  123. package/dist/uploads/types.js.map +1 -1
  124. package/dist/utilities/getSiblingData.d.ts +1 -1
  125. package/dist/utilities/getSiblingData.d.ts.map +1 -1
  126. package/dist/utilities/getSiblingData.js.map +1 -1
  127. package/dist/utilities/isReactComponent.d.ts +3 -3
  128. package/dist/utilities/isReactComponent.d.ts.map +1 -1
  129. package/dist/utilities/isReactComponent.js.map +1 -1
  130. package/dist/utilities/isValidID.d.ts +1 -1
  131. package/dist/utilities/isValidID.d.ts.map +1 -1
  132. package/dist/utilities/isValidID.js.map +1 -1
  133. package/dist/utilities/logger.d.ts +8 -3
  134. package/dist/utilities/logger.d.ts.map +1 -1
  135. package/dist/utilities/logger.js +22 -14
  136. package/dist/utilities/logger.js.map +1 -1
  137. package/dist/utilities/reduceFieldsToValues.d.ts +1 -1
  138. package/dist/utilities/reduceFieldsToValues.d.ts.map +1 -1
  139. package/dist/utilities/reduceFieldsToValues.js.map +1 -1
  140. package/dist/utilities/telemetry/conf/index.d.ts +1 -1
  141. package/dist/utilities/telemetry/conf/index.d.ts.map +1 -1
  142. package/dist/utilities/telemetry/conf/index.js +8 -8
  143. package/dist/utilities/telemetry/conf/index.js.map +1 -1
  144. package/dist/versions/drafts/appendVersionToQueryKey.js +1 -1
  145. package/dist/versions/drafts/appendVersionToQueryKey.js.map +1 -1
  146. package/dist/versions/types.d.ts +4 -4
  147. package/dist/versions/types.d.ts.map +1 -1
  148. package/dist/versions/types.js.map +1 -1
  149. package/package.json +3 -3
@@ -71,14 +71,14 @@ export type BeforeChangeRichTextHookArgs<TData extends TypeWithID = any, TValue
71
71
  };
72
72
  export type BaseRichTextHookArgs<TData extends TypeWithID = any, TValue = any, TSiblingData = any> = {
73
73
  /** The collection which the field belongs to. If the field belongs to a global, this will be null. */
74
- collection: SanitizedCollectionConfig | null;
74
+ collection: null | SanitizedCollectionConfig;
75
75
  context: RequestContext;
76
76
  /** The data passed to update the document within create and update operations, and the full document itself in the afterRead hook. */
77
77
  data?: Partial<TData>;
78
78
  /** The field which the hook is running against. */
79
79
  field: FieldAffectingData;
80
80
  /** The global which the field belongs to. If the field belongs to a collection, this will be null. */
81
- global: SanitizedGlobalConfig | null;
81
+ global: null | SanitizedGlobalConfig;
82
82
  /** The full original document in `update` operations. In the `afterChange` hook, this is the resulting document of the operation. */
83
83
  originalDoc?: TData;
84
84
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"RichText.d.ts","sourceRoot":"","sources":["../../src/admin/RichText.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAC3F,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACnF,OAAO,KAAK,E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AM,eAAe,CACzB,KAAK,SAAS,MAAM,GAAG,GAAG,EAC1B,YAAY,GAAG,GAAG,EAClB,oBAAoB,GAAG,GAAG,IACxB;IACF,aAAa,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAA;IACtC,cAAc,EAAE,gBAAgB,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAA;CAC5D,GAAG,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAA;AAElE,MAAM,MAAM,uBAAuB,CACjC,KAAK,SAAS,MAAM,GAAG,MAAM,EAC7B,YAAY,GAAG,GAAG,EAClB,oBAAoB,GAAG,EAAE,IACvB,CAAC,EACH,MAAM,EACN,MAAM,EACN,iBAAiB,GAClB,EAAE;IACD,MAAM,EAAE,eAAe,CAAA;IACvB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,iBAAiB,EAAE,OAAO,CAAA;CAC3B,KACG,OAAO,CAAC,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC,GACnE,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/admin/RichText.ts"],"sourcesContent":["import type { GenericLanguages, I18n, I18nClient } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\n\nimport type { ImportMap } from '../bin/generateImportMap/index.js'\nimport type { SanitizedCollectionConfig, TypeWithID } from '../collections/config/types.js'\nimport type { Config, PayloadComponent, SanitizedConfig } from '../config/types.js'\nimport type {\n Field,\n FieldAffectingData,\n RichTextField,\n RichTextFieldClient,\n Validate,\n} from '../fields/config/types.js'\nimport type { SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { JsonObject, Payload, PayloadRequest, RequestContext } from '../types/index.js'\nimport type { RichTextFieldProps } from './fields/RichText.js'\nimport type { CreateMappedComponent } from './types.js'\n\nexport type AfterReadRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n currentDepth?: number\n\n depth?: number\n\n draft?: boolean\n\n fallbackLocale?: string\n\n fieldPromises?: Promise<void>[]\n\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany?: boolean\n\n flattenLocales?: boolean\n\n locale?: string\n\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n\n overrideAccess?: boolean\n\n populationPromises?: Promise<void>[]\n showHiddenFields?: boolean\n triggerAccessControl?: boolean\n triggerHooks?: boolean\n}\n\nexport type AfterChangeRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n /** The document before changes were applied. */\n previousDoc?: TData\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\nexport type BeforeValidateRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n overrideAccess?: boolean\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\n\nexport type BeforeChangeRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /**\n * The original data with locales (not modified by any hooks). Only available in `beforeChange` and `beforeDuplicate` field hooks.\n */\n docWithLocales?: JsonObject\n\n duplicate?: boolean\n\n errors?: { field: string; message: string }[]\n /** Only available in `beforeChange` field hooks */\n mergeLocaleActions?: (() => Promise<void>)[]\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n /**\n * The original siblingData with locales (not modified by any hooks).\n */\n siblingDocWithLocales?: JsonObject\n\n skipValidation?: boolean\n}\n\nexport type BaseRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** The collection which the field belongs to. If the field belongs to a global, this will be null. */\n collection: SanitizedCollectionConfig | null\n context: RequestContext\n /** The data passed to update the document within create and update operations, and the full document itself in the afterRead hook. */\n data?: Partial<TData>\n /** The field which the hook is running against. */\n field: FieldAffectingData\n /** The global which the field belongs to. If the field belongs to a collection, this will be null. */\n global: SanitizedGlobalConfig | null\n\n /** The full original document in `update` operations. In the `afterChange` hook, this is the resulting document of the operation. */\n originalDoc?: TData\n /**\n * The path of the field, e.g. [\"group\", \"myArray\", 1, \"textField\"]. The path is the schemaPath but with indexes and would be used in the context of field data, not field schemas.\n */\n path: (number | string)[]\n\n /** The Express request object. It is mocked for Local API operations. */\n req: PayloadRequest\n /**\n * The schemaPath of the field, e.g. [\"group\", \"myArray\", \"textField\"]. The schemaPath is the path but without indexes and would be used in the context of field schemas, not field data.\n */\n schemaPath: string[]\n /** The sibling data passed to a field that the hook is running against. */\n siblingData: Partial<TSiblingData>\n /** The value of the field. */\n value?: TValue\n}\n\nexport type AfterReadRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: AfterReadRichTextHookArgs<TData, TValue, TSiblingData> &\n BaseRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type AfterChangeRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: AfterChangeRichTextHookArgs<TData, TValue, TSiblingData> &\n BaseRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type BeforeChangeRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: BaseRichTextHookArgs<TData, TValue, TSiblingData> &\n BeforeChangeRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type BeforeValidateRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: BaseRichTextHookArgs<TData, TValue, TSiblingData> &\n BeforeValidateRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type RichTextHooks = {\n afterChange?: AfterChangeRichTextHook[]\n afterRead?: AfterReadRichTextHook[]\n beforeChange?: BeforeChangeRichTextHook[]\n beforeValidate?: BeforeValidateRichTextHook[]\n}\n\nexport type RichTextGenerateComponentMap = (args: {\n clientField: RichTextFieldClient\n createMappedComponent: CreateMappedComponent\n field: RichTextField\n i18n: I18nClient\n\n importMap: ImportMap\n payload: Payload\n schemaPath: string\n}) => Map<string, unknown>\n\ntype RichTextAdapterBase<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = {\n generateComponentMap: PayloadComponent<any, never>\n generateImportMap?: Config['admin']['importMap']['generators'][0]\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18n<any, any>\n schemaMap: Map<string, Field[]>\n schemaPath: string\n }) => Map<string, Field[]>\n /**\n * Like an afterRead hook, but runs only for the GraphQL resolver. For populating data, this should be used, as afterRead hooks do not have a depth in graphQL.\n *\n * To populate stuff / resolve field hooks, mutate the incoming populationPromises or fieldPromises array. They will then be awaited in the correct order within payload itself.\n * @param data\n */\n graphQLPopulationPromises?: (data: {\n context: RequestContext\n currentDepth?: number\n depth: number\n draft: boolean\n field: RichTextField<Value, AdapterProps, ExtraFieldProperties>\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n overrideAccess?: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n }) => void\n hooks?: RichTextHooks\n i18n?: Partial<GenericLanguages>\n outputSchema?: ({\n collectionIDFieldTypes,\n config,\n field,\n interfaceNameDefinitions,\n isRequired,\n }: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n field: RichTextField<Value, AdapterProps, ExtraFieldProperties>\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n validate: Validate<\n Value,\n Value,\n unknown,\n RichTextField<Value, AdapterProps, ExtraFieldProperties>\n >\n}\n\nexport type RichTextAdapter<\n Value extends object = any,\n AdapterProps = any,\n ExtraFieldProperties = any,\n> = {\n CellComponent: PayloadComponent<never>\n FieldComponent: PayloadComponent<never, RichTextFieldProps>\n} & RichTextAdapterBase<Value, AdapterProps, ExtraFieldProperties>\n\nexport type RichTextAdapterProvider<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = ({\n config,\n isRoot,\n parentIsLocalized,\n}: {\n config: SanitizedConfig\n /**\n * Whether or not this is the root richText editor, defined in the payload.config.ts.\n *\n * @default false\n */\n isRoot?: boolean\n parentIsLocalized: boolean\n}) =>\n | Promise<RichTextAdapter<Value, AdapterProps, ExtraFieldProperties>>\n | RichTextAdapter<Value, AdapterProps, ExtraFieldProperties>\n"],"names":[],"mappings":"AA0QA,WAmB8D"}
1
+ {"version":3,"sources":["../../src/admin/RichText.ts"],"sourcesContent":["import type { GenericLanguages, I18n, I18nClient } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\n\nimport type { ImportMap } from '../bin/generateImportMap/index.js'\nimport type { SanitizedCollectionConfig, TypeWithID } from '../collections/config/types.js'\nimport type { Config, PayloadComponent, SanitizedConfig } from '../config/types.js'\nimport type {\n Field,\n FieldAffectingData,\n RichTextField,\n RichTextFieldClient,\n Validate,\n} from '../fields/config/types.js'\nimport type { SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { JsonObject, Payload, PayloadRequest, RequestContext } from '../types/index.js'\nimport type { RichTextFieldProps } from './fields/RichText.js'\nimport type { CreateMappedComponent } from './types.js'\n\nexport type AfterReadRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n currentDepth?: number\n\n depth?: number\n\n draft?: boolean\n\n fallbackLocale?: string\n\n fieldPromises?: Promise<void>[]\n\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany?: boolean\n\n flattenLocales?: boolean\n\n locale?: string\n\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n\n overrideAccess?: boolean\n\n populationPromises?: Promise<void>[]\n showHiddenFields?: boolean\n triggerAccessControl?: boolean\n triggerHooks?: boolean\n}\n\nexport type AfterChangeRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n /** The document before changes were applied. */\n previousDoc?: TData\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\nexport type BeforeValidateRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n overrideAccess?: boolean\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\n\nexport type BeforeChangeRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /**\n * The original data with locales (not modified by any hooks). Only available in `beforeChange` and `beforeDuplicate` field hooks.\n */\n docWithLocales?: JsonObject\n\n duplicate?: boolean\n\n errors?: { field: string; message: string }[]\n /** Only available in `beforeChange` field hooks */\n mergeLocaleActions?: (() => Promise<void>)[]\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n /**\n * The original siblingData with locales (not modified by any hooks).\n */\n siblingDocWithLocales?: JsonObject\n\n skipValidation?: boolean\n}\n\nexport type BaseRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** The collection which the field belongs to. If the field belongs to a global, this will be null. */\n collection: null | SanitizedCollectionConfig\n context: RequestContext\n /** The data passed to update the document within create and update operations, and the full document itself in the afterRead hook. */\n data?: Partial<TData>\n /** The field which the hook is running against. */\n field: FieldAffectingData\n /** The global which the field belongs to. If the field belongs to a collection, this will be null. */\n global: null | SanitizedGlobalConfig\n\n /** The full original document in `update` operations. In the `afterChange` hook, this is the resulting document of the operation. */\n originalDoc?: TData\n /**\n * The path of the field, e.g. [\"group\", \"myArray\", 1, \"textField\"]. The path is the schemaPath but with indexes and would be used in the context of field data, not field schemas.\n */\n path: (number | string)[]\n\n /** The Express request object. It is mocked for Local API operations. */\n req: PayloadRequest\n /**\n * The schemaPath of the field, e.g. [\"group\", \"myArray\", \"textField\"]. The schemaPath is the path but without indexes and would be used in the context of field schemas, not field data.\n */\n schemaPath: string[]\n /** The sibling data passed to a field that the hook is running against. */\n siblingData: Partial<TSiblingData>\n /** The value of the field. */\n value?: TValue\n}\n\nexport type AfterReadRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: AfterReadRichTextHookArgs<TData, TValue, TSiblingData> &\n BaseRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type AfterChangeRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: AfterChangeRichTextHookArgs<TData, TValue, TSiblingData> &\n BaseRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type BeforeChangeRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: BaseRichTextHookArgs<TData, TValue, TSiblingData> &\n BeforeChangeRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type BeforeValidateRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: BaseRichTextHookArgs<TData, TValue, TSiblingData> &\n BeforeValidateRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type RichTextHooks = {\n afterChange?: AfterChangeRichTextHook[]\n afterRead?: AfterReadRichTextHook[]\n beforeChange?: BeforeChangeRichTextHook[]\n beforeValidate?: BeforeValidateRichTextHook[]\n}\n\nexport type RichTextGenerateComponentMap = (args: {\n clientField: RichTextFieldClient\n createMappedComponent: CreateMappedComponent\n field: RichTextField\n i18n: I18nClient\n\n importMap: ImportMap\n payload: Payload\n schemaPath: string\n}) => Map<string, unknown>\n\ntype RichTextAdapterBase<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = {\n generateComponentMap: PayloadComponent<any, never>\n generateImportMap?: Config['admin']['importMap']['generators'][0]\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18n<any, any>\n schemaMap: Map<string, Field[]>\n schemaPath: string\n }) => Map<string, Field[]>\n /**\n * Like an afterRead hook, but runs only for the GraphQL resolver. For populating data, this should be used, as afterRead hooks do not have a depth in graphQL.\n *\n * To populate stuff / resolve field hooks, mutate the incoming populationPromises or fieldPromises array. They will then be awaited in the correct order within payload itself.\n * @param data\n */\n graphQLPopulationPromises?: (data: {\n context: RequestContext\n currentDepth?: number\n depth: number\n draft: boolean\n field: RichTextField<Value, AdapterProps, ExtraFieldProperties>\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n overrideAccess?: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n }) => void\n hooks?: RichTextHooks\n i18n?: Partial<GenericLanguages>\n outputSchema?: ({\n collectionIDFieldTypes,\n config,\n field,\n interfaceNameDefinitions,\n isRequired,\n }: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n field: RichTextField<Value, AdapterProps, ExtraFieldProperties>\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n validate: Validate<\n Value,\n Value,\n unknown,\n RichTextField<Value, AdapterProps, ExtraFieldProperties>\n >\n}\n\nexport type RichTextAdapter<\n Value extends object = any,\n AdapterProps = any,\n ExtraFieldProperties = any,\n> = {\n CellComponent: PayloadComponent<never>\n FieldComponent: PayloadComponent<never, RichTextFieldProps>\n} & RichTextAdapterBase<Value, AdapterProps, ExtraFieldProperties>\n\nexport type RichTextAdapterProvider<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = ({\n config,\n isRoot,\n parentIsLocalized,\n}: {\n config: SanitizedConfig\n /**\n * Whether or not this is the root richText editor, defined in the payload.config.ts.\n *\n * @default false\n */\n isRoot?: boolean\n parentIsLocalized: boolean\n}) =>\n | Promise<RichTextAdapter<Value, AdapterProps, ExtraFieldProperties>>\n | RichTextAdapter<Value, AdapterProps, ExtraFieldProperties>\n"],"names":[],"mappings":"AA0QA,WAmB8D"}
@@ -20,7 +20,6 @@ export type DocumentTabCondition = (args: {
20
20
  }) => boolean;
21
21
  export type DocumentTabConfig = {
22
22
  readonly Component?: DocumentTabComponent;
23
- readonly Pill?: PayloadComponent;
24
23
  readonly condition?: DocumentTabCondition;
25
24
  readonly href?: ((args: {
26
25
  apiURL: string;
@@ -36,6 +35,7 @@ export type DocumentTabConfig = {
36
35
  t: (key: string) => string;
37
36
  }) => string) | string;
38
37
  readonly newTab?: boolean;
38
+ readonly Pill?: PayloadComponent;
39
39
  };
40
40
  export type DocumentTabComponent = PayloadComponent<{
41
41
  path: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Tab.d.ts","sourceRoot":"","sources":["../../../src/admin/elements/Tab.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AAEpD,OAAO,KAAK,EAAE,WAAW,EAAE,M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18n } from '@payloadcms/translations'\n\nimport type { Permissions } from '../../auth/types.js'\nimport type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type { PayloadComponent, SanitizedConfig } from '../../config/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { Payload } from '../../index.js'\n\nexport type DocumentTabProps = {\n readonly apiURL?: string\n readonly collectionConfig?: SanitizedCollectionConfig\n readonly globalConfig?: SanitizedGlobalConfig\n readonly i18n: I18n\n readonly payload: Payload\n readonly permissions: Permissions\n}\n\nexport type DocumentTabCondition = (args: {\n collectionConfig: SanitizedCollectionConfig\n config: SanitizedConfig\n globalConfig: SanitizedGlobalConfig\n permissions: Permissions\n}) => boolean\n\n// Everything is optional because we merge in the defaults\n// i.e. the config may override the `Default` view with a `label` but not an `href`\nexport type DocumentTabConfig = {\n readonly Component?: DocumentTabComponent\n readonly Pill?: PayloadComponent\n readonly condition?: DocumentTabCondition\n readonly href?:\n | ((args: {\n apiURL: string\n collection: SanitizedCollectionConfig\n global: SanitizedGlobalConfig\n id?: string\n routes: SanitizedConfig['routes']\n }) => string)\n | string\n readonly isActive?: ((args: { href: string }) => boolean) | boolean\n readonly label?: ((args: { t: (key: string) => string }) => string) | string\n readonly newTab?: boolean\n}\n\nexport type DocumentTabComponent = PayloadComponent<{\n path: string\n}>\n"],"names":[],"mappings":"AA4CA,WAEE"}
1
+ {"version":3,"sources":["../../../src/admin/elements/Tab.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\n\nimport type { Permissions } from '../../auth/types.js'\nimport type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type { PayloadComponent, SanitizedConfig } from '../../config/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { Payload } from '../../index.js'\n\nexport type DocumentTabProps = {\n readonly apiURL?: string\n readonly collectionConfig?: SanitizedCollectionConfig\n readonly globalConfig?: SanitizedGlobalConfig\n readonly i18n: I18n\n readonly payload: Payload\n readonly permissions: Permissions\n}\n\nexport type DocumentTabCondition = (args: {\n collectionConfig: SanitizedCollectionConfig\n config: SanitizedConfig\n globalConfig: SanitizedGlobalConfig\n permissions: Permissions\n}) => boolean\n\n// Everything is optional because we merge in the defaults\n// i.e. the config may override the `Default` view with a `label` but not an `href`\nexport type DocumentTabConfig = {\n readonly Component?: DocumentTabComponent\n readonly condition?: DocumentTabCondition\n readonly href?:\n | ((args: {\n apiURL: string\n collection: SanitizedCollectionConfig\n global: SanitizedGlobalConfig\n id?: string\n routes: SanitizedConfig['routes']\n }) => string)\n | string\n readonly isActive?: ((args: { href: string }) => boolean) | boolean\n readonly label?: ((args: { t: (key: string) => string }) => string) | string\n readonly newTab?: boolean\n readonly Pill?: PayloadComponent\n}\n\nexport type DocumentTabComponent = PayloadComponent<{\n path: string\n}>\n"],"names":[],"mappings":"AA4CA,WAEE"}
@@ -9,8 +9,8 @@ export type FieldDescriptionServerComponent<TFieldServer extends Field = Field>
9
9
  export type StaticDescription = Record<string, string> | string;
10
10
  export type Description = DescriptionFunction | StaticDescription;
11
11
  export type GenericDescriptionProps = {
12
- readonly Description?: MappedComponent;
13
12
  readonly className?: string;
13
+ readonly Description?: MappedComponent;
14
14
  readonly description?: StaticDescription;
15
15
  readonly marginPlacement?: 'bottom' | 'top';
16
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../src/admin/forms/Description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,MAAM,MAAM,mBAAmB,GAAG,aAAa,CAAA;AAE/C,KAAK,2BAA2B,GAAG,YAAY,CAAC,WAAW,EAAE,M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ptional } from 'ts-essentials'\n\nimport type { LabelFunction, ServerProps } from '../../config/types.js'\nimport type { ClientField, Field } from '../../fields/config/types.js'\nimport type { MappedComponent } from '../types.js'\n\nexport type DescriptionFunction = LabelFunction\n\ntype ClientFieldWithOptionalType = MarkOptional<ClientField, 'type'>\n\nexport type FieldDescriptionClientComponent<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = React.ComponentType<FieldDescriptionClientProps<TFieldClient>>\n\nexport type FieldDescriptionServerComponent<TFieldServer extends Field = Field> =\n React.ComponentType<FieldDescriptionServerProps<TFieldServer>>\n\nexport type StaticDescription = Record<string, string> | string\n\nexport type Description = DescriptionFunction | StaticDescription\n\nexport type GenericDescriptionProps = {\n readonly Description?: MappedComponent\n readonly className?: string\n readonly description?: StaticDescription\n readonly marginPlacement?: 'bottom' | 'top'\n}\n\nexport type FieldDescriptionServerProps<TFieldServer extends Field = Field> = {\n field: TFieldServer\n} & GenericDescriptionProps &\n Partial<ServerProps>\n\nexport type FieldDescriptionClientProps<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n field: TFieldClient\n} & GenericDescriptionProps\n"],"names":[],"mappings":"AAiCA,WAI2B"}
1
+ {"version":3,"sources":["../../../src/admin/forms/Description.ts"],"sourcesContent":["import type { MarkOptional } from 'ts-essentials'\n\nimport type { LabelFunction, ServerProps } from '../../config/types.js'\nimport type { ClientField, Field } from '../../fields/config/types.js'\nimport type { MappedComponent } from '../types.js'\n\nexport type DescriptionFunction = LabelFunction\n\ntype ClientFieldWithOptionalType = MarkOptional<ClientField, 'type'>\n\nexport type FieldDescriptionClientComponent<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = React.ComponentType<FieldDescriptionClientProps<TFieldClient>>\n\nexport type FieldDescriptionServerComponent<TFieldServer extends Field = Field> =\n React.ComponentType<FieldDescriptionServerProps<TFieldServer>>\n\nexport type StaticDescription = Record<string, string> | string\n\nexport type Description = DescriptionFunction | StaticDescription\n\nexport type GenericDescriptionProps = {\n readonly className?: string\n readonly Description?: MappedComponent\n readonly description?: StaticDescription\n readonly marginPlacement?: 'bottom' | 'top'\n}\n\nexport type FieldDescriptionServerProps<TFieldServer extends Field = Field> = {\n field: TFieldServer\n} & GenericDescriptionProps &\n Partial<ServerProps>\n\nexport type FieldDescriptionClientProps<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n field: TFieldClient\n} & GenericDescriptionProps\n"],"names":[],"mappings":"AAiCA,WAI2B"}
@@ -3,8 +3,8 @@ import type { ServerProps } from '../../config/types.js';
3
3
  import type { ClientField, Field } from '../../fields/config/types.js';
4
4
  import type { MappedComponent } from '../types.js';
5
5
  export type GenericErrorProps = {
6
- readonly CustomError?: MappedComponent;
7
6
  readonly alignCaret?: 'center' | 'left' | 'right';
7
+ readonly CustomError?: MappedComponent;
8
8
  readonly message?: string;
9
9
  readonly path?: string;
10
10
  readonly showError?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Error.d.ts","sourceRoot":"","sources":["../../../src/admin/forms/Error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,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,WAAW,CAAC,EAAE,eAAe,CAAA;IACtC,QAAQ,CAAC,UAAU,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;IACjD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,OA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S,CAAC,EAAE,OAAO,CAAA;CAC7B,CAAA;AAED,KAAK,2BAA2B,GAAG,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;AAEpE,MAAM,MAAM,qBAAqB,CAC/B,YAAY,SAAS,2BAA2B,GAAG,2BAA2B,IAC5E;IACF,KAAK,EAAE,YAAY,CAAA;CACpB,GAAG,iBAAiB,CAAA;AAErB,MAAM,MAAM,qBAAqB,CAAC,YAAY,SAAS,KAAK,IAAI;IAC9D,KAAK,EAAE,YAAY,CAAA;CACpB,GAAG,iBAAiB,GACnB,OAAO,CAAC,WAAW,CAAC,CAAA;AAEtB,MAAM,MAAM,yBAAyB,CACnC,YAAY,SAAS,2BAA2B,GAAG,2BAA2B,IAC5E,KAAK,CAAC,aAAa,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAC,CAAA;AAE5D,MAAM,MAAM,yBAAyB,CAAC,YAAY,SAAS,KAAK,GAAG,KAAK,IAAI,KAAK,CAAC,aAAa,CAC7F,qBAAqB,CAAC,YAAY,CAAC,CACpC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/admin/forms/Error.ts"],"sourcesContent":["import type { MarkOptional } from 'ts-essentials'\n\nimport type { ServerProps } from '../../config/types.js'\nimport type { ClientField, Field } from '../../fields/config/types.js'\nimport type { MappedComponent } from '../types.js'\n\nexport type GenericErrorProps = {\n readonly CustomError?: MappedComponent\n readonly alignCaret?: 'center' | 'left' | 'right'\n readonly message?: string\n readonly path?: string\n readonly showError?: boolean\n}\n\ntype ClientFieldWithOptionalType = MarkOptional<ClientField, 'type'>\n\nexport type FieldErrorClientProps<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n field: TFieldClient\n} & GenericErrorProps\n\nexport type FieldErrorServerProps<TFieldServer extends Field> = {\n field: TFieldServer\n} & GenericErrorProps &\n Partial<ServerProps>\n\nexport type FieldErrorClientComponent<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = React.ComponentType<FieldErrorClientProps<TFieldClient>>\n\nexport type FieldErrorServerComponent<TFieldServer extends Field = Field> = React.ComponentType<\n FieldErrorServerProps<TFieldServer>\n>\n"],"names":[],"mappings":"AA+BA,WAEC"}
1
+ {"version":3,"sources":["../../../src/admin/forms/Error.ts"],"sourcesContent":["import type { MarkOptional } from 'ts-essentials'\n\nimport type { ServerProps } from '../../config/types.js'\nimport type { ClientField, Field } from '../../fields/config/types.js'\nimport type { MappedComponent } from '../types.js'\n\nexport type GenericErrorProps = {\n readonly alignCaret?: 'center' | 'left' | 'right'\n readonly CustomError?: MappedComponent\n readonly message?: string\n readonly path?: string\n readonly showError?: boolean\n}\n\ntype ClientFieldWithOptionalType = MarkOptional<ClientField, 'type'>\n\nexport type FieldErrorClientProps<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n field: TFieldClient\n} & GenericErrorProps\n\nexport type FieldErrorServerProps<TFieldServer extends Field> = {\n field: TFieldServer\n} & GenericErrorProps &\n Partial<ServerProps>\n\nexport type FieldErrorClientComponent<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = React.ComponentType<FieldErrorClientProps<TFieldClient>>\n\nexport type FieldErrorServerComponent<TFieldServer extends Field = Field> = React.ComponentType<\n FieldErrorServerProps<TFieldServer>\n>\n"],"names":[],"mappings":"AA+BA,WAEC"}
@@ -9,7 +9,7 @@ export type Row = {
9
9
  id: string;
10
10
  };
11
11
  export type FilterOptionsResult = {
12
- [relation: string]: Where | boolean;
12
+ [relation: string]: boolean | Where;
13
13
  };
14
14
  export type FormField = {
15
15
  disableFormData?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../../src/admin/forms/Form.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBA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AA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAAA;CACpC,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,YAAY,EAAE,OAAO,CAAA;IACrB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;IACZ,KAAK,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,KAAK,EAAE,OAAO,CAAA;CACf,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;CAC1B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/admin/forms/Form.ts"],"sourcesContent":["import type { Field, Validate } from '../../fields/config/types.js'\nimport type { Where } from '../../types/index.js'\n\nexport type Data = {\n [key: string]: any\n}\n\nexport type Row = {\n blockType?: string\n collapsed?: boolean\n id: string\n}\n\nexport type FilterOptionsResult = {\n [relation: string]: Where | boolean\n}\n\nexport type FormField = {\n disableFormData?: boolean\n errorMessage?: string\n errorPaths?: string[]\n fieldSchema?: Field\n filterOptions?: FilterOptionsResult\n initialValue: unknown\n passesCondition?: boolean\n rows?: Row[]\n valid: boolean\n validate?: Validate\n value: unknown\n}\n\nexport type FormState = {\n [path: string]: FormField\n}\n"],"names":[],"mappings":"AA+BA,WAEC"}
1
+ {"version":3,"sources":["../../../src/admin/forms/Form.ts"],"sourcesContent":["import type { Field, Validate } from '../../fields/config/types.js'\nimport type { Where } from '../../types/index.js'\n\nexport type Data = {\n [key: string]: any\n}\n\nexport type Row = {\n blockType?: string\n collapsed?: boolean\n id: string\n}\n\nexport type FilterOptionsResult = {\n [relation: string]: boolean | Where\n}\n\nexport type FormField = {\n disableFormData?: boolean\n errorMessage?: string\n errorPaths?: string[]\n fieldSchema?: Field\n filterOptions?: FilterOptionsResult\n initialValue: unknown\n passesCondition?: boolean\n rows?: Row[]\n valid: boolean\n validate?: Validate\n value: unknown\n}\n\nexport type FormState = {\n [path: string]: FormField\n}\n"],"names":[],"mappings":"AA+BA,WAEC"}
@@ -3,9 +3,9 @@ import type { ServerProps, StaticLabel } from '../../config/types.js';
3
3
  import type { ClientField, Field } from '../../fields/config/types.js';
4
4
  import type { MappedComponent } from '../types.js';
5
5
  export type GenericLabelProps = {
6
- readonly Label?: MappedComponent;
7
6
  readonly as?: 'label' | 'span';
8
7
  readonly htmlFor?: string;
8
+ readonly Label?: MappedComponent;
9
9
  readonly label?: StaticLabel;
10
10
  readonly required?: boolean;
11
11
  readonly unstyled?: boolean;
@@ -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,KAAK,CAAC,EAAE,eAAe,CAAA;IAChC,QAAQ,CAAC,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,KAA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,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe,CAAA;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAA;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAC5B,CAAA;AAED,KAAK,2BAA2B,GAAG,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;AAEpE,MAAM,MAAM,qBAAqB,CAC/B,YAAY,SAAS,2BAA2B,GAAG,2BAA2B,IAC5E;IACF,KAAK,EAAE,YAAY,CAAA;CACpB,GAAG,iBAAiB,CAAA;AAErB,MAAM,MAAM,qBAAqB,CAAC,YAAY,SAAS,KAAK,IAAI;IAC9D,KAAK,EAAE,YAAY,CAAA;CACpB,GAAG,iBAAiB,GACnB,OAAO,CAAC,WAAW,CAAC,CAAA;AAEtB,MAAM,MAAM,mBAAmB,CAAC,YAAY,SAAS,WAAW,IAAI,IAAI,CACtE,qBAAqB,CAAC,YAAY,CAAC,EACnC,OAAO,GAAG,UAAU,CACrB,CAAA;AAED,MAAM,MAAM,yBAAyB,CACnC,YAAY,SAAS,2BAA2B,GAAG,2BAA2B,IAC5E,KAAK,CAAC,aAAa,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAC,CAAA;AAE5D,MAAM,MAAM,yBAAyB,CAAC,YAAY,SAAS,KAAK,GAAG,KAAK,IAAI,KAAK,CAAC,aAAa,CAC7F,qBAAqB,CAAC,YAAY,CAAC,CACpC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/admin/forms/Label.ts"],"sourcesContent":["import type { MarkOptional } 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 Label?: MappedComponent\n readonly as?: 'label' | 'span'\n readonly htmlFor?: string\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 { MarkOptional } 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,8 +1,6 @@
1
1
  import type React from 'react';
2
2
  import type { PayloadComponent } from '../config/types.js';
3
3
  import type { JsonObject } from '../types/index.js';
4
- export type { LanguageOptions } from './LanguageOptions.js';
5
- export type { RichTextAdapter, RichTextAdapterProvider, RichTextGenerateComponentMap, RichTextHooks, } from './RichText.js';
6
4
  export type { CellComponentProps, DefaultCellComponentProps } from './elements/Cell.js';
7
5
  export type { ConditionalDateProps } from './elements/DatePicker.js';
8
6
  export type { DayPickerProps, SharedProps, TimePickerProps } from './elements/DatePicker.js';
@@ -40,17 +38,19 @@ export type { FormFieldBase } from './forms/Field.js';
40
38
  export type { Data, FilterOptionsResult, FormField, FormState, Row } from './forms/Form.js';
41
39
  export type { FieldLabelClientComponent, FieldLabelClientProps, FieldLabelServerComponent, FieldLabelServerProps, GenericLabelProps, SanitizedLabelProps, } from './forms/Label.js';
42
40
  export type { RowLabel, RowLabelComponent } from './forms/RowLabel.js';
41
+ export type { LanguageOptions } from './LanguageOptions.js';
42
+ export type { RichTextAdapter, RichTextAdapterProvider, RichTextGenerateComponentMap, RichTextHooks, } from './RichText.js';
43
43
  export type { AdminViewComponent, AdminViewConfig, AdminViewProps, EditViewProps, InitPageResult, ServerSideEditViewProps, VisibleEntities, } from './views/types.js';
44
44
  export type MappedServerComponent<TComponentClientProps extends JsonObject = JsonObject> = {
45
45
  Component: React.ComponentType<TComponentClientProps>;
46
- RenderedComponent: React.ReactNode;
47
46
  props?: Partial<any>;
47
+ RenderedComponent: React.ReactNode;
48
48
  type: 'server';
49
49
  };
50
50
  export type MappedClientComponent<TComponentClientProps extends JsonObject = JsonObject> = {
51
51
  Component: React.ComponentType<TComponentClientProps>;
52
- RenderedComponent?: React.ReactNode;
53
52
  props?: Partial<TComponentClientProps>;
53
+ RenderedComponent?: React.ReactNode;
54
54
  type: 'client';
55
55
  };
56
56
  export type MappedEmptyComponent = {
@@ -60,7 +60,7 @@ export type MappedComponent<TComponentClientProps extends JsonObject = JsonObjec
60
60
  export type CreateMappedComponent = {
61
61
  <T extends JsonObject>(component: {
62
62
  Component: React.FC<T>;
63
- } | PayloadComponent<T> | null, props: {
63
+ } | null | PayloadComponent<T>, props: {
64
64
  clientProps?: JsonObject;
65
65
  serverProps?: object;
66
66
  }, fallback: React.FC, identifier: string): MappedComponent<T>;
@@ -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,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,YAAY,EACV,eAAe,EACf,uBAAuB,EACvB,4BAA4B,EAC5B,aAAa,GACd,MAAM,eAAe,CAAA;AACtB,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,qB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AU,CAAA;QACxB,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,EACD,QAAQ,EAAE,KAAK,CAAC,EAAE,EAClB,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,CAAC,CAAC,CAAA;IAErB,CAAC,CAAC,SAAS,UAAU,EACnB,UAAU,EAAE,CAAC;QAAE,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,EAChE,KAAK,EAAE;QACL,WAAW,CAAC,EAAE,UAAU,CAAA;QACxB,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,EACD,QAAQ,EAAE,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 { LanguageOptions } from './LanguageOptions.js'\nexport type {\n RichTextAdapter,\n RichTextAdapterProvider,\n RichTextGenerateComponentMap,\n RichTextHooks,\n} from './RichText.js'\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'\n\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 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 {\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 RenderedComponent: React.ReactNode\n props?: Partial<any>\n type: 'server'\n}\n\nexport type MappedClientComponent<TComponentClientProps extends JsonObject = JsonObject> = {\n Component: React.ComponentType<TComponentClientProps>\n RenderedComponent?: React.ReactNode\n props?: Partial<TComponentClientProps>\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> } | PayloadComponent<T> | null,\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 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"}
@@ -18,8 +18,8 @@ export type AdminViewConfig = {
18
18
  strict?: boolean;
19
19
  };
20
20
  export type MappedView = {
21
- Component: MappedComponent;
22
21
  actions?: MappedComponent[];
22
+ Component: MappedComponent;
23
23
  };
24
24
  export type AdminViewProps = {
25
25
  readonly clientConfig: ClientConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/admin/views/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAA;AAExE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACjF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,C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EAAE,yBAAyB,CAAC,MAAM,CAAC,EAAE,CAAA;IAChD,OAAO,EAAE,qBAAqB,CAAC,MAAM,CAAC,EAAE,CAAA;CACzC,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,gBAAgB,CAAC,EAAE,yBAAyB,CAAA;IAC5C,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,eAAe,EAAE,eAAe,CAAA;IAChC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,WAAW,CAAA;IACxB,GAAG,EAAE,cAAc,CAAA;IACnB,YAAY,EAAE,wBAAwB,CAAA;IACtC,eAAe,EAAE,eAAe,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAA;IACvC,QAAQ,CAAC,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;KAAE,CAAA;IACjE,QAAQ,CAAC,aAAa,EAAE,MAAM,EAAE,CAAA;IAChC,QAAQ,CAAC,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;KAAE,CAAA;CACxE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/admin/views/types.ts"],"sourcesContent":["import type { ClientTranslationsObject } from '@payloadcms/translations'\n\nimport type { Permissions } from '../../auth/index.js'\nimport type { ImportMap } from '../../bin/generateImportMap/index.js'\nimport type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type { ClientConfig } from '../../config/client.js'\nimport type { Locale, MetaConfig, PayloadComponent } from '../../config/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { PayloadRequest } from '../../types/index.js'\nimport type { LanguageOptions } from '../LanguageOptions.js'\nimport type { MappedComponent } from '../types.js'\n\nexport type AdminViewConfig = {\n Component: AdminViewComponent\n /** Whether the path should be matched exactly or as a prefix */\n exact?: boolean\n meta?: MetaConfig\n path?: string\n sensitive?: boolean\n strict?: boolean\n}\n\nexport type MappedView = {\n Component: MappedComponent\n actions?: MappedComponent[]\n}\n\nexport type AdminViewProps = {\n readonly clientConfig: ClientConfig\n readonly importMap: ImportMap\n readonly initPageResult: InitPageResult\n readonly params?: { [key: string]: string | string[] | undefined }\n readonly searchParams: { [key: string]: string | string[] | undefined }\n}\n\nexport type AdminViewComponent = PayloadComponent<AdminViewProps>\n\nexport type EditViewProps = {\n readonly collectionSlug?: string\n readonly globalSlug?: string\n}\n\nexport type VisibleEntities = {\n collections: SanitizedCollectionConfig['slug'][]\n globals: SanitizedGlobalConfig['slug'][]\n}\n\nexport type InitPageResult = {\n collectionConfig?: SanitizedCollectionConfig\n cookies: Map<string, string>\n docID?: string\n globalConfig?: SanitizedGlobalConfig\n languageOptions: LanguageOptions\n locale?: Locale\n permissions: Permissions\n req: PayloadRequest\n translations: ClientTranslationsObject\n visibleEntities: VisibleEntities\n}\n\nexport type ServerSideEditViewProps = {\n readonly initPageResult: InitPageResult\n readonly params: { [key: string]: string | string[] | undefined }\n readonly routeSegments: string[]\n readonly searchParams: { [key: string]: string | string[] | undefined }\n}\n"],"names":[],"mappings":"AA4DA,WAKC"}
1
+ {"version":3,"sources":["../../../src/admin/views/types.ts"],"sourcesContent":["import type { ClientTranslationsObject } from '@payloadcms/translations'\n\nimport type { Permissions } from '../../auth/index.js'\nimport type { ImportMap } from '../../bin/generateImportMap/index.js'\nimport type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type { ClientConfig } from '../../config/client.js'\nimport type { Locale, MetaConfig, PayloadComponent } from '../../config/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { PayloadRequest } from '../../types/index.js'\nimport type { LanguageOptions } from '../LanguageOptions.js'\nimport type { MappedComponent } from '../types.js'\n\nexport type AdminViewConfig = {\n Component: AdminViewComponent\n /** Whether the path should be matched exactly or as a prefix */\n exact?: boolean\n meta?: MetaConfig\n path?: string\n sensitive?: boolean\n strict?: boolean\n}\n\nexport type MappedView = {\n actions?: MappedComponent[]\n Component: MappedComponent\n}\n\nexport type AdminViewProps = {\n readonly clientConfig: ClientConfig\n readonly importMap: ImportMap\n readonly initPageResult: InitPageResult\n readonly params?: { [key: string]: string | string[] | undefined }\n readonly searchParams: { [key: string]: string | string[] | undefined }\n}\n\nexport type AdminViewComponent = PayloadComponent<AdminViewProps>\n\nexport type EditViewProps = {\n readonly collectionSlug?: string\n readonly globalSlug?: string\n}\n\nexport type VisibleEntities = {\n collections: SanitizedCollectionConfig['slug'][]\n globals: SanitizedGlobalConfig['slug'][]\n}\n\nexport type InitPageResult = {\n collectionConfig?: SanitizedCollectionConfig\n cookies: Map<string, string>\n docID?: string\n globalConfig?: SanitizedGlobalConfig\n languageOptions: LanguageOptions\n locale?: Locale\n permissions: Permissions\n req: PayloadRequest\n translations: ClientTranslationsObject\n visibleEntities: VisibleEntities\n}\n\nexport type ServerSideEditViewProps = {\n readonly initPageResult: InitPageResult\n readonly params: { [key: string]: string | string[] | undefined }\n readonly routeSegments: string[]\n readonly searchParams: { [key: string]: string | string[] | undefined }\n}\n"],"names":[],"mappings":"AA4DA,WAKC"}
@@ -8,7 +8,7 @@ export type AuthArgs = {
8
8
  export type AuthResult = {
9
9
  permissions: Permissions;
10
10
  responseHeaders?: Headers;
11
- user: TypedUser | null;
11
+ user: null | TypedUser;
12
12
  };
13
13
  export declare const auth: (args: Required<AuthArgs>) => Promise<AuthResult>;
14
14
  //# sourceMappingURL=auth.d.ts.map
@@ -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,SAAS,GAAG,IAAI,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;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 +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: TypedUser | null\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 { 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 +1 @@
1
- {"version":3,"sources":["../../../src/auth/strategies/jwt.ts"],"sourcesContent":["import jwt from 'jsonwebtoken'\n\nimport type { Payload, Where } from '../../types/index.js'\nimport type { AuthStrategyFunction, User } from '../index.js'\n\nimport { extractJWT } from '../extractJWT.js'\n\ntype JWTToken = {\n collection: string\n id: string\n}\n\nasync function autoLogin({\n isGraphQL,\n payload,\n}: {\n isGraphQL: boolean\n payload: Payload\n}): Promise<{\n user: User | null\n}> {\n if (\n typeof payload?.config?.admin?.autoLogin !== 'object' ||\n payload.config.admin?.autoLogin.prefillOnly ||\n !payload?.config?.admin?.autoLogin ||\n (!payload.config.admin?.autoLogin.email && !payload.config.admin?.autoLogin.username)\n ) {\n return { user: null }\n }\n\n const collection = payload.collections[payload.config.admin.user]\n\n const where: Where = {\n or: [],\n }\n if (payload.config.admin?.autoLogin.email) {\n where.or.push({\n email: {\n equals: payload.config.admin?.autoLogin.email,\n },\n })\n } else if (payload.config.admin?.autoLogin.username) {\n where.or.push({\n username: {\n equals: payload.config.admin?.autoLogin.username,\n },\n })\n }\n\n const user = (\n await payload.find({\n collection: collection.config.slug,\n depth: isGraphQL ? 0 : collection.config.auth.depth,\n where,\n })\n ).docs[0]\n\n if (!user) {\n return { user: null }\n }\n user.collection = collection.config.slug\n user._strategy = 'local-jwt'\n\n return {\n user: user as User,\n }\n}\n\nexport const JWTAuthentication: AuthStrategyFunction = async ({\n headers,\n isGraphQL = false,\n payload,\n}) => {\n try {\n const token = extractJWT({ headers, payload })\n\n if (!token) {\n if (headers.get('DisableAutologin') !== 'true') {\n return await autoLogin({ isGraphQL, payload })\n }\n return { user: null }\n }\n\n const decodedPayload = jwt.verify(token, payload.secret) as JWTToken & jwt.JwtPayload\n\n const collection = payload.collections[decodedPayload.collection]\n\n const user = await payload.findByID({\n id: decodedPayload.id,\n collection: decodedPayload.collection,\n depth: isGraphQL ? 0 : collection.config.auth.depth,\n })\n\n if (user && (!collection.config.auth.verify || user._verified)) {\n user.collection = collection.config.slug\n user._strategy = 'local-jwt'\n return {\n user: user as User,\n }\n } else {\n if (headers.get('DisableAutologin') !== 'true') {\n return await autoLogin({ isGraphQL, payload })\n }\n return { user: null }\n }\n } catch (error) {\n if (headers.get('DisableAutologin') !== 'true') {\n return await autoLogin({ isGraphQL, payload })\n }\n return { user: null }\n }\n}\n"],"names":["jwt","extractJWT","autoLogin","isGraphQL","payload","config","admin","prefillOnly","email","username","user","collection","collections","where","or","push","equals","find","slug","depth","auth","docs","_strategy","JWTAuthentication","headers","token","get","decodedPayload","verify","secret","findByID","id","_verified","error"],"mappings":"AAAA,OAAOA,SAAS,eAAc;AAK9B,SAASC,UAAU,QAAQ,mBAAkB;AAO7C,eAAeC,UAAU,EACvBC,SAAS,EACTC,OAAO,EAIR;IAGC,IACE,OAAOA,SAASC,QAAQC,OAAOJ,cAAc,YAC7CE,QAAQC,MAAM,CAACC,KAAK,EAAEJ,UAAUK,eAChC,CAACH,SAASC,QAAQC,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AG,CAAC,wBAAwB,QAAQ;gBAC9C,OAAO,MAAMxB,UAAU;oBAAEC;oBAAWC;gBAAQ;YAC9C;YACA,OAAO;gBAAEM,MAAM;YAAK;QACtB;QAEA,MAAMiB,iBAAiB3B,IAAI4B,MAAM,CAACH,OAAOrB,QAAQyB,MAAM;QAEvD,MAAMlB,aAAaP,QAAQQ,WAAW,CAACe,eAAehB,UAAU,CAAC;QAEjE,MAAMD,OAAO,MAAMN,QAAQ0B,QAAQ,CAAC;YAClCC,IAAIJ,eAAeI,EAAE;YACrBpB,YAAYgB,eAAehB,UAAU;YACrCQ,OAAOhB,YAAY,IAAIQ,WAAWN,MAAM,CAACe,IAAI,CAACD,KAAK;QACrD;QAEA,IAAIT,QAAS,CAAA,CAACC,WAAWN,MAAM,CAACe,IAAI,CAACQ,MAAM,IAAIlB,KAAKsB,SAAS,AAAD,GAAI;YAC9DtB,KAAKC,UAAU,GAAGA,WAAWN,MAAM,CAACa,IAAI;YACxCR,KAAKY,SAAS,GAAG;YACjB,OAAO;gBACLZ,MAAMA;YACR;QACF,OAAO;YACL,IAAIc,QAAQE,GAAG,CAAC,wBAAwB,QAAQ;gBAC9C,OAAO,MAAMxB,UAAU;oBAAEC;oBAAWC;gBAAQ;YAC9C;YACA,OAAO;gBAAEM,MAAM;YAAK;QACtB;IACF,EAAE,OAAOuB,OAAO;QACd,IAAIT,QAAQE,GAAG,CAAC,wBAAwB,QAAQ;YAC9C,OAAO,MAAMxB,UAAU;gBAAEC;gBAAWC;YAAQ;QAC9C;QACA,OAAO;YAAEM,MAAM;QAAK;IACtB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../src/auth/strategies/jwt.ts"],"sourcesContent":["import jwt from 'jsonwebtoken'\n\nimport type { Payload, Where } from '../../types/index.js'\nimport type { AuthStrategyFunction, User } from '../index.js'\n\nimport { extractJWT } from '../extractJWT.js'\n\ntype JWTToken = {\n collection: string\n id: string\n}\n\nasync function autoLogin({\n isGraphQL,\n payload,\n}: {\n isGraphQL: boolean\n payload: Payload\n}): Promise<{\n user: null | User\n}> {\n if (\n typeof payload?.config?.admin?.autoLogin !== 'object' ||\n payload.config.admin?.autoLogin.prefillOnly ||\n !payload?.config?.admin?.autoLogin ||\n (!payload.config.admin?.autoLogin.email && !payload.config.admin?.autoLogin.username)\n ) {\n return { user: null }\n }\n\n const collection = payload.collections[payload.config.admin.user]\n\n const where: Where = {\n or: [],\n }\n if (payload.config.admin?.autoLogin.email) {\n where.or.push({\n email: {\n equals: payload.config.admin?.autoLogin.email,\n },\n })\n } else if (payload.config.admin?.autoLogin.username) {\n where.or.push({\n username: {\n equals: payload.config.admin?.autoLogin.username,\n },\n })\n }\n\n const user = (\n await payload.find({\n collection: collection.config.slug,\n depth: isGraphQL ? 0 : collection.config.auth.depth,\n where,\n })\n ).docs[0]\n\n if (!user) {\n return { user: null }\n }\n user.collection = collection.config.slug\n user._strategy = 'local-jwt'\n\n return {\n user: user as User,\n }\n}\n\nexport const JWTAuthentication: AuthStrategyFunction = async ({\n headers,\n isGraphQL = false,\n payload,\n}) => {\n try {\n const token = extractJWT({ headers, payload })\n\n if (!token) {\n if (headers.get('DisableAutologin') !== 'true') {\n return await autoLogin({ isGraphQL, payload })\n }\n return { user: null }\n }\n\n const decodedPayload = jwt.verify(token, payload.secret) as jwt.JwtPayload & JWTToken\n\n const collection = payload.collections[decodedPayload.collection]\n\n const user = await payload.findByID({\n id: decodedPayload.id,\n collection: decodedPayload.collection,\n depth: isGraphQL ? 0 : collection.config.auth.depth,\n })\n\n if (user && (!collection.config.auth.verify || user._verified)) {\n user.collection = collection.config.slug\n user._strategy = 'local-jwt'\n return {\n user: user as User,\n }\n } else {\n if (headers.get('DisableAutologin') !== 'true') {\n return await autoLogin({ isGraphQL, payload })\n }\n return { user: null }\n }\n } catch (error) {\n if (headers.get('DisableAutologin') !== 'true') {\n return await autoLogin({ isGraphQL, payload })\n }\n return { user: null }\n }\n}\n"],"names":["jwt","extractJWT","autoLogin","isGraphQL","payload","config","admin","prefillOnly","email","username","user","collection","collections","where","or","push","equals","find","slug","depth","auth","docs","_strategy","JWTAuthentication","headers","token","get","decodedPayload","verify","secret","findByID","id","_verified","error"],"mappings":"AAAA,OAAOA,SAAS,eAAc;AAK9B,SAASC,UAAU,QAAQ,mBAAkB;AAO7C,eAAeC,UAAU,EACvBC,SAAS,EACTC,OAAO,EAIR;IAGC,IACE,OAAOA,SAASC,QAAQC,OAAOJ,cAAc,YAC7CE,QAAQC,MAAM,CAACC,KAAK,EAAEJ,UAAUK,eAChC,CAACH,SAASC,QAAQC,OAAOJ,aACxB,CAACE,QAAQC,MAAM,CAACC,KAAK,EAAEJ,UAAUM,SAAS,CAACJ,QAAQC,MAAM,CAACC,KAAK,EAAEJ,UAAUO,UAC5E;QACA,OAAO;YAAEC,MAAM;QAAK;IACtB;IAEA,MAAMC,aAAaP,QAAQQ,WAAW,CAACR,QAAQC,MAAM,CAACC,KAAK,CAACI,IAAI,CAAC;IAEjE,MAAMG,QAAe;QACnBC,IAAI,EAAE;IACR;IACA,IAAIV,QAAQC,MAAM,CAACC,KAAK,EAAEJ,UAAUM,OAAO;QACzCK,MAAMC,EAAE,CAACC,IAAI,CAAC;YACZP,OAAO;gBACLQ,QAAQZ,QAAQC,MAAM,CAACC,KAAK,EAAEJ,UAAUM;YAC1C;QACF;IACF,OAAO,IAAIJ,QAAQC,MAAM,CAACC,KAAK,EAAEJ,UAAUO,UAAU;QACnDI,MAAMC,EAAE,CAACC,IAAI,CAAC;YACZN,UAAU;gBACRO,QAAQZ,QAAQC,MAAM,CAACC,KAAK,EAAEJ,UAAUO;YAC1C;QACF;IACF;IAEA,MAAMC,OAAO,AACX,CAAA,MAAMN,QAAQa,IAAI,CAAC;QACjBN,YAAYA,WAAWN,MAAM,CAACa,IAAI;QAClCC,OAAOhB,YAAY,IAAIQ,WAAWN,MAAM,CAACe,IAAI,CAACD,KAAK;QACnDN;IACF,EAAC,EACDQ,IAAI,CAAC,EAAE;IAET,IAAI,CAACX,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AAQ;YAC9C,OAAO,MAAMxB,UAAU;gBAAEC;gBAAWC;YAAQ;QAC9C;QACA,OAAO;YAAEM,MAAM;QAAK;IACtB;AACF,EAAC"}
@@ -93,7 +93,7 @@ export type AuthStrategyFunctionArgs = {
93
93
  };
94
94
  export type AuthStrategyResult = {
95
95
  responseHeaders?: Headers;
96
- user: User | null;
96
+ user: null | User;
97
97
  };
98
98
  export type AuthStrategyFunction = (args: AuthStrategyFunctionArgs) => AuthStrategyResult | Promise<AuthStrategyResult>;
99
99
  export type AuthStrategy = {
@@ -122,7 +122,7 @@ export interface IncomingAuthType {
122
122
  generateEmailSubject?: GenerateForgotPasswordEmailSubject;
123
123
  };
124
124
  lockTime?: number;
125
- loginWithUsername?: LoginWithUsernameOptions | boolean;
125
+ loginWithUsername?: boolean | LoginWithUsernameOptions;
126
126
  maxLoginAttempts?: number;
127
127
  removeTokenFromResponses?: true;
128
128
  strategies?: AuthStrategy[];
@@ -142,9 +142,9 @@ export interface Auth extends Omit<DeepRequired<IncomingAuthType>, 'forgotPasswo
142
142
  generateEmailHTML?: GenerateForgotPasswordEmailHTML;
143
143
  generateEmailSubject?: GenerateForgotPasswordEmailSubject;
144
144
  };
145
- loginWithUsername: LoginWithUsernameOptions | false;
146
- verify?: VerifyConfig | boolean;
145
+ loginWithUsername: false | LoginWithUsernameOptions;
146
+ verify?: boolean | VerifyConfig;
147
147
  }
148
- export declare function hasWhereAccessResult(result: Where | boolean): result is Where;
148
+ export declare function hasWhereAccessResult(result: boolean | Where): result is Where;
149
149
  export {};
150
150
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/auth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAA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{ Payload } from '../index.js'\nimport type { PayloadRequest, Where } from '../types/index.js'\n\nexport type Permission = {\n permission: boolean\n where?: Record<string, unknown>\n}\n\nexport type FieldPermissions = {\n blocks?: {\n [blockSlug: string]: {\n fields: {\n [fieldName: string]: FieldPermissions\n }\n }\n }\n create: {\n permission: boolean\n }\n fields?: {\n [fieldName: string]: FieldPermissions\n }\n read: {\n permission: boolean\n }\n update: {\n permission: boolean\n }\n}\n\nexport type CollectionPermission = {\n create: Permission\n delete: Permission\n fields: {\n [fieldName: string]: FieldPermissions\n }\n read: Permission\n readVersions?: Permission\n update: Permission\n}\n\nexport type GlobalPermission = {\n fields: {\n [fieldName: string]: FieldPermissions\n }\n read: Permission\n readVersions?: Permission\n update: Permission\n}\n\nexport type DocumentPermissions = CollectionPermission | GlobalPermission\nexport type Permissions = {\n canAccessAdmin: boolean\n collections: {\n [collectionSlug: string]: CollectionPermission\n }\n globals?: {\n [globalSlug: string]: GlobalPermission\n }\n}\n\nexport type User = {\n [key: string]: any // This NEEDS to be an any, otherwise it breaks the Omit for ClientUser below\n collection: string\n email?: string\n id: number | string\n username?: string\n}\n\n/**\n * `collection` is not available one the client. It's only available on the server (req.user)\n * On the client, you can access the collection via config.admin.user. Config can be accessed using the useConfig() hook\n */\nexport type ClientUser = Omit<User, 'collection'>\n\ntype GenerateVerifyEmailHTML<TUser = any> = (args: {\n req: PayloadRequest\n token: string\n user: TUser\n}) => Promise<string> | string\n\ntype GenerateVerifyEmailSubject<TUser = any> = (args: {\n req: PayloadRequest\n token: string\n user: TUser\n}) => Promise<string> | string\n\ntype GenerateForgotPasswordEmailHTML<TUser = any> = (args?: {\n req?: PayloadRequest\n token?: string\n user?: TUser\n}) => Promise<string> | string\n\ntype GenerateForgotPasswordEmailSubject<TUser = any> = (args?: {\n req?: PayloadRequest\n token?: string\n user?: TUser\n}) => Promise<string> | string\n\nexport type AuthStrategyFunctionArgs = {\n headers: Request['headers']\n isGraphQL?: boolean\n payload: Payload\n}\n\nexport type AuthStrategyResult = {\n responseHeaders?: Headers\n user: User | null\n}\n\nexport type AuthStrategyFunction = (\n args: AuthStrategyFunctionArgs,\n) => AuthStrategyResult | Promise<AuthStrategyResult>\nexport type AuthStrategy = {\n authenticate: AuthStrategyFunction\n name: string\n}\n\nexport type LoginWithUsernameOptions =\n | {\n allowEmailLogin?: false\n requireEmail?: boolean\n // If `allowEmailLogin` is false, `requireUsername` must be true (default: true)\n requireUsername?: true\n }\n | {\n allowEmailLogin?: true\n requireEmail?: boolean\n requireUsername?: boolean\n }\n\nexport interface IncomingAuthType {\n cookies?: {\n domain?: string\n sameSite?: 'Lax' | 'None' | 'Strict' | boolean\n secure?: boolean\n }\n depth?: number\n disableLocalStrategy?: true\n forgotPassword?: {\n generateEmailHTML?: GenerateForgotPasswordEmailHTML\n generateEmailSubject?: GenerateForgotPasswordEmailSubject\n }\n lockTime?: number\n loginWithUsername?: LoginWithUsernameOptions | boolean\n maxLoginAttempts?: number\n removeTokenFromResponses?: true\n strategies?: AuthStrategy[]\n tokenExpiration?: number\n useAPIKey?: boolean\n verify?:\n | {\n generateEmailHTML?: GenerateVerifyEmailHTML\n generateEmailSubject?: GenerateVerifyEmailSubject\n }\n | boolean\n}\n\nexport type VerifyConfig = {\n generateEmailHTML?: GenerateVerifyEmailHTML\n generateEmailSubject?: GenerateVerifyEmailSubject\n}\n\nexport interface Auth\n extends Omit<DeepRequired<IncomingAuthType>, 'forgotPassword' | 'loginWithUsername' | 'verify'> {\n forgotPassword?: {\n generateEmailHTML?: GenerateForgotPasswordEmailHTML\n generateEmailSubject?: GenerateForgotPasswordEmailSubject\n }\n loginWithUsername: LoginWithUsernameOptions | false\n verify?: VerifyConfig | boolean\n}\n\nexport function hasWhereAccessResult(result: Where | boolean): result is Where {\n return result && typeof result === 'object'\n}\n"],"names":["hasWhereAccessResult","result"],"mappings":"AA+KA,OAAO,SAASA,qBAAqBC,MAAuB;IAC1D,OAAOA,UAAU,OAAOA,WAAW;AACrC"}
1
+ {"version":3,"sources":["../../src/auth/types.ts"],"sourcesContent":["import type { DeepRequired } from 'ts-essentials'\n\nimport type { Payload } from '../index.js'\nimport type { PayloadRequest, Where } from '../types/index.js'\n\nexport type Permission = {\n permission: boolean\n where?: Record<string, unknown>\n}\n\nexport type FieldPermissions = {\n blocks?: {\n [blockSlug: string]: {\n fields: {\n [fieldName: string]: FieldPermissions\n }\n }\n }\n create: {\n permission: boolean\n }\n fields?: {\n [fieldName: string]: FieldPermissions\n }\n read: {\n permission: boolean\n }\n update: {\n permission: boolean\n }\n}\n\nexport type CollectionPermission = {\n create: Permission\n delete: Permission\n fields: {\n [fieldName: string]: FieldPermissions\n }\n read: Permission\n readVersions?: Permission\n update: Permission\n}\n\nexport type GlobalPermission = {\n fields: {\n [fieldName: string]: FieldPermissions\n }\n read: Permission\n readVersions?: Permission\n update: Permission\n}\n\nexport type DocumentPermissions = CollectionPermission | GlobalPermission\nexport type Permissions = {\n canAccessAdmin: boolean\n collections: {\n [collectionSlug: string]: CollectionPermission\n }\n globals?: {\n [globalSlug: string]: GlobalPermission\n }\n}\n\nexport type User = {\n [key: string]: any // This NEEDS to be an any, otherwise it breaks the Omit for ClientUser below\n collection: string\n email?: string\n id: number | string\n username?: string\n}\n\n/**\n * `collection` is not available one the client. It's only available on the server (req.user)\n * On the client, you can access the collection via config.admin.user. Config can be accessed using the useConfig() hook\n */\nexport type ClientUser = Omit<User, 'collection'>\n\ntype GenerateVerifyEmailHTML<TUser = any> = (args: {\n req: PayloadRequest\n token: string\n user: TUser\n}) => Promise<string> | string\n\ntype GenerateVerifyEmailSubject<TUser = any> = (args: {\n req: PayloadRequest\n token: string\n user: TUser\n}) => Promise<string> | string\n\ntype GenerateForgotPasswordEmailHTML<TUser = any> = (args?: {\n req?: PayloadRequest\n token?: string\n user?: TUser\n}) => Promise<string> | string\n\ntype GenerateForgotPasswordEmailSubject<TUser = any> = (args?: {\n req?: PayloadRequest\n token?: string\n user?: TUser\n}) => Promise<string> | string\n\nexport type AuthStrategyFunctionArgs = {\n headers: Request['headers']\n isGraphQL?: boolean\n payload: Payload\n}\n\nexport type AuthStrategyResult = {\n responseHeaders?: Headers\n user: null | User\n}\n\nexport type AuthStrategyFunction = (\n args: AuthStrategyFunctionArgs,\n) => AuthStrategyResult | Promise<AuthStrategyResult>\nexport type AuthStrategy = {\n authenticate: AuthStrategyFunction\n name: string\n}\n\nexport type LoginWithUsernameOptions =\n | {\n allowEmailLogin?: false\n requireEmail?: boolean\n // If `allowEmailLogin` is false, `requireUsername` must be true (default: true)\n requireUsername?: true\n }\n | {\n allowEmailLogin?: true\n requireEmail?: boolean\n requireUsername?: boolean\n }\n\nexport interface IncomingAuthType {\n cookies?: {\n domain?: string\n sameSite?: 'Lax' | 'None' | 'Strict' | boolean\n secure?: boolean\n }\n depth?: number\n disableLocalStrategy?: true\n forgotPassword?: {\n generateEmailHTML?: GenerateForgotPasswordEmailHTML\n generateEmailSubject?: GenerateForgotPasswordEmailSubject\n }\n lockTime?: number\n loginWithUsername?: boolean | LoginWithUsernameOptions\n maxLoginAttempts?: number\n removeTokenFromResponses?: true\n strategies?: AuthStrategy[]\n tokenExpiration?: number\n useAPIKey?: boolean\n verify?:\n | {\n generateEmailHTML?: GenerateVerifyEmailHTML\n generateEmailSubject?: GenerateVerifyEmailSubject\n }\n | boolean\n}\n\nexport type VerifyConfig = {\n generateEmailHTML?: GenerateVerifyEmailHTML\n generateEmailSubject?: GenerateVerifyEmailSubject\n}\n\nexport interface Auth\n extends Omit<DeepRequired<IncomingAuthType>, 'forgotPassword' | 'loginWithUsername' | 'verify'> {\n forgotPassword?: {\n generateEmailHTML?: GenerateForgotPasswordEmailHTML\n generateEmailSubject?: GenerateForgotPasswordEmailSubject\n }\n loginWithUsername: false | LoginWithUsernameOptions\n verify?: boolean | VerifyConfig\n}\n\nexport function hasWhereAccessResult(result: boolean | Where): result is Where {\n return result && typeof result === 'object'\n}\n"],"names":["hasWhereAccessResult","result"],"mappings":"AA+KA,OAAO,SAASA,qBAAqBC,MAAuB;IAC1D,OAAOA,UAAU,OAAOA,WAAW;AACrC"}