From 35dcd6ab220363043b075033f2593c2faf37d1ef Mon Sep 17 00:00:00 2001 From: Schneider Roland Date: Sat, 11 Jan 2025 19:24:01 +0100 Subject: [PATCH] add ityped, add strapi type generate plugin --- yoga-cms/config/plugins.ts | 3 +- yoga-cms/types/generated/components.d.ts | 12 + yoga-cms/types/generated/contentTypes.d.ts | 260 +++++++++++++++++++++ 3 files changed, 274 insertions(+), 1 deletion(-) diff --git a/yoga-cms/config/plugins.ts b/yoga-cms/config/plugins.ts index 6d9544d..e8680c9 100644 --- a/yoga-cms/config/plugins.ts +++ b/yoga-cms/config/plugins.ts @@ -1,6 +1,7 @@ export default () => ({ 'schemas-to-ts': { enabled: true, - destinationFolder: "generated-types" + destinationFolder: "generated-types", + logLevel: 2 }, }); diff --git a/yoga-cms/types/generated/components.d.ts b/yoga-cms/types/generated/components.d.ts index 84c09e2..0ee30f3 100644 --- a/yoga-cms/types/generated/components.d.ts +++ b/yoga-cms/types/generated/components.d.ts @@ -11,6 +11,17 @@ export interface SharedMedia extends Struct.ComponentSchema { }; } +export interface SharedMyComponent extends Struct.ComponentSchema { + collectionName: 'components_shared_my_components'; + info: { + displayName: 'my component'; + icon: 'alien'; + }; + attributes: { + testtext: Schema.Attribute.String; + }; +} + export interface SharedQuote extends Struct.ComponentSchema { collectionName: 'components_shared_quotes'; info: { @@ -66,6 +77,7 @@ declare module '@strapi/strapi' { export module Public { export interface ComponentSchemas { 'shared.media': SharedMedia; + 'shared.my-component': SharedMyComponent; 'shared.quote': SharedQuote; 'shared.rich-text': SharedRichText; 'shared.seo': SharedSeo; diff --git a/yoga-cms/types/generated/contentTypes.d.ts b/yoga-cms/types/generated/contentTypes.d.ts index a963fab..e51d4cc 100644 --- a/yoga-cms/types/generated/contentTypes.d.ts +++ b/yoga-cms/types/generated/contentTypes.d.ts @@ -369,6 +369,258 @@ export interface AdminUser extends Struct.CollectionTypeSchema { }; } +export interface ApiAboutAbout extends Struct.SingleTypeSchema { + collectionName: 'abouts'; + info: { + description: 'Write about yourself and the content you create'; + displayName: 'About'; + pluralName: 'abouts'; + singularName: 'about'; + }; + options: { + draftAndPublish: true; + }; + attributes: { + createdAt: Schema.Attribute.DateTime; + createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + description: Schema.Attribute.Blocks; + image: Schema.Attribute.Media<'images' | 'files' | 'videos' | 'audios'>; + locale: Schema.Attribute.String & Schema.Attribute.Private; + localizations: Schema.Attribute.Relation<'oneToMany', 'api::about.about'> & + Schema.Attribute.Private; + publishedAt: Schema.Attribute.DateTime; + title: Schema.Attribute.String; + updatedAt: Schema.Attribute.DateTime; + updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + }; +} + +export interface ApiArticleArticle extends Struct.CollectionTypeSchema { + collectionName: 'articles'; + info: { + description: 'Create your blog content'; + displayName: 'Article'; + pluralName: 'articles'; + singularName: 'article'; + }; + options: { + draftAndPublish: true; + }; + attributes: { + author: Schema.Attribute.Relation<'manyToOne', 'api::author.author'>; + blocks: Schema.Attribute.DynamicZone< + ['shared.media', 'shared.quote', 'shared.rich-text', 'shared.slider'] + >; + category: Schema.Attribute.Relation<'manyToOne', 'api::category.category'>; + cover: Schema.Attribute.Media<'images' | 'files' | 'videos'>; + createdAt: Schema.Attribute.DateTime; + createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + description: Schema.Attribute.Text & + Schema.Attribute.SetMinMaxLength<{ + maxLength: 80; + }>; + locale: Schema.Attribute.String & Schema.Attribute.Private; + localizations: Schema.Attribute.Relation< + 'oneToMany', + 'api::article.article' + > & + Schema.Attribute.Private; + publishedAt: Schema.Attribute.DateTime; + slug: Schema.Attribute.UID<'title'>; + title: Schema.Attribute.String; + updatedAt: Schema.Attribute.DateTime; + updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + }; +} + +export interface ApiAuthorAuthor extends Struct.CollectionTypeSchema { + collectionName: 'authors'; + info: { + description: 'Create authors for your content'; + displayName: 'Author'; + pluralName: 'authors'; + singularName: 'author'; + }; + options: { + draftAndPublish: false; + }; + attributes: { + articles: Schema.Attribute.Relation<'oneToMany', 'api::article.article'>; + avatar: Schema.Attribute.Media<'images' | 'files' | 'videos'>; + createdAt: Schema.Attribute.DateTime; + createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + email: Schema.Attribute.String; + locale: Schema.Attribute.String & Schema.Attribute.Private; + localizations: Schema.Attribute.Relation< + 'oneToMany', + 'api::author.author' + > & + Schema.Attribute.Private; + name: Schema.Attribute.String; + publishedAt: Schema.Attribute.DateTime; + updatedAt: Schema.Attribute.DateTime; + updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + }; +} + +export interface ApiCarCar extends Struct.CollectionTypeSchema { + collectionName: 'cars'; + info: { + description: ''; + displayName: 'car'; + pluralName: 'cars'; + singularName: 'car'; + }; + options: { + draftAndPublish: true; + }; + attributes: { + createdAt: Schema.Attribute.DateTime; + createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + description: Schema.Attribute.Text; + image: Schema.Attribute.Media<'images' | 'files' | 'videos' | 'audios'>; + locale: Schema.Attribute.String & Schema.Attribute.Private; + localizations: Schema.Attribute.Relation<'oneToMany', 'api::car.car'> & + Schema.Attribute.Private; + myquote: Schema.Attribute.Component<'shared.quote', true>; + name: Schema.Attribute.String; + publishedAt: Schema.Attribute.DateTime; + updatedAt: Schema.Attribute.DateTime; + updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + }; +} + +export interface ApiCategoryCategory extends Struct.CollectionTypeSchema { + collectionName: 'categories'; + info: { + description: 'Organize your content into categories'; + displayName: 'Category'; + pluralName: 'categories'; + singularName: 'category'; + }; + options: { + draftAndPublish: false; + }; + attributes: { + articles: Schema.Attribute.Relation<'oneToMany', 'api::article.article'>; + createdAt: Schema.Attribute.DateTime; + createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + description: Schema.Attribute.Text; + locale: Schema.Attribute.String & Schema.Attribute.Private; + localizations: Schema.Attribute.Relation< + 'oneToMany', + 'api::category.category' + > & + Schema.Attribute.Private; + name: Schema.Attribute.String; + publishedAt: Schema.Attribute.DateTime; + slug: Schema.Attribute.UID; + updatedAt: Schema.Attribute.DateTime; + updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + }; +} + +export interface ApiGlobalGlobal extends Struct.SingleTypeSchema { + collectionName: 'globals'; + info: { + description: 'Define global settings'; + displayName: 'Global'; + pluralName: 'globals'; + singularName: 'global'; + }; + options: { + draftAndPublish: false; + }; + attributes: { + createdAt: Schema.Attribute.DateTime; + createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + defaultSeo: Schema.Attribute.Component<'shared.seo', false>; + favicon: Schema.Attribute.Media<'images' | 'files' | 'videos'>; + locale: Schema.Attribute.String & Schema.Attribute.Private; + localizations: Schema.Attribute.Relation< + 'oneToMany', + 'api::global.global' + > & + Schema.Attribute.Private; + publishedAt: Schema.Attribute.DateTime; + siteDescription: Schema.Attribute.Text & Schema.Attribute.Required; + siteName: Schema.Attribute.String & Schema.Attribute.Required; + updatedAt: Schema.Attribute.DateTime; + updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + }; +} + +export interface ApiPagePage extends Struct.CollectionTypeSchema { + collectionName: 'pages'; + info: { + description: ''; + displayName: 'Page'; + pluralName: 'pages'; + singularName: 'page'; + }; + options: { + draftAndPublish: true; + }; + attributes: { + createdAt: Schema.Attribute.DateTime; + createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + locale: Schema.Attribute.String & Schema.Attribute.Private; + localizations: Schema.Attribute.Relation<'oneToMany', 'api::page.page'> & + Schema.Attribute.Private; + name: Schema.Attribute.String; + parent: Schema.Attribute.Relation<'oneToOne', 'api::page.page'>; + publishedAt: Schema.Attribute.DateTime; + template: Schema.Attribute.Enumeration<['homepage']>; + title: Schema.Attribute.String; + updatedAt: Schema.Attribute.DateTime; + updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + }; +} + +export interface ApiPersonPerson extends Struct.SingleTypeSchema { + collectionName: 'people'; + info: { + displayName: 'person'; + pluralName: 'people'; + singularName: 'person'; + }; + options: { + draftAndPublish: true; + }; + attributes: { + createdAt: Schema.Attribute.DateTime; + createdBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + firstname: Schema.Attribute.String; + lastname: Schema.Attribute.String; + locale: Schema.Attribute.String & Schema.Attribute.Private; + localizations: Schema.Attribute.Relation< + 'oneToMany', + 'api::person.person' + > & + Schema.Attribute.Private; + name: Schema.Attribute.String; + publishedAt: Schema.Attribute.DateTime; + updatedAt: Schema.Attribute.DateTime; + updatedBy: Schema.Attribute.Relation<'oneToOne', 'admin::user'> & + Schema.Attribute.Private; + }; +} + export interface PluginContentReleasesRelease extends Struct.CollectionTypeSchema { collectionName: 'strapi_releases'; @@ -878,6 +1130,14 @@ declare module '@strapi/strapi' { 'admin::transfer-token': AdminTransferToken; 'admin::transfer-token-permission': AdminTransferTokenPermission; 'admin::user': AdminUser; + 'api::about.about': ApiAboutAbout; + 'api::article.article': ApiArticleArticle; + 'api::author.author': ApiAuthorAuthor; + 'api::car.car': ApiCarCar; + 'api::category.category': ApiCategoryCategory; + 'api::global.global': ApiGlobalGlobal; + 'api::page.page': ApiPagePage; + 'api::person.person': ApiPersonPerson; 'plugin::content-releases.release': PluginContentReleasesRelease; 'plugin::content-releases.release-action': PluginContentReleasesReleaseAction; 'plugin::i18n.locale': PluginI18NLocale;