@contentstack/cli-cm-bulk-publish 1.3.9 → 1.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +145 -50
- package/package.json +3 -3
- package/src/commands/cm/entries/publish-modified.js +26 -13
- package/src/commands/cm/entries/publish-non-localized-fields.js +26 -9
- package/src/commands/cm/entries/publish-only-unpublished.js +7 -0
- package/src/commands/cm/entries/publish.js +22 -13
- package/src/commands/cm/entries/unpublish.js +26 -17
- package/src/commands/cm/entries/update-and-publish.js +26 -15
- package/src/commands/cm/stacks/publish-configure.js +14 -9
- package/src/commands/cm/stacks/publish.js +2 -3
- package/src/commands/cm/stacks/unpublish.js +29 -16
- package/src/services/publish-only-unpublished.js +16 -14
- package/src/util/command-helper.js +1 -1
- package/oclif.manifest.json +0 -1581
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ $ npm install -g @contentstack/cli-cm-bulk-publish
|
|
|
18
18
|
$ csdx COMMAND
|
|
19
19
|
running command...
|
|
20
20
|
$ csdx (--version)
|
|
21
|
-
@contentstack/cli-cm-bulk-publish/1.3.
|
|
21
|
+
@contentstack/cli-cm-bulk-publish/1.3.11 darwin-arm64 node-v20.3.1
|
|
22
22
|
$ csdx --help [COMMAND]
|
|
23
23
|
USAGE
|
|
24
24
|
$ csdx COMMAND
|
|
@@ -231,6 +231,7 @@ FLAGS
|
|
|
231
231
|
-a, --alias=<value> Alias(name) for the management token
|
|
232
232
|
-c, --config=<value> Path to the config file
|
|
233
233
|
-e, --environments=<value>... Environments where entries will be published
|
|
234
|
+
-k, --stack-api-key=<value> Stack api key to be used
|
|
234
235
|
-l, --locales=<value>... Locales where entries will be published
|
|
235
236
|
-t, --contentTypes=<value>... The Contenttypes from which entries will be published
|
|
236
237
|
-y, --yes Agree to process the command with the current configuration
|
|
@@ -256,7 +257,7 @@ ALIASES
|
|
|
256
257
|
EXAMPLES
|
|
257
258
|
General Usage
|
|
258
259
|
|
|
259
|
-
$ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --
|
|
260
|
+
$ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS]
|
|
260
261
|
|
|
261
262
|
|
|
262
263
|
|
|
@@ -278,7 +279,13 @@ EXAMPLES
|
|
|
278
279
|
|
|
279
280
|
Using --branch
|
|
280
281
|
|
|
281
|
-
$ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --
|
|
282
|
+
$ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME]
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
Using --stack-api-key
|
|
287
|
+
|
|
288
|
+
$ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY]
|
|
282
289
|
```
|
|
283
290
|
|
|
284
291
|
## `csdx cm:assets:publish [-a <value>] [--retry-failed <value>] [-e <value>] [--folder-uid <value>] [--bulk-publish <value>] [-c <value>] [-y] [--locales <value>] [--branch <value>] [--delivery-token <value>] [--source-env <value>]`
|
|
@@ -393,10 +400,11 @@ The configure command is used to generate a configuration file for publish scrip
|
|
|
393
400
|
|
|
394
401
|
```
|
|
395
402
|
USAGE
|
|
396
|
-
$ csdx cm:bulk-publish:configure [-a <value>]
|
|
403
|
+
$ csdx cm:bulk-publish:configure [-a <value>] [-k <value>]
|
|
397
404
|
|
|
398
405
|
FLAGS
|
|
399
|
-
-a, --alias=<value>
|
|
406
|
+
-a, --alias=<value> Alias(name) for the management token
|
|
407
|
+
-k, --stack-api-key=<value> Stack api key to be used
|
|
400
408
|
|
|
401
409
|
DESCRIPTION
|
|
402
410
|
The configure command is used to generate a configuration file for publish scripts.
|
|
@@ -410,6 +418,8 @@ EXAMPLES
|
|
|
410
418
|
$ csdx cm:stacks:publish-configure -a <management_token_alias>
|
|
411
419
|
|
|
412
420
|
$ csdx cm:stacks:publish-configure --alias <management_token_alias>
|
|
421
|
+
|
|
422
|
+
$ csdx cm:stacks:publish-configure --stack-api-key <stack_api_key>
|
|
413
423
|
```
|
|
414
424
|
|
|
415
425
|
## `csdx cm:bulk-publish:cross-publish [-a <value>] [--retry-failed <value>] [--bulk-publish <value>] [--content-type <value>] [--locales <value>] [--source-env <value>] [--environments <value>] [--delivery-token <value>] [-c <value>] [-y] [--branch <value>] [--onlyAssets] [--onlyEntries]`
|
|
@@ -506,6 +516,7 @@ FLAGS
|
|
|
506
516
|
-c, --config=<value> Path for the external config file (A new config file can be generated at the current
|
|
507
517
|
working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`)
|
|
508
518
|
-e, --environments=<value>... Environments where entries will be published
|
|
519
|
+
-k, --stack-api-key=<value> Stack api key to be used
|
|
509
520
|
-l, --locales=<value>... Locales where entries will be published
|
|
510
521
|
-y, --yes Agree to process the command with the current configuration
|
|
511
522
|
--api-version=<value> API Version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].
|
|
@@ -565,6 +576,12 @@ EXAMPLES
|
|
|
565
576
|
Using --source-env
|
|
566
577
|
|
|
567
578
|
$ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN]
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
Using --stack-api-key
|
|
583
|
+
|
|
584
|
+
$ csdx cm:entries:publish -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN]
|
|
568
585
|
```
|
|
569
586
|
|
|
570
587
|
## `csdx cm:entries:publish-modified [-a <value>] [--retry-failed <value>] [--bulk-publish <value>] [--source-env <value>] [--content-types <value>] [--locales <value>] [-e <value>] [-c <value>] [-y] [--branch <value>]`
|
|
@@ -582,6 +599,7 @@ FLAGS
|
|
|
582
599
|
-a, --alias=<value> Alias(name) for the management token
|
|
583
600
|
-c, --config=<value> Path to the config file
|
|
584
601
|
-e, --environments=<value>... Destination environments
|
|
602
|
+
-k, --stack-api-key=<value> Stack api key to be used
|
|
585
603
|
-l, --locales=<value>... Locales where edited entries will be published
|
|
586
604
|
-y, --yes Agree to process the command with the current configuration
|
|
587
605
|
--api-version=<value> API Version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].
|
|
@@ -632,6 +650,12 @@ EXAMPLES
|
|
|
632
650
|
Using --branch
|
|
633
651
|
|
|
634
652
|
$ csdx cm:entries:publish-modified --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --source-env [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME]
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
Using --stack-api-key
|
|
657
|
+
|
|
658
|
+
$ csdx cm:entries:publish-modified --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --source-env [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -stack-api-key [STACK API KEY]
|
|
635
659
|
```
|
|
636
660
|
|
|
637
661
|
## `csdx cm:entries:publish-non-localized-fields [-a <value>] [--retry-failed <value>] [--bulk-publish <value>] [--source-env <value>] [--content-types <value>] [-e <value>] [-c <value>] [-y] [--branch <value>]`
|
|
@@ -649,6 +673,7 @@ FLAGS
|
|
|
649
673
|
-a, --alias=<value> Alias(name) for the management token
|
|
650
674
|
-c, --config=<value> Path to the config file
|
|
651
675
|
-e, --environments=<value>... Destination environments
|
|
676
|
+
-k, --stack-api-key=<value> Stack api key to be used
|
|
652
677
|
-y, --yes Agree to process the command with the current configuration
|
|
653
678
|
--api-version=<value> API Version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].
|
|
654
679
|
--bulk-publish=<value> [default: true] This flag is set to true by default. It indicates that contentstack's
|
|
@@ -695,6 +720,12 @@ EXAMPLES
|
|
|
695
720
|
Using --branch flag
|
|
696
721
|
|
|
697
722
|
$ csdx cm:entries:publish-non-localized-fields --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --alias [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENV] --branch [BRANCH NAME]
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
Using --stack-api-key flag
|
|
727
|
+
|
|
728
|
+
$ csdx cm:entries:publish-non-localized-fields --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENV]
|
|
698
729
|
```
|
|
699
730
|
|
|
700
731
|
## `csdx cm:bulk-publish:revert`
|
|
@@ -741,18 +772,19 @@ USAGE
|
|
|
741
772
|
[--only-assets] [--only-entries]
|
|
742
773
|
|
|
743
774
|
FLAGS
|
|
744
|
-
-B, --branch=<value>
|
|
745
|
-
-a, --alias=<value>
|
|
746
|
-
-c, --config=<value>
|
|
747
|
-
-e, --environment=<value>
|
|
748
|
-
-
|
|
749
|
-
-
|
|
750
|
-
|
|
751
|
-
--
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
--
|
|
755
|
-
--
|
|
775
|
+
-B, --branch=<value> [default: main] Specify the branch to fetch the content from (default is main branch)
|
|
776
|
+
-a, --alias=<value> Alias(name) for the management token
|
|
777
|
+
-c, --config=<value> Path to the config file
|
|
778
|
+
-e, --environment=<value> Source Environment
|
|
779
|
+
-k, --stack-api-key=<value> Stack api key to be used
|
|
780
|
+
-l, --locale=<value> Locale filter
|
|
781
|
+
-y, --yes Agree to process the command with the current configuration
|
|
782
|
+
--api-version=<value> API Version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].
|
|
783
|
+
--bulk-unpublish=<value> [default: true] This flag is set to true by default. It indicates that contentstack's
|
|
784
|
+
bulkpublish API will be used to unpublish the entries and assets
|
|
785
|
+
--content-type=<value> Content type filter
|
|
786
|
+
--delivery-token=<value> Delivery token for source environment
|
|
787
|
+
--retry-failed=<value> Retry publishing failed entries from the logfile (optional, overrides all other flags)
|
|
756
788
|
|
|
757
789
|
DESCRIPTION
|
|
758
790
|
Unpublish entries or assets of given content types from the specified environment
|
|
@@ -818,6 +850,12 @@ EXAMPLES
|
|
|
818
850
|
Using --branch flag
|
|
819
851
|
|
|
820
852
|
$ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --delivery-token [DELIVERY TOKEN] --branch [BRANCH NAME]
|
|
853
|
+
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
Using --stack-api-key flag
|
|
857
|
+
|
|
858
|
+
$ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --stack-api-key [STACK API KEY] --delivery-token [DELIVERY TOKEN]
|
|
821
859
|
```
|
|
822
860
|
|
|
823
861
|
## `csdx cm:entries:publish-only-unpublished [-a <value>] [--retry-failed <value>] [--bulk-publish <value>] [--source-env <value>] [--content-types <value>] [--locales <value>] [-e <value>] [-c <value>] [-y] [--branch <value>]`
|
|
@@ -838,6 +876,7 @@ FLAGS
|
|
|
838
876
|
bulkpublish API will be used to publish the entries
|
|
839
877
|
-c, --config=<value> Path to the config file
|
|
840
878
|
-e, --environments=<value>... Destination environments
|
|
879
|
+
-k, --stack-api-key=<value> Stack api key to be used
|
|
841
880
|
-y, --yes Agree to process the command with the current configuration
|
|
842
881
|
--api-version=<value> API Version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].
|
|
843
882
|
--content-types=<value>... The Contenttypes from which entries will be published
|
|
@@ -884,6 +923,12 @@ EXAMPLES
|
|
|
884
923
|
Using --branch
|
|
885
924
|
|
|
886
925
|
$ csdx cm:entries:publish-only-unpublished -b --content-types [CONTENT TYPES] -e [ENVIRONMENTS] --locales LOCALE -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] -source-env [SOURCE ENV]
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
Using --stack-api-key
|
|
930
|
+
|
|
931
|
+
$ csdx cm:entries:publish-only-unpublished -b --content-types [CONTENT TYPES] -e [ENVIRONMENTS] --locales LOCALE -a [MANAGEMENT TOKEN ALIAS] --stack-api-key [STACK API KEY] -source-env [SOURCE ENV]
|
|
887
932
|
```
|
|
888
933
|
|
|
889
934
|
## `csdx cm:entries:publish [-a <value>] [--retry-failed <value>] [--bulk-publish <value>] [--publish-all-content-types] [--content-types <value>] [--locales <value>] [-e <value>] [-c <value>] [-y] [--branch <value>] [--delivery-token <value>] [--source-env <value>]`
|
|
@@ -903,6 +948,7 @@ FLAGS
|
|
|
903
948
|
-c, --config=<value> Path for the external config file (A new config file can be generated at the current
|
|
904
949
|
working directory using `csdx cm:bulk-publish:configure -a [ALIAS]`)
|
|
905
950
|
-e, --environments=<value>... Environments where entries will be published
|
|
951
|
+
-k, --stack-api-key=<value> Stack api key to be used
|
|
906
952
|
-l, --locales=<value>... Locales where entries will be published
|
|
907
953
|
-y, --yes Agree to process the command with the current configuration
|
|
908
954
|
--api-version=<value> API Version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].
|
|
@@ -962,6 +1008,12 @@ EXAMPLES
|
|
|
962
1008
|
Using --source-env
|
|
963
1009
|
|
|
964
1010
|
$ csdx cm:entries:publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN]
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
Using --stack-api-key
|
|
1015
|
+
|
|
1016
|
+
$ csdx cm:entries:publish -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENVIRONMENT] --delivery-token [DELIVERY TOKEN]
|
|
965
1017
|
```
|
|
966
1018
|
|
|
967
1019
|
_See code: [src/commands/cm/entries/publish.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/entries/publish.js)_
|
|
@@ -981,6 +1033,7 @@ FLAGS
|
|
|
981
1033
|
-a, --alias=<value> Alias(name) for the management token
|
|
982
1034
|
-c, --config=<value> Path to the config file
|
|
983
1035
|
-e, --environments=<value>... Destination environments
|
|
1036
|
+
-k, --stack-api-key=<value> Stack api key to be used
|
|
984
1037
|
-l, --locales=<value>... Locales where edited entries will be published
|
|
985
1038
|
-y, --yes Agree to process the command with the current configuration
|
|
986
1039
|
--api-version=<value> API Version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].
|
|
@@ -1031,6 +1084,12 @@ EXAMPLES
|
|
|
1031
1084
|
Using --branch
|
|
1032
1085
|
|
|
1033
1086
|
$ csdx cm:entries:publish-modified --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --source-env [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME]
|
|
1087
|
+
|
|
1088
|
+
|
|
1089
|
+
|
|
1090
|
+
Using --stack-api-key
|
|
1091
|
+
|
|
1092
|
+
$ csdx cm:entries:publish-modified --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --source-env [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -stack-api-key [STACK API KEY]
|
|
1034
1093
|
```
|
|
1035
1094
|
|
|
1036
1095
|
_See code: [src/commands/cm/entries/publish-modified.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/entries/publish-modified.js)_
|
|
@@ -1050,6 +1109,7 @@ FLAGS
|
|
|
1050
1109
|
-a, --alias=<value> Alias(name) for the management token
|
|
1051
1110
|
-c, --config=<value> Path to the config file
|
|
1052
1111
|
-e, --environments=<value>... Destination environments
|
|
1112
|
+
-k, --stack-api-key=<value> Stack api key to be used
|
|
1053
1113
|
-y, --yes Agree to process the command with the current configuration
|
|
1054
1114
|
--api-version=<value> API Version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].
|
|
1055
1115
|
--bulk-publish=<value> [default: true] This flag is set to true by default. It indicates that contentstack's
|
|
@@ -1096,6 +1156,12 @@ EXAMPLES
|
|
|
1096
1156
|
Using --branch flag
|
|
1097
1157
|
|
|
1098
1158
|
$ csdx cm:entries:publish-non-localized-fields --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --alias [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENV] --branch [BRANCH NAME]
|
|
1159
|
+
|
|
1160
|
+
|
|
1161
|
+
|
|
1162
|
+
Using --stack-api-key flag
|
|
1163
|
+
|
|
1164
|
+
$ csdx cm:entries:publish-non-localized-fields --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENV]
|
|
1099
1165
|
```
|
|
1100
1166
|
|
|
1101
1167
|
_See code: [src/commands/cm/entries/publish-non-localized-fields.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/entries/publish-non-localized-fields.js)_
|
|
@@ -1118,6 +1184,7 @@ FLAGS
|
|
|
1118
1184
|
bulkpublish API will be used to publish the entries
|
|
1119
1185
|
-c, --config=<value> Path to the config file
|
|
1120
1186
|
-e, --environments=<value>... Destination environments
|
|
1187
|
+
-k, --stack-api-key=<value> Stack api key to be used
|
|
1121
1188
|
-y, --yes Agree to process the command with the current configuration
|
|
1122
1189
|
--api-version=<value> API Version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].
|
|
1123
1190
|
--content-types=<value>... The Contenttypes from which entries will be published
|
|
@@ -1164,6 +1231,12 @@ EXAMPLES
|
|
|
1164
1231
|
Using --branch
|
|
1165
1232
|
|
|
1166
1233
|
$ csdx cm:entries:publish-only-unpublished -b --content-types [CONTENT TYPES] -e [ENVIRONMENTS] --locales LOCALE -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] -source-env [SOURCE ENV]
|
|
1234
|
+
|
|
1235
|
+
|
|
1236
|
+
|
|
1237
|
+
Using --stack-api-key
|
|
1238
|
+
|
|
1239
|
+
$ csdx cm:entries:publish-only-unpublished -b --content-types [CONTENT TYPES] -e [ENVIRONMENTS] --locales LOCALE -a [MANAGEMENT TOKEN ALIAS] --stack-api-key [STACK API KEY] -source-env [SOURCE ENV]
|
|
1167
1240
|
```
|
|
1168
1241
|
|
|
1169
1242
|
_See code: [src/commands/cm/entries/publish-only-unpublished.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/entries/publish-only-unpublished.js)_
|
|
@@ -1174,24 +1247,25 @@ Unpublish entries from the given environment
|
|
|
1174
1247
|
|
|
1175
1248
|
```
|
|
1176
1249
|
USAGE
|
|
1177
|
-
$ csdx cm:entries:unpublish [-a <value>] [-e <value>] [-c <value>] [-y] [--locale <value>] [--branch
|
|
1178
|
-
[--retry-failed <value>] [--bulk-unpublish <value>] [--api-version <value>] [--content-type <value>]
|
|
1250
|
+
$ csdx cm:entries:unpublish [-a <value>] [-k <value>] [-e <value>] [-c <value>] [-y] [--locale <value>] [--branch
|
|
1251
|
+
<value>] [--retry-failed <value>] [--bulk-unpublish <value>] [--api-version <value>] [--content-type <value>]
|
|
1179
1252
|
[--delivery-token <value>]
|
|
1180
1253
|
|
|
1181
1254
|
FLAGS
|
|
1182
|
-
-a, --alias=<value>
|
|
1183
|
-
-c, --config=<value>
|
|
1184
|
-
-e, --environment=<value>
|
|
1185
|
-
-
|
|
1186
|
-
|
|
1187
|
-
--
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
--
|
|
1193
|
-
--
|
|
1194
|
-
--
|
|
1255
|
+
-a, --alias=<value> Alias(name) for the management token
|
|
1256
|
+
-c, --config=<value> Path to the config file
|
|
1257
|
+
-e, --environment=<value> Source Environment
|
|
1258
|
+
-k, --stack-api-key=<value> Stack api key to be used
|
|
1259
|
+
-y, --yes Agree to process the command with the current configuration
|
|
1260
|
+
--api-version=<value> API Version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].
|
|
1261
|
+
--branch=<value> [default: main] Specify the branch to fetch the content (by default the main branch is
|
|
1262
|
+
selected)
|
|
1263
|
+
--bulk-unpublish=<value> [default: true] This flag is set to true by default. It indicates that contentstack's
|
|
1264
|
+
bulkpublish API will be used to unpublish the entries
|
|
1265
|
+
--content-type=<value> Content type filter
|
|
1266
|
+
--delivery-token=<value> Delivery token for source environment
|
|
1267
|
+
--locale=<value> Locale filter
|
|
1268
|
+
--retry-failed=<value> Retry publishing failed entries from the logfile
|
|
1195
1269
|
|
|
1196
1270
|
DESCRIPTION
|
|
1197
1271
|
Unpublish entries from the given environment
|
|
@@ -1223,11 +1297,15 @@ EXAMPLES
|
|
|
1223
1297
|
|
|
1224
1298
|
|
|
1225
1299
|
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
1300
|
Using --branch flag
|
|
1229
1301
|
|
|
1230
1302
|
$ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --delivery-token [DELIVERY TOKEN] --branch [BRANCH NAME]
|
|
1303
|
+
|
|
1304
|
+
|
|
1305
|
+
|
|
1306
|
+
Using --stack-api-key flag
|
|
1307
|
+
|
|
1308
|
+
$ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --stack-api-key [STACK API KEY] --delivery-token [DELIVERY TOKEN]
|
|
1231
1309
|
```
|
|
1232
1310
|
|
|
1233
1311
|
_See code: [src/commands/cm/entries/unpublish.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/entries/unpublish.js)_
|
|
@@ -1247,6 +1325,7 @@ FLAGS
|
|
|
1247
1325
|
-a, --alias=<value> Alias(name) for the management token
|
|
1248
1326
|
-c, --config=<value> Path to the config file
|
|
1249
1327
|
-e, --environments=<value>... Environments where entries will be published
|
|
1328
|
+
-k, --stack-api-key=<value> Stack api key to be used
|
|
1250
1329
|
-l, --locales=<value>... Locales where entries will be published
|
|
1251
1330
|
-t, --contentTypes=<value>... The Contenttypes from which entries will be published
|
|
1252
1331
|
-y, --yes Agree to process the command with the current configuration
|
|
@@ -1272,7 +1351,7 @@ ALIASES
|
|
|
1272
1351
|
EXAMPLES
|
|
1273
1352
|
General Usage
|
|
1274
1353
|
|
|
1275
|
-
$ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --
|
|
1354
|
+
$ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS]
|
|
1276
1355
|
|
|
1277
1356
|
|
|
1278
1357
|
|
|
@@ -1294,7 +1373,13 @@ EXAMPLES
|
|
|
1294
1373
|
|
|
1295
1374
|
Using --branch
|
|
1296
1375
|
|
|
1297
|
-
$ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --
|
|
1376
|
+
$ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME]
|
|
1377
|
+
|
|
1378
|
+
|
|
1379
|
+
|
|
1380
|
+
Using --stack-api-key
|
|
1381
|
+
|
|
1382
|
+
$ csdx cm:entries:update-and-publish --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] --stack-api-key [STACK API KEY]
|
|
1298
1383
|
```
|
|
1299
1384
|
|
|
1300
1385
|
_See code: [src/commands/cm/entries/update-and-publish.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/entries/update-and-publish.js)_
|
|
@@ -1387,10 +1472,11 @@ The configure command is used to generate a configuration file for publish scrip
|
|
|
1387
1472
|
|
|
1388
1473
|
```
|
|
1389
1474
|
USAGE
|
|
1390
|
-
$ csdx cm:stacks:publish-configure [-a <value>]
|
|
1475
|
+
$ csdx cm:stacks:publish-configure [-a <value>] [-k <value>]
|
|
1391
1476
|
|
|
1392
1477
|
FLAGS
|
|
1393
|
-
-a, --alias=<value>
|
|
1478
|
+
-a, --alias=<value> Alias(name) for the management token
|
|
1479
|
+
-k, --stack-api-key=<value> Stack api key to be used
|
|
1394
1480
|
|
|
1395
1481
|
DESCRIPTION
|
|
1396
1482
|
The configure command is used to generate a configuration file for publish scripts.
|
|
@@ -1404,6 +1490,8 @@ EXAMPLES
|
|
|
1404
1490
|
$ csdx cm:stacks:publish-configure -a <management_token_alias>
|
|
1405
1491
|
|
|
1406
1492
|
$ csdx cm:stacks:publish-configure --alias <management_token_alias>
|
|
1493
|
+
|
|
1494
|
+
$ csdx cm:stacks:publish-configure --stack-api-key <stack_api_key>
|
|
1407
1495
|
```
|
|
1408
1496
|
|
|
1409
1497
|
_See code: [src/commands/cm/stacks/publish-configure.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/stacks/publish-configure.js)_
|
|
@@ -1454,18 +1542,19 @@ USAGE
|
|
|
1454
1542
|
[--only-assets] [--only-entries]
|
|
1455
1543
|
|
|
1456
1544
|
FLAGS
|
|
1457
|
-
-B, --branch=<value>
|
|
1458
|
-
-a, --alias=<value>
|
|
1459
|
-
-c, --config=<value>
|
|
1460
|
-
-e, --environment=<value>
|
|
1461
|
-
-
|
|
1462
|
-
-
|
|
1463
|
-
|
|
1464
|
-
--
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
--
|
|
1468
|
-
--
|
|
1545
|
+
-B, --branch=<value> [default: main] Specify the branch to fetch the content from (default is main branch)
|
|
1546
|
+
-a, --alias=<value> Alias(name) for the management token
|
|
1547
|
+
-c, --config=<value> Path to the config file
|
|
1548
|
+
-e, --environment=<value> Source Environment
|
|
1549
|
+
-k, --stack-api-key=<value> Stack api key to be used
|
|
1550
|
+
-l, --locale=<value> Locale filter
|
|
1551
|
+
-y, --yes Agree to process the command with the current configuration
|
|
1552
|
+
--api-version=<value> API Version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].
|
|
1553
|
+
--bulk-unpublish=<value> [default: true] This flag is set to true by default. It indicates that contentstack's
|
|
1554
|
+
bulkpublish API will be used to unpublish the entries and assets
|
|
1555
|
+
--content-type=<value> Content type filter
|
|
1556
|
+
--delivery-token=<value> Delivery token for source environment
|
|
1557
|
+
--retry-failed=<value> Retry publishing failed entries from the logfile (optional, overrides all other flags)
|
|
1469
1558
|
|
|
1470
1559
|
DESCRIPTION
|
|
1471
1560
|
Unpublish entries or assets of given content types from the specified environment
|
|
@@ -1531,6 +1620,12 @@ EXAMPLES
|
|
|
1531
1620
|
Using --branch flag
|
|
1532
1621
|
|
|
1533
1622
|
$ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --alias [MANAGEMENT TOKEN ALIAS] --delivery-token [DELIVERY TOKEN] --branch [BRANCH NAME]
|
|
1623
|
+
|
|
1624
|
+
|
|
1625
|
+
|
|
1626
|
+
Using --stack-api-key flag
|
|
1627
|
+
|
|
1628
|
+
$ csdx cm:stacks:unpublish --bulk-unpublish --content-type [CONTENT TYPE] --environment [SOURCE ENV] --locale [LOCALE] --stack-api-key [STACK API KEY] --delivery-token [DELIVERY TOKEN]
|
|
1534
1629
|
```
|
|
1535
1630
|
|
|
1536
1631
|
_See code: [src/commands/cm/stacks/unpublish.js](https://github.com/contentstack/cli/blob/main/packages/contentstack-bulk-publish/src/commands/cm/stacks/unpublish.js)_
|
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.3.
|
|
4
|
+
"version": "1.3.11",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@contentstack/cli-command": "
|
|
9
|
-
"@contentstack/cli-utilities": "
|
|
8
|
+
"@contentstack/cli-command": "~1.2.12",
|
|
9
|
+
"@contentstack/cli-utilities": "~1.5.2",
|
|
10
10
|
"bluebird": "^3.7.2",
|
|
11
11
|
"chalk": "^4.1.2",
|
|
12
12
|
"dotenv": "^16.1.4",
|
|
@@ -32,29 +32,34 @@ class PublishModifiedCommand extends Command {
|
|
|
32
32
|
if (this.validate(updatedFlags)) {
|
|
33
33
|
let stack;
|
|
34
34
|
if (!updatedFlags.retryFailed) {
|
|
35
|
-
if (!updatedFlags.alias) {
|
|
36
|
-
updatedFlags.alias = await cliux.prompt('Please enter the management token alias to be used');
|
|
37
|
-
}
|
|
38
|
-
updatedFlags.bulkPublish = updatedFlags.bulkPublish !== 'false';
|
|
39
|
-
// Validate management token alias.
|
|
40
|
-
try {
|
|
41
|
-
this.getToken(updatedFlags.alias);
|
|
42
|
-
} catch (error) {
|
|
43
|
-
this.error(
|
|
44
|
-
`The configured management token alias ${updatedFlags.alias} has not been added yet. Add it using 'csdx auth:tokens:add -a ${updatedFlags.alias}'`,
|
|
45
|
-
{ exit: 2 },
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
35
|
config = {
|
|
49
36
|
alias: updatedFlags.alias,
|
|
50
37
|
host: this.cmaHost,
|
|
51
38
|
cda: this.cdaHost,
|
|
52
39
|
branch: entryEditsFlags.branch,
|
|
53
40
|
};
|
|
41
|
+
if (updatedFlags.alias) {
|
|
42
|
+
try {
|
|
43
|
+
this.getToken(updatedFlags.alias);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
this.error(
|
|
46
|
+
`The configured management token alias ${updatedFlags.alias} has not been added yet. Add it using 'csdx auth:tokens:add -a ${updatedFlags.alias}'`,
|
|
47
|
+
{ exit: 2 },
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
} else if (updatedFlags['stack-api-key']) {
|
|
51
|
+
config.stackApiKey = updatedFlags['stack-api-key'];
|
|
52
|
+
} else {
|
|
53
|
+
this.error('Please use `--alias` or `--stack-api-key` to proceed.', { exit: 2 });
|
|
54
|
+
}
|
|
55
|
+
updatedFlags.bulkPublish = updatedFlags.bulkPublish !== 'false';
|
|
54
56
|
stack = await getStack(config);
|
|
55
57
|
}
|
|
56
58
|
if (await this.confirmFlags(updatedFlags)) {
|
|
57
59
|
try {
|
|
60
|
+
if (process.env.NODE_ENV === 'test') {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
58
63
|
if (!updatedFlags.retryFailed) {
|
|
59
64
|
await start(updatedFlags, stack, config);
|
|
60
65
|
} else {
|
|
@@ -121,6 +126,11 @@ But, if retry-failed flag is set, then only a logfile is required
|
|
|
121
126
|
|
|
122
127
|
PublishModifiedCommand.flags = {
|
|
123
128
|
alias: flags.string({ char: 'a', description: 'Alias(name) for the management token' }),
|
|
129
|
+
'stack-api-key': flags.string({
|
|
130
|
+
char: 'k',
|
|
131
|
+
description: 'Stack api key to be used',
|
|
132
|
+
required: false,
|
|
133
|
+
}),
|
|
124
134
|
retryFailed: flags.string({
|
|
125
135
|
char: 'r',
|
|
126
136
|
description: 'Retry publishing failed entries from the logfile (optional, overrides all other flags)',
|
|
@@ -197,6 +207,9 @@ PublishModifiedCommand.examples = [
|
|
|
197
207
|
'',
|
|
198
208
|
'Using --branch',
|
|
199
209
|
'csdx cm:entries:publish-modified --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --source-env [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME]',
|
|
210
|
+
'',
|
|
211
|
+
'Using --stack-api-key',
|
|
212
|
+
'csdx cm:entries:publish-modified --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --source-env [SOURCE_ENV] -e [ENVIRONMENT 1] [ENVIRONMENT 2] --locales [LOCALE 1] [LOCALE 2] -stack-api-key [STACK API KEY]',
|
|
200
213
|
];
|
|
201
214
|
|
|
202
215
|
PublishModifiedCommand.aliases = ['cm:bulk-publish:entry-edits'];
|
|
@@ -40,25 +40,34 @@ class NonlocalizedFieldChangesCommand extends Command {
|
|
|
40
40
|
let stack;
|
|
41
41
|
if (!updatedFlags.retryFailed) {
|
|
42
42
|
updatedFlags.bulkPublish = updatedFlags.bulkPublish === 'false' ? false : true;
|
|
43
|
-
// Validate management token alias.
|
|
44
|
-
try {
|
|
45
|
-
this.getToken(updatedFlags.alias);
|
|
46
|
-
} catch (error) {
|
|
47
|
-
this.error(
|
|
48
|
-
`The configured management token alias ${updatedFlags.alias} has not been added yet. Add it using 'csdx auth:tokens:add -a ${updatedFlags.alias}'`,
|
|
49
|
-
{ exit: 2 },
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
43
|
config = {
|
|
53
44
|
alias: updatedFlags.alias,
|
|
54
45
|
host: this.cmaHost,
|
|
55
46
|
cda: this.cdaHost,
|
|
56
47
|
branch: nonlocalizedFieldChangesFlags.branch,
|
|
57
48
|
};
|
|
49
|
+
if (updatedFlags.alias) {
|
|
50
|
+
try {
|
|
51
|
+
this.getToken(updatedFlags.alias);
|
|
52
|
+
config.alias = updatedFlags.alias;
|
|
53
|
+
} catch (error) {
|
|
54
|
+
this.error(
|
|
55
|
+
`The configured management token alias ${updatedFlags.alias} has not been added yet. Add it using 'csdx auth:tokens:add -a ${updatedFlags.alias}'`,
|
|
56
|
+
{ exit: 2 },
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
} else if (updatedFlags['stack-api-key']) {
|
|
60
|
+
config.stackApiKey = updatedFlags['stack-api-key'];
|
|
61
|
+
} else {
|
|
62
|
+
this.error('Please use `--alias` or `--stack-api-key` to proceed.', { exit: 2 });
|
|
63
|
+
}
|
|
58
64
|
stack = await getStack(config);
|
|
59
65
|
}
|
|
60
66
|
if (await this.confirmFlags(updatedFlags)) {
|
|
61
67
|
try {
|
|
68
|
+
if (process.env.NODE_ENV === 'test') {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
62
71
|
if (!updatedFlags.retryFailed) {
|
|
63
72
|
await start(updatedFlags, stack, config);
|
|
64
73
|
} else {
|
|
@@ -122,6 +131,11 @@ NonlocalizedFieldChangesCommand.flags = {
|
|
|
122
131
|
char: 'a',
|
|
123
132
|
description: 'Alias(name) for the management token',
|
|
124
133
|
}),
|
|
134
|
+
'stack-api-key': flags.string({
|
|
135
|
+
char: 'k',
|
|
136
|
+
description: 'Stack api key to be used',
|
|
137
|
+
required: false,
|
|
138
|
+
}),
|
|
125
139
|
'retry-failed': flags.string({
|
|
126
140
|
description: 'Retry publishing failed entries from the logfile',
|
|
127
141
|
}),
|
|
@@ -204,6 +218,9 @@ NonlocalizedFieldChangesCommand.examples = [
|
|
|
204
218
|
'',
|
|
205
219
|
'Using --branch flag',
|
|
206
220
|
'csdx cm:entries:publish-non-localized-fields --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --alias [MANAGEMENT TOKEN ALIAS] --source-env [SOURCE ENV] --branch [BRANCH NAME]',
|
|
221
|
+
'',
|
|
222
|
+
'Using --stack-api-key flag',
|
|
223
|
+
'csdx cm:entries:publish-non-localized-fields --content-types [CONTENT TYPE 1] [CONTENT TYPE 2] --environments [ENVIRONMENT 1] [ENVIRONMENT 2] --stack-api-key [STACK API KEY] --source-env [SOURCE ENV]',
|
|
207
224
|
];
|
|
208
225
|
|
|
209
226
|
NonlocalizedFieldChangesCommand.aliases = ['cm:bulk-publish:nonlocalized-field-changes'];
|
|
@@ -22,6 +22,10 @@ But, if retry-failed flag is set, then only a logfile is required
|
|
|
22
22
|
|
|
23
23
|
PublishOnlyUnpublished.flags = {
|
|
24
24
|
alias: flags.string({ char: 'a', description: 'Alias(name) for the management token' }),
|
|
25
|
+
'stack-api-key': flags.string({
|
|
26
|
+
char: 'k',
|
|
27
|
+
description: 'Stack api key to be used',
|
|
28
|
+
}),
|
|
25
29
|
retryFailed: flags.string({
|
|
26
30
|
char: 'r',
|
|
27
31
|
hidden: true,
|
|
@@ -102,6 +106,9 @@ PublishOnlyUnpublished.examples = [
|
|
|
102
106
|
'',
|
|
103
107
|
'Using --branch',
|
|
104
108
|
'csdx cm:entries:publish-only-unpublished -b --content-types [CONTENT TYPES] -e [ENVIRONMENTS] --locales LOCALE -a [MANAGEMENT TOKEN ALIAS] --branch [BRANCH NAME] -source-env [SOURCE ENV]',
|
|
109
|
+
'',
|
|
110
|
+
'Using --stack-api-key',
|
|
111
|
+
'csdx cm:entries:publish-only-unpublished -b --content-types [CONTENT TYPES] -e [ENVIRONMENTS] --locales LOCALE -a [MANAGEMENT TOKEN ALIAS] --stack-api-key [STACK API KEY] -source-env [SOURCE ENV]',
|
|
105
112
|
];
|
|
106
113
|
|
|
107
114
|
PublishOnlyUnpublished.aliases = ['cm:bulk-publish:unpublished-entries'];
|