@contentstack/cli-cm-import 1.19.3 → 1.19.4
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
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
It is Contentstack’s CLI plugin to import content in the stack. To learn how to export and import content in Contentstack, refer to the [Migration guide](https://www.contentstack.com/docs/developers/cli/migration/).
|
|
4
4
|
|
|
5
|
-
[](https://github.com/contentstack/cli/blob/main/LICENSE)it -m
|
|
5
|
+
[](https://github.com/contentstack/cli/blob/main/LICENSE)it -m
|
|
6
6
|
|
|
7
7
|
<!-- toc -->
|
|
8
8
|
* [Usage](#usage)
|
|
@@ -47,7 +47,7 @@ $ npm install -g @contentstack/cli-cm-import
|
|
|
47
47
|
$ csdx COMMAND
|
|
48
48
|
running command...
|
|
49
49
|
$ csdx (--version)
|
|
50
|
-
@contentstack/cli-cm-import/1.19.
|
|
50
|
+
@contentstack/cli-cm-import/1.19.4 linux-x64 node-v18.20.6
|
|
51
51
|
$ csdx --help [COMMAND]
|
|
52
52
|
USAGE
|
|
53
53
|
$ csdx COMMAND
|
|
@@ -75,13 +75,14 @@ FLAGS
|
|
|
75
75
|
the branch name, then by default the content will be imported to the main branch.
|
|
76
76
|
-a, --alias=<value> The management token of the destination stack where you will import the content.
|
|
77
77
|
-b, --backup-dir=<value> [optional] Backup directory name when using specific module.
|
|
78
|
-
-c, --config=<value> [optional]
|
|
78
|
+
-c, --config=<value> [optional] The path of the configuration JSON file containing all the options for
|
|
79
|
+
a single run.
|
|
79
80
|
-d, --data-dir=<value> The path or the location in your file system where the content, you intend to
|
|
80
81
|
import, is stored. For example, -d "C:\Users\Name\Desktop\cli\content". If the
|
|
81
82
|
export folder has branches involved, then the path should point till the
|
|
82
83
|
particular branch. For example, “-d
|
|
83
84
|
"C:\Users\Name\Desktop\cli\content\branch_name"
|
|
84
|
-
-k, --stack-api-key=<value> API
|
|
85
|
+
-k, --stack-api-key=<value> API Key of the target stack
|
|
85
86
|
-m, --module=<value> [optional] Specify the module to import into the target stack. If not specified,
|
|
86
87
|
the import command will import all the modules into the stack. The available
|
|
87
88
|
modules are assets, content-types, entries, environments, extensions,
|
|
@@ -89,12 +90,12 @@ FLAGS
|
|
|
89
90
|
custom-roles, and taxonomies.
|
|
90
91
|
-y, --yes [optional] Force override all Marketplace prompts.
|
|
91
92
|
--exclude-global-modules Excludes the branch-independent module from the import operation.
|
|
92
|
-
--import-webhook-status=<option> [default: disable] [
|
|
93
|
-
as the source stack.
|
|
93
|
+
--import-webhook-status=<option> [default: disable] [default: disable] (optional) This webhook state keeps the same
|
|
94
|
+
state of webhooks as the source stack. <options: disable|current>
|
|
94
95
|
<options: disable|current>
|
|
95
|
-
--personalize-project-name=<value> Personalize project
|
|
96
|
+
--personalize-project-name=<value> (optional) Provide a unique name for the Personalize project.
|
|
96
97
|
--replace-existing Replaces the existing module in the target stack.
|
|
97
|
-
--skip-app-recreation
|
|
98
|
+
--skip-app-recreation (optional) Skips the recreation of private apps if they already exist.
|
|
98
99
|
--skip-audit Skips the audit fix that occurs during an import operation.
|
|
99
100
|
--skip-existing Skips the module exists warning messages.
|
|
100
101
|
|
|
@@ -136,13 +137,14 @@ FLAGS
|
|
|
136
137
|
the branch name, then by default the content will be imported to the main branch.
|
|
137
138
|
-a, --alias=<value> The management token of the destination stack where you will import the content.
|
|
138
139
|
-b, --backup-dir=<value> [optional] Backup directory name when using specific module.
|
|
139
|
-
-c, --config=<value> [optional]
|
|
140
|
+
-c, --config=<value> [optional] The path of the configuration JSON file containing all the options for
|
|
141
|
+
a single run.
|
|
140
142
|
-d, --data-dir=<value> The path or the location in your file system where the content, you intend to
|
|
141
143
|
import, is stored. For example, -d "C:\Users\Name\Desktop\cli\content". If the
|
|
142
144
|
export folder has branches involved, then the path should point till the
|
|
143
145
|
particular branch. For example, “-d
|
|
144
146
|
"C:\Users\Name\Desktop\cli\content\branch_name"
|
|
145
|
-
-k, --stack-api-key=<value> API
|
|
147
|
+
-k, --stack-api-key=<value> API Key of the target stack
|
|
146
148
|
-m, --module=<value> [optional] Specify the module to import into the target stack. If not specified,
|
|
147
149
|
the import command will import all the modules into the stack. The available
|
|
148
150
|
modules are assets, content-types, entries, environments, extensions,
|
|
@@ -150,12 +152,12 @@ FLAGS
|
|
|
150
152
|
custom-roles, and taxonomies.
|
|
151
153
|
-y, --yes [optional] Force override all Marketplace prompts.
|
|
152
154
|
--exclude-global-modules Excludes the branch-independent module from the import operation.
|
|
153
|
-
--import-webhook-status=<option> [default: disable] [
|
|
154
|
-
as the source stack.
|
|
155
|
+
--import-webhook-status=<option> [default: disable] [default: disable] (optional) This webhook state keeps the same
|
|
156
|
+
state of webhooks as the source stack. <options: disable|current>
|
|
155
157
|
<options: disable|current>
|
|
156
|
-
--personalize-project-name=<value> Personalize project
|
|
158
|
+
--personalize-project-name=<value> (optional) Provide a unique name for the Personalize project.
|
|
157
159
|
--replace-existing Replaces the existing module in the target stack.
|
|
158
|
-
--skip-app-recreation
|
|
160
|
+
--skip-app-recreation (optional) Skips the recreation of private apps if they already exist.
|
|
159
161
|
--skip-audit Skips the audit fix that occurs during an import operation.
|
|
160
162
|
--skip-existing Skips the module exists warning messages.
|
|
161
163
|
|
|
@@ -55,7 +55,7 @@ ImportCommand.examples = [
|
|
|
55
55
|
ImportCommand.flags = {
|
|
56
56
|
config: cli_utilities_1.flags.string({
|
|
57
57
|
char: 'c',
|
|
58
|
-
description: '[optional]
|
|
58
|
+
description: '[optional] The path of the configuration JSON file containing all the options for a single run.',
|
|
59
59
|
}),
|
|
60
60
|
'stack-uid': cli_utilities_1.flags.string({
|
|
61
61
|
char: 's',
|
|
@@ -65,7 +65,7 @@ ImportCommand.flags = {
|
|
|
65
65
|
}),
|
|
66
66
|
'stack-api-key': cli_utilities_1.flags.string({
|
|
67
67
|
char: 'k',
|
|
68
|
-
description: 'API
|
|
68
|
+
description: 'API Key of the target stack',
|
|
69
69
|
}),
|
|
70
70
|
data: cli_utilities_1.flags.string({
|
|
71
71
|
description: 'path and location where data is stored',
|
|
@@ -108,7 +108,7 @@ ImportCommand.flags = {
|
|
|
108
108
|
parse: (0, cli_utilities_1.printFlagDeprecation)(['-B'], ['--branch']),
|
|
109
109
|
}),
|
|
110
110
|
'import-webhook-status': cli_utilities_1.flags.string({
|
|
111
|
-
description: '[
|
|
111
|
+
description: '[default: disable] (optional) This webhook state keeps the same state of webhooks as the source stack. <options: disable|current>',
|
|
112
112
|
options: ['disable', 'current'],
|
|
113
113
|
required: false,
|
|
114
114
|
default: 'disable',
|
|
@@ -119,7 +119,7 @@ ImportCommand.flags = {
|
|
|
119
119
|
description: '[optional] Force override all Marketplace prompts.',
|
|
120
120
|
}),
|
|
121
121
|
'skip-app-recreation': cli_utilities_1.flags.boolean({
|
|
122
|
-
description: '
|
|
122
|
+
description: '(optional) Skips the recreation of private apps if they already exist.',
|
|
123
123
|
}),
|
|
124
124
|
'replace-existing': cli_utilities_1.flags.boolean({
|
|
125
125
|
required: false,
|
|
@@ -132,7 +132,7 @@ ImportCommand.flags = {
|
|
|
132
132
|
}),
|
|
133
133
|
'personalize-project-name': cli_utilities_1.flags.string({
|
|
134
134
|
required: false,
|
|
135
|
-
description: 'Personalize project
|
|
135
|
+
description: '(optional) Provide a unique name for the Personalize project.',
|
|
136
136
|
}),
|
|
137
137
|
'skip-audit': cli_utilities_1.flags.boolean({
|
|
138
138
|
description: 'Skips the audit fix that occurs during an import operation.',
|
|
@@ -210,7 +210,8 @@ class ImportMarketplaceApps {
|
|
|
210
210
|
.marketplace(this.importConfig.org_uid)
|
|
211
211
|
.installation(app.uid)
|
|
212
212
|
.fetch()
|
|
213
|
-
.catch(() => { }); // NOTE Keeping this to avoid Unhandled
|
|
213
|
+
.catch(() => { }); // NOTE Keeping this to avoid Unhandled exce
|
|
214
|
+
// ption
|
|
214
215
|
return !(0, isEmpty_1.default)(installation);
|
|
215
216
|
}
|
|
216
217
|
/**
|
|
@@ -11,6 +11,7 @@ const _ = tslib_1.__importStar(require("lodash"));
|
|
|
11
11
|
const config_1 = tslib_1.__importDefault(require("../config"));
|
|
12
12
|
const fileHelper = tslib_1.__importStar(require("./file-helper"));
|
|
13
13
|
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
14
|
+
const log_1 = require("./log");
|
|
14
15
|
// update references in entry object
|
|
15
16
|
const lookupEntries = function (data, mappedUids, uidMapperPath) {
|
|
16
17
|
let parent = [];
|
|
@@ -212,6 +213,9 @@ const lookupEntries = function (data, mappedUids, uidMapperPath) {
|
|
|
212
213
|
entry = entry.replace(uidRegex, escapedMappedUid);
|
|
213
214
|
mapped.push(uid);
|
|
214
215
|
}
|
|
216
|
+
else {
|
|
217
|
+
(0, log_1.log)(`Skipping the entry uid ${uid} since the regex is not valid`, 'warn');
|
|
218
|
+
}
|
|
215
219
|
}
|
|
216
220
|
else {
|
|
217
221
|
unmapped.push(uid);
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.19.
|
|
2
|
+
"version": "1.19.4",
|
|
3
3
|
"commands": {
|
|
4
4
|
"cm:stacks:import": {
|
|
5
5
|
"id": "cm:stacks:import",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"name": "config",
|
|
29
29
|
"type": "option",
|
|
30
30
|
"char": "c",
|
|
31
|
-
"description": "[optional]
|
|
31
|
+
"description": "[optional] The path of the configuration JSON file containing all the options for a single run.",
|
|
32
32
|
"multiple": false
|
|
33
33
|
},
|
|
34
34
|
"stack-uid": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"name": "stack-api-key",
|
|
44
44
|
"type": "option",
|
|
45
45
|
"char": "k",
|
|
46
|
-
"description": "API
|
|
46
|
+
"description": "API Key of the target stack",
|
|
47
47
|
"multiple": false
|
|
48
48
|
},
|
|
49
49
|
"data": {
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"import-webhook-status": {
|
|
108
108
|
"name": "import-webhook-status",
|
|
109
109
|
"type": "option",
|
|
110
|
-
"description": "[
|
|
110
|
+
"description": "[default: disable] (optional) This webhook state keeps the same state of webhooks as the source stack. <options: disable|current>",
|
|
111
111
|
"required": false,
|
|
112
112
|
"multiple": false,
|
|
113
113
|
"options": [
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"skip-app-recreation": {
|
|
128
128
|
"name": "skip-app-recreation",
|
|
129
129
|
"type": "boolean",
|
|
130
|
-
"description": "
|
|
130
|
+
"description": "(optional) Skips the recreation of private apps if they already exist.",
|
|
131
131
|
"allowNo": false
|
|
132
132
|
},
|
|
133
133
|
"replace-existing": {
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"personalize-project-name": {
|
|
148
148
|
"name": "personalize-project-name",
|
|
149
149
|
"type": "option",
|
|
150
|
-
"description": "Personalize project
|
|
150
|
+
"description": "(optional) Provide a unique name for the Personalize project.",
|
|
151
151
|
"required": false,
|
|
152
152
|
"multiple": false
|
|
153
153
|
},
|
package/package.json
CHANGED
|
@@ -1,53 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-cm-import",
|
|
3
3
|
"description": "Contentstack CLI plugin to import content into stack",
|
|
4
|
-
"version": "1.19.
|
|
4
|
+
"version": "1.19.4",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@contentstack/cli-audit": "~1.7.
|
|
9
|
-
"@contentstack/cli-command": "~1.3.
|
|
10
|
-
"@contentstack/cli-utilities": "~1.8.
|
|
11
|
-
"@contentstack/management": "~1.18.
|
|
12
|
-
"@contentstack/cli-variants": "~1.1.
|
|
8
|
+
"@contentstack/cli-audit": "~1.7.5",
|
|
9
|
+
"@contentstack/cli-command": "~1.3.3",
|
|
10
|
+
"@contentstack/cli-utilities": "~1.8.1",
|
|
11
|
+
"@contentstack/management": "~1.18.4",
|
|
12
|
+
"@contentstack/cli-variants": "~1.1.5",
|
|
13
13
|
"@oclif/core": "^3.27.0",
|
|
14
14
|
"big-json": "^3.2.0",
|
|
15
15
|
"bluebird": "^3.7.2",
|
|
16
16
|
"chalk": "^4.1.2",
|
|
17
|
-
"debug": "^4.
|
|
17
|
+
"debug": "^4.4.0",
|
|
18
18
|
"fs-extra": "^11.2.0",
|
|
19
19
|
"lodash": "^4.17.21",
|
|
20
20
|
"marked": "^4.3.0",
|
|
21
21
|
"merge": "^2.1.1",
|
|
22
22
|
"mkdirp": "^1.0.4",
|
|
23
23
|
"promise-limit": "^2.7.0",
|
|
24
|
-
"tslib": "^2.8.1",
|
|
25
24
|
"uuid": "^9.0.1",
|
|
26
25
|
"winston": "^3.17.0"
|
|
27
26
|
},
|
|
28
27
|
"devDependencies": {
|
|
29
|
-
"@oclif/test": "^4.1.
|
|
28
|
+
"@oclif/test": "^4.1.6",
|
|
30
29
|
"@types/big-json": "^3.2.5",
|
|
31
30
|
"@types/bluebird": "^3.5.42",
|
|
32
|
-
"@types/chai": "^4.3.20",
|
|
33
31
|
"@types/fs-extra": "^11.0.4",
|
|
34
32
|
"@types/mkdirp": "^1.0.2",
|
|
35
33
|
"@types/mocha": "^8.2.3",
|
|
36
34
|
"@types/node": "^14.18.63",
|
|
37
|
-
"@types/sinon": "^10.0.20",
|
|
38
35
|
"@types/tar": "^6.1.13",
|
|
39
36
|
"@types/uuid": "^9.0.8",
|
|
40
37
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
41
|
-
"chai": "^4.5.0",
|
|
42
38
|
"eslint": "^8.57.1",
|
|
43
39
|
"eslint-config-oclif": "^4.0.0",
|
|
44
|
-
"globby": "^10.0.2",
|
|
45
40
|
"mocha": "^10.8.2",
|
|
46
41
|
"nyc": "^15.1.0",
|
|
47
42
|
"oclif": "^3.17.2",
|
|
48
|
-
"rimraf": "^2.7.1",
|
|
49
|
-
"sinon": "^19.0.2",
|
|
50
|
-
"tmp": "^0.2.3",
|
|
51
43
|
"ts-node": "^10.9.2",
|
|
52
44
|
"typescript": "^4.9.5"
|
|
53
45
|
},
|