Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions packages/contentstack-config/src/commands/config/set/region.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export default class RegionSetCommand extends BaseCommand<typeof RegionSetComman
launch: _flags.string({
description: 'Custom host to set for Launch API',
}),
'composable-studio': _flags.string({
description: 'Custom host to set for Composable Studio API',
studio: _flags.string({
description: 'Custom host to set for Studio API',
}),
};
static examples = [
Expand All @@ -65,8 +65,8 @@ export default class RegionSetCommand extends BaseCommand<typeof RegionSetComman
'$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --developer-hub <custom_developer_hub_url>',
'$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --personalize <custom_personalize_url>',
'$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --launch <custom_launch_url>',
'$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --composable-studio <custom_composable_studio_url>',
'$ csdx config:set:region --cda <custom_cda_host_url> --cma <custom_cma_host_url> --ui-host <custom_ui_host_url> --name "India" --developer-hub <custom_developer_hub_url> --launch <custom_launch_url> --personalize <custom_personalize_url> --composable-studio <custom_composable_studio_url>',
'$ csdx config:set:region --cma <custom_cma_host_url> --cda <custom_cda_host_url> --ui-host <custom_ui_host_url> --name "India" --studio <custom_studio_url>',
'$ csdx config:set:region --cda <custom_cda_host_url> --cma <custom_cma_host_url> --ui-host <custom_ui_host_url> --name "India" --developer-hub <custom_developer_hub_url> --launch <custom_launch_url> --personalize <custom_personalize_url> --studio <custom_studio_url>',
];

static args: ArgInput = {
Expand All @@ -82,7 +82,7 @@ export default class RegionSetCommand extends BaseCommand<typeof RegionSetComman
let developerHubUrl = regionSetFlags['developer-hub'];
let personalizeUrl = regionSetFlags['personalize'];
let launchHubUrl = regionSetFlags['launch'];
let composableStudioUrl = regionSetFlags['composable-studio'];
let composableStudioUrl = regionSetFlags['studio'];
let selectedRegion = args.region;
if (!(cda && cma && uiHost && name) && !selectedRegion) {
selectedRegion = await interactive.askRegions();
Expand Down Expand Up @@ -132,7 +132,7 @@ export default class RegionSetCommand extends BaseCommand<typeof RegionSetComman
cliux.success(`Developer Hub URL: ${customRegion.developerHubUrl}`);
cliux.success(`Personalize URL: ${customRegion.personalizeUrl}`);
cliux.success(`Launch URL: ${customRegion.launchHubUrl}`);
cliux.success(`Composable Studio URL: ${customRegion.composableStudioUrl}`);
cliux.success(`Studio URL: ${customRegion.composableStudioUrl}`);
} catch (error) {
this.logger.error('failed to set the region', error);
cliux.error(`Failed to set region due to: ${error.message}`);
Expand All @@ -151,7 +151,7 @@ export default class RegionSetCommand extends BaseCommand<typeof RegionSetComman
cliux.success(`Developer Hub URL: ${regionDetails.developerHubUrl}`);
cliux.success(`Personalize URL: ${regionDetails.personalizeUrl}`);
cliux.success(`Launch URL: ${regionDetails.launchHubUrl}`);
cliux.success(`Composable Studio URL: ${regionDetails.composableStudioUrl}`);
cliux.success(`Studio URL: ${regionDetails.composableStudioUrl}`);
} else {
cliux.error(`Invalid region specified.`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ describe('Region command', function () {
expect(result.launchHubUrl).to.equal(customRegion.launchHubUrl);
});

it('should set a custom region with composable studio URL', function () {
it('should set a custom region with studio URL', function () {
const customRegion = {
cma: 'https://custom-cma.com',
cda: 'https://custom-cda.com',
Expand Down
116 changes: 58 additions & 58 deletions packages/contentstack-export/messages/index.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
{
"ASSET_EXPORT_COMPLETE": "Asset export process completed successfully",
"ASSET_FOLDERS_EXPORT_COMPLETE": "Asset folder structure exported successfully",
"ASSET_METADATA_EXPORT_COMPLETE": "Asset metadata exported successfully",
"ASSET_VERSIONED_METADATA_EXPORT_COMPLETE": "Versioned asset metadata exported successfully",
"ASSET_DOWNLOAD_COMPLETE": "Asset download completed successfully",
"ASSET_DOWNLOAD_SUCCESS": "Asset '%s' (UID: %s) downloaded successfully",
"ASSET_DOWNLOAD_FAILED": "Failed to download asset '%s' (UID: %s)",
"ASSET_WRITE_FAILED": "Failed to write asset file '%s' (UID: %s)",
"ASSET_QUERY_FAILED": "Failed to query asset data from the API",
"ASSET_VERSIONED_QUERY_FAILED": "Failed to query versioned asset data from the API",
"ASSET_COUNT_QUERY_FAILED": "Failed to retrieve total asset count",
"ASSET_EXPORT_COMPLETE": "Asset export process completed successfully",
"ASSET_FOLDERS_EXPORT_COMPLETE": "Asset folder structure exported successfully",
"ASSET_METADATA_EXPORT_COMPLETE": "Asset metadata exported successfully",
"ASSET_VERSIONED_METADATA_EXPORT_COMPLETE": "Versioned asset metadata exported successfully",
"ASSET_DOWNLOAD_COMPLETE": "Asset download completed successfully",
"ASSET_DOWNLOAD_SUCCESS": "Asset '%s' (UID: %s) downloaded successfully",
"ASSET_DOWNLOAD_FAILED": "Failed to download asset '%s' (UID: %s)",
"ASSET_WRITE_FAILED": "Failed to write asset file '%s' (UID: %s)",
"ASSET_QUERY_FAILED": "Failed to query asset data from the API",
"ASSET_VERSIONED_QUERY_FAILED": "Failed to query versioned asset data from the API",
"ASSET_COUNT_QUERY_FAILED": "Failed to retrieve total asset count",

"CONTENT_TYPE_EXPORT_COMPLETE": "Content types exported successfully",
"CONTENT_TYPE_NO_TYPES": "No content types found",
"CONTENT_TYPE_EXPORT_FAILED": "Failed to export content types",
"CONTENT_TYPE_NO_TYPES_RETURNED": "API returned no content types for the given query",
"CONTENT_TYPE_EXPORT_COMPLETE": "Content types exported successfully",
"CONTENT_TYPE_NO_TYPES": "No content types found",
"CONTENT_TYPE_EXPORT_FAILED": "Failed to export content types",
"CONTENT_TYPE_NO_TYPES_RETURNED": "API returned no content types for the given query",

"ENVIRONMENT_EXPORT_COMPLETE": "Successfully exported %s environment(s)",
"ENVIRONMENT_EXPORT_SUCCESS": "Environment '%s' exported successfully",
"ENVIRONMENT_NOT_FOUND": "No environments found in the current stack",
"ENVIRONMENT_EXPORT_COMPLETE": "Successfully exported %s environment(s)",
"ENVIRONMENT_EXPORT_SUCCESS": "Environment '%s' exported successfully",
"ENVIRONMENT_NOT_FOUND": "No environments found in the current stack",

"EXTENSION_EXPORT_COMPLETE": "Successfully exported %s extension(s)",
"EXTENSION_EXPORT_SUCCESS": "Extension '%s' exported successfully",
"EXTENSION_NOT_FOUND": "No extensions found in the current stack",
"EXTENSION_EXPORT_COMPLETE": "Successfully exported %s extension(s)",
"EXTENSION_EXPORT_SUCCESS": "Extension '%s' exported successfully",
"EXTENSION_NOT_FOUND": "No extensions found in the current stack",

"GLOBAL_FIELDS_EXPORT_COMPLETE": "Successfully exported %s global field(s)",
"GLOBAL_FIELDS_EXPORT_COMPLETE": "Successfully exported %s global field(s)",

"LABELS_EXPORT_COMPLETE": "Successfully exported %s label(s)",
"LABEL_EXPORT_SUCCESS": "Label '%s' exported successfully",
"LABELS_NOT_FOUND": "No labels found in the current stack",
"LABELS_EXPORT_COMPLETE": "Successfully exported %s label(s)",
"LABEL_EXPORT_SUCCESS": "Label '%s' exported successfully",
"LABELS_NOT_FOUND": "No labels found in the current stack",

"LOCALES_EXPORT_COMPLETE": "Successfully exported %s locale(s) including %s master locale(s)",
"LOCALES_EXPORT_COMPLETE": "Successfully exported %s locale(s) including %s master locale(s)",

"TAXONOMY_EXPORT_COMPLETE": "Successfully exported %s taxonomy entries",
"TAXONOMY_EXPORT_SUCCESS": "Taxonomy '%s' exported successfully",
"TAXONOMY_NOT_FOUND": "No taxonomies found in the current stack",
"TAXONOMY_EXPORT_COMPLETE": "Successfully exported %s taxonomy entries",
"TAXONOMY_EXPORT_SUCCESS": "Taxonomy '%s' exported successfully",
"TAXONOMY_NOT_FOUND": "No taxonomies found in the current stack",

"WEBHOOK_EXPORT_COMPLETE": "Successfully exported %s webhook(s)",
"WEBHOOK_EXPORT_SUCCESS": "Webhook '%s' exported successfully",
"WEBHOOK_NOT_FOUND": "No webhooks found in the current stack",
"WEBHOOK_EXPORT_COMPLETE": "Successfully exported %s webhook(s)",
"WEBHOOK_EXPORT_SUCCESS": "Webhook '%s' exported successfully",
"WEBHOOK_NOT_FOUND": "No webhooks found in the current stack",

"WORKFLOW_EXPORT_COMPLETE": "Successfully exported %s workflow(s)",
"WORKFLOW_EXPORT_SUCCESS": "Workflow '%s' exported successfully",
"WORKFLOW_NOT_FOUND": "No workflows found in the current stack",
"WORKFLOW_EXPORT_COMPLETE": "Successfully exported %s workflow(s)",
"WORKFLOW_EXPORT_SUCCESS": "Workflow '%s' exported successfully",
"WORKFLOW_NOT_FOUND": "No workflows found in the current stack",

"PERSONALIZE_URL_NOT_SET": "Cannot export Personalize project: URL not configured",
"PERSONALIZE_SKIPPING_WITH_MANAGEMENT_TOKEN": "Skipping Personalize project export: Management token not supported",
"PERSONALIZE_MODULE_NOT_IMPLEMENTED": "Module '%s' implementation not found",
"PERSONALIZE_NOT_ENABLED": "Personalize feature is not enabled for this organization",
"PERSONALIZE_URL_NOT_SET": "Cannot export Personalize project: URL not configured",
"PERSONALIZE_SKIPPING_WITH_MANAGEMENT_TOKEN": "Skipping Personalize project export: Management token not supported",
"PERSONALIZE_MODULE_NOT_IMPLEMENTED": "Module '%s' implementation not found",
"PERSONALIZE_NOT_ENABLED": "Personalize feature is not enabled for this organization",

"MARKETPLACE_APPS_EXPORT_COMPLETE": "Successfully exported %s marketplace app(s)",
"MARKETPLACE_APP_CONFIG_EXPORT": "Exporting configuration for app '%s'",
"MARKETPLACE_APP_CONFIG_SUCCESS": "Successfully exported configuration for app '%s'",
"MARKETPLACE_APP_EXPORT_SUCCESS": "Successfully exported app '%s'",
"MARKETPLACE_APPS_NOT_FOUND": "No marketplace apps found in the current stack",
"MARKETPLACE_APP_CONFIG_EXPORT_FAILED": "Failed to export configuration for app '%s'",
"MARKETPLACE_APP_MANIFEST_EXPORT_FAILED": "Failed to export manifest for app '%s'",
"MARKETPLACE_APPS_EXPORT_COMPLETE": "Successfully exported %s marketplace app(s)",
"MARKETPLACE_APP_CONFIG_EXPORT": "Exporting configuration for app '%s'",
"MARKETPLACE_APP_CONFIG_SUCCESS": "Successfully exported configuration for app '%s'",
"MARKETPLACE_APP_EXPORT_SUCCESS": "Successfully exported app '%s'",
"MARKETPLACE_APPS_NOT_FOUND": "No marketplace apps found in the current stack",
"MARKETPLACE_APP_CONFIG_EXPORT_FAILED": "Failed to export configuration for app '%s'",
"MARKETPLACE_APP_MANIFEST_EXPORT_FAILED": "Failed to export manifest for app '%s'",

"COMPOSABLE_STUDIO_EXPORT_START": "Starting Composable Studio project export...",
"COMPOSABLE_STUDIO_NOT_FOUND": "No Composable Studio project found for this stack",
"COMPOSABLE_STUDIO_EXPORT_COMPLETE": "Successfully exported Composable Studio project '%s'",
"COMPOSABLE_STUDIO_EXPORT_FAILED": "Failed to export Composable Studio project: %s",
"COMPOSABLE_STUDIO_AUTH_REQUIRED": "To export Composable Studio projects, you must be logged in",
"COMPOSABLE_STUDIO_EXPORT_START": "Starting Studio project export...",
"COMPOSABLE_STUDIO_NOT_FOUND": "No Studio project found for this stack",
"COMPOSABLE_STUDIO_EXPORT_COMPLETE": "Successfully exported Studio project '%s'",
"COMPOSABLE_STUDIO_EXPORT_FAILED": "Failed to export Studio project: %s",
"COMPOSABLE_STUDIO_AUTH_REQUIRED": "To export Studio projects, you must be logged in",

"ENTRIES_EXPORT_COMPLETE": "Successfully exported entries (Content Type: %s, Locale: %s)",
"ENTRIES_EXPORT_SUCCESS": "All entries exported successfully",
"ENTRIES_VERSIONED_EXPORT_SUCCESS": "Successfully exported versioned entry (Content Type: %s, UID: %s, Locale: %s)",
"ENTRIES_EXPORT_VERSIONS_FAILED": "Failed to export versions for content type '%s' (UID: %s)",
"ENTRIES_EXPORT_COMPLETE": "Successfully exported entries (Content Type: %s, Locale: %s)",
"ENTRIES_EXPORT_SUCCESS": "All entries exported successfully",
"ENTRIES_VERSIONED_EXPORT_SUCCESS": "Successfully exported versioned entry (Content Type: %s, UID: %s, Locale: %s)",
"ENTRIES_EXPORT_VERSIONS_FAILED": "Failed to export versions for content type '%s' (UID: %s)",

"BRANCH_EXPORT_FAILED": "Failed to export contents from branch (UID: %s)",
"BRANCH_EXPORT_FAILED": "Failed to export contents from branch (UID: %s)",

"ROLES_NO_CUSTOM_ROLES": "No custom roles found in the current stack",
"ROLES_EXPORTING_ROLE": "Exporting role '%s'"
"ROLES_NO_CUSTOM_ROLES": "No custom roles found in the current stack",
"ROLES_EXPORTING_ROLE": "Exporting role '%s'"
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default class ExportCommand extends Command {
module: flags.string({
char: 'm',
description:
'[optional] Specific module name. If not specified, the export command will export all the modules to the stack. The available modules are assets, content-types, entries, environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks, workflows, custom-roles, taxonomies, and composable-studio.',
'[optional] Specific module name. If not specified, the export command will export all the modules to the stack. The available modules are assets, content-types, entries, environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks, workflows, custom-roles, taxonomies, and studio.',
parse: printFlagDeprecation(['-m'], ['--module']),
}),
'content-types': flags.string({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ export default class ExportComposableStudio {
this.composableStudioConfig = exportConfig.modules['composable-studio'];
this.exportConfig.context.module = 'composable-studio';

// Initialize HttpClient with Composable Studio API base URL
// Initialize HttpClient with Studio API base URL
this.apiClient = new HttpClient();
this.apiClient.baseUrl(`${this.composableStudioConfig.apiBaseUrl}/${this.composableStudioConfig.apiVersion}`);
}

async start(): Promise<void> {
log.debug('Starting Composable Studio project export process...', this.exportConfig.context);
log.debug('Starting Studio project export process...', this.exportConfig.context);

if (!isAuthenticated()) {
cliux.print(
'WARNING!!! To export Composable Studio projects, you must be logged in. Please check csdx auth:login --help to log in',
'WARNING!!! To export Studio projects, you must be logged in. Please check csdx auth:login --help to log in',
{ color: 'yellow' },
);
return Promise.resolve();
Expand All @@ -45,27 +45,27 @@ export default class ExportComposableStudio {
this.exportConfig.branchName || '',
this.composableStudioConfig.dirName,
);
log.debug(`Composable Studio folder path: ${this.composableStudioPath}`, this.exportConfig.context);
log.debug(`Studio folder path: ${this.composableStudioPath}`, this.exportConfig.context);

await fsUtil.makeDirectory(this.composableStudioPath);
log.debug('Created Composable Studio directory', this.exportConfig.context);
log.debug('Created Studio directory', this.exportConfig.context);

this.exportConfig.org_uid = this.exportConfig.org_uid || (await getOrgUid(this.exportConfig));
log.debug(`Organization UID: ${this.exportConfig.org_uid}`, this.exportConfig.context);

await this.exportProjects();
log.debug('Composable Studio project export process completed', this.exportConfig.context);
log.debug('Studio project export process completed', this.exportConfig.context);
}

/**
* Export Composable Studio projects connected to the current stack
* Export Studio projects connected to the current stack
*/
async exportProjects(): Promise<void> {
log.debug('Starting Composable Studio project export...', this.exportConfig.context);
log.debug('Starting Studio project export...', this.exportConfig.context);

try {
// Get authentication details - following personalization-api-adapter pattern
log.debug('Initializing Composable Studio API authentication...', this.exportConfig.context);
log.debug('Initializing Studio API authentication...', this.exportConfig.context);
await authenticationHandler.getAuthDetails();
const token = authenticationHandler.accessToken;
log.debug(
Expand Down Expand Up @@ -116,11 +116,11 @@ export default class ExportComposableStudio {

// Use the first connected project (stacks should have only one project)
this.composableStudioProject = connectedProject[0];
log.debug(`Found Composable Studio project: ${this.composableStudioProject.name}`, this.exportConfig.context);
log.debug(`Found Studio project: ${this.composableStudioProject.name}`, this.exportConfig.context);

// Write the project to file
const composableStudioFilePath = pResolve(this.composableStudioPath, this.composableStudioConfig.fileName);
log.debug(`Writing Composable Studio project to: ${composableStudioFilePath}`, this.exportConfig.context);
log.debug(`Writing Studio project to: ${composableStudioFilePath}`, this.exportConfig.context);

fsUtil.writeFile(composableStudioFilePath, this.composableStudioProject as unknown as Record<string, unknown>);

Expand All @@ -129,7 +129,7 @@ export default class ExportComposableStudio {
this.exportConfig.context,
);
} catch (error: any) {
log.debug('Error occurred while exporting Composable Studio project', this.exportConfig.context);
log.debug('Error occurred while exporting Studio project', this.exportConfig.context);
handleAndLogError(error, {
...this.exportConfig.context,
});
Expand Down
10 changes: 5 additions & 5 deletions packages/contentstack-import/messages/index.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"COMPOSABLE_STUDIO_IMPORT_START": "Starting Composable Studio project import...",
"COMPOSABLE_STUDIO_NOT_FOUND": "No Composable Studio project found in exported data",
"COMPOSABLE_STUDIO_SKIP_EXISTING": "Skipping Composable Studio import - target stack already has a connected project",
"COMPOSABLE_STUDIO_IMPORT_COMPLETE": "Successfully imported Composable Studio project '%s'",
"COMPOSABLE_STUDIO_IMPORT_FAILED": "Failed to import Composable Studio project: %s",
"COMPOSABLE_STUDIO_IMPORT_START": "Starting Studio project import...",
"COMPOSABLE_STUDIO_NOT_FOUND": "No Studio project found in exported data",
"COMPOSABLE_STUDIO_SKIP_EXISTING": "Skipping Studio import - target stack already has a connected project",
"COMPOSABLE_STUDIO_IMPORT_COMPLETE": "Successfully imported Studio project '%s'",
"COMPOSABLE_STUDIO_IMPORT_FAILED": "Failed to import Studio project: %s",
"COMPOSABLE_STUDIO_NAME_CONFLICT": "Project name '%s' already exists. Please provide a new name:",
"COMPOSABLE_STUDIO_SUGGEST_NAME": "Suggested name: %s",
"COMPOSABLE_STUDIO_ENV_MAPPING_FAILED": "Warning: Could not map environment '%s', using empty environment"
Expand Down
Loading
Loading