@contentstack/cli-cm-export 2.0.0-beta.2 → 2.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -65
- package/lib/commands/cm/stacks/export.d.ts +0 -1
- package/lib/commands/cm/stacks/export.js +5 -32
- package/lib/config/index.js +7 -0
- package/lib/export/module-exporter.js +3 -2
- package/lib/export/modules/composable-studio.d.ts +15 -0
- package/lib/export/modules/composable-studio.js +87 -0
- package/lib/export/modules/content-types.js +4 -2
- package/lib/export/modules/entries.js +7 -7
- package/lib/export/modules/global-fields.js +6 -2
- package/lib/export/modules/marketplace-apps.js +33 -21
- package/lib/export/modules/stack.js +18 -18
- package/lib/export/modules/taxonomies.d.ts +1 -0
- package/lib/export/modules/taxonomies.js +23 -6
- package/lib/export/modules/workflows.js +1 -1
- package/lib/types/default-config.d.ts +6 -0
- package/lib/types/index.d.ts +27 -1
- package/lib/utils/basic-login.js +1 -1
- package/lib/utils/export-config-handler.js +8 -7
- package/lib/utils/file-helper.js +1 -1
- package/lib/utils/marketplace-app-helper.js +1 -3
- package/messages/index.json +73 -67
- package/oclif.manifest.json +4 -42
- package/package.json +6 -10
|
@@ -28,7 +28,7 @@ class ExportStack extends base_class_1.default {
|
|
|
28
28
|
// Add processes based on configuration
|
|
29
29
|
let processCount = 0;
|
|
30
30
|
if (stackData === null || stackData === void 0 ? void 0 : stackData.org_uid) {
|
|
31
|
-
cli_utilities_1.log.debug(`Found organization UID: ${stackData.org_uid}
|
|
31
|
+
cli_utilities_1.log.debug(`Found organization UID: '${stackData.org_uid}'.`, this.exportConfig.context);
|
|
32
32
|
this.exportConfig.org_uid = stackData.org_uid;
|
|
33
33
|
this.exportConfig.sourceStackName = stackData.name;
|
|
34
34
|
cli_utilities_1.log.debug(`Set source stack name: ${stackData.name}`, this.exportConfig.context);
|
|
@@ -92,30 +92,30 @@ class ExportStack extends base_class_1.default {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
async getStack() {
|
|
95
|
-
cli_utilities_1.log.debug(`Fetching stack data for
|
|
95
|
+
cli_utilities_1.log.debug(`Fetching stack data for: '${this.exportConfig.source_stack}'...`, this.exportConfig.context);
|
|
96
96
|
const tempAPIClient = await (0, cli_utilities_1.managementSDKClient)({ host: this.exportConfig.host });
|
|
97
|
-
cli_utilities_1.log.debug(`Created
|
|
97
|
+
cli_utilities_1.log.debug(`Created Management SDK client with host: '${this.exportConfig.host}'.`, this.exportConfig.context);
|
|
98
98
|
return await tempAPIClient
|
|
99
99
|
.stack({ api_key: this.exportConfig.source_stack })
|
|
100
100
|
.fetch()
|
|
101
101
|
.then((data) => {
|
|
102
|
-
cli_utilities_1.log.debug(`Successfully fetched stack data for: ${this.exportConfig.source_stack}
|
|
102
|
+
cli_utilities_1.log.debug(`Successfully fetched stack data for: '${this.exportConfig.source_stack}'.`, this.exportConfig.context);
|
|
103
103
|
return data;
|
|
104
104
|
})
|
|
105
105
|
.catch((error) => {
|
|
106
|
-
cli_utilities_1.log.debug(`Failed to fetch stack data for: ${this.exportConfig.source_stack}
|
|
106
|
+
cli_utilities_1.log.debug(`Failed to fetch stack data for: '${this.exportConfig.source_stack}'.`, this.exportConfig.context);
|
|
107
107
|
return {};
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
110
|
async getLocales(skip = 0) {
|
|
111
111
|
if (skip) {
|
|
112
112
|
this.qs.skip = skip;
|
|
113
|
-
cli_utilities_1.log.debug(`Fetching locales with skip: ${skip}
|
|
113
|
+
cli_utilities_1.log.debug(`Fetching locales with skip: ${skip}.`, this.exportConfig.context);
|
|
114
114
|
}
|
|
115
115
|
else {
|
|
116
|
-
cli_utilities_1.log.debug('Fetching locales with initial query', this.exportConfig.context);
|
|
116
|
+
cli_utilities_1.log.debug('Fetching locales with initial query...', this.exportConfig.context);
|
|
117
117
|
}
|
|
118
|
-
cli_utilities_1.log.debug(`Query parameters: ${JSON.stringify(this.qs)}
|
|
118
|
+
cli_utilities_1.log.debug(`Query parameters: ${JSON.stringify(this.qs)}.`, this.exportConfig.context);
|
|
119
119
|
return await this.stack
|
|
120
120
|
.locale()
|
|
121
121
|
.query(this.qs)
|
|
@@ -123,7 +123,7 @@ class ExportStack extends base_class_1.default {
|
|
|
123
123
|
.then(async (data) => {
|
|
124
124
|
var _a;
|
|
125
125
|
const { items, count } = data;
|
|
126
|
-
cli_utilities_1.log.debug(`Fetched ${(items === null || items === void 0 ? void 0 : items.length) || 0} locales out of
|
|
126
|
+
cli_utilities_1.log.debug(`Fetched ${(items === null || items === void 0 ? void 0 : items.length) || 0} locales out of ${count}.`, this.exportConfig.context);
|
|
127
127
|
if (items === null || items === void 0 ? void 0 : items.length) {
|
|
128
128
|
cli_utilities_1.log.debug(`Processing ${items.length} locales to find master locale`, this.exportConfig.context);
|
|
129
129
|
// Track progress for each locale processed
|
|
@@ -131,17 +131,17 @@ class ExportStack extends base_class_1.default {
|
|
|
131
131
|
skip += this.stackConfig.limit || 100;
|
|
132
132
|
const masterLocalObj = (0, find_1.default)(items, (locale) => {
|
|
133
133
|
if (locale.fallback_locale === null) {
|
|
134
|
-
cli_utilities_1.log.debug(`Found master locale: ${locale.name} (${locale.code})
|
|
134
|
+
cli_utilities_1.log.debug(`Found master locale: '${locale.name}' (code: ${locale.code}).`, this.exportConfig.context);
|
|
135
135
|
return locale;
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
138
|
if (masterLocalObj) {
|
|
139
|
-
cli_utilities_1.log.debug(`Returning master locale: ${masterLocalObj.name}
|
|
139
|
+
cli_utilities_1.log.debug(`Returning master locale: '${masterLocalObj.name}'.`, this.exportConfig.context);
|
|
140
140
|
return masterLocalObj;
|
|
141
141
|
}
|
|
142
142
|
else if (skip >= count) {
|
|
143
143
|
cli_utilities_1.log.error(`Locale locale not found in the stack ${this.exportConfig.source_stack}. Please ensure that the stack has a master locale.`, this.exportConfig.context);
|
|
144
|
-
cli_utilities_1.log.debug('Completed
|
|
144
|
+
cli_utilities_1.log.debug('Completed search. Master locale not found.', this.exportConfig.context);
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
else {
|
|
@@ -150,7 +150,7 @@ class ExportStack extends base_class_1.default {
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
else {
|
|
153
|
-
cli_utilities_1.log.debug('No locales found to process', this.exportConfig.context);
|
|
153
|
+
cli_utilities_1.log.debug('No locales found to process.', this.exportConfig.context);
|
|
154
154
|
}
|
|
155
155
|
})
|
|
156
156
|
.catch((error) => {
|
|
@@ -162,20 +162,20 @@ class ExportStack extends base_class_1.default {
|
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
async exportStack() {
|
|
165
|
-
cli_utilities_1.log.debug(`Starting stack export for: ${this.exportConfig.source_stack}
|
|
165
|
+
cli_utilities_1.log.debug(`Starting stack export for: '${this.exportConfig.source_stack}'...`, this.exportConfig.context);
|
|
166
166
|
await utils_1.fsUtil.makeDirectory(this.stackFolderPath);
|
|
167
|
-
cli_utilities_1.log.debug(`Created stack directory at: ${this.stackFolderPath}`, this.exportConfig.context);
|
|
167
|
+
cli_utilities_1.log.debug(`Created stack directory at: '${this.stackFolderPath}'`, this.exportConfig.context);
|
|
168
168
|
return this.stack
|
|
169
169
|
.fetch()
|
|
170
170
|
.then((resp) => {
|
|
171
171
|
var _a;
|
|
172
172
|
const stackFilePath = (0, node_path_1.resolve)(this.stackFolderPath, this.stackConfig.fileName);
|
|
173
|
-
cli_utilities_1.log.debug(`Writing stack data to: ${stackFilePath}`, this.exportConfig.context);
|
|
173
|
+
cli_utilities_1.log.debug(`Writing stack data to: '${stackFilePath}'`, this.exportConfig.context);
|
|
174
174
|
utils_1.fsUtil.writeFile(stackFilePath, resp);
|
|
175
175
|
// Track progress for stack export completion
|
|
176
176
|
(_a = this.progressManager) === null || _a === void 0 ? void 0 : _a.tick(true, `stack: ${this.exportConfig.source_stack}`, null, utils_1.PROCESS_NAMES.STACK_DETAILS);
|
|
177
177
|
cli_utilities_1.log.success(`Stack details exported successfully for stack ${this.exportConfig.source_stack}`, this.exportConfig.context);
|
|
178
|
-
cli_utilities_1.log.debug('Stack export completed successfully', this.exportConfig.context);
|
|
178
|
+
cli_utilities_1.log.debug('Stack export completed successfully.', this.exportConfig.context);
|
|
179
179
|
return resp;
|
|
180
180
|
})
|
|
181
181
|
.catch((error) => {
|
|
@@ -186,7 +186,7 @@ class ExportStack extends base_class_1.default {
|
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
188
|
async exportStackSettings() {
|
|
189
|
-
cli_utilities_1.log.info('Exporting stack settings', this.exportConfig.context);
|
|
189
|
+
cli_utilities_1.log.info('Exporting stack settings...', this.exportConfig.context);
|
|
190
190
|
await utils_1.fsUtil.makeDirectory(this.stackFolderPath);
|
|
191
191
|
return this.stack
|
|
192
192
|
.settings()
|
|
@@ -22,12 +22,12 @@ class ExportTaxonomies extends base_class_1.default {
|
|
|
22
22
|
}
|
|
23
23
|
async start() {
|
|
24
24
|
var _a;
|
|
25
|
-
cli_utilities_1.log.debug('Starting
|
|
25
|
+
cli_utilities_1.log.debug('Starting export process for taxonomies...', this.exportConfig.context);
|
|
26
26
|
//create taxonomies folder
|
|
27
27
|
this.taxonomiesFolderPath = (0, node_path_1.resolve)(this.exportConfig.data, this.exportConfig.branchName || '', this.taxonomiesConfig.dirName);
|
|
28
|
-
cli_utilities_1.log.debug(`Taxonomies folder path: ${this.taxonomiesFolderPath}`, this.exportConfig.context);
|
|
28
|
+
cli_utilities_1.log.debug(`Taxonomies folder path: '${this.taxonomiesFolderPath}'`, this.exportConfig.context);
|
|
29
29
|
await utils_1.fsUtil.makeDirectory(this.taxonomiesFolderPath);
|
|
30
|
-
cli_utilities_1.log.debug('Created taxonomies directory', this.exportConfig.context);
|
|
30
|
+
cli_utilities_1.log.debug('Created taxonomies directory.', this.exportConfig.context);
|
|
31
31
|
const localesToExport = this.getLocalesToExport();
|
|
32
32
|
cli_utilities_1.log.debug(`Will attempt to export taxonomies for ${localesToExport.length} locale(s): ${localesToExport.join(', ')}`, this.exportConfig.context);
|
|
33
33
|
if (localesToExport.length === 0) {
|
|
@@ -38,7 +38,10 @@ class ExportTaxonomies extends base_class_1.default {
|
|
|
38
38
|
const masterLocale = (_a = this.exportConfig.master_locale) === null || _a === void 0 ? void 0 : _a.code;
|
|
39
39
|
await this.fetchTaxonomies(masterLocale, true);
|
|
40
40
|
if (!this.isLocaleBasedExportSupported) {
|
|
41
|
-
|
|
41
|
+
this.taxonomies = {};
|
|
42
|
+
this.taxonomiesByLocale = {};
|
|
43
|
+
// Fetch taxonomies without locale parameter
|
|
44
|
+
await this.fetchTaxonomies();
|
|
42
45
|
await this.exportTaxonomies();
|
|
43
46
|
await this.writeTaxonomiesMetadata();
|
|
44
47
|
}
|
|
@@ -122,10 +125,18 @@ class ExportTaxonomies extends base_class_1.default {
|
|
|
122
125
|
}
|
|
123
126
|
catch (error) {
|
|
124
127
|
cli_utilities_1.log.debug(`Error fetching taxonomies ${localeInfo}`, this.exportConfig.context);
|
|
125
|
-
|
|
126
|
-
|
|
128
|
+
if (checkLocaleSupport && this.isLocalePlanLimitationError(error)) {
|
|
129
|
+
cli_utilities_1.log.debug('Taxonomy localization is not included in your plan. Falling back to non-localized export.', this.exportConfig.context);
|
|
127
130
|
this.isLocaleBasedExportSupported = false;
|
|
128
131
|
}
|
|
132
|
+
else if (checkLocaleSupport) {
|
|
133
|
+
cli_utilities_1.log.debug('Locale-based taxonomy export not supported, will use legacy method', this.exportConfig.context);
|
|
134
|
+
this.isLocaleBasedExportSupported = false;
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
// Log actual errors during normal fetch (not locale check)
|
|
138
|
+
(0, cli_utilities_1.handleAndLogError)(error, Object.assign(Object.assign({}, this.exportConfig.context), (localeCode && { locale: localeCode })));
|
|
139
|
+
}
|
|
129
140
|
// Break to avoid infinite retry loop on errors
|
|
130
141
|
break;
|
|
131
142
|
}
|
|
@@ -234,5 +245,11 @@ class ExportTaxonomies extends base_class_1.default {
|
|
|
234
245
|
cli_utilities_1.log.debug(`Total unique locales to export: ${localesToExport.length}`, this.exportConfig.context);
|
|
235
246
|
return localesToExport;
|
|
236
247
|
}
|
|
248
|
+
isLocalePlanLimitationError(error) {
|
|
249
|
+
var _a, _b;
|
|
250
|
+
return ((error === null || error === void 0 ? void 0 : error.status) === 403 &&
|
|
251
|
+
((_b = (_a = error === null || error === void 0 ? void 0 : error.errors) === null || _a === void 0 ? void 0 : _a.taxonomies) === null || _b === void 0 ? void 0 : _b.some((msg) => msg.toLowerCase().includes('taxonomy localization') &&
|
|
252
|
+
msg.toLowerCase().includes('not included in your plan'))));
|
|
253
|
+
}
|
|
237
254
|
}
|
|
238
255
|
exports.default = ExportTaxonomies;
|
|
@@ -140,7 +140,7 @@ class ExportWorkFlows extends base_class_1.default {
|
|
|
140
140
|
.catch((err) => {
|
|
141
141
|
cli_utilities_1.log.debug(`Failed to fetch role data for UID: ${roleUid}`, this.exportConfig.context);
|
|
142
142
|
(0, cli_utilities_1.handleAndLogError)(err, Object.assign({}, this.exportConfig.context));
|
|
143
|
-
|
|
143
|
+
return undefined; // Return undefined instead of throwing to handle gracefully
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
}
|
|
@@ -147,6 +147,12 @@ export default interface DefaultConfig {
|
|
|
147
147
|
fileName: string;
|
|
148
148
|
dependencies?: Modules[];
|
|
149
149
|
};
|
|
150
|
+
'composable-studio': {
|
|
151
|
+
dirName: string;
|
|
152
|
+
fileName: string;
|
|
153
|
+
apiBaseUrl: string;
|
|
154
|
+
apiVersion: string;
|
|
155
|
+
};
|
|
150
156
|
masterLocale: {
|
|
151
157
|
dirName: string;
|
|
152
158
|
fileName: string;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export interface Region {
|
|
|
26
26
|
cda: string;
|
|
27
27
|
uiHost: string;
|
|
28
28
|
}
|
|
29
|
-
export type Modules = 'stack' | 'assets' | 'locales' | 'environments' | 'extensions' | 'webhooks' | 'global-fields' | 'entries' | 'content-types' | 'custom-roles' | 'workflows' | 'labels' | 'marketplace-apps' | 'taxonomies' | 'personalize';
|
|
29
|
+
export type Modules = 'stack' | 'assets' | 'locales' | 'environments' | 'extensions' | 'webhooks' | 'global-fields' | 'entries' | 'content-types' | 'custom-roles' | 'workflows' | 'labels' | 'marketplace-apps' | 'taxonomies' | 'personalize' | 'composable-studio';
|
|
30
30
|
export type ModuleClassParams = {
|
|
31
31
|
stackAPIClient: ReturnType<ContentstackClient['stack']>;
|
|
32
32
|
exportConfig: ExportConfig;
|
|
@@ -96,6 +96,32 @@ export interface StackConfig {
|
|
|
96
96
|
dependencies?: Modules[];
|
|
97
97
|
limit?: number;
|
|
98
98
|
}
|
|
99
|
+
export interface ComposableStudioConfig {
|
|
100
|
+
dirName: string;
|
|
101
|
+
fileName: string;
|
|
102
|
+
apiBaseUrl: string;
|
|
103
|
+
apiVersion: string;
|
|
104
|
+
}
|
|
105
|
+
export interface ComposableStudioProject {
|
|
106
|
+
name: string;
|
|
107
|
+
description: string;
|
|
108
|
+
canvasUrl: string;
|
|
109
|
+
connectedStackApiKey: string;
|
|
110
|
+
contentTypeUid: string;
|
|
111
|
+
organizationUid: string;
|
|
112
|
+
settings: {
|
|
113
|
+
configuration: {
|
|
114
|
+
environment: string;
|
|
115
|
+
locale: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
createdBy: string;
|
|
119
|
+
updatedBy: string;
|
|
120
|
+
deletedAt: boolean;
|
|
121
|
+
createdAt: string;
|
|
122
|
+
updatedAt: string;
|
|
123
|
+
uid: string;
|
|
124
|
+
}
|
|
99
125
|
export interface Context {
|
|
100
126
|
command: string;
|
|
101
127
|
module: string;
|
package/lib/utils/basic-login.js
CHANGED
|
@@ -10,20 +10,23 @@ const interactive_1 = require("./interactive");
|
|
|
10
10
|
const basic_login_1 = tslib_1.__importDefault(require("./basic-login"));
|
|
11
11
|
const lodash_1 = require("lodash");
|
|
12
12
|
const setupConfig = async (exportCmdFlags) => {
|
|
13
|
+
// Set progress supported module FIRST, before any log calls
|
|
14
|
+
// This ensures the logger respects the showConsoleLogs setting correctly
|
|
15
|
+
cli_utilities_1.configHandler.set('log.progressSupportedModule', 'export');
|
|
13
16
|
let config = (0, merge_1.default)({}, config_1.default);
|
|
14
17
|
// Track authentication method
|
|
15
18
|
let authenticationMethod = 'unknown';
|
|
16
19
|
cli_utilities_1.log.debug('Setting up export configuration');
|
|
17
20
|
// setup the config
|
|
18
21
|
if (exportCmdFlags['config']) {
|
|
19
|
-
cli_utilities_1.log.debug('Loading external configuration file', { configFile: exportCmdFlags['config'] });
|
|
22
|
+
cli_utilities_1.log.debug('Loading external configuration file...', { configFile: exportCmdFlags['config'] });
|
|
20
23
|
const externalConfig = await (0, file_helper_1.readFile)(exportCmdFlags['config']);
|
|
21
24
|
config = merge_1.default.recursive(config, externalConfig);
|
|
22
25
|
}
|
|
23
26
|
config.exportDir = (0, cli_utilities_1.sanitizePath)(exportCmdFlags['data'] || exportCmdFlags['data-dir'] || config.data || (await (0, interactive_1.askExportDir)()));
|
|
24
27
|
const pattern = /[*$%#<>{}!&?]/g;
|
|
25
28
|
if (pattern.test(config.exportDir)) {
|
|
26
|
-
cli_utilities_1.cliux.print(`\nPlease
|
|
29
|
+
cli_utilities_1.cliux.print(`\nPlease enter a directory path without any special characters: (*,&,{,},[,],$,%,<,>,?,!)`, {
|
|
27
30
|
color: 'yellow',
|
|
28
31
|
});
|
|
29
32
|
config.exportDir = (0, cli_utilities_1.sanitizePath)(await (0, interactive_1.askExportDir)());
|
|
@@ -40,7 +43,7 @@ const setupConfig = async (exportCmdFlags) => {
|
|
|
40
43
|
config.apiKey = apiKey;
|
|
41
44
|
authenticationMethod = 'Management Token';
|
|
42
45
|
if (!config.management_token) {
|
|
43
|
-
cli_utilities_1.log.debug('Management token not found for alias', { alias: managementTokenAlias });
|
|
46
|
+
cli_utilities_1.log.debug('Management token not found for alias!', { alias: managementTokenAlias });
|
|
44
47
|
throw new Error(`No management token found on given alias ${managementTokenAlias}`);
|
|
45
48
|
}
|
|
46
49
|
cli_utilities_1.log.debug('Management token configuration successful');
|
|
@@ -73,7 +76,7 @@ const setupConfig = async (exportCmdFlags) => {
|
|
|
73
76
|
config.apiKey =
|
|
74
77
|
exportCmdFlags['stack-uid'] || exportCmdFlags['stack-api-key'] || config.source_stack || (await (0, interactive_1.askAPIKey)());
|
|
75
78
|
if (typeof config.apiKey !== 'string') {
|
|
76
|
-
cli_utilities_1.log.debug('Invalid API key received', { apiKey: config.apiKey });
|
|
79
|
+
cli_utilities_1.log.debug('Invalid API key received!', { apiKey: config.apiKey });
|
|
77
80
|
throw new Error('Invalid API key received');
|
|
78
81
|
}
|
|
79
82
|
}
|
|
@@ -119,11 +122,9 @@ const setupConfig = async (exportCmdFlags) => {
|
|
|
119
122
|
throw new Error(`Invalid query format: ${error.message}`);
|
|
120
123
|
}
|
|
121
124
|
}
|
|
122
|
-
// Set progress supported module to check and display console logs
|
|
123
|
-
cli_utilities_1.configHandler.set('log.progressSupportedModule', 'export');
|
|
124
125
|
// Add authentication details to config for context tracking
|
|
125
126
|
config.authenticationMethod = authenticationMethod;
|
|
126
|
-
cli_utilities_1.log.debug('Export configuration setup completed', Object.assign({}, config));
|
|
127
|
+
cli_utilities_1.log.debug('Export configuration setup completed.', Object.assign({}, config));
|
|
127
128
|
return config;
|
|
128
129
|
};
|
|
129
130
|
exports.default = setupConfig;
|
package/lib/utils/file-helper.js
CHANGED
|
@@ -22,10 +22,8 @@ async function createNodeCryptoInstance(config) {
|
|
|
22
22
|
if (config.forceStopMarketplaceAppsPrompt) {
|
|
23
23
|
cryptoArgs['encryptionKey'] = config.marketplaceAppEncryptionKey;
|
|
24
24
|
}
|
|
25
|
-
else if (config.marketplaceAppEncryptionKey) {
|
|
26
|
-
cryptoArgs['encryptionKey'] = config.marketplaceAppEncryptionKey;
|
|
27
|
-
}
|
|
28
25
|
else {
|
|
26
|
+
// Always prompt when forceStopMarketplaceAppsPrompt is false, using existing key as default
|
|
29
27
|
cli_utilities_1.cliux.print('');
|
|
30
28
|
cryptoArgs['encryptionKey'] = await askEncryptionKey(config);
|
|
31
29
|
cli_utilities_1.cliux.print('');
|
package/messages/index.json
CHANGED
|
@@ -1,71 +1,77 @@
|
|
|
1
1
|
{
|
|
2
|
-
"ASSET_EXPORT_COMPLETE": "Asset export process completed successfully",
|
|
3
|
-
"ASSET_FOLDERS_EXPORT_COMPLETE": "Asset folder structure exported successfully with %s folder(s)",
|
|
4
|
-
"ASSET_METADATA_EXPORT_COMPLETE": "Asset metadata exported successfully",
|
|
5
|
-
"ASSET_VERSIONED_METADATA_EXPORT_COMPLETE": "Versioned asset metadata exported successfully",
|
|
6
|
-
"ASSET_DOWNLOAD_COMPLETE": "Asset download completed successfully",
|
|
7
|
-
"ASSET_DOWNLOAD_SUCCESS": "Asset '%s' (UID: %s) downloaded successfully",
|
|
8
|
-
"ASSET_DOWNLOAD_FAILED": "Failed to download asset '%s' (UID: %s)",
|
|
9
|
-
"ASSET_WRITE_FAILED": "Failed to write asset file '%s' (UID: %s)",
|
|
10
|
-
"ASSET_QUERY_FAILED": "Failed to query asset data from the API",
|
|
11
|
-
"ASSET_VERSIONED_QUERY_FAILED": "Failed to query versioned asset data from the API",
|
|
12
|
-
"ASSET_COUNT_QUERY_FAILED": "Failed to retrieve total asset count",
|
|
13
|
-
|
|
14
|
-
"CONTENT_TYPE_EXPORT_COMPLETE": "Content types exported successfully",
|
|
15
|
-
"CONTENT_TYPE_NO_TYPES": "No content types found",
|
|
16
|
-
"CONTENT_TYPE_EXPORT_FAILED": "Failed to export content types",
|
|
17
|
-
"CONTENT_TYPE_NO_TYPES_RETURNED": "API returned no content types for the given query",
|
|
18
|
-
|
|
19
|
-
"ENVIRONMENT_EXPORT_COMPLETE": "Successfully exported %s environment(s)",
|
|
20
|
-
"ENVIRONMENT_EXPORT_SUCCESS": "Environment '%s' exported successfully",
|
|
21
|
-
"ENVIRONMENT_NOT_FOUND": "No environments found in the current stack",
|
|
22
|
-
|
|
23
|
-
"EXTENSION_EXPORT_COMPLETE": "Successfully exported %s extension(s)",
|
|
24
|
-
"EXTENSION_EXPORT_SUCCESS": "Extension '%s' exported successfully",
|
|
25
|
-
"EXTENSION_NOT_FOUND": "No extensions found in the current stack",
|
|
26
|
-
|
|
27
|
-
"GLOBAL_FIELDS_EXPORT_COMPLETE": "Successfully exported %s global field(s)",
|
|
28
|
-
|
|
29
|
-
"LABELS_EXPORT_COMPLETE": "Successfully exported %s label(s)",
|
|
30
|
-
"LABEL_EXPORT_SUCCESS": "Label '%s' exported successfully",
|
|
31
|
-
"LABELS_NOT_FOUND": "No labels found in the current stack",
|
|
32
|
-
|
|
33
|
-
"LOCALES_EXPORT_COMPLETE": "Successfully exported %s locale(s) including %s master locale(s)",
|
|
34
|
-
|
|
35
|
-
"TAXONOMY_EXPORT_COMPLETE": "Successfully exported %s taxonomy entries",
|
|
36
|
-
"TAXONOMY_EXPORT_SUCCESS": "Taxonomy '%s' exported successfully",
|
|
37
|
-
"TAXONOMY_NOT_FOUND": "No taxonomies found in the current stack",
|
|
38
|
-
|
|
39
|
-
"WEBHOOK_EXPORT_COMPLETE": "Successfully exported %s webhook(s)",
|
|
40
|
-
"WEBHOOK_EXPORT_SUCCESS": "Webhook '%s' exported successfully",
|
|
41
|
-
"WEBHOOK_NOT_FOUND": "No webhooks found in the current stack",
|
|
42
|
-
|
|
43
|
-
"WORKFLOW_EXPORT_COMPLETE": "Successfully exported %s workflow(s)",
|
|
44
|
-
"WORKFLOW_EXPORT_SUCCESS": "Workflow '%s' exported successfully",
|
|
45
|
-
"WORKFLOW_NOT_FOUND": "No workflows found in the current stack",
|
|
46
|
-
|
|
47
|
-
"PERSONALIZE_URL_NOT_SET": "Cannot export Personalize project: URL not configured",
|
|
48
|
-
"PERSONALIZE_SKIPPING_WITH_MANAGEMENT_TOKEN": "Skipping Personalize project export: Management token not supported",
|
|
49
|
-
"PERSONALIZE_MODULE_NOT_IMPLEMENTED": "Module '%s' implementation not found",
|
|
50
|
-
"PERSONALIZE_NOT_ENABLED": "Personalize feature is not enabled for this organization",
|
|
51
|
-
|
|
52
|
-
"MARKETPLACE_APPS_EXPORT_COMPLETE": "Successfully exported %s marketplace app(s)",
|
|
53
|
-
"MARKETPLACE_APP_CONFIG_EXPORT": "Exporting configuration for app '%s'",
|
|
54
|
-
"MARKETPLACE_APP_CONFIG_SUCCESS": "Successfully exported configuration for app '%s'",
|
|
55
|
-
"MARKETPLACE_APP_EXPORT_SUCCESS": "Successfully exported app '%s'",
|
|
56
|
-
"MARKETPLACE_APPS_NOT_FOUND": "No marketplace apps found in the current stack",
|
|
57
|
-
"MARKETPLACE_APP_CONFIG_EXPORT_FAILED": "Failed to export configuration for app '%s'",
|
|
58
|
-
"MARKETPLACE_APP_MANIFEST_EXPORT_FAILED": "Failed to export manifest for app '%s'",
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"
|
|
68
|
-
"
|
|
2
|
+
"ASSET_EXPORT_COMPLETE": "Asset export process completed successfully",
|
|
3
|
+
"ASSET_FOLDERS_EXPORT_COMPLETE": "Asset folder structure exported successfully with %s folder(s)",
|
|
4
|
+
"ASSET_METADATA_EXPORT_COMPLETE": "Asset metadata exported successfully",
|
|
5
|
+
"ASSET_VERSIONED_METADATA_EXPORT_COMPLETE": "Versioned asset metadata exported successfully",
|
|
6
|
+
"ASSET_DOWNLOAD_COMPLETE": "Asset download completed successfully",
|
|
7
|
+
"ASSET_DOWNLOAD_SUCCESS": "Asset '%s' (UID: %s) downloaded successfully",
|
|
8
|
+
"ASSET_DOWNLOAD_FAILED": "Failed to download asset '%s' (UID: %s)",
|
|
9
|
+
"ASSET_WRITE_FAILED": "Failed to write asset file '%s' (UID: %s)",
|
|
10
|
+
"ASSET_QUERY_FAILED": "Failed to query asset data from the API",
|
|
11
|
+
"ASSET_VERSIONED_QUERY_FAILED": "Failed to query versioned asset data from the API",
|
|
12
|
+
"ASSET_COUNT_QUERY_FAILED": "Failed to retrieve total asset count",
|
|
13
|
+
|
|
14
|
+
"CONTENT_TYPE_EXPORT_COMPLETE": "Content types exported successfully",
|
|
15
|
+
"CONTENT_TYPE_NO_TYPES": "No content types found",
|
|
16
|
+
"CONTENT_TYPE_EXPORT_FAILED": "Failed to export content types",
|
|
17
|
+
"CONTENT_TYPE_NO_TYPES_RETURNED": "API returned no content types for the given query",
|
|
18
|
+
|
|
19
|
+
"ENVIRONMENT_EXPORT_COMPLETE": "Successfully exported %s environment(s)",
|
|
20
|
+
"ENVIRONMENT_EXPORT_SUCCESS": "Environment '%s' exported successfully",
|
|
21
|
+
"ENVIRONMENT_NOT_FOUND": "No environments found in the current stack",
|
|
22
|
+
|
|
23
|
+
"EXTENSION_EXPORT_COMPLETE": "Successfully exported %s extension(s)",
|
|
24
|
+
"EXTENSION_EXPORT_SUCCESS": "Extension '%s' exported successfully",
|
|
25
|
+
"EXTENSION_NOT_FOUND": "No extensions found in the current stack",
|
|
26
|
+
|
|
27
|
+
"GLOBAL_FIELDS_EXPORT_COMPLETE": "Successfully exported %s global field(s)",
|
|
28
|
+
|
|
29
|
+
"LABELS_EXPORT_COMPLETE": "Successfully exported %s label(s)",
|
|
30
|
+
"LABEL_EXPORT_SUCCESS": "Label '%s' exported successfully",
|
|
31
|
+
"LABELS_NOT_FOUND": "No labels found in the current stack",
|
|
32
|
+
|
|
33
|
+
"LOCALES_EXPORT_COMPLETE": "Successfully exported %s locale(s) including %s master locale(s)",
|
|
34
|
+
|
|
35
|
+
"TAXONOMY_EXPORT_COMPLETE": "Successfully exported %s taxonomy entries",
|
|
36
|
+
"TAXONOMY_EXPORT_SUCCESS": "Taxonomy '%s' exported successfully",
|
|
37
|
+
"TAXONOMY_NOT_FOUND": "No taxonomies found in the current stack",
|
|
38
|
+
|
|
39
|
+
"WEBHOOK_EXPORT_COMPLETE": "Successfully exported %s webhook(s)",
|
|
40
|
+
"WEBHOOK_EXPORT_SUCCESS": "Webhook '%s' exported successfully",
|
|
41
|
+
"WEBHOOK_NOT_FOUND": "No webhooks found in the current stack",
|
|
42
|
+
|
|
43
|
+
"WORKFLOW_EXPORT_COMPLETE": "Successfully exported %s workflow(s)",
|
|
44
|
+
"WORKFLOW_EXPORT_SUCCESS": "Workflow '%s' exported successfully",
|
|
45
|
+
"WORKFLOW_NOT_FOUND": "No workflows found in the current stack",
|
|
46
|
+
|
|
47
|
+
"PERSONALIZE_URL_NOT_SET": "Cannot export Personalize project: URL not configured",
|
|
48
|
+
"PERSONALIZE_SKIPPING_WITH_MANAGEMENT_TOKEN": "Skipping Personalize project export: Management token not supported",
|
|
49
|
+
"PERSONALIZE_MODULE_NOT_IMPLEMENTED": "Module '%s' implementation not found",
|
|
50
|
+
"PERSONALIZE_NOT_ENABLED": "Personalize feature is not enabled for this organization",
|
|
51
|
+
|
|
52
|
+
"MARKETPLACE_APPS_EXPORT_COMPLETE": "Successfully exported %s marketplace app(s)",
|
|
53
|
+
"MARKETPLACE_APP_CONFIG_EXPORT": "Exporting configuration for app '%s'",
|
|
54
|
+
"MARKETPLACE_APP_CONFIG_SUCCESS": "Successfully exported configuration for app '%s'",
|
|
55
|
+
"MARKETPLACE_APP_EXPORT_SUCCESS": "Successfully exported app '%s'",
|
|
56
|
+
"MARKETPLACE_APPS_NOT_FOUND": "No marketplace apps found in the current stack",
|
|
57
|
+
"MARKETPLACE_APP_CONFIG_EXPORT_FAILED": "Failed to export configuration for app '%s'",
|
|
58
|
+
"MARKETPLACE_APP_MANIFEST_EXPORT_FAILED": "Failed to export manifest for app '%s'",
|
|
59
|
+
|
|
60
|
+
"COMPOSABLE_STUDIO_EXPORT_START": "Starting Studio project export...",
|
|
61
|
+
"COMPOSABLE_STUDIO_NOT_FOUND": "No Studio project found for this stack",
|
|
62
|
+
"COMPOSABLE_STUDIO_EXPORT_COMPLETE": "Successfully exported Studio project '%s'",
|
|
63
|
+
"COMPOSABLE_STUDIO_EXPORT_FAILED": "Failed to export Studio project: %s",
|
|
64
|
+
"COMPOSABLE_STUDIO_AUTH_REQUIRED": "To export Studio projects, you must be logged in",
|
|
65
|
+
|
|
66
|
+
"ENTRIES_EXPORT_COMPLETE": "Successfully exported entries (Content Type: %s, Locale: %s)",
|
|
67
|
+
"ENTRIES_EXPORT_SUCCESS": "All entries exported successfully",
|
|
68
|
+
"ENTRIES_VERSIONED_EXPORT_SUCCESS": "Successfully exported versioned entry (Content Type: %s, UID: %s, Locale: %s)",
|
|
69
|
+
"ENTRIES_EXPORT_VERSIONS_FAILED": "Failed to export versions for content type '%s' (UID: %s)",
|
|
70
|
+
|
|
71
|
+
"BRANCH_EXPORT_FAILED": "Failed to export contents from branch (UID: %s)",
|
|
72
|
+
|
|
73
|
+
"ROLES_NO_CUSTOM_ROLES": "No custom roles found in the current stack",
|
|
74
|
+
"ROLES_EXPORTING_ROLE": "Exporting role '%s'",
|
|
69
75
|
|
|
70
76
|
"GLOBAL_FIELDS_NOT_FOUND": "No global fields found in the current stack"
|
|
71
77
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"commands": {
|
|
3
3
|
"cm:stacks:export": {
|
|
4
|
-
"aliases": [
|
|
5
|
-
"cm:export"
|
|
6
|
-
],
|
|
4
|
+
"aliases": [],
|
|
7
5
|
"args": {},
|
|
8
6
|
"description": "Export content from a stack",
|
|
9
7
|
"examples": [
|
|
@@ -24,15 +22,6 @@
|
|
|
24
22
|
"multiple": false,
|
|
25
23
|
"type": "option"
|
|
26
24
|
},
|
|
27
|
-
"stack-uid": {
|
|
28
|
-
"char": "s",
|
|
29
|
-
"description": "API key of the source stack",
|
|
30
|
-
"hidden": true,
|
|
31
|
-
"name": "stack-uid",
|
|
32
|
-
"hasDynamicHelp": false,
|
|
33
|
-
"multiple": false,
|
|
34
|
-
"type": "option"
|
|
35
|
-
},
|
|
36
25
|
"stack-api-key": {
|
|
37
26
|
"char": "k",
|
|
38
27
|
"description": "API Key of the source stack",
|
|
@@ -41,14 +30,6 @@
|
|
|
41
30
|
"multiple": false,
|
|
42
31
|
"type": "option"
|
|
43
32
|
},
|
|
44
|
-
"data": {
|
|
45
|
-
"description": "path or location to store the data",
|
|
46
|
-
"hidden": true,
|
|
47
|
-
"name": "data",
|
|
48
|
-
"hasDynamicHelp": false,
|
|
49
|
-
"multiple": false,
|
|
50
|
-
"type": "option"
|
|
51
|
-
},
|
|
52
33
|
"data-dir": {
|
|
53
34
|
"char": "d",
|
|
54
35
|
"description": "The path or the location in your file system to store the exported content. For e.g., ./content",
|
|
@@ -65,32 +46,14 @@
|
|
|
65
46
|
"multiple": false,
|
|
66
47
|
"type": "option"
|
|
67
48
|
},
|
|
68
|
-
"management-token-alias": {
|
|
69
|
-
"description": "alias of the management token",
|
|
70
|
-
"hidden": true,
|
|
71
|
-
"name": "management-token-alias",
|
|
72
|
-
"hasDynamicHelp": false,
|
|
73
|
-
"multiple": false,
|
|
74
|
-
"type": "option"
|
|
75
|
-
},
|
|
76
|
-
"auth-token": {
|
|
77
|
-
"char": "A",
|
|
78
|
-
"description": "to use auth token",
|
|
79
|
-
"hidden": true,
|
|
80
|
-
"name": "auth-token",
|
|
81
|
-
"allowNo": false,
|
|
82
|
-
"type": "boolean"
|
|
83
|
-
},
|
|
84
49
|
"module": {
|
|
85
|
-
"
|
|
86
|
-
"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, and taxonomies.",
|
|
50
|
+
"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 studio.",
|
|
87
51
|
"name": "module",
|
|
88
52
|
"hasDynamicHelp": false,
|
|
89
53
|
"multiple": false,
|
|
90
54
|
"type": "option"
|
|
91
55
|
},
|
|
92
56
|
"content-types": {
|
|
93
|
-
"char": "t",
|
|
94
57
|
"description": "[optional] The UID of the content type(s) whose content you want to export. In case of multiple content types, specify the IDs separated by spaces.",
|
|
95
58
|
"name": "content-types",
|
|
96
59
|
"hasDynamicHelp": false,
|
|
@@ -98,7 +61,6 @@
|
|
|
98
61
|
"type": "option"
|
|
99
62
|
},
|
|
100
63
|
"branch": {
|
|
101
|
-
"char": "B",
|
|
102
64
|
"description": "[optional] The name of the branch where you want to export your content. If you don't mention the branch name, then by default the content will be exported from all the branches of your stack.",
|
|
103
65
|
"exclusive": [
|
|
104
66
|
"branch-alias"
|
|
@@ -148,7 +110,7 @@
|
|
|
148
110
|
"pluginName": "@contentstack/cli-cm-export",
|
|
149
111
|
"pluginType": "core",
|
|
150
112
|
"strict": true,
|
|
151
|
-
"usage": "cm:stacks:export [
|
|
113
|
+
"usage": "cm:stacks:export [--config <value>] [--stack-api-key <value>] [--data-dir <value>] [--alias <value>] [--module <value>] [--content-types <value>] [--branch <value>] [--secured-assets]",
|
|
152
114
|
"isESM": false,
|
|
153
115
|
"relativePath": [
|
|
154
116
|
"lib",
|
|
@@ -159,5 +121,5 @@
|
|
|
159
121
|
]
|
|
160
122
|
}
|
|
161
123
|
},
|
|
162
|
-
"version": "2.0.0-beta.
|
|
124
|
+
"version": "2.0.0-beta.4"
|
|
163
125
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-cm-export",
|
|
3
3
|
"description": "Contentstack CLI plugin to export content from stack",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.4",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@contentstack/cli-command": "~1.
|
|
9
|
-
"@contentstack/cli-variants": "~2.0.0-beta",
|
|
8
|
+
"@contentstack/cli-command": "~1.7.0",
|
|
10
9
|
"@oclif/core": "^4.3.3",
|
|
10
|
+
"@contentstack/cli-variants": "~2.0.0-beta.3",
|
|
11
11
|
"@contentstack/cli-utilities": "~1.15.0",
|
|
12
12
|
"async": "^3.2.6",
|
|
13
13
|
"big-json": "^3.2.0",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"winston": "^3.17.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@contentstack/cli-auth": "~1.6.
|
|
25
|
-
"@contentstack/cli-config": "~1.15.
|
|
24
|
+
"@contentstack/cli-auth": "~1.6.2",
|
|
25
|
+
"@contentstack/cli-config": "~1.15.3",
|
|
26
26
|
"@contentstack/cli-dev-dependencies": "~1.3.1",
|
|
27
27
|
"@oclif/plugin-help": "^6.2.28",
|
|
28
28
|
"@oclif/test": "^4.1.13",
|
|
@@ -89,12 +89,8 @@
|
|
|
89
89
|
"repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-export/<%- commandPath %>"
|
|
90
90
|
},
|
|
91
91
|
"csdxConfig": {
|
|
92
|
-
"expiredCommands": {
|
|
93
|
-
"cm:export": "csdx cm:stacks:export"
|
|
94
|
-
},
|
|
95
92
|
"shortCommandName": {
|
|
96
|
-
"cm:stacks:export": "EXPRT"
|
|
97
|
-
"cm:export": "O-EXPRT"
|
|
93
|
+
"cm:stacks:export": "EXPRT"
|
|
98
94
|
}
|
|
99
95
|
},
|
|
100
96
|
"repository": "https://github.com/contentstack/cli"
|