@contentstack/cli-cm-export 1.5.9 → 1.7.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 +2 -2
- package/lib/commands/cm/stacks/export.d.ts +10 -0
- package/lib/commands/cm/stacks/export.js +108 -0
- package/lib/config/index.d.ts +3 -0
- package/lib/config/index.js +403 -0
- package/lib/export/index.d.ts +1 -0
- package/lib/export/index.js +8 -0
- package/lib/export/module-exporter.d.ts +15 -0
- package/lib/export/module-exporter.js +93 -0
- package/lib/export/modules/assets.d.ts +54 -0
- package/lib/export/modules/assets.js +303 -0
- package/lib/export/modules/base-class.d.ts +48 -0
- package/lib/export/modules/base-class.js +117 -0
- package/lib/export/modules/content-types.d.ts +15 -0
- package/lib/export/modules/content-types.js +72 -0
- package/lib/export/modules/custom-roles.d.ts +16 -0
- package/lib/export/modules/custom-roles.js +81 -0
- package/lib/export/modules/environments.d.ts +12 -0
- package/lib/export/modules/environments.js +64 -0
- package/lib/export/modules/extensions.d.ts +12 -0
- package/lib/export/modules/extensions.js +64 -0
- package/lib/export/modules/global-fields.d.ts +14 -0
- package/lib/export/modules/global-fields.js +59 -0
- package/lib/export/modules/index.d.ts +3 -0
- package/lib/export/modules/index.js +38 -0
- package/lib/export/modules/labels.d.ts +12 -0
- package/lib/export/modules/labels.js +64 -0
- package/lib/export/modules/locales.d.ts +16 -0
- package/lib/export/modules/locales.js +68 -0
- package/lib/export/modules/marketplace-apps.d.ts +18 -0
- package/lib/export/modules/marketplace-apps.js +119 -0
- package/lib/export/modules/webhooks.d.ts +12 -0
- package/lib/export/modules/webhooks.js +63 -0
- package/lib/export/modules-js/assets.d.ts +43 -0
- package/lib/export/modules-js/assets.js +391 -0
- package/lib/export/modules-js/content-types.d.ts +21 -0
- package/lib/export/modules-js/content-types.js +75 -0
- package/lib/export/modules-js/custom-roles.d.ts +21 -0
- package/lib/export/modules-js/custom-roles.js +76 -0
- package/lib/export/modules-js/entries.d.ts +18 -0
- package/lib/export/modules-js/entries.js +141 -0
- package/lib/export/modules-js/environments.d.ts +16 -0
- package/lib/export/modules-js/environments.js +62 -0
- package/lib/export/modules-js/extensions.d.ts +18 -0
- package/lib/export/modules-js/extensions.js +57 -0
- package/lib/export/modules-js/global-fields.d.ts +22 -0
- package/lib/export/modules-js/global-fields.js +107 -0
- package/lib/export/modules-js/index.d.ts +2 -0
- package/lib/export/modules-js/index.js +31 -0
- package/lib/export/modules-js/labels.d.ts +14 -0
- package/lib/export/modules-js/labels.js +56 -0
- package/lib/export/modules-js/locales.d.ts +23 -0
- package/lib/export/modules-js/locales.js +67 -0
- package/lib/export/modules-js/marketplace-apps.d.ts +20 -0
- package/lib/export/modules-js/marketplace-apps.js +125 -0
- package/lib/export/modules-js/stack.d.ts +18 -0
- package/lib/export/modules-js/stack.js +91 -0
- package/lib/export/modules-js/webhooks.d.ts +18 -0
- package/lib/export/modules-js/webhooks.js +60 -0
- package/lib/export/modules-js/workflows.d.ts +16 -0
- package/lib/export/modules-js/workflows.js +89 -0
- package/lib/types/default-config.d.ts +158 -0
- package/lib/types/default-config.js +2 -0
- package/lib/types/export-config.d.ts +36 -0
- package/lib/types/export-config.js +2 -0
- package/lib/types/index.d.ts +88 -0
- package/lib/types/index.js +2 -0
- package/lib/utils/basic-login.d.ts +8 -0
- package/lib/utils/basic-login.js +45 -0
- package/lib/utils/common-helper.d.ts +11 -0
- package/lib/utils/common-helper.js +78 -0
- package/lib/utils/export-config-handler.d.ts +3 -0
- package/lib/utils/export-config-handler.js +72 -0
- package/lib/utils/file-helper.d.ts +14 -0
- package/lib/utils/file-helper.js +120 -0
- package/lib/utils/index.d.ts +10 -0
- package/lib/utils/index.js +21 -0
- package/lib/utils/interactive.d.ts +7 -0
- package/lib/utils/interactive.js +84 -0
- package/lib/utils/logger.d.ts +8 -0
- package/lib/utils/logger.js +154 -0
- package/lib/utils/marketplace-app-helper.d.ts +11 -0
- package/lib/utils/marketplace-app-helper.js +55 -0
- package/lib/utils/setup-branches.d.ts +3 -0
- package/lib/utils/setup-branches.js +49 -0
- package/lib/utils/setup-export-dir.d.ts +2 -0
- package/lib/utils/setup-export-dir.js +12 -0
- package/messages/index.json +1 -7
- package/oclif.manifest.json +1 -1
- package/package.json +38 -23
- package/src/app.js +0 -156
- package/src/commands/cm/stacks/export.js +0 -202
- package/src/config/default.js +0 -360
- package/src/lib/export/assets.js +0 -454
- package/src/lib/export/content-types.js +0 -90
- package/src/lib/export/custom-roles.js +0 -92
- package/src/lib/export/entries.js +0 -200
- package/src/lib/export/environments.js +0 -74
- package/src/lib/export/extensions.js +0 -69
- package/src/lib/export/global-fields.js +0 -122
- package/src/lib/export/labels.js +0 -67
- package/src/lib/export/locales.js +0 -72
- package/src/lib/export/marketplace-apps.js +0 -187
- package/src/lib/export/stack.js +0 -98
- package/src/lib/export/webhooks.js +0 -76
- package/src/lib/export/workflows.js +0 -106
- package/src/lib/util/export-flags.js +0 -193
- package/src/lib/util/helper.js +0 -113
- package/src/lib/util/index.js +0 -80
- package/src/lib/util/log.js +0 -161
- package/src/lib/util/login.js +0 -79
- package/src/lib/util/marketplace-app-helper.js +0 -24
- package/src/lib/util/setup-branches.js +0 -56
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const keys_1 = tslib_1.__importDefault(require("lodash/keys"));
|
|
5
|
+
const find_1 = tslib_1.__importDefault(require("lodash/find"));
|
|
6
|
+
const forEach_1 = tslib_1.__importDefault(require("lodash/forEach"));
|
|
7
|
+
const values_1 = tslib_1.__importDefault(require("lodash/values"));
|
|
8
|
+
const node_path_1 = require("node:path");
|
|
9
|
+
const config_1 = tslib_1.__importDefault(require("../../config"));
|
|
10
|
+
const base_class_1 = tslib_1.__importDefault(require("./base-class"));
|
|
11
|
+
const utils_1 = require("../../utils");
|
|
12
|
+
class ExportCustomRoles extends base_class_1.default {
|
|
13
|
+
constructor({ exportConfig, stackAPIClient }) {
|
|
14
|
+
super({ exportConfig, stackAPIClient });
|
|
15
|
+
this.customRoles = {};
|
|
16
|
+
this.customRolesConfig = config_1.default.modules.customRoles;
|
|
17
|
+
this.existingRoles = { Admin: 1, Developer: 1, 'Content Manager': 1 };
|
|
18
|
+
this.localesMap = {};
|
|
19
|
+
this.sourceLocalesMap = {};
|
|
20
|
+
}
|
|
21
|
+
async start() {
|
|
22
|
+
(0, utils_1.log)(this.exportConfig, 'Starting custom roles export', 'info');
|
|
23
|
+
this.rolesFolderPath = (0, node_path_1.resolve)(this.exportConfig.data, this.exportConfig.branchName || '', this.customRolesConfig.dirName);
|
|
24
|
+
await utils_1.fsUtil.makeDirectory(this.rolesFolderPath);
|
|
25
|
+
this.customRolesLocalesFilepath = (0, node_path_1.resolve)(this.rolesFolderPath, this.customRolesConfig.customRolesLocalesFileName);
|
|
26
|
+
await this.getCustomRoles();
|
|
27
|
+
await this.getLocales();
|
|
28
|
+
await this.getCustomRolesLocales();
|
|
29
|
+
}
|
|
30
|
+
async getCustomRoles() {
|
|
31
|
+
const roles = await this.stack
|
|
32
|
+
.role()
|
|
33
|
+
.fetchAll({ include_rules: true, include_permissions: true })
|
|
34
|
+
.then((data) => data)
|
|
35
|
+
.catch((err) => (0, utils_1.log)(this.exportConfig, `Failed to fetch roles. ${(0, utils_1.formatError)(err)}`, 'error'));
|
|
36
|
+
const customRoles = roles.items.filter((role) => !this.existingRoles[role.name]);
|
|
37
|
+
if (!customRoles.length) {
|
|
38
|
+
(0, utils_1.log)(this.exportConfig, 'No custom roles were found in the Stack', 'info');
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
customRoles.forEach((role) => {
|
|
42
|
+
(0, utils_1.log)(this.exportConfig, `'${role === null || role === void 0 ? void 0 : role.name}' role was exported successfully`, 'info');
|
|
43
|
+
this.customRoles[role.uid] = role;
|
|
44
|
+
});
|
|
45
|
+
utils_1.fsUtil.writeFile((0, node_path_1.resolve)(this.rolesFolderPath, this.customRolesConfig.fileName), this.customRoles);
|
|
46
|
+
}
|
|
47
|
+
async getLocales() {
|
|
48
|
+
const locales = await this.stack
|
|
49
|
+
.locale()
|
|
50
|
+
.query({})
|
|
51
|
+
.find()
|
|
52
|
+
.then((data) => data)
|
|
53
|
+
.catch((err) => (0, utils_1.log)(this.exportConfig, `Failed to fetch locales. ${(0, utils_1.formatError)(err)}`, 'error'));
|
|
54
|
+
for (const locale of locales.items) {
|
|
55
|
+
this.sourceLocalesMap[locale.uid] = locale;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async getCustomRolesLocales() {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
for (const role of (0, values_1.default)(this.customRoles)) {
|
|
61
|
+
const customRole = role;
|
|
62
|
+
const rulesLocales = (0, find_1.default)(customRole.rules, (rule) => rule.module === 'locale');
|
|
63
|
+
if ((_a = rulesLocales === null || rulesLocales === void 0 ? void 0 : rulesLocales.locales) === null || _a === void 0 ? void 0 : _a.length) {
|
|
64
|
+
(0, forEach_1.default)(rulesLocales.locales, (locale) => {
|
|
65
|
+
this.localesMap[locale] = 1;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if ((_b = (0, keys_1.default)(this.localesMap)) === null || _b === void 0 ? void 0 : _b.length) {
|
|
70
|
+
for (const locale in this.localesMap) {
|
|
71
|
+
if (this.sourceLocalesMap[locale] !== undefined) {
|
|
72
|
+
const sourceLocale = this.sourceLocalesMap[locale];
|
|
73
|
+
sourceLocale === null || sourceLocale === void 0 ? true : delete sourceLocale.stackHeaders;
|
|
74
|
+
}
|
|
75
|
+
this.localesMap[locale] = this.sourceLocalesMap[locale];
|
|
76
|
+
}
|
|
77
|
+
utils_1.fsUtil.writeFile(this.customRolesLocalesFilepath, this.localesMap);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.default = ExportCustomRoles;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import BaseClass from './base-class';
|
|
2
|
+
import { ModuleClassParams } from '../../types';
|
|
3
|
+
export default class ExportEnvironments extends BaseClass {
|
|
4
|
+
private environments;
|
|
5
|
+
private environmentConfig;
|
|
6
|
+
environmentsFolderPath: string;
|
|
7
|
+
private qs;
|
|
8
|
+
constructor({ exportConfig, stackAPIClient }: ModuleClassParams);
|
|
9
|
+
start(): Promise<void>;
|
|
10
|
+
getEnvironments(skip?: number): Promise<void>;
|
|
11
|
+
sanitizeAttribs(environments: Record<string, string>[]): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
|
+
const omit_1 = tslib_1.__importDefault(require("lodash/omit"));
|
|
6
|
+
const isEmpty_1 = tslib_1.__importDefault(require("lodash/isEmpty"));
|
|
7
|
+
const config_1 = tslib_1.__importDefault(require("../../config"));
|
|
8
|
+
const base_class_1 = tslib_1.__importDefault(require("./base-class"));
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
class ExportEnvironments extends base_class_1.default {
|
|
11
|
+
constructor({ exportConfig, stackAPIClient }) {
|
|
12
|
+
super({ exportConfig, stackAPIClient });
|
|
13
|
+
this.environments = {};
|
|
14
|
+
this.environmentConfig = config_1.default.modules.environments;
|
|
15
|
+
this.qs = { include_count: true };
|
|
16
|
+
}
|
|
17
|
+
async start() {
|
|
18
|
+
(0, utils_1.log)(this.exportConfig, 'Starting environment export', 'info');
|
|
19
|
+
this.environmentsFolderPath = (0, node_path_1.resolve)(this.exportConfig.data, this.exportConfig.branchName || '', this.environmentConfig.dirName);
|
|
20
|
+
await utils_1.fsUtil.makeDirectory(this.environmentsFolderPath);
|
|
21
|
+
await this.getEnvironments();
|
|
22
|
+
if (this.environments === undefined || (0, isEmpty_1.default)(this.environments)) {
|
|
23
|
+
(0, utils_1.log)(this.exportConfig, 'No environments found', 'info');
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
utils_1.fsUtil.writeFile((0, node_path_1.resolve)(this.environmentsFolderPath, this.environmentConfig.fileName), this.environments);
|
|
27
|
+
(0, utils_1.log)(this.exportConfig, 'All the environments have been exported successfully!', 'success');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async getEnvironments(skip = 0) {
|
|
31
|
+
if (skip) {
|
|
32
|
+
this.qs.skip = skip;
|
|
33
|
+
}
|
|
34
|
+
await this.stack
|
|
35
|
+
.environment()
|
|
36
|
+
.query(this.qs)
|
|
37
|
+
.find()
|
|
38
|
+
.then(async (data) => {
|
|
39
|
+
const { items, count } = data;
|
|
40
|
+
if (items === null || items === void 0 ? void 0 : items.length) {
|
|
41
|
+
this.sanitizeAttribs(items);
|
|
42
|
+
skip += this.environmentConfig.limit || 100;
|
|
43
|
+
if (skip >= count) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
return await this.getEnvironments(skip);
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
.catch((error) => {
|
|
50
|
+
(0, utils_1.log)(this.exportConfig, `Failed to export environments. ${(0, utils_1.formatError)(error)}`, 'error');
|
|
51
|
+
(0, utils_1.log)(this.exportConfig, error, 'error');
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
sanitizeAttribs(environments) {
|
|
55
|
+
var _a;
|
|
56
|
+
for (let index = 0; index < (environments === null || environments === void 0 ? void 0 : environments.length); index++) {
|
|
57
|
+
const extUid = environments[index].uid;
|
|
58
|
+
const envName = (_a = environments[index]) === null || _a === void 0 ? void 0 : _a.name;
|
|
59
|
+
this.environments[extUid] = (0, omit_1.default)(environments[index], ['ACL']);
|
|
60
|
+
(0, utils_1.log)(this.exportConfig, `'${envName}' environment was exported successfully`, 'success');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.default = ExportEnvironments;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import BaseClass from './base-class';
|
|
2
|
+
import { ExtensionsConfig, ModuleClassParams } from '../../types';
|
|
3
|
+
export default class ExportExtensions extends BaseClass {
|
|
4
|
+
private extensionsFolderPath;
|
|
5
|
+
private extensions;
|
|
6
|
+
extensionConfig: ExtensionsConfig;
|
|
7
|
+
private qs;
|
|
8
|
+
constructor({ exportConfig, stackAPIClient }: ModuleClassParams);
|
|
9
|
+
start(): Promise<void>;
|
|
10
|
+
getExtensions(skip?: number): Promise<void>;
|
|
11
|
+
sanitizeAttribs(extensions: Record<string, string>[]): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const omit_1 = tslib_1.__importDefault(require("lodash/omit"));
|
|
5
|
+
const isEmpty_1 = tslib_1.__importDefault(require("lodash/isEmpty"));
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const config_1 = tslib_1.__importDefault(require("../../config"));
|
|
8
|
+
const base_class_1 = tslib_1.__importDefault(require("./base-class"));
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
class ExportExtensions extends base_class_1.default {
|
|
11
|
+
constructor({ exportConfig, stackAPIClient }) {
|
|
12
|
+
super({ exportConfig, stackAPIClient });
|
|
13
|
+
this.extensions = {};
|
|
14
|
+
this.extensionConfig = config_1.default.modules.extensions;
|
|
15
|
+
this.qs = { include_count: true };
|
|
16
|
+
}
|
|
17
|
+
async start() {
|
|
18
|
+
(0, utils_1.log)(this.exportConfig, 'Starting extension export', 'info');
|
|
19
|
+
this.extensionsFolderPath = (0, node_path_1.resolve)(this.exportConfig.data, this.exportConfig.branchName || '', this.extensionConfig.dirName);
|
|
20
|
+
await utils_1.fsUtil.makeDirectory(this.extensionsFolderPath);
|
|
21
|
+
await this.getExtensions();
|
|
22
|
+
if (this.extensions === undefined || (0, isEmpty_1.default)(this.extensions)) {
|
|
23
|
+
(0, utils_1.log)(this.exportConfig, 'No extensions found', 'info');
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
utils_1.fsUtil.writeFile((0, node_path_1.resolve)(this.extensionsFolderPath, this.extensionConfig.fileName), this.extensions);
|
|
27
|
+
(0, utils_1.log)(this.exportConfig, 'All the extensions have been exported successfully!', 'success');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async getExtensions(skip = 0) {
|
|
31
|
+
if (skip) {
|
|
32
|
+
this.qs.skip = skip;
|
|
33
|
+
}
|
|
34
|
+
await this.stack
|
|
35
|
+
.extension()
|
|
36
|
+
.query(this.qs)
|
|
37
|
+
.find()
|
|
38
|
+
.then(async (data) => {
|
|
39
|
+
const { items, count } = data;
|
|
40
|
+
if (items === null || items === void 0 ? void 0 : items.length) {
|
|
41
|
+
this.sanitizeAttribs(items);
|
|
42
|
+
skip += this.extensionConfig.limit || 100;
|
|
43
|
+
if (skip >= count) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
return await this.getExtensions(skip);
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
.catch((error) => {
|
|
50
|
+
(0, utils_1.log)(this.exportConfig, `Failed to export extensions. ${(0, utils_1.formatError)(error)}`, 'error');
|
|
51
|
+
(0, utils_1.log)(this.exportConfig, error, 'error');
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
sanitizeAttribs(extensions) {
|
|
55
|
+
var _a;
|
|
56
|
+
for (let index = 0; index < (extensions === null || extensions === void 0 ? void 0 : extensions.length); index++) {
|
|
57
|
+
const extUid = extensions[index].uid;
|
|
58
|
+
const extTitle = (_a = extensions[index]) === null || _a === void 0 ? void 0 : _a.title;
|
|
59
|
+
this.extensions[extUid] = (0, omit_1.default)(extensions[index], ['SYS_ACL']);
|
|
60
|
+
(0, utils_1.log)(this.exportConfig, `'${extTitle}' extension was exported successfully`, 'success');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.default = ExportExtensions;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ExportConfig, ModuleClassParams } from '../../types';
|
|
2
|
+
import BaseClass from './base-class';
|
|
3
|
+
export default class GlobalFieldsExport extends BaseClass {
|
|
4
|
+
private stackAPIClient;
|
|
5
|
+
exportConfig: ExportConfig;
|
|
6
|
+
private qs;
|
|
7
|
+
private globalFieldsConfig;
|
|
8
|
+
private globalFieldsDirPath;
|
|
9
|
+
private globalFields;
|
|
10
|
+
constructor({ exportConfig, stackAPIClient }: ModuleClassParams);
|
|
11
|
+
start(): Promise<void>;
|
|
12
|
+
getGlobalFields(skip?: number): Promise<any>;
|
|
13
|
+
sanitizeAttribs(globalFields: Record<string, string>[]): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const path = tslib_1.__importStar(require("path"));
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
6
|
+
const base_class_1 = tslib_1.__importDefault(require("./base-class"));
|
|
7
|
+
class GlobalFieldsExport extends base_class_1.default {
|
|
8
|
+
constructor({ exportConfig, stackAPIClient }) {
|
|
9
|
+
super({ exportConfig, stackAPIClient });
|
|
10
|
+
this.stackAPIClient = stackAPIClient;
|
|
11
|
+
this.globalFieldsConfig = exportConfig.modules['global-fields'];
|
|
12
|
+
this.qs = {
|
|
13
|
+
skip: 0,
|
|
14
|
+
asc: 'updated_at',
|
|
15
|
+
include_count: true,
|
|
16
|
+
limit: this.globalFieldsConfig.limit,
|
|
17
|
+
};
|
|
18
|
+
this.globalFieldsDirPath = path.resolve(exportConfig.data, exportConfig.branchName || '', this.globalFieldsConfig.dirName);
|
|
19
|
+
this.globalFields = [];
|
|
20
|
+
}
|
|
21
|
+
async start() {
|
|
22
|
+
try {
|
|
23
|
+
(0, utils_1.log)(this.exportConfig, 'Starting global fields export', 'success');
|
|
24
|
+
await utils_1.fsUtil.makeDirectory(this.globalFieldsDirPath);
|
|
25
|
+
await this.getGlobalFields();
|
|
26
|
+
utils_1.fsUtil.writeFile(path.join(this.globalFieldsDirPath, this.globalFieldsConfig.fileName), this.globalFields);
|
|
27
|
+
(0, utils_1.log)(this.exportConfig, 'Completed global fields export', 'success');
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
(0, utils_1.log)(this.exportConfig, `Failed to export global fields. ${(0, utils_1.formatError)(error)}`, 'error');
|
|
31
|
+
throw new Error('Failed to export global fields');
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async getGlobalFields(skip = 0) {
|
|
35
|
+
if (skip) {
|
|
36
|
+
this.qs.skip = skip;
|
|
37
|
+
}
|
|
38
|
+
let globalFieldsFetchResponse = await this.stackAPIClient.globalField().query(this.qs).find();
|
|
39
|
+
if (Array.isArray(globalFieldsFetchResponse.items) && globalFieldsFetchResponse.items.length > 0) {
|
|
40
|
+
this.sanitizeAttribs(globalFieldsFetchResponse.items);
|
|
41
|
+
skip += this.globalFieldsConfig.limit || 100;
|
|
42
|
+
if (skip >= globalFieldsFetchResponse.count) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
return await this.getGlobalFields(skip);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
sanitizeAttribs(globalFields) {
|
|
49
|
+
globalFields.forEach((globalField) => {
|
|
50
|
+
for (let key in globalField) {
|
|
51
|
+
if (this.globalFieldsConfig.validKeys.indexOf(key) === -1) {
|
|
52
|
+
delete globalField[key];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
this.globalFields.push(globalField);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.default = GlobalFieldsExport;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
var _a;
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.ExportAssets = void 0;
|
|
31
|
+
async function startModuleExport(modulePayload) {
|
|
32
|
+
const { default: ModuleRunner } = await (_a = `./${modulePayload.moduleName}`, Promise.resolve().then(() => __importStar(require(_a))));
|
|
33
|
+
const moduleRunner = new ModuleRunner(modulePayload);
|
|
34
|
+
return moduleRunner.start();
|
|
35
|
+
}
|
|
36
|
+
exports.default = startModuleExport;
|
|
37
|
+
var assets_1 = require("./assets");
|
|
38
|
+
Object.defineProperty(exports, "ExportAssets", { enumerable: true, get: function () { return __importDefault(assets_1).default; } });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import BaseClass from './base-class';
|
|
2
|
+
import { ModuleClassParams } from '../../types';
|
|
3
|
+
export default class ExportLabels extends BaseClass {
|
|
4
|
+
private labels;
|
|
5
|
+
private labelConfig;
|
|
6
|
+
labelsFolderPath: string;
|
|
7
|
+
private qs;
|
|
8
|
+
constructor({ exportConfig, stackAPIClient }: ModuleClassParams);
|
|
9
|
+
start(): Promise<void>;
|
|
10
|
+
getLabels(skip?: number): Promise<void>;
|
|
11
|
+
sanitizeAttribs(labels: Record<string, string>[]): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const omit_1 = tslib_1.__importDefault(require("lodash/omit"));
|
|
5
|
+
const isEmpty_1 = tslib_1.__importDefault(require("lodash/isEmpty"));
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const config_1 = tslib_1.__importDefault(require("../../config"));
|
|
8
|
+
const base_class_1 = tslib_1.__importDefault(require("./base-class"));
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
class ExportLabels extends base_class_1.default {
|
|
11
|
+
constructor({ exportConfig, stackAPIClient }) {
|
|
12
|
+
super({ exportConfig, stackAPIClient });
|
|
13
|
+
this.labels = {};
|
|
14
|
+
this.labelConfig = config_1.default.modules.labels;
|
|
15
|
+
this.qs = { include_count: true };
|
|
16
|
+
}
|
|
17
|
+
async start() {
|
|
18
|
+
(0, utils_1.log)(this.exportConfig, 'Starting labels export', 'info');
|
|
19
|
+
this.labelsFolderPath = (0, node_path_1.resolve)(this.exportConfig.data, this.exportConfig.branchName || '', this.labelConfig.dirName);
|
|
20
|
+
await utils_1.fsUtil.makeDirectory(this.labelsFolderPath);
|
|
21
|
+
await this.getLabels();
|
|
22
|
+
if (this.labels === undefined || (0, isEmpty_1.default)(this.labels)) {
|
|
23
|
+
(0, utils_1.log)(this.exportConfig, 'No labels found', 'info');
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
utils_1.fsUtil.writeFile((0, node_path_1.resolve)(this.labelsFolderPath, this.labelConfig.fileName), this.labels);
|
|
27
|
+
(0, utils_1.log)(this.exportConfig, 'All the labels have been exported successfully!', 'success');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async getLabels(skip = 0) {
|
|
31
|
+
if (skip) {
|
|
32
|
+
this.qs.skip = skip;
|
|
33
|
+
}
|
|
34
|
+
await this.stack
|
|
35
|
+
.label()
|
|
36
|
+
.query(this.qs)
|
|
37
|
+
.find()
|
|
38
|
+
.then(async (data) => {
|
|
39
|
+
const { items, count } = data;
|
|
40
|
+
if (items === null || items === void 0 ? void 0 : items.length) {
|
|
41
|
+
this.sanitizeAttribs(items);
|
|
42
|
+
skip += this.labelConfig.limit || 100;
|
|
43
|
+
if (skip >= count) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
return await this.getLabels(skip);
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
.catch((error) => {
|
|
50
|
+
(0, utils_1.log)(this.exportConfig, `Failed to export labels. ${(0, utils_1.formatError)(error)}`, 'error');
|
|
51
|
+
(0, utils_1.log)(this.exportConfig, error, 'error');
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
sanitizeAttribs(labels) {
|
|
55
|
+
var _a;
|
|
56
|
+
for (let index = 0; index < (labels === null || labels === void 0 ? void 0 : labels.length); index++) {
|
|
57
|
+
const labelUid = labels[index].uid;
|
|
58
|
+
const labelName = (_a = labels[index]) === null || _a === void 0 ? void 0 : _a.name;
|
|
59
|
+
this.labels[labelUid] = (0, omit_1.default)(labels[index], this.labelConfig.invalidKeys);
|
|
60
|
+
(0, utils_1.log)(this.exportConfig, `'${labelName}' label was exported successfully`, 'success');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.default = ExportLabels;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ExportConfig, ModuleClassParams } from '../../types';
|
|
2
|
+
import BaseClass from './base-class';
|
|
3
|
+
export default class LocaleExport extends BaseClass {
|
|
4
|
+
private stackAPIClient;
|
|
5
|
+
exportConfig: ExportConfig;
|
|
6
|
+
private masterLocaleConfig;
|
|
7
|
+
private qs;
|
|
8
|
+
private localeConfig;
|
|
9
|
+
private localesPath;
|
|
10
|
+
private masterLocale;
|
|
11
|
+
private locales;
|
|
12
|
+
constructor({ exportConfig, stackAPIClient }: ModuleClassParams);
|
|
13
|
+
start(): Promise<void>;
|
|
14
|
+
getLocales(skip?: number): Promise<any>;
|
|
15
|
+
sanitizeAttribs(locales: Record<string, string>[]): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const path = tslib_1.__importStar(require("path"));
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
6
|
+
const base_class_1 = tslib_1.__importDefault(require("./base-class"));
|
|
7
|
+
class LocaleExport extends base_class_1.default {
|
|
8
|
+
constructor({ exportConfig, stackAPIClient }) {
|
|
9
|
+
super({ exportConfig, stackAPIClient });
|
|
10
|
+
this.stackAPIClient = stackAPIClient;
|
|
11
|
+
this.localeConfig = exportConfig.modules.locales;
|
|
12
|
+
this.masterLocaleConfig = exportConfig.modules.masterLocale;
|
|
13
|
+
this.qs = {
|
|
14
|
+
include_count: true,
|
|
15
|
+
asc: 'updated_at',
|
|
16
|
+
only: {
|
|
17
|
+
BASE: this.localeConfig.requiredKeys,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
this.localesPath = path.resolve(exportConfig.data, exportConfig.branchName || '', this.localeConfig.dirName);
|
|
21
|
+
this.locales = {};
|
|
22
|
+
this.masterLocale = {};
|
|
23
|
+
}
|
|
24
|
+
async start() {
|
|
25
|
+
try {
|
|
26
|
+
(0, utils_1.log)(this.exportConfig, 'Starting locale export', 'success');
|
|
27
|
+
await utils_1.fsUtil.makeDirectory(this.localesPath);
|
|
28
|
+
await this.getLocales();
|
|
29
|
+
utils_1.fsUtil.writeFile(path.join(this.localesPath, this.localeConfig.fileName), this.locales);
|
|
30
|
+
utils_1.fsUtil.writeFile(path.join(this.localesPath, this.masterLocaleConfig.fileName), this.masterLocale);
|
|
31
|
+
(0, utils_1.log)(this.exportConfig, 'Completed locale export', 'success');
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
(0, utils_1.log)(this.exportConfig, `Failed to export locales. ${(0, utils_1.formatError)(error)}`, 'error');
|
|
35
|
+
throw new Error('Failed to export locales');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async getLocales(skip = 0) {
|
|
39
|
+
if (skip) {
|
|
40
|
+
this.qs.skip = skip;
|
|
41
|
+
}
|
|
42
|
+
let localesFetchResponse = await this.stackAPIClient.locale().query(this.qs).find();
|
|
43
|
+
if (Array.isArray(localesFetchResponse.items) && localesFetchResponse.items.length > 0) {
|
|
44
|
+
this.sanitizeAttribs(localesFetchResponse.items);
|
|
45
|
+
skip += this.localeConfig.limit || 100;
|
|
46
|
+
if (skip > localesFetchResponse.count) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
return await this.getLocales(skip);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
sanitizeAttribs(locales) {
|
|
53
|
+
locales.forEach((locale) => {
|
|
54
|
+
for (let key in locale) {
|
|
55
|
+
if (this.localeConfig.requiredKeys.indexOf(key) === -1) {
|
|
56
|
+
delete locale[key];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (locale.code === this.exportConfig.master_locale.code) {
|
|
60
|
+
this.masterLocale[locale.uid] = locale;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
this.locales[locale.uid] = locale;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.default = LocaleExport;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NodeCrypto } from '@contentstack/cli-utilities';
|
|
2
|
+
import BaseClass from './base-class';
|
|
3
|
+
import { ModuleClassParams } from '../../types';
|
|
4
|
+
export default class ExportMarketplaceApps extends BaseClass {
|
|
5
|
+
private httpClient;
|
|
6
|
+
private marketplaceAppConfig;
|
|
7
|
+
private listOfApps;
|
|
8
|
+
private installedApps;
|
|
9
|
+
developerHubBaseUrl: string;
|
|
10
|
+
marketplaceAppPath: string;
|
|
11
|
+
nodeCrypto: NodeCrypto;
|
|
12
|
+
constructor({ exportConfig, stackAPIClient }: ModuleClassParams);
|
|
13
|
+
start(): Promise<void>;
|
|
14
|
+
setHttpClient(): Promise<void>;
|
|
15
|
+
getAllStackSpecificApps(skip?: number): Promise<any>;
|
|
16
|
+
exportInstalledExtensions(): Promise<void>;
|
|
17
|
+
getAppConfigurations(index: number, appInstallation: any): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const map_1 = tslib_1.__importDefault(require("lodash/map"));
|
|
5
|
+
const has_1 = tslib_1.__importDefault(require("lodash/has"));
|
|
6
|
+
const find_1 = tslib_1.__importDefault(require("lodash/find"));
|
|
7
|
+
const entries_1 = tslib_1.__importDefault(require("lodash/entries"));
|
|
8
|
+
const isEmpty_1 = tslib_1.__importDefault(require("lodash/isEmpty"));
|
|
9
|
+
const node_path_1 = require("node:path");
|
|
10
|
+
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
11
|
+
const config_1 = tslib_1.__importDefault(require("../../config"));
|
|
12
|
+
const utils_1 = require("../../utils");
|
|
13
|
+
const base_class_1 = tslib_1.__importDefault(require("./base-class"));
|
|
14
|
+
class ExportMarketplaceApps extends base_class_1.default {
|
|
15
|
+
constructor({ exportConfig, stackAPIClient }) {
|
|
16
|
+
super({ exportConfig, stackAPIClient });
|
|
17
|
+
this.httpClient = new cli_utilities_1.HttpClient();
|
|
18
|
+
this.marketplaceAppConfig = config_1.default.modules.marketplace_apps;
|
|
19
|
+
this.listOfApps = [];
|
|
20
|
+
this.installedApps = [];
|
|
21
|
+
}
|
|
22
|
+
async start() {
|
|
23
|
+
if (!(0, cli_utilities_1.isAuthenticated)()) {
|
|
24
|
+
cli_utilities_1.cliux.print('WARNING!!! To export Marketplace apps, you must be logged in. Please check csdx auth:login --help to log in', { color: 'yellow' });
|
|
25
|
+
return Promise.resolve();
|
|
26
|
+
}
|
|
27
|
+
(0, utils_1.log)(this.exportConfig, 'Starting marketplace app export', 'info');
|
|
28
|
+
this.marketplaceAppPath = (0, node_path_1.resolve)(this.exportConfig.data, this.exportConfig.branchName || '', this.marketplaceAppConfig.dirName);
|
|
29
|
+
await utils_1.fsUtil.makeDirectory(this.marketplaceAppPath);
|
|
30
|
+
this.developerHubBaseUrl = this.exportConfig.developerHubBaseUrl || (await (0, utils_1.getDeveloperHubUrl)(this.exportConfig));
|
|
31
|
+
this.exportConfig.org_uid = await (0, utils_1.getOrgUid)(this.exportConfig);
|
|
32
|
+
await this.setHttpClient();
|
|
33
|
+
await this.getAllStackSpecificApps();
|
|
34
|
+
this.installedApps = this.listOfApps;
|
|
35
|
+
await this.exportInstalledExtensions();
|
|
36
|
+
}
|
|
37
|
+
async setHttpClient() {
|
|
38
|
+
if (!this.exportConfig.auth_token) {
|
|
39
|
+
this.httpClient = new cli_utilities_1.OauthDecorator(this.httpClient);
|
|
40
|
+
const headers = await this.httpClient.preHeadersCheck(this.exportConfig);
|
|
41
|
+
this.httpClient = this.httpClient.headers(headers);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
this.httpClient = new cli_utilities_1.HttpClientDecorator(this.httpClient);
|
|
45
|
+
this.httpClient.headers(this.exportConfig);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async getAllStackSpecificApps(skip = 0) {
|
|
49
|
+
const data = await (0, utils_1.getStackSpecificApps)({
|
|
50
|
+
developerHubBaseUrl: this.developerHubBaseUrl,
|
|
51
|
+
httpClient: this.httpClient,
|
|
52
|
+
config: this.exportConfig,
|
|
53
|
+
skip,
|
|
54
|
+
});
|
|
55
|
+
const { data: apps, count } = data;
|
|
56
|
+
if (!this.nodeCrypto && (0, find_1.default)(apps, (app) => (0, isEmpty_1.default)(app.configuration))) {
|
|
57
|
+
this.nodeCrypto = await (0, utils_1.createNodeCryptoInstance)(this.exportConfig);
|
|
58
|
+
}
|
|
59
|
+
const stackApps = (0, map_1.default)(apps, (app) => {
|
|
60
|
+
if ((0, has_1.default)(app, 'configuration')) {
|
|
61
|
+
app['configuration'] = this.nodeCrypto.encrypt(app.configuration);
|
|
62
|
+
}
|
|
63
|
+
return app;
|
|
64
|
+
});
|
|
65
|
+
this.listOfApps = [...this.listOfApps, ...stackApps];
|
|
66
|
+
if (count - (skip + 50) > 0) {
|
|
67
|
+
return await this.getAllStackSpecificApps(skip + 50);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async exportInstalledExtensions() {
|
|
71
|
+
if ((0, isEmpty_1.default)(this.installedApps)) {
|
|
72
|
+
(0, utils_1.log)(this.exportConfig, 'No marketplace apps found', 'info');
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
for (const [index, app] of (0, entries_1.default)(this.installedApps)) {
|
|
76
|
+
await this.getAppConfigurations(+index, app);
|
|
77
|
+
}
|
|
78
|
+
utils_1.fsUtil.writeFile((0, node_path_1.resolve)(this.marketplaceAppPath, this.marketplaceAppConfig.fileName), this.installedApps);
|
|
79
|
+
(0, utils_1.log)(this.exportConfig, 'All the marketplace apps have been exported successfully', 'info');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
async getAppConfigurations(index, appInstallation) {
|
|
83
|
+
var _a, _b;
|
|
84
|
+
const sdkClient = await (0, cli_utilities_1.managementSDKClient)({
|
|
85
|
+
host: this.developerHubBaseUrl.split('://').pop(),
|
|
86
|
+
});
|
|
87
|
+
const appName = (_a = appInstallation === null || appInstallation === void 0 ? void 0 : appInstallation.manifest) === null || _a === void 0 ? void 0 : _a.name;
|
|
88
|
+
(0, utils_1.log)(this.exportConfig, `Exporting ${appName} app and it's config.`, 'info');
|
|
89
|
+
await sdkClient
|
|
90
|
+
.organization(this.exportConfig.org_uid)
|
|
91
|
+
.app((_b = appInstallation === null || appInstallation === void 0 ? void 0 : appInstallation.manifest) === null || _b === void 0 ? void 0 : _b.uid)
|
|
92
|
+
.installation(appInstallation === null || appInstallation === void 0 ? void 0 : appInstallation.uid)
|
|
93
|
+
.installationData()
|
|
94
|
+
.then(async (result) => {
|
|
95
|
+
const { data, error } = result;
|
|
96
|
+
if ((0, has_1.default)(data, 'server_configuration')) {
|
|
97
|
+
if (!this.nodeCrypto && (0, has_1.default)(data, 'server_configuration')) {
|
|
98
|
+
this.nodeCrypto = await (0, utils_1.createNodeCryptoInstance)(this.exportConfig);
|
|
99
|
+
}
|
|
100
|
+
if (!(0, isEmpty_1.default)(data === null || data === void 0 ? void 0 : data.server_configuration)) {
|
|
101
|
+
this.installedApps[index]['server_configuration'] = this.nodeCrypto.encrypt(data.server_configuration);
|
|
102
|
+
(0, utils_1.log)(this.exportConfig, `Exported ${appName} app and it's config.`, 'success');
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
(0, utils_1.log)(this.exportConfig, `Exported ${appName} app`, 'success');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
else if (error) {
|
|
109
|
+
(0, utils_1.log)(this.exportConfig, `Error on exporting ${appName} app and it's config.`, 'error');
|
|
110
|
+
(0, utils_1.log)(this.exportConfig, error, 'error');
|
|
111
|
+
}
|
|
112
|
+
})
|
|
113
|
+
.catch((error) => {
|
|
114
|
+
(0, utils_1.log)(this.exportConfig, `Failed to export ${appName} app config ${(0, utils_1.formatError)(error)}`, 'error');
|
|
115
|
+
(0, utils_1.log)(this.exportConfig, error, 'error');
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
exports.default = ExportMarketplaceApps;
|