@contentstack/cli-cm-bulk-publish 1.4.3 → 1.4.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@contentstack/cli-cm-bulk-publish",
3
3
  "description": "Contentstack CLI plugin for bulk publish actions",
4
- "version": "1.4.3",
4
+ "version": "1.4.5",
5
5
  "author": "Contentstack",
6
6
  "bugs": "https://github.com/contentstack/cli/issues",
7
7
  "dependencies": {
@@ -99,4 +99,4 @@
99
99
  "version": "oclif readme && git add README.md",
100
100
  "clean": "rm -rf ./node_modules tsconfig.build.tsbuildinfo"
101
101
  }
102
- }
102
+ }
@@ -124,7 +124,7 @@ class CrossPublishCommand extends Command {
124
124
 
125
125
  flagsAdapter(_flags) {
126
126
  if ('content-type' in _flags) {
127
- _flags.contentType = _flags['content-type'];
127
+ _flags.contentTypes = _flags['content-type'];
128
128
  delete _flags['content-type'];
129
129
  }
130
130
  if ('locales' in _flags) {
@@ -196,7 +196,7 @@ CrossPublishCommand.flags = {
196
196
  default: 'true',
197
197
  }),
198
198
  'api-version': flags.string({
199
- description : "API Version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].",
199
+ description: 'API Version to be used. Values [Default: 3, Nested Reference Publishing: 3.2].',
200
200
  }),
201
201
  contentType: flags.string({
202
202
  char: 't',
@@ -192,6 +192,12 @@ async function getSyncEntries(
192
192
 
193
193
  const entriesResponse = await Stack.sync(syncData);
194
194
 
195
+ if (filter?.content_type_uid?.length) {
196
+ entriesResponse.items = entriesResponse.items.filter((entry) =>
197
+ filter?.content_type_uid.includes(entry.content_type_uid),
198
+ );
199
+ }
200
+
195
201
  if (entriesResponse.items.length > 0) {
196
202
  await bulkAction(stack, entriesResponse.items, bulkPublish, filter, destEnv, apiVersion);
197
203
  }
@@ -241,7 +247,7 @@ async function start(
241
247
  bulkPublish,
242
248
  _filter,
243
249
  deliveryToken,
244
- contentType,
250
+ contentTypes,
245
251
  environment,
246
252
  locale,
247
253
  onlyAssets,
@@ -286,8 +292,8 @@ async function start(
286
292
  };
287
293
  if (f_types) filter.type = f_types;
288
294
  // filter.type = (f_types) ? f_types : types // types mentioned in the config file (f_types) are given preference
289
- if (contentType) {
290
- filter.content_type_uid = contentType;
295
+ if (contentTypes) {
296
+ filter.content_type_uid = contentTypes;
291
297
  filter.type = 'entry_published';
292
298
  }
293
299
  if (onlyAssets) {