payload 3.0.0-beta.72 → 3.0.0-beta.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/RichText.d.ts +2 -1
- package/dist/admin/RichText.d.ts.map +1 -1
- package/dist/admin/RichText.js.map +1 -1
- package/dist/admin/elements/Cell.d.ts +1 -0
- package/dist/admin/elements/Cell.d.ts.map +1 -1
- package/dist/admin/elements/Cell.js.map +1 -1
- package/dist/admin/fields/Array.d.ts +3 -1
- package/dist/admin/fields/Array.d.ts.map +1 -1
- package/dist/admin/fields/Array.js.map +1 -1
- package/dist/admin/fields/Blocks.d.ts +3 -1
- package/dist/admin/fields/Blocks.d.ts.map +1 -1
- package/dist/admin/fields/Blocks.js.map +1 -1
- package/dist/admin/fields/Checkbox.d.ts +3 -1
- package/dist/admin/fields/Checkbox.d.ts.map +1 -1
- package/dist/admin/fields/Checkbox.js.map +1 -1
- package/dist/admin/fields/Code.d.ts +3 -1
- package/dist/admin/fields/Code.d.ts.map +1 -1
- package/dist/admin/fields/Code.js.map +1 -1
- package/dist/admin/fields/Date.d.ts +3 -1
- package/dist/admin/fields/Date.d.ts.map +1 -1
- package/dist/admin/fields/Date.js.map +1 -1
- package/dist/admin/fields/Email.d.ts +3 -1
- package/dist/admin/fields/Email.d.ts.map +1 -1
- package/dist/admin/fields/Email.js.map +1 -1
- package/dist/admin/fields/JSON.d.ts +3 -1
- package/dist/admin/fields/JSON.d.ts.map +1 -1
- package/dist/admin/fields/JSON.js.map +1 -1
- package/dist/admin/fields/Number.d.ts +3 -1
- package/dist/admin/fields/Number.d.ts.map +1 -1
- package/dist/admin/fields/Number.js.map +1 -1
- package/dist/admin/fields/Point.d.ts +3 -1
- package/dist/admin/fields/Point.d.ts.map +1 -1
- package/dist/admin/fields/Point.js.map +1 -1
- package/dist/admin/fields/Radio.d.ts +3 -1
- package/dist/admin/fields/Radio.d.ts.map +1 -1
- package/dist/admin/fields/Radio.js.map +1 -1
- package/dist/admin/fields/Relationship.d.ts +3 -1
- package/dist/admin/fields/Relationship.d.ts.map +1 -1
- package/dist/admin/fields/Relationship.js.map +1 -1
- package/dist/admin/fields/RichText.d.ts +3 -1
- package/dist/admin/fields/RichText.d.ts.map +1 -1
- package/dist/admin/fields/RichText.js.map +1 -1
- package/dist/admin/fields/Select.d.ts +3 -1
- package/dist/admin/fields/Select.d.ts.map +1 -1
- package/dist/admin/fields/Select.js.map +1 -1
- package/dist/admin/fields/Text.d.ts +3 -1
- package/dist/admin/fields/Text.d.ts.map +1 -1
- package/dist/admin/fields/Text.js.map +1 -1
- package/dist/admin/fields/Textarea.d.ts +3 -1
- package/dist/admin/fields/Textarea.d.ts.map +1 -1
- package/dist/admin/fields/Textarea.js.map +1 -1
- package/dist/admin/fields/Upload.d.ts +3 -2
- package/dist/admin/fields/Upload.d.ts.map +1 -1
- package/dist/admin/fields/Upload.js.map +1 -1
- package/dist/admin/forms/FieldDescription.d.ts +1 -2
- package/dist/admin/forms/FieldDescription.d.ts.map +1 -1
- package/dist/admin/forms/FieldDescription.js.map +1 -1
- package/dist/admin/forms/Form.d.ts +2 -2
- package/dist/admin/forms/Form.d.ts.map +1 -1
- package/dist/admin/forms/Form.js.map +1 -1
- package/dist/admin/forms/Label.d.ts +5 -3
- package/dist/admin/forms/Label.d.ts.map +1 -1
- package/dist/admin/forms/Label.js.map +1 -1
- package/dist/auth/baseFields/email.d.ts +2 -4
- package/dist/auth/baseFields/email.d.ts.map +1 -1
- package/dist/auth/baseFields/email.js +21 -21
- package/dist/auth/baseFields/email.js.map +1 -1
- package/dist/auth/baseFields/username.d.ts +2 -2
- package/dist/auth/baseFields/username.d.ts.map +1 -1
- package/dist/auth/baseFields/username.js +1 -1
- package/dist/auth/baseFields/username.js.map +1 -1
- package/dist/auth/ensureUsernameOrEmail.d.ts +17 -0
- package/dist/auth/ensureUsernameOrEmail.d.ts.map +1 -0
- package/dist/auth/ensureUsernameOrEmail.js +43 -0
- package/dist/auth/ensureUsernameOrEmail.js.map +1 -0
- package/dist/auth/getAuthFields.d.ts.map +1 -1
- package/dist/auth/getAuthFields.js +18 -10
- package/dist/auth/getAuthFields.js.map +1 -1
- package/dist/auth/operations/registerFirstUser.d.ts.map +1 -1
- package/dist/auth/operations/registerFirstUser.js +8 -0
- package/dist/auth/operations/registerFirstUser.js.map +1 -1
- package/dist/auth/types.d.ts +6 -1
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/auth/types.js.map +1 -1
- package/dist/collections/config/defaults.d.ts.map +1 -1
- package/dist/collections/config/defaults.js +2 -1
- package/dist/collections/config/defaults.js.map +1 -1
- package/dist/collections/config/sanitize.d.ts.map +1 -1
- package/dist/collections/config/sanitize.js +17 -4
- package/dist/collections/config/sanitize.js.map +1 -1
- package/dist/collections/operations/create.d.ts.map +1 -1
- package/dist/collections/operations/create.js +8 -0
- package/dist/collections/operations/create.js.map +1 -1
- package/dist/collections/operations/update.d.ts.map +1 -1
- package/dist/collections/operations/update.js +11 -0
- package/dist/collections/operations/update.js.map +1 -1
- package/dist/collections/operations/updateByID.d.ts.map +1 -1
- package/dist/collections/operations/updateByID.js +11 -0
- package/dist/collections/operations/updateByID.js.map +1 -1
- package/dist/errors/ValidationError.d.ts +6 -8
- package/dist/errors/ValidationError.d.ts.map +1 -1
- package/dist/errors/ValidationError.js.map +1 -1
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js.map +1 -1
- package/dist/fields/config/client.d.ts +16 -15
- package/dist/fields/config/client.d.ts.map +1 -1
- package/dist/fields/config/types.d.ts +3 -1
- package/dist/fields/config/types.d.ts.map +1 -1
- package/dist/fields/config/types.js.map +1 -1
- package/dist/fields/hooks/beforeChange/promise.d.ts.map +1 -1
- package/dist/fields/hooks/beforeChange/promise.js +1 -0
- package/dist/fields/hooks/beforeChange/promise.js.map +1 -1
- package/dist/fields/validations.d.ts +65 -74
- package/dist/fields/validations.d.ts.map +1 -1
- package/dist/fields/validations.js +20 -4
- package/dist/fields/validations.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/uploads/types.d.ts +6 -0
- package/dist/uploads/types.d.ts.map +1 -1
- package/dist/uploads/types.js.map +1 -1
- package/dist/utilities/configToJSONSchema.d.ts.map +1 -1
- package/dist/utilities/configToJSONSchema.js +88 -57
- package/dist/utilities/configToJSONSchema.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/uploads/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAA6B,MAAM,OAAO,CAAA;AAE5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEjE,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAA;IACvB,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAA;IACvB,MAAM,EAAE,IAAI,GAAG,MAAM,CAAA;IACrB,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAA;IACvB,KAAK,EAAE,IAAI,GAAG,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB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IACvB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/uploads/types.ts"],"sourcesContent":["import type { ResizeOptions, Sharp, Metadata as SharpMetadata } from 'sharp'\n\nimport type { TypeWithID } from '../collections/config/types.js'\nimport type { PayloadRequest } from '../types/index.js'\nimport type { WithMetadata } from './optionallyAppendMetadata.js'\n\nexport type FileSize = {\n filename: null | string\n filesize: null | number\n height: null | number\n mimeType: null | string\n width: null | number\n}\n\nexport type FileSizes = {\n [size: string]: FileSize\n}\n\nexport type FileData = {\n filename: string\n filesize: number\n focalX?: number\n focalY?: number\n height: number\n mimeType: string\n sizes: FileSizes\n tempFilePath?: string\n url?: string\n width: number\n}\n\nexport type ProbedImageSize = {\n height: number\n width: number\n}\n\n/**\n * Params sent to the sharp `toFormat()` function\n * @link https://sharp.pixelplumbing.com/api-output#toformat\n */\nexport type ImageUploadFormatOptions = {\n format: Parameters<Sharp['toFormat']>[0]\n options?: Parameters<Sharp['toFormat']>[1]\n}\n\n/**\n * Params sent to the sharp trim() function\n * @link https://sharp.pixelplumbing.com/api-resize#trim\n */\nexport type ImageUploadTrimOptions = Parameters<Sharp['trim']>[0]\n\nexport type ImageSize = {\n /**\n * @deprecated prefer position\n */\n crop?: string // comes from sharp package\n formatOptions?: ImageUploadFormatOptions\n name: string\n trimOptions?: ImageUploadTrimOptions\n /**\n * When an uploaded image is smaller than the defined image size, we have 3 options:\n *\n * `undefined | false | true`\n *\n * 1. `undefined` [default]: uploading images with smaller width AND height than the image size will return null\n * 2. `false`: always enlarge images to the image size\n * 3. `true`: if the image is smaller than the image size, return the original image\n */\n withoutEnlargement?: ResizeOptions['withoutEnlargement']\n} & Omit<ResizeOptions, 'withoutEnlargement'>\n\nexport type GetAdminThumbnail = (args: { doc: Record<string, unknown> }) => false | null | string\n\nexport type UploadConfig = {\n /**\n * The adapter name to use for uploads. Used for storage adapter telemetry.\n * @default undefined\n */\n adapter?: string\n /**\n * Represents an admin thumbnail, which can be either a React component or a string.\n * - If a string, it should be one of the image size names.\n * - A function that generates a fully qualified URL for the thumbnail, receives the doc as the only argument.\n **/\n adminThumbnail?: GetAdminThumbnail | string\n /**\n * Enables cropping of images.\n * @default true\n */\n crop?: boolean\n /**\n * Disable the ability to save files to disk.\n * @default false\n */\n disableLocalStorage?: boolean\n /**\n * Ability to filter/modify Request Headers when fetching a file.\n *\n * Useful for adding custom headers to fetch from external providers.\n * @default undefined\n */\n externalFileHeaderFilter?: (headers: Record<string, string>) => Record<string, string>\n /**\n * Require files to be uploaded when creating a document.\n * @default true\n */\n filesRequiredOnCreate?: boolean\n /**\n * Enables focal point positioning for image manipulation.\n * @default false\n */\n focalPoint?: boolean\n /**\n * Format options for the uploaded file. Formatting image sizes needs to be done within each formatOptions individually.\n */\n formatOptions?: ImageUploadFormatOptions\n /**\n * Custom handlers to run when a file is fetched.\n *\n * - If a handler returns a Response, the response will be sent to the client and no further handlers will be run.\n * - If a handler returns null, the next handler will be run.\n * - If no handlers return a response the file will be returned by default.\n *\n * @default undefined\n */\n handlers?: ((\n req: PayloadRequest,\n args: {\n doc: TypeWithID\n params: { collection: string; filename: string }\n },\n ) => Promise<Response> | Promise<void> | Response | void)[]\n imageSizes?: ImageSize[]\n /**\n * Restrict mimeTypes in the file picker. Array of valid mime types or mimetype wildcards\n * @example ['image/*', 'application/pdf']\n * @default undefined\n */\n mimeTypes?: string[]\n /**\n * Ability to modify the response headers fetching a file.\n * @default undefined\n */\n modifyResponseHeaders?: ({ headers }: { headers: Headers }) => Headers\n /**\n * Sharp resize options for the original image.\n * @link https://sharp.pixelplumbing.com/api-resize#resize\n * @default undefined\n */\n resizeOptions?: ResizeOptions\n /**\n * The directory to serve static files from. Defaults to collection slug.\n * @default undefined\n */\n staticDir?: string\n trimOptions?: ImageUploadTrimOptions\n /**\n * Optionally append metadata to the image during processing.\n *\n * Can be a boolean or a function.\n *\n * If true, metadata will be appended to the image.\n * If false, no metadata will be appended.\n * If a function, it will receive an object containing the metadata and should return a boolean indicating whether to append the metadata.\n * @default false\n */\n withMetadata?: WithMetadata\n}\n\nexport type SanitizedUploadConfig = {\n staticDir: UploadConfig['staticDir']\n} & UploadConfig\n\nexport type File = {\n /**\n * The buffer of the file.\n */\n data: Buffer\n /**\n * The mimetype of the file.\n */\n mimetype: string\n /**\n * The name of the file.\n */\n name: string\n /**\n * The size of the file in bytes.\n */\n size: number\n}\n\nexport type FileToSave = {\n /**\n * The buffer of the file.\n */\n buffer: Buffer\n /**\n * The path to save the file.\n */\n path: string\n}\n\ntype Crop = {\n height: number\n unit: '%' | 'px'\n width: number\n x: number\n y: number\n}\n\ntype FocalPoint = {\n x: number\n y: number\n}\n\nexport type UploadEdits = {\n crop?: Crop\n focalPoint?: FocalPoint\n heightInPixels?: number\n widthInPixels?: number\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/uploads/types.ts"],"sourcesContent":["import type { ResizeOptions, Sharp, Metadata as SharpMetadata } from 'sharp'\n\nimport type { TypeWithID } from '../collections/config/types.js'\nimport type { PayloadRequest } from '../types/index.js'\nimport type { WithMetadata } from './optionallyAppendMetadata.js'\n\nexport type FileSize = {\n filename: null | string\n filesize: null | number\n height: null | number\n mimeType: null | string\n width: null | number\n}\n\nexport type FileSizes = {\n [size: string]: FileSize\n}\n\nexport type FileData = {\n filename: string\n filesize: number\n focalX?: number\n focalY?: number\n height: number\n mimeType: string\n sizes: FileSizes\n tempFilePath?: string\n url?: string\n width: number\n}\n\nexport type ProbedImageSize = {\n height: number\n width: number\n}\n\n/**\n * Params sent to the sharp `toFormat()` function\n * @link https://sharp.pixelplumbing.com/api-output#toformat\n */\nexport type ImageUploadFormatOptions = {\n format: Parameters<Sharp['toFormat']>[0]\n options?: Parameters<Sharp['toFormat']>[1]\n}\n\n/**\n * Params sent to the sharp trim() function\n * @link https://sharp.pixelplumbing.com/api-resize#trim\n */\nexport type ImageUploadTrimOptions = Parameters<Sharp['trim']>[0]\n\nexport type ImageSize = {\n /**\n * @deprecated prefer position\n */\n crop?: string // comes from sharp package\n formatOptions?: ImageUploadFormatOptions\n name: string\n trimOptions?: ImageUploadTrimOptions\n /**\n * When an uploaded image is smaller than the defined image size, we have 3 options:\n *\n * `undefined | false | true`\n *\n * 1. `undefined` [default]: uploading images with smaller width AND height than the image size will return null\n * 2. `false`: always enlarge images to the image size\n * 3. `true`: if the image is smaller than the image size, return the original image\n */\n withoutEnlargement?: ResizeOptions['withoutEnlargement']\n} & Omit<ResizeOptions, 'withoutEnlargement'>\n\nexport type GetAdminThumbnail = (args: { doc: Record<string, unknown> }) => false | null | string\n\nexport type UploadConfig = {\n /**\n * The adapter name to use for uploads. Used for storage adapter telemetry.\n * @default undefined\n */\n adapter?: string\n /**\n * Represents an admin thumbnail, which can be either a React component or a string.\n * - If a string, it should be one of the image size names.\n * - A function that generates a fully qualified URL for the thumbnail, receives the doc as the only argument.\n **/\n adminThumbnail?: GetAdminThumbnail | string\n /**\n * Enables cropping of images.\n * @default true\n */\n crop?: boolean\n /**\n * Disable the ability to save files to disk.\n * @default false\n */\n disableLocalStorage?: boolean\n /**\n * Enable displaying preview of the uploaded file in Upload fields related to this Collection.\n * Can be locally overridden by `displayPreview` option in Upload field.\n * @default false\n */\n displayPreview?: boolean\n /**\n * Ability to filter/modify Request Headers when fetching a file.\n *\n * Useful for adding custom headers to fetch from external providers.\n * @default undefined\n */\n externalFileHeaderFilter?: (headers: Record<string, string>) => Record<string, string>\n /**\n * Require files to be uploaded when creating a document.\n * @default true\n */\n filesRequiredOnCreate?: boolean\n /**\n * Enables focal point positioning for image manipulation.\n * @default false\n */\n focalPoint?: boolean\n /**\n * Format options for the uploaded file. Formatting image sizes needs to be done within each formatOptions individually.\n */\n formatOptions?: ImageUploadFormatOptions\n /**\n * Custom handlers to run when a file is fetched.\n *\n * - If a handler returns a Response, the response will be sent to the client and no further handlers will be run.\n * - If a handler returns null, the next handler will be run.\n * - If no handlers return a response the file will be returned by default.\n *\n * @default undefined\n */\n handlers?: ((\n req: PayloadRequest,\n args: {\n doc: TypeWithID\n params: { collection: string; filename: string }\n },\n ) => Promise<Response> | Promise<void> | Response | void)[]\n imageSizes?: ImageSize[]\n /**\n * Restrict mimeTypes in the file picker. Array of valid mime types or mimetype wildcards\n * @example ['image/*', 'application/pdf']\n * @default undefined\n */\n mimeTypes?: string[]\n /**\n * Ability to modify the response headers fetching a file.\n * @default undefined\n */\n modifyResponseHeaders?: ({ headers }: { headers: Headers }) => Headers\n /**\n * Sharp resize options for the original image.\n * @link https://sharp.pixelplumbing.com/api-resize#resize\n * @default undefined\n */\n resizeOptions?: ResizeOptions\n /**\n * The directory to serve static files from. Defaults to collection slug.\n * @default undefined\n */\n staticDir?: string\n trimOptions?: ImageUploadTrimOptions\n /**\n * Optionally append metadata to the image during processing.\n *\n * Can be a boolean or a function.\n *\n * If true, metadata will be appended to the image.\n * If false, no metadata will be appended.\n * If a function, it will receive an object containing the metadata and should return a boolean indicating whether to append the metadata.\n * @default false\n */\n withMetadata?: WithMetadata\n}\n\nexport type SanitizedUploadConfig = {\n staticDir: UploadConfig['staticDir']\n} & UploadConfig\n\nexport type File = {\n /**\n * The buffer of the file.\n */\n data: Buffer\n /**\n * The mimetype of the file.\n */\n mimetype: string\n /**\n * The name of the file.\n */\n name: string\n /**\n * The size of the file in bytes.\n */\n size: number\n}\n\nexport type FileToSave = {\n /**\n * The buffer of the file.\n */\n buffer: Buffer\n /**\n * The path to save the file.\n */\n path: string\n}\n\ntype Crop = {\n height: number\n unit: '%' | 'px'\n width: number\n x: number\n y: number\n}\n\ntype FocalPoint = {\n x: number\n y: number\n}\n\nexport type UploadEdits = {\n crop?: Crop\n focalPoint?: FocalPoint\n heightInPixels?: number\n widthInPixels?: number\n}\n"],"names":[],"mappings":"AA8NA,WAKC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configToJSONSchema.d.ts","sourceRoot":"","sources":["../../src/utilities/configToJSONSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAMnE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAA8B,MAAM,2BAA2B,CAAA;AAClF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AA4HvE;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,mBAAmB,EAC9B,UAAU,EAAE,OAAO,GAClB,mBAAmB,GAAG,mBAAmB,EAAE,CAK7C;AAED,wBAAgB,kBAAkB;AAChC;;;;GAIG;AACH,sBAAsB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAA;CAAE,EAC9D,MAAM,EAAE,KAAK,EAAE;AACf;;GAEG;AACH,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EAClD,MAAM,CAAC,EAAE,eAAe,GACvB;IACD,UAAU,EAAE;QACV,CAAC,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;KACzB,CAAA;IACD,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB,CAsYA;AAGD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,eAAe,EACvB,cAAc,EAAE,yBAAyB,GAAG,qBAAqB,EACjE,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EAClD,aAAa,EAAE,QAAQ,GAAG,MAAM,GAC/B,WAAW,CA8Cb;
|
|
1
|
+
{"version":3,"file":"configToJSONSchema.d.ts","sourceRoot":"","sources":["../../src/utilities/configToJSONSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,M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};
|
|
560
560
|
const generateAuthFieldTypes = ({ type, loginWithUsername })=>{
|
|
561
|
-
const emailAuthFields = {
|
|
562
|
-
additionalProperties: false,
|
|
563
|
-
properties: {
|
|
564
|
-
email: fieldType
|
|
565
|
-
},
|
|
566
|
-
required: [
|
|
567
|
-
'email'
|
|
568
|
-
]
|
|
569
|
-
};
|
|
570
|
-
const usernameAuthFields = {
|
|
571
|
-
additionalProperties: false,
|
|
572
|
-
properties: {
|
|
573
|
-
username: fieldType
|
|
574
|
-
},
|
|
575
|
-
required: [
|
|
576
|
-
'username'
|
|
577
|
-
]
|
|
578
|
-
};
|
|
579
|
-
if ([
|
|
580
|
-
'login',
|
|
581
|
-
'register'
|
|
582
|
-
].includes(type)) {
|
|
583
|
-
emailAuthFields.properties['password'] = fieldType;
|
|
584
|
-
emailAuthFields.required.push('password');
|
|
585
|
-
usernameAuthFields.properties['password'] = fieldType;
|
|
586
|
-
usernameAuthFields.required.push('password');
|
|
587
|
-
}
|
|
588
561
|
if (loginWithUsername) {
|
|
589
562
|
switch(type){
|
|
590
563
|
case 'login':
|
|
@@ -594,45 +567,69 @@ const generateAuthFieldTypes = ({ type, loginWithUsername })=>{
|
|
|
594
567
|
return {
|
|
595
568
|
additionalProperties: false,
|
|
596
569
|
oneOf: [
|
|
597
|
-
|
|
598
|
-
|
|
570
|
+
{
|
|
571
|
+
additionalProperties: false,
|
|
572
|
+
properties: {
|
|
573
|
+
email: fieldType,
|
|
574
|
+
password: fieldType
|
|
575
|
+
},
|
|
576
|
+
required: [
|
|
577
|
+
'email',
|
|
578
|
+
'password'
|
|
579
|
+
]
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
additionalProperties: false,
|
|
583
|
+
properties: {
|
|
584
|
+
password: fieldType,
|
|
585
|
+
username: fieldType
|
|
586
|
+
},
|
|
587
|
+
required: [
|
|
588
|
+
'username',
|
|
589
|
+
'password'
|
|
590
|
+
]
|
|
591
|
+
}
|
|
599
592
|
]
|
|
600
593
|
};
|
|
601
594
|
} else {
|
|
602
595
|
// allow only username and password for login
|
|
603
|
-
return usernameAuthFields;
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
case 'register':
|
|
607
|
-
{
|
|
608
|
-
if (loginWithUsername.requireEmail) {
|
|
609
|
-
// require username, email and password for registration
|
|
610
596
|
return {
|
|
611
597
|
additionalProperties: false,
|
|
612
598
|
properties: {
|
|
613
|
-
|
|
614
|
-
|
|
599
|
+
password: fieldType,
|
|
600
|
+
username: fieldType
|
|
615
601
|
},
|
|
616
602
|
required: [
|
|
617
|
-
|
|
618
|
-
|
|
603
|
+
'username',
|
|
604
|
+
'password'
|
|
619
605
|
]
|
|
620
606
|
};
|
|
621
|
-
} else if (loginWithUsername.allowEmailLogin) {
|
|
622
|
-
// allow both but only require username for registration
|
|
623
|
-
return {
|
|
624
|
-
additionalProperties: false,
|
|
625
|
-
properties: {
|
|
626
|
-
...usernameAuthFields.properties,
|
|
627
|
-
...emailAuthFields.properties
|
|
628
|
-
},
|
|
629
|
-
required: usernameAuthFields.required
|
|
630
|
-
};
|
|
631
|
-
} else {
|
|
632
|
-
// require only username and password for registration
|
|
633
|
-
return usernameAuthFields;
|
|
634
607
|
}
|
|
635
608
|
}
|
|
609
|
+
case 'register':
|
|
610
|
+
{
|
|
611
|
+
const requiredFields = [
|
|
612
|
+
'password'
|
|
613
|
+
];
|
|
614
|
+
const properties = {
|
|
615
|
+
password: fieldType,
|
|
616
|
+
username: fieldType
|
|
617
|
+
};
|
|
618
|
+
if (loginWithUsername.requireEmail) {
|
|
619
|
+
requiredFields.push('email');
|
|
620
|
+
}
|
|
621
|
+
if (loginWithUsername.requireUsername) {
|
|
622
|
+
requiredFields.push('username');
|
|
623
|
+
}
|
|
624
|
+
if (loginWithUsername.requireEmail || loginWithUsername.allowEmailLogin) {
|
|
625
|
+
properties.email = fieldType;
|
|
626
|
+
}
|
|
627
|
+
return {
|
|
628
|
+
additionalProperties: false,
|
|
629
|
+
properties,
|
|
630
|
+
required: requiredFields
|
|
631
|
+
};
|
|
632
|
+
}
|
|
636
633
|
case 'forgotOrUnlock':
|
|
637
634
|
{
|
|
638
635
|
if (loginWithUsername.allowEmailLogin) {
|
|
@@ -640,19 +637,53 @@ const generateAuthFieldTypes = ({ type, loginWithUsername })=>{
|
|
|
640
637
|
return {
|
|
641
638
|
additionalProperties: false,
|
|
642
639
|
oneOf: [
|
|
643
|
-
|
|
644
|
-
|
|
640
|
+
{
|
|
641
|
+
additionalProperties: false,
|
|
642
|
+
properties: {
|
|
643
|
+
email: fieldType
|
|
644
|
+
},
|
|
645
|
+
required: [
|
|
646
|
+
'email'
|
|
647
|
+
]
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
additionalProperties: false,
|
|
651
|
+
properties: {
|
|
652
|
+
username: fieldType
|
|
653
|
+
},
|
|
654
|
+
required: [
|
|
655
|
+
'username'
|
|
656
|
+
]
|
|
657
|
+
}
|
|
645
658
|
]
|
|
646
659
|
};
|
|
647
660
|
} else {
|
|
648
661
|
// allow only username for unlock/forgot-password
|
|
649
|
-
return
|
|
662
|
+
return {
|
|
663
|
+
additionalProperties: false,
|
|
664
|
+
properties: {
|
|
665
|
+
username: fieldType
|
|
666
|
+
},
|
|
667
|
+
required: [
|
|
668
|
+
'username'
|
|
669
|
+
]
|
|
670
|
+
};
|
|
650
671
|
}
|
|
651
672
|
}
|
|
652
673
|
}
|
|
653
674
|
}
|
|
654
675
|
// default email (and password for login/register)
|
|
655
|
-
return
|
|
676
|
+
return {
|
|
677
|
+
additionalProperties: false,
|
|
678
|
+
properties: {
|
|
679
|
+
email: fieldType,
|
|
680
|
+
password: fieldType
|
|
681
|
+
},
|
|
682
|
+
required: [
|
|
683
|
+
'email',
|
|
684
|
+
'password'
|
|
685
|
+
]
|
|
686
|
+
};
|
|
656
687
|
};
|
|
657
688
|
export function authCollectionToOperationsJSONSchema(config) {
|
|
658
689
|
const loginWithUsername = config.auth?.loginWithUsername;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utilities/configToJSONSchema.ts"],"sourcesContent":["import type { JSONSchema4, JSONSchema4TypeName } from 'json-schema'\n\nimport pluralize from 'pluralize'\nconst { singular } = pluralize\n\nimport type { Auth } from '../auth/types.js'\nimport type { SanitizedCollectionConfig } from '../collections/config/types.js'\nimport type { SanitizedConfig } from '../config/types.js'\nimport type { Field, FieldAffectingData, Option } from '../fields/config/types.js'\nimport type { SanitizedGlobalConfig } from '../globals/config/types.js'\n\nimport { MissingEditorProp } from '../errors/MissingEditorProp.js'\nimport { fieldAffectsData, tabHasName } from '../fields/config/types.js'\nimport { deepCopyObject } from './deepCopyObject.js'\nimport { toWords } from './formatLabels.js'\nimport { getCollectionIDFieldTypes } from './getCollectionIDFieldTypes.js'\n\nconst fieldIsRequired = (field: Field) => {\n const isConditional = Boolean(field?.admin && field?.admin?.condition)\n if (isConditional) return false\n\n const isMarkedRequired = 'required' in field && field.required === true\n if (fieldAffectsData(field) && isMarkedRequired) return true\n\n // if any subfields are required, this field is required\n if ('fields' in field && field.type !== 'array') {\n return field.fields.some((subField) => fieldIsRequired(subField))\n }\n\n // if any tab subfields have required fields, this field is required\n if (field.type === 'tabs') {\n return field.tabs.some((tab) => {\n if ('name' in tab) {\n return tab.fields.some((subField) => fieldIsRequired(subField))\n }\n return false\n })\n }\n\n return false\n}\n\nfunction buildOptionEnums(options: Option[]): string[] {\n return options.map((option) => {\n if (typeof option === 'object' && 'value' in option) {\n return option.value\n }\n\n return option\n })\n}\n\nfunction generateEntitySchemas(\n entities: (SanitizedCollectionConfig | SanitizedGlobalConfig)[],\n): JSONSchema4 {\n const properties = [...entities].reduce((acc, { slug }) => {\n acc[slug] = {\n $ref: `#/definitions/${slug}`,\n }\n\n return acc\n }, {})\n\n return {\n type: 'object',\n additionalProperties: false,\n properties,\n required: Object.keys(properties),\n }\n}\n\nfunction generateLocaleEntitySchemas(localization: SanitizedConfig['localization']): JSONSchema4 {\n if (localization && 'locales' in localization && localization?.locales) {\n const localesFromConfig = localization?.locales\n\n const locales = [...localesFromConfig].map((locale) => {\n return locale.code\n }, [])\n\n return {\n type: 'string',\n enum: locales,\n }\n }\n\n return {\n type: 'null',\n }\n}\n\nfunction generateAuthEntitySchemas(entities: SanitizedCollectionConfig[]): JSONSchema4 {\n const properties: JSONSchema4[] = [...entities]\n .filter(({ auth }) => Boolean(auth))\n .map(({ slug }) => {\n return {\n allOf: [\n { $ref: `#/definitions/${slug}` },\n {\n type: 'object',\n additionalProperties: false,\n properties: {\n collection: { type: 'string', enum: [slug] },\n },\n required: ['collection'],\n },\n ],\n }\n }, {})\n\n return {\n oneOf: properties,\n }\n}\n\n/**\n * Generates the JSON Schema for database configuration\n *\n * @example { db: idType: string }\n */\nfunction generateDbEntitySchema(config: SanitizedConfig): JSONSchema4 {\n const defaultIDType: JSONSchema4 =\n config.db?.defaultIDType === 'number' ? { type: 'number' } : { type: 'string' }\n\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n defaultIDType,\n },\n required: ['defaultIDType'],\n }\n}\n\n/**\n * Returns a JSON Schema Type with 'null' added if the field is not required.\n */\nexport function withNullableJSONSchemaType(\n fieldType: JSONSchema4TypeName,\n isRequired: boolean,\n): JSONSchema4TypeName | JSONSchema4TypeName[] {\n const fieldTypes = [fieldType]\n if (isRequired) return fieldType\n fieldTypes.push('null')\n return fieldTypes\n}\n\nexport function fieldsToJSONSchema(\n /**\n * Used for relationship fields, to determine whether to use a string or number type for the ID.\n * While there is a default ID field type set by the db adapter, they can differ on a collection-level\n * if they have custom ID fields.\n */\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' },\n fields: Field[],\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 config?: SanitizedConfig,\n): {\n properties: {\n [k: string]: JSONSchema4\n }\n required: string[]\n} {\n const requiredFieldNames = new Set<string>()\n\n return {\n properties: Object.fromEntries(\n fields.reduce((fieldSchemas, field) => {\n const isRequired = fieldAffectsData(field) && fieldIsRequired(field)\n if (isRequired) requiredFieldNames.add(field.name)\n\n let fieldSchema: JSONSchema4\n\n switch (field.type) {\n case 'text':\n if (field.hasMany === true) {\n fieldSchema = {\n type: withNullableJSONSchemaType('array', isRequired),\n items: { type: 'string' },\n }\n } else {\n fieldSchema = { type: withNullableJSONSchemaType('string', isRequired) }\n }\n break\n case 'textarea':\n case 'code':\n case 'email':\n case 'date': {\n fieldSchema = { type: withNullableJSONSchemaType('string', isRequired) }\n break\n }\n\n case 'number': {\n if (field.hasMany === true) {\n fieldSchema = {\n type: withNullableJSONSchemaType('array', isRequired),\n items: { type: 'number' },\n }\n } else {\n fieldSchema = { type: withNullableJSONSchemaType('number', isRequired) }\n }\n break\n }\n\n case 'checkbox': {\n fieldSchema = { type: withNullableJSONSchemaType('boolean', isRequired) }\n break\n }\n\n case 'json': {\n fieldSchema = field.jsonSchema?.schema || {\n type: ['object', 'array', 'string', 'number', 'boolean', 'null'],\n }\n break\n }\n\n case 'richText': {\n if (!field?.editor) {\n throw new MissingEditorProp(field) // while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor\n }\n if (typeof field.editor === 'function') {\n throw new Error('Attempted to access unsanitized rich text editor.')\n }\n if (field.editor.outputSchema) {\n fieldSchema = field.editor.outputSchema({\n collectionIDFieldTypes,\n config,\n field,\n interfaceNameDefinitions,\n isRequired,\n })\n } else {\n // Maintain backwards compatibility with existing rich text editors\n fieldSchema = {\n type: withNullableJSONSchemaType('array', isRequired),\n items: {\n type: 'object',\n },\n }\n }\n\n break\n }\n\n case 'radio': {\n fieldSchema = {\n type: withNullableJSONSchemaType('string', isRequired),\n enum: buildOptionEnums(field.options),\n }\n\n break\n }\n\n case 'select': {\n const optionEnums = buildOptionEnums(field.options)\n\n if (field.hasMany) {\n fieldSchema = {\n type: withNullableJSONSchemaType('array', isRequired),\n items: {\n type: 'string',\n enum: optionEnums,\n },\n }\n } else {\n fieldSchema = {\n type: withNullableJSONSchemaType('string', isRequired),\n enum: optionEnums,\n }\n }\n\n break\n }\n\n case 'point': {\n fieldSchema = {\n type: withNullableJSONSchemaType('array', isRequired),\n items: [\n {\n type: 'number',\n },\n {\n type: 'number',\n },\n ],\n maxItems: 2,\n minItems: 2,\n }\n break\n }\n\n case 'relationship': {\n if (Array.isArray(field.relationTo)) {\n if (field.hasMany) {\n fieldSchema = {\n type: withNullableJSONSchemaType('array', isRequired),\n items: {\n oneOf: field.relationTo.map((relation) => {\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n relationTo: {\n const: relation,\n },\n value: {\n oneOf: [\n {\n type: collectionIDFieldTypes[relation],\n },\n {\n $ref: `#/definitions/${relation}`,\n },\n ],\n },\n },\n required: ['value', 'relationTo'],\n }\n }),\n },\n }\n } else {\n fieldSchema = {\n oneOf: field.relationTo.map((relation) => {\n return {\n type: withNullableJSONSchemaType('object', isRequired),\n additionalProperties: false,\n properties: {\n relationTo: {\n const: relation,\n },\n value: {\n oneOf: [\n {\n type: collectionIDFieldTypes[relation],\n },\n {\n $ref: `#/definitions/${relation}`,\n },\n ],\n },\n },\n required: ['value', 'relationTo'],\n }\n }),\n }\n }\n } else if (field.hasMany) {\n fieldSchema = {\n type: withNullableJSONSchemaType('array', isRequired),\n items: {\n oneOf: [\n {\n type: collectionIDFieldTypes[field.relationTo],\n },\n {\n $ref: `#/definitions/${field.relationTo}`,\n },\n ],\n },\n }\n } else {\n fieldSchema = {\n oneOf: [\n {\n type: withNullableJSONSchemaType(\n collectionIDFieldTypes[field.relationTo],\n isRequired,\n ),\n },\n {\n $ref: `#/definitions/${field.relationTo}`,\n },\n ],\n }\n }\n\n break\n }\n\n case 'upload': {\n fieldSchema = {\n oneOf: [\n {\n type: collectionIDFieldTypes[field.relationTo],\n },\n {\n $ref: `#/definitions/${field.relationTo}`,\n },\n ],\n }\n if (!isRequired) fieldSchema.oneOf.push({ type: 'null' })\n break\n }\n\n case 'blocks': {\n fieldSchema = {\n type: withNullableJSONSchemaType('array', isRequired),\n items: {\n oneOf: field.blocks.map((block) => {\n const blockFieldSchemas = fieldsToJSONSchema(\n collectionIDFieldTypes,\n block.fields,\n interfaceNameDefinitions,\n config,\n )\n\n const blockSchema: JSONSchema4 = {\n type: 'object',\n additionalProperties: false,\n properties: {\n ...blockFieldSchemas.properties,\n blockType: {\n const: block.slug,\n },\n },\n required: ['blockType', ...blockFieldSchemas.required],\n }\n\n if (block.interfaceName) {\n interfaceNameDefinitions.set(block.interfaceName, blockSchema)\n\n return {\n $ref: `#/definitions/${block.interfaceName}`,\n }\n }\n\n return blockSchema\n }),\n },\n }\n break\n }\n\n case 'array': {\n fieldSchema = {\n type: withNullableJSONSchemaType('array', isRequired),\n items: {\n type: 'object',\n additionalProperties: false,\n ...fieldsToJSONSchema(\n collectionIDFieldTypes,\n field.fields,\n interfaceNameDefinitions,\n config,\n ),\n },\n }\n\n if (field.interfaceName) {\n interfaceNameDefinitions.set(field.interfaceName, fieldSchema)\n\n fieldSchema = {\n $ref: `#/definitions/${field.interfaceName}`,\n }\n }\n break\n }\n\n case 'row':\n case 'collapsible': {\n const childSchema = fieldsToJSONSchema(\n collectionIDFieldTypes,\n field.fields,\n interfaceNameDefinitions,\n config,\n )\n Object.entries(childSchema.properties).forEach(([propName, propSchema]) => {\n fieldSchemas.set(propName, propSchema)\n })\n childSchema.required.forEach((propName) => {\n requiredFieldNames.add(propName)\n })\n break\n }\n\n case 'tabs': {\n field.tabs.forEach((tab) => {\n const childSchema = fieldsToJSONSchema(\n collectionIDFieldTypes,\n tab.fields,\n interfaceNameDefinitions,\n config,\n )\n if (tabHasName(tab)) {\n // could have interface\n fieldSchemas.set(tab.name, {\n type: 'object',\n additionalProperties: false,\n ...childSchema,\n })\n\n // If the named tab has any required fields then we mark this as required otherwise it should be optional\n const hasRequiredFields = tab.fields.some((subField) => fieldIsRequired(subField))\n\n if (hasRequiredFields) {\n requiredFieldNames.add(tab.name)\n }\n } else {\n Object.entries(childSchema.properties).forEach(([propName, propSchema]) => {\n fieldSchemas.set(propName, propSchema)\n })\n childSchema.required.forEach((propName) => {\n requiredFieldNames.add(propName)\n })\n }\n })\n break\n }\n\n case 'group': {\n fieldSchema = {\n type: 'object',\n additionalProperties: false,\n ...fieldsToJSONSchema(\n collectionIDFieldTypes,\n field.fields,\n interfaceNameDefinitions,\n config,\n ),\n }\n\n if (field.interfaceName) {\n interfaceNameDefinitions.set(field.interfaceName, fieldSchema)\n\n fieldSchema = {\n $ref: `#/definitions/${field.interfaceName}`,\n }\n }\n break\n }\n\n default: {\n break\n }\n }\n\n if ('typescriptSchema' in field && field?.typescriptSchema?.length) {\n for (const schema of field.typescriptSchema) {\n fieldSchema = schema({ jsonSchema: fieldSchema })\n }\n }\n\n if (fieldSchema && fieldAffectsData(field)) {\n fieldSchemas.set(field.name, fieldSchema)\n }\n\n return fieldSchemas\n }, new Map<string, JSONSchema4>()),\n ),\n required: Array.from(requiredFieldNames),\n }\n}\n\n// This function is part of the public API and is exported through payload/utilities\nexport function entityToJSONSchema(\n config: SanitizedConfig,\n incomingEntity: SanitizedCollectionConfig | SanitizedGlobalConfig,\n interfaceNameDefinitions: Map<string, JSONSchema4>,\n defaultIDType: 'number' | 'text',\n): JSONSchema4 {\n const entity: SanitizedCollectionConfig | SanitizedGlobalConfig = deepCopyObject(incomingEntity)\n const title = entity.typescript?.interface\n ? entity.typescript.interface\n : singular(toWords(entity.slug, true))\n\n const idField: FieldAffectingData = { name: 'id', type: defaultIDType as 'text', required: true }\n const customIdField = entity.fields.find(\n (field) => fieldAffectsData(field) && field.name === 'id',\n ) as FieldAffectingData\n\n if (customIdField && customIdField.type !== 'group' && customIdField.type !== 'tab') {\n customIdField.required = true\n } else {\n entity.fields.unshift(idField)\n }\n\n // mark timestamp fields required\n if ('timestamps' in entity && entity.timestamps !== false) {\n entity.fields = entity.fields.map((field) => {\n if (fieldAffectsData(field) && (field.name === 'createdAt' || field.name === 'updatedAt')) {\n return {\n ...field,\n required: true,\n }\n }\n return field\n })\n }\n\n if ('auth' in entity && entity.auth && !entity.auth?.disableLocalStrategy) {\n entity.fields.push({\n name: 'password',\n type: 'text',\n })\n }\n\n // Used for relationship fields, to determine whether to use a string or number type for the ID.\n const collectionIDFieldTypes = getCollectionIDFieldTypes({ config, defaultIDType })\n\n return {\n type: 'object',\n additionalProperties: false,\n title,\n ...fieldsToJSONSchema(collectionIDFieldTypes, entity.fields, interfaceNameDefinitions, config),\n }\n}\n\nconst fieldType: JSONSchema4 = {\n type: 'string',\n required: false,\n}\nconst generateAuthFieldTypes = ({\n type,\n loginWithUsername,\n}: {\n loginWithUsername: Auth['loginWithUsername']\n type: 'forgotOrUnlock' | 'login' | 'register'\n}): JSONSchema4 => {\n const emailAuthFields = {\n additionalProperties: false,\n properties: { email: fieldType },\n required: ['email'],\n }\n const usernameAuthFields = {\n additionalProperties: false,\n properties: { username: fieldType },\n required: ['username'],\n }\n\n if (['login', 'register'].includes(type)) {\n emailAuthFields.properties['password'] = fieldType\n emailAuthFields.required.push('password')\n usernameAuthFields.properties['password'] = fieldType\n usernameAuthFields.required.push('password')\n }\n\n if (loginWithUsername) {\n switch (type) {\n case 'login': {\n if (loginWithUsername.allowEmailLogin) {\n // allow username or email and require password for login\n return {\n additionalProperties: false,\n oneOf: [emailAuthFields, usernameAuthFields],\n }\n } else {\n // allow only username and password for login\n return usernameAuthFields\n }\n }\n\n case 'register': {\n if (loginWithUsername.requireEmail) {\n // require username, email and password for registration\n return {\n additionalProperties: false,\n properties: {\n ...usernameAuthFields.properties,\n ...emailAuthFields.properties,\n },\n required: [...usernameAuthFields.required, ...emailAuthFields.required],\n }\n } else if (loginWithUsername.allowEmailLogin) {\n // allow both but only require username for registration\n return {\n additionalProperties: false,\n properties: {\n ...usernameAuthFields.properties,\n ...emailAuthFields.properties,\n },\n required: usernameAuthFields.required,\n }\n } else {\n // require only username and password for registration\n return usernameAuthFields\n }\n }\n\n case 'forgotOrUnlock': {\n if (loginWithUsername.allowEmailLogin) {\n // allow email or username for unlock/forgot-password\n return {\n additionalProperties: false,\n oneOf: [emailAuthFields, usernameAuthFields],\n }\n } else {\n // allow only username for unlock/forgot-password\n return usernameAuthFields\n }\n }\n }\n }\n\n // default email (and password for login/register)\n return emailAuthFields\n}\n\nexport function authCollectionToOperationsJSONSchema(\n config: SanitizedCollectionConfig,\n): JSONSchema4 {\n const loginWithUsername = config.auth?.loginWithUsername\n const loginUserFields: JSONSchema4 = generateAuthFieldTypes({ type: 'login', loginWithUsername })\n const forgotOrUnlockUserFields: JSONSchema4 = generateAuthFieldTypes({\n type: 'forgotOrUnlock',\n loginWithUsername,\n })\n const registerUserFields: JSONSchema4 = generateAuthFieldTypes({\n type: 'register',\n loginWithUsername,\n })\n\n const properties: JSONSchema4['properties'] = {\n forgotPassword: forgotOrUnlockUserFields,\n login: loginUserFields,\n registerFirstUser: registerUserFields,\n unlock: forgotOrUnlockUserFields,\n }\n\n return {\n type: 'object',\n additionalProperties: false,\n properties,\n required: Object.keys(properties),\n title: `${singular(toWords(`${config.slug}`, true))}AuthOperations`,\n }\n}\n\nfunction generateAuthOperationSchemas(collections: SanitizedCollectionConfig[]): JSONSchema4 {\n const properties = collections.reduce((acc, collection) => {\n if (collection.auth) {\n acc[collection.slug] = {\n $ref: `#/definitions/auth/${collection.slug}`,\n }\n }\n return acc\n }, {})\n\n return {\n type: 'object',\n additionalProperties: false,\n properties,\n required: Object.keys(properties),\n }\n}\n\n/**\n * This is used for generating the TypeScript types (payload-types.ts) with the payload generate:types command.\n */\nexport function configToJSONSchema(\n config: SanitizedConfig,\n defaultIDType?: 'number' | 'text',\n): JSONSchema4 {\n // a mutable Map to store custom top-level `interfaceName` types. Fields with an `interfaceName` property will be moved to the top-level definitions here\n const interfaceNameDefinitions: Map<string, JSONSchema4> = new Map()\n\n // Collections and Globals have to be moved to the top-level definitions as well. Reason: The top-level type will be the `Config` type - we don't want all collection and global\n // types to be inlined inside the `Config` type\n const entityDefinitions: { [k: string]: JSONSchema4 } = [\n ...config.globals,\n ...config.collections,\n ].reduce((acc, entity) => {\n acc[entity.slug] = entityToJSONSchema(config, entity, interfaceNameDefinitions, defaultIDType)\n return acc\n }, {})\n\n const authOperationDefinitions = [...config.collections]\n .filter(({ auth }) => Boolean(auth))\n .reduce(\n (acc, authCollection) => {\n acc.auth[authCollection.slug] = authCollectionToOperationsJSONSchema(authCollection)\n return acc\n },\n { auth: {} },\n )\n\n let jsonSchema: JSONSchema4 = {\n additionalProperties: false,\n definitions: {\n ...entityDefinitions,\n ...Object.fromEntries(interfaceNameDefinitions),\n ...authOperationDefinitions,\n },\n // These properties here will be very simple, as all the complexity is in the definitions. These are just the properties for the top-level `Config` type\n type: 'object',\n properties: {\n auth: generateAuthOperationSchemas(config.collections),\n collections: generateEntitySchemas(config.collections || []),\n db: generateDbEntitySchema(config),\n globals: generateEntitySchemas(config.globals || []),\n locale: generateLocaleEntitySchemas(config.localization),\n user: generateAuthEntitySchemas(config.collections),\n },\n required: ['user', 'locale', 'collections', 'globals', 'auth', 'db'],\n title: 'Config',\n }\n\n if (config?.typescript?.schema?.length) {\n for (const schema of config.typescript.schema) {\n jsonSchema = schema({ jsonSchema })\n }\n }\n\n return jsonSchema\n}\n"],"names":["pluralize","singular","MissingEditorProp","fieldAffectsData","tabHasName","deepCopyObject","toWords","getCollectionIDFieldTypes","fieldIsRequired","field","isConditional","Boolean","admin","condition","isMarkedRequired","required","type","fields","some","subField","tabs","tab","buildOptionEnums","options","map","option","value","generateEntitySchemas","entities","properties","reduce","acc","slug","$ref","additionalProperties","Object","keys","generateLocaleEntitySchemas","localization","locales","localesFromConfig","locale","code","enum","generateAuthEntitySchemas","filter","auth","allOf","collection","oneOf","generateDbEntitySchema","config","defaultIDType","db","withNullableJSONSchemaType","fieldType","isRequired","fieldTypes","push","fieldsToJSONSchema","collectionIDFieldTypes","interfaceNameDefinitions","requiredFieldNames","Set","fromEntries","fieldSchemas","add","name","fieldSchema","hasMany","items","jsonSchema","schema","editor","Error","outputSchema","optionEnums","maxItems","minItems","Array","isArray","relationTo","relation","const","blocks","block","blockFieldSchemas","blockSchema","blockType","interfaceName","set","childSchema","entries","forEach","propName","propSchema","hasRequiredFields","typescriptSchema","length","Map","from","entityToJSONSchema","incomingEntity","entity","title","typescript","interface","idField","customIdField","find","unshift","timestamps","disableLocalStrategy","generateAuthFieldTypes","loginWithUsername","emailAuthFields","email","usernameAuthFields","username","includes","allowEmailLogin","requireEmail","authCollectionToOperationsJSONSchema","loginUserFields","forgotOrUnlockUserFields","registerUserFields","forgotPassword","login","registerFirstUser","unlock","generateAuthOperationSchemas","collections","configToJSONSchema","entityDefinitions","globals","authOperationDefinitions","authCollection","definitions","user"],"mappings":"AAEA,OAAOA,eAAe,YAAW;AACjC,MAAM,EAAEC,QAAQ,EAAE,GAAGD;AAQrB,SAASE,iBAAiB,QAAQ,iCAAgC;AAClE,SAASC,gBAAgB,EAAEC,UAAU,QAAQ,4BAA2B;AACxE,SAASC,cAAc,QAAQ,sBAAqB;AACpD,SAASC,OAAO,QAAQ,oBAAmB;AAC3C,SAASC,yBAAyB,QAAQ,iCAAgC;AAE1E,MAAMC,kBAAkB,CAACC;IACvB,MAAMC,gBAAgBC,QAAQF,OAAOG,SAASH,OAAOG,OAAOC;IAC5D,IAAIH,eAAe,OAAO;IAE1B,MAAMI,mBAAmB,cAAcL,SAASA,MAAMM,QAAQ,KAAK;IACnE,IAAIZ,iBAAiBM,UAAUK,kBAAkB,OAAO;IAExD,wDAAwD;IACxD,IAAI,YAAYL,SAASA,MAAMO,IAAI,KAAK,SAAS;QAC/C,OAAOP,MAAMQ,MAAM,CAACC,IAAI,CAAC,CAACC,WAAaX,gBAAgBW;IACzD;IAEA,oEAAoE;IACpE,IAAIV,MAAMO,IAAI,KAAK,QAAQ;QACzB,OAAOP,MAAMW,IAAI,CAACF,IAAI,CAAC,CAACG;YACtB,IAAI,UAAUA,KAAK;gBACjB,OAAOA,IAAIJ,MAAM,CAACC,IAAI,CAAC,CAACC,WAAaX,gBAAgBW;YACvD;YACA,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YAAW;YAAQ;SAAK;QACpEyF,OAAO;IACT;IAEA,IAAIrD,QAAQsD,YAAYjC,QAAQ0B,QAAQ;QACtC,KAAK,MAAM1B,UAAUrB,OAAOsD,UAAU,CAACjC,MAAM,CAAE;YAC7CD,aAAaC,OAAO;gBAAED;YAAW;QACnC;IACF;IAEA,OAAOA;AACT"}
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/configToJSONSchema.ts"],"sourcesContent":["import type { JSONSchema4, JSONSchema4TypeName } from 'json-schema'\n\nimport pluralize from 'pluralize'\nconst { singular } = pluralize\n\nimport type { Auth } from '../auth/types.js'\nimport type { SanitizedCollectionConfig } from '../collections/config/types.js'\nimport type { SanitizedConfig } from '../config/types.js'\nimport type { Field, FieldAffectingData, Option } from '../fields/config/types.js'\nimport type { SanitizedGlobalConfig } from '../globals/config/types.js'\n\nimport { MissingEditorProp } from '../errors/MissingEditorProp.js'\nimport { fieldAffectsData, tabHasName } from '../fields/config/types.js'\nimport { deepCopyObject } from './deepCopyObject.js'\nimport { toWords } from './formatLabels.js'\nimport { getCollectionIDFieldTypes } from './getCollectionIDFieldTypes.js'\n\nconst fieldIsRequired = (field: Field) => {\n const isConditional = Boolean(field?.admin && field?.admin?.condition)\n if (isConditional) return false\n\n const isMarkedRequired = 'required' in field && field.required === true\n if (fieldAffectsData(field) && isMarkedRequired) return true\n\n // if any subfields are required, this field is required\n if ('fields' in field && field.type !== 'array') {\n return field.fields.some((subField) => fieldIsRequired(subField))\n }\n\n // if any tab subfields have required fields, this field is required\n if (field.type === 'tabs') {\n return field.tabs.some((tab) => {\n if ('name' in tab) {\n return tab.fields.some((subField) => fieldIsRequired(subField))\n }\n return false\n })\n }\n\n return false\n}\n\nfunction buildOptionEnums(options: Option[]): string[] {\n return options.map((option) => {\n if (typeof option === 'object' && 'value' in option) {\n return option.value\n }\n\n return option\n })\n}\n\nfunction generateEntitySchemas(\n entities: (SanitizedCollectionConfig | SanitizedGlobalConfig)[],\n): JSONSchema4 {\n const properties = [...entities].reduce((acc, { slug }) => {\n acc[slug] = {\n $ref: `#/definitions/${slug}`,\n }\n\n return acc\n }, {})\n\n return {\n type: 'object',\n additionalProperties: false,\n properties,\n required: Object.keys(properties),\n }\n}\n\nfunction generateLocaleEntitySchemas(localization: SanitizedConfig['localization']): JSONSchema4 {\n if (localization && 'locales' in localization && localization?.locales) {\n const localesFromConfig = localization?.locales\n\n const locales = [...localesFromConfig].map((locale) => {\n return locale.code\n }, [])\n\n return {\n type: 'string',\n enum: locales,\n }\n }\n\n return {\n type: 'null',\n }\n}\n\nfunction generateAuthEntitySchemas(entities: SanitizedCollectionConfig[]): JSONSchema4 {\n const properties: JSONSchema4[] = [...entities]\n .filter(({ auth }) => Boolean(auth))\n .map(({ slug }) => {\n return {\n allOf: [\n { $ref: `#/definitions/${slug}` },\n {\n type: 'object',\n additionalProperties: false,\n properties: {\n collection: { type: 'string', enum: [slug] },\n },\n required: ['collection'],\n },\n ],\n }\n }, {})\n\n return {\n oneOf: properties,\n }\n}\n\n/**\n * Generates the JSON Schema for database configuration\n *\n * @example { db: idType: string }\n */\nfunction generateDbEntitySchema(config: SanitizedConfig): JSONSchema4 {\n const defaultIDType: JSONSchema4 =\n config.db?.defaultIDType === 'number' ? { type: 'number' } : { type: 'string' }\n\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n defaultIDType,\n },\n required: ['defaultIDType'],\n }\n}\n\n/**\n * Returns a JSON Schema Type with 'null' added if the field is not required.\n */\nexport function withNullableJSONSchemaType(\n fieldType: JSONSchema4TypeName,\n isRequired: boolean,\n): JSONSchema4TypeName | JSONSchema4TypeName[] {\n const fieldTypes = [fieldType]\n if (isRequired) return fieldType\n fieldTypes.push('null')\n return fieldTypes\n}\n\nexport function fieldsToJSONSchema(\n /**\n * Used for relationship fields, to determine whether to use a string or number type for the ID.\n * While there is a default ID field type set by the db adapter, they can differ on a collection-level\n * if they have custom ID fields.\n */\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' },\n fields: Field[],\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 config?: SanitizedConfig,\n): {\n properties: {\n [k: string]: JSONSchema4\n }\n required: string[]\n} {\n const requiredFieldNames = new Set<string>()\n\n return {\n properties: Object.fromEntries(\n fields.reduce((fieldSchemas, field) => {\n const isRequired = fieldAffectsData(field) && fieldIsRequired(field)\n if (isRequired) requiredFieldNames.add(field.name)\n\n let fieldSchema: JSONSchema4\n\n switch (field.type) {\n case 'text':\n if (field.hasMany === true) {\n fieldSchema = {\n type: withNullableJSONSchemaType('array', isRequired),\n items: { type: 'string' },\n }\n } else {\n fieldSchema = { type: withNullableJSONSchemaType('string', isRequired) }\n }\n break\n case 'textarea':\n case 'code':\n case 'email':\n case 'date': {\n fieldSchema = { type: withNullableJSONSchemaType('string', isRequired) }\n break\n }\n\n case 'number': {\n if (field.hasMany === true) {\n fieldSchema = {\n type: withNullableJSONSchemaType('array', isRequired),\n items: { type: 'number' },\n }\n } else {\n fieldSchema = { type: withNullableJSONSchemaType('number', isRequired) }\n }\n break\n }\n\n case 'checkbox': {\n fieldSchema = { type: withNullableJSONSchemaType('boolean', isRequired) }\n break\n }\n\n case 'json': {\n fieldSchema = field.jsonSchema?.schema || {\n type: ['object', 'array', 'string', 'number', 'boolean', 'null'],\n }\n break\n }\n\n case 'richText': {\n if (!field?.editor) {\n throw new MissingEditorProp(field) // while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor\n }\n if (typeof field.editor === 'function') {\n throw new Error('Attempted to access unsanitized rich text editor.')\n }\n if (field.editor.outputSchema) {\n fieldSchema = field.editor.outputSchema({\n collectionIDFieldTypes,\n config,\n field,\n interfaceNameDefinitions,\n isRequired,\n })\n } else {\n // Maintain backwards compatibility with existing rich text editors\n fieldSchema = {\n type: withNullableJSONSchemaType('array', isRequired),\n items: {\n type: 'object',\n },\n }\n }\n\n break\n }\n\n case 'radio': {\n fieldSchema = {\n type: withNullableJSONSchemaType('string', isRequired),\n enum: buildOptionEnums(field.options),\n }\n\n break\n }\n\n case 'select': {\n const optionEnums = buildOptionEnums(field.options)\n\n if (field.hasMany) {\n fieldSchema = {\n type: withNullableJSONSchemaType('array', isRequired),\n items: {\n type: 'string',\n enum: optionEnums,\n },\n }\n } else {\n fieldSchema = {\n type: withNullableJSONSchemaType('string', isRequired),\n enum: optionEnums,\n }\n }\n\n break\n }\n\n case 'point': {\n fieldSchema = {\n type: withNullableJSONSchemaType('array', isRequired),\n items: [\n {\n type: 'number',\n },\n {\n type: 'number',\n },\n ],\n maxItems: 2,\n minItems: 2,\n }\n break\n }\n\n case 'relationship': {\n if (Array.isArray(field.relationTo)) {\n if (field.hasMany) {\n fieldSchema = {\n type: withNullableJSONSchemaType('array', isRequired),\n items: {\n oneOf: field.relationTo.map((relation) => {\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n relationTo: {\n const: relation,\n },\n value: {\n oneOf: [\n {\n type: collectionIDFieldTypes[relation],\n },\n {\n $ref: `#/definitions/${relation}`,\n },\n ],\n },\n },\n required: ['value', 'relationTo'],\n }\n }),\n },\n }\n } else {\n fieldSchema = {\n oneOf: field.relationTo.map((relation) => {\n return {\n type: withNullableJSONSchemaType('object', isRequired),\n additionalProperties: false,\n properties: {\n relationTo: {\n const: relation,\n },\n value: {\n oneOf: [\n {\n type: collectionIDFieldTypes[relation],\n },\n {\n $ref: `#/definitions/${relation}`,\n },\n ],\n },\n },\n required: ['value', 'relationTo'],\n }\n }),\n }\n }\n } else if (field.hasMany) {\n fieldSchema = {\n type: withNullableJSONSchemaType('array', isRequired),\n items: {\n oneOf: [\n {\n type: collectionIDFieldTypes[field.relationTo],\n },\n {\n $ref: `#/definitions/${field.relationTo}`,\n },\n ],\n },\n }\n } else {\n fieldSchema = {\n oneOf: [\n {\n type: withNullableJSONSchemaType(\n collectionIDFieldTypes[field.relationTo],\n isRequired,\n ),\n },\n {\n $ref: `#/definitions/${field.relationTo}`,\n },\n ],\n }\n }\n\n break\n }\n\n case 'upload': {\n fieldSchema = {\n oneOf: [\n {\n type: collectionIDFieldTypes[field.relationTo],\n },\n {\n $ref: `#/definitions/${field.relationTo}`,\n },\n ],\n }\n if (!isRequired) fieldSchema.oneOf.push({ type: 'null' })\n break\n }\n\n case 'blocks': {\n fieldSchema = {\n type: withNullableJSONSchemaType('array', isRequired),\n items: {\n oneOf: field.blocks.map((block) => {\n const blockFieldSchemas = fieldsToJSONSchema(\n collectionIDFieldTypes,\n block.fields,\n interfaceNameDefinitions,\n config,\n )\n\n const blockSchema: JSONSchema4 = {\n type: 'object',\n additionalProperties: false,\n properties: {\n ...blockFieldSchemas.properties,\n blockType: {\n const: block.slug,\n },\n },\n required: ['blockType', ...blockFieldSchemas.required],\n }\n\n if (block.interfaceName) {\n interfaceNameDefinitions.set(block.interfaceName, blockSchema)\n\n return {\n $ref: `#/definitions/${block.interfaceName}`,\n }\n }\n\n return blockSchema\n }),\n },\n }\n break\n }\n\n case 'array': {\n fieldSchema = {\n type: withNullableJSONSchemaType('array', isRequired),\n items: {\n type: 'object',\n additionalProperties: false,\n ...fieldsToJSONSchema(\n collectionIDFieldTypes,\n field.fields,\n interfaceNameDefinitions,\n config,\n ),\n },\n }\n\n if (field.interfaceName) {\n interfaceNameDefinitions.set(field.interfaceName, fieldSchema)\n\n fieldSchema = {\n $ref: `#/definitions/${field.interfaceName}`,\n }\n }\n break\n }\n\n case 'row':\n case 'collapsible': {\n const childSchema = fieldsToJSONSchema(\n collectionIDFieldTypes,\n field.fields,\n interfaceNameDefinitions,\n config,\n )\n Object.entries(childSchema.properties).forEach(([propName, propSchema]) => {\n fieldSchemas.set(propName, propSchema)\n })\n childSchema.required.forEach((propName) => {\n requiredFieldNames.add(propName)\n })\n break\n }\n\n case 'tabs': {\n field.tabs.forEach((tab) => {\n const childSchema = fieldsToJSONSchema(\n collectionIDFieldTypes,\n tab.fields,\n interfaceNameDefinitions,\n config,\n )\n if (tabHasName(tab)) {\n // could have interface\n fieldSchemas.set(tab.name, {\n type: 'object',\n additionalProperties: false,\n ...childSchema,\n })\n\n // If the named tab has any required fields then we mark this as required otherwise it should be optional\n const hasRequiredFields = tab.fields.some((subField) => fieldIsRequired(subField))\n\n if (hasRequiredFields) {\n requiredFieldNames.add(tab.name)\n }\n } else {\n Object.entries(childSchema.properties).forEach(([propName, propSchema]) => {\n fieldSchemas.set(propName, propSchema)\n })\n childSchema.required.forEach((propName) => {\n requiredFieldNames.add(propName)\n })\n }\n })\n break\n }\n\n case 'group': {\n fieldSchema = {\n type: 'object',\n additionalProperties: false,\n ...fieldsToJSONSchema(\n collectionIDFieldTypes,\n field.fields,\n interfaceNameDefinitions,\n config,\n ),\n }\n\n if (field.interfaceName) {\n interfaceNameDefinitions.set(field.interfaceName, fieldSchema)\n\n fieldSchema = {\n $ref: `#/definitions/${field.interfaceName}`,\n }\n }\n break\n }\n\n default: {\n break\n }\n }\n\n if ('typescriptSchema' in field && field?.typescriptSchema?.length) {\n for (const schema of field.typescriptSchema) {\n fieldSchema = schema({ jsonSchema: fieldSchema })\n }\n }\n\n if (fieldSchema && fieldAffectsData(field)) {\n fieldSchemas.set(field.name, fieldSchema)\n }\n\n return fieldSchemas\n }, new Map<string, JSONSchema4>()),\n ),\n required: Array.from(requiredFieldNames),\n }\n}\n\n// This function is part of the public API and is exported through payload/utilities\nexport function entityToJSONSchema(\n config: SanitizedConfig,\n incomingEntity: SanitizedCollectionConfig | SanitizedGlobalConfig,\n interfaceNameDefinitions: Map<string, JSONSchema4>,\n defaultIDType: 'number' | 'text',\n): JSONSchema4 {\n const entity: SanitizedCollectionConfig | SanitizedGlobalConfig = deepCopyObject(incomingEntity)\n const title = entity.typescript?.interface\n ? entity.typescript.interface\n : singular(toWords(entity.slug, true))\n\n const idField: FieldAffectingData = { name: 'id', type: defaultIDType as 'text', required: true }\n const customIdField = entity.fields.find(\n (field) => fieldAffectsData(field) && field.name === 'id',\n ) as FieldAffectingData\n\n if (customIdField && customIdField.type !== 'group' && customIdField.type !== 'tab') {\n customIdField.required = true\n } else {\n entity.fields.unshift(idField)\n }\n\n // mark timestamp fields required\n if ('timestamps' in entity && entity.timestamps !== false) {\n entity.fields = entity.fields.map((field) => {\n if (fieldAffectsData(field) && (field.name === 'createdAt' || field.name === 'updatedAt')) {\n return {\n ...field,\n required: true,\n }\n }\n return field\n })\n }\n\n if ('auth' in entity && entity.auth && !entity.auth?.disableLocalStrategy) {\n entity.fields.push({\n name: 'password',\n type: 'text',\n })\n }\n\n // Used for relationship fields, to determine whether to use a string or number type for the ID.\n const collectionIDFieldTypes = getCollectionIDFieldTypes({ config, defaultIDType })\n\n return {\n type: 'object',\n additionalProperties: false,\n title,\n ...fieldsToJSONSchema(collectionIDFieldTypes, entity.fields, interfaceNameDefinitions, config),\n }\n}\n\nconst fieldType: JSONSchema4 = {\n type: 'string',\n required: false,\n}\nconst generateAuthFieldTypes = ({\n type,\n loginWithUsername,\n}: {\n loginWithUsername: Auth['loginWithUsername']\n type: 'forgotOrUnlock' | 'login' | 'register'\n}): JSONSchema4 => {\n if (loginWithUsername) {\n switch (type) {\n case 'login': {\n if (loginWithUsername.allowEmailLogin) {\n // allow username or email and require password for login\n return {\n additionalProperties: false,\n oneOf: [\n {\n additionalProperties: false,\n properties: { email: fieldType, password: fieldType },\n required: ['email', 'password'],\n },\n {\n additionalProperties: false,\n properties: { password: fieldType, username: fieldType },\n required: ['username', 'password'],\n },\n ],\n }\n } else {\n // allow only username and password for login\n return {\n additionalProperties: false,\n properties: {\n password: fieldType,\n username: fieldType,\n },\n required: ['username', 'password'],\n }\n }\n }\n\n case 'register': {\n const requiredFields: ('email' | 'password' | 'username')[] = ['password']\n const properties: {\n email?: JSONSchema4['properties']\n password?: JSONSchema4['properties']\n username?: JSONSchema4['properties']\n } = {\n password: fieldType,\n username: fieldType,\n }\n\n if (loginWithUsername.requireEmail) {\n requiredFields.push('email')\n }\n if (loginWithUsername.requireUsername) {\n requiredFields.push('username')\n }\n if (loginWithUsername.requireEmail || loginWithUsername.allowEmailLogin) {\n properties.email = fieldType\n }\n\n return {\n additionalProperties: false,\n properties,\n required: requiredFields,\n }\n }\n\n case 'forgotOrUnlock': {\n if (loginWithUsername.allowEmailLogin) {\n // allow email or username for unlock/forgot-password\n return {\n additionalProperties: false,\n oneOf: [\n {\n additionalProperties: false,\n properties: { email: fieldType },\n required: ['email'],\n },\n {\n additionalProperties: false,\n properties: { username: fieldType },\n required: ['username'],\n },\n ],\n }\n } else {\n // allow only username for unlock/forgot-password\n return {\n additionalProperties: false,\n properties: { username: fieldType },\n required: ['username'],\n }\n }\n }\n }\n }\n\n // default email (and password for login/register)\n return {\n additionalProperties: false,\n properties: { email: fieldType, password: fieldType },\n required: ['email', 'password'],\n }\n}\n\nexport function authCollectionToOperationsJSONSchema(\n config: SanitizedCollectionConfig,\n): JSONSchema4 {\n const loginWithUsername = config.auth?.loginWithUsername\n const loginUserFields: JSONSchema4 = generateAuthFieldTypes({ type: 'login', loginWithUsername })\n const forgotOrUnlockUserFields: JSONSchema4 = generateAuthFieldTypes({\n type: 'forgotOrUnlock',\n loginWithUsername,\n })\n const registerUserFields: JSONSchema4 = generateAuthFieldTypes({\n type: 'register',\n loginWithUsername,\n })\n\n const properties: JSONSchema4['properties'] = {\n forgotPassword: forgotOrUnlockUserFields,\n login: loginUserFields,\n registerFirstUser: registerUserFields,\n unlock: forgotOrUnlockUserFields,\n }\n\n return {\n type: 'object',\n additionalProperties: false,\n properties,\n required: Object.keys(properties),\n title: `${singular(toWords(`${config.slug}`, true))}AuthOperations`,\n }\n}\n\nfunction generateAuthOperationSchemas(collections: SanitizedCollectionConfig[]): JSONSchema4 {\n const properties = collections.reduce((acc, collection) => {\n if (collection.auth) {\n acc[collection.slug] = {\n $ref: `#/definitions/auth/${collection.slug}`,\n }\n }\n return acc\n }, {})\n\n return {\n type: 'object',\n additionalProperties: false,\n properties,\n required: Object.keys(properties),\n }\n}\n\n/**\n * This is used for generating the TypeScript types (payload-types.ts) with the payload generate:types command.\n */\nexport function configToJSONSchema(\n config: SanitizedConfig,\n defaultIDType?: 'number' | 'text',\n): JSONSchema4 {\n // a mutable Map to store custom top-level `interfaceName` types. Fields with an `interfaceName` property will be moved to the top-level definitions here\n const interfaceNameDefinitions: Map<string, JSONSchema4> = new Map()\n\n // Collections and Globals have to be moved to the top-level definitions as well. Reason: The top-level type will be the `Config` type - we don't want all collection and global\n // types to be inlined inside the `Config` type\n const entityDefinitions: { [k: string]: JSONSchema4 } = [\n ...config.globals,\n ...config.collections,\n ].reduce((acc, entity) => {\n acc[entity.slug] = entityToJSONSchema(config, entity, interfaceNameDefinitions, defaultIDType)\n return acc\n }, {})\n\n const authOperationDefinitions = [...config.collections]\n .filter(({ auth }) => Boolean(auth))\n .reduce(\n (acc, authCollection) => {\n acc.auth[authCollection.slug] = authCollectionToOperationsJSONSchema(authCollection)\n return acc\n },\n { auth: {} },\n )\n\n let jsonSchema: JSONSchema4 = {\n additionalProperties: false,\n definitions: {\n ...entityDefinitions,\n ...Object.fromEntries(interfaceNameDefinitions),\n ...authOperationDefinitions,\n },\n // These properties here will be very simple, as all the complexity is in the definitions. These are just the properties for the top-level `Config` type\n type: 'object',\n properties: {\n auth: generateAuthOperationSchemas(config.collections),\n collections: generateEntitySchemas(config.collections || []),\n db: generateDbEntitySchema(config),\n globals: generateEntitySchemas(config.globals || []),\n locale: generateLocaleEntitySchemas(config.localization),\n user: generateAuthEntitySchemas(config.collections),\n },\n required: ['user', 'locale', 'collections', 'globals', 'auth', 'db'],\n title: 'Config',\n }\n\n if (config?.typescript?.schema?.length) {\n for (const schema of config.typescript.schema) {\n jsonSchema = schema({ jsonSchema })\n }\n }\n\n return jsonSchema\n}\n"],"names":["pluralize","singular","MissingEditorProp","fieldAffectsData","tabHasName","deepCopyObject","toWords","getCollectionIDFieldTypes","fieldIsRequired","field","isConditional","Boolean","admin","condition","isMarkedRequired","required","type","fields","some","subField","tabs","tab","buildOptionEnums","options","map","option","value","generateEntitySchemas","entities","properties","reduce","acc","slug","$ref","additionalProperties","Object","keys","generateLocaleEntitySchemas","localization","locales","localesFromConfig","locale","code","enum","generateAuthEntitySchemas","filter","auth","allOf","collection","oneOf","generateDbEntitySchema","config","defaultIDType","db","withNullableJSONSchemaType","fieldType","isRequired","fieldTypes","push","fieldsToJSONSchema","collectionIDFieldTypes","interfaceNameDefinitions","requiredFieldNames","Set","fromEntries","fieldSchemas","add","name","fieldSchema","hasMany","items","jsonSchema","schema","editor","Error","outputSchema","optionEnums","maxItems","minItems","Array","isArray","relationTo","relation","const","blocks","block","blockFieldSchemas","blockSchema","blockType","interfaceName","set","childSchema","entries","forEach","propName","propSchema","hasRequiredFields","typescriptSchema","length","Map","from","entityToJSONSchema","incomingEntity","entity","title","typescript","interface","idField","customIdField","find","unshift","timestamps","disableLocalStrategy","generateAuthFieldTypes","loginWithUsername","allowEmailLogin","email","password","username","requiredFields","requireEmail","requireUsername","authCollectionToOperationsJSONSchema","loginUserFields","forgotOrUnlockUserFields","registerUserFields","forgotPassword","login","registerFirstUser","unlock","generateAuthOperationSchemas","collections","configToJSONSchema","entityDefinitions","globals","authOperationDefinitions","authCollection","definitions","user"],"mappings":"AAEA,OAAOA,eAAe,YAAW;AACjC,MAAM,EAAEC,QAAQ,EAAE,GAAGD;AAQrB,SAASE,iBAAiB,QAAQ,iCAAgC;AAClE,SAASC,gBAAgB,EAAEC,UAAU,QAAQ,4BAA2B;AACxE,SAASC,cAAc,QAAQ,sBAAqB;AACpD,SAASC,OAAO,QAAQ,oBAAmB;AAC3C,SAASC,yBAAyB,QAAQ,iCAAgC;AAE1E,MAAMC,kBAAkB,CAACC;IACvB,MAAMC,gBAAgBC,QAAQF,OAAOG,SAASH,OAAOG,OAAOC;IAC5D,IAAIH,eAAe,OAAO;IAE1B,MAAMI,mBAAmB,cAAcL,SAASA,MAAMM,QAAQ,KAAK;IACnE,IAAIZ,iBAAiBM,UAAUK,kBAAkB,OAAO;IAExD,wDAAwD;IACxD,IAAI,YAAYL,SAASA,MAAMO,I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uG,aAAa;YACX,GAAGJ,iBAAiB;YACpB,GAAGlG,OAAO6B,WAAW,CAACH,yBAAyB;YAC/C,GAAG0E,wBAAwB;QAC7B;QACA,wJAAwJ;QACxJvH,MAAM;QACNa,YAAY;YACViB,MAAMoF,6BAA6B/E,OAAOgF,WAAW;YACrDA,aAAaxG,sBAAsBwB,OAAOgF,WAAW,IAAI,EAAE;YAC3D9E,IAAIH,uBAAuBC;YAC3BmF,SAAS3G,sBAAsBwB,OAAOmF,OAAO,IAAI,EAAE;YACnD7F,QAAQJ,4BAA4Bc,OAAOb,YAAY;YACvDoG,MAAM9F,0BAA0BO,OAAOgF,WAAW;QACpD;QACApH,UAAU;YAAC;YAAQ;YAAU;YAAe;YAAW;YAAQ;SAAK;QACpEyF,OAAO;IACT;IAEA,IAAIrD,QAAQsD,YAAYjC,QAAQ0B,QAAQ;QACtC,KAAK,MAAM1B,UAAUrB,OAAOsD,UAAU,CAACjC,MAAM,CAAE;YAC7CD,aAAaC,OAAO;gBAAED;YAAW;QACnC;IACF;IAEA,OAAOA;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payload",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.74",
|
|
4
4
|
"description": "Node, React, Headless CMS and Application Framework built on Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"admin panel",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"scmp": "2.1.0",
|
|
97
97
|
"ts-essentials": "7.0.3",
|
|
98
98
|
"uuid": "10.0.0",
|
|
99
|
-
"@payloadcms/translations": "3.0.0-beta.
|
|
99
|
+
"@payloadcms/translations": "3.0.0-beta.74"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
102
|
"@hyrious/esbuild-plugin-commonjs": "^0.2.4",
|