@contentstack/cli-cm-bulk-publish 1.10.0 → 1.10.2
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 +1 -1
- package/package.json +2 -2
- package/src/commands/cm/assets/publish.js +1 -0
- package/src/commands/cm/assets/unpublish.js +1 -0
- package/src/commands/cm/bulk-publish/cross-publish.js +1 -0
- package/src/commands/cm/entries/publish-modified.js +1 -0
- package/src/commands/cm/entries/publish-non-localized-fields.js +1 -0
- package/src/commands/cm/entries/publish.js +15 -8
- package/src/commands/cm/entries/unpublish.js +1 -0
- package/src/commands/cm/entries/update-and-publish.js +1 -0
- package/src/commands/cm/stacks/unpublish.js +1 -0
- package/src/producer/cross-publish.js +9 -10
- package/src/producer/revert.js +2 -1
- package/src/services/publish-only-unpublished.js +1 -0
- package/src/util/client.js +1 -0
- package/src/util/retryfailed.js +1 -1
- package/src/util/store.js +1 -0
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.10.
|
|
21
|
+
@contentstack/cli-cm-bulk-publish/1.10.1 darwin-arm64 node-v22.14.0
|
|
22
22
|
$ csdx --help [COMMAND]
|
|
23
23
|
USAGE
|
|
24
24
|
$ csdx COMMAND
|
package/package.json
CHANGED
|
@@ -1,13 +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.10.
|
|
4
|
+
"version": "1.10.2",
|
|
5
5
|
"author": "Contentstack",
|
|
6
6
|
"bugs": "https://github.com/contentstack/cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@contentstack/cli-command": "~1.6.1",
|
|
9
9
|
"@contentstack/cli-config": "~1.15.0",
|
|
10
|
-
"@contentstack/cli-utilities": "~1.
|
|
10
|
+
"@contentstack/cli-utilities": "~1.14.4",
|
|
11
11
|
"@oclif/core": "^4.3.0",
|
|
12
12
|
"@oclif/plugin-help": "^6.2.28",
|
|
13
13
|
"chalk": "^4.1.2",
|
|
@@ -50,6 +50,7 @@ class PublishEntriesCommand extends Command {
|
|
|
50
50
|
host: this.cmaHost,
|
|
51
51
|
cda: this.cdaHost,
|
|
52
52
|
branch: entriesFlags.branch,
|
|
53
|
+
delayMs: updatedFlags.delayMs,
|
|
53
54
|
};
|
|
54
55
|
if (updatedFlags.alias) {
|
|
55
56
|
try {
|
|
@@ -87,14 +88,20 @@ class PublishEntriesCommand extends Command {
|
|
|
87
88
|
updatedFlags.destEnv = updatedFlags.environments;
|
|
88
89
|
updatedFlags.environment = updatedFlags['source-env'];
|
|
89
90
|
updatedFlags.onlyEntries = true;
|
|
90
|
-
if
|
|
91
|
-
updatedFlags.
|
|
92
|
-
updatedFlags.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
if(Array.isArray(updatedFlags.contentTypes) && updatedFlags.contentTypes.length > 0){
|
|
92
|
+
for (const contentType of updatedFlags.contentTypes) {
|
|
93
|
+
updatedFlags.contentType = contentType;
|
|
94
|
+
if (Array.isArray(updatedFlags.locales)) {
|
|
95
|
+
for (const locale of updatedFlags.locales) {
|
|
96
|
+
updatedFlags.locale = locale;
|
|
97
|
+
console.log(`Bulk publish started for content type \x1b[36m${updatedFlags.contentType}\x1b[0m and locale is \x1b[36m${updatedFlags.locale}\x1b[0m`);
|
|
98
|
+
await publishFunction(startCrossPublish);
|
|
99
|
+
}
|
|
100
|
+
} else {
|
|
101
|
+
updatedFlags.locale = updatedFlags.locales;
|
|
102
|
+
publishFunction(startCrossPublish);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
98
105
|
}
|
|
99
106
|
} else {
|
|
100
107
|
publishFunction(startPublish);
|
|
@@ -200,17 +200,15 @@ async function getSyncEntries(
|
|
|
200
200
|
if (queryParamsObj.locale) {
|
|
201
201
|
syncData['locale'] = queryParamsObj.locale;
|
|
202
202
|
}
|
|
203
|
+
if (filter?.content_type_uid) {
|
|
204
|
+
syncData['content_type_uid'] = filter.content_type_uid;
|
|
205
|
+
}
|
|
203
206
|
if (queryParamsObj.type) {
|
|
204
207
|
syncData['type'] = queryParamsObj.type;
|
|
205
208
|
}
|
|
209
|
+
let entriesResponse;
|
|
210
|
+
entriesResponse = await Stack.sync(syncData);
|
|
206
211
|
|
|
207
|
-
const entriesResponse = await Stack.sync(syncData);
|
|
208
|
-
|
|
209
|
-
if (filter?.content_type_uid?.length) {
|
|
210
|
-
entriesResponse.items = entriesResponse.items.filter((entry) =>
|
|
211
|
-
filter?.content_type_uid.includes(entry.content_type_uid),
|
|
212
|
-
);
|
|
213
|
-
}
|
|
214
212
|
|
|
215
213
|
if (variantsFlag) {
|
|
216
214
|
for (let index = 0; index < entriesResponse?.items?.length; index++) {
|
|
@@ -241,6 +239,7 @@ async function getSyncEntries(
|
|
|
241
239
|
destEnv,
|
|
242
240
|
apiVersion,
|
|
243
241
|
bulkPublishLimit,
|
|
242
|
+
variantsFlag,
|
|
244
243
|
entriesResponse.pagination_token,
|
|
245
244
|
);
|
|
246
245
|
}, 3000);
|
|
@@ -314,7 +313,7 @@ async function start(
|
|
|
314
313
|
retryFailed,
|
|
315
314
|
bulkPublish,
|
|
316
315
|
deliveryToken,
|
|
317
|
-
|
|
316
|
+
contentType,
|
|
318
317
|
environment,
|
|
319
318
|
locale,
|
|
320
319
|
onlyAssets,
|
|
@@ -372,8 +371,8 @@ async function start(
|
|
|
372
371
|
};
|
|
373
372
|
if (f_types) filter.type = f_types;
|
|
374
373
|
// filter.type = (f_types) ? f_types : types // types mentioned in the config file (f_types) are given preference
|
|
375
|
-
if (
|
|
376
|
-
filter.content_type_uid =
|
|
374
|
+
if (contentType) {
|
|
375
|
+
filter.content_type_uid = contentType;
|
|
377
376
|
filter.type = 'entry_published';
|
|
378
377
|
}
|
|
379
378
|
if (onlyAssets) {
|
package/src/producer/revert.js
CHANGED
|
@@ -183,7 +183,8 @@ async function revertUsingLogs(logFileName) {
|
|
|
183
183
|
apikey: response.file[0].message.api_key,
|
|
184
184
|
alias: response.file[0].message.alias,
|
|
185
185
|
host: response.file[0].message.host,
|
|
186
|
-
branch: response.file[0].message.branch || 'main'
|
|
186
|
+
branch: response.file[0].message.branch || 'main',
|
|
187
|
+
delayMs: response.file[0].message.delayMs
|
|
187
188
|
});
|
|
188
189
|
logs = await formatLogData(stack, response.file);
|
|
189
190
|
const bulkPublishLimit = fetchBulkPublishLimit(stack?.org_uid);
|
package/src/util/client.js
CHANGED
package/src/util/retryfailed.js
CHANGED
|
@@ -5,7 +5,7 @@ module.exports = async (filename, queue, Type) => {
|
|
|
5
5
|
const logs = await getAllLogs(filename);
|
|
6
6
|
if (logs.file.length > 0) {
|
|
7
7
|
logs.file.forEach(async (log) => {
|
|
8
|
-
const stackOptions = {host: log.message.host };
|
|
8
|
+
const stackOptions = {host: log.message.host, delayMs: log.message.delayMs };
|
|
9
9
|
if(log.message.alias) {
|
|
10
10
|
stackOptions["alias"] = log.message.alias
|
|
11
11
|
} else {
|