diff --git a/packages/contentstack-import-setup/src/import/content-types.ts b/packages/contentstack-import-setup/src/import/content-types.ts index e69de29bb2..bea9774754 100644 --- a/packages/contentstack-import-setup/src/import/content-types.ts +++ b/packages/contentstack-import-setup/src/import/content-types.ts @@ -0,0 +1,45 @@ +import * as chalk from 'chalk'; +import { log, fsUtil } from '../utils'; +import { join } from 'path'; +import { ImportConfig, ModuleClassParams } from '../types'; +import ExtensionImportSetup from './extensions'; + +export default class ContentTypesImportSetup { + private config: ImportConfig; + private contentTypeFilePath: string; + private stackAPIClient: ModuleClassParams['stackAPIClient']; + private dependencies: ModuleClassParams['dependencies']; + private contentTypeConfig: ImportConfig['modules']['content-types']; + + constructor({ config, stackAPIClient, dependencies }: ModuleClassParams) { + this.config = config; + this.stackAPIClient = stackAPIClient; + this.dependencies = dependencies; + this.contentTypeConfig = config.modules['content-types']; + } + + /** + * + */ + async start() { + try { + // in content type we need to create mappers for marketplace apps, extension, taxonomies + // we can call the specific import setup for each of these modules + // Call the specific import setup for each module + // todo + // await this.importMarketplaceApps(); + await new ExtensionImportSetup({ + config: this.config, + dependencies: this.dependencies, + stackAPIClient: this.stackAPIClient, + }).start(); + + // todo + // await this.importTaxonomies(); + + log(this.config, chalk.green(`Mapper file created`), 'success'); + } catch (error) { + log(this.config, chalk.red(`Error generating ${error.message}`), 'error'); + } + } +} diff --git a/packages/contentstack-import-setup/src/types/import-config.ts b/packages/contentstack-import-setup/src/types/import-config.ts index 8ca9ca9eeb..08af70544b 100644 --- a/packages/contentstack-import-setup/src/types/import-config.ts +++ b/packages/contentstack-import-setup/src/types/import-config.ts @@ -11,7 +11,7 @@ export interface ExternalConfig { } export default interface ImportConfig extends DefaultConfig, ExternalConfig { - cliLogsPath: string; + cliLogsPath?: string; contentDir: string; data: string; management_token?: string;