@contentstack/cli-cm-import 2.0.0-beta.1 → 2.0.0-beta.11
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/LICENSE +1 -1
- package/README.md +50 -96
- package/lib/commands/cm/stacks/import.d.ts +0 -1
- package/lib/commands/cm/stacks/import.js +13 -46
- package/lib/config/index.js +7 -0
- package/lib/constants/index.d.ts +57 -0
- package/lib/constants/index.js +59 -0
- package/lib/import/module-importer.js +4 -4
- package/lib/import/modules/assets.js +18 -9
- package/lib/import/modules/base-class.d.ts +21 -4
- package/lib/import/modules/base-class.js +31 -1
- package/lib/import/modules/composable-studio.d.ts +44 -0
- package/lib/import/modules/composable-studio.js +235 -0
- package/lib/import/modules/content-types.d.ts +2 -0
- package/lib/import/modules/content-types.js +52 -13
- package/lib/import/modules/custom-roles.js +10 -10
- package/lib/import/modules/entries.d.ts +2 -0
- package/lib/import/modules/entries.js +41 -36
- package/lib/import/modules/environments.js +6 -6
- package/lib/import/modules/extensions.js +7 -7
- package/lib/import/modules/global-fields.d.ts +1 -1
- package/lib/import/modules/global-fields.js +10 -10
- package/lib/import/modules/labels.js +6 -6
- package/lib/import/modules/locales.d.ts +1 -1
- package/lib/import/modules/locales.js +8 -8
- package/lib/import/modules/marketplace-apps.js +6 -6
- package/lib/import/modules/personalize.js +2 -3
- package/lib/import/modules/stack.js +5 -5
- package/lib/import/modules/taxonomies.d.ts +26 -3
- package/lib/import/modules/taxonomies.js +180 -63
- package/lib/import/modules/variant-entries.js +5 -5
- package/lib/import/modules/webhooks.js +6 -6
- package/lib/import/modules/workflows.d.ts +1 -1
- package/lib/import/modules/workflows.js +7 -7
- package/lib/types/default-config.d.ts +6 -0
- package/lib/types/index.d.ts +37 -11
- package/lib/utils/asset-helper.js +1 -1
- package/lib/utils/common-helper.d.ts +1 -1
- package/lib/utils/common-helper.js +8 -7
- package/lib/utils/content-type-helper.d.ts +1 -1
- package/lib/utils/content-type-helper.js +3 -3
- package/lib/utils/extension-helper.js +5 -4
- package/lib/utils/file-helper.js +1 -1
- package/lib/utils/import-config-handler.js +7 -13
- package/lib/utils/import-path-resolver.js +2 -8
- package/lib/utils/logger.d.ts +1 -1
- package/lib/utils/logger.js +2 -2
- package/lib/utils/login-handler.d.ts +1 -1
- package/lib/utils/login-handler.js +4 -4
- package/lib/utils/marketplace-app-helper.js +9 -6
- package/lib/utils/taxonomies-helper.js +1 -1
- package/messages/index.json +10 -1
- package/oclif.manifest.json +4 -48
- package/package.json +16 -18
|
@@ -6,18 +6,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.lookupExtension = void 0;
|
|
7
7
|
/*!
|
|
8
8
|
* Contentstack Import
|
|
9
|
-
* Copyright (c)
|
|
9
|
+
* Copyright (c) 2026 Contentstack LLC
|
|
10
10
|
* MIT Licensed
|
|
11
11
|
*/
|
|
12
12
|
const node_path_1 = require("node:path");
|
|
13
13
|
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
14
|
+
const constants_1 = require("../constants");
|
|
14
15
|
// eslint-disable-next-line camelcase
|
|
15
16
|
const lookupExtension = function (config, schema, preserveStackVersion, installedExtensions) {
|
|
16
17
|
cli_utilities_1.log.debug('Starting extension lookup process...');
|
|
17
18
|
const fs = new cli_utilities_1.FsUtility({ basePath: config.backupDir });
|
|
18
|
-
const extensionPath = (0, node_path_1.join)(config.backupDir,
|
|
19
|
-
const globalfieldsPath = (0, node_path_1.join)(config.backupDir,
|
|
20
|
-
const marketPlaceAppsPath = (0, node_path_1.join)(config.backupDir,
|
|
19
|
+
const extensionPath = (0, node_path_1.join)(config.backupDir, constants_1.PATH_CONSTANTS.MAPPER, constants_1.PATH_CONSTANTS.MAPPER_MODULES.EXTENSIONS, constants_1.PATH_CONSTANTS.FILES.UID_MAPPING);
|
|
20
|
+
const globalfieldsPath = (0, node_path_1.join)(config.backupDir, constants_1.PATH_CONSTANTS.MAPPER, constants_1.PATH_CONSTANTS.MAPPER_MODULES.GLOBAL_FIELDS, constants_1.PATH_CONSTANTS.FILES.UID_MAPPING);
|
|
21
|
+
const marketPlaceAppsPath = (0, node_path_1.join)(config.backupDir, constants_1.PATH_CONSTANTS.MAPPER, constants_1.PATH_CONSTANTS.MAPPER_MODULES.MARKETPLACE_APPS, constants_1.PATH_CONSTANTS.FILES.UID_MAPPING);
|
|
21
22
|
cli_utilities_1.log.debug(`Extension mapping paths - Extensions: ${extensionPath}, Global fields: ${globalfieldsPath}, Marketplace apps: ${marketPlaceAppsPath}`);
|
|
22
23
|
for (let i in schema) {
|
|
23
24
|
if (schema[i].data_type === 'group') {
|
package/lib/utils/file-helper.js
CHANGED
|
@@ -11,6 +11,9 @@ const interactive_1 = require("./interactive");
|
|
|
11
11
|
const login_handler_1 = tslib_1.__importDefault(require("./login-handler"));
|
|
12
12
|
const setupConfig = async (importCmdFlags) => {
|
|
13
13
|
var _a;
|
|
14
|
+
// Set progress supported module FIRST, before any log calls
|
|
15
|
+
// This ensures the logger respects the showConsoleLogs setting correctly
|
|
16
|
+
cli_utilities_1.configHandler.set('log.progressSupportedModule', 'import');
|
|
14
17
|
let config = (0, merge_1.default)({}, config_1.default);
|
|
15
18
|
// Track authentication method
|
|
16
19
|
let authenticationMethod = 'unknown';
|
|
@@ -23,18 +26,16 @@ const setupConfig = async (importCmdFlags) => {
|
|
|
23
26
|
}
|
|
24
27
|
config = merge_1.default.recursive(config, externalConfig);
|
|
25
28
|
}
|
|
26
|
-
config.contentDir = (0, cli_utilities_1.sanitizePath)(importCmdFlags['data'] || importCmdFlags['data-dir'] || config.
|
|
29
|
+
config.contentDir = (0, cli_utilities_1.sanitizePath)(importCmdFlags['data'] || importCmdFlags['data-dir'] || config.contentDir || (await (0, interactive_1.askContentDir)()));
|
|
27
30
|
const pattern = /[*$%#<>{}!&?]/g;
|
|
28
31
|
if (pattern.test(config.contentDir)) {
|
|
29
|
-
cli_utilities_1.cliux.print(`\nPlease
|
|
32
|
+
cli_utilities_1.cliux.print(`\nPlease enter a directory path without any special characters: (*,&,{,},[,],$,%,<,>,?,!)`, {
|
|
30
33
|
color: 'yellow',
|
|
31
34
|
});
|
|
32
35
|
config.contentDir = (0, cli_utilities_1.sanitizePath)(await (0, interactive_1.askContentDir)());
|
|
33
36
|
}
|
|
34
37
|
config.contentDir = config.contentDir.replace(/['"]/g, '');
|
|
35
38
|
config.contentDir = path.resolve(config.contentDir);
|
|
36
|
-
//Note to support the old key
|
|
37
|
-
config.data = config.contentDir;
|
|
38
39
|
const managementTokenAlias = importCmdFlags['management-token-alias'] || importCmdFlags['alias'];
|
|
39
40
|
if (managementTokenAlias) {
|
|
40
41
|
const { token, apiKey } = (_a = cli_utilities_1.configHandler.get(`tokens.${managementTokenAlias}`)) !== null && _a !== void 0 ? _a : {};
|
|
@@ -71,7 +72,7 @@ const setupConfig = async (importCmdFlags) => {
|
|
|
71
72
|
cli_utilities_1.log.debug('User authenticated via auth token');
|
|
72
73
|
}
|
|
73
74
|
config.apiKey =
|
|
74
|
-
importCmdFlags['stack-uid'] || importCmdFlags['stack-api-key'] || config.
|
|
75
|
+
importCmdFlags['stack-uid'] || importCmdFlags['stack-api-key'] || config.apiKey || (await (0, interactive_1.askAPIKey)());
|
|
75
76
|
if (typeof config.apiKey !== 'string') {
|
|
76
77
|
throw new Error('Invalid API key received');
|
|
77
78
|
}
|
|
@@ -79,12 +80,9 @@ const setupConfig = async (importCmdFlags) => {
|
|
|
79
80
|
}
|
|
80
81
|
config.isAuthenticated = (0, cli_utilities_1.isAuthenticated)();
|
|
81
82
|
config.auth_token = cli_utilities_1.configHandler.get('authtoken'); // TBD handle auth token in httpClient & sdk
|
|
82
|
-
//Note to support the old key
|
|
83
|
-
config.source_stack = config.apiKey;
|
|
84
83
|
config.skipAudit = importCmdFlags['skip-audit'];
|
|
85
84
|
config.forceStopMarketplaceAppsPrompt = importCmdFlags.yes;
|
|
86
85
|
config.importWebhookStatus = importCmdFlags['import-webhook-status'];
|
|
87
|
-
config.skipPrivateAppRecreationIfExist = !importCmdFlags['skip-app-recreation'];
|
|
88
86
|
if (importCmdFlags['branch-alias']) {
|
|
89
87
|
config.branchAlias = importCmdFlags['branch-alias'];
|
|
90
88
|
}
|
|
@@ -105,19 +103,15 @@ const setupConfig = async (importCmdFlags) => {
|
|
|
105
103
|
if (importCmdFlags['skip-entries-publish']) {
|
|
106
104
|
config.skipEntriesPublish = importCmdFlags['skip-entries-publish'];
|
|
107
105
|
}
|
|
108
|
-
// Note to support old modules
|
|
109
|
-
config.target_stack = config.apiKey;
|
|
110
106
|
config.replaceExisting = importCmdFlags['replace-existing'];
|
|
111
107
|
config.skipExisting = importCmdFlags['skip-existing'];
|
|
112
108
|
config.personalizeProjectName = importCmdFlags['personalize-project-name'];
|
|
113
109
|
if (importCmdFlags['exclude-global-modules']) {
|
|
114
110
|
config['exclude-global-modules'] = importCmdFlags['exclude-global-modules'];
|
|
115
111
|
}
|
|
116
|
-
// Set progress supported module to check and display console logs
|
|
117
|
-
cli_utilities_1.configHandler.set('log.progressSupportedModule', 'import');
|
|
118
112
|
// Add authentication details to config for context tracking
|
|
119
113
|
config.authenticationMethod = authenticationMethod;
|
|
120
|
-
cli_utilities_1.log.debug('Import configuration setup completed', Object.assign({}, config));
|
|
114
|
+
cli_utilities_1.log.debug('Import configuration setup completed.', Object.assign({}, config));
|
|
121
115
|
return config;
|
|
122
116
|
};
|
|
123
117
|
exports.default = setupConfig;
|
|
@@ -63,7 +63,7 @@ exports.selectBranchFromDirectory = selectBranchFromDirectory;
|
|
|
63
63
|
*/
|
|
64
64
|
const resolveImportPath = async (importConfig, stackAPIClient) => {
|
|
65
65
|
cli_utilities_1.log.debug('Resolving import path based on directory structure');
|
|
66
|
-
const contentDir = importConfig.contentDir
|
|
66
|
+
const contentDir = importConfig.contentDir;
|
|
67
67
|
cli_utilities_1.log.debug(`Content directory: ${contentDir}`);
|
|
68
68
|
if (!(0, file_helper_1.fileExistsSync)(contentDir)) {
|
|
69
69
|
throw new Error(`Content directory does not exist: ${contentDir}`);
|
|
@@ -83,11 +83,6 @@ const resolveImportPath = async (importConfig, stackAPIClient) => {
|
|
|
83
83
|
cli_utilities_1.log.debug(`Branch directory not found: ${branchPath}, using contentDir as-is`);
|
|
84
84
|
return contentDir;
|
|
85
85
|
}
|
|
86
|
-
const exportInfoPath = path.join(contentDir, 'export-info.json');
|
|
87
|
-
if ((0, file_helper_1.fileExistsSync)(exportInfoPath)) {
|
|
88
|
-
cli_utilities_1.log.debug('Found export-info.json - using contentDir as-is (v2 export)');
|
|
89
|
-
return contentDir;
|
|
90
|
-
}
|
|
91
86
|
const moduleTypes = config_1.default.modules.types;
|
|
92
87
|
const hasModuleFolders = moduleTypes.some((moduleType) => (0, file_helper_1.fileExistsSync)(path.join(contentDir, moduleType)));
|
|
93
88
|
if (hasModuleFolders) {
|
|
@@ -115,8 +110,7 @@ const updateImportConfigWithResolvedPath = async (importConfig, resolvedPath) =>
|
|
|
115
110
|
}
|
|
116
111
|
importConfig.branchDir = resolvedPath;
|
|
117
112
|
importConfig.contentDir = resolvedPath;
|
|
118
|
-
importConfig.
|
|
119
|
-
cli_utilities_1.log.debug(`Import config updated - contentDir: ${importConfig.contentDir}, branchDir: ${importConfig.branchDir}, data: ${importConfig.data},`);
|
|
113
|
+
cli_utilities_1.log.debug(`Import config updated - contentDir: ${importConfig.contentDir}, branchDir: ${importConfig.branchDir}`);
|
|
120
114
|
};
|
|
121
115
|
exports.updateImportConfigWithResolvedPath = updateImportConfigWithResolvedPath;
|
|
122
116
|
/**
|
package/lib/utils/logger.d.ts
CHANGED
package/lib/utils/logger.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*!
|
|
3
3
|
* Contentstack Export
|
|
4
|
-
* Copyright (c)
|
|
4
|
+
* Copyright (c) 2026 Contentstack LLC
|
|
5
5
|
* MIT Licensed
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -125,7 +125,7 @@ function init(_logPath) {
|
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
127
|
const log = async (config, message, type) => {
|
|
128
|
-
config.cliLogsPath = (0, cli_utilities_1.sanitizePath)(config.cliLogsPath || config.
|
|
128
|
+
config.cliLogsPath = (0, cli_utilities_1.sanitizePath)(config.cliLogsPath || config.contentDir || path.join(__dirname, 'logs'));
|
|
129
129
|
// ignoring the type argument, as we are not using it to create a logfile anymore
|
|
130
130
|
if (type !== 'error') {
|
|
131
131
|
// removed type argument from init method
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/* eslint-disable no-empty */
|
|
5
5
|
/*!
|
|
6
6
|
* Contentstack Import
|
|
7
|
-
* Copyright (c)
|
|
7
|
+
* Copyright (c) 2026 Contentstack LLC
|
|
8
8
|
* MIT Licensed
|
|
9
9
|
*/
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -18,7 +18,7 @@ const login = async (config) => {
|
|
|
18
18
|
if (authtoken) {
|
|
19
19
|
cli_utilities_1.log.debug('Login successful, setting up headers');
|
|
20
20
|
config.headers = {
|
|
21
|
-
api_key: config.
|
|
21
|
+
api_key: config.apiKey,
|
|
22
22
|
access_token: config.access_token,
|
|
23
23
|
authtoken: config.authtoken,
|
|
24
24
|
'X-User-Agent': 'contentstack-export/v',
|
|
@@ -36,7 +36,7 @@ const login = async (config) => {
|
|
|
36
36
|
else if ((0, cli_utilities_1.isAuthenticated)()) {
|
|
37
37
|
cli_utilities_1.log.debug('Using existing authentication, validating stack access');
|
|
38
38
|
const stackAPIClient = client.stack({
|
|
39
|
-
api_key: config.
|
|
39
|
+
api_key: config.apiKey,
|
|
40
40
|
management_token: config.management_token,
|
|
41
41
|
});
|
|
42
42
|
const stack = await stackAPIClient.fetch().catch((error) => {
|
|
@@ -44,7 +44,7 @@ const login = async (config) => {
|
|
|
44
44
|
let errorstack_key = (_a = error === null || error === void 0 ? void 0 : error.errors) === null || _a === void 0 ? void 0 : _a.api_key;
|
|
45
45
|
if (errorstack_key) {
|
|
46
46
|
const keyError = errorstack_key[0];
|
|
47
|
-
cli_utilities_1.log.error(`Invalid stack API token: ${keyError} Please enter valid stack API token.`);
|
|
47
|
+
cli_utilities_1.log.error(`Invalid stack API token: ${keyError}. Please enter a valid stack API token.`);
|
|
48
48
|
throw error;
|
|
49
49
|
}
|
|
50
50
|
cli_utilities_1.log.error(`Stack fetch error: ${error === null || error === void 0 ? void 0 : error.errorMessage}`);
|
|
@@ -18,9 +18,10 @@ const getAllStackSpecificApps = async (config, skip = 0, listOfApps = []) => {
|
|
|
18
18
|
const collection = await appSdk
|
|
19
19
|
.marketplace(config.org_uid)
|
|
20
20
|
.installation()
|
|
21
|
-
.fetchAll({ target_uids: config.
|
|
21
|
+
.fetchAll({ target_uids: config.apiKey, skip })
|
|
22
22
|
.catch((error) => {
|
|
23
23
|
(0, cli_utilities_1.handleAndLogError)(error);
|
|
24
|
+
cli_utilities_1.log.error(error, config === null || config === void 0 ? void 0 : config.context);
|
|
24
25
|
});
|
|
25
26
|
if (collection) {
|
|
26
27
|
const { items: apps, count } = collection;
|
|
@@ -53,10 +54,11 @@ const getOrgUid = async (config) => {
|
|
|
53
54
|
cli_utilities_1.log.debug('Fetching organization UID');
|
|
54
55
|
const tempAPIClient = await (0, cli_utilities_1.managementSDKClient)({ host: config.host });
|
|
55
56
|
const tempStackData = await tempAPIClient
|
|
56
|
-
.stack({ api_key: config.
|
|
57
|
+
.stack({ api_key: config.apiKey })
|
|
57
58
|
.fetch()
|
|
58
59
|
.catch((error) => {
|
|
59
|
-
|
|
60
|
+
(0, cli_utilities_1.handleAndLogError)(error);
|
|
61
|
+
cli_utilities_1.log.error(error, config === null || config === void 0 ? void 0 : config.context);
|
|
60
62
|
});
|
|
61
63
|
const orgUid = (tempStackData === null || tempStackData === void 0 ? void 0 : tempStackData.org_uid) || '';
|
|
62
64
|
cli_utilities_1.log.debug(`Organization UID: ${orgUid}`);
|
|
@@ -78,7 +80,7 @@ const getConfirmationToCreateApps = async (privateApps, config) => {
|
|
|
78
80
|
return Promise.resolve(true);
|
|
79
81
|
}
|
|
80
82
|
else {
|
|
81
|
-
cli_utilities_1.log.
|
|
83
|
+
cli_utilities_1.log.debug('User declined to create private apps (second prompt).');
|
|
82
84
|
return Promise.resolve(false);
|
|
83
85
|
}
|
|
84
86
|
}
|
|
@@ -89,7 +91,7 @@ const getConfirmationToCreateApps = async (privateApps, config) => {
|
|
|
89
91
|
}
|
|
90
92
|
}
|
|
91
93
|
else {
|
|
92
|
-
cli_utilities_1.log.
|
|
94
|
+
cli_utilities_1.log.debug('Force prompt disabled, automatically creating private apps');
|
|
93
95
|
return Promise.resolve(true);
|
|
94
96
|
}
|
|
95
97
|
};
|
|
@@ -111,7 +113,7 @@ const makeRedirectUrlCall = async (response, appName, config) => {
|
|
|
111
113
|
.get(response.redirect_url)
|
|
112
114
|
.then(async ({ response }) => {
|
|
113
115
|
if ((0, includes_1.default)([501, 403], response.status)) {
|
|
114
|
-
cli_utilities_1.log.error(`OAuth API call failed for ${appName}: ${response.statusText}
|
|
116
|
+
cli_utilities_1.log.error(`OAuth API call failed for ${appName}: ${response.statusText}`, config === null || config === void 0 ? void 0 : config.context);
|
|
115
117
|
await (0, exports.confirmToCloseProcess)(response.data, config);
|
|
116
118
|
}
|
|
117
119
|
else {
|
|
@@ -119,6 +121,7 @@ const makeRedirectUrlCall = async (response, appName, config) => {
|
|
|
119
121
|
}
|
|
120
122
|
})
|
|
121
123
|
.catch((error) => {
|
|
124
|
+
cli_utilities_1.log.error(error, config === null || config === void 0 ? void 0 : config.context);
|
|
122
125
|
if ((0, includes_1.default)([501, 403], error.status)) {
|
|
123
126
|
(0, cli_utilities_1.handleAndLogError)(error);
|
|
124
127
|
}
|
|
@@ -14,7 +14,7 @@ const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
|
14
14
|
* @param {ImportConfig} importConfig
|
|
15
15
|
*/
|
|
16
16
|
const lookUpTaxonomy = function (importConfig, schema, taxonomies) {
|
|
17
|
-
cli_utilities_1.log.debug(`Starting taxonomy lookup for schema with ${Object.keys(schema).length} fields
|
|
17
|
+
cli_utilities_1.log.debug(`Starting taxonomy lookup for schema with ${Object.keys(schema).length} fields.`);
|
|
18
18
|
for (let i in schema) {
|
|
19
19
|
if (schema[i].data_type === 'taxonomy') {
|
|
20
20
|
cli_utilities_1.log.debug(`Processing taxonomy field: ${schema[i].uid}`);
|
package/messages/index.json
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"COMPOSABLE_STUDIO_IMPORT_START": "Starting Studio project import...",
|
|
3
|
+
"COMPOSABLE_STUDIO_NOT_FOUND": "No Studio project found in exported data",
|
|
4
|
+
"COMPOSABLE_STUDIO_SKIP_EXISTING": "Skipping Studio import - target stack already has a connected project",
|
|
5
|
+
"COMPOSABLE_STUDIO_IMPORT_COMPLETE": "Successfully imported Studio project '%s'",
|
|
6
|
+
"COMPOSABLE_STUDIO_IMPORT_FAILED": "Failed to import Studio project: %s",
|
|
7
|
+
"COMPOSABLE_STUDIO_NAME_CONFLICT": "Project name '%s' already exists. Please provide a new name:",
|
|
8
|
+
"COMPOSABLE_STUDIO_SUGGEST_NAME": "Suggested name: %s",
|
|
9
|
+
"COMPOSABLE_STUDIO_ENV_MAPPING_FAILED": "Warning: Could not map environment '%s', using empty environment"
|
|
10
|
+
}
|
package/oclif.manifest.json
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"commands": {
|
|
3
3
|
"cm:stacks:import": {
|
|
4
|
-
"aliases": [
|
|
5
|
-
"cm:import"
|
|
6
|
-
],
|
|
4
|
+
"aliases": [],
|
|
7
5
|
"args": {},
|
|
8
6
|
"description": "Import content from a stack",
|
|
9
7
|
"examples": [
|
|
@@ -25,15 +23,6 @@
|
|
|
25
23
|
"multiple": false,
|
|
26
24
|
"type": "option"
|
|
27
25
|
},
|
|
28
|
-
"stack-uid": {
|
|
29
|
-
"char": "s",
|
|
30
|
-
"description": "API key of the target stack.",
|
|
31
|
-
"hidden": true,
|
|
32
|
-
"name": "stack-uid",
|
|
33
|
-
"hasDynamicHelp": false,
|
|
34
|
-
"multiple": false,
|
|
35
|
-
"type": "option"
|
|
36
|
-
},
|
|
37
26
|
"stack-api-key": {
|
|
38
27
|
"char": "k",
|
|
39
28
|
"description": "API Key of the target stack",
|
|
@@ -42,14 +31,6 @@
|
|
|
42
31
|
"multiple": false,
|
|
43
32
|
"type": "option"
|
|
44
33
|
},
|
|
45
|
-
"data": {
|
|
46
|
-
"description": "path and location where data is stored",
|
|
47
|
-
"hidden": true,
|
|
48
|
-
"name": "data",
|
|
49
|
-
"hasDynamicHelp": false,
|
|
50
|
-
"multiple": false,
|
|
51
|
-
"type": "option"
|
|
52
|
-
},
|
|
53
34
|
"data-dir": {
|
|
54
35
|
"char": "d",
|
|
55
36
|
"description": "The path or the location in your file system where the content, you intend to import, is stored. For example, -d \"C:\\Users\\Name\\Desktop\\cli\\content\". If the export folder has branches involved, then the path should point till the particular branch. For example, “-d \"C:\\Users\\Name\\Desktop\\cli\\content\\branch_name\"",
|
|
@@ -66,25 +47,8 @@
|
|
|
66
47
|
"multiple": false,
|
|
67
48
|
"type": "option"
|
|
68
49
|
},
|
|
69
|
-
"management-token-alias": {
|
|
70
|
-
"description": "alias of the management token",
|
|
71
|
-
"hidden": true,
|
|
72
|
-
"name": "management-token-alias",
|
|
73
|
-
"hasDynamicHelp": false,
|
|
74
|
-
"multiple": false,
|
|
75
|
-
"type": "option"
|
|
76
|
-
},
|
|
77
|
-
"auth-token": {
|
|
78
|
-
"char": "A",
|
|
79
|
-
"description": "to use auth token",
|
|
80
|
-
"hidden": true,
|
|
81
|
-
"name": "auth-token",
|
|
82
|
-
"allowNo": false,
|
|
83
|
-
"type": "boolean"
|
|
84
|
-
},
|
|
85
50
|
"module": {
|
|
86
|
-
"
|
|
87
|
-
"description": "[optional] Specify the module to import into the target stack. If not specified, the import command will import all the modules into the stack. The available modules are assets, content-types, entries, environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks, workflows, custom-roles, personalize projects, and taxonomies.",
|
|
51
|
+
"description": "[optional] Specify the module to import into the target stack. If not specified, the import command will import all the modules into the stack. The available modules are assets, content-types, entries, environments, extensions, marketplace-apps, global-fields, labels, locales, webhooks, workflows, custom-roles, personalize projects, taxonomies, and composable-studio.",
|
|
88
52
|
"name": "module",
|
|
89
53
|
"required": false,
|
|
90
54
|
"hasDynamicHelp": false,
|
|
@@ -92,7 +56,6 @@
|
|
|
92
56
|
"type": "option"
|
|
93
57
|
},
|
|
94
58
|
"backup-dir": {
|
|
95
|
-
"char": "b",
|
|
96
59
|
"description": "[optional] Backup directory name when using specific module.",
|
|
97
60
|
"name": "backup-dir",
|
|
98
61
|
"hasDynamicHelp": false,
|
|
@@ -100,7 +63,6 @@
|
|
|
100
63
|
"type": "option"
|
|
101
64
|
},
|
|
102
65
|
"branch": {
|
|
103
|
-
"char": "B",
|
|
104
66
|
"description": "The name of the branch where you want to import your content. If you don't mention the branch name, then by default the content will be imported to the main branch.",
|
|
105
67
|
"exclusive": [
|
|
106
68
|
"branch-alias"
|
|
@@ -141,12 +103,6 @@
|
|
|
141
103
|
"allowNo": false,
|
|
142
104
|
"type": "boolean"
|
|
143
105
|
},
|
|
144
|
-
"skip-app-recreation": {
|
|
145
|
-
"description": "(optional) Skips the recreation of private apps if they already exist.",
|
|
146
|
-
"name": "skip-app-recreation",
|
|
147
|
-
"allowNo": false,
|
|
148
|
-
"type": "boolean"
|
|
149
|
-
},
|
|
150
106
|
"replace-existing": {
|
|
151
107
|
"description": "Replaces the existing module in the target stack.",
|
|
152
108
|
"name": "replace-existing",
|
|
@@ -201,7 +157,7 @@
|
|
|
201
157
|
"pluginName": "@contentstack/cli-cm-import",
|
|
202
158
|
"pluginType": "core",
|
|
203
159
|
"strict": true,
|
|
204
|
-
"usage": "cm:stacks:import [
|
|
160
|
+
"usage": "cm:stacks:import [--config <value>] [--stack-api-key <value>] [--data-dir <value>] [--alias <value>] [--module <value>] [--backup-dir <value>] [--branch <value>] [--import-webhook-status disable|current]",
|
|
205
161
|
"isESM": false,
|
|
206
162
|
"relativePath": [
|
|
207
163
|
"lib",
|
|
@@ -212,5 +168,5 @@
|
|
|
212
168
|
]
|
|
213
169
|
}
|
|
214
170
|
},
|
|
215
|
-
"version": "2.0.0-beta.
|
|
171
|
+
"version": "2.0.0-beta.11"
|
|
216
172
|
}
|
package/package.json
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-cm-import",
|
|
3
3
|
"description": "Contentstack CLI plugin to import content into stack",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.11",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@contentstack/cli-audit": "~
|
|
9
|
-
"@contentstack/cli-command": "~
|
|
10
|
-
"@contentstack/cli-utilities": "~
|
|
11
|
-
"@contentstack/
|
|
12
|
-
"@contentstack/cli-variants": "~2.0.0-beta",
|
|
8
|
+
"@contentstack/cli-audit": "~2.0.0-beta.6",
|
|
9
|
+
"@contentstack/cli-command": "~2.0.0-beta.2",
|
|
10
|
+
"@contentstack/cli-utilities": "~2.0.0-beta.2",
|
|
11
|
+
"@contentstack/cli-variants": "~2.0.0-beta.8",
|
|
13
12
|
"@oclif/core": "^4.3.0",
|
|
14
13
|
"big-json": "^3.2.0",
|
|
15
14
|
"bluebird": "^3.7.2",
|
|
16
15
|
"chalk": "^4.1.2",
|
|
17
|
-
"debug": "^4.4.
|
|
18
|
-
"fs-extra": "^11.3.
|
|
19
|
-
"lodash": "^4.17.
|
|
16
|
+
"debug": "^4.4.3",
|
|
17
|
+
"fs-extra": "^11.3.3",
|
|
18
|
+
"lodash": "^4.17.23",
|
|
20
19
|
"marked": "^4.3.0",
|
|
21
20
|
"merge": "^2.1.1",
|
|
22
21
|
"mkdirp": "^1.0.4",
|
|
@@ -25,13 +24,14 @@
|
|
|
25
24
|
"winston": "^3.17.0"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
28
|
-
"@oclif/test": "^4.1.
|
|
27
|
+
"@oclif/test": "^4.1.16",
|
|
29
28
|
"@types/big-json": "^3.2.5",
|
|
30
29
|
"@types/bluebird": "^3.5.42",
|
|
31
30
|
"@types/fs-extra": "^11.0.4",
|
|
32
31
|
"@types/mkdirp": "^1.0.2",
|
|
33
32
|
"@types/mocha": "^8.2.3",
|
|
34
33
|
"@types/node": "^14.18.63",
|
|
34
|
+
"@types/rewire": "^2.5.30",
|
|
35
35
|
"@types/tar": "^6.1.13",
|
|
36
36
|
"@types/uuid": "^9.0.8",
|
|
37
37
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
@@ -40,12 +40,13 @@
|
|
|
40
40
|
"mocha": "^10.8.2",
|
|
41
41
|
"nyc": "^15.1.0",
|
|
42
42
|
"oclif": "^4.17.46",
|
|
43
|
+
"rewire": "^9.0.1",
|
|
43
44
|
"ts-node": "^10.9.2",
|
|
44
45
|
"typescript": "^4.9.5"
|
|
45
46
|
},
|
|
46
47
|
"scripts": {
|
|
47
|
-
"build": "
|
|
48
|
-
"clean": "rm -rf ./lib ./node_modules tsconfig.
|
|
48
|
+
"build": "pnpm compile && oclif manifest && oclif readme",
|
|
49
|
+
"clean": "rm -rf ./lib ./node_modules tsconfig.tsbuildinfo",
|
|
49
50
|
"compile": "tsc -b tsconfig.json",
|
|
50
51
|
"postpack": "rm -f oclif.manifest.json",
|
|
51
52
|
"prepack": "pnpm compile && oclif manifest && oclif readme",
|
|
@@ -57,7 +58,8 @@
|
|
|
57
58
|
"lint": "eslint src/**/*.ts",
|
|
58
59
|
"format": "eslint src/**/*.ts --fix",
|
|
59
60
|
"test:integration": "mocha --forbid-only \"test/run.test.js\" --integration-test --timeout 60000",
|
|
60
|
-
"test:unit": "mocha --forbid-only \"test/unit
|
|
61
|
+
"test:unit:report": "nyc --extension .ts mocha --forbid-only \"test/unit/**/*.test.ts\"",
|
|
62
|
+
"test:unit": "mocha --forbid-only \"test/**/*.test.ts\" --exit"
|
|
61
63
|
},
|
|
62
64
|
"engines": {
|
|
63
65
|
"node": ">=14.0.0"
|
|
@@ -83,12 +85,8 @@
|
|
|
83
85
|
"repositoryPrefix": "<%- repo %>/blob/main/packages/contentstack-import/<%- commandPath %>"
|
|
84
86
|
},
|
|
85
87
|
"csdxConfig": {
|
|
86
|
-
"expiredCommands": {
|
|
87
|
-
"cm:import": "csdx cm:stacks:import"
|
|
88
|
-
},
|
|
89
88
|
"shortCommandName": {
|
|
90
|
-
"cm:stacks:import": "IMPRT"
|
|
91
|
-
"cm:import": "O-IMPRT"
|
|
89
|
+
"cm:stacks:import": "IMPRT"
|
|
92
90
|
}
|
|
93
91
|
},
|
|
94
92
|
"repository": "https://github.com/contentstack/cli"
|