diff --git a/packages/contentstack-import/src/config/default.js b/packages/contentstack-import/src/config/default.js index d09ce6f040..7b28b8192f 100644 --- a/packages/contentstack-import/src/config/default.js +++ b/packages/contentstack-import/src/config/default.js @@ -14,12 +14,12 @@ module.exports = { 'environments', 'assets', 'extensions', - 'webhooks', 'global-fields', 'content-types', 'workflows', 'entries', 'labels', + 'webhooks', ], locales: { dirName: 'locales', diff --git a/packages/contentstack-import/src/lib/import/entries.js b/packages/contentstack-import/src/lib/import/entries.js index a6f5978fcd..bbd4951467 100755 --- a/packages/contentstack-import/src/lib/import/entries.js +++ b/packages/contentstack-import/src/lib/import/entries.js @@ -650,6 +650,7 @@ importEntries.prototype = { .contentType(ctUid) .entry(entry.uid); Object.assign(entryResponse, entry); + delete entryResponse.title; delete entryResponse.publish_details; return entryResponse .update({ locale: lang }) diff --git a/packages/contentstack-import/src/lib/import/webhooks.js b/packages/contentstack-import/src/lib/import/webhooks.js index 53e4399492..c10d9537f8 100644 --- a/packages/contentstack-import/src/lib/import/webhooks.js +++ b/packages/contentstack-import/src/lib/import/webhooks.js @@ -58,6 +58,9 @@ importWebhooks.prototype = { webUids, function (webUid) { let web = self.webhooks[webUid]; + if (config.disableWebhooks) { + web.disabled = true; + } if (!self.webUidMapper.hasOwnProperty(webUid)) { let requestOption = { json: { @@ -65,26 +68,24 @@ importWebhooks.prototype = { }, }; - return ( - client - .stack({ api_key: config.target_stack, management_token: config.management_token }) - .webhook() - .create(requestOption.json) - .then(function (response) { - self.success.push(response); - self.webUidMapper[webUid] = response.uid; - helper.writeFile(webUidMapperPath, self.webUidMapper); - }) - .catch(function (err) { - let error = JSON.parse(err.message); - self.fails.push(web); - addlogs( - config, - chalk.red("Webhooks: '" + web.name + "' failed to be import\n" + JSON.stringify(error)), - 'error', - ); - }) - ); + return client + .stack({ api_key: config.target_stack, management_token: config.management_token }) + .webhook() + .create(requestOption.json) + .then(function (response) { + self.success.push(response); + self.webUidMapper[webUid] = response.uid; + helper.writeFile(webUidMapperPath, self.webUidMapper); + }) + .catch(function (err) { + let error = JSON.parse(err.message); + self.fails.push(web); + addlogs( + config, + chalk.red("Webhooks: '" + web.name + "' failed to be import\n" + JSON.stringify(error)), + 'error', + ); + }); } else { // the webhooks has already been created addlogs(