konrad
f4c552a79f
All checks were successful
continuous-integration/drone/push Build is passing
Co-authored-by: kolaente <k@knt.li> Reviewed-on: #699 Co-authored-by: konrad <k@knt.li> Co-committed-by: konrad <k@knt.li>
38 lines
721 B
TypeScript
38 lines
721 B
TypeScript
export interface Migrator {
|
|
name: string
|
|
identifier: string
|
|
isFileMigrator?: boolean
|
|
}
|
|
|
|
export const getMigratorFromSlug = (slug: string): Migrator => {
|
|
switch (slug) {
|
|
case 'wunderlist':
|
|
return {
|
|
name: 'Wunderlist',
|
|
identifier: 'wunderlist',
|
|
}
|
|
case 'todoist':
|
|
return {
|
|
name: 'Todoist',
|
|
identifier: 'todoist',
|
|
}
|
|
case 'trello':
|
|
return {
|
|
name: 'Trello',
|
|
identifier: 'trello',
|
|
}
|
|
case 'microsoft-todo':
|
|
return {
|
|
name: 'Microsoft Todo',
|
|
identifier: 'microsoft-todo',
|
|
}
|
|
case 'vikunja-file':
|
|
return {
|
|
name: 'Vikunja Export',
|
|
identifier: 'vikunja-file',
|
|
isFileMigrator: true,
|
|
}
|
|
default:
|
|
throw Error('Unknown migrator slug ' + slug)
|
|
}
|
|
} |