fix: directus类型标注更新
- 使用Directus-sdk-typegen生成Directus类型标注
This commit is contained in:
@ -1,5 +1,3 @@
|
|||||||
import type { JsonValue } from '../common';
|
|
||||||
|
|
||||||
export interface CompanyProfile {
|
export interface CompanyProfile {
|
||||||
/** @primaryKey */
|
/** @primaryKey */
|
||||||
id: number;
|
id: number;
|
||||||
@ -28,20 +26,9 @@ export interface ContactInfoTranslation {
|
|||||||
content?: 'json' | null;
|
content?: 'json' | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Document {
|
|
||||||
/** @primaryKey */
|
|
||||||
id: number;
|
|
||||||
status?: 'published' | 'draft' | 'archived';
|
|
||||||
file?: DirectusFile | string | null;
|
|
||||||
/** @description i18n字段 */
|
|
||||||
translations?: DocumentsTranslation[] | null;
|
|
||||||
products?: ProductsDocument[] | string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DocumentsTranslation {
|
export interface DocumentsTranslation {
|
||||||
/** @primaryKey */
|
/** @primaryKey */
|
||||||
id: number;
|
id: number;
|
||||||
documents_id?: Document | string | null;
|
|
||||||
languages_code?: Language | string | null;
|
languages_code?: Language | string | null;
|
||||||
title?: string | null;
|
title?: string | null;
|
||||||
}
|
}
|
||||||
@ -68,6 +55,22 @@ export interface Language {
|
|||||||
direction?: 'ltr' | 'rtl' | null;
|
direction?: 'ltr' | 'rtl' | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ProductDocument {
|
||||||
|
/** @primaryKey */
|
||||||
|
id: number;
|
||||||
|
status?: 'published' | 'draft' | 'archived';
|
||||||
|
file?: DirectusFile | string | null;
|
||||||
|
translations?: ProductDocumentsTranslation[] | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ProductDocumentsTranslation {
|
||||||
|
/** @primaryKey */
|
||||||
|
id: number;
|
||||||
|
product_documents_id?: ProductDocument | string | null;
|
||||||
|
languages_code?: Language | string | null;
|
||||||
|
title?: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ProductImage {
|
export interface ProductImage {
|
||||||
/** @primaryKey */
|
/** @primaryKey */
|
||||||
id: number;
|
id: number;
|
||||||
@ -146,21 +149,20 @@ export interface Product {
|
|||||||
cover?: DirectusFile | string | null;
|
cover?: DirectusFile | string | null;
|
||||||
homepage_recommend?: Homepage | string | null;
|
homepage_recommend?: Homepage | string | null;
|
||||||
recommend_sort?: number | null;
|
recommend_sort?: number | null;
|
||||||
faqs?: ProductsQuestion[] | string[];
|
|
||||||
/** @description i18n字段 */
|
/** @description i18n字段 */
|
||||||
translations?: ProductsTranslation[] | null;
|
translations?: ProductsTranslation[] | null;
|
||||||
|
faqs?: ProductsQuestion[] | string[];
|
||||||
/** @description 在产品详情页中展示 */
|
/** @description 在产品详情页中展示 */
|
||||||
images?: ProductsProductImage[] | string[];
|
images?: ProductsProductImage[] | string[];
|
||||||
documents?: ProductsDocument[] | string[];
|
|
||||||
specs?: ProductSpecGroup[] | string[];
|
specs?: ProductSpecGroup[] | string[];
|
||||||
|
documents?: ProductsProductDocument[] | string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ProductsDocument {
|
export interface ProductsProductDocument {
|
||||||
/** @primaryKey */
|
/** @primaryKey */
|
||||||
id: number;
|
id: number;
|
||||||
products_id?: Product | string | null;
|
products_id?: Product | string | null;
|
||||||
documents_id?: Document | string | null;
|
product_documents_id?: ProductDocument | string | null;
|
||||||
sort?: number | null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ProductsProductImage {
|
export interface ProductsProductImage {
|
||||||
@ -187,7 +189,7 @@ export interface ProductsTranslation {
|
|||||||
/** @required */
|
/** @required */
|
||||||
name: string;
|
name: string;
|
||||||
summary?: string | null;
|
summary?: string | null;
|
||||||
description?: JsonValue | null;
|
description?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Question {
|
export interface Question {
|
||||||
@ -206,7 +208,7 @@ export interface QuestionsTranslation {
|
|||||||
languages_code?: Language | string | null;
|
languages_code?: Language | string | null;
|
||||||
/** @required */
|
/** @required */
|
||||||
title: string;
|
title: string;
|
||||||
content?: 'json' | null;
|
content?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SolutionType {
|
export interface SolutionType {
|
||||||
@ -723,11 +725,12 @@ export interface Schema {
|
|||||||
company_profile_translations: CompanyProfileTranslation[];
|
company_profile_translations: CompanyProfileTranslation[];
|
||||||
contact_info: ContactInfo;
|
contact_info: ContactInfo;
|
||||||
contact_info_translations: ContactInfoTranslation[];
|
contact_info_translations: ContactInfoTranslation[];
|
||||||
documents: Document[];
|
|
||||||
documents_translations: DocumentsTranslation[];
|
documents_translations: DocumentsTranslation[];
|
||||||
homepage: Homepage;
|
homepage: Homepage;
|
||||||
homepage_files: HomepageFile[];
|
homepage_files: HomepageFile[];
|
||||||
languages: Language[];
|
languages: Language[];
|
||||||
|
product_documents: ProductDocument[];
|
||||||
|
product_documents_translations: ProductDocumentsTranslation[];
|
||||||
product_images: ProductImage[];
|
product_images: ProductImage[];
|
||||||
product_images_translations: ProductImagesTranslation[];
|
product_images_translations: ProductImagesTranslation[];
|
||||||
product_spec_groups: ProductSpecGroup[];
|
product_spec_groups: ProductSpecGroup[];
|
||||||
@ -737,7 +740,7 @@ export interface Schema {
|
|||||||
product_types: ProductType[];
|
product_types: ProductType[];
|
||||||
product_types_translations: ProductTypesTranslation[];
|
product_types_translations: ProductTypesTranslation[];
|
||||||
products: Product[];
|
products: Product[];
|
||||||
products_documents: ProductsDocument[];
|
products_product_documents: ProductsProductDocument[];
|
||||||
products_product_images: ProductsProductImage[];
|
products_product_images: ProductsProductImage[];
|
||||||
products_questions: ProductsQuestion[];
|
products_questions: ProductsQuestion[];
|
||||||
products_translations: ProductsTranslation[];
|
products_translations: ProductsTranslation[];
|
||||||
@ -781,11 +784,12 @@ export enum CollectionNames {
|
|||||||
company_profile_translations = 'company_profile_translations',
|
company_profile_translations = 'company_profile_translations',
|
||||||
contact_info = 'contact_info',
|
contact_info = 'contact_info',
|
||||||
contact_info_translations = 'contact_info_translations',
|
contact_info_translations = 'contact_info_translations',
|
||||||
documents = 'documents',
|
|
||||||
documents_translations = 'documents_translations',
|
documents_translations = 'documents_translations',
|
||||||
homepage = 'homepage',
|
homepage = 'homepage',
|
||||||
homepage_files = 'homepage_files',
|
homepage_files = 'homepage_files',
|
||||||
languages = 'languages',
|
languages = 'languages',
|
||||||
|
product_documents = 'product_documents',
|
||||||
|
product_documents_translations = 'product_documents_translations',
|
||||||
product_images = 'product_images',
|
product_images = 'product_images',
|
||||||
product_images_translations = 'product_images_translations',
|
product_images_translations = 'product_images_translations',
|
||||||
product_spec_groups = 'product_spec_groups',
|
product_spec_groups = 'product_spec_groups',
|
||||||
@ -795,7 +799,7 @@ export enum CollectionNames {
|
|||||||
product_types = 'product_types',
|
product_types = 'product_types',
|
||||||
product_types_translations = 'product_types_translations',
|
product_types_translations = 'product_types_translations',
|
||||||
products = 'products',
|
products = 'products',
|
||||||
products_documents = 'products_documents',
|
products_product_documents = 'products_product_documents',
|
||||||
products_product_images = 'products_product_images',
|
products_product_images = 'products_product_images',
|
||||||
products_questions = 'products_questions',
|
products_questions = 'products_questions',
|
||||||
products_translations = 'products_translations',
|
products_translations = 'products_translations',
|
||||||
|
|||||||
Reference in New Issue
Block a user