@contentstack/cli-cm-bulk-publish 1.7.4 → 1.8.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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@contentstack/cli-cm-bulk-publish",
3
3
  "description": "Contentstack CLI plugin for bulk publish actions",
4
- "version": "1.7.4",
4
+ "version": "1.8.0",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
8
- "@contentstack/cli-command": "~1.3.3",
9
- "@contentstack/cli-utilities": "~1.9.0",
8
+ "@contentstack/cli-command": "~1.5.0",
9
+ "@contentstack/cli-utilities": "~1.11.0",
10
10
  "chalk": "^4.1.2",
11
11
  "dotenv": "^16.4.7",
12
12
  "inquirer": "8.2.6",
@@ -17,10 +17,10 @@
17
17
  "@oclif/test": "^4.1.6",
18
18
  "chai": "^4.5.0",
19
19
  "eslint": "^8.57.1",
20
- "eslint-config-oclif": "^4.0.0",
20
+ "eslint-config-oclif": "^6.0.15",
21
21
  "mocha": "^10.8.2",
22
22
  "nyc": "^15.1.0",
23
- "oclif": "^3.17.2"
23
+ "oclif": "^4.17.30"
24
24
  },
25
25
  "engines": {
26
26
  "node": ">=14.0.0"
@@ -15,7 +15,7 @@ class AssetsPublishCommand extends Command {
15
15
  assetsFlags.folderUid = assetsFlags['folder-uid'] || assetsFlags.folderUid;
16
16
  assetsFlags.bulkPublish = assetsFlags['bulk-publish'] || assetsFlags.bulkPublish;
17
17
  assetsFlags.apiVersion = assetsFlags['api-version'] || '3'; // setting default value for apiVersion
18
- delete assetsFlags['api-version']
18
+ delete assetsFlags['api-version'];
19
19
  delete assetsFlags['retry-failed'];
20
20
  delete assetsFlags['folder-uid'];
21
21
  delete assetsFlags['bulk-publish'];
@@ -143,7 +143,7 @@ class AssetsPublishCommand extends Command {
143
143
  if (data.yes) {
144
144
  return true;
145
145
  }
146
- return cliux.confirm('Do you want to continue with this configuration ? [yes or no]');
146
+ return await cliux.confirm('Do you want to continue with this configuration ? [yes or no]');
147
147
  }
148
148
  }
149
149
 
@@ -157,7 +157,8 @@ But, if retryFailed flag is set, then only a logfile is required
157
157
  AssetsPublishCommand.flags = {
158
158
  alias: flags.string({
159
159
  char: 'a',
160
- description: 'Alias (name) for the management token. You must use either the --alias flag or the --stack-api-key flag.',
160
+ description:
161
+ 'Alias (name) for the management token. You must use either the --alias flag or the --stack-api-key flag.',
161
162
  }),
162
163
  'stack-api-key': flags.string({
163
164
  char: 'k',
@@ -165,15 +166,18 @@ AssetsPublishCommand.flags = {
165
166
  required: false,
166
167
  }),
167
168
  'retry-failed': flags.string({
168
- description: 'Use this option to retry publishing the failed assets from the logfile. Specify the name of the logfile that lists failed publish calls. If this option is used, it will override all other flags.',
169
+ description:
170
+ 'Use this option to retry publishing the failed assets from the logfile. Specify the name of the logfile that lists failed publish calls. If this option is used, it will override all other flags.',
169
171
  }),
170
172
  environments: flags.string({
171
173
  char: 'e',
172
- description: 'The name of the environment on which entries will be published. In case of multiple environments, specify their names separated by spaces.',
174
+ description:
175
+ 'The name of the environment on which entries will be published. In case of multiple environments, specify their names separated by spaces.',
173
176
  multiple: true,
174
177
  }),
175
178
  'folder-uid': flags.string({
176
- description: '(optional) The UID of the Assets’ folder from which the assets need to be published. The default value is cs_root.',
179
+ description:
180
+ '(optional) The UID of the Assets’ folder from which the assets need to be published. The default value is cs_root.',
177
181
  exclusive: ['source-env'],
178
182
  }),
179
183
  'bulk-publish': flags.string({
@@ -182,7 +186,8 @@ AssetsPublishCommand.flags = {
182
186
  }),
183
187
  config: flags.string({
184
188
  char: 'c',
185
- description: '(optional) The path of the optional configuration JSON file containing all the options for a single run. Refer to the configure command to create a configuration file.',
189
+ description:
190
+ '(optional) The path of the optional configuration JSON file containing all the options for a single run. Refer to the configure command to create a configuration file.',
186
191
  }),
187
192
  yes: flags.boolean({
188
193
  char: 'y',
@@ -190,17 +195,19 @@ AssetsPublishCommand.flags = {
190
195
  }),
191
196
  locales: flags.string({
192
197
  char: 'l',
193
- description: 'Locales in which assets will be published, e.g., en-us. In the case of multiple locales, specify the codes separated by spaces.',
198
+ description:
199
+ 'Locales in which assets will be published, e.g., en-us. In the case of multiple locales, specify the codes separated by spaces.',
194
200
  multiple: true,
195
201
  parse: printFlagDeprecation(['-l'], ['--locales']),
196
202
  }),
197
203
  branch: flags.string({
198
204
  char: 'B',
199
205
  default: 'main',
200
- description: 'The name of the branch where you want to perform the bulk publish operation. If you don’t mention the branch name, then by default the assets from the main branch will be published.',
206
+ description:
207
+ 'The name of the branch where you want to perform the bulk publish operation. If you don’t mention the branch name, then by default the assets from the main branch will be published.',
201
208
  parse: printFlagDeprecation(['-B'], ['--branch']),
202
209
  }),
203
-
210
+
204
211
  // To be deprecated
205
212
  retryFailed: flags.string({
206
213
  char: 'r',
@@ -217,13 +224,14 @@ AssetsPublishCommand.flags = {
217
224
  }),
218
225
  bulkPublish: flags.string({
219
226
  char: 'b',
220
- description: "By default this flag is set as true. It indicates that Contentstack's bulk publish API will be used to publish the entries.",
227
+ description:
228
+ "By default this flag is set as true. It indicates that Contentstack's bulk publish API will be used to publish the entries.",
221
229
  default: 'true',
222
230
  hidden: true,
223
231
  parse: printFlagDeprecation(['-b', '--bulkPublish'], ['--bulk-publish']),
224
232
  }),
225
233
  'api-version': flags.string({
226
- description: "API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].",
234
+ description: 'API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].',
227
235
  }),
228
236
  'delivery-token': flags.string({ description: 'The delivery token of the source environment.' }),
229
237
  'source-env': flags.string({ description: 'Source environment' }),
@@ -18,7 +18,7 @@ class UnpublishCommand extends Command {
18
18
  unpublishFlags.apiVersion = unpublishFlags['api-version'] || '3';
19
19
  unpublishFlags.onlyAssets = true;
20
20
  unpublishFlags.onlyEntries = false;
21
- delete unpublishFlags['api-version']
21
+ delete unpublishFlags['api-version'];
22
22
  delete unpublishFlags['retry-failed'];
23
23
  delete unpublishFlags['bulk-unpublish'];
24
24
  delete unpublishFlags['delivery-token'];
@@ -121,7 +121,7 @@ class UnpublishCommand extends Command {
121
121
  return true;
122
122
  }
123
123
 
124
- return cliux.confirm('Do you want to continue with this configuration ? [yes or no]');
124
+ return await cliux.confirm('Do you want to continue with this configuration ? [yes or no]');
125
125
  }
126
126
  }
127
127
 
@@ -134,7 +134,8 @@ But, if retry-failed flag is set, then only a logfile is required`;
134
134
  UnpublishCommand.flags = {
135
135
  alias: flags.string({
136
136
  char: 'a',
137
- description: 'Alias (name) of the management token. You must use either the --alias flag or the --stack-api-key flag.',
137
+ description:
138
+ 'Alias (name) of the management token. You must use either the --alias flag or the --stack-api-key flag.',
138
139
  }),
139
140
  'stack-api-key': flags.string({
140
141
  char: 'k',
@@ -147,7 +148,8 @@ UnpublishCommand.flags = {
147
148
  }),
148
149
  config: flags.string({
149
150
  char: 'c',
150
- description: '(optional) Path of an optional configuration JSON file containing all the options for a single run. Refer to the configure command to create a configuration file.',
151
+ description:
152
+ '(optional) Path of an optional configuration JSON file containing all the options for a single run. Refer to the configure command to create a configuration file.',
151
153
  }),
152
154
  yes: flags.boolean({
153
155
  char: 'y',
@@ -158,10 +160,12 @@ UnpublishCommand.flags = {
158
160
  }),
159
161
  branch: flags.string({
160
162
  default: 'main',
161
- description: 'The name of the branch where you want to perform the bulk unpublish operation. If you don’t mention the branch name, then by default the content from the main branch will be unpublished.',
163
+ description:
164
+ 'The name of the branch where you want to perform the bulk unpublish operation. If you don’t mention the branch name, then by default the content from the main branch will be unpublished.',
162
165
  }),
163
166
  'retry-failed': flags.string({
164
- description: '(optional) Use this option to retry unpublishing the failed entries from the logfile. Specify the name of the logfile that lists failed unpublish calls. If this option is used, it will override all other flags.',
167
+ description:
168
+ '(optional) Use this option to retry unpublishing the failed entries from the logfile. Specify the name of the logfile that lists failed unpublish calls. If this option is used, it will override all other flags.',
165
169
  }),
166
170
  'bulk-unpublish': flags.string({
167
171
  description: 'Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by default.',
@@ -119,7 +119,7 @@ class CrossPublishCommand extends Command {
119
119
  if (data.yes) {
120
120
  return true;
121
121
  }
122
- return cliux.confirm('Do you want to continue with this configuration ? [yes or no]');
122
+ return await cliux.confirm('Do you want to continue with this configuration ? [yes or no]');
123
123
  }
124
124
 
125
125
  flagsAdapter(_flags) {
@@ -189,14 +189,12 @@ CrossPublishCommand.flags = {
189
189
  bulkPublish: flags.string({
190
190
  char: 'b',
191
191
  hidden: true,
192
- description:
193
- "Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by default.",
192
+ description: 'Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by default.',
194
193
  default: 'true',
195
194
  parse: printFlagDeprecation(['--bulkPublish', '-b'], ['--bulk-publish']),
196
195
  }),
197
196
  'bulk-publish': flags.string({
198
- description:
199
- "Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by default.",
197
+ description: 'Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by default.',
200
198
  default: 'true',
201
199
  }),
202
200
  'api-version': flags.string({
@@ -17,7 +17,7 @@ class PublishModifiedCommand extends Command {
17
17
  entryEditsFlags.bulkPublish = entryEditsFlags['bulk-publish'] || entryEditsFlags.bulkPublish;
18
18
  entryEditsFlags.sourceEnv = entryEditsFlags['source-env'] || entryEditsFlags.sourceEnv;
19
19
  entryEditsFlags.apiVersion = entryEditsFlags['api-version'] || '3';
20
- delete entryEditsFlags['api-version']
20
+ delete entryEditsFlags['api-version'];
21
21
  delete entryEditsFlags['retry-failed'];
22
22
  delete entryEditsFlags['content-types'];
23
23
  delete entryEditsFlags['bulk-publish'];
@@ -112,7 +112,7 @@ class PublishModifiedCommand extends Command {
112
112
  if (data.yes) {
113
113
  return true;
114
114
  }
115
- return cliux.confirm('Do you want to continue with this configuration ? [yes or no]');
115
+ return await cliux.confirm('Do you want to continue with this configuration ? [yes or no]');
116
116
  }
117
117
  }
118
118
 
@@ -125,7 +125,11 @@ But, if retry-failed flag is set, then only a logfile is required
125
125
  `;
126
126
 
127
127
  PublishModifiedCommand.flags = {
128
- alias: flags.string({ char: 'a', description: 'Alias (name) of the management token. You must use either the --alias flag or the --stack-api-key flag.' }),
128
+ alias: flags.string({
129
+ char: 'a',
130
+ description:
131
+ 'Alias (name) of the management token. You must use either the --alias flag or the --stack-api-key flag.',
132
+ }),
129
133
  'stack-api-key': flags.string({
130
134
  char: 'k',
131
135
  description: 'API key of the source stack. You must use either the --stack-api-key flag or the --alias flag.',
@@ -133,27 +137,27 @@ PublishModifiedCommand.flags = {
133
137
  }),
134
138
  retryFailed: flags.string({
135
139
  char: 'r',
136
- description: '(optional) Use this option to retry publishing the failed entries/assets from the logfile. Specify the name of the logfile that lists failed publish calls. If this option is used, it will override all other flags',
140
+ description:
141
+ '(optional) Use this option to retry publishing the failed entries/assets from the logfile. Specify the name of the logfile that lists failed publish calls. If this option is used, it will override all other flags',
137
142
  hidden: true,
138
143
  parse: printFlagDeprecation(['-r', '--retryFailed'], ['--retry-failed']),
139
144
  }),
140
145
  'retry-failed': flags.string({
141
- description: '(optional) Use this option to retry publishing the failed entries/assets from the logfile. Specify the name of the logfile that lists failed publish calls. If this option is used, it will override all other flags',
146
+ description:
147
+ '(optional) Use this option to retry publishing the failed entries/assets from the logfile. Specify the name of the logfile that lists failed publish calls. If this option is used, it will override all other flags',
142
148
  }),
143
149
  bulkPublish: flags.string({
144
150
  char: 'b',
145
- description:
146
- "Set this flag to use Contentstack\'s Bulk Publish APIs. It is true, by default.",
151
+ description: "Set this flag to use Contentstack\'s Bulk Publish APIs. It is true, by default.",
147
152
  hidden: true,
148
153
  parse: printFlagDeprecation(['-b', '--bulkPublish'], ['--bulk-publish']),
149
154
  }),
150
155
  'bulk-publish': flags.string({
151
- description:
152
- "Set this flag to use Contentstack\'s Bulk Publish APIs. It is true, by default.",
156
+ description: "Set this flag to use Contentstack\'s Bulk Publish APIs. It is true, by default.",
153
157
  default: 'true',
154
158
  }),
155
159
  'api-version': flags.string({
156
- description : "API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].",
160
+ description: 'API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].',
157
161
  }),
158
162
  sourceEnv: flags.string({
159
163
  char: 's',
@@ -166,28 +170,44 @@ PublishModifiedCommand.flags = {
166
170
  }),
167
171
  contentTypes: flags.string({
168
172
  char: 't',
169
- description: 'The UID of the content type(s) whose edited entries you want to publish in bulk. In case of multiple content types, specify the IDs separated by spaces.',
173
+ description:
174
+ 'The UID of the content type(s) whose edited entries you want to publish in bulk. In case of multiple content types, specify the IDs separated by spaces.',
170
175
  multiple: true,
171
176
  parse: printFlagDeprecation(['-t', '--contentTypes'], ['--content-types']),
172
177
  hidden: true,
173
178
  }),
174
179
  'content-types': flags.string({
175
- description: 'The UID of the content type(s) whose edited entries you want to publish in bulk. In case of multiple content types, specify the IDs separated by spaces.',
180
+ description:
181
+ 'The UID of the content type(s) whose edited entries you want to publish in bulk. In case of multiple content types, specify the IDs separated by spaces.',
176
182
  multiple: true,
177
183
  }),
178
184
  locales: flags.string({
179
185
  char: 'l',
180
- description: 'Locales in which entries will be published, e.g., en-us. In the case of multiple locales, specify the codes separated by spaces.',
186
+ description:
187
+ 'Locales in which entries will be published, e.g., en-us. In the case of multiple locales, specify the codes separated by spaces.',
181
188
  multiple: true,
182
189
  parse: printFlagDeprecation(['-l'], ['--locales']),
183
190
  }),
184
- environments: flags.string({ char: 'e', description: 'The name of the environment(s) on which the entries will be published. In case of multiple environments, specify their names separated by spaces.', multiple: true }),
185
- config: flags.string({ char: 'c', description: '(optional) The path of the optional configuration JSON file containing all the options for a single run. Refer to the configure command to create a configuration file.' }),
186
- yes: flags.boolean({ char: 'y', description: 'Set it to true to process the command with the current configuration.' }),
191
+ environments: flags.string({
192
+ char: 'e',
193
+ description:
194
+ 'The name of the environment(s) on which the entries will be published. In case of multiple environments, specify their names separated by spaces.',
195
+ multiple: true,
196
+ }),
197
+ config: flags.string({
198
+ char: 'c',
199
+ description:
200
+ '(optional) The path of the optional configuration JSON file containing all the options for a single run. Refer to the configure command to create a configuration file.',
201
+ }),
202
+ yes: flags.boolean({
203
+ char: 'y',
204
+ description: 'Set it to true to process the command with the current configuration.',
205
+ }),
187
206
  branch: flags.string({
188
207
  char: 'B',
189
208
  default: 'main',
190
- description: 'The name of the branch where you want to perform the bulk publish operation. If you don\'t mention the branch name, then by default the entries from main branch will be published.',
209
+ description:
210
+ "The name of the branch where you want to perform the bulk publish operation. If you don't mention the branch name, then by default the entries from main branch will be published.",
191
211
  parse: printFlagDeprecation(['-B'], ['--branch']),
192
212
  }),
193
213
  };
@@ -19,9 +19,9 @@ class NonlocalizedFieldChangesCommand extends Command {
19
19
  nonlocalizedFieldChangesFlags['source-env'] || nonlocalizedFieldChangesFlags.sourceEnv;
20
20
  nonlocalizedFieldChangesFlags.contentTypes =
21
21
  nonlocalizedFieldChangesFlags['content-types'] || nonlocalizedFieldChangesFlags.contentTypes;
22
- nonlocalizedFieldChangesFlags.apiVersion = nonlocalizedFieldChangesFlags['api-version'] || '3';
23
-
24
- delete nonlocalizedFieldChangesFlags['api-version']
22
+ nonlocalizedFieldChangesFlags.apiVersion = nonlocalizedFieldChangesFlags['api-version'] || '3';
23
+
24
+ delete nonlocalizedFieldChangesFlags['api-version'];
25
25
  delete nonlocalizedFieldChangesFlags['retry-failed'];
26
26
  delete nonlocalizedFieldChangesFlags['bulk-publish'];
27
27
  delete nonlocalizedFieldChangesFlags['source-env'];
@@ -116,7 +116,7 @@ class NonlocalizedFieldChangesCommand extends Command {
116
116
  if (data.yes) {
117
117
  return true;
118
118
  }
119
- return cliux.confirm('Do you want to continue with this configuration ? [yes or no]');
119
+ return await cliux.confirm('Do you want to continue with this configuration ? [yes or no]');
120
120
  }
121
121
  }
122
122
 
@@ -129,7 +129,8 @@ But, if retryFailed flag is set, then only a logfile is required`;
129
129
  NonlocalizedFieldChangesCommand.flags = {
130
130
  alias: flags.string({
131
131
  char: 'a',
132
- description: 'Alias (name) of the management token. You must use either the --alias flag or the --stack-api-key flag.',
132
+ description:
133
+ 'Alias (name) of the management token. You must use either the --alias flag or the --stack-api-key flag.',
133
134
  }),
134
135
  'stack-api-key': flags.string({
135
136
  char: 'k',
@@ -137,27 +138,31 @@ NonlocalizedFieldChangesCommand.flags = {
137
138
  required: false,
138
139
  }),
139
140
  'retry-failed': flags.string({
140
- description: 'Use this option to retry publishing the failed entries from the logfile. Specify the name of the logfile that lists failed publish calls. If this option is used, it will override all other flags.',
141
+ description:
142
+ 'Use this option to retry publishing the failed entries from the logfile. Specify the name of the logfile that lists failed publish calls. If this option is used, it will override all other flags.',
141
143
  }),
142
144
  'bulk-publish': flags.string({
143
- description: "Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by default.",
145
+ description: 'Set this flag to use Contentstack’s Bulk Publish APIs. It is true, by default.',
144
146
  default: 'true',
145
147
  }),
146
148
  'source-env': flags.string({
147
149
  description: 'The name of the source environment.',
148
150
  }),
149
151
  'content-types': flags.string({
150
- description: 'The UID of the content type whose entries you want to publish in bulk. In case of multiple content types, specify their IDs separated by spaces.',
152
+ description:
153
+ 'The UID of the content type whose entries you want to publish in bulk. In case of multiple content types, specify their IDs separated by spaces.',
151
154
  multiple: true,
152
155
  }),
153
156
  environments: flags.string({
154
157
  char: 'e',
155
- description: 'The name of the environment on which entries will be published. In case of multiple environments, specify their names separated by spaces.',
158
+ description:
159
+ 'The name of the environment on which entries will be published. In case of multiple environments, specify their names separated by spaces.',
156
160
  multiple: true,
157
161
  }),
158
162
  config: flags.string({
159
163
  char: 'c',
160
- description: '(optional) The path of the optional configuration JSON file containing all the options for a single run. Refer to the configure command to create a configuration file.',
164
+ description:
165
+ '(optional) The path of the optional configuration JSON file containing all the options for a single run. Refer to the configure command to create a configuration file.',
161
166
  }),
162
167
  yes: flags.boolean({
163
168
  char: 'y',
@@ -166,7 +171,8 @@ NonlocalizedFieldChangesCommand.flags = {
166
171
  branch: flags.string({
167
172
  char: 'B',
168
173
  default: 'main',
169
- description: 'The name of the branch where you want to perform the bulk publish operation. If you don’t mention the branch name, then by default the content from the main branch will be published.',
174
+ description:
175
+ 'The name of the branch where you want to perform the bulk publish operation. If you don’t mention the branch name, then by default the content from the main branch will be published.',
170
176
  parse: printFlagDeprecation(['-B'], ['--branch']),
171
177
  }),
172
178
 
@@ -179,13 +185,14 @@ NonlocalizedFieldChangesCommand.flags = {
179
185
  }),
180
186
  bulkPublish: flags.string({
181
187
  char: 'b',
182
- description: "This flag is set to true by default. It indicates that Contentstack's bulk publish API will be used to publish the entries.",
188
+ description:
189
+ "This flag is set to true by default. It indicates that Contentstack's bulk publish API will be used to publish the entries.",
183
190
  default: 'true',
184
191
  hidden: true,
185
192
  parse: printFlagDeprecation(['-b', '--bulkPublish'], ['--bulk-publish']),
186
193
  }),
187
194
  'api-version': flags.string({
188
- description: "API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].",
195
+ description: 'API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].',
189
196
  }),
190
197
  sourceEnv: flags.string({
191
198
  char: 's',
@@ -163,7 +163,7 @@ class PublishEntriesCommand extends Command {
163
163
  return true;
164
164
  }
165
165
 
166
- return cliux.confirm('Do you want to continue with this configuration ? [yes or no]');
166
+ return await cliux.confirm('Do you want to continue with this configuration ? [yes or no]');
167
167
  }
168
168
  }
169
169
 
@@ -176,7 +176,11 @@ But, if retry-failed flag is set, then only a logfile is required
176
176
  `;
177
177
 
178
178
  PublishEntriesCommand.flags = {
179
- alias: flags.string({ char: 'a', description: 'Alias (name) of the management token. You must use either the --alias flag or the --stack-api-key flag.' }),
179
+ alias: flags.string({
180
+ char: 'a',
181
+ description:
182
+ 'Alias (name) of the management token. You must use either the --alias flag or the --stack-api-key flag.',
183
+ }),
180
184
  'stack-api-key': flags.string({
181
185
  char: 'k',
182
186
  description: 'API key of the source stack. You must use either the --stack-api-key flag or the --alias flag.',
@@ -199,42 +203,47 @@ PublishEntriesCommand.flags = {
199
203
  parse: printFlagDeprecation(['-b', '--bulkPublish'], ['--bulk-publish']),
200
204
  }),
201
205
  'bulk-publish': flags.string({
202
- description:
203
- `Set this flag to use Contentstack\'s Bulk Publish APIs. This flag is set to true, by default.`,
206
+ description: `Set this flag to use Contentstack\'s Bulk Publish APIs. This flag is set to true, by default.`,
204
207
  default: 'true',
205
208
  }),
206
209
  'api-version': flags.string({
207
- description : 'API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].',
210
+ description: 'API version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].',
208
211
  }),
209
212
  'publish-all-content-types': flags.boolean({
210
- description: '(optional) Set it to true to bulk publish entries from all content types. If the --content-types option is already used, then you cannot use this option.',
213
+ description:
214
+ '(optional) Set it to true to bulk publish entries from all content types. If the --content-types option is already used, then you cannot use this option.',
211
215
  }),
212
216
  publishAllContentTypes: flags.boolean({
213
217
  char: 'o',
214
- description: '(optional) Set it to true to bulk publish entries from all content types. If the --content-types option is already used, then you cannot use this option.',
218
+ description:
219
+ '(optional) Set it to true to bulk publish entries from all content types. If the --content-types option is already used, then you cannot use this option.',
215
220
  hidden: true,
216
221
  parse: printFlagDeprecation(['-o', '--publishAllContentTypes'], ['--publish-all-content-types']),
217
222
  }),
218
223
  'content-types': flags.string({
219
- description: 'The UID of the content type(s) whose entries you want to publish in bulk. In case of multiple content types, specify the IDs separated by spaces.',
224
+ description:
225
+ 'The UID of the content type(s) whose entries you want to publish in bulk. In case of multiple content types, specify the IDs separated by spaces.',
220
226
  multiple: true,
221
227
  }),
222
228
  contentTypes: flags.string({
223
229
  char: 't',
224
- description: 'The UID of the content type(s) whose entries you want to publish in bulk. In case of multiple content types, specify the IDs separated by spaces.',
230
+ description:
231
+ 'The UID of the content type(s) whose entries you want to publish in bulk. In case of multiple content types, specify the IDs separated by spaces.',
225
232
  multiple: true,
226
233
  parse: printFlagDeprecation(['-t', '--contentTypes'], ['--content-types']),
227
234
  hidden: true,
228
235
  }),
229
236
  locales: flags.string({
230
237
  char: 'l',
231
- description: ' Locales in which entries will be published, e.g., en-us. In the case of multiple locales, specify the codes separated by spaces.',
238
+ description:
239
+ ' Locales in which entries will be published, e.g., en-us. In the case of multiple locales, specify the codes separated by spaces.',
232
240
  multiple: true,
233
241
  parse: printFlagDeprecation(['-l'], ['--locales']),
234
242
  }),
235
243
  environments: flags.string({
236
244
  char: 'e',
237
- description: 'The name of the environment on which entries will be published. In case of multiple environments, specify their names separated by spaces.',
245
+ description:
246
+ 'The name of the environment on which entries will be published. In case of multiple environments, specify their names separated by spaces.',
238
247
  multiple: true,
239
248
  }),
240
249
  config: flags.string({
@@ -242,11 +251,15 @@ PublishEntriesCommand.flags = {
242
251
  description:
243
252
  '(optional) The path of the optional configuration JSON file containing all the options for a single run. Refer to the configure command to create a configuration file.',
244
253
  }),
245
- yes: flags.boolean({ char: 'y', description: 'Set it to true to process the command with the current configuration.' }),
254
+ yes: flags.boolean({
255
+ char: 'y',
256
+ description: 'Set it to true to process the command with the current configuration.',
257
+ }),
246
258
  branch: flags.string({
247
259
  char: 'B',
248
260
  default: 'main',
249
- description: 'The name of the branch where you want to perform the bulk publish operation. If you don’t mention the branch name, then by default the content from main branch will be published.',
261
+ description:
262
+ 'The name of the branch where you want to perform the bulk publish operation. If you don’t mention the branch name, then by default the content from main branch will be published.',
250
263
  parse: printFlagDeprecation(['-B'], ['--branch']),
251
264
  }),
252
265
  'delivery-token': flags.string({ description: 'The delivery token of the source environment.' }),
@@ -118,11 +118,11 @@ class UnpublishCommand extends Command {
118
118
  return true;
119
119
  }
120
120
  if (!data.contentType) {
121
- return cliux.confirm(
121
+ return await cliux.confirm(
122
122
  'Do you want to continue with this configuration. This will unpublish all the entries from all content types? [yes or no]',
123
123
  );
124
124
  } else {
125
- return cliux.confirm('Do you want to continue with this configuration ? [yes or no]');
125
+ return await cliux.confirm('Do you want to continue with this configuration ? [yes or no]');
126
126
  }
127
127
  }
128
128
  }
@@ -136,7 +136,8 @@ But, if retry-failed flag is set, then only a logfile is required`;
136
136
  UnpublishCommand.flags = {
137
137
  alias: flags.string({
138
138
  char: 'a',
139
- description: 'Alias (name) for the management token. You must use either the --alias flag or the --stack-api-key flag.',
139
+ description:
140
+ 'Alias (name) for the management token. You must use either the --alias flag or the --stack-api-key flag.',
140
141
  }),
141
142
  'stack-api-key': flags.string({
142
143
  char: 'k',
@@ -148,7 +149,8 @@ UnpublishCommand.flags = {
148
149
  }),
149
150
  config: flags.string({
150
151
  char: 'c',
151
- description: '(optional) Path to the configuration JSON file containing all options for a single run. Refer to the configure command to create a configuration file.',
152
+ description:
153
+ '(optional) Path to the configuration JSON file containing all options for a single run. Refer to the configure command to create a configuration file.',
152
154
  }),
153
155
  yes: flags.boolean({
154
156
  char: 'y',
@@ -162,10 +164,12 @@ UnpublishCommand.flags = {
162
164
  description: 'Specify the branch to fetch the content. If not mentioned, the main branch will be used by default.',
163
165
  }),
164
166
  'retry-failed': flags.string({
165
- description: '(optional) Use this option to retry unpublishing the failed entries from the logfile. Specify the name of the logfile that lists failed unpublish calls. If used, this option will override all other flags.',
167
+ description:
168
+ '(optional) Use this option to retry unpublishing the failed entries from the logfile. Specify the name of the logfile that lists failed unpublish calls. If used, this option will override all other flags.',
166
169
  }),
167
170
  'bulk-unpublish': flags.string({
168
- description: "This flag is set to true by default. It indicates that Contentstack's Bulk Publish APIs will be used to unpublish the entries.",
171
+ description:
172
+ "This flag is set to true by default. It indicates that Contentstack's Bulk Publish APIs will be used to unpublish the entries.",
169
173
  default: 'true',
170
174
  }),
171
175
  'api-version': flags.string({
@@ -177,9 +181,9 @@ UnpublishCommand.flags = {
177
181
  'delivery-token': flags.string({
178
182
  description: 'The delivery token of the source environment.',
179
183
  }),
180
- 'include-variants': flags.boolean({
184
+ 'include-variants': flags.boolean({
181
185
  default: false, // set the default value to false
182
- description: 'Include Variants flag will unpublish all associated variant entries.'
186
+ description: 'Include Variants flag will unpublish all associated variant entries.',
183
187
  }),
184
188
  };
185
189