@@ -83,7 +83,7 @@ export class MigrationStream extends Transform {
8383 return migrationFunction ;
8484 }
8585
86- private async processStory ( story : Story ) : Promise < Array < { storyId : number ; name : string | undefined ; content : StoryContent } > > {
86+ private async processStory ( story : Story ) : Promise < Array < { storyId : number ; name : string | undefined ; content : StoryContent ; published ?: boolean ; unpublished_changes ?: boolean } > > {
8787 // Filter migrations based on component name if provided
8888 const relevantMigrations = this . options . componentName
8989 ? this . options . migrationFiles . filter ( ( file ) => {
@@ -101,7 +101,7 @@ export class MigrationStream extends Transform {
101101 return [ ] ;
102102 }
103103
104- const successfulResults : Array < { storyId : number ; name : string | undefined ; content : StoryContent } > = [ ] ;
104+ const successfulResults : Array < { storyId : number ; name : string | undefined ; content : StoryContent ; published ?: boolean ; unpublished_changes ?: boolean } > = [ ] ;
105105
106106 // Process each relevant migration
107107 const result = await this . applyMigrationsToStory ( story , relevantMigrations ) ;
@@ -112,7 +112,7 @@ export class MigrationStream extends Transform {
112112 return successfulResults ;
113113 }
114114
115- private async applyMigrationsToStory ( story : Story , migrationFiles : MigrationFile [ ] ) : Promise < { storyId : number ; name : string | undefined ; content : StoryContent } | null > {
115+ private async applyMigrationsToStory ( story : Story , migrationFiles : MigrationFile [ ] ) : Promise < { storyId : number ; name : string | undefined ; content : StoryContent ; published ?: boolean ; unpublished_changes ?: boolean } | null > {
116116 const migrationNames = migrationFiles . map ( f => f . name ) ;
117117
118118 try {
@@ -144,7 +144,13 @@ export class MigrationStream extends Transform {
144144 await saveRollbackData ( {
145145 space : this . options . space ,
146146 path : this . options . path ,
147- story : { id : story . id , name : story . name || '' , content : story . content as StoryContent } ,
147+ story : {
148+ id : story . id ,
149+ name : story . name || '' ,
150+ content : story . content as StoryContent ,
151+ published : story . published ,
152+ unpublished_changes : story . unpublished_changes ,
153+ } ,
148154 migrationTimestamp : this . timestamp ,
149155 migrationNames,
150156 } ) ;
@@ -160,6 +166,8 @@ export class MigrationStream extends Transform {
160166 storyId : story . id ,
161167 name : story . name ,
162168 content : storyContent ,
169+ published : story . published ,
170+ unpublished_changes : story . unpublished_changes ,
163171 } ;
164172 }
165173 else if ( processed && ! contentChanged ) {
0 commit comments