@contentstack/cli-cm-bulk-publish 0.1.1-beta.2 → 0.1.1-beta.5

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
@@ -1,30 +1,33 @@
1
- @contentstack/cli-cm-bulk-publish
2
- ============
1
+ # @contentstack/cli-cm-bulk-publish
3
2
 
4
3
  It is Contentstack’s CLI plugin to perform bulk publish/unpublish operations on entries and assets in Contentstack. Refer to the [Bulk Publish and Unpublish documentation](https://www.contentstack.com/docs/developers/cli/bulk-publish-and-unpublish) to learn more about its commands.
5
4
 
6
5
  [![License](https://img.shields.io/npm/l/@contentstack/cli)](https://github.com/contentstack/cli/blob/main/LICENSE)
7
6
 
8
-
9
7
  <!-- toc -->
8
+ * [@contentstack/cli-cm-bulk-publish](#contentstackcli-cm-bulk-publish)
10
9
  * [Usage](#usage)
11
10
  * [Commands](#commands)
12
11
  <!-- tocstop -->
12
+
13
13
  # Usage
14
+
14
15
  <!-- usage -->
15
16
  ```sh-session
16
17
  $ npm install -g @contentstack/cli-cm-bulk-publish
17
18
  $ csdx COMMAND
18
19
  running command...
19
20
  $ csdx (-v|--version|version)
20
- @contentstack/cli-cm-bulk-publish/0.1.1-beta.2 darwin-x64 node-v14.9.0
21
+ @contentstack/cli-cm-bulk-publish/0.1.1-beta.5 linux-x64 node-v12.22.7
21
22
  $ csdx --help [COMMAND]
22
23
  USAGE
23
24
  $ csdx COMMAND
24
25
  ...
25
26
  ```
26
27
  <!-- usagestop -->
28
+
27
29
  # Commands
30
+
28
31
  <!-- commands -->
29
32
  * [`csdx cm:bulk-publish`](#csdx-cmbulk-publish)
30
33
  * [`csdx cm:bulk-publish:add-fields`](#csdx-cmbulk-publishadd-fields)
@@ -48,7 +51,7 @@ USAGE
48
51
  $ csdx cm:bulk-publish
49
52
  ```
50
53
 
51
- _See code: [src/commands/cm/bulk-publish/index.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.2/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/index.js)_
54
+ _See code: [src/commands/cm/bulk-publish/index.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.5/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/index.js)_
52
55
 
53
56
  ## `csdx cm:bulk-publish:add-fields`
54
57
 
@@ -59,6 +62,7 @@ USAGE
59
62
  $ csdx cm:bulk-publish:add-fields
60
63
 
61
64
  OPTIONS
65
+ -B, --branch=branch [default: main] Specify the branch to fetch the content from (default is main branch)
62
66
  -a, --alias=alias Alias for the management token to be used
63
67
 
64
68
  -b, --bulkPublish=bulkPublish [default: true] This flag is set to true by default. It indicates that contentstack's
@@ -97,9 +101,13 @@ EXAMPLES
97
101
  Using --retryFailed or -r flag
98
102
  csdx cm:bulk-publish:add-fields --retryFailed [LOG FILE NAME]
99
103
  csdx cm:bulk-publish:add-fields -r [LOG FILE NAME]
104
+
105
+ Using --branch or -B flag
106
+ csdx cm:bulk-publish:add-fields -t [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE 1]
107
+ [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] -B [BRANCH NAME]
100
108
  ```
101
109
 
102
- _See code: [src/commands/cm/bulk-publish/add-fields.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.2/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/add-fields.js)_
110
+ _See code: [src/commands/cm/bulk-publish/add-fields.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.5/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/add-fields.js)_
103
111
 
104
112
  ## `csdx cm:bulk-publish:assets`
105
113
 
@@ -110,6 +118,7 @@ USAGE
110
118
  $ csdx cm:bulk-publish:assets
111
119
 
112
120
  OPTIONS
121
+ -B, --branch=branch [default: main] Specify the branch to fetch the content from (default is main branch)
113
122
  -a, --alias=alias Alias for the management token to be used
114
123
 
115
124
  -b, --bulkPublish=bulkPublish [default: true] This flag is set to true by default. It indicates that contentstack's
@@ -146,9 +155,13 @@ EXAMPLES
146
155
  Using --retryFailed or -r flag
147
156
  csdx cm:bulk-publish:assets --retryFailed [LOG FILE NAME]
148
157
  csdx cm:bulk-publish:assets -r [LOG FILE NAME]
158
+
159
+ Using --branch or -B flag
160
+ csdx cm:bulk-publish:assets -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE] -a [MANAGEMENT TOKEN ALIAS] -B [BRANCH
161
+ NAME]
149
162
  ```
150
163
 
151
- _See code: [src/commands/cm/bulk-publish/assets.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.2/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/assets.js)_
164
+ _See code: [src/commands/cm/bulk-publish/assets.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.5/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/assets.js)_
152
165
 
153
166
  ## `csdx cm:bulk-publish:clear`
154
167
 
@@ -163,7 +176,7 @@ OPTIONS
163
176
  -y, --yes Delete all files without asking for confirmation
164
177
  ```
165
178
 
166
- _See code: [src/commands/cm/bulk-publish/clear.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.2/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/clear.js)_
179
+ _See code: [src/commands/cm/bulk-publish/clear.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.5/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/clear.js)_
167
180
 
168
181
  ## `csdx cm:bulk-publish:configure`
169
182
 
@@ -188,7 +201,7 @@ DESCRIPTION
188
201
  EXAMPLE : cm:bulk-publish:configure -a [MANAGEMENT TOKEN Alias]
189
202
  ```
190
203
 
191
- _See code: [src/commands/cm/bulk-publish/configure.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.2/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/configure.js)_
204
+ _See code: [src/commands/cm/bulk-publish/configure.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.5/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/configure.js)_
192
205
 
193
206
  ## `csdx cm:bulk-publish:cross-publish`
194
207
 
@@ -199,6 +212,9 @@ USAGE
199
212
  $ csdx cm:bulk-publish:cross-publish
200
213
 
201
214
  OPTIONS
215
+ -B, --branch=branch [default: main] Specify the branch to fetch the content from (default is main
216
+ branch)
217
+
202
218
  -a, --alias=alias Alias for the management token to be used
203
219
 
204
220
  -b, --bulkPublish=bulkPublish [default: true] This flag is set to true by default. It indicates that
@@ -221,6 +237,10 @@ OPTIONS
221
237
 
222
238
  -y, --yes Agree to process the command with the current configuration
223
239
 
240
+ --onlyAssets Unpublish only assets
241
+
242
+ --onlyEntries Unpublish only entries
243
+
224
244
  DESCRIPTION
225
245
  The cross-publish command is used for publishing entries and assets from one evironment to other environments
226
246
 
@@ -240,9 +260,13 @@ EXAMPLES
240
260
  Using --retryFailed or -r flag
241
261
  csdx cm:bulk-publish:cross-publish --retryFailed [LOG FILE NAME]
242
262
  csdx cm:bulk-publish:cross-publish -r [LOG FILE NAME]
263
+
264
+ Using --branch or -B flag
265
+ csdx cm:bulk-publish:cross-publish -t [CONTENT TYPE] -e [SOURCE ENV] -d [DESTINATION ENVIRONMENT] -l [LOCALE] -a
266
+ [MANAGEMENT TOKEN ALIAS] -x [DELIVERY TOKEN] -B [BRANCH NAME]
243
267
  ```
244
268
 
245
- _See code: [src/commands/cm/bulk-publish/cross-publish.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.2/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/cross-publish.js)_
269
+ _See code: [src/commands/cm/bulk-publish/cross-publish.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.5/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/cross-publish.js)_
246
270
 
247
271
  ## `csdx cm:bulk-publish:entries`
248
272
 
@@ -253,6 +277,7 @@ USAGE
253
277
  $ csdx cm:bulk-publish:entries
254
278
 
255
279
  OPTIONS
280
+ -B, --branch=branch [default: main] Specify the branch to fetch the content from (default is main branch)
256
281
  -a, --alias=alias Alias for the management token to be used
257
282
 
258
283
  -b, --bulkPublish=bulkPublish [default: true] This flag is set to true by default. It indicates that contentstack's
@@ -295,9 +320,13 @@ EXAMPLES
295
320
  Using --retryFailed or -r flag
296
321
  csdx cm:bulk-publish:entries --retryFailed [LOG FILE NAME]
297
322
  csdx cm:bulk-publish:entries -r [LOG FILE NAME]
323
+
324
+ Using --branch or -B flag
325
+ csdx cm:bulk-publish:entries -t [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE 1]
326
+ [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] -B [BRANCH NAME]
298
327
  ```
299
328
 
300
- _See code: [src/commands/cm/bulk-publish/entries.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.2/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/entries.js)_
329
+ _See code: [src/commands/cm/bulk-publish/entries.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.5/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/entries.js)_
301
330
 
302
331
  ## `csdx cm:bulk-publish:entry-edits`
303
332
 
@@ -308,6 +337,7 @@ USAGE
308
337
  $ csdx cm:bulk-publish:entry-edits
309
338
 
310
339
  OPTIONS
340
+ -B, --branch=branch [default: main] Specify the branch to fetch the content from (default is main branch)
311
341
  -a, --alias=alias Alias for the management token to be used
312
342
 
313
343
  -b, --bulkPublish=bulkPublish [default: true] This flag is set to true by default. It indicates that contentstack's
@@ -349,9 +379,13 @@ EXAMPLES
349
379
  Using --retryFailed or -r flag
350
380
  csdx cm:bulk-publish:entry-edits --retryFailed [LOG FILE NAME]
351
381
  csdx cm:bulk-publish:entry-edits -r [LOG FILE NAME]
382
+
383
+ Using --branch or -B flag
384
+ csdx cm:bulk-publish:entry-edits -t [CONTENT TYPE 1] [CONTENT TYPE 2] -s [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT
385
+ 2] -l [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] -B [BRANCH NAME]
352
386
  ```
353
387
 
354
- _See code: [src/commands/cm/bulk-publish/entry-edits.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.2/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/entry-edits.js)_
388
+ _See code: [src/commands/cm/bulk-publish/entry-edits.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.5/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/entry-edits.js)_
355
389
 
356
390
  ## `csdx cm:bulk-publish:nonlocalized-field-changes`
357
391
 
@@ -362,6 +396,7 @@ USAGE
362
396
  $ csdx cm:bulk-publish:nonlocalized-field-changes
363
397
 
364
398
  OPTIONS
399
+ -B, --branch=branch [default: main] Specify the branch to fetch the content from (default is main branch)
365
400
  -a, --alias=alias Alias for the management token to be used
366
401
 
367
402
  -b, --bulkPublish=bulkPublish [default: true] This flag is set to true by default. It indicates that contentstack's
@@ -390,7 +425,7 @@ DESCRIPTION
390
425
  EXAMPLES
391
426
  General Usage
392
427
  csdx cm:bulk-publish:nonlocalized-field-changes -t [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT
393
- 2] -l [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS]
428
+ 2] -l [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] -s [SOURCE ENV]
394
429
 
395
430
  Using --config or -c flag
396
431
  Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`
@@ -400,9 +435,13 @@ EXAMPLES
400
435
  Using --retryFailed or -r flag
401
436
  csdx cm:bulk-publish:nonlocalized-field-changes --retryFailed [LOG FILE NAME]
402
437
  csdx cm:bulk-publish:nonlocalized-field-changes -r [LOG FILE NAME]
438
+
439
+ Using --branch or -B flag
440
+ csdx cm:bulk-publish:nonlocalized-field-changes -t [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT
441
+ 2] -l [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] -B [BRANCH NAME] -s [SOURCE ENV]
403
442
  ```
404
443
 
405
- _See code: [src/commands/cm/bulk-publish/nonlocalized-field-changes.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.2/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/nonlocalized-field-changes.js)_
444
+ _See code: [src/commands/cm/bulk-publish/nonlocalized-field-changes.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.5/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/nonlocalized-field-changes.js)_
406
445
 
407
446
  ## `csdx cm:bulk-publish:revert`
408
447
 
@@ -430,7 +469,7 @@ EXAMPLES
430
469
  cm:bulk-publish:revert -r [LOG FILE NAME]
431
470
  ```
432
471
 
433
- _See code: [src/commands/cm/bulk-publish/revert.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.2/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/revert.js)_
472
+ _See code: [src/commands/cm/bulk-publish/revert.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.5/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/revert.js)_
434
473
 
435
474
  ## `csdx cm:bulk-publish:unpublish`
436
475
 
@@ -441,6 +480,9 @@ USAGE
441
480
  $ csdx cm:bulk-publish:unpublish
442
481
 
443
482
  OPTIONS
483
+ -B, --branch=branch [default: main] Specify the branch to fetch the content from (default is main
484
+ branch)
485
+
444
486
  -a, --alias=alias Alias for the management token to be used
445
487
 
446
488
  -b, --bulkUnpublish=bulkUnpublish [default: true] This flag is set to true by default. It indicates that
@@ -504,9 +546,13 @@ EXAMPLES
504
546
  entries, all entries, from the source environment)
505
547
  csdx cm:bulk-publish:unpublish --contentType [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --onlyEntries
506
548
  (Will unpublish only entries, (from CONTENT TYPE) from the source environment)
549
+
550
+ Using --branch or -B flag
551
+ csdx cm:bulk-publish:unpublish -b -t [CONTENT TYPE] -e [SOURCE ENV] -l [LOCALE] -a [MANAGEMENT TOKEN ALIAS] -x
552
+ [DELIVERY TOKEN] -B [BRANCH NAME]
507
553
  ```
508
554
 
509
- _See code: [src/commands/cm/bulk-publish/unpublish.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.2/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/unpublish.js)_
555
+ _See code: [src/commands/cm/bulk-publish/unpublish.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.5/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/unpublish.js)_
510
556
 
511
557
  ## `csdx cm:bulk-publish:unpublished-entries`
512
558
 
@@ -517,6 +563,7 @@ USAGE
517
563
  $ csdx cm:bulk-publish:unpublished-entries
518
564
 
519
565
  OPTIONS
566
+ -B, --branch=branch [default: main] Specify the branch to fetch the content from (default is main branch)
520
567
  -a, --alias=alias Alias for the management token to be used
521
568
 
522
569
  -b, --bulkPublish=bulkPublish [default: true] This flag is set to true by default. It indicates that contentstack's
@@ -546,7 +593,8 @@ DESCRIPTION
546
593
 
547
594
  EXAMPLES
548
595
  General Usage
549
- csdx cm:bulk-publish:unpublished-entries -b -t [CONTENT TYPES] -e [ENVIRONMENTS] -l LOCALE -a [MANAGEMENT TOKEN ALIAS]
596
+ csdx cm:bulk-publish:unpublished-entries -b -t [CONTENT TYPES] -e [ENVIRONMENTS] -l LOCALE -a [MANAGEMENT TOKEN ALIAS]
597
+ -s [SOURCE ENV]
550
598
 
551
599
  Using --config or -c flag
552
600
  Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`
@@ -556,7 +604,11 @@ EXAMPLES
556
604
  Using --retryFailed or -r flag
557
605
  csdx cm:bulk-publish:unpublished-entries --retryFailed [LOG FILE NAME]
558
606
  csdx cm:bulk-publish:unpublished-entries -r [LOG FILE NAME]
607
+
608
+ Using --branch or -B flag
609
+ csdx cm:bulk-publish:unpublished-entries -b -t [CONTENT TYPES] -e [ENVIRONMENTS] -l LOCALE -a [MANAGEMENT TOKEN ALIAS]
610
+ -B [BRANCH NAME] -s [SOURCE ENV]
559
611
  ```
560
612
 
561
- _See code: [src/commands/cm/bulk-publish/unpublished-entries.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.2/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/unpublished-entries.js)_
613
+ _See code: [src/commands/cm/bulk-publish/unpublished-entries.js](https://github.com/contentstack/cli/blob/v0.1.1-beta.5/packages/contentstack-bulk-publish/src/commands/cm/bulk-publish/unpublished-entries.js)_
562
614
  <!-- commandsstop -->
@@ -1 +1 @@
1
- {"version":"0.1.1-beta.2","commands":{"cm:bulk-publish:add-fields":{"id":"cm:bulk-publish:add-fields","description":"Add fields from updated content types to their respective entries\nThe add-fields command is used for updating already existing entries with the updated schema of their respective Content Type\n\nContent Types, Environments and Locales are required for executing the command successfully\nBut, if retryFailed flag is set, then only a logfile is required\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"examples":["General Usage","csdx cm:bulk-publish:add-fields -t [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS]","","Using --config or -c flag","Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`","csdx cm:bulk-publish:add-fields --config [PATH TO CONFIG FILE]","csdx cm:bulk-publish:add-fields -c [PATH TO CONFIG FILE]","","Using --retryFailed or -r flag","csdx cm:bulk-publish:add-fields --retryFailed [LOG FILE NAME]","csdx cm:bulk-publish:add-fields -r [LOG FILE NAME]"],"flags":{"alias":{"name":"alias","type":"option","char":"a","description":"Alias for the management token to be used"},"retryFailed":{"name":"retryFailed","type":"option","char":"r","description":"Retry publishing failed entries from the logfile (optional, overrides all other flags)"},"bulkPublish":{"name":"bulkPublish","type":"option","char":"b","description":"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used for publishing the entries","default":"true"},"contentTypes":{"name":"contentTypes","type":"option","char":"t","description":"The Content-Types from which entries need to be published"},"locales":{"name":"locales","type":"option","char":"l","description":"Locales to which entries need to be published"},"environments":{"name":"environments","type":"option","char":"e","description":"Environments to which entries need to be published"},"config":{"name":"config","type":"option","char":"c","description":"Path to config file to be used"},"yes":{"name":"yes","type":"boolean","char":"y","description":"Agree to process the command with the current configuration","allowNo":false}},"args":[]},"cm:bulk-publish:assets":{"id":"cm:bulk-publish:assets","description":"Publish assets to specified environments\nThe assets command is used for publishing assets from the specified stack, to the specified environments\n\nEnvironment(s) and Locale(s) are required for executing the command successfully\nBut, if retryFailed flag is set, then only a logfile is required\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"examples":["General Usage","csdx cm:bulk-publish:assets -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE] -a [MANAGEMENT TOKEN ALIAS]","","Using --config or -c flag","Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`","csdx cm:bulk-publish:assets --config [PATH TO CONFIG FILE]","csdx cm:bulk-publish:assets -c [PATH TO CONFIG FILE]","","Using --retryFailed or -r flag","csdx cm:bulk-publish:assets --retryFailed [LOG FILE NAME]","csdx cm:bulk-publish:assets -r [LOG FILE NAME]"],"flags":{"alias":{"name":"alias","type":"option","char":"a","description":"Alias for the management token to be used"},"retryFailed":{"name":"retryFailed","type":"option","char":"r","description":"Retry publishing failed assets from the logfile (optional, will override all other flags)"},"environments":{"name":"environments","type":"option","char":"e","description":"Environments to which assets need to be published"},"folderUid":{"name":"folderUid","type":"option","char":"u","description":"[default: cs_root] Folder-uid from which the assets need to be published"},"bulkPublish":{"name":"bulkPublish","type":"option","char":"b","description":"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used for publishing the entries","default":"true"},"config":{"name":"config","type":"option","char":"c","description":"Path to config file to be used"},"yes":{"name":"yes","type":"boolean","char":"y","description":"Agree to process the command with the current configuration","allowNo":false},"locales":{"name":"locales","type":"option","char":"l","description":"Locales to which assets need to be published"}},"args":[]},"cm:bulk-publish:clear":{"id":"cm:bulk-publish:clear","description":"Clear the log folder\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"flags":{"list":{"name":"list","type":"boolean","char":"l","description":"List number of log files","allowNo":false},"yes":{"name":"yes","type":"boolean","char":"y","description":"Delete all files without asking for confirmation","allowNo":false}},"args":[]},"cm:bulk-publish:configure":{"id":"cm:bulk-publish:configure","description":"Generate configuration template\nThe configure command is used for generating a configuration file for bulk-publish script.\n\nHere is a detailed description for all the available flags\n\n-----------------------------------------------------------------------------------------------------------\n--alias or -a : Management token Alias for the stack in use.\n\nEXAMPLE : cm:bulk-publish:configure --alias [MANAGEMENT TOKEN Alias]\nEXAMPLE : cm:bulk-publish:configure -a [MANAGEMENT TOKEN Alias]\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"flags":{"alias":{"name":"alias","type":"option","char":"a","description":"Management token alias for the stack"}},"args":[]},"cm:bulk-publish:cross-publish":{"id":"cm:bulk-publish:cross-publish","description":"Publish entries and assets from one environment to other environments\nThe cross-publish command is used for publishing entries and assets from one evironment to other environments\n\nContent Type, Environment, Destination Environment(s) and Locale are required for executing the command successfully\nBut, if retryFailed flag is set, then only a logfile is required\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"examples":["General Usage","csdx cm:bulk-publish:cross-publish -t [CONTENT TYPE] -e [SOURCE ENV] -d [DESTINATION ENVIRONMENT] -l [LOCALE] -a [MANAGEMENT TOKEN ALIAS] -x [DELIVERY TOKEN]","","Using --config or -c flag","Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`","csdx cm:bulk-publish:cross-publish --config [PATH TO CONFIG FILE]","csdx cm:bulk-publish:cross-publish -c [PATH TO CONFIG FILE]","","Using --retryFailed or -r flag","csdx cm:bulk-publish:cross-publish --retryFailed [LOG FILE NAME]","csdx cm:bulk-publish:cross-publish -r [LOG FILE NAME]"],"flags":{"alias":{"name":"alias","type":"option","char":"a","description":"Alias for the management token to be used"},"retryFailed":{"name":"retryFailed","type":"option","char":"r","description":"Retry publishing failed entries from the logfile (optional, overrides all other flags)"},"bulkPublish":{"name":"bulkPublish","type":"option","char":"b","description":"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used for publishing the entries","default":"true"},"contentType":{"name":"contentType","type":"option","char":"t","description":"Content-Type filter"},"locale":{"name":"locale","type":"option","char":"l","description":"Locale filter"},"environment":{"name":"environment","type":"option","char":"e","description":"Source Environment"},"deliveryToken":{"name":"deliveryToken","type":"option","char":"x","description":"Delivery Token for source environment"},"destEnv":{"name":"destEnv","type":"option","char":"d","description":"Destination Environments"},"config":{"name":"config","type":"option","char":"c","description":"Path to config file to be used"},"yes":{"name":"yes","type":"boolean","char":"y","description":"Agree to process the command with the current configuration","allowNo":false}},"args":[]},"cm:bulk-publish:entries":{"id":"cm:bulk-publish:entries","description":"Publish entries from multiple content-types to multiple environments and locales\nThe entries command is used for publishing entries from the specified content types, to the\nspecified environments and locales \n\nContent Types, Environments and Locales are required for executing the command successfully\nBut, if retryFailed flag is set, then only a logfile is required\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"examples":["General Usage","csdx cm:bulk-publish:entries -t [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS]","","Using --config or -c flag","Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`","csdx cm:bulk-publish:entries --config [PATH TO CONFIG FILE]","csdx cm:bulk-publish:entries -c [PATH TO CONFIG FILE]","","Using --retryFailed or -r flag","csdx cm:bulk-publish:entries --retryFailed [LOG FILE NAME]","csdx cm:bulk-publish:entries -r [LOG FILE NAME]"],"flags":{"alias":{"name":"alias","type":"option","char":"a","description":"Alias for the management token to be used"},"retryFailed":{"name":"retryFailed","type":"option","char":"r","description":"Retry failed entries from the logfile (optional, overrides all other flags) This flag is used to retry publishing entries that failed to publish in a previous attempt. A log file for the previous session will be required for processing the failed entries"},"bulkPublish":{"name":"bulkPublish","type":"option","char":"b","description":"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used for publishing the entries","default":"true"},"publishAllContentTypes":{"name":"publishAllContentTypes","type":"boolean","char":"o","description":"Publish all content-types (optional, cannot be set when contentTypes flag is set)","allowNo":false},"contentTypes":{"name":"contentTypes","type":"option","char":"t","description":"The Content-types from which entries need to be published"},"locales":{"name":"locales","type":"option","char":"l","description":"Locales to which entries need to be published"},"environments":{"name":"environments","type":"option","char":"e","description":"Environments to which entries need to be published"},"config":{"name":"config","type":"option","char":"c","description":"Path for the external config file to be used (A new config file can be generated at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`)"},"yes":{"name":"yes","type":"boolean","char":"y","description":"Agree to process the command with the current configuration","allowNo":false}},"args":[]},"cm:bulk-publish:entry-edits":{"id":"cm:bulk-publish:entry-edits","description":"Publish edited entries from a specified Content Type to given locales and environments\nThe entry-edits command is used for publishing entries from the specified content types, to the\nspecified environments and locales\n\nContent Type(s), Source Environment, Destination Environment(s) and Locale(s) are required for executing the command successfully\nBut, if retryFailed flag is set, then only a logfile is required\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"examples":["General Usage","csdx cm:bulk-publish:entry-edits -t [CONTENT TYPE 1] [CONTENT TYPE 2] -s [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS]","","Using --config or -c flag","Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`","csdx cm:bulk-publish:entry-edits --config [PATH TO CONFIG FILE]","csdx cm:bulk-publish:entry-edits -c [PATH TO CONFIG FILE]","","Using --retryFailed or -r flag","csdx cm:bulk-publish:entry-edits --retryFailed [LOG FILE NAME]","csdx cm:bulk-publish:entry-edits -r [LOG FILE NAME]"],"flags":{"alias":{"name":"alias","type":"option","char":"a","description":"Alias for the management token to be used"},"retryFailed":{"name":"retryFailed","type":"option","char":"r","description":"Retry publishing failed entries from the logfile (optional, overrides all other flags)"},"bulkPublish":{"name":"bulkPublish","type":"option","char":"b","description":"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used for publishing the entries","default":"true"},"sourceEnv":{"name":"sourceEnv","type":"option","char":"s","description":"Environment from which edited entries will be published"},"contentTypes":{"name":"contentTypes","type":"option","char":"t","description":"The Content-Types which will be checked for edited entries"},"locales":{"name":"locales","type":"option","char":"l","description":"Locales to which edited entries need to be published"},"environments":{"name":"environments","type":"option","char":"e","description":"Destination environments"},"config":{"name":"config","type":"option","char":"c","description":"Path to config file to be used"},"yes":{"name":"yes","type":"boolean","char":"y","description":"Agree to process the command with the current configuration","allowNo":false}},"args":[]},"cm:bulk-publish":{"id":"cm:bulk-publish","description":"Bulk Publish script for managing entries and assets\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"flags":{},"args":[]},"cm:bulk-publish:nonlocalized-field-changes":{"id":"cm:bulk-publish:nonlocalized-field-changes","description":"Publish non-localized-fields for given Content Types, from a particular source environment to specified environments\nThe nonlocalized-field-changes command is used for publishing nonlocalized field changes from the given Content Types to\nthe specified Environments\n\nContent Types, Environments and Source Environment are required for executing this command successfully.\nBut, if retryFailed flag is set, then only a logfile is required\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"examples":["General Usage","csdx cm:bulk-publish:nonlocalized-field-changes -t [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS]","","Using --config or -c flag","Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`","csdx cm:bulk-publish:nonlocalized-field-changes --config [PATH TO CONFIG FILE]","csdx cm:bulk-publish:nonlocalized-field-changes -c [PATH TO CONFIG FILE]","","Using --retryFailed or -r flag","csdx cm:bulk-publish:nonlocalized-field-changes --retryFailed [LOG FILE NAME]","csdx cm:bulk-publish:nonlocalized-field-changes -r [LOG FILE NAME]"],"flags":{"alias":{"name":"alias","type":"option","char":"a","description":"Alias for the management token to be used"},"retryFailed":{"name":"retryFailed","type":"option","char":"r","description":"Retry publishing failed entries from the logfile"},"bulkPublish":{"name":"bulkPublish","type":"option","char":"b","description":"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used for publishing the entries","default":"true"},"sourceEnv":{"name":"sourceEnv","type":"option","char":"s","description":"Source Environment"},"contentTypes":{"name":"contentTypes","type":"option","char":"t","description":"The Content-Types from which entries need to be published"},"environments":{"name":"environments","type":"option","char":"e","description":"Destination environments"},"config":{"name":"config","type":"option","char":"c","description":"Path to config file to be used"},"yes":{"name":"yes","type":"boolean","char":"y","description":"Agree to process the command with the current configuration","allowNo":false}},"args":[]},"cm:bulk-publish:revert":{"id":"cm:bulk-publish:revert","description":"Revert publish operations by using a log file\nThe revert command is used for reverting all publish operations performed using bulk-publish script.\nA log file name is required to execute revert command\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"examples":["Using --logFile","cm:bulk-publish:revert --logFile [LOG FILE NAME]","cm:bulk-publish:revert -l [LOG FILE NAME]","","Using --retryFailed","cm:bulk-publish:revert --retryFailed [LOG FILE NAME]","cm:bulk-publish:revert -r [LOG FILE NAME]"],"flags":{"retryFailed":{"name":"retryFailed","type":"option","char":"r","description":"retry publishing failed entries from the logfile"},"logFile":{"name":"logFile","type":"option","char":"l","description":"logfile to be used to revert"}},"args":[]},"cm:bulk-publish:unpublish":{"id":"cm:bulk-publish:unpublish","description":"Unpublish entries of given Content Types from given environment\nThe unpublish command is used for unpublishing entries from given environment\n\nEnvironment (Source Environment) and Locale are required for executing the command successfully\nBut, if retryFailed flag is set, then only a logfile is required\n\nA Content Type can be specified for publishing entries, but if no content-type(s) is/are specified and --onlyAssets is not used,\nthen all entries from all content types will be unpublished from the source environment\n\n--onlyAssets can be used to unpublish only assets and --onlyEntries can be used to unpublish only entries.\n(--onlyAssets and --onlyEntries cannot be used together at the same time)\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"examples":["General Usage","csdx cm:bulk-publish:unpublish -b -t [CONTENT TYPE] -e [SOURCE ENV] -l [LOCALE] -a [MANAGEMENT TOKEN ALIAS] -x [DELIVERY TOKEN]","","Using --config or -c flag","Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`","csdx cm:bulk-publish:unpublish --config [PATH TO CONFIG FILE]","csdx cm:bulk-publish:unpublish -c [PATH TO CONFIG FILE]","","Using --retryFailed or -r flag","csdx cm:bulk-publish:unpublish --retryFailed [LOG FILE NAME]","csdx cm:bulk-publish:unpublish -r [LOG FILE NAME]","","No content type","csdx cm:bulk-publish:unpublish --environment [SOURCE ENV] --locale [LOCALE] (Will unpublish all entries from all content types and assets from the source environment)","","Using --onlyAssets","csdx cm:bulk-publish:unpublish --environment [SOURCE ENV] --locale [LOCALE] --onlyAssets (Will unpublish only assets from the source environment)","","Using --onlyEntries","csdx cm:bulk-publish:unpublish --environment [SOURCE ENV] --locale [LOCALE] --onlyEntries (Will unpublish only entries, all entries, from the source environment)","csdx cm:bulk-publish:unpublish --contentType [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --onlyEntries (Will unpublish only entries, (from CONTENT TYPE) from the source environment)"],"flags":{"alias":{"name":"alias","type":"option","char":"a","description":"Alias for the management token to be used"},"retryFailed":{"name":"retryFailed","type":"option","char":"r","description":"Retry publishing failed entries from the logfile"},"bulkUnpublish":{"name":"bulkUnpublish","type":"option","char":"b","description":"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used for publishing the entries","default":"true"},"contentType":{"name":"contentType","type":"option","char":"t","description":"Content Type filter"},"locale":{"name":"locale","type":"option","char":"l","description":"Locale filter"},"environment":{"name":"environment","type":"option","char":"e","description":"Source Environment"},"deliveryToken":{"name":"deliveryToken","type":"option","char":"x","description":"Delivery Token for source environment"},"config":{"name":"config","type":"option","char":"c","description":"Path to config file to be used"},"yes":{"name":"yes","type":"boolean","char":"y","description":"Agree to process the command with the current configuration","allowNo":false},"onlyAssets":{"name":"onlyAssets","type":"boolean","description":"Unpublish only assets","allowNo":false},"onlyEntries":{"name":"onlyEntries","type":"boolean","description":"Unpublish only entries","allowNo":false}},"args":[]},"cm:bulk-publish:unpublished-entries":{"id":"cm:bulk-publish:unpublished-entries","description":"Publish unpublished entries from the source environment, to other environments and locales\nThe unpublished-entries command is used for publishing unpublished entries from the source environment, to other environments and locales\n\nContent Type(s), Source Environment, Destination Environment(s) and Source Locale are required for executing the command successfully\nBut, if retryFailed flag is set, then only a logfile is required\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"examples":["General Usage","csdx cm:bulk-publish:unpublished-entries -b -t [CONTENT TYPES] -e [ENVIRONMENTS] -l LOCALE -a [MANAGEMENT TOKEN ALIAS]","","Using --config or -c flag","Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`","csdx cm:bulk-publish:unpublished-entries --config [PATH TO CONFIG FILE]","csdx cm:bulk-publish:unpublished-entries -c [PATH TO CONFIG FILE]","","Using --retryFailed or -r flag","csdx cm:bulk-publish:unpublished-entries --retryFailed [LOG FILE NAME]","csdx cm:bulk-publish:unpublished-entries -r [LOG FILE NAME]"],"flags":{"alias":{"name":"alias","type":"option","char":"a","description":"Alias for the management token to be used"},"retryFailed":{"name":"retryFailed","type":"option","char":"r","description":"Retry publishing failed entries from the logfile"},"bulkPublish":{"name":"bulkPublish","type":"option","char":"b","description":"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used for publishing the entries","default":"true"},"sourceEnv":{"name":"sourceEnv","type":"option","char":"s","description":"Source Env"},"contentTypes":{"name":"contentTypes","type":"option","char":"t","description":"The Content-Types from which entries need to be published"},"locale":{"name":"locale","type":"option","char":"l","description":"Source locale"},"environments":{"name":"environments","type":"option","char":"e","description":"Destination environments"},"config":{"name":"config","type":"option","char":"c","description":"Path to config file to be used"},"yes":{"name":"yes","type":"boolean","char":"y","description":"Agree to process the command with the current configuration","allowNo":false}},"args":[]}}}
1
+ {"version":"0.1.1-beta.5","commands":{"cm:bulk-publish:add-fields":{"id":"cm:bulk-publish:add-fields","description":"Add fields from updated content types to their respective entries\nThe add-fields command is used for updating already existing entries with the updated schema of their respective Content Type\n\nContent Types, Environments and Locales are required for executing the command successfully\nBut, if retryFailed flag is set, then only a logfile is required\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"examples":["General Usage","csdx cm:bulk-publish:add-fields -t [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS]","","Using --config or -c flag","Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`","csdx cm:bulk-publish:add-fields --config [PATH TO CONFIG FILE]","csdx cm:bulk-publish:add-fields -c [PATH TO CONFIG FILE]","","Using --retryFailed or -r flag","csdx cm:bulk-publish:add-fields --retryFailed [LOG FILE NAME]","csdx cm:bulk-publish:add-fields -r [LOG FILE NAME]","","Using --branch or -B flag","csdx cm:bulk-publish:add-fields -t [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] -B [BRANCH NAME]"],"flags":{"alias":{"name":"alias","type":"option","char":"a","description":"Alias for the management token to be used"},"retryFailed":{"name":"retryFailed","type":"option","char":"r","description":"Retry publishing failed entries from the logfile (optional, overrides all other flags)"},"bulkPublish":{"name":"bulkPublish","type":"option","char":"b","description":"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used for publishing the entries","default":"true"},"contentTypes":{"name":"contentTypes","type":"option","char":"t","description":"The Content-Types from which entries need to be published"},"locales":{"name":"locales","type":"option","char":"l","description":"Locales to which entries need to be published"},"environments":{"name":"environments","type":"option","char":"e","description":"Environments to which entries need to be published"},"config":{"name":"config","type":"option","char":"c","description":"Path to config file to be used"},"yes":{"name":"yes","type":"boolean","char":"y","description":"Agree to process the command with the current configuration","allowNo":false},"branch":{"name":"branch","type":"option","char":"B","description":"Specify the branch to fetch the content from (default is main branch)","default":"main"}},"args":[]},"cm:bulk-publish:assets":{"id":"cm:bulk-publish:assets","description":"Publish assets to specified environments\nThe assets command is used for publishing assets from the specified stack, to the specified environments\n\nEnvironment(s) and Locale(s) are required for executing the command successfully\nBut, if retryFailed flag is set, then only a logfile is required\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"examples":["General Usage","csdx cm:bulk-publish:assets -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE] -a [MANAGEMENT TOKEN ALIAS]","","Using --config or -c flag","Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`","csdx cm:bulk-publish:assets --config [PATH TO CONFIG FILE]","csdx cm:bulk-publish:assets -c [PATH TO CONFIG FILE]","","Using --retryFailed or -r flag","csdx cm:bulk-publish:assets --retryFailed [LOG FILE NAME]","csdx cm:bulk-publish:assets -r [LOG FILE NAME]","","Using --branch or -B flag","csdx cm:bulk-publish:assets -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE] -a [MANAGEMENT TOKEN ALIAS] -B [BRANCH NAME]"],"flags":{"alias":{"name":"alias","type":"option","char":"a","description":"Alias for the management token to be used"},"retryFailed":{"name":"retryFailed","type":"option","char":"r","description":"Retry publishing failed assets from the logfile (optional, will override all other flags)"},"environments":{"name":"environments","type":"option","char":"e","description":"Environments to which assets need to be published"},"folderUid":{"name":"folderUid","type":"option","char":"u","description":"[default: cs_root] Folder-uid from which the assets need to be published"},"bulkPublish":{"name":"bulkPublish","type":"option","char":"b","description":"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used for publishing the entries","default":"true"},"config":{"name":"config","type":"option","char":"c","description":"Path to config file to be used"},"yes":{"name":"yes","type":"boolean","char":"y","description":"Agree to process the command with the current configuration","allowNo":false},"locales":{"name":"locales","type":"option","char":"l","description":"Locales to which assets need to be published"},"branch":{"name":"branch","type":"option","char":"B","description":"Specify the branch to fetch the content from (default is main branch)","default":"main"}},"args":[]},"cm:bulk-publish:clear":{"id":"cm:bulk-publish:clear","description":"Clear the log folder\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"flags":{"list":{"name":"list","type":"boolean","char":"l","description":"List number of log files","allowNo":false},"yes":{"name":"yes","type":"boolean","char":"y","description":"Delete all files without asking for confirmation","allowNo":false}},"args":[]},"cm:bulk-publish:configure":{"id":"cm:bulk-publish:configure","description":"Generate configuration template\nThe configure command is used for generating a configuration file for bulk-publish script.\n\nHere is a detailed description for all the available flags\n\n-----------------------------------------------------------------------------------------------------------\n--alias or -a : Management token Alias for the stack in use.\n\nEXAMPLE : cm:bulk-publish:configure --alias [MANAGEMENT TOKEN Alias]\nEXAMPLE : cm:bulk-publish:configure -a [MANAGEMENT TOKEN Alias]\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"flags":{"alias":{"name":"alias","type":"option","char":"a","description":"Management token alias for the stack"}},"args":[]},"cm:bulk-publish:cross-publish":{"id":"cm:bulk-publish:cross-publish","description":"Publish entries and assets from one environment to other environments\nThe cross-publish command is used for publishing entries and assets from one evironment to other environments\n\nContent Type, Environment, Destination Environment(s) and Locale are required for executing the command successfully\nBut, if retryFailed flag is set, then only a logfile is required\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"examples":["General Usage","csdx cm:bulk-publish:cross-publish -t [CONTENT TYPE] -e [SOURCE ENV] -d [DESTINATION ENVIRONMENT] -l [LOCALE] -a [MANAGEMENT TOKEN ALIAS] -x [DELIVERY TOKEN]","","Using --config or -c flag","Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`","csdx cm:bulk-publish:cross-publish --config [PATH TO CONFIG FILE]","csdx cm:bulk-publish:cross-publish -c [PATH TO CONFIG FILE]","","Using --retryFailed or -r flag","csdx cm:bulk-publish:cross-publish --retryFailed [LOG FILE NAME]","csdx cm:bulk-publish:cross-publish -r [LOG FILE NAME]","","Using --branch or -B flag","csdx cm:bulk-publish:cross-publish -t [CONTENT TYPE] -e [SOURCE ENV] -d [DESTINATION ENVIRONMENT] -l [LOCALE] -a [MANAGEMENT TOKEN ALIAS] -x [DELIVERY TOKEN] -B [BRANCH NAME]"],"flags":{"alias":{"name":"alias","type":"option","char":"a","description":"Alias for the management token to be used"},"retryFailed":{"name":"retryFailed","type":"option","char":"r","description":"Retry publishing failed entries from the logfile (optional, overrides all other flags)"},"bulkPublish":{"name":"bulkPublish","type":"option","char":"b","description":"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used for publishing the entries","default":"true"},"contentType":{"name":"contentType","type":"option","char":"t","description":"Content-Type filter"},"locale":{"name":"locale","type":"option","char":"l","description":"Locale filter"},"environment":{"name":"environment","type":"option","char":"e","description":"Source Environment"},"deliveryToken":{"name":"deliveryToken","type":"option","char":"x","description":"Delivery Token for source environment"},"destEnv":{"name":"destEnv","type":"option","char":"d","description":"Destination Environments"},"config":{"name":"config","type":"option","char":"c","description":"Path to config file to be used"},"yes":{"name":"yes","type":"boolean","char":"y","description":"Agree to process the command with the current configuration","allowNo":false},"branch":{"name":"branch","type":"option","char":"B","description":"Specify the branch to fetch the content from (default is main branch)","default":"main"},"onlyAssets":{"name":"onlyAssets","type":"boolean","description":"Unpublish only assets","allowNo":false},"onlyEntries":{"name":"onlyEntries","type":"boolean","description":"Unpublish only entries","allowNo":false}},"args":[]},"cm:bulk-publish:entries":{"id":"cm:bulk-publish:entries","description":"Publish entries from multiple content-types to multiple environments and locales\nThe entries command is used for publishing entries from the specified content types, to the\nspecified environments and locales \n\nContent Types, Environments and Locales are required for executing the command successfully\nBut, if retryFailed flag is set, then only a logfile is required\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"examples":["General Usage","csdx cm:bulk-publish:entries -t [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS]","","Using --config or -c flag","Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`","csdx cm:bulk-publish:entries --config [PATH TO CONFIG FILE]","csdx cm:bulk-publish:entries -c [PATH TO CONFIG FILE]","","Using --retryFailed or -r flag","csdx cm:bulk-publish:entries --retryFailed [LOG FILE NAME]","csdx cm:bulk-publish:entries -r [LOG FILE NAME]","","Using --branch or -B flag","csdx cm:bulk-publish:entries -t [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] -B [BRANCH NAME]"],"flags":{"alias":{"name":"alias","type":"option","char":"a","description":"Alias for the management token to be used"},"retryFailed":{"name":"retryFailed","type":"option","char":"r","description":"Retry failed entries from the logfile (optional, overrides all other flags) This flag is used to retry publishing entries that failed to publish in a previous attempt. A log file for the previous session will be required for processing the failed entries"},"bulkPublish":{"name":"bulkPublish","type":"option","char":"b","description":"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used for publishing the entries","default":"true"},"publishAllContentTypes":{"name":"publishAllContentTypes","type":"boolean","char":"o","description":"Publish all content-types (optional, cannot be set when contentTypes flag is set)","allowNo":false},"contentTypes":{"name":"contentTypes","type":"option","char":"t","description":"The Content-types from which entries need to be published"},"locales":{"name":"locales","type":"option","char":"l","description":"Locales to which entries need to be published"},"environments":{"name":"environments","type":"option","char":"e","description":"Environments to which entries need to be published"},"config":{"name":"config","type":"option","char":"c","description":"Path for the external config file to be used (A new config file can be generated at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`)"},"yes":{"name":"yes","type":"boolean","char":"y","description":"Agree to process the command with the current configuration","allowNo":false},"branch":{"name":"branch","type":"option","char":"B","description":"Specify the branch to fetch the content from (default is main branch)","default":"main"}},"args":[]},"cm:bulk-publish:entry-edits":{"id":"cm:bulk-publish:entry-edits","description":"Publish edited entries from a specified Content Type to given locales and environments\nThe entry-edits command is used for publishing entries from the specified content types, to the\nspecified environments and locales\n\nContent Type(s), Source Environment, Destination Environment(s) and Locale(s) are required for executing the command successfully\nBut, if retryFailed flag is set, then only a logfile is required\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"examples":["General Usage","csdx cm:bulk-publish:entry-edits -t [CONTENT TYPE 1] [CONTENT TYPE 2] -s [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS]","","Using --config or -c flag","Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`","csdx cm:bulk-publish:entry-edits --config [PATH TO CONFIG FILE]","csdx cm:bulk-publish:entry-edits -c [PATH TO CONFIG FILE]","","Using --retryFailed or -r flag","csdx cm:bulk-publish:entry-edits --retryFailed [LOG FILE NAME]","csdx cm:bulk-publish:entry-edits -r [LOG FILE NAME]","","Using --branch or -B flag","csdx cm:bulk-publish:entry-edits -t [CONTENT TYPE 1] [CONTENT TYPE 2] -s [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] -B [BRANCH NAME]"],"flags":{"alias":{"name":"alias","type":"option","char":"a","description":"Alias for the management token to be used"},"retryFailed":{"name":"retryFailed","type":"option","char":"r","description":"Retry publishing failed entries from the logfile (optional, overrides all other flags)"},"bulkPublish":{"name":"bulkPublish","type":"option","char":"b","description":"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used for publishing the entries","default":"true"},"sourceEnv":{"name":"sourceEnv","type":"option","char":"s","description":"Environment from which edited entries will be published"},"contentTypes":{"name":"contentTypes","type":"option","char":"t","description":"The Content-Types which will be checked for edited entries"},"locales":{"name":"locales","type":"option","char":"l","description":"Locales to which edited entries need to be published"},"environments":{"name":"environments","type":"option","char":"e","description":"Destination environments"},"config":{"name":"config","type":"option","char":"c","description":"Path to config file to be used"},"yes":{"name":"yes","type":"boolean","char":"y","description":"Agree to process the command with the current configuration","allowNo":false},"branch":{"name":"branch","type":"option","char":"B","description":"Specify the branch to fetch the content from (default is main branch)","default":"main"}},"args":[]},"cm:bulk-publish":{"id":"cm:bulk-publish","description":"Bulk Publish script for managing entries and assets\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"flags":{},"args":[]},"cm:bulk-publish:nonlocalized-field-changes":{"id":"cm:bulk-publish:nonlocalized-field-changes","description":"Publish non-localized-fields for given Content Types, from a particular source environment to specified environments\nThe nonlocalized-field-changes command is used for publishing nonlocalized field changes from the given Content Types to\nthe specified Environments\n\nContent Types, Environments and Source Environment are required for executing this command successfully.\nBut, if retryFailed flag is set, then only a logfile is required\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"examples":["General Usage","csdx cm:bulk-publish:nonlocalized-field-changes -t [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] -s [SOURCE ENV]","","Using --config or -c flag","Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`","csdx cm:bulk-publish:nonlocalized-field-changes --config [PATH TO CONFIG FILE]","csdx cm:bulk-publish:nonlocalized-field-changes -c [PATH TO CONFIG FILE]","","Using --retryFailed or -r flag","csdx cm:bulk-publish:nonlocalized-field-changes --retryFailed [LOG FILE NAME]","csdx cm:bulk-publish:nonlocalized-field-changes -r [LOG FILE NAME]","","Using --branch or -B flag","csdx cm:bulk-publish:nonlocalized-field-changes -t [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] -B [BRANCH NAME] -s [SOURCE ENV]"],"flags":{"alias":{"name":"alias","type":"option","char":"a","description":"Alias for the management token to be used"},"retryFailed":{"name":"retryFailed","type":"option","char":"r","description":"Retry publishing failed entries from the logfile"},"bulkPublish":{"name":"bulkPublish","type":"option","char":"b","description":"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used for publishing the entries","default":"true"},"sourceEnv":{"name":"sourceEnv","type":"option","char":"s","description":"Source Environment"},"contentTypes":{"name":"contentTypes","type":"option","char":"t","description":"The Content-Types from which entries need to be published"},"environments":{"name":"environments","type":"option","char":"e","description":"Destination environments"},"config":{"name":"config","type":"option","char":"c","description":"Path to config file to be used"},"yes":{"name":"yes","type":"boolean","char":"y","description":"Agree to process the command with the current configuration","allowNo":false},"branch":{"name":"branch","type":"option","char":"B","description":"Specify the branch to fetch the content from (default is main branch)","default":"main"}},"args":[]},"cm:bulk-publish:revert":{"id":"cm:bulk-publish:revert","description":"Revert publish operations by using a log file\nThe revert command is used for reverting all publish operations performed using bulk-publish script.\nA log file name is required to execute revert command\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"examples":["Using --logFile","cm:bulk-publish:revert --logFile [LOG FILE NAME]","cm:bulk-publish:revert -l [LOG FILE NAME]","","Using --retryFailed","cm:bulk-publish:revert --retryFailed [LOG FILE NAME]","cm:bulk-publish:revert -r [LOG FILE NAME]"],"flags":{"retryFailed":{"name":"retryFailed","type":"option","char":"r","description":"retry publishing failed entries from the logfile"},"logFile":{"name":"logFile","type":"option","char":"l","description":"logfile to be used to revert"}},"args":[]},"cm:bulk-publish:unpublish":{"id":"cm:bulk-publish:unpublish","description":"Unpublish entries of given Content Types from given environment\nThe unpublish command is used for unpublishing entries from given environment\n\nEnvironment (Source Environment) and Locale are required for executing the command successfully\nBut, if retryFailed flag is set, then only a logfile is required\n\nA Content Type can be specified for publishing entries, but if no content-type(s) is/are specified and --onlyAssets is not used,\nthen all entries from all content types will be unpublished from the source environment\n\n--onlyAssets can be used to unpublish only assets and --onlyEntries can be used to unpublish only entries.\n(--onlyAssets and --onlyEntries cannot be used together at the same time)\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"examples":["General Usage","csdx cm:bulk-publish:unpublish -b -t [CONTENT TYPE] -e [SOURCE ENV] -l [LOCALE] -a [MANAGEMENT TOKEN ALIAS] -x [DELIVERY TOKEN]","","Using --config or -c flag","Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`","csdx cm:bulk-publish:unpublish --config [PATH TO CONFIG FILE]","csdx cm:bulk-publish:unpublish -c [PATH TO CONFIG FILE]","","Using --retryFailed or -r flag","csdx cm:bulk-publish:unpublish --retryFailed [LOG FILE NAME]","csdx cm:bulk-publish:unpublish -r [LOG FILE NAME]","","No content type","csdx cm:bulk-publish:unpublish --environment [SOURCE ENV] --locale [LOCALE] (Will unpublish all entries from all content types and assets from the source environment)","","Using --onlyAssets","csdx cm:bulk-publish:unpublish --environment [SOURCE ENV] --locale [LOCALE] --onlyAssets (Will unpublish only assets from the source environment)","","Using --onlyEntries","csdx cm:bulk-publish:unpublish --environment [SOURCE ENV] --locale [LOCALE] --onlyEntries (Will unpublish only entries, all entries, from the source environment)","csdx cm:bulk-publish:unpublish --contentType [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --onlyEntries (Will unpublish only entries, (from CONTENT TYPE) from the source environment)","","Using --branch or -B flag","csdx cm:bulk-publish:unpublish -b -t [CONTENT TYPE] -e [SOURCE ENV] -l [LOCALE] -a [MANAGEMENT TOKEN ALIAS] -x [DELIVERY TOKEN] -B [BRANCH NAME]"],"flags":{"alias":{"name":"alias","type":"option","char":"a","description":"Alias for the management token to be used"},"retryFailed":{"name":"retryFailed","type":"option","char":"r","description":"Retry publishing failed entries from the logfile"},"bulkUnpublish":{"name":"bulkUnpublish","type":"option","char":"b","description":"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used for publishing the entries","default":"true"},"contentType":{"name":"contentType","type":"option","char":"t","description":"Content Type filter"},"locale":{"name":"locale","type":"option","char":"l","description":"Locale filter"},"environment":{"name":"environment","type":"option","char":"e","description":"Source Environment"},"deliveryToken":{"name":"deliveryToken","type":"option","char":"x","description":"Delivery Token for source environment"},"config":{"name":"config","type":"option","char":"c","description":"Path to config file to be used"},"yes":{"name":"yes","type":"boolean","char":"y","description":"Agree to process the command with the current configuration","allowNo":false},"onlyAssets":{"name":"onlyAssets","type":"boolean","description":"Unpublish only assets","allowNo":false},"onlyEntries":{"name":"onlyEntries","type":"boolean","description":"Unpublish only entries","allowNo":false},"branch":{"name":"branch","type":"option","char":"B","description":"Specify the branch to fetch the content from (default is main branch)","default":"main"}},"args":[]},"cm:bulk-publish:unpublished-entries":{"id":"cm:bulk-publish:unpublished-entries","description":"Publish unpublished entries from the source environment, to other environments and locales\nThe unpublished-entries command is used for publishing unpublished entries from the source environment, to other environments and locales\n\nContent Type(s), Source Environment, Destination Environment(s) and Source Locale are required for executing the command successfully\nBut, if retryFailed flag is set, then only a logfile is required\n","pluginName":"@contentstack/cli-cm-bulk-publish","pluginType":"core","aliases":[],"examples":["General Usage","csdx cm:bulk-publish:unpublished-entries -b -t [CONTENT TYPES] -e [ENVIRONMENTS] -l LOCALE -a [MANAGEMENT TOKEN ALIAS] -s [SOURCE ENV]","","Using --config or -c flag","Generate a config file at the current working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`","csdx cm:bulk-publish:unpublished-entries --config [PATH TO CONFIG FILE]","csdx cm:bulk-publish:unpublished-entries -c [PATH TO CONFIG FILE]","","Using --retryFailed or -r flag","csdx cm:bulk-publish:unpublished-entries --retryFailed [LOG FILE NAME]","csdx cm:bulk-publish:unpublished-entries -r [LOG FILE NAME]","","Using --branch or -B flag","csdx cm:bulk-publish:unpublished-entries -b -t [CONTENT TYPES] -e [ENVIRONMENTS] -l LOCALE -a [MANAGEMENT TOKEN ALIAS] -B [BRANCH NAME] -s [SOURCE ENV]"],"flags":{"alias":{"name":"alias","type":"option","char":"a","description":"Alias for the management token to be used"},"retryFailed":{"name":"retryFailed","type":"option","char":"r","description":"Retry publishing failed entries from the logfile"},"bulkPublish":{"name":"bulkPublish","type":"option","char":"b","description":"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used for publishing the entries","default":"true"},"sourceEnv":{"name":"sourceEnv","type":"option","char":"s","description":"Source Env"},"contentTypes":{"name":"contentTypes","type":"option","char":"t","description":"The Content-Types from which entries need to be published"},"locale":{"name":"locale","type":"option","char":"l","description":"Source locale"},"environments":{"name":"environments","type":"option","char":"e","description":"Destination environments"},"config":{"name":"config","type":"option","char":"c","description":"Path to config file to be used"},"yes":{"name":"yes","type":"boolean","char":"y","description":"Agree to process the command with the current configuration","allowNo":false},"branch":{"name":"branch","type":"option","char":"B","description":"Specify the branch to fetch the content from (default is main branch)","default":"main"}},"args":[]}}}
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": "0.1.1-beta.2",
4
+ "version": "0.1.1-beta.5",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
8
- "@contentstack/cli-command": "0.1.1-beta.1",
9
- "@contentstack/management": "1.1.2",
8
+ "@contentstack/cli-command": "0.1.1-beta.6",
9
+ "@contentstack/management": "^1.3.0",
10
10
  "@oclif/command": "^1.7.0",
11
11
  "@oclif/config": "^1.16.0",
12
12
  "bluebird": "^3.7.2",
@@ -24,7 +24,7 @@
24
24
  "eslint": "^5.16.0",
25
25
  "eslint-config-oclif": "^3.1.0",
26
26
  "globby": "^10.0.2",
27
- "mocha": "^5.2.0",
27
+ "mocha": "^8.2.1",
28
28
  "nyc": "^14.1.1"
29
29
  },
30
30
  "engines": {
@@ -38,7 +38,9 @@
38
38
  ],
39
39
  "homepage": "https://github.com/contentstack/cli",
40
40
  "keywords": [
41
- "contentstack","cli","plugin"
41
+ "contentstack",
42
+ "cli",
43
+ "plugin"
42
44
  ],
43
45
  "license": "MIT",
44
46
  "oclif": {
@@ -54,7 +56,6 @@
54
56
  },
55
57
  "repository": "https://github.com/contentstack/cli",
56
58
  "scripts": {
57
- "pack": "npm pack && mv *.tgz ../../build",
58
59
  "postpack": "rm -f oclif.manifest.json",
59
60
  "prepack": "oclif-dev manifest && oclif-dev readme",
60
61
  "test": "nyc mocha --forbid-only \"test/**/*.test.js\"",
@@ -3,30 +3,31 @@ const {start} = require('../../../producer/add-fields')
3
3
  const store = require('../../../util/store.js')
4
4
  const {cli} = require('cli-ux')
5
5
  const configKey = 'addFields'
6
- const { prettyPrint, formatError } = require('../../../util')
7
- const { getStack } = require('../../../util/client.js')
6
+ const {prettyPrint, formatError} = require('../../../util')
7
+ const {getStack} = require('../../../util/client.js')
8
8
  let config
9
9
 
10
10
  class AddFieldsCommand extends Command {
11
11
  async run() {
12
- const {flags} = this.parse(AddFieldsCommand)
12
+ const addFieldsFlags = this.parse(AddFieldsCommand).flags
13
13
  let updatedFlags
14
14
  try {
15
- updatedFlags = (flags.config) ? store.updateMissing(configKey, flags) : flags
16
- } catch(error) {
15
+ updatedFlags = (addFieldsFlags.config) ? store.updateMissing(configKey, addFieldsFlags) : addFieldsFlags
16
+ } catch (error) {
17
17
  this.error(error.message, {exit: 2})
18
18
  }
19
19
  if (this.validate(updatedFlags)) {
20
20
  let stack
21
21
  if (!updatedFlags.retryFailed) {
22
- if(!updatedFlags.alias) {
22
+ if (!updatedFlags.alias) {
23
23
  updatedFlags.alias = await cli.prompt('Please enter the management token alias to be used')
24
24
  }
25
25
  updatedFlags.bulkPublish = (updatedFlags.bulkPublish === 'false') ? false : true
26
26
  await this.config.runHook('validateManagementTokenAlias', {alias: updatedFlags.alias})
27
- config = {
27
+ config = {
28
28
  alias: updatedFlags.alias,
29
- host: this.config.userConfig.getRegion().cma
29
+ host: this.config.userConfig.getRegion().cma,
30
+ branch: addFieldsFlags.branch,
30
31
  }
31
32
  stack = getStack(config)
32
33
  }
@@ -72,9 +73,9 @@ class AddFieldsCommand extends Command {
72
73
  }
73
74
  }
74
75
 
75
- async confirmFlags(flags) {
76
- prettyPrint(flags)
77
- if(flags.yes) {
76
+ async confirmFlags(data) {
77
+ prettyPrint(data)
78
+ if (data.yes) {
78
79
  return true
79
80
  }
80
81
  const confirmation = await cli.confirm('Do you want to continue with this configuration ? [yes or no]')
@@ -97,7 +98,8 @@ AddFieldsCommand.flags = {
97
98
  locales: flags.string({char: 'l', description: 'Locales to which entries need to be published', multiple: true}),
98
99
  environments: flags.string({char: 'e', description: 'Environments to which entries need to be published', multiple: true}),
99
100
  config: flags.string({char: 'c', description: 'Path to config file to be used'}),
100
- yes: flags.boolean({char: 'y', description: 'Agree to process the command with the current configuration' }),
101
+ yes: flags.boolean({char: 'y', description: 'Agree to process the command with the current configuration'}),
102
+ branch: flags.string({char: 'B', default: 'main', description: 'Specify the branch to fetch the content from (default is main branch)'}),
101
103
  }
102
104
 
103
105
  AddFieldsCommand.examples = [
@@ -111,7 +113,10 @@ AddFieldsCommand.examples = [
111
113
  '',
112
114
  'Using --retryFailed or -r flag',
113
115
  'csdx cm:bulk-publish:add-fields --retryFailed [LOG FILE NAME]',
114
- 'csdx cm:bulk-publish:add-fields -r [LOG FILE NAME]'
116
+ 'csdx cm:bulk-publish:add-fields -r [LOG FILE NAME]',
117
+ '',
118
+ 'Using --branch or -B flag',
119
+ 'csdx cm:bulk-publish:add-fields -t [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] -B [BRANCH NAME]',
115
120
  ]
116
121
 
117
122
  module.exports = AddFieldsCommand
@@ -9,10 +9,10 @@ let config
9
9
 
10
10
  class AssetsCommand extends Command {
11
11
  async run() {
12
- const {flags} = this.parse(AssetsCommand)
12
+ const assetsFlags = this.parse(AssetsCommand).flags
13
13
  let updatedFlags
14
14
  try {
15
- updatedFlags = (flags.config) ? store.updateMissing(configKey, flags) : flags
15
+ updatedFlags = (assetsFlags.config) ? store.updateMissing(configKey, assetsFlags) : assetsFlags
16
16
  } catch(error) {
17
17
  this.error(error.message, {exit: 2})
18
18
  }
@@ -28,9 +28,10 @@ class AssetsCommand extends Command {
28
28
  updatedFlags.folderUid = 'cs_root'
29
29
  }
30
30
  await this.config.runHook('validateManagementTokenAlias', {alias: updatedFlags.alias})
31
- config = {
31
+ config = {
32
32
  alias: updatedFlags.alias,
33
- host: this.config.userConfig.getRegion().cma
33
+ host: this.config.userConfig.getRegion().cma,
34
+ branch: assetsFlags.branch,
34
35
  }
35
36
  stack = getStack(config)
36
37
  }
@@ -72,9 +73,9 @@ class AssetsCommand extends Command {
72
73
  }
73
74
  }
74
75
 
75
- async confirmFlags(flags) {
76
- prettyPrint(flags)
77
- if(flags.yes) {
76
+ async confirmFlags(data) {
77
+ prettyPrint(data)
78
+ if(data.yes) {
78
79
  return true
79
80
  }
80
81
  const confirmation = await cli.confirm('Do you want to continue with this configuration ? [yes or no]')
@@ -96,8 +97,9 @@ AssetsCommand.flags = {
96
97
  folderUid: flags.string({char: 'u', description: '[default: cs_root] Folder-uid from which the assets need to be published'}),
97
98
  bulkPublish: flags.string({char: 'b', description: 'This flag is set to true by default. It indicates that contentstack\'s bulkpublish API will be used for publishing the entries', default: 'true'}),
98
99
  config: flags.string({char: 'c', description: 'Path to config file to be used'}),
99
- yes: flags.boolean({char: 'y', description: 'Agree to process the command with the current configuration' }),
100
- locales: flags.string({char: 'l', description: 'Locales to which assets need to be published', multiple: true }),
100
+ yes: flags.boolean({char: 'y', description: 'Agree to process the command with the current configuration'}),
101
+ locales: flags.string({char: 'l', description: 'Locales to which assets need to be published', multiple: true}),
102
+ branch: flags.string({char: 'B', default: 'main', description: 'Specify the branch to fetch the content from (default is main branch)'}),
101
103
  }
102
104
 
103
105
  AssetsCommand.examples = [
@@ -111,7 +113,10 @@ AssetsCommand.examples = [
111
113
  '',
112
114
  'Using --retryFailed or -r flag',
113
115
  'csdx cm:bulk-publish:assets --retryFailed [LOG FILE NAME]',
114
- 'csdx cm:bulk-publish:assets -r [LOG FILE NAME]'
116
+ 'csdx cm:bulk-publish:assets -r [LOG FILE NAME]',
117
+ '',
118
+ 'Using --branch or -B flag',
119
+ 'csdx cm:bulk-publish:assets -e [ENVIRONMENT 1] [ENVIRONMENT 2] -l [LOCALE] -a [MANAGEMENT TOKEN ALIAS] -B [BRANCH NAME]',
115
120
  ]
116
121
 
117
122
  module.exports = AssetsCommand