@contentstack/cli-cm-bulk-publish 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1042 -375
- package/oclif.manifest.json +1484 -1
- package/package.json +7 -13
- package/src/commands/cm/assets/publish.js +1 -1
- package/src/commands/cm/assets/unpublish.js +1 -1
- package/src/commands/cm/bulk-publish/cross-publish.js +8 -4
- package/src/commands/cm/bulk-publish/index.js +1 -1
- package/src/commands/cm/entries/publish-modified.js +1 -1
- package/src/commands/cm/entries/publish-non-localized-fields.js +1 -1
- package/src/commands/cm/entries/publish.js +2 -2
- package/src/commands/cm/entries/unpublish.js +1 -1
- package/src/commands/cm/entries/update-and-publish.js +22 -20
- package/src/commands/cm/stacks/publish-clear-logs.js +1 -1
- package/src/commands/cm/stacks/publish-configure.js +1 -1
- package/src/commands/cm/stacks/publish-revert.js +1 -1
- package/src/commands/cm/stacks/unpublish.js +1 -1
- package/src/services/publish-only-unpublished.js +2 -1
package/package.json
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentstack/cli-cm-bulk-publish",
|
|
3
3
|
"description": "Contentstack CLI plugin for bulk publish actions",
|
|
4
|
-
"version": "1.0
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@contentstack/cli-command": "^1.0
|
|
9
|
-
"@contentstack/cli-utilities": "^1.0
|
|
10
|
-
"@contentstack/management": "^1.6.
|
|
11
|
-
"@oclif/command": "^1.8.16",
|
|
12
|
-
"@oclif/config": "^1.18.3",
|
|
8
|
+
"@contentstack/cli-command": "^1.1.0",
|
|
9
|
+
"@contentstack/cli-utilities": "^1.1.0",
|
|
10
|
+
"@contentstack/management": "^1.6.1",
|
|
13
11
|
"bluebird": "^3.7.2",
|
|
14
12
|
"lodash": "^4.17.15",
|
|
15
13
|
"nock": "^13.0.2",
|
|
@@ -17,8 +15,7 @@
|
|
|
17
15
|
"inquirer": "8.2.4"
|
|
18
16
|
},
|
|
19
17
|
"devDependencies": {
|
|
20
|
-
"
|
|
21
|
-
"@oclif/plugin-help": "^5.1.12",
|
|
18
|
+
"oclif": "^3.1.2",
|
|
22
19
|
"@oclif/test": "^1.2.6",
|
|
23
20
|
"chai": "^4.2.0",
|
|
24
21
|
"eslint": "^8.18.0",
|
|
@@ -46,9 +43,6 @@
|
|
|
46
43
|
"oclif": {
|
|
47
44
|
"commands": "./src/commands",
|
|
48
45
|
"bin": "csdx",
|
|
49
|
-
"devPlugins": [
|
|
50
|
-
"@oclif/plugin-help"
|
|
51
|
-
],
|
|
52
46
|
"hooks": {
|
|
53
47
|
"validateConfig": "./src/hooks/config.js"
|
|
54
48
|
},
|
|
@@ -72,9 +66,9 @@
|
|
|
72
66
|
"repository": "https://github.com/contentstack/cli",
|
|
73
67
|
"scripts": {
|
|
74
68
|
"postpack": "rm -f oclif.manifest.json",
|
|
75
|
-
"prepack": "oclif
|
|
69
|
+
"prepack": "oclif manifest && oclif readme",
|
|
76
70
|
"test": "nyc mocha --forbid-only \"test/**/*.test.js\"",
|
|
77
71
|
"posttest": "eslint .",
|
|
78
|
-
"version": "oclif
|
|
72
|
+
"version": "oclif readme && git add README.md"
|
|
79
73
|
}
|
|
80
74
|
}
|
|
@@ -10,7 +10,7 @@ let config;
|
|
|
10
10
|
|
|
11
11
|
class AssetsPublishCommand extends Command {
|
|
12
12
|
async run() {
|
|
13
|
-
const assetsFlags = this.parse(AssetsPublishCommand)
|
|
13
|
+
const { flags: assetsFlags } = await this.parse(AssetsPublishCommand);
|
|
14
14
|
assetsFlags.retryFailed = assetsFlags['retry-failed'] || assetsFlags.retryFailed || false;
|
|
15
15
|
assetsFlags.folderUid = assetsFlags['folder-uid'] || assetsFlags.folderUid;
|
|
16
16
|
assetsFlags.bulkPublish = assetsFlags['bulk-publish'] || assetsFlags.bulkPublish;
|
|
@@ -11,7 +11,7 @@ let config;
|
|
|
11
11
|
|
|
12
12
|
class UnpublishCommand extends Command {
|
|
13
13
|
async run() {
|
|
14
|
-
const unpublishFlags = this.parse(UnpublishCommand)
|
|
14
|
+
const { flags: unpublishFlags } = await this.parse(UnpublishCommand);
|
|
15
15
|
unpublishFlags.retryFailed = unpublishFlags['retry-failed'] || unpublishFlags.retryFailed || false;
|
|
16
16
|
unpublishFlags.bulkUnpublish = unpublishFlags['bulk-unpublish'] || unpublishFlags.bulkUnpublish;
|
|
17
17
|
unpublishFlags.deliveryToken = unpublishFlags['delivery-token'] || unpublishFlags.deliveryToken;
|
|
@@ -10,7 +10,8 @@ let config;
|
|
|
10
10
|
|
|
11
11
|
class CrossPublishCommand extends Command {
|
|
12
12
|
async run() {
|
|
13
|
-
const
|
|
13
|
+
const { flags: _flags } = await this.parse(CrossPublishCommand);
|
|
14
|
+
const crossPublishFlags = this.flagsAdapter(_flags || {});
|
|
14
15
|
let updatedFlags;
|
|
15
16
|
try {
|
|
16
17
|
updatedFlags = crossPublishFlags.config ? store.updateMissing(configKey, crossPublishFlags) : crossPublishFlags;
|
|
@@ -32,7 +33,10 @@ class CrossPublishCommand extends Command {
|
|
|
32
33
|
try {
|
|
33
34
|
this.getToken(updatedFlags.alias);
|
|
34
35
|
} catch (error) {
|
|
35
|
-
this.error(
|
|
36
|
+
this.error(
|
|
37
|
+
`The configured management token alias ${updatedFlags.alias} has not been added yet. Add it using 'csdx auth:tokens:add -a ${updatedFlags.alias}'`,
|
|
38
|
+
{ exit: 2 },
|
|
39
|
+
);
|
|
36
40
|
}
|
|
37
41
|
config = {
|
|
38
42
|
alias: updatedFlags.alias,
|
|
@@ -212,7 +216,7 @@ CrossPublishCommand.flags = {
|
|
|
212
216
|
hidden: true,
|
|
213
217
|
parse: printFlagDeprecation(['--destEnv'], ['--environments']),
|
|
214
218
|
}),
|
|
215
|
-
|
|
219
|
+
environments: flags.string({
|
|
216
220
|
description: 'Destination Environments',
|
|
217
221
|
multiple: true,
|
|
218
222
|
}),
|
|
@@ -254,6 +258,6 @@ CrossPublishCommand.examples = [
|
|
|
254
258
|
'csdx cm:bulk-publish:cross-publish --content-type [CONTENT TYPE] --source-env [SOURCE ENV] --environments [DESTINATION ENVIRONMENT] --locales [LOCALE] -a [MANAGEMENT TOKEN ALIAS] --delivery-token [DELIVERY TOKEN] --branch [BRANCH NAME]',
|
|
255
259
|
];
|
|
256
260
|
|
|
257
|
-
CrossPublishCommand.usage = `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]
|
|
261
|
+
CrossPublishCommand.usage = `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]`;
|
|
258
262
|
|
|
259
263
|
module.exports = CrossPublishCommand;
|
|
@@ -11,7 +11,7 @@ let config;
|
|
|
11
11
|
|
|
12
12
|
class PublishModifiedCommand extends Command {
|
|
13
13
|
async run() {
|
|
14
|
-
const entryEditsFlags = this.parse(PublishModifiedCommand)
|
|
14
|
+
const { flags: entryEditsFlags } = await this.parse(PublishModifiedCommand);
|
|
15
15
|
entryEditsFlags.retryFailed = entryEditsFlags['retry-failed'] || entryEditsFlags.retryFailed || false;
|
|
16
16
|
entryEditsFlags.contentTypes = entryEditsFlags['content-types'] || entryEditsFlags.contentTypes;
|
|
17
17
|
entryEditsFlags.bulkPublish = entryEditsFlags['bulk-publish'] || entryEditsFlags.bulkPublish;
|
|
@@ -10,7 +10,7 @@ let config;
|
|
|
10
10
|
|
|
11
11
|
class NonlocalizedFieldChangesCommand extends Command {
|
|
12
12
|
async run() {
|
|
13
|
-
const nonlocalizedFieldChangesFlags = this.parse(NonlocalizedFieldChangesCommand)
|
|
13
|
+
const { flags: nonlocalizedFieldChangesFlags } = await this.parse(NonlocalizedFieldChangesCommand);
|
|
14
14
|
nonlocalizedFieldChangesFlags.retryFailed =
|
|
15
15
|
nonlocalizedFieldChangesFlags['retry-failed'] || nonlocalizedFieldChangesFlags.retryFailed || false;
|
|
16
16
|
nonlocalizedFieldChangesFlags.bulkPublish =
|
|
@@ -14,7 +14,7 @@ let config;
|
|
|
14
14
|
|
|
15
15
|
class PublishEntriesCommand extends Command {
|
|
16
16
|
async run() {
|
|
17
|
-
const entriesFlags = this.parse(PublishEntriesCommand)
|
|
17
|
+
const { flags: entriesFlags } = await this.parse(PublishEntriesCommand);
|
|
18
18
|
entriesFlags.retryFailed = entriesFlags['retry-failed'] || entriesFlags.retryFailed || false;
|
|
19
19
|
entriesFlags.contentTypes = entriesFlags['content-types'] || entriesFlags.contentTypes;
|
|
20
20
|
entriesFlags.bulkPublish = entriesFlags['bulk-publish'] || entriesFlags.bulkPublish;
|
|
@@ -224,7 +224,7 @@ PublishEntriesCommand.flags = {
|
|
|
224
224
|
parse: printFlagDeprecation(['-B'], ['--branch']),
|
|
225
225
|
}),
|
|
226
226
|
'delivery-token': flags.string({ description: 'Delivery token for source environment' }),
|
|
227
|
-
'source-env': flags.string({ description: 'Source environment'}),
|
|
227
|
+
'source-env': flags.string({ description: 'Source environment' }),
|
|
228
228
|
};
|
|
229
229
|
|
|
230
230
|
PublishEntriesCommand.examples = [
|
|
@@ -11,7 +11,7 @@ let config;
|
|
|
11
11
|
|
|
12
12
|
class UnpublishCommand extends Command {
|
|
13
13
|
async run() {
|
|
14
|
-
const unpublishFlags = this.parse(UnpublishCommand)
|
|
14
|
+
const { flags: unpublishFlags } = await this.parse(UnpublishCommand);
|
|
15
15
|
unpublishFlags.retryFailed = unpublishFlags['retry-failed'] || unpublishFlags.retryFailed || false;
|
|
16
16
|
unpublishFlags.bulkUnpublish = unpublishFlags['bulk-unpublish'] || unpublishFlags.bulkUnpublish;
|
|
17
17
|
unpublishFlags.contentType = unpublishFlags['content-type'] || unpublishFlags.contentType || '';
|
|
@@ -11,7 +11,7 @@ const configKey = 'addFields';
|
|
|
11
11
|
|
|
12
12
|
class UpdateAndPublishCommand extends Command {
|
|
13
13
|
async run() {
|
|
14
|
-
const addFieldsFlags = this.parse(UpdateAndPublishCommand)
|
|
14
|
+
const { flags: addFieldsFlags } = await this.parse(UpdateAndPublishCommand);
|
|
15
15
|
addFieldsFlags.retryFailed = addFieldsFlags['retry-failed'] || addFieldsFlags.retryFailed || false;
|
|
16
16
|
addFieldsFlags.contentTypes = addFieldsFlags['content-types'] || addFieldsFlags.contentTypes;
|
|
17
17
|
addFieldsFlags.bulkPublish = addFieldsFlags['bulk-publish'] || addFieldsFlags.bulkPublish;
|
|
@@ -114,34 +114,15 @@ UpdateAndPublishCommand.flags = {
|
|
|
114
114
|
'retry-failed': flags.string({
|
|
115
115
|
description: 'Retry publishing failed entries from the logfile (optional, overrides all other flags)',
|
|
116
116
|
}),
|
|
117
|
-
retryFailed: flags.string({
|
|
118
|
-
char: 'r',
|
|
119
|
-
description: 'Retry publishing failed entries from the logfile (optional, overrides all other flags)',
|
|
120
|
-
hidden: true,
|
|
121
|
-
parse: printFlagDeprecation(['-r', '--retryFailed'], ['--retry-failed']),
|
|
122
|
-
}),
|
|
123
117
|
'bulk-publish': flags.string({
|
|
124
118
|
description:
|
|
125
119
|
"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used to publish the entries",
|
|
126
120
|
default: 'true',
|
|
127
121
|
}),
|
|
128
|
-
bulkPublish: flags.string({
|
|
129
|
-
char: 'b',
|
|
130
|
-
description:
|
|
131
|
-
"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used to publish the entries",
|
|
132
|
-
hidden: true,
|
|
133
|
-
parse: printFlagDeprecation(['-b', '--bulkPublish'], ['--bulk-publish']),
|
|
134
|
-
}),
|
|
135
122
|
'content-types': flags.string({
|
|
136
123
|
description: 'The Contenttypes from which entries will be published',
|
|
137
124
|
multiple: true,
|
|
138
125
|
}),
|
|
139
|
-
contentTypes: flags.string({
|
|
140
|
-
char: 't',
|
|
141
|
-
description: 'The Contenttypes from which entries will be published',
|
|
142
|
-
multiple: true,
|
|
143
|
-
parse: printFlagDeprecation(['-t', '--contentTypes'], ['--content-types']),
|
|
144
|
-
}),
|
|
145
126
|
environments: flags.string({
|
|
146
127
|
char: 'e',
|
|
147
128
|
description: 'Environments where entries will be published',
|
|
@@ -165,6 +146,27 @@ UpdateAndPublishCommand.flags = {
|
|
|
165
146
|
default: false,
|
|
166
147
|
description: 'Update and publish all entries even if no fields have been added',
|
|
167
148
|
}),
|
|
149
|
+
|
|
150
|
+
// To be deprecated
|
|
151
|
+
retryFailed: flags.string({
|
|
152
|
+
char: 'r',
|
|
153
|
+
description: 'Retry publishing failed entries from the logfile (optional, overrides all other flags)',
|
|
154
|
+
hidden: true,
|
|
155
|
+
parse: printFlagDeprecation(['-r', '--retryFailed'], ['--retry-failed']),
|
|
156
|
+
}),
|
|
157
|
+
bulkPublish: flags.string({
|
|
158
|
+
char: 'b',
|
|
159
|
+
description:
|
|
160
|
+
"This flag is set to true by default. It indicates that contentstack's bulkpublish API will be used to publish the entries",
|
|
161
|
+
hidden: true,
|
|
162
|
+
parse: printFlagDeprecation(['-b', '--bulkPublish'], ['--bulk-publish']),
|
|
163
|
+
}),
|
|
164
|
+
contentTypes: flags.string({
|
|
165
|
+
char: 't',
|
|
166
|
+
description: 'The Contenttypes from which entries will be published',
|
|
167
|
+
multiple: true,
|
|
168
|
+
parse: printFlagDeprecation(['-t', '--contentTypes'], ['--content-types']),
|
|
169
|
+
}),
|
|
168
170
|
};
|
|
169
171
|
|
|
170
172
|
UpdateAndPublishCommand.examples = [
|
|
@@ -6,7 +6,7 @@ const { getLogsDirPath } = require('../../../util/logger.js');
|
|
|
6
6
|
|
|
7
7
|
class ClearCommand extends Command {
|
|
8
8
|
async run() {
|
|
9
|
-
const clearFlags = this.parse(ClearCommand)
|
|
9
|
+
const { flags: clearFlags } = await this.parse(ClearCommand);
|
|
10
10
|
let dirPath = getLogsDirPath();
|
|
11
11
|
if (clearFlags['log-files-count'] || clearFlags.list) {
|
|
12
12
|
this.listFiles(dirPath);
|
|
@@ -7,7 +7,7 @@ let config = require('../../../config/index.js');
|
|
|
7
7
|
|
|
8
8
|
class ConfigureCommand extends Command {
|
|
9
9
|
async run() {
|
|
10
|
-
const configureFlags = this.parse(ConfigureCommand)
|
|
10
|
+
const { flags: configureFlags } = await this.parse(ConfigureCommand);
|
|
11
11
|
|
|
12
12
|
if (!configureFlags.alias) {
|
|
13
13
|
configureFlags.alias = await cliux.prompt('Please enter the management token alias to be used');
|
|
@@ -10,7 +10,7 @@ const configKey = 'revert';
|
|
|
10
10
|
|
|
11
11
|
class RevertCommand extends Command {
|
|
12
12
|
async run() {
|
|
13
|
-
const revertFlags = this.parse(RevertCommand)
|
|
13
|
+
const { flags: revertFlags } = await this.parse(RevertCommand);
|
|
14
14
|
revertFlags.retryFailed = revertFlags['retry-failed'] || revertFlags.retryFailed;
|
|
15
15
|
revertFlags.logFile = revertFlags['log-file'] || revertFlags.logFile;
|
|
16
16
|
delete revertFlags['retry-failed'];
|
|
@@ -11,7 +11,7 @@ let config;
|
|
|
11
11
|
|
|
12
12
|
class UnpublishCommand extends Command {
|
|
13
13
|
async run() {
|
|
14
|
-
const unpublishFlags = this.parse(UnpublishCommand)
|
|
14
|
+
const { flags: unpublishFlags } = await this.parse(UnpublishCommand);
|
|
15
15
|
unpublishFlags.retryFailed = unpublishFlags['retry-failed'] || unpublishFlags.retryFailed;
|
|
16
16
|
unpublishFlags.bulkUnpublish = unpublishFlags['bulk-unpublish'] || unpublishFlags.bulkUnpublish;
|
|
17
17
|
unpublishFlags.contentType = unpublishFlags['content-type'] || unpublishFlags.contentType;
|
|
@@ -11,7 +11,8 @@ const configKey = 'publish_unpublished_env';
|
|
|
11
11
|
|
|
12
12
|
async function publishOnlyUnpublishedService(UnpublishedEntriesCommand) {
|
|
13
13
|
let config;
|
|
14
|
-
const
|
|
14
|
+
const _flags = await this.parse(UnpublishedEntriesCommand)
|
|
15
|
+
const unpublishedEntriesFlags = flagsAdapter(_flags.flags);
|
|
15
16
|
let updatedFlags;
|
|
16
17
|
try {
|
|
17
18
|
updatedFlags = unpublishedEntriesFlags.config
|