fix: disallow duplicate fieldNames to be used on the same level in the config (#4381)

This commit is contained in:
Jarrod Flesch
2023-12-11 16:52:24 -05:00
committed by GitHub
parent 548e78c598
commit a1d66b83e0
14 changed files with 758 additions and 279 deletions

View File

@@ -1,180 +1,171 @@
/* tslint:disable */
/* eslint-disable */
/**
* This file was automatically generated by Payload.
* DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,
* and re-run `payload generate:types` to regenerate this file.
*/
export interface Config {}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "fields-relationship".
*/
export interface Config {
collections: {
'fields-relationship': FieldsRelationship
'relation-one': RelationOne
'relation-two': RelationTwo
'relation-restricted': RelationRestricted
'relation-with-title': RelationWithTitle
'relation-updated-externally': RelationUpdatedExternally
'collection-1': Collection1
'collection-2': Collection2
users: User
'payload-preferences': PayloadPreference
'payload-migrations': PayloadMigration
}
globals: {}
}
export interface FieldsRelationship {
id: string
relationship?: string | RelationOne
relationshipHasMany?: string[] | RelationOne[]
relationship?: (string | null) | RelationOne
relationshipHasMany?: (string | RelationOne)[] | null
relationshipMultiple?:
| {
value: string | RelationOne
| ({
relationTo: 'relation-one'
}
| {
value: string | RelationTwo
value: string | RelationOne
} | null)
| ({
relationTo: 'relation-two'
}
value: string | RelationTwo
} | null)
relationshipHasManyMultiple?:
| (
| {
value: string
relationTo: 'relation-one'
value: string | RelationOne
}
| {
value: string
relationTo: 'relation-two'
value: string | RelationTwo
}
)[]
| (
| {
value: RelationOne
relationTo: 'relation-one'
}
| {
value: RelationTwo
relationTo: 'relation-two'
}
)[]
relationshipRestricted?: string | RelationRestricted
relationshipWithTitle?: string | RelationWithTitle
relationshipFiltered?: string | RelationOne
| null
relationshipRestricted?: (string | null) | RelationRestricted
relationshipWithTitle?: (string | null) | RelationWithTitle
relationshipFiltered?: (string | null) | RelationOne
relationshipFilteredAsync?: (string | null) | RelationOne
relationshipManyFiltered?:
| (
| {
value: string
relationTo: 'relation-with-title'
value: string | RelationWithTitle
}
| {
value: string
relationTo: 'relation-one'
value: string | RelationOne
}
)[]
| (
| {
value: RelationWithTitle
relationTo: 'relation-with-title'
}
| {
value: RelationOne
relationTo: 'relation-one'
}
)[]
filter?: string
createdAt: string
| null
filter?: string | null
relationshipReadOnly?: (string | null) | RelationOne
updatedAt: string
createdAt: string
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "relation-one".
*/
export interface RelationOne {
id: string
name?: string
createdAt: string
name?: string | null
updatedAt: string
createdAt: string
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "relation-two".
*/
export interface RelationTwo {
id: string
name?: string
createdAt: string
name?: string | null
updatedAt: string
createdAt: string
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "relation-restricted".
*/
export interface RelationRestricted {
id: string
name?: string
createdAt: string
name?: string | null
updatedAt: string
createdAt: string
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "relation-with-title".
*/
export interface RelationWithTitle {
id: string
name?: string
createdAt: string
name?: string | null
meta?: {
title?: string | null
}
updatedAt: string
createdAt: string
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "relation-updated-externally".
*/
export interface RelationUpdatedExternally {
id: string
relationPrePopulate?: string | Collection1
relationHasMany?: string[] | Collection1[]
relationPrePopulate?: (string | null) | Collection1
relationHasMany?: (string | Collection1)[] | null
relationToManyHasMany?:
| (
| {
value: string
relationTo: 'collection-1'
value: string | Collection1
}
| {
value: string
relationTo: 'collection-2'
value: string | Collection2
}
)[]
| (
| {
value: Collection1
relationTo: 'collection-1'
}
| {
value: Collection2
relationTo: 'collection-2'
}
)[]
createdAt: string
| null
updatedAt: string
createdAt: string
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "collection-1".
*/
export interface Collection1 {
id: string
name?: string
createdAt: string
name?: string | null
updatedAt: string
createdAt: string
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "collection-2".
*/
export interface Collection2 {
id: string
name?: string
createdAt: string
name?: string | null
updatedAt: string
createdAt: string
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "users".
*/
export interface User {
id: string
email?: string
resetPasswordToken?: string
resetPasswordExpiration?: string
loginAttempts?: number
lockUntil?: string
createdAt: string
updatedAt: string
createdAt: string
email: string
resetPasswordToken?: string | null
resetPasswordExpiration?: string | null
salt?: string | null
hash?: string | null
loginAttempts?: number | null
lockUntil?: string | null
password: string | null
}
export interface PayloadPreference {
id: string
user: {
relationTo: 'users'
value: string | User
}
key?: string | null
value?:
| {
[k: string]: unknown
}
| unknown[]
| string
| number
| boolean
| null
updatedAt: string
createdAt: string
}
export interface PayloadMigration {
id: string
name?: string | null
batch?: number | null
updatedAt: string
createdAt: string
}
declare module 'payload' {
export interface GeneratedTypes extends Config {}
}