fix(db-postgres): localized relationships inside blocks (#13760)

Fixes https://github.com/payloadcms/payload/issues/12463 and
https://github.com/payloadcms/payload/issues/13747
This commit is contained in:
Sasha
2025-09-19 16:28:12 +03:00
committed by GitHub
parent b7f6e3c294
commit 22ae9fa9d0
4 changed files with 307 additions and 195 deletions

View File

@@ -60,9 +60,14 @@ export default buildConfigWithDefaults({
baseDir: path.resolve(dirname),
},
},
localization: {
locales: ['en', 'es', 'fr'],
defaultLocale: 'en',
},
collections: [
{
slug: relationSlug,
versions: { drafts: { autosave: true } },
fields: [
{
name: 'image',
@@ -79,6 +84,42 @@ export default buildConfigWithDefaults({
type: 'upload',
relationTo: hideFileInputOnCreateSlug,
},
{
type: 'tabs',
tabs: [
{
label: 'a',
fields: [
{
name: 'blocks',
type: 'blocks',
blocks: [
{
slug: 'localizedMediaBlock',
fields: [
{
name: 'media',
type: 'upload',
relationTo: 'media',
localized: true,
required: true,
},
{
name: 'relatedMedia',
type: 'relationship',
relationTo: 'media',
localized: true,
hasMany: true,
maxRows: 5,
},
],
},
],
},
],
},
],
},
],
},
{
@@ -346,6 +387,11 @@ export default buildConfigWithDefaults({
type: 'text',
name: 'alt',
},
{
type: 'text',
name: 'localized',
localized: true,
},
],
upload: {
staticDir: path.resolve(dirname, './media'),

View File

@@ -603,6 +603,59 @@ describe('Collections - Uploads', () => {
expect(doc.docs[0].image).toBeFalsy()
})
it('should allow a localized upload relationship in a block', async () => {
const filePath = path.resolve(dirname, './image.png')
const file = await getFileByPath(filePath)
const { id } = await payload.create({
collection: mediaSlug,
data: {},
file,
})
const { id: id_2 } = await payload.create({
collection: mediaSlug,
data: {},
file,
})
const res = await payload.create({
collection: 'relation',
depth: 0,
data: {
blocks: [
{
blockType: 'localizedMediaBlock',
media: id,
relatedMedia: [id],
},
],
},
})
expect(res.blocks[0]?.media).toBe(id)
expect(res.blocks[0]?.relatedMedia).toEqual([id])
const res_2 = await payload.update({
collection: 'relation',
id: res.id,
depth: 0,
data: {
blocks: [
{
id: res.blocks[0]?.id,
blockType: 'localizedMediaBlock',
media: id_2,
relatedMedia: [id_2],
},
],
},
})
expect(res_2.blocks[0]?.media).toBe(id_2)
expect(res_2.blocks[0]?.relatedMedia).toEqual([id_2])
})
})
describe('cookie filtering', () => {

View File

@@ -190,11 +190,11 @@ export interface Config {
'payload-migrations': PayloadMigrationsSelect<false> | PayloadMigrationsSelect<true>;
};
db: {
defaultIDType: string;
defaultIDType: number;
};
globals: {};
globalsSelect: {};
locale: null;
locale: 'en' | 'es' | 'fr';
user: User & {
collection: 'users';
};
@@ -226,20 +226,31 @@ export interface UserAuthOperations {
* via the `definition` "relation".
*/
export interface Relation {
id: string;
image?: (string | null) | Media;
versionedImage?: (string | null) | Version;
hideFileInputOnCreate?: (string | null) | HideFileInputOnCreate;
id: number;
image?: (number | null) | Media;
versionedImage?: (number | null) | Version;
hideFileInputOnCreate?: (number | null) | HideFileInputOnCreate;
blocks?:
| {
media: number | Media;
relatedMedia?: (number | Media)[] | null;
id?: string | null;
blockName?: string | null;
blockType: 'localizedMediaBlock';
}[]
| null;
updatedAt: string;
createdAt: string;
_status?: ('draft' | 'published') | null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "media".
*/
export interface Media {
id: string;
id: number;
alt?: string | null;
localized?: string | null;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -387,7 +398,7 @@ export interface Media {
* via the `definition` "versions".
*/
export interface Version {
id: string;
id: number;
title?: string | null;
updatedAt: string;
createdAt: string;
@@ -407,7 +418,7 @@ export interface Version {
* via the `definition` "hide-file-input-on-create".
*/
export interface HideFileInputOnCreate {
id: string;
id: number;
title?: string | null;
updatedAt: string;
createdAt: string;
@@ -426,8 +437,8 @@ export interface HideFileInputOnCreate {
* via the `definition` "audio".
*/
export interface Audio {
id: string;
audio?: (string | null) | Media;
id: number;
audio?: (number | null) | Media;
updatedAt: string;
createdAt: string;
}
@@ -436,7 +447,7 @@ export interface Audio {
* via the `definition` "gif-resize".
*/
export interface GifResize {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -472,7 +483,7 @@ export interface GifResize {
* via the `definition` "filename-compound-index".
*/
export interface FilenameCompoundIndex {
id: string;
id: number;
/**
* Alt text to be used for compound index
*/
@@ -512,7 +523,7 @@ export interface FilenameCompoundIndex {
* via the `definition` "no-image-sizes".
*/
export interface NoImageSize {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -530,7 +541,7 @@ export interface NoImageSize {
* via the `definition` "object-fit".
*/
export interface ObjectFit {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -582,7 +593,7 @@ export interface ObjectFit {
* via the `definition` "with-meta-data".
*/
export interface WithMetaDatum {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -610,7 +621,7 @@ export interface WithMetaDatum {
* via the `definition` "without-meta-data".
*/
export interface WithoutMetaDatum {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -638,7 +649,7 @@ export interface WithoutMetaDatum {
* via the `definition` "with-only-jpeg-meta-data".
*/
export interface WithOnlyJpegMetaDatum {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -666,7 +677,7 @@ export interface WithOnlyJpegMetaDatum {
* via the `definition` "crop-only".
*/
export interface CropOnly {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -710,7 +721,7 @@ export interface CropOnly {
* via the `definition` "focal-only".
*/
export interface FocalOnly {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -754,7 +765,7 @@ export interface FocalOnly {
* via the `definition` "image-sizes-only".
*/
export interface ImageSizesOnly {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -790,7 +801,7 @@ export interface ImageSizesOnly {
* via the `definition` "focal-no-sizes".
*/
export interface FocalNoSize {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -808,7 +819,7 @@ export interface FocalNoSize {
* via the `definition` "allow-list-media".
*/
export interface AllowListMedia {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -826,7 +837,7 @@ export interface AllowListMedia {
* via the `definition` "skip-safe-fetch-media".
*/
export interface SkipSafeFetchMedia {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -844,7 +855,7 @@ export interface SkipSafeFetchMedia {
* via the `definition` "skip-safe-fetch-header-filter".
*/
export interface SkipSafeFetchHeaderFilter {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -862,7 +873,7 @@ export interface SkipSafeFetchHeaderFilter {
* via the `definition` "skip-allow-list-safe-fetch-media".
*/
export interface SkipAllowListSafeFetchMedia {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -880,7 +891,7 @@ export interface SkipAllowListSafeFetchMedia {
* via the `definition` "restrict-file-types".
*/
export interface RestrictFileType {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -898,7 +909,7 @@ export interface RestrictFileType {
* via the `definition` "no-restrict-file-types".
*/
export interface NoRestrictFileType {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -916,7 +927,7 @@ export interface NoRestrictFileType {
* via the `definition` "no-restrict-file-mime-types".
*/
export interface NoRestrictFileMimeType {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -934,7 +945,7 @@ export interface NoRestrictFileMimeType {
* via the `definition` "animated-type-media".
*/
export interface AnimatedTypeMedia {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -986,7 +997,7 @@ export interface AnimatedTypeMedia {
* via the `definition` "enlarge".
*/
export interface Enlarge {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1054,7 +1065,7 @@ export interface Enlarge {
* via the `definition` "without-enlarge".
*/
export interface WithoutEnlarge {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1072,7 +1083,7 @@ export interface WithoutEnlarge {
* via the `definition` "reduce".
*/
export interface Reduce {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1124,7 +1135,7 @@ export interface Reduce {
* via the `definition` "media-trim".
*/
export interface MediaTrim {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1168,7 +1179,7 @@ export interface MediaTrim {
* via the `definition` "custom-file-name-media".
*/
export interface CustomFileNameMedia {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1196,7 +1207,7 @@ export interface CustomFileNameMedia {
* via the `definition` "unstored-media".
*/
export interface UnstoredMedia {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1214,7 +1225,7 @@ export interface UnstoredMedia {
* via the `definition` "externally-served-media".
*/
export interface ExternallyServedMedia {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1232,11 +1243,11 @@ export interface ExternallyServedMedia {
* via the `definition` "uploads-1".
*/
export interface Uploads1 {
id: string;
hasManyUpload?: (string | Uploads2)[] | null;
singleUpload?: (string | null) | Uploads2;
hasManyThumbnailUpload?: (string | AdminThumbnailSize)[] | null;
singleThumbnailUpload?: (string | null) | AdminThumbnailSize;
id: number;
hasManyUpload?: (number | Uploads2)[] | null;
singleUpload?: (number | null) | Uploads2;
hasManyThumbnailUpload?: (number | AdminThumbnailSize)[] | null;
singleThumbnailUpload?: (number | null) | AdminThumbnailSize;
richText?: {
root: {
type: string;
@@ -1269,7 +1280,7 @@ export interface Uploads1 {
* via the `definition` "uploads-2".
*/
export interface Uploads2 {
id: string;
id: number;
prefix: string;
title?: string | null;
updatedAt: string;
@@ -1289,7 +1300,7 @@ export interface Uploads2 {
* via the `definition` "admin-thumbnail-size".
*/
export interface AdminThumbnailSize {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1325,7 +1336,7 @@ export interface AdminThumbnailSize {
* via the `definition` "any-images".
*/
export interface AnyImage {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1343,7 +1354,7 @@ export interface AnyImage {
* via the `definition` "admin-thumbnail-function".
*/
export interface AdminThumbnailFunction {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1361,7 +1372,7 @@ export interface AdminThumbnailFunction {
* via the `definition` "admin-thumbnail-with-search-queries".
*/
export interface AdminThumbnailWithSearchQuery {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1379,7 +1390,7 @@ export interface AdminThumbnailWithSearchQuery {
* via the `definition` "admin-upload-control".
*/
export interface AdminUploadControl {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1397,7 +1408,7 @@ export interface AdminUploadControl {
* via the `definition` "optional-file".
*/
export interface OptionalFile {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1415,7 +1426,7 @@ export interface OptionalFile {
* via the `definition` "required-file".
*/
export interface RequiredFile {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1433,7 +1444,7 @@ export interface RequiredFile {
* via the `definition` "custom-upload-field".
*/
export interface CustomUploadField {
id: string;
id: number;
alt?: string | null;
updatedAt: string;
createdAt: string;
@@ -1452,7 +1463,7 @@ export interface CustomUploadField {
* via the `definition` "media-with-relation-preview".
*/
export interface MediaWithRelationPreview {
id: string;
id: number;
title?: string | null;
updatedAt: string;
createdAt: string;
@@ -1471,7 +1482,7 @@ export interface MediaWithRelationPreview {
* via the `definition` "media-without-cache-tags".
*/
export interface MediaWithoutCacheTag {
id: string;
id: number;
title?: string | null;
updatedAt: string;
createdAt: string;
@@ -1490,7 +1501,7 @@ export interface MediaWithoutCacheTag {
* via the `definition` "media-without-relation-preview".
*/
export interface MediaWithoutRelationPreview {
id: string;
id: number;
title?: string | null;
updatedAt: string;
createdAt: string;
@@ -1509,13 +1520,13 @@ export interface MediaWithoutRelationPreview {
* via the `definition` "relation-preview".
*/
export interface RelationPreview {
id: string;
imageWithPreview1?: (string | null) | MediaWithRelationPreview;
imageWithPreview2?: (string | null) | MediaWithRelationPreview;
imageWithoutPreview1?: (string | null) | MediaWithRelationPreview;
imageWithoutPreview2?: (string | null) | MediaWithoutRelationPreview;
imageWithPreview3?: (string | null) | MediaWithoutRelationPreview;
imageWithoutPreview3?: (string | null) | MediaWithoutRelationPreview;
id: number;
imageWithPreview1?: (number | null) | MediaWithRelationPreview;
imageWithPreview2?: (number | null) | MediaWithRelationPreview;
imageWithoutPreview1?: (number | null) | MediaWithRelationPreview;
imageWithoutPreview2?: (number | null) | MediaWithoutRelationPreview;
imageWithPreview3?: (number | null) | MediaWithoutRelationPreview;
imageWithoutPreview3?: (number | null) | MediaWithoutRelationPreview;
updatedAt: string;
createdAt: string;
}
@@ -1524,11 +1535,11 @@ export interface RelationPreview {
* via the `definition` "best-fit".
*/
export interface BestFit {
id: string;
withAdminThumbnail?: (string | null) | AdminThumbnailFunction;
withinRange?: (string | null) | Enlarge;
nextSmallestOutOfRange?: (string | null) | FocalOnly;
original?: (string | null) | FocalOnly;
id: number;
withAdminThumbnail?: (number | null) | AdminThumbnailFunction;
withinRange?: (number | null) | Enlarge;
nextSmallestOutOfRange?: (number | null) | FocalOnly;
original?: (number | null) | FocalOnly;
updatedAt: string;
createdAt: string;
}
@@ -1537,10 +1548,10 @@ export interface BestFit {
* via the `definition` "list-view-preview".
*/
export interface ListViewPreview {
id: string;
id: number;
title?: string | null;
imageUpload?: (string | null) | MediaWithRelationPreview;
imageRelationship?: (string | null) | MediaWithRelationPreview;
imageUpload?: (number | null) | MediaWithRelationPreview;
imageRelationship?: (number | null) | MediaWithRelationPreview;
updatedAt: string;
createdAt: string;
}
@@ -1549,7 +1560,7 @@ export interface ListViewPreview {
* via the `definition` "three-dimensional".
*/
export interface ThreeDimensional {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1565,7 +1576,7 @@ export interface ThreeDimensional {
* via the `definition` "constructor-options".
*/
export interface ConstructorOption {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1583,11 +1594,11 @@ export interface ConstructorOption {
* via the `definition` "bulk-uploads".
*/
export interface BulkUpload {
id: string;
id: number;
title: string;
relationship?: {
relationTo: 'simple-relationship';
value: string | SimpleRelationship;
value: number | SimpleRelationship;
} | null;
updatedAt: string;
createdAt: string;
@@ -1606,7 +1617,7 @@ export interface BulkUpload {
* via the `definition` "simple-relationship".
*/
export interface SimpleRelationship {
id: string;
id: number;
title?: string | null;
updatedAt: string;
createdAt: string;
@@ -1616,7 +1627,7 @@ export interface SimpleRelationship {
* via the `definition` "file-mime-type".
*/
export interface FileMimeType {
id: string;
id: number;
title?: string | null;
updatedAt: string;
createdAt: string;
@@ -1635,7 +1646,7 @@ export interface FileMimeType {
* via the `definition` "svg-only".
*/
export interface SvgOnly {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1653,7 +1664,7 @@ export interface SvgOnly {
* via the `definition` "media-without-delete-access".
*/
export interface MediaWithoutDeleteAccess {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1671,7 +1682,7 @@ export interface MediaWithoutDeleteAccess {
* via the `definition` "media-with-image-size-admin-props".
*/
export interface MediaWithImageSizeAdminProp {
id: string;
id: number;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1723,7 +1734,7 @@ export interface MediaWithImageSizeAdminProp {
* via the `definition` "users".
*/
export interface User {
id: string;
id: number;
updatedAt: string;
createdAt: string;
email: string;
@@ -1747,236 +1758,236 @@ export interface User {
* via the `definition` "payload-locked-documents".
*/
export interface PayloadLockedDocument {
id: string;
id: number;
document?:
| ({
relationTo: 'relation';
value: string | Relation;
value: number | Relation;
} | null)
| ({
relationTo: 'audio';
value: string | Audio;
value: number | Audio;
} | null)
| ({
relationTo: 'gif-resize';
value: string | GifResize;
value: number | GifResize;
} | null)
| ({
relationTo: 'filename-compound-index';
value: string | FilenameCompoundIndex;
value: number | FilenameCompoundIndex;
} | null)
| ({
relationTo: 'no-image-sizes';
value: string | NoImageSize;
value: number | NoImageSize;
} | null)
| ({
relationTo: 'object-fit';
value: string | ObjectFit;
value: number | ObjectFit;
} | null)
| ({
relationTo: 'with-meta-data';
value: string | WithMetaDatum;
value: number | WithMetaDatum;
} | null)
| ({
relationTo: 'without-meta-data';
value: string | WithoutMetaDatum;
value: number | WithoutMetaDatum;
} | null)
| ({
relationTo: 'with-only-jpeg-meta-data';
value: string | WithOnlyJpegMetaDatum;
value: number | WithOnlyJpegMetaDatum;
} | null)
| ({
relationTo: 'crop-only';
value: string | CropOnly;
value: number | CropOnly;
} | null)
| ({
relationTo: 'focal-only';
value: string | FocalOnly;
value: number | FocalOnly;
} | null)
| ({
relationTo: 'image-sizes-only';
value: string | ImageSizesOnly;
value: number | ImageSizesOnly;
} | null)
| ({
relationTo: 'focal-no-sizes';
value: string | FocalNoSize;
value: number | FocalNoSize;
} | null)
| ({
relationTo: 'media';
value: string | Media;
value: number | Media;
} | null)
| ({
relationTo: 'allow-list-media';
value: string | AllowListMedia;
value: number | AllowListMedia;
} | null)
| ({
relationTo: 'skip-safe-fetch-media';
value: string | SkipSafeFetchMedia;
value: number | SkipSafeFetchMedia;
} | null)
| ({
relationTo: 'skip-safe-fetch-header-filter';
value: string | SkipSafeFetchHeaderFilter;
value: number | SkipSafeFetchHeaderFilter;
} | null)
| ({
relationTo: 'skip-allow-list-safe-fetch-media';
value: string | SkipAllowListSafeFetchMedia;
value: number | SkipAllowListSafeFetchMedia;
} | null)
| ({
relationTo: 'restrict-file-types';
value: string | RestrictFileType;
value: number | RestrictFileType;
} | null)
| ({
relationTo: 'no-restrict-file-types';
value: string | NoRestrictFileType;
value: number | NoRestrictFileType;
} | null)
| ({
relationTo: 'no-restrict-file-mime-types';
value: string | NoRestrictFileMimeType;
value: number | NoRestrictFileMimeType;
} | null)
| ({
relationTo: 'animated-type-media';
value: string | AnimatedTypeMedia;
value: number | AnimatedTypeMedia;
} | null)
| ({
relationTo: 'enlarge';
value: string | Enlarge;
value: number | Enlarge;
} | null)
| ({
relationTo: 'without-enlarge';
value: string | WithoutEnlarge;
value: number | WithoutEnlarge;
} | null)
| ({
relationTo: 'reduce';
value: string | Reduce;
value: number | Reduce;
} | null)
| ({
relationTo: 'media-trim';
value: string | MediaTrim;
value: number | MediaTrim;
} | null)
| ({
relationTo: 'custom-file-name-media';
value: string | CustomFileNameMedia;
value: number | CustomFileNameMedia;
} | null)
| ({
relationTo: 'unstored-media';
value: string | UnstoredMedia;
value: number | UnstoredMedia;
} | null)
| ({
relationTo: 'externally-served-media';
value: string | ExternallyServedMedia;
value: number | ExternallyServedMedia;
} | null)
| ({
relationTo: 'uploads-1';
value: string | Uploads1;
value: number | Uploads1;
} | null)
| ({
relationTo: 'uploads-2';
value: string | Uploads2;
value: number | Uploads2;
} | null)
| ({
relationTo: 'any-images';
value: string | AnyImage;
value: number | AnyImage;
} | null)
| ({
relationTo: 'admin-thumbnail-function';
value: string | AdminThumbnailFunction;
value: number | AdminThumbnailFunction;
} | null)
| ({
relationTo: 'admin-thumbnail-with-search-queries';
value: string | AdminThumbnailWithSearchQuery;
value: number | AdminThumbnailWithSearchQuery;
} | null)
| ({
relationTo: 'admin-thumbnail-size';
value: string | AdminThumbnailSize;
value: number | AdminThumbnailSize;
} | null)
| ({
relationTo: 'admin-upload-control';
value: string | AdminUploadControl;
value: number | AdminUploadControl;
} | null)
| ({
relationTo: 'optional-file';
value: string | OptionalFile;
value: number | OptionalFile;
} | null)
| ({
relationTo: 'required-file';
value: string | RequiredFile;
value: number | RequiredFile;
} | null)
| ({
relationTo: 'versions';
value: string | Version;
value: number | Version;
} | null)
| ({
relationTo: 'custom-upload-field';
value: string | CustomUploadField;
value: number | CustomUploadField;
} | null)
| ({
relationTo: 'media-with-relation-preview';
value: string | MediaWithRelationPreview;
value: number | MediaWithRelationPreview;
} | null)
| ({
relationTo: 'media-without-cache-tags';
value: string | MediaWithoutCacheTag;
value: number | MediaWithoutCacheTag;
} | null)
| ({
relationTo: 'media-without-relation-preview';
value: string | MediaWithoutRelationPreview;
value: number | MediaWithoutRelationPreview;
} | null)
| ({
relationTo: 'relation-preview';
value: string | RelationPreview;
value: number | RelationPreview;
} | null)
| ({
relationTo: 'hide-file-input-on-create';
value: string | HideFileInputOnCreate;
value: number | HideFileInputOnCreate;
} | null)
| ({
relationTo: 'best-fit';
value: string | BestFit;
value: number | BestFit;
} | null)
| ({
relationTo: 'list-view-preview';
value: string | ListViewPreview;
value: number | ListViewPreview;
} | null)
| ({
relationTo: 'three-dimensional';
value: string | ThreeDimensional;
value: number | ThreeDimensional;
} | null)
| ({
relationTo: 'constructor-options';
value: string | ConstructorOption;
value: number | ConstructorOption;
} | null)
| ({
relationTo: 'bulk-uploads';
value: string | BulkUpload;
value: number | BulkUpload;
} | null)
| ({
relationTo: 'simple-relationship';
value: string | SimpleRelationship;
value: number | SimpleRelationship;
} | null)
| ({
relationTo: 'file-mime-type';
value: string | FileMimeType;
value: number | FileMimeType;
} | null)
| ({
relationTo: 'svg-only';
value: string | SvgOnly;
value: number | SvgOnly;
} | null)
| ({
relationTo: 'media-without-delete-access';
value: string | MediaWithoutDeleteAccess;
value: number | MediaWithoutDeleteAccess;
} | null)
| ({
relationTo: 'media-with-image-size-admin-props';
value: string | MediaWithImageSizeAdminProp;
value: number | MediaWithImageSizeAdminProp;
} | null)
| ({
relationTo: 'users';
value: string | User;
value: number | User;
} | null);
globalSlug?: string | null;
user: {
relationTo: 'users';
value: string | User;
value: number | User;
};
updatedAt: string;
createdAt: string;
@@ -1986,10 +1997,10 @@ export interface PayloadLockedDocument {
* via the `definition` "payload-preferences".
*/
export interface PayloadPreference {
id: string;
id: number;
user: {
relationTo: 'users';
value: string | User;
value: number | User;
};
key?: string | null;
value?:
@@ -2009,7 +2020,7 @@ export interface PayloadPreference {
* via the `definition` "payload-migrations".
*/
export interface PayloadMigration {
id: string;
id: number;
name?: string | null;
batch?: number | null;
updatedAt: string;
@@ -2023,8 +2034,21 @@ export interface RelationSelect<T extends boolean = true> {
image?: T;
versionedImage?: T;
hideFileInputOnCreate?: T;
blocks?:
| T
| {
localizedMediaBlock?:
| T
| {
media?: T;
relatedMedia?: T;
id?: T;
blockName?: T;
};
};
updatedAt?: T;
createdAt?: T;
_status?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
@@ -2455,6 +2479,7 @@ export interface FocalNoSizesSelect<T extends boolean = true> {
*/
export interface MediaSelect<T extends boolean = true> {
alt?: T;
localized?: T;
updatedAt?: T;
createdAt?: T;
url?: T;