## Description This PR adds the ability to configure Mongoose's `schemaOptions`, which exposes more control about how Mongoose operates internally. For example, you can now disable `strict` mode in Mongoose to be able to preserve / surface data in MongoDB that is not reflected in Payload schemas. - [x] I have read and understand the [CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md) document in this repository. ## Type of change - [x] New feature (non-breaking change which adds functionality) ## Checklist: - [x] I have added tests that prove my fix is effective or that my feature works - [x] Existing test suite passes locally with my changes - [ ] I have made corresponding changes to the documentation
160 lines
3.4 KiB
TypeScript
160 lines
3.4 KiB
TypeScript
/* 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 {
|
|
collections: {
|
|
posts: Post
|
|
'relation-a': RelationA
|
|
'relation-b': RelationB
|
|
'custom-schema': CustomSchema
|
|
users: User
|
|
'payload-preferences': PayloadPreference
|
|
'payload-migrations': PayloadMigration
|
|
}
|
|
globals: {
|
|
global: Global
|
|
}
|
|
}
|
|
/**
|
|
* This interface was referenced by `Config`'s JSON-Schema
|
|
* via the `definition` "posts".
|
|
*/
|
|
export interface Post {
|
|
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
|
|
}
|
|
/**
|
|
* This interface was referenced by `Config`'s JSON-Schema
|
|
* via the `definition` "relation-b".
|
|
*/
|
|
export interface RelationB {
|
|
id: string
|
|
relationship?: (string | null) | RelationA
|
|
richText?:
|
|
| {
|
|
[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?:
|
|
| {
|
|
text?: string | null
|
|
localizedText?: string | null
|
|
id?: string | null
|
|
}[]
|
|
| null
|
|
blocks?:
|
|
| {
|
|
text?: string | null
|
|
localizedText?: string | null
|
|
id?: string | null
|
|
blockName?: string | null
|
|
blockType: 'block'
|
|
}[]
|
|
| null
|
|
updatedAt: string
|
|
createdAt: string
|
|
_status?: ('draft' | 'published') | null
|
|
}
|
|
/**
|
|
* 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
|
|
}
|
|
/**
|
|
* This interface was referenced by `Config`'s JSON-Schema
|
|
* via the `definition` "payload-preferences".
|
|
*/
|
|
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
|
|
}
|
|
/**
|
|
* 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
|
|
}
|
|
/**
|
|
* 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' {
|
|
export interface GeneratedTypes extends Config {}
|
|
}
|