message: Remove usage of old sdk in supported-formats
diff: 'use strict'
  +const sdk = require('etcher-sdk')
  const _ = require('lodash')
  +const mime = require('mime')
  const path = require('path')
  -const imageStream = require('../sdk/image-stream')
  -const fileExtensions = require('./file-extensions')
  -/**
  - * @summary Build an extension list getter from a type
  - * @function
  - * @private
  - *
  - * @param {String} type - file type
  - * @returns {Function} extension list getter
  - *
  - * @example
  - * const extensions = getExtensionsFromTypeGetter('archive')();
  - */
  -const getExtensionsFromTypeGetter = (type) => {
  - return () => {
  - return _.map(_.filter(imageStream.supportedFileTypes, {
  - type
  - }), 'extension')
  - }
  -}
  +const fileExtensions = require('./file-extensions')
  /**
  * @summary Get compressed extensions
  @@ -52,7 +35,18 @@ const getExtensionsFromTypeGetter = (type) => {
  * console.log('We support the ' + extension + ' compressed file format');
  * });
  */
  -exports.getCompressedExtensions = getExtensionsFromTypeGetter('compressed')
  +exports.getCompressedExtensions = () => {
  + const result = []
  + for (const [ mimetype, cls ] of sdk.sourceDestination.SourceDestination.mimetypes.entries()) {
  + if (cls.prototype instanceof sdk.sourceDestination.CompressedSource) {
  + const mtype = mime.getExtension(mimetype)
  + if (mtype != null) {
  + result.push(mtype)
  + }
  + }
  + }
  + return result
  +}
  /**
  * @summary Get non compressed extensions
  @@ -66,7 +60,9 @@ exports.getCompressedExtensions = getExtensionsFromTypeGetter('compressed')
  * console.log('We support the ' + extension + ' file format');
  * });
  */
  -exports.getNonCompressedExtensions = getExtensionsFromTypeGetter('image')
  +exports.getNonCompressedExtensions = () => {
  + return sdk.sourceDestination.SourceDestination.imageExtensions
  +}
  /**
  * @summary Get archive extensions
  @@ -80,7 +76,9 @@ exports.getNonCompressedExtensions = getExtensionsFromTypeGetter('image')
  * console.log('We support the ' + extension + ' file format');
  * });
  */
  -exports.getArchiveExtensions = getExtensionsFromTypeGetter('archive')
  +exports.getArchiveExtensions = () => {
  + return [ 'zip', 'etch' ]
  +}
  /**
  * @summary Get all supported extensions
  @@ -95,7 +93,7 @@ exports.getArchiveExtensions = getExtensionsFromTypeGetter('archive')
  * });
  */
  exports.getAllExtensions = () => {
  - return _.map(imageStream.supportedFileTypes, 'extension')
  + return [ ...exports.getArchiveExtensions(), ...exports.getNonCompressedExtensions(), ...exports.getCompressedExtensions() ]
  }
  /**
  