Skip to content

Commit

Permalink
Uses types System for MigrationItem
Browse files Browse the repository at this point in the history
  • Loading branch information
Enngage committed Jul 25, 2024
1 parent ad92ec3 commit 0d71ad4
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ type CollectionCodenames = "default" | "global";
type WorkflowCodenames = "default" | "custom";
type WorkflowStepCodenames = "published" | "archived" | "draft";
type ContentTypeCodenames = "movie" | "actor";
type ContentTypeCodename<Codename extends ContentTypeCodenames> = Codename;
type System<Codename extends ContentTypeCodenames> = MigrationItemSystem<
Codename,
LanguageCodenames,
CollectionCodenames,
WorkflowCodenames
>;

type MovieItem = MigrationItem<
// Defines the elements in the 'Movie' content type defined in Kontent.ai
Expand All @@ -27,7 +32,7 @@ type MovieItem = MigrationItem<
releasecategory: MigrationElementModels.TaxonomyElement;
},
MigrationItemSystem<
ContentTypeCodename<"movie">,
System<"movie">,
LanguageCodenames,
CollectionCodenames,
WorkflowCodenames
Expand Down

0 comments on commit 0d71ad4

Please sign in to comment.