From afe7a15104185f58589aa8ad210e338a6fa979ce Mon Sep 17 00:00:00 2001 From: Danijel Martinek Date: Tue, 5 May 2026 08:18:46 +0200 Subject: [PATCH] =?UTF-8?q?feat(core-cms):=20regenerate=20types=20?= =?UTF-8?q?=E2=80=94=20now=20includes=20Articles,=20Users,=20Media?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core-cms/src/generated-types.ts | 162 +++++++++++++++-------- 1 file changed, 104 insertions(+), 58 deletions(-) diff --git a/packages/core-cms/src/generated-types.ts b/packages/core-cms/src/generated-types.ts index 520f18e..341abff 100644 --- a/packages/core-cms/src/generated-types.ts +++ b/packages/core-cms/src/generated-types.ts @@ -67,18 +67,20 @@ export interface Config { }; blocks: {}; collections: { - articles: Article; - 'payload-kv': PayloadKv; users: User; + articles: Article; + media: Media; + 'payload-kv': PayloadKv; 'payload-locked-documents': PayloadLockedDocument; 'payload-preferences': PayloadPreference; 'payload-migrations': PayloadMigration; }; collectionsJoins: {}; collectionsSelect: { - articles: ArticlesSelect | ArticlesSelect; - 'payload-kv': PayloadKvSelect | PayloadKvSelect; users: UsersSelect | UsersSelect; + articles: ArticlesSelect | ArticlesSelect; + media: MediaSelect | MediaSelect; + 'payload-kv': PayloadKvSelect | PayloadKvSelect; 'payload-locked-documents': PayloadLockedDocumentsSelect | PayloadLockedDocumentsSelect; 'payload-preferences': PayloadPreferencesSelect | PayloadPreferencesSelect; 'payload-migrations': PayloadMigrationsSelect | PayloadMigrationsSelect; @@ -117,6 +119,33 @@ export interface UserAuthOperations { password: string; }; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "users". + */ +export interface User { + id: number; + displayName?: string | null; + role: 'admin' | 'editor' | 'author'; + 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` "articles". @@ -144,15 +173,32 @@ export interface Article { [k: string]: unknown; } | null; status: 'draft' | 'published'; - /** - * Temporary text field; restored to users relationship in Plan 3. - */ - author: string; + author: number | User; + featuredImage?: (number | null) | Media; publishedAt?: string | 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: 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; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "payload-kv". @@ -170,31 +216,6 @@ export interface PayloadKv { | boolean | null; } -/** - * This interface was referenced by `Config`'s JSON-Schema - * via the `definition` "users". - */ -export interface User { - id: number; - 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` "payload-locked-documents". @@ -202,13 +223,17 @@ export interface User { export interface PayloadLockedDocument { id: number; document?: + | ({ + relationTo: 'users'; + value: number | User; + } | null) | ({ relationTo: 'articles'; value: number | Article; } | null) | ({ - relationTo: 'users'; - value: number | User; + relationTo: 'media'; + value: number | Media; } | null); globalSlug?: string | null; user: { @@ -252,34 +277,13 @@ export interface PayloadMigration { updatedAt: string; createdAt: string; } -/** - * This interface was referenced by `Config`'s JSON-Schema - * via the `definition` "articles_select". - */ -export interface ArticlesSelect { - title?: T; - slug?: T; - content?: T; - status?: T; - author?: T; - publishedAt?: T; - updatedAt?: T; - createdAt?: T; - _status?: T; -} -/** - * This interface was referenced by `Config`'s JSON-Schema - * via the `definition` "payload-kv_select". - */ -export interface PayloadKvSelect { - key?: T; - data?: T; -} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "users_select". */ export interface UsersSelect { + displayName?: T; + role?: T; updatedAt?: T; createdAt?: T; email?: T; @@ -297,6 +301,48 @@ export interface UsersSelect { expiresAt?: T; }; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "articles_select". + */ +export interface ArticlesSelect { + title?: T; + slug?: T; + content?: T; + status?: T; + author?: T; + featuredImage?: T; + publishedAt?: T; + updatedAt?: T; + createdAt?: T; + _status?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "media_select". + */ +export interface MediaSelect { + 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` "payload-kv_select". + */ +export interface PayloadKvSelect { + key?: T; + data?: T; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "payload-locked-documents_select".