Custom Plugin: Component and Content-Type creation by startup

I’m using Strapi 4.14.5 and I writing my plugin with Typescript. The object strapi.components[“uid”] expect the type Schema.Component. The type does not provide all attrbiutes for the component to be accepted. I had to add info, filename and schema for it to work. I also have to specify a filename even though i don’t have a file.

Thank you @Boegie19 for your hint with the strapi console.

import { Strapi } from "@strapi/strapi";

export default async ({ strapi }: { strapi: Strapi }) => {
  const schema = {
    collectionName: "components_huhu_minis",
    info: { displayName: "mini", icon: "alien" },
    options: {},
    attributes: { attribut1: { type: "string" } },
    __filename__: "mini.json",
    __schema__: {
      collectionName: "components_huhu_minis",
      info: { displayName: "mini", icon: "alien" },
      options: {},
      attributes: { attribut1: { type: "string" } },
      __filename__: "mini.json",
    },
    uid: "huhu.mini",
    category: "huhu",
    modelType: "component",
    modelName: "mini",
    globalId: "ComponentHuhuMini",
  };

  strapi.components["huhu.mini"] = schema as any;
};