@contentstack/cli-cm-export 2.0.0-beta.15 → 2.0.0-beta.16
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 +5 -0
- package/lib/export/module-exporter.js +5 -2
- package/lib/export/modules/assets.js +45 -1
- package/lib/export/modules/stack.js +10 -9
- package/lib/types/default-config.d.ts +9 -0
- package/lib/types/export-config.d.ts +5 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/utils/constants.d.ts +13 -0
- package/lib/utils/constants.js +15 -0
- package/lib/utils/get-linked-workspaces.d.ts +13 -0
- package/lib/utils/get-linked-workspaces.js +32 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +3 -1
- package/lib/utils/progress-strategy-registry.js +18 -0
- package/oclif.manifest.json +1 -1
- package/package.json +5 -4
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/2.0.0-beta.
|
|
51
|
+
@contentstack/cli-cm-export/2.0.0-beta.16 linux-x64 node-v22.22.2
|
|
52
52
|
$ csdx --help [COMMAND]
|
|
53
53
|
USAGE
|
|
54
54
|
$ csdx COMMAND
|
package/lib/config/index.js
CHANGED
|
@@ -112,6 +112,11 @@ const config = {
|
|
|
112
112
|
enableDownloadStatus: false,
|
|
113
113
|
includeVersionedAssets: false,
|
|
114
114
|
},
|
|
115
|
+
'asset-management': {
|
|
116
|
+
chunkFileSizeMb: 1,
|
|
117
|
+
apiConcurrency: 5,
|
|
118
|
+
downloadAssetsConcurrency: 5,
|
|
119
|
+
},
|
|
115
120
|
content_types: {
|
|
116
121
|
dirName: 'content_types',
|
|
117
122
|
fileName: 'content_types.json',
|
|
@@ -35,6 +35,7 @@ class ModuleExporter {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
async exportByBranches() {
|
|
38
|
+
var _a;
|
|
38
39
|
let targetBranch;
|
|
39
40
|
if (this.exportConfig.branchName) {
|
|
40
41
|
// User specified a branch - export only that branch
|
|
@@ -62,8 +63,10 @@ class ModuleExporter {
|
|
|
62
63
|
cli_utilities_1.log.success(`The content of branch ${targetBranch.uid} has been exported successfully!`, this.exportConfig.context);
|
|
63
64
|
}
|
|
64
65
|
catch (error) {
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
const originalMessage = (_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : '';
|
|
67
|
+
const errorMessage = originalMessage || cli_utilities_1.messageHandler.parse('FAILED_EXPORT_CONTENT_BRANCH', { branch: targetBranch === null || targetBranch === void 0 ? void 0 : targetBranch.uid });
|
|
68
|
+
(0, cli_utilities_1.handleAndLogError)(error, Object.assign(Object.assign({}, this.exportConfig.context), { branch: targetBranch === null || targetBranch === void 0 ? void 0 : targetBranch.uid }), errorMessage);
|
|
69
|
+
throw new Error(errorMessage);
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
72
|
async export() {
|
|
@@ -19,6 +19,7 @@ const cli_utilities_2 = require("@contentstack/cli-utilities");
|
|
|
19
19
|
const constants_1 = require("../../constants");
|
|
20
20
|
const config_1 = tslib_1.__importDefault(require("../../config"));
|
|
21
21
|
const base_class_1 = tslib_1.__importDefault(require("./base-class"));
|
|
22
|
+
const cli_asset_management_1 = require("@contentstack/cli-asset-management");
|
|
22
23
|
const utils_1 = require("../../utils");
|
|
23
24
|
class ExportAssets extends base_class_1.default {
|
|
24
25
|
constructor({ exportConfig, stackAPIClient }) {
|
|
@@ -37,7 +38,50 @@ class ExportAssets extends base_class_1.default {
|
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
40
|
async start() {
|
|
40
|
-
|
|
41
|
+
var _a, _b, _c, _d;
|
|
42
|
+
const linkedWorkspaces = (_a = this.exportConfig.linkedWorkspaces) !== null && _a !== void 0 ? _a : [];
|
|
43
|
+
if (linkedWorkspaces.length > 0) {
|
|
44
|
+
const assetManagementUrl = (_b = this.exportConfig.region) === null || _b === void 0 ? void 0 : _b.assetManagementUrl;
|
|
45
|
+
if (!assetManagementUrl) {
|
|
46
|
+
(0, cli_utilities_2.handleAndLogError)(new Error('Asset Management URL is required for AM 2.0 export. Ensure your region is configured with assetManagementUrl.'), Object.assign(Object.assign({}, this.exportConfig.context), { message: 'Asset Management URL is required for AM 2.0 export. Ensure your region is configured with assetManagementUrl.' }));
|
|
47
|
+
this.completeProgressWithMessage({
|
|
48
|
+
moduleName: 'Asset Management 2.0',
|
|
49
|
+
customWarningMessage: 'Asset Management 2.0 export was skipped: assetManagementUrl is not configured. AM 2.0 assets will not be exported.',
|
|
50
|
+
context: this.exportConfig.context,
|
|
51
|
+
});
|
|
52
|
+
cli_utilities_1.cliux.print('Asset Management URL is required for AM 2.0 export. Ensure your region is configured with assetManagementUrl.', { color: 'yellow' });
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
cli_utilities_2.log.debug(`Exporting with AM 2.0: ${assetManagementUrl} (linked_workspaces from exportConfig)`, this.exportConfig.context);
|
|
56
|
+
this.exportConfig.org_uid = this.exportConfig.org_uid || (await (0, utils_1.getOrgUid)(this.exportConfig));
|
|
57
|
+
const progress = this.createNestedProgress(this.currentModuleName);
|
|
58
|
+
try {
|
|
59
|
+
const assetManagementModuleConfig = this.exportConfig.modules['asset-management'];
|
|
60
|
+
const exporter = new cli_asset_management_1.ExportSpaces({
|
|
61
|
+
linkedWorkspaces,
|
|
62
|
+
exportDir: this.exportConfig.exportDir,
|
|
63
|
+
branchName: this.exportConfig.branchName || 'main',
|
|
64
|
+
assetManagementUrl,
|
|
65
|
+
org_uid: (_c = this.exportConfig.org_uid) !== null && _c !== void 0 ? _c : '',
|
|
66
|
+
apiKey: this.exportConfig.apiKey,
|
|
67
|
+
context: this.exportConfig.context,
|
|
68
|
+
securedAssets: this.exportConfig.securedAssets,
|
|
69
|
+
chunkFileSizeMb: assetManagementModuleConfig === null || assetManagementModuleConfig === void 0 ? void 0 : assetManagementModuleConfig.chunkFileSizeMb,
|
|
70
|
+
apiConcurrency: assetManagementModuleConfig === null || assetManagementModuleConfig === void 0 ? void 0 : assetManagementModuleConfig.apiConcurrency,
|
|
71
|
+
downloadAssetsConcurrency: assetManagementModuleConfig === null || assetManagementModuleConfig === void 0 ? void 0 : assetManagementModuleConfig.downloadAssetsConcurrency,
|
|
72
|
+
});
|
|
73
|
+
exporter.setParentProgressManager(progress);
|
|
74
|
+
await exporter.start();
|
|
75
|
+
this.completeProgressWithMessage();
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
this.completeProgress(false, (_d = error === null || error === void 0 ? void 0 : error.message) !== null && _d !== void 0 ? _d : 'Asset Management export failed');
|
|
79
|
+
throw error;
|
|
80
|
+
}
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
cli_utilities_2.log.debug('Using legacy asset export (no linked_workspaces in exportConfig)', this.exportConfig.context);
|
|
84
|
+
this.assetsRootPath = (0, node_path_1.resolve)(this.exportConfig.exportDir, this.exportConfig.branchName || '', (this.assetsRootPath = (0, node_path_1.resolve)((0, utils_1.getExportBasePath)(this.exportConfig), this.assetConfig.dirName)));
|
|
41
85
|
cli_utilities_2.log.debug(`Assets root path resolved to: ${this.assetsRootPath}`, this.exportConfig.context);
|
|
42
86
|
cli_utilities_2.log.debug('Fetching assets and folders count...', this.exportConfig.context);
|
|
43
87
|
// NOTE step 1: Get assets and it's folder count in parallel
|
|
@@ -196,10 +196,7 @@ class ExportStack extends base_class_1.default {
|
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
198
|
isStackFetchPayload(data) {
|
|
199
|
-
return
|
|
200
|
-
data !== null &&
|
|
201
|
-
!Array.isArray(data) &&
|
|
202
|
-
('api_key' in data || 'uid' in data));
|
|
199
|
+
return typeof data === 'object' && data !== null && !Array.isArray(data) && ('api_key' in data || 'uid' in data);
|
|
203
200
|
}
|
|
204
201
|
/**
|
|
205
202
|
* Management-token exports cannot use Stack CMA endpoints for full metadata; write api_key from config only.
|
|
@@ -234,13 +231,17 @@ class ExportStack extends base_class_1.default {
|
|
|
234
231
|
await utils_1.fsUtil.makeDirectory(this.stackFolderPath);
|
|
235
232
|
return this.stack
|
|
236
233
|
.settings()
|
|
237
|
-
.then((resp) => {
|
|
238
|
-
var _a;
|
|
239
|
-
|
|
234
|
+
.then(async (resp) => {
|
|
235
|
+
var _a, _b;
|
|
236
|
+
const linked = await (0, utils_1.getLinkedWorkspacesForBranch)(this.stack, this.exportConfig.branchName || 'main', this.exportConfig.context);
|
|
237
|
+
const settings = Object.assign(Object.assign({}, resp), { am_v2: Object.assign(Object.assign({}, ((_a = resp.am_v2) !== null && _a !== void 0 ? _a : {})), { linked_workspaces: linked }) });
|
|
238
|
+
utils_1.fsUtil.writeFile((0, node_path_1.resolve)(this.stackFolderPath, constants_1.PATH_CONSTANTS.FILES.SETTINGS), settings);
|
|
239
|
+
this.exportConfig.linkedWorkspaces = linked;
|
|
240
240
|
// Track progress for stack settings completion
|
|
241
|
-
(
|
|
241
|
+
(_b = this.progressManager) === null || _b === void 0 ? void 0 : _b.tick(true, 'stack settings', null, utils_1.PROCESS_NAMES.STACK_SETTINGS);
|
|
242
|
+
cli_utilities_1.log.debug(`Included ${linked.length} linked workspace(s) in settings`, this.exportConfig.context);
|
|
242
243
|
cli_utilities_1.log.success('Exported stack settings successfully!', this.exportConfig.context);
|
|
243
|
-
return
|
|
244
|
+
return settings;
|
|
244
245
|
})
|
|
245
246
|
.catch((error) => {
|
|
246
247
|
var _a;
|
|
@@ -84,6 +84,15 @@ export default interface DefaultConfig {
|
|
|
84
84
|
includeVersionedAssets: boolean;
|
|
85
85
|
dependencies?: Modules[];
|
|
86
86
|
};
|
|
87
|
+
'asset-management': {
|
|
88
|
+
/** Passed to FsUtility chunkFileSize (MB) when writing chunked export JSON. */
|
|
89
|
+
chunkFileSizeMb: number;
|
|
90
|
+
/** Shared export concurrency fallback used by AM 2.0 export. */
|
|
91
|
+
apiConcurrency: number;
|
|
92
|
+
/** Parallel downloads per AM workspace export. */
|
|
93
|
+
downloadAssetsConcurrency: number;
|
|
94
|
+
dependencies?: Modules[];
|
|
95
|
+
};
|
|
87
96
|
content_types: {
|
|
88
97
|
dirName: string;
|
|
89
98
|
fileName: string;
|
|
@@ -34,6 +34,11 @@ export default interface ExportConfig extends DefaultConfig {
|
|
|
34
34
|
skipStackSettings?: boolean;
|
|
35
35
|
skipDependencies?: boolean;
|
|
36
36
|
authenticationMethod?: string;
|
|
37
|
+
linkedWorkspaces?: Array<{
|
|
38
|
+
uid: string;
|
|
39
|
+
space_uid: string;
|
|
40
|
+
is_default: boolean;
|
|
41
|
+
}>;
|
|
37
42
|
}
|
|
38
43
|
type branch = {
|
|
39
44
|
uid: string;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export interface Region {
|
|
|
25
25
|
cma: string;
|
|
26
26
|
cda: string;
|
|
27
27
|
uiHost: string;
|
|
28
|
+
assetManagementUrl?: string;
|
|
28
29
|
}
|
|
29
30
|
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
31
|
export type ModuleClassParams = {
|
package/lib/utils/constants.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ export declare const PROCESS_NAMES: {
|
|
|
2
2
|
readonly ASSET_FOLDERS: "Folders";
|
|
3
3
|
readonly ASSET_METADATA: "Metadata";
|
|
4
4
|
readonly ASSET_DOWNLOADS: "Downloads";
|
|
5
|
+
/** Used when Assets module runs Asset Management 2.0 path (spaces, metadata, folders, assets, downloads). */
|
|
6
|
+
readonly ASSET_MANAGEMENT_SPACES: "Spaces & assets";
|
|
7
|
+
readonly ASSET_MANAGEMENT_EXPORT: "Asset Management 2.0";
|
|
5
8
|
readonly FETCH_ROLES: "Fetch Roles";
|
|
6
9
|
readonly FETCH_LOCALES: "Fetch Locales";
|
|
7
10
|
readonly PROCESS_MAPPINGS: "Process Mappings";
|
|
@@ -23,6 +26,7 @@ export declare const PROCESS_NAMES: {
|
|
|
23
26
|
};
|
|
24
27
|
export declare const MODULE_CONTEXTS: {
|
|
25
28
|
readonly ASSETS: "assets";
|
|
29
|
+
readonly ASSET_MANAGEMENT: "asset-management";
|
|
26
30
|
readonly CONTENT_TYPES: "content-types";
|
|
27
31
|
readonly CUSTOM_ROLES: "custom-roles";
|
|
28
32
|
readonly ENTRIES: "entries";
|
|
@@ -40,6 +44,7 @@ export declare const MODULE_CONTEXTS: {
|
|
|
40
44
|
};
|
|
41
45
|
export declare const MODULE_NAMES: {
|
|
42
46
|
readonly assets: "Assets";
|
|
47
|
+
readonly "asset-management": "Asset Management 2.0";
|
|
43
48
|
readonly "content-types": "Content Types";
|
|
44
49
|
readonly "custom-roles": "Custom Roles";
|
|
45
50
|
readonly entries: "Entries";
|
|
@@ -69,6 +74,14 @@ export declare const PROCESS_STATUS: {
|
|
|
69
74
|
DOWNLOADING: string;
|
|
70
75
|
FAILED: string;
|
|
71
76
|
};
|
|
77
|
+
"Spaces & assets": {
|
|
78
|
+
EXPORTING: string;
|
|
79
|
+
FAILED: string;
|
|
80
|
+
};
|
|
81
|
+
"Asset Management 2.0": {
|
|
82
|
+
EXPORTING: string;
|
|
83
|
+
FAILED: string;
|
|
84
|
+
};
|
|
72
85
|
"Fetch Roles": {
|
|
73
86
|
FETCHING: string;
|
|
74
87
|
FAILED: string;
|
package/lib/utils/constants.js
CHANGED
|
@@ -6,6 +6,10 @@ exports.PROCESS_NAMES = {
|
|
|
6
6
|
ASSET_FOLDERS: 'Folders',
|
|
7
7
|
ASSET_METADATA: 'Metadata',
|
|
8
8
|
ASSET_DOWNLOADS: 'Downloads',
|
|
9
|
+
/** Used when Assets module runs Asset Management 2.0 path (spaces, metadata, folders, assets, downloads). */
|
|
10
|
+
ASSET_MANAGEMENT_SPACES: 'Spaces & assets',
|
|
11
|
+
// Asset Management 2.0 module
|
|
12
|
+
ASSET_MANAGEMENT_EXPORT: 'Asset Management 2.0',
|
|
9
13
|
// Custom Roles module
|
|
10
14
|
FETCH_ROLES: 'Fetch Roles',
|
|
11
15
|
FETCH_LOCALES: 'Fetch Locales',
|
|
@@ -33,6 +37,7 @@ exports.PROCESS_NAMES = {
|
|
|
33
37
|
};
|
|
34
38
|
exports.MODULE_CONTEXTS = {
|
|
35
39
|
ASSETS: 'assets',
|
|
40
|
+
ASSET_MANAGEMENT: 'asset-management',
|
|
36
41
|
CONTENT_TYPES: 'content-types',
|
|
37
42
|
CUSTOM_ROLES: 'custom-roles',
|
|
38
43
|
ENTRIES: 'entries',
|
|
@@ -51,6 +56,7 @@ exports.MODULE_CONTEXTS = {
|
|
|
51
56
|
// Display names for modules to avoid scattering user-facing strings
|
|
52
57
|
exports.MODULE_NAMES = {
|
|
53
58
|
[exports.MODULE_CONTEXTS.ASSETS]: 'Assets',
|
|
59
|
+
[exports.MODULE_CONTEXTS.ASSET_MANAGEMENT]: 'Asset Management 2.0',
|
|
54
60
|
[exports.MODULE_CONTEXTS.CONTENT_TYPES]: 'Content Types',
|
|
55
61
|
[exports.MODULE_CONTEXTS.CUSTOM_ROLES]: 'Custom Roles',
|
|
56
62
|
[exports.MODULE_CONTEXTS.ENTRIES]: 'Entries',
|
|
@@ -81,6 +87,15 @@ exports.PROCESS_STATUS = {
|
|
|
81
87
|
FAILED: 'Failed to download asset:',
|
|
82
88
|
},
|
|
83
89
|
// Custom Roles
|
|
90
|
+
[exports.PROCESS_NAMES.ASSET_MANAGEMENT_SPACES]: {
|
|
91
|
+
EXPORTING: 'Exporting spaces & assets...',
|
|
92
|
+
FAILED: 'Failed to export spaces & assets.',
|
|
93
|
+
},
|
|
94
|
+
// Asset Management 2.0
|
|
95
|
+
[exports.PROCESS_NAMES.ASSET_MANAGEMENT_EXPORT]: {
|
|
96
|
+
EXPORTING: 'Exporting...',
|
|
97
|
+
FAILED: 'Asset Management export failed.',
|
|
98
|
+
},
|
|
84
99
|
[exports.PROCESS_NAMES.FETCH_ROLES]: {
|
|
85
100
|
FETCHING: 'Fetching custom roles...',
|
|
86
101
|
FAILED: 'Failed to fetch custom roles.',
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { LinkedWorkspace } from '@contentstack/cli-asset-management';
|
|
2
|
+
/** Stack client with branch().fetch() for CMA branch details */
|
|
3
|
+
type StackWithBranch = {
|
|
4
|
+
branch: (name: string) => {
|
|
5
|
+
fetch: (params?: Record<string, unknown>) => Promise<unknown>;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Fetch branch details with include_settings: true and return linked workspaces (am_v2).
|
|
10
|
+
* Reused by stack export (included in settings.json) and asset-management module.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getLinkedWorkspacesForBranch(stack: StackWithBranch, branchName: string, context?: Record<string, unknown>): Promise<LinkedWorkspace[]>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLinkedWorkspacesForBranch = void 0;
|
|
4
|
+
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
5
|
+
/**
|
|
6
|
+
* Fetch branch details with include_settings: true and return linked workspaces (am_v2).
|
|
7
|
+
* Reused by stack export (included in settings.json) and asset-management module.
|
|
8
|
+
*/
|
|
9
|
+
async function getLinkedWorkspacesForBranch(stack, branchName, context) {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
cli_utilities_1.log.debug(`Fetching branch details for: ${branchName}`, context);
|
|
12
|
+
try {
|
|
13
|
+
const branch = await stack.branch(branchName).fetch({ include_settings: true });
|
|
14
|
+
const linked = (_b = (_a = branch === null || branch === void 0 ? void 0 : branch.settings) === null || _a === void 0 ? void 0 : _a.am_v2) === null || _b === void 0 ? void 0 : _b.linked_workspaces;
|
|
15
|
+
if (!Array.isArray(linked)) {
|
|
16
|
+
cli_utilities_1.log.debug('No linked_workspaces in branch settings', context);
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
cli_utilities_1.log.info(`Found ${linked.length} linked workspace(s) for branch ${branchName}`, context);
|
|
20
|
+
return linked;
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
const err = error;
|
|
24
|
+
if ((err === null || err === void 0 ? void 0 : err.status) === 412 || (err === null || err === void 0 ? void 0 : err.errorCode) === 412) {
|
|
25
|
+
cli_utilities_1.log.warn('Branch settings not found, please check if the branches are enabled in your stack', context);
|
|
26
|
+
return [];
|
|
27
|
+
}
|
|
28
|
+
(0, cli_utilities_1.handleAndLogError)(error, context, 'Failed to fetch branch settings');
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.getLinkedWorkspacesForBranch = getLinkedWorkspacesForBranch;
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -9,4 +9,5 @@ export { log, unlinkFileLogger } from './logger';
|
|
|
9
9
|
export { default as login } from './basic-login';
|
|
10
10
|
export * from './common-helper';
|
|
11
11
|
export * from './marketplace-app-helper';
|
|
12
|
+
export { getLinkedWorkspacesForBranch } from './get-linked-workspaces';
|
|
12
13
|
export { MODULE_CONTEXTS, MODULE_NAMES, PROCESS_NAMES, PROCESS_STATUS } from './constants';
|
package/lib/utils/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PROCESS_STATUS = exports.PROCESS_NAMES = exports.MODULE_NAMES = exports.MODULE_CONTEXTS = exports.login = exports.unlinkFileLogger = exports.log = exports.getExportBasePath = exports.setupExportDir = exports.setupBranches = exports.fsUtil = exports.fileHelper = exports.setupExportConfig = exports.interactive = void 0;
|
|
3
|
+
exports.PROCESS_STATUS = exports.PROCESS_NAMES = exports.MODULE_NAMES = exports.MODULE_CONTEXTS = exports.getLinkedWorkspacesForBranch = exports.login = exports.unlinkFileLogger = exports.log = exports.getExportBasePath = exports.setupExportDir = exports.setupBranches = exports.fsUtil = exports.fileHelper = exports.setupExportConfig = exports.interactive = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
exports.interactive = tslib_1.__importStar(require("./interactive"));
|
|
6
6
|
var export_config_handler_1 = require("./export-config-handler");
|
|
@@ -21,6 +21,8 @@ var basic_login_1 = require("./basic-login");
|
|
|
21
21
|
Object.defineProperty(exports, "login", { enumerable: true, get: function () { return tslib_1.__importDefault(basic_login_1).default; } });
|
|
22
22
|
tslib_1.__exportStar(require("./common-helper"), exports);
|
|
23
23
|
tslib_1.__exportStar(require("./marketplace-app-helper"), exports);
|
|
24
|
+
var get_linked_workspaces_1 = require("./get-linked-workspaces");
|
|
25
|
+
Object.defineProperty(exports, "getLinkedWorkspacesForBranch", { enumerable: true, get: function () { return get_linked_workspaces_1.getLinkedWorkspacesForBranch; } });
|
|
24
26
|
var constants_1 = require("./constants");
|
|
25
27
|
Object.defineProperty(exports, "MODULE_CONTEXTS", { enumerable: true, get: function () { return constants_1.MODULE_CONTEXTS; } });
|
|
26
28
|
Object.defineProperty(exports, "MODULE_NAMES", { enumerable: true, get: function () { return constants_1.MODULE_NAMES; } });
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cli_asset_management_1 = require("@contentstack/cli-asset-management");
|
|
3
4
|
const constants_1 = require("./constants");
|
|
4
5
|
/**
|
|
5
6
|
* Progress Strategy Registrations for Export Modules
|
|
@@ -22,6 +23,23 @@ try {
|
|
|
22
23
|
failures: downloadsProcess.failureCount,
|
|
23
24
|
};
|
|
24
25
|
}
|
|
26
|
+
// Asset Management 2.0 path (process name owned by AM package)
|
|
27
|
+
const amProcess = processes.get(cli_asset_management_1.AM_MAIN_PROCESS_NAME);
|
|
28
|
+
if (amProcess) {
|
|
29
|
+
return {
|
|
30
|
+
total: amProcess.total,
|
|
31
|
+
success: amProcess.successCount,
|
|
32
|
+
failures: amProcess.failureCount,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
const spacesProcess = processes.get(constants_1.PROCESS_NAMES.ASSET_MANAGEMENT_SPACES);
|
|
36
|
+
if (spacesProcess) {
|
|
37
|
+
return {
|
|
38
|
+
total: spacesProcess.total,
|
|
39
|
+
success: spacesProcess.successCount,
|
|
40
|
+
failures: spacesProcess.failureCount,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
25
43
|
// Fallback to metadata process if downloads don't exist
|
|
26
44
|
const metadataProcess = processes.get(constants_1.PROCESS_NAMES.ASSET_METADATA);
|
|
27
45
|
if (metadataProcess) {
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
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.16",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@contentstack/cli-command": "~2.0.0-beta.6",
|
|
9
9
|
"@contentstack/cli-utilities": "~2.0.0-beta.7",
|
|
10
10
|
"@contentstack/cli-variants": "~2.0.0-beta.12",
|
|
11
|
+
"@contentstack/cli-asset-management": "~1.0.0-beta.0",
|
|
11
12
|
"@oclif/core": "^4.8.0",
|
|
12
13
|
"async": "^3.2.6",
|
|
13
14
|
"big-json": "^3.2.0",
|
|
@@ -18,14 +19,14 @@
|
|
|
18
19
|
"mkdirp": "^1.0.4",
|
|
19
20
|
"progress-stream": "^2.0.0",
|
|
20
21
|
"promise-limit": "^2.7.0",
|
|
21
|
-
"winston": "^3.
|
|
22
|
+
"winston": "^3.19.0"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
25
|
"@contentstack/cli-auth": "~2.0.0-beta.9",
|
|
25
26
|
"@contentstack/cli-config": "~2.0.0-beta.5",
|
|
26
27
|
"@contentstack/cli-dev-dependencies": "~2.0.0-beta.0",
|
|
27
28
|
"@oclif/plugin-help": "^6.2.28",
|
|
28
|
-
"@oclif/test": "^4.1.
|
|
29
|
+
"@oclif/test": "^4.1.18",
|
|
29
30
|
"@types/big-json": "^3.2.5",
|
|
30
31
|
"@types/chai": "^4.3.11",
|
|
31
32
|
"@types/mkdirp": "^1.0.2",
|
|
@@ -94,4 +95,4 @@
|
|
|
94
95
|
}
|
|
95
96
|
},
|
|
96
97
|
"repository": "https://github.com/contentstack/cli"
|
|
97
|
-
}
|
|
98
|
+
}
|