@contentstack/cli-cm-export 1.21.0 → 1.22.0
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 +3 -3
- package/lib/commands/cm/stacks/export.js +7 -4
- package/lib/config/index.js +7 -0
- package/lib/export/module-exporter.js +4 -3
- 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 +3 -3
- package/lib/export/modules/custom-roles.js +18 -20
- package/lib/export/modules/entries.js +7 -7
- package/lib/export/modules/environments.js +13 -13
- package/lib/export/modules/extensions.js +16 -16
- package/lib/export/modules/global-fields.js +16 -16
- package/lib/export/modules/labels.js +17 -17
- package/lib/export/modules/locales.js +17 -17
- package/lib/export/modules/marketplace-apps.js +32 -32
- package/lib/export/modules/personalize.js +14 -14
- package/lib/export/modules/stack.js +26 -26
- package/lib/export/modules/taxonomies.d.ts +1 -0
- package/lib/export/modules/taxonomies.js +23 -6
- package/lib/export/modules-js/assets.js +3 -3
- 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 +5 -5
- package/lib/utils/file-helper.js +1 -1
- package/messages/index.json +6 -0
- package/oclif.manifest.json +2 -2
- package/package.json +6 -6
|
@@ -17,20 +17,20 @@ class ExportStack extends base_class_1.default {
|
|
|
17
17
|
async start() {
|
|
18
18
|
cli_utilities_1.log.debug('Starting stack export process...', this.exportConfig.context);
|
|
19
19
|
if ((0, cli_utilities_1.isAuthenticated)()) {
|
|
20
|
-
cli_utilities_1.log.debug('User
|
|
20
|
+
cli_utilities_1.log.debug('User authenticated.', this.exportConfig.context);
|
|
21
21
|
const stackData = await this.getStack();
|
|
22
22
|
if (stackData === null || stackData === void 0 ? void 0 : stackData.org_uid) {
|
|
23
|
-
cli_utilities_1.log.debug(`Found organization UID: ${stackData.org_uid}
|
|
23
|
+
cli_utilities_1.log.debug(`Found organization UID: '${stackData.org_uid}'.`, this.exportConfig.context);
|
|
24
24
|
this.exportConfig.org_uid = stackData.org_uid;
|
|
25
25
|
this.exportConfig.sourceStackName = stackData.name;
|
|
26
|
-
cli_utilities_1.log.debug(`Set source stack name: ${stackData.name}
|
|
26
|
+
cli_utilities_1.log.debug(`Set source stack name: '${stackData.name}'.`, this.exportConfig.context);
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
|
-
cli_utilities_1.log.debug('No stack data found or missing
|
|
29
|
+
cli_utilities_1.log.debug('No stack data found or missing organization UID.', this.exportConfig.context);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
else {
|
|
33
|
-
cli_utilities_1.log.debug('User is not authenticated
|
|
33
|
+
cli_utilities_1.log.debug('User is not authenticated.', this.exportConfig.context);
|
|
34
34
|
}
|
|
35
35
|
if (this.exportConfig.management_token) {
|
|
36
36
|
cli_utilities_1.log.info('Skipping stack settings export: Operation is not supported when using a management token.', this.exportConfig.context);
|
|
@@ -44,61 +44,61 @@ class ExportStack extends base_class_1.default {
|
|
|
44
44
|
return this.getLocales();
|
|
45
45
|
}
|
|
46
46
|
else if (this.exportConfig.preserveStackVersion) {
|
|
47
|
-
cli_utilities_1.log.debug('Preserve stack version is
|
|
47
|
+
cli_utilities_1.log.debug('Preserve stack version is set to true.', this.exportConfig.context);
|
|
48
48
|
return this.exportStack();
|
|
49
49
|
}
|
|
50
50
|
else {
|
|
51
|
-
cli_utilities_1.log.debug('Master locale already set
|
|
51
|
+
cli_utilities_1.log.debug('Master locale is already set.', this.exportConfig.context);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
async getStack() {
|
|
55
|
-
cli_utilities_1.log.debug(`Fetching stack data for
|
|
55
|
+
cli_utilities_1.log.debug(`Fetching stack data for: '${this.exportConfig.source_stack}'...`, this.exportConfig.context);
|
|
56
56
|
const tempAPIClient = await (0, cli_utilities_1.managementSDKClient)({ host: this.exportConfig.host });
|
|
57
|
-
cli_utilities_1.log.debug(`Created
|
|
57
|
+
cli_utilities_1.log.debug(`Created Management SDK client with host: '${this.exportConfig.host}'.`, this.exportConfig.context);
|
|
58
58
|
return await tempAPIClient
|
|
59
59
|
.stack({ api_key: this.exportConfig.source_stack })
|
|
60
60
|
.fetch()
|
|
61
61
|
.then((data) => {
|
|
62
|
-
cli_utilities_1.log.debug(`Successfully fetched stack data for: ${this.exportConfig.source_stack}
|
|
62
|
+
cli_utilities_1.log.debug(`Successfully fetched stack data for: '${this.exportConfig.source_stack}'.`, this.exportConfig.context);
|
|
63
63
|
return data;
|
|
64
64
|
})
|
|
65
65
|
.catch((error) => {
|
|
66
|
-
cli_utilities_1.log.debug(`Failed to fetch stack data for: ${this.exportConfig.source_stack}
|
|
66
|
+
cli_utilities_1.log.debug(`Failed to fetch stack data for: '${this.exportConfig.source_stack}'.`, this.exportConfig.context);
|
|
67
67
|
return {};
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
async getLocales(skip = 0) {
|
|
71
71
|
if (skip) {
|
|
72
72
|
this.qs.skip = skip;
|
|
73
|
-
cli_utilities_1.log.debug(`Fetching locales with skip: ${skip}
|
|
73
|
+
cli_utilities_1.log.debug(`Fetching locales with skip: ${skip}.`, this.exportConfig.context);
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
76
|
-
cli_utilities_1.log.debug('Fetching locales with initial query', this.exportConfig.context);
|
|
76
|
+
cli_utilities_1.log.debug('Fetching locales with initial query...', this.exportConfig.context);
|
|
77
77
|
}
|
|
78
|
-
cli_utilities_1.log.debug(`Query parameters: ${JSON.stringify(this.qs)}
|
|
78
|
+
cli_utilities_1.log.debug(`Query parameters: ${JSON.stringify(this.qs)}.`, this.exportConfig.context);
|
|
79
79
|
return await this.stack
|
|
80
80
|
.locale()
|
|
81
81
|
.query(this.qs)
|
|
82
82
|
.find()
|
|
83
83
|
.then(async (data) => {
|
|
84
84
|
const { items, count } = data;
|
|
85
|
-
cli_utilities_1.log.debug(`Fetched ${(items === null || items === void 0 ? void 0 : items.length) || 0} locales out of
|
|
85
|
+
cli_utilities_1.log.debug(`Fetched ${(items === null || items === void 0 ? void 0 : items.length) || 0} locales out of ${count}.`, this.exportConfig.context);
|
|
86
86
|
if (items === null || items === void 0 ? void 0 : items.length) {
|
|
87
|
-
cli_utilities_1.log.debug(`Processing ${items.length} locales to find master locale
|
|
87
|
+
cli_utilities_1.log.debug(`Processing ${items.length} locales to find the master locale...`, this.exportConfig.context);
|
|
88
88
|
skip += this.stackConfig.limit || 100;
|
|
89
89
|
const masterLocalObj = (0, find_1.default)(items, (locale) => {
|
|
90
90
|
if (locale.fallback_locale === null) {
|
|
91
|
-
cli_utilities_1.log.debug(`Found master locale: ${locale.name} (${locale.code})
|
|
91
|
+
cli_utilities_1.log.debug(`Found master locale: '${locale.name}' (code: ${locale.code}).`, this.exportConfig.context);
|
|
92
92
|
return locale;
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
95
|
if (masterLocalObj) {
|
|
96
|
-
cli_utilities_1.log.debug(`Returning master locale: ${masterLocalObj.name}
|
|
96
|
+
cli_utilities_1.log.debug(`Returning master locale: '${masterLocalObj.name}'.`, this.exportConfig.context);
|
|
97
97
|
return masterLocalObj;
|
|
98
98
|
}
|
|
99
99
|
else if (skip >= count) {
|
|
100
100
|
cli_utilities_1.log.error(`Master locale not found in the stack ${this.exportConfig.source_stack}. Please ensure that the stack has a master locale.`, this.exportConfig.context);
|
|
101
|
-
cli_utilities_1.log.debug('Completed
|
|
101
|
+
cli_utilities_1.log.debug('Completed search. Master locale not found.', this.exportConfig.context);
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
104
|
else {
|
|
@@ -107,7 +107,7 @@ class ExportStack extends base_class_1.default {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
else {
|
|
110
|
-
cli_utilities_1.log.debug('No locales found to process', this.exportConfig.context);
|
|
110
|
+
cli_utilities_1.log.debug('No locales found to process.', this.exportConfig.context);
|
|
111
111
|
}
|
|
112
112
|
})
|
|
113
113
|
.catch((error) => {
|
|
@@ -117,26 +117,26 @@ class ExportStack extends base_class_1.default {
|
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
119
|
async exportStack() {
|
|
120
|
-
cli_utilities_1.log.debug(`Starting stack export for: ${this.exportConfig.source_stack}
|
|
120
|
+
cli_utilities_1.log.debug(`Starting stack export for: '${this.exportConfig.source_stack}'...`, this.exportConfig.context);
|
|
121
121
|
await utils_1.fsUtil.makeDirectory(this.stackFolderPath);
|
|
122
|
-
cli_utilities_1.log.debug(`Created stack directory at: ${this.stackFolderPath}`, this.exportConfig.context);
|
|
122
|
+
cli_utilities_1.log.debug(`Created stack directory at: '${this.stackFolderPath}'`, this.exportConfig.context);
|
|
123
123
|
return this.stack
|
|
124
124
|
.fetch()
|
|
125
125
|
.then((resp) => {
|
|
126
126
|
const stackFilePath = (0, node_path_1.resolve)(this.stackFolderPath, this.stackConfig.fileName);
|
|
127
|
-
cli_utilities_1.log.debug(`Writing stack data to: ${stackFilePath}`, this.exportConfig.context);
|
|
127
|
+
cli_utilities_1.log.debug(`Writing stack data to: '${stackFilePath}'`, this.exportConfig.context);
|
|
128
128
|
utils_1.fsUtil.writeFile(stackFilePath, resp);
|
|
129
129
|
cli_utilities_1.log.success(`Stack details exported successfully for stack ${this.exportConfig.source_stack}`, this.exportConfig.context);
|
|
130
|
-
cli_utilities_1.log.debug('Stack export completed successfully', this.exportConfig.context);
|
|
130
|
+
cli_utilities_1.log.debug('Stack export completed successfully.', this.exportConfig.context);
|
|
131
131
|
return resp;
|
|
132
132
|
})
|
|
133
133
|
.catch((error) => {
|
|
134
|
-
cli_utilities_1.log.debug(`
|
|
134
|
+
cli_utilities_1.log.debug(`An error occurred while exporting stack: '${this.exportConfig.source_stack}'.`, this.exportConfig.context);
|
|
135
135
|
(0, cli_utilities_1.handleAndLogError)(error, Object.assign({}, this.exportConfig.context));
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
async exportStackSettings() {
|
|
139
|
-
cli_utilities_1.log.info('Exporting stack settings', this.exportConfig.context);
|
|
139
|
+
cli_utilities_1.log.info('Exporting stack settings...', this.exportConfig.context);
|
|
140
140
|
await utils_1.fsUtil.makeDirectory(this.stackFolderPath);
|
|
141
141
|
return this.stack
|
|
142
142
|
.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;
|
|
@@ -240,7 +240,7 @@ module.exports = class ExportAssets {
|
|
|
240
240
|
const assetVersionInfo = bucket || [];
|
|
241
241
|
return new Promise((resolve, reject) => {
|
|
242
242
|
if (self.assetDownloadRetry[uid + version] > self.assetDownloadRetryLimit) {
|
|
243
|
-
console.log('Reached
|
|
243
|
+
console.log('Reached the maximum limit.', self.assetDownloadRetry[uid + version]);
|
|
244
244
|
return reject(new Error('Asset Max download retry limit exceeded! ' + uid));
|
|
245
245
|
}
|
|
246
246
|
if (version <= 0) {
|
|
@@ -274,7 +274,7 @@ module.exports = class ExportAssets {
|
|
|
274
274
|
.catch((error) => {
|
|
275
275
|
log(self.config, error, 'error');
|
|
276
276
|
if (error.status === 408) {
|
|
277
|
-
console.log('
|
|
277
|
+
console.log('Retrying...', uid);
|
|
278
278
|
// retrying when timeout
|
|
279
279
|
self.assetDownloadRetry[uid + version]
|
|
280
280
|
? ++self.assetDownloadRetry[uid + version]
|
|
@@ -313,7 +313,7 @@ module.exports = class ExportAssets {
|
|
|
313
313
|
length: assetStreamRequest.headers['content-length'],
|
|
314
314
|
});
|
|
315
315
|
str.on('progress', (progressData) => {
|
|
316
|
-
console.log(`${asset.filename}: ${Math.round(progressData.percentage)}
|
|
316
|
+
console.log(`${asset.filename}: ${Math.round(progressData.percentage)}% complete`);
|
|
317
317
|
});
|
|
318
318
|
assetStreamRequest.pipe(str).pipe(assetFileStream);
|
|
319
319
|
}
|
|
@@ -148,6 +148,12 @@ export default interface DefaultConfig {
|
|
|
148
148
|
fileName: string;
|
|
149
149
|
dependencies?: Modules[];
|
|
150
150
|
};
|
|
151
|
+
'composable-studio': {
|
|
152
|
+
dirName: string;
|
|
153
|
+
fileName: string;
|
|
154
|
+
apiBaseUrl: string;
|
|
155
|
+
apiVersion: string;
|
|
156
|
+
};
|
|
151
157
|
masterLocale: {
|
|
152
158
|
dirName: string;
|
|
153
159
|
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
|
@@ -16,14 +16,14 @@ const setupConfig = async (exportCmdFlags) => {
|
|
|
16
16
|
cli_utilities_1.log.debug('Setting up export configuration');
|
|
17
17
|
// setup the config
|
|
18
18
|
if (exportCmdFlags['config']) {
|
|
19
|
-
cli_utilities_1.log.debug('Loading external configuration file', { configFile: exportCmdFlags['config'] });
|
|
19
|
+
cli_utilities_1.log.debug('Loading external configuration file...', { configFile: exportCmdFlags['config'] });
|
|
20
20
|
const externalConfig = await (0, file_helper_1.readFile)(exportCmdFlags['config']);
|
|
21
21
|
config = merge_1.default.recursive(config, externalConfig);
|
|
22
22
|
}
|
|
23
23
|
config.exportDir = (0, cli_utilities_1.sanitizePath)(exportCmdFlags['data'] || exportCmdFlags['data-dir'] || config.data || (await (0, interactive_1.askExportDir)()));
|
|
24
24
|
const pattern = /[*$%#<>{}!&?]/g;
|
|
25
25
|
if (pattern.test(config.exportDir)) {
|
|
26
|
-
cli_utilities_1.cliux.print(`\nPlease
|
|
26
|
+
cli_utilities_1.cliux.print(`\nPlease enter a directory path without any special characters: (*,&,{,},[,],$,%,<,>,?,!)`, {
|
|
27
27
|
color: 'yellow',
|
|
28
28
|
});
|
|
29
29
|
config.exportDir = (0, cli_utilities_1.sanitizePath)(await (0, interactive_1.askExportDir)());
|
|
@@ -40,7 +40,7 @@ const setupConfig = async (exportCmdFlags) => {
|
|
|
40
40
|
config.apiKey = apiKey;
|
|
41
41
|
authenticationMethod = 'Management Token';
|
|
42
42
|
if (!config.management_token) {
|
|
43
|
-
cli_utilities_1.log.debug('Management token not found for alias', { alias: managementTokenAlias });
|
|
43
|
+
cli_utilities_1.log.debug('Management token not found for alias!', { alias: managementTokenAlias });
|
|
44
44
|
throw new Error(`No management token found on given alias ${managementTokenAlias}`);
|
|
45
45
|
}
|
|
46
46
|
cli_utilities_1.log.debug('Management token configuration successful');
|
|
@@ -73,7 +73,7 @@ const setupConfig = async (exportCmdFlags) => {
|
|
|
73
73
|
config.apiKey =
|
|
74
74
|
exportCmdFlags['stack-uid'] || exportCmdFlags['stack-api-key'] || config.source_stack || (await (0, interactive_1.askAPIKey)());
|
|
75
75
|
if (typeof config.apiKey !== 'string') {
|
|
76
|
-
cli_utilities_1.log.debug('Invalid API key received', { apiKey: config.apiKey });
|
|
76
|
+
cli_utilities_1.log.debug('Invalid API key received!', { apiKey: config.apiKey });
|
|
77
77
|
throw new Error('Invalid API key received');
|
|
78
78
|
}
|
|
79
79
|
}
|
|
@@ -121,7 +121,7 @@ const setupConfig = async (exportCmdFlags) => {
|
|
|
121
121
|
}
|
|
122
122
|
// Add authentication details to config for context tracking
|
|
123
123
|
config.authenticationMethod = authenticationMethod;
|
|
124
|
-
cli_utilities_1.log.debug('Export configuration setup completed', Object.assign({}, config));
|
|
124
|
+
cli_utilities_1.log.debug('Export configuration setup completed.', Object.assign({}, config));
|
|
125
125
|
return config;
|
|
126
126
|
};
|
|
127
127
|
exports.default = setupConfig;
|
package/lib/utils/file-helper.js
CHANGED
package/messages/index.json
CHANGED
|
@@ -57,6 +57,12 @@
|
|
|
57
57
|
"MARKETPLACE_APP_CONFIG_EXPORT_FAILED": "Failed to export configuration for app '%s'",
|
|
58
58
|
"MARKETPLACE_APP_MANIFEST_EXPORT_FAILED": "Failed to export manifest for app '%s'",
|
|
59
59
|
|
|
60
|
+
"COMPOSABLE_STUDIO_EXPORT_START": "Starting Composable Studio project export...",
|
|
61
|
+
"COMPOSABLE_STUDIO_NOT_FOUND": "No Composable Studio project found for this stack",
|
|
62
|
+
"COMPOSABLE_STUDIO_EXPORT_COMPLETE": "Successfully exported Composable Studio project '%s'",
|
|
63
|
+
"COMPOSABLE_STUDIO_EXPORT_FAILED": "Failed to export Composable Studio project: %s",
|
|
64
|
+
"COMPOSABLE_STUDIO_AUTH_REQUIRED": "To export Composable Studio projects, you must be logged in",
|
|
65
|
+
|
|
60
66
|
"ENTRIES_EXPORT_COMPLETE": "Successfully exported entries (Content Type: %s, Locale: %s)",
|
|
61
67
|
"ENTRIES_EXPORT_SUCCESS": "All entries exported successfully",
|
|
62
68
|
"ENTRIES_VERSIONED_EXPORT_SUCCESS": "Successfully exported versioned entry (Content Type: %s, UID: %s, Locale: %s)",
|
package/oclif.manifest.json
CHANGED
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"module": {
|
|
85
85
|
"char": "m",
|
|
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
|
|
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, taxonomies, and composable-studio.",
|
|
87
87
|
"name": "module",
|
|
88
88
|
"hasDynamicHelp": false,
|
|
89
89
|
"multiple": false,
|
|
@@ -159,5 +159,5 @@
|
|
|
159
159
|
]
|
|
160
160
|
}
|
|
161
161
|
},
|
|
162
|
-
"version": "1.
|
|
162
|
+
"version": "1.22.0"
|
|
163
163
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-cm-export",
|
|
3
3
|
"description": "Contentstack CLI plugin to export content from stack",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.22.0",
|
|
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": "~1.3.4",
|
|
8
|
+
"@contentstack/cli-command": "~1.7.0",
|
|
10
9
|
"@oclif/core": "^4.3.3",
|
|
11
|
-
"@contentstack/cli-
|
|
10
|
+
"@contentstack/cli-variants": "~1.3.5",
|
|
11
|
+
"@contentstack/cli-utilities": "~1.15.0",
|
|
12
12
|
"async": "^3.2.6",
|
|
13
13
|
"big-json": "^3.2.0",
|
|
14
14
|
"bluebird": "^3.7.2",
|
|
@@ -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",
|