gbmake-payload/src/payload-types.ts

988 lines
21 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* 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.
*/
/**
* Supported timezones in IANA format.
*
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "supportedTimezones".
*/
export type SupportedTimezones =
| 'Pacific/Midway'
| 'Pacific/Niue'
| 'Pacific/Honolulu'
| 'Pacific/Rarotonga'
| 'America/Anchorage'
| 'Pacific/Gambier'
| 'America/Los_Angeles'
| 'America/Tijuana'
| 'America/Denver'
| 'America/Phoenix'
| 'America/Chicago'
| 'America/Guatemala'
| 'America/New_York'
| 'America/Bogota'
| 'America/Caracas'
| 'America/Santiago'
| 'America/Buenos_Aires'
| 'America/Sao_Paulo'
| 'Atlantic/South_Georgia'
| 'Atlantic/Azores'
| 'Atlantic/Cape_Verde'
| 'Europe/London'
| 'Europe/Berlin'
| 'Africa/Lagos'
| 'Europe/Athens'
| 'Africa/Cairo'
| 'Europe/Moscow'
| 'Asia/Riyadh'
| 'Asia/Dubai'
| 'Asia/Baku'
| 'Asia/Karachi'
| 'Asia/Tashkent'
| 'Asia/Calcutta'
| 'Asia/Dhaka'
| 'Asia/Almaty'
| 'Asia/Jakarta'
| 'Asia/Bangkok'
| 'Asia/Shanghai'
| 'Asia/Singapore'
| 'Asia/Tokyo'
| 'Asia/Seoul'
| 'Australia/Brisbane'
| 'Australia/Sydney'
| 'Pacific/Guam'
| 'Pacific/Noumea'
| 'Pacific/Auckland'
| 'Pacific/Fiji';
export interface Config {
auth: {
users: UserAuthOperations;
};
blocks: {};
collections: {
users: User;
media: Media;
products: Product;
announcements: Announcement;
articles: Article;
logs: Log;
'payload-kv': PayloadKv;
'payload-jobs': PayloadJob;
'payload-locked-documents': PayloadLockedDocument;
'payload-preferences': PayloadPreference;
'payload-migrations': PayloadMigration;
};
collectionsJoins: {};
collectionsSelect: {
users: UsersSelect<false> | UsersSelect<true>;
media: MediaSelect<false> | MediaSelect<true>;
products: ProductsSelect<false> | ProductsSelect<true>;
announcements: AnnouncementsSelect<false> | AnnouncementsSelect<true>;
articles: ArticlesSelect<false> | ArticlesSelect<true>;
logs: LogsSelect<false> | LogsSelect<true>;
'payload-kv': PayloadKvSelect<false> | PayloadKvSelect<true>;
'payload-jobs': PayloadJobsSelect<false> | PayloadJobsSelect<true>;
'payload-locked-documents': PayloadLockedDocumentsSelect<false> | PayloadLockedDocumentsSelect<true>;
'payload-preferences': PayloadPreferencesSelect<false> | PayloadPreferencesSelect<true>;
'payload-migrations': PayloadMigrationsSelect<false> | PayloadMigrationsSelect<true>;
};
db: {
defaultIDType: number;
};
fallbackLocale: null;
globals: {
'admin-settings': AdminSetting;
'logs-manager': LogsManager;
'hero-slider': HeroSlider;
'product-recommendations': ProductRecommendation;
};
globalsSelect: {
'admin-settings': AdminSettingsSelect<false> | AdminSettingsSelect<true>;
'logs-manager': LogsManagerSelect<false> | LogsManagerSelect<true>;
'hero-slider': HeroSliderSelect<false> | HeroSliderSelect<true>;
'product-recommendations': ProductRecommendationsSelect<false> | ProductRecommendationsSelect<true>;
};
locale: null;
user: User;
jobs: {
tasks: {
schedulePublish: TaskSchedulePublish;
inline: {
input: unknown;
output: unknown;
};
};
workflows: unknown;
};
}
export interface UserAuthOperations {
forgotPassword: {
email: string;
password: string;
};
login: {
email: string;
password: string;
};
registerFirstUser: {
email: string;
password: string;
};
unlock: {
email: string;
password: string;
};
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "users".
*/
export interface User {
id: number;
roles: ('admin' | 'editor' | 'user')[];
updatedAt: string;
createdAt: string;
email: string;
resetPasswordToken?: string | null;
resetPasswordExpiration?: string | null;
salt?: string | null;
hash?: string | null;
loginAttempts?: number | null;
lockUntil?: string | null;
sessions?:
| {
id: string;
createdAt?: string | null;
expiresAt: string;
}[]
| null;
password?: string | null;
collection: 'users';
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "media".
*/
export interface Media {
id: number;
alt: string;
updatedAt: string;
createdAt: string;
url?: string | null;
thumbnailURL?: string | null;
filename?: string | null;
mimeType?: string | null;
filesize?: number | null;
width?: number | null;
height?: number | null;
focalX?: number | null;
focalY?: number | null;
}
/**
* 管理 Medusa 商品的详细内容和描述
*
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "products".
*/
export interface Product {
id: number;
/**
* Medusa 商品 ID
*/
medusaId: string;
/**
* 商品详情状态
*/
status: 'draft' | 'published';
/**
* 商品标题(从 Medusa 同步)
*/
title: string;
handle?: string | null;
/**
* 商品封面 URL支持上传或输入 URL
*/
thumbnail?: string | null;
/**
* 最后同步时间
*/
lastSyncedAt?: string | null;
/**
* 商品详细内容(支持图文混排)
*/
content?: {
root: {
type: string;
children: {
type: any;
version: number;
[k: string]: unknown;
}[];
direction: ('ltr' | 'rtl') | null;
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
indent: number;
version: number;
};
[k: string]: unknown;
} | null;
/**
* 相关商品,支持搜索联想
*/
relatedProducts?: (number | Product)[] | null;
updatedAt: string;
createdAt: string;
}
/**
* 管理系统公告和通知
*
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "announcements".
*/
export interface Announcement {
id: number;
/**
* 公告标题
*/
title: string;
/**
* 公告类型
*/
type: 'info' | 'warning' | 'important' | 'urgent';
/**
* 发布状态
*/
status: 'draft' | 'published' | 'archived';
/**
* 优先级(数字越大越靠前)
*/
priority?: number | null;
/**
* 公告摘要(显示在列表页)
*/
summary?: string | null;
/**
* 公告详细内容
*/
content: {
root: {
type: string;
children: {
type: any;
version: number;
[k: string]: unknown;
}[];
direction: ('ltr' | 'rtl') | null;
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
indent: number;
version: number;
};
[k: string]: unknown;
};
/**
* 发布时间
*/
publishedAt?: string | null;
/**
* 过期时间(可选)
*/
expiresAt?: string | null;
/**
* 在首页显示此公告
*/
showOnHomepage?: boolean | null;
/**
* 发布者
*/
author?: (number | null) | User;
updatedAt: string;
createdAt: string;
}
/**
* 管理文章内容
*
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "articles".
*/
export interface Article {
id: number;
/**
* 文章标题
*/
title: string;
/**
* 发布状态
*/
status: 'draft' | 'published';
/**
* 文章 URL 路径(用于 SEO 友好的 URL
*/
slug: string;
/**
* 文章特色图片(封面)
*/
featuredImage?: (number | null) | Media;
/**
* 文章摘要(显示在列表页和 SEO
*/
excerpt?: string | null;
/**
* 文章详细内容
*/
content: {
root: {
type: string;
children: {
type: any;
version: number;
[k: string]: unknown;
}[];
direction: ('ltr' | 'rtl') | null;
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
indent: number;
version: number;
};
[k: string]: unknown;
};
/**
* 文章分类
*/
category: 'news' | 'tutorial' | 'tech' | 'review' | 'industry' | 'other';
/**
* 标记为推荐文章
*/
featured?: boolean | null;
/**
* 文章标签(用于搜索和分类)
*/
tags?: string[] | null;
/**
* 文章作者
*/
author: number | User;
/**
* 发布时间
*/
publishedAt?: string | null;
/**
* 相关文章
*/
relatedArticles?: (number | Article)[] | null;
/**
* 相关商品
*/
relatedProducts?: (number | Product)[] | null;
/**
* SEO 标题(留空则使用文章标题)
*/
metaTitle?: string | null;
/**
* SEO 描述(留空则使用摘要)
*/
metaDescription?: string | null;
/**
* SEO 关键词
*/
metaKeywords?: string[] | null;
updatedAt: string;
createdAt: string;
_status?: ('draft' | 'published') | null;
}
/**
* 系统操作日志记录
*
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "logs".
*/
export interface Log {
id: number;
/**
* 操作类型
*/
action: 'create' | 'update' | 'delete' | 'sync' | 'login' | 'logout';
/**
* 操作的集合名称
*/
collection: string;
/**
* 文档 ID
*/
documentId?: string | null;
/**
* 文档标题
*/
documentTitle?: string | null;
/**
* 操作用户
*/
user: number | User;
/**
* 变更内容JSON 格式)
*/
changes?:
| {
[k: string]: unknown;
}
| unknown[]
| string
| number
| boolean
| null;
/**
* IP 地址
*/
ip?: string | null;
/**
* 浏览器信息
*/
userAgent?: string | null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-kv".
*/
export interface PayloadKv {
id: number;
key: string;
data:
| {
[k: string]: unknown;
}
| unknown[]
| string
| number
| boolean
| null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-jobs".
*/
export interface PayloadJob {
id: number;
/**
* Input data provided to the job
*/
input?:
| {
[k: string]: unknown;
}
| unknown[]
| string
| number
| boolean
| null;
taskStatus?:
| {
[k: string]: unknown;
}
| unknown[]
| string
| number
| boolean
| null;
completedAt?: string | null;
totalTried?: number | null;
/**
* If hasError is true this job will not be retried
*/
hasError?: boolean | null;
/**
* If hasError is true, this is the error that caused it
*/
error?:
| {
[k: string]: unknown;
}
| unknown[]
| string
| number
| boolean
| null;
/**
* Task execution log
*/
log?:
| {
executedAt: string;
completedAt: string;
taskSlug: 'inline' | 'schedulePublish';
taskID: string;
input?:
| {
[k: string]: unknown;
}
| unknown[]
| string
| number
| boolean
| null;
output?:
| {
[k: string]: unknown;
}
| unknown[]
| string
| number
| boolean
| null;
state: 'failed' | 'succeeded';
error?:
| {
[k: string]: unknown;
}
| unknown[]
| string
| number
| boolean
| null;
id?: string | null;
}[]
| null;
taskSlug?: ('inline' | 'schedulePublish') | null;
queue?: string | null;
waitUntil?: string | null;
processing?: boolean | null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-locked-documents".
*/
export interface PayloadLockedDocument {
id: number;
document?:
| ({
relationTo: 'users';
value: number | User;
} | null)
| ({
relationTo: 'media';
value: number | Media;
} | null)
| ({
relationTo: 'products';
value: number | Product;
} | null)
| ({
relationTo: 'announcements';
value: number | Announcement;
} | null)
| ({
relationTo: 'articles';
value: number | Article;
} | null)
| ({
relationTo: 'logs';
value: number | Log;
} | null);
globalSlug?: string | null;
user: {
relationTo: 'users';
value: number | User;
};
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-preferences".
*/
export interface PayloadPreference {
id: number;
user: {
relationTo: 'users';
value: number | 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: number;
name?: string | null;
batch?: number | null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "users_select".
*/
export interface UsersSelect<T extends boolean = true> {
roles?: T;
updatedAt?: T;
createdAt?: T;
email?: T;
resetPasswordToken?: T;
resetPasswordExpiration?: T;
salt?: T;
hash?: T;
loginAttempts?: T;
lockUntil?: T;
sessions?:
| T
| {
id?: T;
createdAt?: T;
expiresAt?: T;
};
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "media_select".
*/
export interface MediaSelect<T extends boolean = true> {
alt?: T;
updatedAt?: T;
createdAt?: T;
url?: T;
thumbnailURL?: T;
filename?: T;
mimeType?: T;
filesize?: T;
width?: T;
height?: T;
focalX?: T;
focalY?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "products_select".
*/
export interface ProductsSelect<T extends boolean = true> {
medusaId?: T;
status?: T;
title?: T;
handle?: T;
thumbnail?: T;
lastSyncedAt?: T;
content?: T;
relatedProducts?: T;
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "announcements_select".
*/
export interface AnnouncementsSelect<T extends boolean = true> {
title?: T;
type?: T;
status?: T;
priority?: T;
summary?: T;
content?: T;
publishedAt?: T;
expiresAt?: T;
showOnHomepage?: T;
author?: T;
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "articles_select".
*/
export interface ArticlesSelect<T extends boolean = true> {
title?: T;
status?: T;
slug?: T;
featuredImage?: T;
excerpt?: T;
content?: T;
category?: T;
featured?: T;
tags?: T;
author?: T;
publishedAt?: T;
relatedArticles?: T;
relatedProducts?: T;
metaTitle?: T;
metaDescription?: T;
metaKeywords?: T;
updatedAt?: T;
createdAt?: T;
_status?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "logs_select".
*/
export interface LogsSelect<T extends boolean = true> {
action?: T;
collection?: T;
documentId?: T;
documentTitle?: T;
user?: T;
changes?: T;
ip?: T;
userAgent?: T;
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-kv_select".
*/
export interface PayloadKvSelect<T extends boolean = true> {
key?: T;
data?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-jobs_select".
*/
export interface PayloadJobsSelect<T extends boolean = true> {
input?: T;
taskStatus?: T;
completedAt?: T;
totalTried?: T;
hasError?: T;
error?: T;
log?:
| T
| {
executedAt?: T;
completedAt?: T;
taskSlug?: T;
taskID?: T;
input?: T;
output?: T;
state?: T;
error?: T;
id?: T;
};
taskSlug?: T;
queue?: T;
waitUntil?: T;
processing?: T;
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-locked-documents_select".
*/
export interface PayloadLockedDocumentsSelect<T extends boolean = true> {
document?: T;
globalSlug?: T;
user?: T;
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-preferences_select".
*/
export interface PayloadPreferencesSelect<T extends boolean = true> {
user?: T;
key?: T;
value?: T;
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-migrations_select".
*/
export interface PayloadMigrationsSelect<T extends boolean = true> {
name?: T;
batch?: T;
updatedAt?: T;
createdAt?: T;
}
/**
* 管理员控制面板 - 数据管理和系统维护
*
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "admin-settings".
*/
export interface AdminSetting {
id: number;
title?: string | null;
updatedAt?: string | null;
createdAt?: string | null;
}
/**
* 日志查看和管理工具
*
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "logs-manager".
*/
export interface LogsManager {
id: number;
placeholder?: string | null;
updatedAt?: string | null;
createdAt?: string | null;
}
/**
* Manage homepage hero slider/banner
*
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "hero-slider".
*/
export interface HeroSlider {
id: number;
/**
* Add slides to the hero slider (drag to reorder)
*/
slides?:
| {
title: string;
subtitle?: string | null;
/**
* Recommended: 1920x800px
*/
image: number | Media;
/**
* Optional. Recommended: 750x1000px
*/
imageMobile?: (number | null) | Media;
/**
* Where to go when clicked (e.g., /products)
*/
link?: string | null;
id?: string | null;
}[]
| null;
updatedAt?: string | null;
createdAt?: string | null;
}
/**
* Manage product recommendation lists for homepage and other pages
*
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "product-recommendations".
*/
export interface ProductRecommendation {
id: number;
/**
* Toggle to show/hide product recommendations
*/
enabled?: boolean | null;
/**
* Create multiple product recommendation lists (e.g., Hot Items, New Arrivals, Limited Offers)
*/
lists?:
| {
title: string;
subtitle?: string | null;
/**
* Select and drag to reorder products
*/
products?: (number | Product)[] | null;
id?: string | null;
}[]
| null;
updatedAt?: string | null;
createdAt?: string | null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "admin-settings_select".
*/
export interface AdminSettingsSelect<T extends boolean = true> {
title?: T;
updatedAt?: T;
createdAt?: T;
globalType?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "logs-manager_select".
*/
export interface LogsManagerSelect<T extends boolean = true> {
placeholder?: T;
updatedAt?: T;
createdAt?: T;
globalType?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "hero-slider_select".
*/
export interface HeroSliderSelect<T extends boolean = true> {
slides?:
| T
| {
title?: T;
subtitle?: T;
image?: T;
imageMobile?: T;
link?: T;
id?: T;
};
updatedAt?: T;
createdAt?: T;
globalType?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "product-recommendations_select".
*/
export interface ProductRecommendationsSelect<T extends boolean = true> {
enabled?: T;
lists?:
| T
| {
title?: T;
subtitle?: T;
products?: T;
id?: T;
};
updatedAt?: T;
createdAt?: T;
globalType?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "TaskSchedulePublish".
*/
export interface TaskSchedulePublish {
input: {
type?: ('publish' | 'unpublish') | null;
locale?: string | null;
doc?: {
relationTo: 'articles';
value: number | Article;
} | null;
global?: string | null;
user?: (number | null) | User;
};
output?: unknown;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "auth".
*/
export interface Auth {
[k: string]: unknown;
}
declare module 'payload' {
export interface GeneratedTypes extends Config {}
}