@contentstack/cli-cm-bulk-publish 1.8.1 → 1.8.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 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.8.1 darwin-arm64 node-v22.14.0
21
+ @contentstack/cli-cm-bulk-publish/1.8.2 darwin-x64 node-v22.17.0
22
22
  $ csdx --help [COMMAND]
23
23
  USAGE
24
24
  $ csdx COMMAND
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "@contentstack/cli-cm-bulk-publish",
3
3
  "description": "Contentstack CLI plugin for bulk publish actions",
4
- "version": "1.8.1",
4
+ "version": "1.8.2",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
8
8
  "@contentstack/cli-command": "~1.5.0",
9
9
  "@contentstack/cli-utilities": "~1.12.0",
10
+ "@oclif/core": "^4.3.0",
11
+ "@oclif/plugin-help": "^6.2.28",
10
12
  "chalk": "^4.1.2",
11
13
  "dotenv": "^16.5.0",
12
14
  "inquirer": "8.2.6",
@@ -268,7 +268,6 @@ async function getEnvironment(stack, environment) {
268
268
  if (Array.isArray(environment) && environment.length) {
269
269
  for (let i = 0; i < environment.length; i++) {
270
270
  const key = await stack.environment(environment[i]).fetch();
271
- console.log(key);
272
271
  mapping[key.uid] = environment[i];
273
272
  }
274
273
  } else {
@@ -16,6 +16,7 @@ const command = new Command();
16
16
  const { isEmpty } = require('../util');
17
17
  const { fetchBulkPublishLimit } = require('../util/common-utility');
18
18
  const VARIANTS_UNPUBLISH_API_VERSION = '3.2';
19
+ const delay = (ms) => new Promise((res) => setTimeout(res, ms));
19
20
 
20
21
  let bulkUnPublishSet = [];
21
22
  let bulkUnPulishAssetSet = [];
@@ -196,7 +197,6 @@ async function getSyncEntries(
196
197
  }
197
198
 
198
199
  const Stack = new command.deliveryAPIClient.Stack(deliveryAPIOptions);
199
-
200
200
  Stack.setHost(config.cda);
201
201
 
202
202
  const syncData = {};
@@ -227,28 +227,29 @@ async function getSyncEntries(
227
227
  // Call bulkAction for entries without variants
228
228
  await bulkAction(stack, entriesResponse.items, bulkUnpublish, environment, locale, apiVersion, bulkPublishLimit, false);
229
229
  }
230
-
231
- if (entriesResponse.items.length === 0) {
230
+ if (entriesResponse.items.length === 0 && !entriesResponse.pagination_token) {
232
231
  if (!changedFlag) console.log('No Entries/Assets Found published on specified environment');
233
232
  return resolve();
234
233
  }
235
- setTimeout(async () => {
236
- await getSyncEntries(
237
- stack,
238
- config,
239
- locale,
240
- queryParams,
241
- bulkUnpublish,
242
- environment,
243
- deliveryToken,
244
- apiVersion,
245
- bulkPublishLimit,
246
- variantsFlag,
247
- null,
248
- );
249
- }, 3000);
234
+
235
+ await delay(3000);
236
+ await getSyncEntries(
237
+ stack,
238
+ config,
239
+ locale,
240
+ queryParams,
241
+ bulkUnpublish,
242
+ environment,
243
+ deliveryToken,
244
+ apiVersion,
245
+ bulkPublishLimit,
246
+ variantsFlag,
247
+ entriesResponse.pagination_token,
248
+ );
249
+
250
+ return resolve();
250
251
  } catch (error) {
251
- reject(error);
252
+ return reject(error);
252
253
  }
253
254
  });
254
255
  }