@commercetools-frontend/mc-scripts 24.13.0 → 25.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.
Files changed (76) hide show
  1. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.dev.js +1 -1
  2. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.cjs.prod.js +1 -1
  3. package/application-runtime/dist/commercetools-frontend-mc-scripts-application-runtime.esm.js +1 -1
  4. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.dev.js +14 -13
  5. package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +14 -13
  6. package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +14 -13
  7. package/dist/{build-f737874d.cjs.dev.js → build-0a5986d1.cjs.dev.js} +7 -7
  8. package/dist/{build-85028596.esm.js → build-dbcd0936.esm.js} +7 -7
  9. package/dist/{build-136a1b89.cjs.prod.js → build-ec10df64.cjs.prod.js} +7 -7
  10. package/dist/{build-vite-e26f6c9f.cjs.dev.js → build-vite-16b1a575.cjs.dev.js} +8 -9
  11. package/dist/{build-vite-85211835.esm.js → build-vite-59e1f185.esm.js} +8 -9
  12. package/dist/{build-vite-4a6c90c2.cjs.prod.js → build-vite-5d317720.cjs.prod.js} +8 -9
  13. package/dist/commercetools-frontend-mc-scripts.cjs.dev.js +1 -1
  14. package/dist/commercetools-frontend-mc-scripts.cjs.prod.js +1 -1
  15. package/dist/commercetools-frontend-mc-scripts.esm.js +1 -1
  16. package/dist/{compile-html-adfef598.esm.js → compile-html-025cd493.esm.js} +2 -4
  17. package/dist/{compile-html-b80f9651.cjs.prod.js → compile-html-50fd05ec.cjs.prod.js} +2 -5
  18. package/dist/{compile-html-8679f721.cjs.dev.js → compile-html-f4ac88cc.cjs.dev.js} +2 -5
  19. package/dist/{config-sync-c2f0d0d2.cjs.prod.js → config-sync-ce05c66c.cjs.prod.js} +70 -78
  20. package/dist/{config-sync-a6d29e7e.cjs.dev.js → config-sync-dbb43993.cjs.dev.js} +72 -80
  21. package/dist/{config-sync-ca738e38.esm.js → config-sync-e7f53a98.esm.js} +71 -79
  22. package/dist/{create-postcss-config-2a12c11b.esm.js → create-postcss-config-0a86560d.esm.js} +1 -1
  23. package/dist/{create-postcss-config-7ea95e6f.cjs.dev.js → create-postcss-config-381b636b.cjs.dev.js} +1 -1
  24. package/dist/{create-postcss-config-43a47b87.cjs.prod.js → create-postcss-config-91c09596.cjs.prod.js} +1 -1
  25. package/dist/{create-webpack-config-for-development-01784333.cjs.prod.js → create-webpack-config-for-development-37677a49.cjs.prod.js} +6 -6
  26. package/dist/{create-webpack-config-for-development-09988fe4.cjs.dev.js → create-webpack-config-for-development-488742b2.cjs.dev.js} +6 -6
  27. package/dist/{create-webpack-config-for-development-ca57ea56.esm.js → create-webpack-config-for-development-df3f7f7f.esm.js} +6 -6
  28. package/dist/{create-webpack-config-for-production-d1699ee5.cjs.dev.js → create-webpack-config-for-production-46d817cc.cjs.dev.js} +7 -7
  29. package/dist/{create-webpack-config-for-production-58d046e9.cjs.prod.js → create-webpack-config-for-production-aad64e2a.cjs.prod.js} +7 -7
  30. package/dist/{create-webpack-config-for-production-7b4166fc.esm.js → create-webpack-config-for-production-e22f78d2.esm.js} +7 -7
  31. package/dist/{credentials-storage-381abf27.cjs.prod.js → credentials-storage-0b89aa0e.cjs.prod.js} +1 -1
  32. package/dist/{credentials-storage-7285d7b4.esm.js → credentials-storage-4464313c.esm.js} +1 -1
  33. package/dist/{credentials-storage-de220814.cjs.dev.js → credentials-storage-cbb5c559.cjs.dev.js} +1 -1
  34. package/dist/{deployment-previews-set-6baa8fc7.cjs.dev.js → deployment-previews-set-4edd48db.cjs.dev.js} +22 -28
  35. package/dist/{deployment-previews-set-86ea8608.cjs.prod.js → deployment-previews-set-636fb1a3.cjs.prod.js} +22 -28
  36. package/dist/{deployment-previews-set-8b33d390.esm.js → deployment-previews-set-bbef95d2.esm.js} +22 -27
  37. package/dist/{graphql-requests-73d961d9.cjs.dev.js → graphql-requests-0a6eeb3a.cjs.prod.js} +5 -8
  38. package/dist/{graphql-requests-b6ca7894.esm.js → graphql-requests-14074b2b.esm.js} +5 -8
  39. package/dist/{graphql-requests-4ff022ec.cjs.prod.js → graphql-requests-23f7ddb1.cjs.dev.js} +5 -8
  40. package/dist/{i18n-message-complilation-8aec9d1b.esm.js → i18n-message-complilation-21d3b0aa.esm.js} +1 -1
  41. package/dist/{i18n-message-complilation-3f80e8d6.cjs.dev.js → i18n-message-complilation-7311cb29.cjs.dev.js} +1 -1
  42. package/dist/{i18n-message-complilation-393d344a.cjs.prod.js → i18n-message-complilation-7762da61.cjs.prod.js} +1 -1
  43. package/dist/{login-5c212340.esm.js → login-1b222f33.esm.js} +27 -30
  44. package/dist/{login-b4e3433c.cjs.prod.js → login-54ebae96.cjs.prod.js} +28 -31
  45. package/dist/{login-856475d9.cjs.dev.js → login-a6fd5fbf.cjs.dev.js} +28 -31
  46. package/dist/{optimizations-ea21b802.cjs.prod.js → optimizations-7789145e.cjs.dev.js} +5 -8
  47. package/dist/{optimizations-ea71a24a.esm.js → optimizations-bf991634.esm.js} +5 -7
  48. package/dist/{optimizations-ebbeaf88.cjs.dev.js → optimizations-fb93514f.cjs.prod.js} +5 -8
  49. package/dist/{package-85c56dad.esm.js → package-a34835d9.esm.js} +9 -11
  50. package/dist/{package-36c179b4.cjs.prod.js → package-d8b1f4c0.cjs.dev.js} +9 -11
  51. package/dist/{package-483f057b.cjs.dev.js → package-e1f7242c.cjs.prod.js} +9 -11
  52. package/dist/{paths-7bf7e88e.esm.js → paths-39f22b8b.esm.js} +4 -9
  53. package/dist/{paths-af1a725a.cjs.prod.js → paths-7768b440.cjs.prod.js} +4 -10
  54. package/dist/{paths-ec3e3a7d.cjs.dev.js → paths-b76fc753.cjs.dev.js} +4 -10
  55. package/dist/{serve-04a03d5f.cjs.dev.js → serve-38456e1b.cjs.dev.js} +7 -6
  56. package/dist/{serve-fb1a0f5a.esm.js → serve-be1f9439.esm.js} +6 -6
  57. package/dist/{serve-2a863026.cjs.prod.js → serve-cc4a766d.cjs.prod.js} +7 -6
  58. package/dist/{start-33cc9cbb.cjs.prod.js → start-0be8a294.cjs.prod.js} +8 -9
  59. package/dist/{start-e28d1fec.cjs.dev.js → start-37ec4a7e.cjs.dev.js} +8 -9
  60. package/dist/{start-654d09ae.esm.js → start-890895df.esm.js} +8 -9
  61. package/dist/{start-vite-eea72ba9.cjs.dev.js → start-vite-068e9f73.cjs.dev.js} +3 -4
  62. package/dist/{start-vite-d548c121.cjs.prod.js → start-vite-29078b3a.cjs.prod.js} +3 -4
  63. package/dist/{start-vite-d649d1f3.esm.js → start-vite-7d1161e8.esm.js} +3 -4
  64. package/dist/{vite-plugin-svgr-53ef97c7.cjs.dev.js → vite-plugin-svgr-4034a834.cjs.prod.js} +4 -4
  65. package/dist/{vite-plugin-svgr-5de1cad9.cjs.prod.js → vite-plugin-svgr-7d06f400.cjs.dev.js} +4 -4
  66. package/dist/{vite-plugin-svgr-22c8d518.esm.js → vite-plugin-svgr-de6ee7da.esm.js} +4 -4
  67. package/package.json +9 -11
  68. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.dev.js +2 -2
  69. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.prod.js +2 -2
  70. package/postcss/dist/commercetools-frontend-mc-scripts-postcss.esm.js +2 -2
  71. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.dev.js +6 -6
  72. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +6 -6
  73. package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +6 -6
  74. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.dev.js +1 -1
  75. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.prod.js +1 -1
  76. package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.esm.js +1 -1
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
4
- var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
5
4
  var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
6
5
  var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
7
6
  var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
@@ -10,7 +9,7 @@ var chalk = require('chalk');
10
9
  var omit = require('lodash/omit');
11
10
  var prompts = require('prompts');
12
11
  var applicationConfig = require('@commercetools-frontend/application-config');
13
- var credentialsStorage$1 = require('./credentials-storage-de220814.cjs.dev.js');
12
+ var credentialsStorage$1 = require('./credentials-storage-cbb5c559.cjs.dev.js');
14
13
  var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
15
14
  var _Object$getOwnPropertyDescriptor = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
16
15
  var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
@@ -20,9 +19,10 @@ var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
20
19
  var _repeatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/repeat');
21
20
  var _Set = require('@babel/runtime-corejs3/core-js-stable/set');
22
21
  var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
22
+ var _bindInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/bind');
23
23
  var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
24
24
  var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
25
- var graphqlRequests = require('./graphql-requests-73d961d9.cjs.dev.js');
25
+ var graphqlRequests = require('./graphql-requests-23f7ddb1.cjs.dev.js');
26
26
  require('@babel/runtime-corejs3/helpers/classCallCheck');
27
27
  require('@babel/runtime-corejs3/helpers/createClass');
28
28
  require('@babel/runtime-corejs3/core-js-stable/date/now');
@@ -35,11 +35,10 @@ require('graphql');
35
35
  require('graphql-request');
36
36
  require('@commercetools-frontend/constants');
37
37
  require('@commercetools/http-user-agent');
38
- require('./package-483f057b.cjs.dev.js');
38
+ require('./package-d8b1f4c0.cjs.dev.js');
39
39
 
40
40
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
41
41
 
42
- var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
43
42
  var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
44
43
  var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
45
44
  var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
@@ -55,21 +54,22 @@ var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defin
55
54
  var _repeatInstanceProperty__default = /*#__PURE__*/_interopDefault(_repeatInstanceProperty);
56
55
  var _Set__default = /*#__PURE__*/_interopDefault(_Set);
57
56
  var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
57
+ var _bindInstanceProperty__default = /*#__PURE__*/_interopDefault(_bindInstanceProperty);
58
58
  var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
59
59
  var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
60
60
 
61
61
  function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
62
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context21, _context22; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context21 = ownKeys(Object(t), !0)).call(_context21, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context22 = ownKeys(Object(t))).call(_context22, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
62
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context9, _context0; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context9 = ownKeys(Object(t), !0)).call(_context9, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context0 = ownKeys(Object(t))).call(_context0, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
63
63
 
64
64
  // Since not all terminal supports colors, to make things more consistent for testing purposes,
65
65
  // during tests the color used is appended before the string instead of coloring it.
66
66
  const isTest = process.env.NODE_ENV === 'test';
67
67
  const red = str => {
68
- if (isTest) return "<color-red>".concat(str, "</color-red>");
68
+ if (isTest) return `<color-red>${str}</color-red>`;
69
69
  return chalk__default["default"].red(str);
70
70
  };
71
71
  const green = str => {
72
- if (isTest) return "<color-green>".concat(str, "</color-green>");
72
+ if (isTest) return `<color-green>${str}</color-green>`;
73
73
  return chalk__default["default"].green(str);
74
74
  };
75
75
 
@@ -85,21 +85,19 @@ const getStringDiff = _ref => {
85
85
  _ref$indentLevel = _ref.indentLevel,
86
86
  indentLevel = _ref$indentLevel === void 0 ? 0 : _ref$indentLevel;
87
87
  if (!previousValue && nextValue) {
88
- var _context2, _context3;
89
- return _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = "".concat(indent(indentLevel))).call(_context3, label, " added: ")).call(_context2, green(nextValue));
88
+ return `${indent(indentLevel)}${label} added: ${green(nextValue)}`;
90
89
  }
91
90
  if (previousValue && !nextValue) {
92
- var _context4, _context5;
93
- return _concatInstanceProperty__default["default"](_context4 = _concatInstanceProperty__default["default"](_context5 = "".concat(indent(indentLevel))).call(_context5, label, " removed: ")).call(_context4, red(previousValue));
91
+ return `${indent(indentLevel)}${label} removed: ${red(previousValue)}`;
94
92
  }
95
93
  if (previousValue && nextValue && previousValue !== nextValue) {
96
- var _context6, _context7, _context8;
97
- return _concatInstanceProperty__default["default"](_context6 = _concatInstanceProperty__default["default"](_context7 = _concatInstanceProperty__default["default"](_context8 = "".concat(indent(indentLevel))).call(_context8, label, " changed: ")).call(_context7, red(previousValue), " => ")).call(_context6, green(nextValue));
94
+ return `${indent(indentLevel)}${label} changed: ${red(previousValue)} => ${green(nextValue)}`;
98
95
  }
99
96
  return null;
100
97
  };
101
98
  // NOTE: this assumes that the array values are scalar values (not objects).
102
99
  const getArrayDiff = _ref2 => {
100
+ var _context2, _context3;
103
101
  let previousValue = _ref2.previousValue,
104
102
  nextValue = _ref2.nextValue,
105
103
  label = _ref2.label,
@@ -107,7 +105,7 @@ const getArrayDiff = _ref2 => {
107
105
  indentLevel = _ref2$indentLevel === void 0 ? 0 : _ref2$indentLevel;
108
106
  const oldArraySet = new _Set__default["default"](previousValue);
109
107
  const arrayDiff = [];
110
- nextValue === null || nextValue === void 0 || _forEachInstanceProperty__default["default"](nextValue).call(nextValue, item => {
108
+ ((_context2 = nextValue) == null ? void 0 : _bindInstanceProperty__default["default"](_context3 = Function.call).call(_context3, _forEachInstanceProperty__default["default"](_context2), _context2))?.(item => {
111
109
  if (oldArraySet.has(item)) {
112
110
  oldArraySet.delete(item);
113
111
  } else {
@@ -128,7 +126,7 @@ const getArrayDiff = _ref2 => {
128
126
  return arrayDiff.join('\n');
129
127
  };
130
128
  const getPermissionsDiff = _ref3 => {
131
- var _context1;
129
+ var _context4;
132
130
  let previousValue = _ref3.previousValue,
133
131
  nextValue = _ref3.nextValue;
134
132
  const permissionDiff = ['permissions changed'];
@@ -141,12 +139,10 @@ const getPermissionsDiff = _ref3 => {
141
139
  }, {});
142
140
  const indentLevel = 1;
143
141
  _forEachInstanceProperty__default["default"](nextValue).call(nextValue, newPermission => {
144
- var _context9;
145
- const currentDiff = [_concatInstanceProperty__default["default"](_context9 = "".concat(indent(indentLevel), "\"")).call(_context9, newPermission.name, "\" changed")];
142
+ const currentDiff = [`${indent(indentLevel)}"${newPermission.name}" changed`];
146
143
  // if the permission name is not in the old config, it means it is a new addition.
147
144
  if (!mappedOldPermissions[newPermission.name]) {
148
- var _context0;
149
- permissionDiff.push(_concatInstanceProperty__default["default"](_context0 = "".concat(indent(indentLevel), "\"")).call(_context0, green(newPermission.name), "\" was added"));
145
+ permissionDiff.push(`${indent(indentLevel)}"${green(newPermission.name)}" was added`);
150
146
  }
151
147
 
152
148
  // if permission name is in the old config, now we check if there was a change
@@ -163,22 +159,21 @@ const getPermissionsDiff = _ref3 => {
163
159
  });
164
160
 
165
161
  // if there are old permissions left, it means they were deleted in the new Permissions.
166
- _forEachInstanceProperty__default["default"](_context1 = _Object$keys__default["default"](mappedOldPermissions)).call(_context1, oldPermissionName => {
167
- var _context10;
168
- permissionDiff.push(_concatInstanceProperty__default["default"](_context10 = "".concat(indent(indentLevel), "\"")).call(_context10, red(oldPermissionName), "\" was removed"));
162
+ _forEachInstanceProperty__default["default"](_context4 = _Object$keys__default["default"](mappedOldPermissions)).call(_context4, oldPermissionName => {
163
+ permissionDiff.push(`${indent(indentLevel)}"${red(oldPermissionName)}" was removed`);
169
164
  });
170
165
  if (permissionDiff.length > 1) return permissionDiff.join('\n');
171
166
  return null;
172
167
  };
173
168
  const getLabelAllLocalesDiff = _ref5 => {
174
- var _context14;
169
+ var _context5;
175
170
  let _ref5$previousValue = _ref5.previousValue,
176
171
  previousValue = _ref5$previousValue === void 0 ? [] : _ref5$previousValue,
177
172
  _ref5$nextValue = _ref5.nextValue,
178
173
  nextValue = _ref5$nextValue === void 0 ? [] : _ref5$nextValue,
179
174
  _ref5$indentLevel = _ref5.indentLevel,
180
175
  indentLevel = _ref5$indentLevel === void 0 ? 0 : _ref5$indentLevel;
181
- const labelAllLocalesDiff = ["".concat(indent(indentLevel - 1), "labelAllLocales changed")];
176
+ const labelAllLocalesDiff = [`${indent(indentLevel - 1)}labelAllLocales changed`];
182
177
  const mappedOldLabelAllLocales = _reduceInstanceProperty__default["default"](previousValue).call(previousValue, (previousLabelAllLocale, _ref6) => {
183
178
  let locale = _ref6.locale,
184
179
  value = _ref6.value;
@@ -190,8 +185,7 @@ const getLabelAllLocalesDiff = _ref5 => {
190
185
  if (newLabelAllLocale.locale in mappedOldLabelAllLocales) {
191
186
  const oldLocaleValue = mappedOldLabelAllLocales[newLabelAllLocale.locale];
192
187
  if (oldLocaleValue !== newLabelAllLocale.value) {
193
- var _context11, _context12, _context13;
194
- labelAllLocalesDiff.push(_concatInstanceProperty__default["default"](_context11 = _concatInstanceProperty__default["default"](_context12 = _concatInstanceProperty__default["default"](_context13 = "".concat(indent(indentLevel), "locale \"")).call(_context13, newLabelAllLocale.locale, "\" changed: ")).call(_context12, red(oldLocaleValue), " => ")).call(_context11, green(newLabelAllLocale.value)));
188
+ labelAllLocalesDiff.push(`${indent(indentLevel)}locale "${newLabelAllLocale.locale}" changed: ${red(oldLocaleValue)} => ${green(newLabelAllLocale.value)}`);
195
189
  }
196
190
  delete mappedOldLabelAllLocales[newLabelAllLocale.locale];
197
191
  } else {
@@ -205,7 +199,7 @@ const getLabelAllLocalesDiff = _ref5 => {
205
199
  }
206
200
  }
207
201
  });
208
- _forEachInstanceProperty__default["default"](_context14 = _Object$keys__default["default"](mappedOldLabelAllLocales)).call(_context14, key => {
202
+ _forEachInstanceProperty__default["default"](_context5 = _Object$keys__default["default"](mappedOldLabelAllLocales)).call(_context5, key => {
209
203
  const localeDiff = getStringDiff({
210
204
  previousValue: key,
211
205
  label: 'locale',
@@ -219,14 +213,14 @@ const getLabelAllLocalesDiff = _ref5 => {
219
213
  return null;
220
214
  };
221
215
  const getTypeSettingsDiff = _ref7 => {
222
- var _context15;
216
+ var _context6;
223
217
  let previousValue = _ref7.previousValue,
224
218
  nextValue = _ref7.nextValue;
225
219
  const nonNullablePreviousValue = previousValue || {};
226
220
  const nonNullableNextValue = nextValue || {};
227
221
  const indentLevel = 1;
228
- const typeSettingsDiff = ["".concat(indent(indentLevel - 1), "type settings changed")];
229
- _forEachInstanceProperty__default["default"](_context15 = _Object$keys__default["default"](nonNullablePreviousValue)).call(_context15, key => {
222
+ const typeSettingsDiff = [`${indent(indentLevel - 1)}type settings changed`];
223
+ _forEachInstanceProperty__default["default"](_context6 = _Object$keys__default["default"](nonNullablePreviousValue)).call(_context6, key => {
230
224
  const typeSettingDiff = getStringDiff({
231
225
  previousValue: nonNullablePreviousValue[key],
232
226
  nextValue: nonNullableNextValue[key],
@@ -276,7 +270,7 @@ const getMainMenuLinkDiff = _ref9 => {
276
270
  indentLevel: 2
277
271
  });
278
272
  if (mainMenuLinkPermissionsDiff.length > 0) {
279
- mainMenuLinkDiff.push("".concat(indent(1), "permissions changed"));
273
+ mainMenuLinkDiff.push(`${indent(1)}permissions changed`);
280
274
  mainMenuLinkDiff.push(mainMenuLinkPermissionsDiff);
281
275
  }
282
276
  const menuLabelsDiff = getLabelAllLocalesDiff({
@@ -292,7 +286,7 @@ const getMainMenuLinkDiff = _ref9 => {
292
286
  return null;
293
287
  };
294
288
  const getSubmenuLinksDiff = _ref0 => {
295
- var _context20;
289
+ var _context8;
296
290
  let previousValue = _ref0.previousValue,
297
291
  nextValue = _ref0.nextValue;
298
292
  const submenuLinksDiff = ['submenuLink changed'];
@@ -303,17 +297,16 @@ const getSubmenuLinksDiff = _ref0 => {
303
297
  const previousOrder = getOrder(previousValue);
304
298
  const newOrder = getOrder(nextValue);
305
299
  if (previousOrder !== newOrder) {
306
- var _context16, _context17;
307
- submenuLinksDiff.push("".concat(indent(1), "submenu order changed"));
308
- submenuLinksDiff.push(_concatInstanceProperty__default["default"](_context16 = "".concat(indent(2), "previous order: [")).call(_context16, previousOrder, "]"));
309
- submenuLinksDiff.push(_concatInstanceProperty__default["default"](_context17 = "".concat(indent(2), "new order: [")).call(_context17, newOrder, "]"));
300
+ submenuLinksDiff.push(`${indent(1)}submenu order changed`);
301
+ submenuLinksDiff.push(`${indent(2)}previous order: [${previousOrder}]`);
302
+ submenuLinksDiff.push(`${indent(2)}new order: [${newOrder}]`);
310
303
  }
311
304
  _forEachInstanceProperty__default["default"](nextValue).call(nextValue, newSubmenuLink => {
312
305
  const oldSubMenuLink = mappedSubmenuLinks[newSubmenuLink.uriPath];
313
306
  if (newSubmenuLink.uriPath in mappedSubmenuLinks) {
314
- var _context18, _context19;
315
- const submenuLinkDiff = [_concatInstanceProperty__default["default"](_context18 = "".concat(indent(1), "menu link \"")).call(_context18, newSubmenuLink.uriPath, "\" changed")];
316
- _forEachInstanceProperty__default["default"](_context19 = _Object$keys__default["default"](mappedSubmenuLinks[newSubmenuLink.uriPath])).call(_context19, key => {
307
+ var _context7;
308
+ const submenuLinkDiff = [`${indent(1)}menu link "${newSubmenuLink.uriPath}" changed`];
309
+ _forEachInstanceProperty__default["default"](_context7 = _Object$keys__default["default"](mappedSubmenuLinks[newSubmenuLink.uriPath])).call(_context7, key => {
317
310
  switch (key) {
318
311
  case 'defaultLabel':
319
312
  {
@@ -337,7 +330,7 @@ const getSubmenuLinksDiff = _ref0 => {
337
330
  indentLevel: 3
338
331
  });
339
332
  if (submenuLinkPermissionsDiff.length > 0) {
340
- submenuLinkDiff.push("".concat(indent(2), "permissions changed"));
333
+ submenuLinkDiff.push(`${indent(2)}permissions changed`);
341
334
  submenuLinkDiff.push(submenuLinkPermissionsDiff);
342
335
  }
343
336
  break;
@@ -372,7 +365,7 @@ const getSubmenuLinksDiff = _ref0 => {
372
365
  }
373
366
  }
374
367
  });
375
- _forEachInstanceProperty__default["default"](_context20 = _Object$keys__default["default"](mappedSubmenuLinks)).call(_context20, key => {
368
+ _forEachInstanceProperty__default["default"](_context8 = _Object$keys__default["default"](mappedSubmenuLinks)).call(_context8, key => {
376
369
  const linksDiff = getStringDiff({
377
370
  previousValue: key,
378
371
  label: 'menu link',
@@ -547,18 +540,17 @@ const getCustomViewConfigDiff = (oldConfig, newConfig) => {
547
540
 
548
541
  const credentialsStorage = new credentialsStorage$1.CredentialsStorage();
549
542
  const getMcUrlLink = _ref => {
550
- var _context, _context2, _context3;
551
543
  let mcApiUrl = _ref.mcApiUrl,
552
544
  organizationId = _ref.organizationId,
553
545
  customEntityId = _ref.customEntityId,
554
546
  isCustomView = _ref.isCustomView;
555
547
  const mcUrl = mcApiUrl.replace('mc-api', 'mc');
556
- const customEntityLink = _concatInstanceProperty__default["default"](_context = _concatInstanceProperty__default["default"](_context2 = _concatInstanceProperty__default["default"](_context3 = "".concat(mcUrl, "/account/organizations/")).call(_context3, organizationId, "/custom-")).call(_context2, isCustomView ? 'views' : 'applications', "/owned/")).call(_context, customEntityId);
548
+ const customEntityLink = `${mcUrl}/account/organizations/${organizationId}/custom-${isCustomView ? 'views' : 'applications'}/owned/${customEntityId}`;
557
549
  return customEntityLink;
558
550
  };
559
551
  const isCustomViewData = data => data.entryPointUriPath === undefined;
560
552
  async function createOrUpdateCustomApplication(_ref2) {
561
- var _context6;
553
+ var _context3;
562
554
  let mcApiUrl = _ref2.mcApiUrl,
563
555
  localCustomEntityData = _ref2.localCustomEntityData,
564
556
  applicationIdentifier = _ref2.applicationIdentifier,
@@ -569,14 +561,14 @@ async function createOrUpdateCustomApplication(_ref2) {
569
561
  applicationIdentifier
570
562
  });
571
563
  if (!fetchedCustomApplication) {
572
- var _context5;
564
+ var _context2;
573
565
  const userOrganizations = await graphqlRequests.fetchUserOrganizations({
574
566
  mcApiUrl,
575
567
  applicationIdentifier
576
568
  });
577
569
  let organizationId, organizationName;
578
570
  if (userOrganizations.total === 0) {
579
- throw new Error("It seems you are not an admin of any Organization. Please make sure to be part of the Administrators team of the Organization you want the Custom Application to be configured to.");
571
+ throw new Error(`It seems you are not an admin of any Organization. Please make sure to be part of the Administrators team of the Organization you want the Custom Application to be configured to.`);
580
572
  }
581
573
  if (userOrganizations.total === 1) {
582
574
  const _userOrganizations$re = _slicedToArray(userOrganizations.results, 1),
@@ -584,8 +576,8 @@ async function createOrUpdateCustomApplication(_ref2) {
584
576
  organizationId = organization.id;
585
577
  organizationName = organization.name;
586
578
  } else {
587
- var _context4;
588
- const organizationChoices = _mapInstanceProperty__default["default"](_context4 = userOrganizations.results).call(_context4, organization => ({
579
+ var _context;
580
+ const organizationChoices = _mapInstanceProperty__default["default"](_context = userOrganizations.results).call(_context, organization => ({
589
581
  title: organization.name,
590
582
  value: organization.id
591
583
  }));
@@ -598,7 +590,7 @@ async function createOrUpdateCustomApplication(_ref2) {
598
590
  }),
599
591
  selectedOrganizationId = _await$prompts.organizationId;
600
592
  if (!selectedOrganizationId) {
601
- throw new Error("No Organization selected, aborting.");
593
+ throw new Error(`No Organization selected, aborting.`);
602
594
  }
603
595
  organizationId = selectedOrganizationId;
604
596
  organizationName = _findInstanceProperty__default["default"](organizationChoices).call(organizationChoices, _ref3 => {
@@ -609,7 +601,7 @@ async function createOrUpdateCustomApplication(_ref2) {
609
601
  const _await$prompts2 = await prompts__default["default"]({
610
602
  type: 'text',
611
603
  name: 'confirmation',
612
- message: _filterInstanceProperty__default["default"](_context5 = ["You are about to create a new Custom Application in the \"".concat(chalk__default["default"].green(organizationName), "\" organization. Are you sure you want to proceed?"), options.dryRun && chalk__default["default"].gray('Using "--dry-run", no data will be created.')]).call(_context5, Boolean).join('\n'),
604
+ message: _filterInstanceProperty__default["default"](_context2 = [`You are about to create a new Custom Application in the "${chalk__default["default"].green(organizationName)}" organization. Are you sure you want to proceed?`, options.dryRun && chalk__default["default"].gray('Using "--dry-run", no data will be created.')]).call(_context2, Boolean).join('\n'),
613
605
  initial: 'yes'
614
606
  }),
615
607
  confirmation = _await$prompts2.confirmation;
@@ -620,7 +612,7 @@ async function createOrUpdateCustomApplication(_ref2) {
620
612
  const data = omit__default["default"](localCustomEntityData, ['id']);
621
613
  if (options.dryRun) {
622
614
  console.log();
623
- console.log("The following payload would be used to create a new Custom Application.");
615
+ console.log(`The following payload would be used to create a new Custom Application.`);
624
616
  console.log();
625
617
  console.log(chalk__default["default"].gray(_JSON$stringify__default["default"](data, null, 2)));
626
618
  return;
@@ -644,8 +636,8 @@ async function createOrUpdateCustomApplication(_ref2) {
644
636
  organizationId,
645
637
  customEntityId: createdCustomApplication.id
646
638
  });
647
- console.log(chalk__default["default"].green("Custom Application created.\nPlease update the \"env.production.applicationId\" field in your local Custom Application config file with the following value: \"".concat(chalk__default["default"].green(createdCustomApplication.id), "\".")));
648
- console.log("You can inspect the Custom Application data in the Merchant Center at \"".concat(chalk__default["default"].gray(customAppLink), "\"."));
639
+ console.log(chalk__default["default"].green(`Custom Application created.\nPlease update the "env.production.applicationId" field in your local Custom Application config file with the following value: "${chalk__default["default"].green(createdCustomApplication.id)}".`));
640
+ console.log(`You can inspect the Custom Application data in the Merchant Center at "${chalk__default["default"].gray(customAppLink)}".`);
649
641
  return;
650
642
  }
651
643
  const customAppLink = getMcUrlLink({
@@ -655,8 +647,8 @@ async function createOrUpdateCustomApplication(_ref2) {
655
647
  });
656
648
  const configDiff = getCustomApplicationConfigDiff(fetchedCustomApplication.application, localCustomEntityData);
657
649
  if (!configDiff) {
658
- console.log(chalk__default["default"].green("Custom Application up-to-date."));
659
- console.log("You can inspect the Custom Application data in the Merchant Center at \"".concat(chalk__default["default"].gray(customAppLink), "\"."));
650
+ console.log(chalk__default["default"].green(`Custom Application up-to-date.`));
651
+ console.log(`You can inspect the Custom Application data in the Merchant Center at "${chalk__default["default"].gray(customAppLink)}".`);
660
652
  return;
661
653
  }
662
654
  console.log('Changes detected:');
@@ -665,7 +657,7 @@ async function createOrUpdateCustomApplication(_ref2) {
665
657
  const _await$prompts3 = await prompts__default["default"]({
666
658
  type: 'text',
667
659
  name: 'confirmation',
668
- message: _filterInstanceProperty__default["default"](_context6 = ["You are about to update the Custom Application \"".concat(chalk__default["default"].green(localCustomEntityData.entryPointUriPath), "\" with the changes above. Are you sure you want to proceed?"), options.dryRun && chalk__default["default"].gray('Using "--dry-run", no data will be updated.')]).call(_context6, Boolean).join('\n'),
660
+ message: _filterInstanceProperty__default["default"](_context3 = [`You are about to update the Custom Application "${chalk__default["default"].green(localCustomEntityData.entryPointUriPath)}" with the changes above. Are you sure you want to proceed?`, options.dryRun && chalk__default["default"].gray('Using "--dry-run", no data will be updated.')]).call(_context3, Boolean).join('\n'),
669
661
  initial: 'yes'
670
662
  }),
671
663
  confirmation = _await$prompts3.confirmation;
@@ -676,7 +668,7 @@ async function createOrUpdateCustomApplication(_ref2) {
676
668
  const data = omit__default["default"](localCustomEntityData, ['id']);
677
669
  if (options.dryRun) {
678
670
  console.log();
679
- console.log("The following payload would be used to update the Custom Application \"".concat(chalk__default["default"].green(data.entryPointUriPath), "\"."));
671
+ console.log(`The following payload would be used to update the Custom Application "${chalk__default["default"].green(data.entryPointUriPath)}".`);
680
672
  console.log();
681
673
  console.log(chalk__default["default"].gray(_JSON$stringify__default["default"](data, null, 2)));
682
674
  return;
@@ -688,11 +680,11 @@ async function createOrUpdateCustomApplication(_ref2) {
688
680
  applicationId: fetchedCustomApplication.application.id,
689
681
  applicationIdentifier
690
682
  });
691
- console.log(chalk__default["default"].green("Custom Application updated."));
692
- console.log("You can inspect the Custom Application data in the Merchant Center at \"".concat(chalk__default["default"].gray(customAppLink), "\"."));
683
+ console.log(chalk__default["default"].green(`Custom Application updated.`));
684
+ console.log(`You can inspect the Custom Application data in the Merchant Center at "${chalk__default["default"].gray(customAppLink)}".`);
693
685
  }
694
686
  async function createOrUpdateCustomView(_ref4) {
695
- var _fetchedCustomView$cu, _context9, _fetchedCustomView$cu2;
687
+ var _context6;
696
688
  let mcApiUrl = _ref4.mcApiUrl,
697
689
  localCustomEntityData = _ref4.localCustomEntityData,
698
690
  customViewId = _ref4.customViewId,
@@ -704,7 +696,7 @@ async function createOrUpdateCustomView(_ref4) {
704
696
  applicationIdentifier
705
697
  });
706
698
  if (!fetchedCustomView) {
707
- var _context8;
699
+ var _context5;
708
700
  const userOrganizations = await graphqlRequests.fetchUserOrganizations({
709
701
  mcApiUrl,
710
702
  customViewId,
@@ -712,7 +704,7 @@ async function createOrUpdateCustomView(_ref4) {
712
704
  });
713
705
  let organizationId, organizationName;
714
706
  if (userOrganizations.total === 0) {
715
- throw new Error("It seems you are not an admin of any Organization. Please make sure to be part of the Administrators team of the Organization you want the Custom View to be configured to.");
707
+ throw new Error(`It seems you are not an admin of any Organization. Please make sure to be part of the Administrators team of the Organization you want the Custom View to be configured to.`);
716
708
  }
717
709
  if (userOrganizations.total === 1) {
718
710
  const _userOrganizations$re2 = _slicedToArray(userOrganizations.results, 1),
@@ -720,8 +712,8 @@ async function createOrUpdateCustomView(_ref4) {
720
712
  organizationId = organization.id;
721
713
  organizationName = organization.name;
722
714
  } else {
723
- var _context7;
724
- const organizationChoices = _mapInstanceProperty__default["default"](_context7 = userOrganizations.results).call(_context7, organization => ({
715
+ var _context4;
716
+ const organizationChoices = _mapInstanceProperty__default["default"](_context4 = userOrganizations.results).call(_context4, organization => ({
725
717
  title: organization.name,
726
718
  value: organization.id
727
719
  }));
@@ -734,7 +726,7 @@ async function createOrUpdateCustomView(_ref4) {
734
726
  }),
735
727
  selectedOrganizationId = _await$prompts4.organizationId;
736
728
  if (!selectedOrganizationId) {
737
- throw new Error("No Organization selected, aborting.");
729
+ throw new Error(`No Organization selected, aborting.`);
738
730
  }
739
731
  organizationId = selectedOrganizationId;
740
732
  organizationName = _findInstanceProperty__default["default"](organizationChoices).call(organizationChoices, _ref5 => {
@@ -745,7 +737,7 @@ async function createOrUpdateCustomView(_ref4) {
745
737
  const _await$prompts5 = await prompts__default["default"]({
746
738
  type: 'text',
747
739
  name: 'confirmation',
748
- message: _filterInstanceProperty__default["default"](_context8 = ["You are about to create a new Custom View in the \"".concat(chalk__default["default"].green(organizationName), "\" organization. Are you sure you want to proceed?"), options.dryRun && chalk__default["default"].gray('Using "--dry-run", no data will be created.')]).call(_context8, Boolean).join('\n'),
740
+ message: _filterInstanceProperty__default["default"](_context5 = [`You are about to create a new Custom View in the "${chalk__default["default"].green(organizationName)}" organization. Are you sure you want to proceed?`, options.dryRun && chalk__default["default"].gray('Using "--dry-run", no data will be created.')]).call(_context5, Boolean).join('\n'),
749
741
  initial: 'yes'
750
742
  }),
751
743
  confirmation = _await$prompts5.confirmation;
@@ -756,7 +748,7 @@ async function createOrUpdateCustomView(_ref4) {
756
748
  const data = omit__default["default"](localCustomEntityData, ['id']);
757
749
  if (options.dryRun) {
758
750
  console.log();
759
- console.log("The following payload would be used to create a new Custom View.");
751
+ console.log(`The following payload would be used to create a new Custom View.`);
760
752
  console.log();
761
753
  console.log(chalk__default["default"].gray(_JSON$stringify__default["default"](data, null, 2)));
762
754
  return;
@@ -781,20 +773,20 @@ async function createOrUpdateCustomView(_ref4) {
781
773
  customEntityId: createdCustomView.id,
782
774
  isCustomView: true
783
775
  });
784
- console.log(chalk__default["default"].green("Custom View created.\nPlease update the \"env.production.customViewId\" field in your local Custom View config file with the following value: \"".concat(chalk__default["default"].green(createdCustomView.id), "\".")));
785
- console.log("You can inspect the Custom View data in the Merchant Center at \"".concat(chalk__default["default"].gray(customViewLink), "\"."));
776
+ console.log(chalk__default["default"].green(`Custom View created.\nPlease update the "env.production.customViewId" field in your local Custom View config file with the following value: "${chalk__default["default"].green(createdCustomView.id)}".`));
777
+ console.log(`You can inspect the Custom View data in the Merchant Center at "${chalk__default["default"].gray(customViewLink)}".`);
786
778
  return;
787
779
  }
788
780
  const customViewLink = getMcUrlLink({
789
781
  mcApiUrl,
790
782
  organizationId: fetchedCustomView.organizationId,
791
- customEntityId: (fetchedCustomView === null || fetchedCustomView === void 0 || (_fetchedCustomView$cu = fetchedCustomView.customView) === null || _fetchedCustomView$cu === void 0 ? void 0 : _fetchedCustomView$cu.id) || '',
783
+ customEntityId: fetchedCustomView?.customView?.id || '',
792
784
  isCustomView: true
793
785
  });
794
786
  const configDiff = getCustomViewConfigDiff(fetchedCustomView.customView, localCustomEntityData);
795
787
  if (!configDiff) {
796
- console.log(chalk__default["default"].green("Custom View up-to-date."));
797
- console.log("You can inspect the Custom View data in the Merchant Center at \"".concat(chalk__default["default"].gray(customViewLink), "\"."));
788
+ console.log(chalk__default["default"].green(`Custom View up-to-date.`));
789
+ console.log(`You can inspect the Custom View data in the Merchant Center at "${chalk__default["default"].gray(customViewLink)}".`);
798
790
  return;
799
791
  }
800
792
  console.log('Changes detected:');
@@ -803,7 +795,7 @@ async function createOrUpdateCustomView(_ref4) {
803
795
  const _await$prompts6 = await prompts__default["default"]({
804
796
  type: 'text',
805
797
  name: 'confirmation',
806
- message: _filterInstanceProperty__default["default"](_context9 = ["You are about to update the Custom View \"".concat(chalk__default["default"].green(localCustomEntityData.defaultLabel), "\" with the changes above. Are you sure you want to proceed?"), options.dryRun && chalk__default["default"].gray('Using "--dry-run", no data will be updated.')]).call(_context9, Boolean).join('\n'),
798
+ message: _filterInstanceProperty__default["default"](_context6 = [`You are about to update the Custom View "${chalk__default["default"].green(localCustomEntityData.defaultLabel)}" with the changes above. Are you sure you want to proceed?`, options.dryRun && chalk__default["default"].gray('Using "--dry-run", no data will be updated.')]).call(_context6, Boolean).join('\n'),
807
799
  initial: 'yes'
808
800
  }),
809
801
  confirmation = _await$prompts6.confirmation;
@@ -814,7 +806,7 @@ async function createOrUpdateCustomView(_ref4) {
814
806
  const data = omit__default["default"](localCustomEntityData, ['id']);
815
807
  if (options.dryRun) {
816
808
  console.log();
817
- console.log("The following payload would be used to update the Custom View \"".concat(chalk__default["default"].green(data.defaultLabel), "\"."));
809
+ console.log(`The following payload would be used to update the Custom View "${chalk__default["default"].green(data.defaultLabel)}".`);
818
810
  console.log();
819
811
  console.log(chalk__default["default"].gray(_JSON$stringify__default["default"](data, null, 2)));
820
812
  return;
@@ -823,11 +815,11 @@ async function createOrUpdateCustomView(_ref4) {
823
815
  mcApiUrl,
824
816
  organizationId: fetchedCustomView.organizationId,
825
817
  data: omit__default["default"](localCustomEntityData, ['id']),
826
- customViewId: (fetchedCustomView === null || fetchedCustomView === void 0 || (_fetchedCustomView$cu2 = fetchedCustomView.customView) === null || _fetchedCustomView$cu2 === void 0 ? void 0 : _fetchedCustomView$cu2.id) || '',
818
+ customViewId: fetchedCustomView?.customView?.id || '',
827
819
  applicationIdentifier
828
820
  });
829
- console.log(chalk__default["default"].green("Custom View updated."));
830
- console.log("You can inspect the Custom View data in the Merchant Center at \"".concat(chalk__default["default"].gray(customViewLink), "\"."));
821
+ console.log(chalk__default["default"].green(`Custom View updated.`));
822
+ console.log(`You can inspect the Custom View data in the Merchant Center at "${chalk__default["default"].gray(customViewLink)}".`);
831
823
  }
832
824
  async function run(options) {
833
825
  const applicationConfig$1 = await applicationConfig.processConfig();
@@ -836,11 +828,11 @@ async function run(options) {
836
828
  mcApiUrl = _applicationConfig$en.mcApiUrl,
837
829
  applicationIdentifier = _applicationConfig$en.applicationIdentifier,
838
830
  customViewId = _applicationConfig$en.customViewId;
839
- console.log("Using Merchant Center environment \"".concat(chalk__default["default"].green(mcApiUrl), "\"."));
831
+ console.log(`Using Merchant Center environment "${chalk__default["default"].green(mcApiUrl)}".`);
840
832
  console.log();
841
833
  const isSessionValid = credentialsStorage.isSessionValid(mcApiUrl);
842
834
  if (!isSessionValid) {
843
- throw new Error("You don't have a valid session. Please, run the \"mc-scripts login\" command to authenticate yourself.");
835
+ throw new Error(`You don't have a valid session. Please, run the "mc-scripts login" command to authenticate yourself.`);
844
836
  }
845
837
  if (isCustomViewData(localCustomEntityData)) {
846
838
  createOrUpdateCustomView({