@@ -8,7 +8,6 @@ import { BlueprintId } from '@sofie-automation/corelib/dist/dataModel/Ids'
88import { Meteor } from 'meteor/meteor'
99import { ClientAPI } from '@sofie-automation/meteor-lib/dist/api/client'
1010import { MeteorCall } from '../../methods'
11- import { MigrationStepInputResult } from '@sofie-automation/blueprints-integration'
1211
1312class SystemServerAPI implements SystemRestAPI {
1413 async assignSystemBlueprint (
@@ -33,36 +32,20 @@ class SystemServerAPI implements SystemRestAPI {
3332 const migrationStatus = await MeteorCall . migration . getMigrationStatus ( )
3433 if ( ! migrationStatus . migrationNeeded ) return ClientAPI . responseSuccess ( { inputs : [ ] } )
3534
36- const requiredInputs : PendingMigrations = [ ]
37- for ( const migration of migrationStatus . migration . manualInputs ) {
38- if ( migration . stepId && migration . attribute ) {
39- requiredInputs . push ( {
40- stepId : migration . stepId ,
41- attributeId : migration . attribute ,
42- } )
43- }
44- }
45-
46- return ClientAPI . responseSuccess ( { inputs : requiredInputs } )
35+ // Inputs are no longer supported, but need to be preserved for api compatibility
36+ return ClientAPI . responseSuccess ( { inputs : [ ] } )
4737 }
4838
4939 async applyPendingMigrations (
5040 _connection : Meteor . Connection ,
51- _event : string ,
52- inputs : MigrationData
41+ _event : string
5342 ) : Promise < ClientAPI . ClientResponse < void > > {
5443 const migrationStatus = await MeteorCall . migration . getMigrationStatus ( )
5544 if ( ! migrationStatus . migrationNeeded ) throw new Error ( `Migration does not need to be applied` )
5645
57- const migrationData : MigrationStepInputResult [ ] = inputs . map ( ( input ) => ( {
58- stepId : input . stepId ,
59- attribute : input . attributeId ,
60- value : input . migrationValue ,
61- } ) )
6246 const result = await MeteorCall . migration . runMigration (
6347 migrationStatus . migration . chunks ,
64- migrationStatus . migration . hash ,
65- migrationData
48+ migrationStatus . migration . hash
6649 )
6750 if ( result . migrationCompleted ) return ClientAPI . responseSuccess ( undefined )
6851 throw new Error ( `Unknown error occurred` )
@@ -95,12 +78,10 @@ export function registerRoutes(registerRoute: APIRegisterHook<SystemRestAPI>): v
9578 '/system/migrations' ,
9679 new Map ( [ [ 400 , [ UserErrorMessage . NoMigrationsToApply ] ] ] ) ,
9780 systemAPIFactory ,
98- async ( serverAPI , connection , event , _params , body ) => {
99- const inputs = body . inputs
81+ async ( serverAPI , connection , event , _params , _body ) => {
10082 logger . info ( `API POST: System migrations` )
10183
102- check ( inputs , Array )
103- return await serverAPI . applyPendingMigrations ( connection , event , inputs )
84+ return await serverAPI . applyPendingMigrations ( connection , event )
10485 }
10586 )
10687
0 commit comments