@contentstack/cli-cm-export 1.16.3 → 1.17.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 +1 -1
- package/lib/config/index.js +7 -1
- package/lib/export/modules/stack.d.ts +1 -0
- package/lib/export/modules/stack.js +21 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ $ npm install -g @contentstack/cli-cm-export
|
|
|
48
48
|
$ csdx COMMAND
|
|
49
49
|
running command...
|
|
50
50
|
$ csdx (--version)
|
|
51
|
-
@contentstack/cli-cm-export/1.
|
|
51
|
+
@contentstack/cli-cm-export/1.17.0 linux-x64 node-v22.16.0
|
|
52
52
|
$ csdx --help [COMMAND]
|
|
53
53
|
USAGE
|
|
54
54
|
$ csdx COMMAND
|
package/lib/config/index.js
CHANGED
|
@@ -149,7 +149,13 @@ const config = {
|
|
|
149
149
|
},
|
|
150
150
|
personalize: {
|
|
151
151
|
baseURL: {
|
|
152
|
-
NA: 'https://personalize-api.contentstack.com',
|
|
152
|
+
'AWS-NA': 'https://personalize-api.contentstack.com',
|
|
153
|
+
'AWS-EU': 'https://eu-personalize-api.contentstack.com',
|
|
154
|
+
'AWS-AU': 'https://au-personalize-api.contentstack.com',
|
|
155
|
+
'AZURE-NA': 'https://azure-na-personalize-api.contentstack.com',
|
|
156
|
+
'AZURE-EU': 'https://azure-eu-personalize-api.contentstack.com',
|
|
157
|
+
'GCP-NA': 'https://gcp-na-personalize-api.contentstack.com',
|
|
158
|
+
'GCP-EU': 'https://gcp-eu-personalize-api.contentstack.com',
|
|
153
159
|
},
|
|
154
160
|
dirName: 'personalize',
|
|
155
161
|
exportOrder: ['attributes', 'audiences', 'events', 'experiences'],
|
|
@@ -11,7 +11,7 @@ class ExportStack extends base_class_1.default {
|
|
|
11
11
|
super({ exportConfig, stackAPIClient });
|
|
12
12
|
this.stackConfig = exportConfig.modules.stack;
|
|
13
13
|
this.qs = { include_count: true };
|
|
14
|
-
this.stackFolderPath = (0, node_path_1.resolve)(this.exportConfig.data, this.stackConfig.dirName);
|
|
14
|
+
this.stackFolderPath = (0, node_path_1.resolve)(this.exportConfig.data, this.exportConfig.branchName || '', this.stackConfig.dirName);
|
|
15
15
|
}
|
|
16
16
|
async start() {
|
|
17
17
|
if ((0, cli_utilities_1.isAuthenticated)()) {
|
|
@@ -21,6 +21,12 @@ class ExportStack extends base_class_1.default {
|
|
|
21
21
|
this.exportConfig.sourceStackName = stackData.name;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
+
if (this.exportConfig.management_token) {
|
|
25
|
+
(0, utils_1.log)(this.exportConfig, 'Skipping stack settings export: Operation is not supported when using a management token.', 'info');
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
await this.exportStackSettings();
|
|
29
|
+
}
|
|
24
30
|
if (!this.exportConfig.preserveStackVersion && !this.exportConfig.hasOwnProperty('master_locale')) {
|
|
25
31
|
//fetch master locale details
|
|
26
32
|
return this.getLocales();
|
|
@@ -84,5 +90,19 @@ class ExportStack extends base_class_1.default {
|
|
|
84
90
|
(0, utils_1.log)(this.exportConfig, `Failed to export stack. ${(0, utils_1.formatError)(error)}`, 'error');
|
|
85
91
|
});
|
|
86
92
|
}
|
|
93
|
+
async exportStackSettings() {
|
|
94
|
+
(0, utils_1.log)(this.exportConfig, 'Exporting stack settings', 'success');
|
|
95
|
+
await utils_1.fsUtil.makeDirectory(this.stackFolderPath);
|
|
96
|
+
return this.stack
|
|
97
|
+
.settings()
|
|
98
|
+
.then((resp) => {
|
|
99
|
+
utils_1.fsUtil.writeFile((0, node_path_1.resolve)(this.stackFolderPath, 'settings.json'), resp);
|
|
100
|
+
(0, utils_1.log)(this.exportConfig, 'Exported stack settings successfully!', 'success');
|
|
101
|
+
return resp;
|
|
102
|
+
})
|
|
103
|
+
.catch((error) => {
|
|
104
|
+
(0, utils_1.log)(this.exportConfig, `Failed to export stack settings. ${(0, utils_1.formatError)(error)}`, 'error');
|
|
105
|
+
});
|
|
106
|
+
}
|
|
87
107
|
}
|
|
88
108
|
exports.default = ExportStack;
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED