chore: properly working generated types within tests (#6288)

This commit is contained in:
Alessio Gravili
2024-05-09 17:12:51 -04:00
committed by GitHub
parent cfeac79b99
commit f7a2cf96b9
93 changed files with 7012 additions and 3097 deletions

View File

@@ -8,79 +8,179 @@
export interface Config {
collections: {
posts: Post
'relation-a': RelationA
'relation-b': RelationB
users: User
'payload-preferences': PayloadPreference
'payload-migrations': PayloadMigration
}
globals: {}
posts: Post;
'relation-a': RelationA;
'relation-b': RelationB;
'custom-schema': CustomSchema;
users: User;
'payload-preferences': PayloadPreference;
'payload-migrations': PayloadMigration;
};
globals: {
global: Global;
};
locale: 'en' | 'es';
user: User & {
collection: 'users';
};
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "posts".
*/
export interface Post {
id: string
title: string
updatedAt: string
createdAt: string
id: string;
title: string;
throwAfterChange?: boolean | null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "relation-a".
*/
export interface RelationA {
id: string
relationship?: (string | null) | RelationB
richText?:
| {
[k: string]: unknown
}[]
| null
updatedAt: string
createdAt: string
id: string;
title?: string | null;
relationship?: (string | null) | RelationB;
richText?: {
root: {
type: string;
children: {
type: string;
version: number;
[k: string]: unknown;
}[];
direction: ('ltr' | 'rtl') | null;
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
indent: number;
version: number;
};
[k: string]: unknown;
} | null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "relation-b".
*/
export interface RelationB {
id: string
relationship?: (string | null) | RelationA
richText?:
id: string;
title?: string | null;
relationship?: (string | null) | RelationA;
richText?: {
root: {
type: string;
children: {
type: string;
version: number;
[k: string]: unknown;
}[];
direction: ('ltr' | 'rtl') | null;
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
indent: number;
version: number;
};
[k: string]: unknown;
} | null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "custom-schema".
*/
export interface CustomSchema {
id: string;
text?: string | null;
localizedText?: string | null;
relationship?: (string | RelationA)[] | null;
select?: ('a' | 'b' | 'c')[] | null;
radio?: ('a' | 'b' | 'c') | null;
array?:
| {
[k: string]: unknown
text?: string | null;
localizedText?: string | null;
id?: string | null;
}[]
| null
updatedAt: string
createdAt: string
| null;
blocks?:
| {
text?: string | null;
localizedText?: string | null;
id?: string | null;
blockName?: string | null;
blockType: 'block';
}[]
| null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "users".
*/
export interface User {
id: 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
id: 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;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-preferences".
*/
export interface PayloadPreference {
id: string
id: string;
user: {
relationTo: 'users'
value: string | User
}
key?: string | null
relationTo: 'users';
value: string | User;
};
key?: string | null;
value?:
| {
[k: string]: unknown
[k: string]: unknown;
}
| unknown[]
| string
| number
| boolean
| null
updatedAt: string
createdAt: string
| null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-migrations".
*/
export interface PayloadMigration {
id: string
name?: string | null
batch?: number | null
updatedAt: string
createdAt: string
id: string;
name?: string | null;
batch?: number | null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "global".
*/
export interface Global {
id: string;
text?: string | null;
updatedAt?: string | null;
createdAt?: string | null;
}
declare module 'payload' {
// @ts-ignore
export interface GeneratedTypes extends Config {}
}