Skip to content

Commit

Permalink
content type update
Browse files Browse the repository at this point in the history
  • Loading branch information
shafeeqd959 committed Sep 3, 2024
1 parent c8df043 commit 6db05e3
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
45 changes: 45 additions & 0 deletions packages/contentstack-import-setup/src/import/content-types.ts
Original file line number Diff line number Diff line change
@@ -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');
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6db05e3

Please sign in to comment.